@univerjs-pro/thread-comment-datasource 0.7.0-nightly.202505111606 → 0.7.0-nightly.202505131607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function _0x289b(_0xdef441,_0x5c452b){const _0x536247=_0x5362();return _0x289b=function(_0x289b50,_0x3dbebd){_0x289b50=_0x289b50-0x9e;let _0x5e1721=_0x536247[_0x289b50];return _0x5e1721;},_0x289b(_0xdef441,_0x5c452b);}const _0x4ae273=_0x289b;(function(_0x40e0d5,_0x31b299){const _0x156586=_0x289b,_0x16ff4a=_0x40e0d5();while(!![]){try{const _0x44f9ec=-parseInt(_0x156586(0xf2))/0x1*(-parseInt(_0x156586(0xf8))/0x2)+parseInt(_0x156586(0xdc))/0x3+-parseInt(_0x156586(0x101))/0x4+parseInt(_0x156586(0xe2))/0x5*(parseInt(_0x156586(0xe3))/0x6)+-parseInt(_0x156586(0x103))/0x7*(-parseInt(_0x156586(0xd1))/0x8)+parseInt(_0x156586(0xe9))/0x9+-parseInt(_0x156586(0xe5))/0xa;if(_0x44f9ec===_0x31b299)break;else _0x16ff4a['push'](_0x16ff4a['shift']());}catch(_0x412dae){_0x16ff4a['push'](_0x16ff4a['shift']());}}}(_0x5362,0x1e98f));Object['defineProperty'](exports,Symbol['toStringTag'],{'value':_0x4ae273(0xa1)});const b=require('@univerjs-pro/collaboration-client'),T=require('@univerjs-pro/license'),c=require(_0x4ae273(0x106)),j=require(_0x4ae273(0xa3)),M=require(_0x4ae273(0xc9)),w=require(_0x4ae273(0xb0)),P=require('@univerjs/network'),U=_0x4ae273(0xa7);var I=(_0x14366c=>(_0x14366c[_0x14366c[_0x4ae273(0x109)]=0x0]='OpenOrReOpen',_0x14366c[_0x14366c[_0x4ae273(0xd5)]=0x1]=_0x4ae273(0xd5),_0x14366c[_0x14366c['UNRECOGNIZED']=-0x1]=_0x4ae273(0x10b),_0x14366c))(I||{}),v=(_0x47bd2e=>(_0x47bd2e[_0x47bd2e[_0x4ae273(0xf6)]=0x0]='Unknown',_0x47bd2e[_0x47bd2e[_0x4ae273(0xeb)]=0x1]=_0x4ae273(0xeb),_0x47bd2e[_0x47bd2e[_0x4ae273(0x10a)]=0x2]=_0x4ae273(0x10a),_0x47bd2e[_0x47bd2e[_0x4ae273(0xd9)]=0x3]=_0x4ae273(0xd9),_0x47bd2e[_0x47bd2e[_0x4ae273(0x105)]=0x4]=_0x4ae273(0x105),_0x47bd2e[_0x47bd2e[_0x4ae273(0xe7)]=0x5]=_0x4ae273(0xe7),_0x47bd2e[_0x47bd2e[_0x4ae273(0x10b)]=-0x1]='UNRECOGNIZED',_0x47bd2e))(v||{});const f=_0x3d7cd3=>c[_0x4ae273(0xf7)](new Date(+_0x3d7cd3))[_0x4ae273(0xe6)](_0x4ae273(0x10d)),R=async(_0x14d822,_0x4efd3f)=>{const _0x303ef8=_0x4ae273,_0x2bd209=_0x14d822[_0x303ef8(0xbd)](c[_0x303ef8(0xa4)]),_0x2a7e8d=_0x14d822['get'](P[_0x303ef8(0xd0)]);_0x4efd3f[_0x303ef8(0xbc)](_0x22af8d=>{const _0x398a0b=_0x303ef8;_0x2bd209[_0x398a0b(0xba)](_0x22af8d)&&_0x4efd3f['delete'](_0x22af8d);}),_0x4efd3f[_0x303ef8(0xff)]&&(await _0x2a7e8d[_0x303ef8(0xbd)](_0x303ef8(0xb4),{'params':{'userIDs':[..._0x4efd3f]}}))[_0x303ef8(0xaa)][_0x303ef8(0xb7)][_0x303ef8(0xbc)](_0x3413eb=>{const _0x1451e9=_0x303ef8;_0x3413eb&&_0x2bd209[_0x1451e9(0x108)](_0x3413eb);});};var $=Object[_0x4ae273(0x9e)],E=(_0x3b3def,_0x162768,_0x372acc,_0x120bb4)=>{for(var _0x11bec5=_0x120bb4>0x1?void 0x0:_0x120bb4?$(_0x162768,_0x372acc):_0x162768,_0x58e9e0=_0x3b3def['length']-0x1,_0xa1d518;_0x58e9e0>=0x0;_0x58e9e0--)(_0xa1d518=_0x3b3def[_0x58e9e0])&&(_0x11bec5=_0xa1d518(_0x11bec5)||_0x11bec5);return _0x11bec5;},S=(_0x4cc93f,_0x5a8fcd)=>(_0x320472,_0x4dfdf9)=>_0x5a8fcd(_0x320472,_0x4dfdf9,_0x4cc93f);let p=class extends c['Disposable']{constructor(_0x5b966c,_0xbc726c,_0x17e5ab,_0x4e225b){const _0x2e1c1d=_0x4ae273;super(),this['_commentService']=_0x5b966c,this['_threadCommentModel']=_0xbc726c,this[_0x2e1c1d(0xef)]=_0x17e5ab,this[_0x2e1c1d(0xda)]=_0x4e225b,this[_0x2e1c1d(0x100)](),this[_0x2e1c1d(0x10c)]();}[_0x4ae273(0x10c)](){const _0x349348=_0x4ae273;this['disposeWithMe'](this[_0x349348(0xee)]['commentUpdate$']['pipe'](w[_0x349348(0x113)](0x10))[_0x349348(0x10e)](_0x4520d4=>{const _0x53da15=_0x349348,_0x5cd53b=new Set();_0x4520d4['forEach'](_0xcc70a5=>{const _0xed8d0f=_0x289b;switch(_0xcc70a5[_0xed8d0f(0xcc)]){case _0xed8d0f(0xdb):{const _0x1503bd=_0xcc70a5[_0xed8d0f(0xf4)][_0xed8d0f(0xb3)];_0x5cd53b[_0xed8d0f(0xdb)](_0x1503bd);break;}}}),R(this[_0x53da15(0xda)],_0x5cd53b);}));}[_0x4ae273(0x100)](){const _0x461ee1=_0x4ae273;this[_0x461ee1(0xd7)](this[_0x461ee1(0x115)]['commentUpdate$'][_0x461ee1(0x10e)](async _0x57a8a1=>{const _0x3d86cf=_0x461ee1;var _0x57cd02,_0x3da038,_0x359928,_0x39ddb7;const _0x47ce09=(_0x57cd02=this[_0x3d86cf(0xee)]['getUnit'](_0x57a8a1[_0x3d86cf(0xfc)])[_0x3d86cf(0xf0)](_0x3351f6=>_0x3351f6[_0x3d86cf(0xb9)]===_0x57a8a1['threadId']))==null?void 0x0:_0x57cd02[_0x3d86cf(0xa5)];if(!_0x47ce09)return;const {unitId:_0x287414,subUnitId:_0x17135a}=_0x47ce09;switch(_0x57a8a1[_0x3d86cf(0x111)]&&this[_0x3d86cf(0xef)][_0x3d86cf(0x108)](_0x57a8a1[_0x3d86cf(0x111)]),_0x57a8a1[_0x3d86cf(0xcc)]){case v[_0x3d86cf(0xeb)]:break;case v[_0x3d86cf(0x10a)]:{this[_0x3d86cf(0xee)][_0x3d86cf(0xfa)](_0x287414,_0x17135a,{'unitId':_0x287414,'subUnitId':_0x17135a,'ref':'','id':_0x57a8a1[_0x3d86cf(0xad)],'dT':f(+_0x57a8a1['createTimestamp']),'threadId':_0x57a8a1[_0x3d86cf(0xb9)],'personId':(_0x359928=(_0x3da038=_0x57a8a1[_0x3d86cf(0x111)])==null?void 0x0:_0x3da038['userID'])!=null?_0x359928:_0x57a8a1['userId'],'text':JSON[_0x3d86cf(0xea)](_0x57a8a1[_0x3d86cf(0xc1)]),'parentId':_0x47ce09['id']});break;}case v[_0x3d86cf(0x105)]:{const _0x163684=this[_0x3d86cf(0xee)]['getComment'](_0x287414,_0x17135a,_0x57a8a1[_0x3d86cf(0xad)]);_0x163684&&_0x163684['parentId']&&this[_0x3d86cf(0xee)]['deleteComment'](_0x287414,_0x17135a,_0x57a8a1[_0x3d86cf(0xad)]);break;}case v['Edit']:{this[_0x3d86cf(0xee)][_0x3d86cf(0xa2)](_0x287414,_0x17135a,{'commentId':_0x57a8a1[_0x3d86cf(0xad)],'text':JSON[_0x3d86cf(0xea)](_0x57a8a1[_0x3d86cf(0xc1)])});break;}case v[_0x3d86cf(0xe7)]:{const _0x260cc1=(_0x39ddb7=this['_threadCommentModel'][_0x3d86cf(0xfb)](_0x57a8a1[_0x3d86cf(0xfc)])['find'](_0x2fab45=>_0x2fab45['threadId']===_0x57a8a1[_0x3d86cf(0xb9)]))==null?void 0x0:_0x39ddb7[_0x3d86cf(0xa5)];_0x260cc1&&this[_0x3d86cf(0xee)][_0x3d86cf(0xbb)](_0x287414,_0x17135a,_0x260cc1['id'],_0x57a8a1[_0x3d86cf(0xf3)]===I[_0x3d86cf(0xd5)]);break;}}}));}};p=E([S(0x0,c[_0x4ae273(0xd4)](b['CommentService'])),S(0x1,c[_0x4ae273(0xd4)](M[_0x4ae273(0xc3)])),S(0x2,c['Inject'](c[_0x4ae273(0xa4)])),S(0x3,c[_0x4ae273(0xd4)](c[_0x4ae273(0xd2)]))],p);const q='thread-comment-data-source.config',D={};var A=Object[_0x4ae273(0x9e)],x=(_0x557b62,_0x4bb138,_0x3048f9,_0x30a09a)=>{const _0x3b5526=_0x4ae273;for(var _0x4fb52a=_0x30a09a>0x1?void 0x0:_0x30a09a?A(_0x4bb138,_0x3048f9):_0x4bb138,_0x5d35dd=_0x557b62[_0x3b5526(0xf1)]-0x1,_0x4ee223;_0x5d35dd>=0x0;_0x5d35dd--)(_0x4ee223=_0x557b62[_0x5d35dd])&&(_0x4fb52a=_0x4ee223(_0x4fb52a)||_0x4fb52a);return _0x4fb52a;},_=(_0x3f2c5a,_0x339fa4)=>(_0x562bc1,_0x4b6035)=>_0x339fa4(_0x562bc1,_0x4b6035,_0x3f2c5a);function Y(_0x599be2,_0x3d591c){const _0x517ab9=_0x4ae273,_0x32bafc=_0x599be2[_0x517ab9(0xd3)][0x0];return{..._0x3d591c,'id':_0x32bafc[_0x517ab9(0xad)],'resolved':_0x599be2[_0x517ab9(0xf3)]===0x1,'dT':f(_0x32bafc[_0x517ab9(0x114)]),'personId':_0x32bafc['userId'],'threadId':_0x32bafc[_0x517ab9(0xb9)]};}function G(_0x2eef40,_0x316c3d,_0xf244a7){const _0x6d9f25=_0x4ae273;var _0x39664e,_0xb6c3b2;if(((_0xb6c3b2=(_0x39664e=_0x2eef40==null?void 0x0:_0x2eef40['replies'])==null?void 0x0:_0x39664e[_0x6d9f25(0xf1)])!=null?_0xb6c3b2:0x0)>0x0){const _0x42cd59=(_0xee327,_0x1219e6)=>({'id':_0xee327[_0x6d9f25(0xad)],'threadId':_0xee327[_0x6d9f25(0xb9)],'dT':f(_0xee327[_0x6d9f25(0x114)]),'personId':_0xee327[_0x6d9f25(0xc5)],'resolved':_0x2eef40[_0x6d9f25(0xf3)]===I[_0x6d9f25(0xd5)],'unitId':_0x316c3d,'subUnitId':_0xf244a7,'text':JSON['parse'](_0xee327[_0x6d9f25(0xc1)]),'parentId':_0x1219e6}),_0x193094=_0x42cd59(_0x2eef40[_0x6d9f25(0xd3)][0x0]);return{..._0x193094,'children':_0x2eef40[_0x6d9f25(0xd3)][_0x6d9f25(0xec)](0x1)[_0x6d9f25(0xb8)](_0x24c438=>_0x42cd59(_0x24c438,_0x193094['id']))};}return null;}let g=class{constructor(_0x2086de,_0x6b104e,_0x563a4e,_0x36fa48){const _0x4bd995=_0x4ae273;this[_0x4bd995(0xb1)]=_0x2086de,this[_0x4bd995(0xef)]=_0x6b104e,this[_0x4bd995(0xde)]=_0x563a4e,this[_0x4bd995(0xda)]=_0x36fa48;}async['addComment'](_0x5b007b){const _0x587902=_0x4ae273;var _0x5e86f3,_0x18ea34;const {parentId:_0x1e51f3,unitId:_0x42e85b,text:_0x2daa9d,threadId:_0x5aafa4}=_0x5b007b,_0x424365=(_0x18ea34=(_0x5e86f3=_0x2daa9d[_0x587902(0xa0)])==null?void 0x0:_0x5e86f3['filter'](_0x57d348=>_0x57d348[_0x587902(0xbf)]===c[_0x587902(0xe8)]['COMMENT'])[_0x587902(0xb8)](_0x19e3d1=>_0x19e3d1['rangeId']))!=null?_0x18ea34:[],_0x37f82d=JSON[_0x587902(0xce)](_0x2daa9d),_0xf70449=(await this[_0x587902(0xde)][_0x587902(0xcf)](_0x42e85b))['getMemberID']();if(_0x1e51f3){const _0x54ce1f={'memberId':_0xf70449,'unitId':_0x42e85b,'content':_0x37f82d,'mention':_0x424365,'threadId':_0x5aafa4},_0x1107ab=(await this['_httpService'][_0x587902(0x102)](_0x587902(0xe1)+_0x42e85b+_0x587902(0xb5),{'body':_0x54ce1f}))[_0x587902(0xaa)]['reply'];return{..._0x5b007b,'id':_0x1107ab[_0x587902(0xad)],'dT':c['dayjs'](+_0x1107ab[_0x587902(0x114)])['format'](_0x587902(0x10d)),'personId':_0x1107ab['userId']};}else{const _0x1278a9={'memberId':_0xf70449,'unitId':_0x42e85b,'content':_0x37f82d,'mention':_0x424365},_0x12f60d=await this['_httpService'][_0x587902(0x102)](_0x587902(0xe1)+_0x42e85b+_0x587902(0xc6),{'body':_0x1278a9});return Y(_0x12f60d[_0x587902(0xaa)]['comment'],_0x5b007b);}}async['updateComment'](_0x443ace){const _0x553436=_0x4ae273;var _0x322648,_0x356f58;const {text:_0x435409,unitId:_0x432ce8}=_0x443ace,_0x14d13d=(_0x356f58=(_0x322648=_0x435409[_0x553436(0xa0)])==null?void 0x0:_0x322648['filter'](_0x365578=>_0x365578[_0x553436(0xbf)]===c[_0x553436(0xe8)]['COMMENT'])[_0x553436(0xb8)](_0x1cd0cd=>_0x1cd0cd[_0x553436(0xaf)]))!=null?_0x356f58:[],_0x27c085=JSON[_0x553436(0xce)](_0x435409),_0x1c57c7=_0x443ace[_0x553436(0xb9)],_0x105e15=_0x443ace['id'],_0x3c24f2={'memberId':(await this[_0x553436(0xde)]['requireSession'](_0x432ce8))[_0x553436(0xab)](),'unitId':_0x432ce8,'threadId':_0x1c57c7,'mention':_0x14d13d,'content':_0x27c085,'replyId':_0x105e15},_0x5f3a9e=await this[_0x553436(0xb1)]['post'](_0x553436(0xe1)+_0x432ce8+_0x553436(0xfe),{'body':_0x3c24f2});return!_0x5f3a9e['body'][_0x553436(0xcd)]||_0x5f3a9e[_0x553436(0xaa)][_0x553436(0xcd)][_0x553436(0xca)]===0x1;}async[_0x4ae273(0xbb)](_0x5a5145){const _0x1735f5=_0x4ae273,{unitId:_0x175ff9}=_0x5a5145,_0x5e6672=_0x5a5145[_0x1735f5(0xb9)],_0xc1d84f={'memberId':this[_0x1735f5(0xef)]['getCurrentUser']()[_0x1735f5(0xf5)],'unitId':_0x175ff9,'threadId':_0x5e6672,'solved':_0x5a5145[_0x1735f5(0xc4)]?I['Solved']:I[_0x1735f5(0x109)]},_0x4abd92=await this[_0x1735f5(0xb1)][_0x1735f5(0x102)](_0x1735f5(0xe1)+_0x175ff9+'/solved',{'body':_0xc1d84f});return!_0x4abd92[_0x1735f5(0xaa)][_0x1735f5(0xcd)]||_0x4abd92[_0x1735f5(0xaa)][_0x1735f5(0xcd)][_0x1735f5(0xca)]===0x1;}async[_0x4ae273(0xc0)](_0x1fea3a,_0x49b0a0,_0x42822f,_0x472fb3){const _0x2c59d6=_0x4ae273,_0x3edafd={'memberId':(await this[_0x2c59d6(0xde)][_0x2c59d6(0xcf)](_0x1fea3a))[_0x2c59d6(0xab)](),'threadId':_0x42822f,'replyId':_0x472fb3,'unitId':_0x1fea3a},_0x2838ce=await this['_httpService']['post'](_0x2c59d6(0xe1)+_0x1fea3a+_0x2c59d6(0x10f),{'body':_0x3edafd});return!_0x2838ce[_0x2c59d6(0xaa)][_0x2c59d6(0xcd)]||_0x2838ce[_0x2c59d6(0xaa)][_0x2c59d6(0xcd)][_0x2c59d6(0xca)]===0x1;}async[_0x4ae273(0xb2)](_0x1999ec,_0x23cca6,_0x48d901){const _0x3cbb66=_0x4ae273,_0x2e0c4d={'unitId':_0x1999ec,'threadId':_0x48d901},_0x329240=await this[_0x3cbb66(0xb1)][_0x3cbb66(0x102)]('/universer-api/comment/unit/'+_0x1999ec+'/list',{'body':_0x2e0c4d}),_0xd05bb4=_0x48d901[_0x3cbb66(0xb8)](_0x36f14e=>G(_0x329240[_0x3cbb66(0xaa)]['comments'][_0x36f14e],_0x1999ec,_0x23cca6))[_0x3cbb66(0xdd)](Boolean);return Object[_0x3cbb66(0xac)](_0x329240[_0x3cbb66(0xaa)]['users'])[_0x3cbb66(0xbc)](_0x2d1d98=>{const _0x28d078=_0x3cbb66;this[_0x28d078(0xef)]['addUser'](_0x2d1d98);}),_0xd05bb4;}[_0x4ae273(0xc7)](_0x326a1a){const _0x2e52f9=_0x4ae273;return{'id':_0x326a1a['id'],'threadId':_0x326a1a[_0x2e52f9(0xb9)],'ref':_0x326a1a[_0x2e52f9(0xf9)]};}};g=x([_(0x0,c[_0x4ae273(0xd4)](P[_0x4ae273(0xd0)])),_(0x1,c[_0x4ae273(0xd4)](c[_0x4ae273(0xa4)])),_(0x2,c['Inject'](b[_0x4ae273(0xa6)])),_(0x3,c[_0x4ae273(0xd4)](c[_0x4ae273(0xd2)]))],g);var H=Object[_0x4ae273(0x9e)],J=(_0x11affa,_0x319600,_0x56da34,_0x7e95cf)=>{for(var _0x4e4b13=_0x7e95cf>0x1?void 0x0:_0x7e95cf?H(_0x319600,_0x56da34):_0x319600,_0x5a2cdb=_0x11affa['length']-0x1,_0x7ec729;_0x5a2cdb>=0x0;_0x5a2cdb--)(_0x7ec729=_0x11affa[_0x5a2cdb])&&(_0x4e4b13=_0x7ec729(_0x4e4b13)||_0x4e4b13);return _0x4e4b13;},y=(_0x41dc77,_0x1d646a)=>(_0x3cad87,_0x22b838)=>_0x1d646a(_0x3cad87,_0x22b838,_0x41dc77);let C=class extends c[_0x4ae273(0xa8)]{constructor(_0x296d7e,_0x142f85){const _0x159b04=_0x4ae273;super(),this[_0x159b04(0x9f)]=_0x296d7e,this['_threadCommentDataSource']=_0x142f85,this['_initDataSource']();}[_0x4ae273(0x112)](){const _0x376b59=_0x4ae273;this[_0x376b59(0x9f)][_0x376b59(0xae)]=this[_0x376b59(0xcb)],this[_0x376b59(0x9f)]['syncUpdateMutationToColla']=!0x1;}};C=J([y(0x0,M[_0x4ae273(0x110)]),y(0x1,c['Inject'](g))],C);var F=Object['defineProperty'],L=Object['getOwnPropertyDescriptor'],Z=(_0x1acbc4,_0x229cd3,_0xe77459)=>_0x229cd3 in _0x1acbc4?F(_0x1acbc4,_0x229cd3,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0xe77459}):_0x1acbc4[_0x229cd3]=_0xe77459,W=(_0x374bb6,_0x2599d6,_0x8e2233,_0x41a544)=>{const _0x1d1ada=_0x4ae273;for(var _0x2207d2=_0x41a544>0x1?void 0x0:_0x41a544?L(_0x2599d6,_0x8e2233):_0x2599d6,_0x58f111=_0x374bb6[_0x1d1ada(0xf1)]-0x1,_0x2adbfa;_0x58f111>=0x0;_0x58f111--)(_0x2adbfa=_0x374bb6[_0x58f111])&&(_0x2207d2=_0x2adbfa(_0x2207d2)||_0x2207d2);return _0x2207d2;},O=(_0xf7647b,_0x41af70)=>(_0x3c0eb0,_0x4d7767)=>_0x41af70(_0x3c0eb0,_0x4d7767,_0xf7647b),N=(_0x5a611c,_0x370a00,_0x188303)=>Z(_0x5a611c,typeof _0x370a00!=_0x4ae273(0xc8)?_0x370a00+'':_0x370a00,_0x188303);function _0x5362(){const _0x3fe95b=['dataSource','rangeId','rxjs','_httpService','listComments','personId','/universer-api/user/list','/reply','UNIVER_UNKNOWN','users','map','threadId','getUser','resolveComment','forEach','get','_configService','rangeType','deleteComment','content','setConfig','ThreadCommentModel','resolved','userId','/add','saveCommentToSnapshot','symbol','@univerjs/thread-comment','code','_threadCommentDataSource','type','error','stringify','requireSession','HTTPService','177736QKiIJD','Injector','replies','Inject','Solved','_config','disposeWithMe','UniverThreadCommentUIPlugin','Edit','_injector','add','743034nsfklO','filter','_sessionService','UniverCollaborationClientPlugin','merge','/universer-api/comment/unit/','10JyIgnE','416328nQhHXD','DependentOn','6823580Febkeo','format','Solve','CustomRangeType','2181834RlBCQl','parse','Add','slice','onStarting','_threadCommentModel','_userService','find','length','1HSXRNy','solved','payload','userID','Unknown','dayjs','350722OLpUpx','ref','addComment','getUnit','unitId','UniverThreadCommentDataSourcePlugin','/edit','size','_init','252828hMPtMt','post','21mVqokA','UniverLicensePlugin','Delete','@univerjs/core','onReady','addUser','OpenOrReOpen','Reply','UNRECOGNIZED','_initUserSync','YYYY/MM/DD\x20HH:mm','subscribe','/delete','IThreadCommentDataSourceService','user','_initDataSource','bufferTime','createTimestamp','_commentService','getOwnPropertyDescriptor','_threadCommentDataSourceService','customRanges','Module','updateComment','@univerjs/thread-comment-ui','UserManagerService','root','CollaborationSessionService','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','Disposable','Plugin','body','getMemberID','values','replyId'];_0x5362=function(){return _0x3fe95b;};return _0x5362();}exports['UniverThreadCommentDataSourcePlugin']=class extends c[_0x4ae273(0xa9)]{constructor(_0x44ca0e=D,_0x2baa3f,_0x2e18f9){const _0x2c7611=_0x4ae273;super(),this[_0x2c7611(0xd6)]=_0x44ca0e,this['_injector']=_0x2baa3f,this[_0x2c7611(0xbe)]=_0x2e18f9;const {..._0x747ce5}=c[_0x2c7611(0xe0)]({},D,this[_0x2c7611(0xd6)]);this[_0x2c7611(0xbe)][_0x2c7611(0xc2)](q,_0x747ce5);}[_0x4ae273(0xed)](){const _0x51e99c=_0x4ae273;[[g],[C],[p]][_0x51e99c(0xbc)](_0x1859cc=>{const _0x3da4dc=_0x51e99c;this[_0x3da4dc(0xda)][_0x3da4dc(0xdb)](_0x1859cc);});}[_0x4ae273(0x107)](){const _0x16827e=_0x4ae273;this[_0x16827e(0xda)][_0x16827e(0xbd)](C),this[_0x16827e(0xda)][_0x16827e(0xbd)](p);}},N(exports[_0x4ae273(0xfd)],'pluginName',U),N(exports['UniverThreadCommentDataSourcePlugin'],_0x4ae273(0xcc),c['UniverInstanceType'][_0x4ae273(0xb6)]),exports[_0x4ae273(0xfd)]=W([c[_0x4ae273(0xe4)](j[_0x4ae273(0xd8)],b[_0x4ae273(0xdf)],T[_0x4ae273(0x104)]),O(0x1,c[_0x4ae273(0xd4)](c[_0x4ae273(0xd2)])),O(0x2,c['IConfigService'])],exports[_0x4ae273(0xfd)]);
|
|
1
|
+
'use strict';function _0x2c6f(){const _0x275c8a=['pipe','UserManagerService','1165098XMmDSL','_initDataSource','users','/add','/reply','/delete','getOwnPropertyDescriptor','onReady','_commentService','size','thread-comment-data-source.config','replyId','Solved','Inject','find','bufferTime','12VLrnNE','_initUserSync','post','293268IgJwaz','map','Delete','listComments','_threadCommentDataSource','replies','forEach','@univerjs-pro/collaboration-client','_httpService','filter','parse','content','length','Reply','CollaborationSessionService','IConfigService','commentUpdate$','unitId','@univerjs/thread-comment','defineProperty','DependentOn','UniverInstanceType','_sessionService','Injector','/solved','CustomRangeType','userId','YYYY/MM/DD\x20HH:mm','user','symbol','_userService','Disposable','getMemberID','type','customRanges','code','threadId','addComment','_threadCommentDataSourceService','rxjs','updateComment','stringify','toStringTag','saveCommentToSnapshot','@univerjs/network','add','get','1305140OGyfRg','reply','17991coURTN','UNRECOGNIZED','_config','CommentService','24zAeIST','5075497kXWimN','Solve','root','ref','createTimestamp','UNIVER_UNKNOWN','error','delete','dayjs','getUser','HTTPService','UniverCollaborationClientPlugin','body','IThreadCommentDataSourceService','Unknown','_init','UniverThreadCommentDataSourcePlugin','pluginName','disposeWithMe','format','requireSession','@univerjs/core','setConfig','_threadCommentModel','syncUpdateMutationToColla','/universer-api/comment/unit/','Add','@univerjs/thread-comment-ui','rangeId','solved','onStarting','addUser','3440riHWkV','14421710qQMcdW','UniverThreadCommentUIPlugin','COMMENT','subscribe','comment','OpenOrReOpen','comments','44648oJqXCW','rangeType','Edit','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','_configService','slice'];_0x2c6f=function(){return _0x275c8a;};return _0x2c6f();}const _0x52d492=_0x5cbb;(function(_0x289697,_0x29d15f){const _0x5c60fd=_0x5cbb,_0x377570=_0x289697();while(!![]){try{const _0x89b301=-parseInt(_0x5c60fd(0xe2))/0x1+parseInt(_0x5c60fd(0xf5))/0x2*(parseInt(_0x5c60fd(0x12a))/0x3)+-parseInt(_0x5c60fd(0x153))/0x4+parseInt(_0x5c60fd(0x124))/0x5*(parseInt(_0x5c60fd(0xf2))/0x6)+parseInt(_0x5c60fd(0x12b))/0x7+-parseInt(_0x5c60fd(0x14b))/0x8*(-parseInt(_0x5c60fd(0x126))/0x9)+-parseInt(_0x5c60fd(0x14c))/0xa;if(_0x89b301===_0x29d15f)break;else _0x377570['push'](_0x377570['shift']());}catch(_0x2415d4){_0x377570['push'](_0x377570['shift']());}}}(_0x2c6f,0xa175a));Object['defineProperty'](exports,Symbol[_0x52d492(0x11f)],{'value':'Module'});const b=require(_0x52d492(0xfc)),T=require('@univerjs-pro/license'),c=require(_0x52d492(0x140)),j=require(_0x52d492(0x146)),M=require(_0x52d492(0x107)),w=require(_0x52d492(0x11c)),P=require(_0x52d492(0x121)),U=_0x52d492(0xdd);var I=(_0x3c323b=>(_0x3c323b[_0x3c323b[_0x52d492(0x151)]=0x0]=_0x52d492(0x151),_0x3c323b[_0x3c323b[_0x52d492(0xee)]=0x1]=_0x52d492(0xee),_0x3c323b[_0x3c323b[_0x52d492(0x127)]=-0x1]='UNRECOGNIZED',_0x3c323b))(I||{}),v=(_0x35857a=>(_0x35857a[_0x35857a[_0x52d492(0x139)]=0x0]=_0x52d492(0x139),_0x35857a[_0x35857a[_0x52d492(0x145)]=0x1]='Add',_0x35857a[_0x35857a[_0x52d492(0x102)]=0x2]='Reply',_0x35857a[_0x35857a[_0x52d492(0xdc)]=0x3]=_0x52d492(0xdc),_0x35857a[_0x35857a['Delete']=0x4]='Delete',_0x35857a[_0x35857a[_0x52d492(0x12c)]=0x5]=_0x52d492(0x12c),_0x35857a[_0x35857a['UNRECOGNIZED']=-0x1]=_0x52d492(0x127),_0x35857a))(v||{});const f=_0x50f58a=>c[_0x52d492(0x133)](new Date(+_0x50f58a))[_0x52d492(0x13e)](_0x52d492(0x110)),R=async(_0x3e4551,_0x2e68a6)=>{const _0x456585=_0x52d492,_0x167d32=_0x3e4551[_0x456585(0x123)](c[_0x456585(0xe1)]),_0xadfbdc=_0x3e4551[_0x456585(0x123)](P[_0x456585(0x135)]);_0x2e68a6[_0x456585(0xfb)](_0x38bc84=>{const _0x10e004=_0x456585;_0x167d32[_0x10e004(0x134)](_0x38bc84)&&_0x2e68a6[_0x10e004(0x132)](_0x38bc84);}),_0x2e68a6[_0x456585(0xeb)]&&(await _0xadfbdc[_0x456585(0x123)]('/universer-api/user/list',{'params':{'userIDs':[..._0x2e68a6]}}))[_0x456585(0x137)][_0x456585(0xe4)]['forEach'](_0x3154f9=>{_0x3154f9&&_0x167d32['addUser'](_0x3154f9);});};var $=Object[_0x52d492(0xe8)],E=(_0x480dc3,_0x378425,_0x31f26d,_0x2d5ed8)=>{for(var _0x3aeaf4=_0x2d5ed8>0x1?void 0x0:_0x2d5ed8?$(_0x378425,_0x31f26d):_0x378425,_0x1b0ee1=_0x480dc3['length']-0x1,_0x262460;_0x1b0ee1>=0x0;_0x1b0ee1--)(_0x262460=_0x480dc3[_0x1b0ee1])&&(_0x3aeaf4=_0x262460(_0x3aeaf4)||_0x3aeaf4);return _0x3aeaf4;},S=(_0x206ed4,_0x24139e)=>(_0x21e656,_0x142334)=>_0x24139e(_0x21e656,_0x142334,_0x206ed4);let p=class extends c[_0x52d492(0x114)]{constructor(_0x54d593,_0x4fe6b8,_0x31c5df,_0x10c478){const _0x5bb7b5=_0x52d492;super(),this['_commentService']=_0x54d593,this[_0x5bb7b5(0x142)]=_0x4fe6b8,this['_userService']=_0x31c5df,this['_injector']=_0x10c478,this['_init'](),this['_initUserSync']();}[_0x52d492(0xf3)](){const _0x5017b7=_0x52d492;this[_0x5017b7(0x13d)](this['_threadCommentModel'][_0x5017b7(0x105)][_0x5017b7(0xe0)](w[_0x5017b7(0xf1)](0x10))[_0x5017b7(0x14f)](_0x3bf1f0=>{const _0x3f711d=_0x5017b7,_0x5b6cce=new Set();_0x3bf1f0[_0x3f711d(0xfb)](_0x4e0b13=>{const _0x3d28dd=_0x3f711d;switch(_0x4e0b13[_0x3d28dd(0x116)]){case _0x3d28dd(0x122):{const _0x3fcd40=_0x4e0b13['payload']['personId'];_0x5b6cce[_0x3d28dd(0x122)](_0x3fcd40);break;}}}),R(this['_injector'],_0x5b6cce);}));}[_0x52d492(0x13a)](){const _0x40bcda=_0x52d492;this['disposeWithMe'](this[_0x40bcda(0xea)]['commentUpdate$']['subscribe'](async _0x33d99d=>{const _0xa038a3=_0x40bcda;var _0x1a211f,_0x462cf9,_0x57fa23,_0x407767;const _0x512956=(_0x1a211f=this[_0xa038a3(0x142)]['getUnit'](_0x33d99d[_0xa038a3(0x106)])[_0xa038a3(0xf0)](_0x2c531e=>_0x2c531e['threadId']===_0x33d99d[_0xa038a3(0x119)]))==null?void 0x0:_0x1a211f[_0xa038a3(0x12d)];if(!_0x512956)return;const {unitId:_0x263c90,subUnitId:_0x3bf227}=_0x512956;switch(_0x33d99d[_0xa038a3(0x111)]&&this[_0xa038a3(0x113)][_0xa038a3(0x14a)](_0x33d99d[_0xa038a3(0x111)]),_0x33d99d[_0xa038a3(0x116)]){case v[_0xa038a3(0x145)]:break;case v['Reply']:{this[_0xa038a3(0x142)][_0xa038a3(0x11a)](_0x263c90,_0x3bf227,{'unitId':_0x263c90,'subUnitId':_0x3bf227,'ref':'','id':_0x33d99d[_0xa038a3(0xed)],'dT':f(+_0x33d99d[_0xa038a3(0x12f)]),'threadId':_0x33d99d['threadId'],'personId':(_0x57fa23=(_0x462cf9=_0x33d99d[_0xa038a3(0x111)])==null?void 0x0:_0x462cf9['userID'])!=null?_0x57fa23:_0x33d99d[_0xa038a3(0x10f)],'text':JSON[_0xa038a3(0xff)](_0x33d99d[_0xa038a3(0x100)]),'parentId':_0x512956['id']});break;}case v[_0xa038a3(0xf7)]:{const _0x25e7a1=this['_threadCommentModel']['getComment'](_0x263c90,_0x3bf227,_0x33d99d[_0xa038a3(0xed)]);_0x25e7a1&&_0x25e7a1['parentId']&&this['_threadCommentModel']['deleteComment'](_0x263c90,_0x3bf227,_0x33d99d[_0xa038a3(0xed)]);break;}case v[_0xa038a3(0xdc)]:{this['_threadCommentModel'][_0xa038a3(0x11d)](_0x263c90,_0x3bf227,{'commentId':_0x33d99d[_0xa038a3(0xed)],'text':JSON[_0xa038a3(0xff)](_0x33d99d['content'])});break;}case v['Solve']:{const _0x563983=(_0x407767=this[_0xa038a3(0x142)]['getUnit'](_0x33d99d[_0xa038a3(0x106)])[_0xa038a3(0xf0)](_0x11df3e=>_0x11df3e[_0xa038a3(0x119)]===_0x33d99d[_0xa038a3(0x119)]))==null?void 0x0:_0x407767['root'];_0x563983&&this[_0xa038a3(0x142)]['resolveComment'](_0x263c90,_0x3bf227,_0x563983['id'],_0x33d99d[_0xa038a3(0x148)]===I[_0xa038a3(0xee)]);break;}}}));}};p=E([S(0x0,c[_0x52d492(0xef)](b[_0x52d492(0x129)])),S(0x1,c[_0x52d492(0xef)](M['ThreadCommentModel'])),S(0x2,c[_0x52d492(0xef)](c['UserManagerService'])),S(0x3,c[_0x52d492(0xef)](c[_0x52d492(0x10c)]))],p);const q=_0x52d492(0xec),D={};var A=Object['getOwnPropertyDescriptor'],x=(_0xfa79dc,_0x527692,_0x4ebdfb,_0x209ca1)=>{for(var _0x210442=_0x209ca1>0x1?void 0x0:_0x209ca1?A(_0x527692,_0x4ebdfb):_0x527692,_0x346fad=_0xfa79dc['length']-0x1,_0x4a2b4d;_0x346fad>=0x0;_0x346fad--)(_0x4a2b4d=_0xfa79dc[_0x346fad])&&(_0x210442=_0x4a2b4d(_0x210442)||_0x210442);return _0x210442;},_=(_0x2e6ebc,_0x5f462e)=>(_0x5f2f53,_0x48d8d4)=>_0x5f462e(_0x5f2f53,_0x48d8d4,_0x2e6ebc);function Y(_0x5c2536,_0x544f3a){const _0x1d8907=_0x52d492,_0x4e9d9d=_0x5c2536[_0x1d8907(0xfa)][0x0];return{..._0x544f3a,'id':_0x4e9d9d[_0x1d8907(0xed)],'resolved':_0x5c2536['solved']===0x1,'dT':f(_0x4e9d9d[_0x1d8907(0x12f)]),'personId':_0x4e9d9d[_0x1d8907(0x10f)],'threadId':_0x4e9d9d[_0x1d8907(0x119)]};}function G(_0x230f90,_0x5259d5,_0x56c241){const _0x42220a=_0x52d492;var _0x4b92a9,_0x2ceb98;if(((_0x2ceb98=(_0x4b92a9=_0x230f90==null?void 0x0:_0x230f90[_0x42220a(0xfa)])==null?void 0x0:_0x4b92a9[_0x42220a(0x101)])!=null?_0x2ceb98:0x0)>0x0){const _0x32f4fb=(_0x5460ec,_0x15b6b4)=>({'id':_0x5460ec[_0x42220a(0xed)],'threadId':_0x5460ec[_0x42220a(0x119)],'dT':f(_0x5460ec[_0x42220a(0x12f)]),'personId':_0x5460ec[_0x42220a(0x10f)],'resolved':_0x230f90[_0x42220a(0x148)]===I[_0x42220a(0xee)],'unitId':_0x5259d5,'subUnitId':_0x56c241,'text':JSON[_0x42220a(0xff)](_0x5460ec[_0x42220a(0x100)]),'parentId':_0x15b6b4}),_0x549642=_0x32f4fb(_0x230f90[_0x42220a(0xfa)][0x0]);return{..._0x549642,'children':_0x230f90[_0x42220a(0xfa)][_0x42220a(0xdf)](0x1)[_0x42220a(0xf6)](_0x2f6215=>_0x32f4fb(_0x2f6215,_0x549642['id']))};}return null;}function _0x5cbb(_0x273ca0,_0x9e87c){const _0x2c6f55=_0x2c6f();return _0x5cbb=function(_0x5cbb59,_0x7ce387){_0x5cbb59=_0x5cbb59-0xdc;let _0x4bb5cb=_0x2c6f55[_0x5cbb59];return _0x4bb5cb;},_0x5cbb(_0x273ca0,_0x9e87c);}let g=class{constructor(_0x56b0b8,_0x3176e3,_0x5927e8,_0x3b23de){const _0x242b20=_0x52d492;this[_0x242b20(0xfd)]=_0x56b0b8,this['_userService']=_0x3176e3,this[_0x242b20(0x10b)]=_0x5927e8,this['_injector']=_0x3b23de;}async[_0x52d492(0x11a)](_0x4f24fa){const _0x3ee37f=_0x52d492;var _0x1a5991,_0x222131;const {parentId:_0x2b1dbb,unitId:_0x2e625d,text:_0x5538cb,threadId:_0x1699b0}=_0x4f24fa,_0x4ed9d9=(_0x222131=(_0x1a5991=_0x5538cb[_0x3ee37f(0x117)])==null?void 0x0:_0x1a5991[_0x3ee37f(0xfe)](_0x193cad=>_0x193cad['rangeType']===c[_0x3ee37f(0x10e)][_0x3ee37f(0x14e)])[_0x3ee37f(0xf6)](_0xd62db4=>_0xd62db4[_0x3ee37f(0x147)]))!=null?_0x222131:[],_0xd042b6=JSON['stringify'](_0x5538cb),_0x3b0f9b=(await this[_0x3ee37f(0x10b)][_0x3ee37f(0x13f)](_0x2e625d))[_0x3ee37f(0x115)]();if(_0x2b1dbb){const _0x1c6640={'memberId':_0x3b0f9b,'unitId':_0x2e625d,'content':_0xd042b6,'mention':_0x4ed9d9,'threadId':_0x1699b0},_0x27b720=(await this[_0x3ee37f(0xfd)][_0x3ee37f(0xf4)]('/universer-api/comment/unit/'+_0x2e625d+_0x3ee37f(0xe6),{'body':_0x1c6640}))[_0x3ee37f(0x137)][_0x3ee37f(0x125)];return{..._0x4f24fa,'id':_0x27b720['replyId'],'dT':c[_0x3ee37f(0x133)](+_0x27b720['createTimestamp'])[_0x3ee37f(0x13e)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x27b720[_0x3ee37f(0x10f)]};}else{const _0x45fde2={'memberId':_0x3b0f9b,'unitId':_0x2e625d,'content':_0xd042b6,'mention':_0x4ed9d9},_0x177768=await this[_0x3ee37f(0xfd)][_0x3ee37f(0xf4)](_0x3ee37f(0x144)+_0x2e625d+_0x3ee37f(0xe5),{'body':_0x45fde2});return Y(_0x177768['body'][_0x3ee37f(0x150)],_0x4f24fa);}}async[_0x52d492(0x11d)](_0x496874){const _0xe9378=_0x52d492;var _0x84af71,_0x218cb9;const {text:_0xd733ef,unitId:_0x553b79}=_0x496874,_0x34608b=(_0x218cb9=(_0x84af71=_0xd733ef['customRanges'])==null?void 0x0:_0x84af71['filter'](_0x3965ff=>_0x3965ff[_0xe9378(0x154)]===c[_0xe9378(0x10e)]['COMMENT'])[_0xe9378(0xf6)](_0x4365b5=>_0x4365b5['rangeId']))!=null?_0x218cb9:[],_0x180480=JSON[_0xe9378(0x11e)](_0xd733ef),_0x90c881=_0x496874[_0xe9378(0x119)],_0x2b6d9e=_0x496874['id'],_0x21b491={'memberId':(await this['_sessionService'][_0xe9378(0x13f)](_0x553b79))['getMemberID'](),'unitId':_0x553b79,'threadId':_0x90c881,'mention':_0x34608b,'content':_0x180480,'replyId':_0x2b6d9e},_0x222471=await this['_httpService']['post'](_0xe9378(0x144)+_0x553b79+'/edit',{'body':_0x21b491});return!_0x222471[_0xe9378(0x137)]['error']||_0x222471[_0xe9378(0x137)][_0xe9378(0x131)]['code']===0x1;}async['resolveComment'](_0x245a9d){const _0x1c2749=_0x52d492,{unitId:_0x3b3785}=_0x245a9d,_0x7ebe1a=_0x245a9d[_0x1c2749(0x119)],_0x17179e={'memberId':this[_0x1c2749(0x113)]['getCurrentUser']()['userID'],'unitId':_0x3b3785,'threadId':_0x7ebe1a,'solved':_0x245a9d['resolved']?I[_0x1c2749(0xee)]:I[_0x1c2749(0x151)]},_0x27c567=await this[_0x1c2749(0xfd)][_0x1c2749(0xf4)](_0x1c2749(0x144)+_0x3b3785+_0x1c2749(0x10d),{'body':_0x17179e});return!_0x27c567[_0x1c2749(0x137)][_0x1c2749(0x131)]||_0x27c567[_0x1c2749(0x137)][_0x1c2749(0x131)][_0x1c2749(0x118)]===0x1;}async['deleteComment'](_0x5d4ff0,_0x265a85,_0x26f52f,_0x5b1e79){const _0x310660=_0x52d492,_0x57baba={'memberId':(await this[_0x310660(0x10b)]['requireSession'](_0x5d4ff0))[_0x310660(0x115)](),'threadId':_0x26f52f,'replyId':_0x5b1e79,'unitId':_0x5d4ff0},_0x547379=await this[_0x310660(0xfd)][_0x310660(0xf4)](_0x310660(0x144)+_0x5d4ff0+_0x310660(0xe7),{'body':_0x57baba});return!_0x547379['body']['error']||_0x547379['body'][_0x310660(0x131)][_0x310660(0x118)]===0x1;}async[_0x52d492(0xf8)](_0x4678a3,_0xa9b060,_0x38662c){const _0x4ed5f5=_0x52d492,_0x5e896e={'unitId':_0x4678a3,'threadId':_0x38662c},_0x47168d=await this['_httpService']['post']('/universer-api/comment/unit/'+_0x4678a3+'/list',{'body':_0x5e896e}),_0x55f7a6=_0x38662c[_0x4ed5f5(0xf6)](_0x1419c2=>G(_0x47168d[_0x4ed5f5(0x137)][_0x4ed5f5(0x152)][_0x1419c2],_0x4678a3,_0xa9b060))[_0x4ed5f5(0xfe)](Boolean);return Object['values'](_0x47168d[_0x4ed5f5(0x137)][_0x4ed5f5(0xe4)])['forEach'](_0x3ea75a=>{const _0xc17e7a=_0x4ed5f5;this[_0xc17e7a(0x113)][_0xc17e7a(0x14a)](_0x3ea75a);}),_0x55f7a6;}[_0x52d492(0x120)](_0x21e1d5){const _0x2ba870=_0x52d492;return{'id':_0x21e1d5['id'],'threadId':_0x21e1d5[_0x2ba870(0x119)],'ref':_0x21e1d5[_0x2ba870(0x12e)]};}};g=x([_(0x0,c[_0x52d492(0xef)](P[_0x52d492(0x135)])),_(0x1,c[_0x52d492(0xef)](c[_0x52d492(0xe1)])),_(0x2,c[_0x52d492(0xef)](b[_0x52d492(0x103)])),_(0x3,c['Inject'](c[_0x52d492(0x10c)]))],g);var H=Object[_0x52d492(0xe8)],J=(_0x1209ae,_0x152d5d,_0x32e88b,_0x1c0f8f)=>{const _0x242148=_0x52d492;for(var _0x5c233d=_0x1c0f8f>0x1?void 0x0:_0x1c0f8f?H(_0x152d5d,_0x32e88b):_0x152d5d,_0x4a5440=_0x1209ae[_0x242148(0x101)]-0x1,_0x24738d;_0x4a5440>=0x0;_0x4a5440--)(_0x24738d=_0x1209ae[_0x4a5440])&&(_0x5c233d=_0x24738d(_0x5c233d)||_0x5c233d);return _0x5c233d;},y=(_0x17a926,_0x40c1f8)=>(_0x2916d8,_0x2d52d4)=>_0x40c1f8(_0x2916d8,_0x2d52d4,_0x17a926);let C=class extends c[_0x52d492(0x114)]{constructor(_0x5bb3e5,_0x2e2c7d){const _0x4dfa64=_0x52d492;super(),this[_0x4dfa64(0x11b)]=_0x5bb3e5,this[_0x4dfa64(0xf9)]=_0x2e2c7d,this[_0x4dfa64(0xe3)]();}['_initDataSource'](){const _0x13057c=_0x52d492;this[_0x13057c(0x11b)]['dataSource']=this[_0x13057c(0xf9)],this[_0x13057c(0x11b)][_0x13057c(0x143)]=!0x1;}};C=J([y(0x0,M[_0x52d492(0x138)]),y(0x1,c[_0x52d492(0xef)](g))],C);var F=Object[_0x52d492(0x108)],L=Object[_0x52d492(0xe8)],Z=(_0x2e9e8e,_0x1f3053,_0x135968)=>_0x1f3053 in _0x2e9e8e?F(_0x2e9e8e,_0x1f3053,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x135968}):_0x2e9e8e[_0x1f3053]=_0x135968,W=(_0x389f31,_0x3cf823,_0x5983d9,_0xf80b0d)=>{const _0x1f9a62=_0x52d492;for(var _0x463b88=_0xf80b0d>0x1?void 0x0:_0xf80b0d?L(_0x3cf823,_0x5983d9):_0x3cf823,_0x539e76=_0x389f31[_0x1f9a62(0x101)]-0x1,_0x52f355;_0x539e76>=0x0;_0x539e76--)(_0x52f355=_0x389f31[_0x539e76])&&(_0x463b88=_0x52f355(_0x463b88)||_0x463b88);return _0x463b88;},O=(_0x5970b7,_0x42492c)=>(_0xe041dc,_0x484066)=>_0x42492c(_0xe041dc,_0x484066,_0x5970b7),N=(_0x436571,_0x257778,_0x36954c)=>Z(_0x436571,typeof _0x257778!=_0x52d492(0x112)?_0x257778+'':_0x257778,_0x36954c);exports['UniverThreadCommentDataSourcePlugin']=class extends c['Plugin']{constructor(_0x3c9009=D,_0x28b657,_0x44cd1c){const _0x5bc01f=_0x52d492;super(),this[_0x5bc01f(0x128)]=_0x3c9009,this['_injector']=_0x28b657,this[_0x5bc01f(0xde)]=_0x44cd1c;const {..._0x36046e}=c['merge']({},D,this[_0x5bc01f(0x128)]);this[_0x5bc01f(0xde)][_0x5bc01f(0x141)](q,_0x36046e);}[_0x52d492(0x149)](){const _0x3bd074=_0x52d492;[[g],[C],[p]][_0x3bd074(0xfb)](_0x17ac63=>{const _0x58ee54=_0x3bd074;this['_injector'][_0x58ee54(0x122)](_0x17ac63);});}[_0x52d492(0xe9)](){const _0xc2bdf=_0x52d492;this['_injector'][_0xc2bdf(0x123)](C),this['_injector']['get'](p);}},N(exports[_0x52d492(0x13b)],_0x52d492(0x13c),U),N(exports[_0x52d492(0x13b)],_0x52d492(0x116),c[_0x52d492(0x10a)][_0x52d492(0x130)]),exports['UniverThreadCommentDataSourcePlugin']=W([c[_0x52d492(0x109)](j[_0x52d492(0x14d)],b[_0x52d492(0x136)],T['UniverLicensePlugin']),O(0x1,c[_0x52d492(0xef)](c['Injector'])),O(0x2,c[_0x52d492(0x104)])],exports[_0x52d492(0x13b)]);
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2069b1=_0x43de;(function(_0x380a17,_0x180abc){const _0x512c22=_0x43de,_0xf23808=_0x380a17();while(!![]){try{const _0x23b653=-parseInt(_0x512c22(0x202))/0x1*(-parseInt(_0x512c22(0x211))/0x2)+parseInt(_0x512c22(0x212))/0x3*(parseInt(_0x512c22(0x1f7))/0x4)+parseInt(_0x512c22(0x204))/0x5*(-parseInt(_0x512c22(0x235))/0x6)+-parseInt(_0x512c22(0x20f))/0x7+parseInt(_0x512c22(0x231))/0x8*(-parseInt(_0x512c22(0x1ed))/0x9)+-parseInt(_0x512c22(0x1f1))/0xa+parseInt(_0x512c22(0x249))/0xb;if(_0x23b653===_0x180abc)break;else _0xf23808['push'](_0xf23808['shift']());}catch(_0x4008b3){_0xf23808['push'](_0xf23808['shift']());}}}(_0x5a9a,0xc9b63));import{CommentService as _0x13b92b,CollaborationSessionService as _0x497b32,UniverCollaborationClientPlugin as _0x293a48}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x177d79}from'@univerjs-pro/license';import{dayjs as _0x3db8db,UserManagerService as _0x4a0daf,Inject as _0x29435d,Injector as _0x4a982a,Disposable as _0xcf5e6a,CustomRangeType as _0x20a37b,UniverInstanceType as _0x388da4,DependentOn as _0x4bdd65,IConfigService as _0x10e4b8,Plugin as _0x336457,merge as _0x29ae8d}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x40bc7d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x307483,IThreadCommentDataSourceService as _0x50d99d}from'@univerjs/thread-comment';import{bufferTime as _0x2cdc2a}from'rxjs';import{HTTPService as _0x28bbac}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2869f4=>(_0x2869f4[_0x2869f4['OpenOrReOpen']=0x0]=_0x2069b1(0x246),_0x2869f4[_0x2869f4[_0x2069b1(0x23a)]=0x1]='Solved',_0x2869f4[_0x2869f4[_0x2069b1(0x208)]=-0x1]='UNRECOGNIZED',_0x2869f4))(I||{}),v=(_0x4886b4=>(_0x4886b4[_0x4886b4[_0x2069b1(0x22a)]=0x0]=_0x2069b1(0x22a),_0x4886b4[_0x4886b4['Add']=0x1]=_0x2069b1(0x1ec),_0x4886b4[_0x4886b4[_0x2069b1(0x245)]=0x2]=_0x2069b1(0x245),_0x4886b4[_0x4886b4[_0x2069b1(0x244)]=0x3]=_0x2069b1(0x244),_0x4886b4[_0x4886b4[_0x2069b1(0x20d)]=0x4]=_0x2069b1(0x20d),_0x4886b4[_0x4886b4[_0x2069b1(0x241)]=0x5]=_0x2069b1(0x241),_0x4886b4[_0x4886b4[_0x2069b1(0x208)]=-0x1]=_0x2069b1(0x208),_0x4886b4))(v||{});const D=_0x370191=>_0x3db8db(new Date(+_0x370191))[_0x2069b1(0x210)](_0x2069b1(0x232)),B=async(_0x191f0d,_0x23776b)=>{const _0x187ad9=_0x2069b1,_0x3ecd4a=_0x191f0d[_0x187ad9(0x1f8)](_0x4a0daf),_0x478deb=_0x191f0d[_0x187ad9(0x1f8)](_0x28bbac);_0x23776b[_0x187ad9(0x206)](_0x3b836a=>{_0x3ecd4a['getUser'](_0x3b836a)&&_0x23776b['delete'](_0x3b836a);}),_0x23776b['size']&&(await _0x478deb[_0x187ad9(0x1f8)](_0x187ad9(0x1f3),{'params':{'userIDs':[..._0x23776b]}}))[_0x187ad9(0x1eb)][_0x187ad9(0x236)][_0x187ad9(0x206)](_0x2ab20f=>{const _0x28dba8=_0x187ad9;_0x2ab20f&&_0x3ecd4a[_0x28dba8(0x1fd)](_0x2ab20f);});};var K=Object[_0x2069b1(0x1f0)],V=(_0xc1efc,_0x23a962,_0x2f879a,_0x39b1b5)=>{const _0x48ea24=_0x2069b1;for(var _0x2271cc=_0x39b1b5>0x1?void 0x0:_0x39b1b5?K(_0x23a962,_0x2f879a):_0x23a962,_0x442cad=_0xc1efc[_0x48ea24(0x243)]-0x1,_0x140cdf;_0x442cad>=0x0;_0x442cad--)(_0x140cdf=_0xc1efc[_0x442cad])&&(_0x2271cc=_0x140cdf(_0x2271cc)||_0x2271cc);return _0x2271cc;},p=(_0x20cc3e,_0x213cb1)=>(_0x4562f0,_0x36ca17)=>_0x213cb1(_0x4562f0,_0x36ca17,_0x20cc3e);let S=class extends _0xcf5e6a{constructor(_0x5e4639,_0x4ad17a,_0x1df9ef,_0x43e464){const _0x592c51=_0x2069b1;super(),this[_0x592c51(0x1f2)]=_0x5e4639,this[_0x592c51(0x201)]=_0x4ad17a,this['_userService']=_0x1df9ef,this['_injector']=_0x43e464,this['_init'](),this[_0x592c51(0x217)]();}['_initUserSync'](){const _0x1bb593=_0x2069b1;this['disposeWithMe'](this[_0x1bb593(0x201)][_0x1bb593(0x21a)][_0x1bb593(0x1e6)](_0x2cdc2a(0x10))[_0x1bb593(0x242)](_0x14c196=>{const _0x5196a3=_0x1bb593,_0x1ac635=new Set();_0x14c196[_0x5196a3(0x206)](_0x5f3b47=>{const _0x8685af=_0x5196a3;switch(_0x5f3b47[_0x8685af(0x229)]){case _0x8685af(0x226):{const _0x3eb9ac=_0x5f3b47[_0x8685af(0x239)]['personId'];_0x1ac635[_0x8685af(0x226)](_0x3eb9ac);break;}}}),B(this[_0x5196a3(0x20e)],_0x1ac635);}));}['_init'](){const _0x191103=_0x2069b1;this['disposeWithMe'](this[_0x191103(0x1f2)][_0x191103(0x21a)]['subscribe'](async _0x576bff=>{const _0x54e210=_0x191103;var _0x1e86ed,_0x513627,_0x562641,_0x5c215c;const _0x3fe2bf=(_0x1e86ed=this['_threadCommentModel'][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0xc814d3=>_0xc814d3[_0x54e210(0x233)]===_0x576bff[_0x54e210(0x233)]))==null?void 0x0:_0x1e86ed[_0x54e210(0x1fb)];if(!_0x3fe2bf)return;const {unitId:_0x38e42b,subUnitId:_0x32a05e}=_0x3fe2bf;switch(_0x576bff[_0x54e210(0x22b)]&&this[_0x54e210(0x224)][_0x54e210(0x1fd)](_0x576bff['user']),_0x576bff[_0x54e210(0x229)]){case v[_0x54e210(0x1ec)]:break;case v['Reply']:{this['_threadCommentModel'][_0x54e210(0x1e8)](_0x38e42b,_0x32a05e,{'unitId':_0x38e42b,'subUnitId':_0x32a05e,'ref':'','id':_0x576bff[_0x54e210(0x23e)],'dT':D(+_0x576bff[_0x54e210(0x23c)]),'threadId':_0x576bff[_0x54e210(0x233)],'personId':(_0x562641=(_0x513627=_0x576bff[_0x54e210(0x22b)])==null?void 0x0:_0x513627[_0x54e210(0x214)])!=null?_0x562641:_0x576bff[_0x54e210(0x223)],'text':JSON[_0x54e210(0x216)](_0x576bff[_0x54e210(0x238)]),'parentId':_0x3fe2bf['id']});break;}case v[_0x54e210(0x20d)]:{const _0x15bd4d=this[_0x54e210(0x201)][_0x54e210(0x215)](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);_0x15bd4d&&_0x15bd4d[_0x54e210(0x209)]&&this[_0x54e210(0x201)]['deleteComment'](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);break;}case v[_0x54e210(0x244)]:{this[_0x54e210(0x201)][_0x54e210(0x22c)](_0x38e42b,_0x32a05e,{'commentId':_0x576bff['replyId'],'text':JSON['parse'](_0x576bff[_0x54e210(0x238)])});break;}case v['Solve']:{const _0x50c2c4=(_0x5c215c=this[_0x54e210(0x201)][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0x107d79=>_0x107d79[_0x54e210(0x233)]===_0x576bff['threadId']))==null?void 0x0:_0x5c215c[_0x54e210(0x1fb)];_0x50c2c4&&this[_0x54e210(0x201)][_0x54e210(0x1f6)](_0x38e42b,_0x32a05e,_0x50c2c4['id'],_0x576bff['solved']===I[_0x54e210(0x23a)]);break;}}}));}};function _0x5a9a(){const _0x5366f2=['commentUpdate$','replies','find','unitId','saveCommentToSnapshot','_httpService','dataSource','stringify','solved','userId','_userService','/solved','add','_configService','setConfig','type','Unknown','user','updateComment','getUnit','/edit','/reply','filter','69256DAIiqt','YYYY/MM/DD\x20HH:mm','threadId','pluginName','2082jCSCpC','users','symbol','content','payload','Solved','_threadCommentDataSource','createTimestamp','getMemberID','replyId','_sessionService','post','Solve','subscribe','length','Edit','Reply','OpenOrReOpen','rangeType','syncUpdateMutationToColla','31023069BMRycz','reply','pipe','customRanges','addComment','map','_threadCommentDataSourceService','body','Add','1629QhDmIA','onStarting','error','getOwnPropertyDescriptor','7244530jbqmzq','_commentService','/universer-api/user/list','COMMENT','values','resolveComment','36YvsnLp','get','/add','ref','root','requireSession','addUser','_config','UNIVER_UNKNOWN','comment','_threadCommentModel','424AGAVSP','listComments','10655TPPakK','rangeId','forEach','getCurrentUser','UNRECOGNIZED','parentId','code','/universer-api/comment/unit/','/delete','Delete','_injector','3187954BAQHAN','format','844drDleX','437751EsPYEn','thread-comment-data-source.config','userID','getComment','parse','_initUserSync','_initDataSource','defineProperty'];_0x5a9a=function(){return _0x5366f2;};return _0x5a9a();}function _0x43de(_0x266f57,_0xd09ba3){const _0x5a9a09=_0x5a9a();return _0x43de=function(_0x43de40,_0x5853ef){_0x43de40=_0x43de40-0x1e6;let _0x3a8bd3=_0x5a9a09[_0x43de40];return _0x3a8bd3;},_0x43de(_0x266f57,_0xd09ba3);}S=V([p(0x0,_0x29435d(_0x13b92b)),p(0x1,_0x29435d(_0x307483)),p(0x2,_0x29435d(_0x4a0daf)),p(0x3,_0x29435d(_0x4a982a))],S);const z=_0x2069b1(0x213),M={};var k=Object[_0x2069b1(0x1f0)],Q=(_0x4b650e,_0x2d1575,_0x32a1f4,_0x254d33)=>{for(var _0x4ff3c5=_0x254d33>0x1?void 0x0:_0x254d33?k(_0x2d1575,_0x32a1f4):_0x2d1575,_0xcc5436=_0x4b650e['length']-0x1,_0x3c0264;_0xcc5436>=0x0;_0xcc5436--)(_0x3c0264=_0x4b650e[_0xcc5436])&&(_0x4ff3c5=_0x3c0264(_0x4ff3c5)||_0x4ff3c5);return _0x4ff3c5;},_=(_0x2bd5f4,_0x32c032)=>(_0x28a6e4,_0x3e8e36)=>_0x32c032(_0x28a6e4,_0x3e8e36,_0x2bd5f4);function X(_0x2f4f42,_0x2b125f){const _0x51c332=_0x2069b1,_0x5056fc=_0x2f4f42[_0x51c332(0x21b)][0x0];return{..._0x2b125f,'id':_0x5056fc['replyId'],'resolved':_0x2f4f42[_0x51c332(0x222)]===0x1,'dT':D(_0x5056fc[_0x51c332(0x23c)]),'personId':_0x5056fc[_0x51c332(0x223)],'threadId':_0x5056fc[_0x51c332(0x233)]};}function ee(_0x300d9d,_0x1645fb,_0x3e6823){const _0x1e4b94=_0x2069b1;var _0x395378,_0x3d0378;if(((_0x3d0378=(_0x395378=_0x300d9d==null?void 0x0:_0x300d9d[_0x1e4b94(0x21b)])==null?void 0x0:_0x395378[_0x1e4b94(0x243)])!=null?_0x3d0378:0x0)>0x0){const _0x2be729=(_0x1fe7c3,_0x22b6aa)=>({'id':_0x1fe7c3[_0x1e4b94(0x23e)],'threadId':_0x1fe7c3['threadId'],'dT':D(_0x1fe7c3[_0x1e4b94(0x23c)]),'personId':_0x1fe7c3[_0x1e4b94(0x223)],'resolved':_0x300d9d[_0x1e4b94(0x222)]===I[_0x1e4b94(0x23a)],'unitId':_0x1645fb,'subUnitId':_0x3e6823,'text':JSON[_0x1e4b94(0x216)](_0x1fe7c3['content']),'parentId':_0x22b6aa}),_0x25549e=_0x2be729(_0x300d9d['replies'][0x0]);return{..._0x25549e,'children':_0x300d9d['replies']['slice'](0x1)[_0x1e4b94(0x1e9)](_0x42081c=>_0x2be729(_0x42081c,_0x25549e['id']))};}return null;}let f=class{constructor(_0x2973e1,_0x4c581d,_0x4112ae,_0x3c713d){const _0x4f683f=_0x2069b1;this[_0x4f683f(0x21f)]=_0x2973e1,this[_0x4f683f(0x224)]=_0x4c581d,this[_0x4f683f(0x23f)]=_0x4112ae,this['_injector']=_0x3c713d;}async[_0x2069b1(0x1e8)](_0x57ba0c){const _0xc74b=_0x2069b1;var _0x260f16,_0x3aec62;const {parentId:_0x37b97d,unitId:_0x25ebf1,text:_0x5881ae,threadId:_0x208bba}=_0x57ba0c,_0x22a188=(_0x3aec62=(_0x260f16=_0x5881ae['customRanges'])==null?void 0x0:_0x260f16['filter'](_0x4cf826=>_0x4cf826['rangeType']===_0x20a37b[_0xc74b(0x1f4)])[_0xc74b(0x1e9)](_0x4947a6=>_0x4947a6[_0xc74b(0x205)]))!=null?_0x3aec62:[],_0x53dc8e=JSON['stringify'](_0x5881ae),_0x2893aa=(await this[_0xc74b(0x23f)][_0xc74b(0x1fc)](_0x25ebf1))[_0xc74b(0x23d)]();if(_0x37b97d){const _0x447f4c={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188,'threadId':_0x208bba},_0x8537e3=(await this[_0xc74b(0x21f)][_0xc74b(0x240)](_0xc74b(0x20b)+_0x25ebf1+_0xc74b(0x22f),{'body':_0x447f4c}))[_0xc74b(0x1eb)][_0xc74b(0x24a)];return{..._0x57ba0c,'id':_0x8537e3[_0xc74b(0x23e)],'dT':_0x3db8db(+_0x8537e3['createTimestamp'])[_0xc74b(0x210)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x8537e3['userId']};}else{const _0xbaf400={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188},_0x3beb00=await this[_0xc74b(0x21f)][_0xc74b(0x240)]('/universer-api/comment/unit/'+_0x25ebf1+_0xc74b(0x1f9),{'body':_0xbaf400});return X(_0x3beb00['body'][_0xc74b(0x200)],_0x57ba0c);}}async['updateComment'](_0x33469c){const _0x2bb8dd=_0x2069b1;var _0x57cd8f,_0x326866;const {text:_0x3d2d88,unitId:_0x484fbb}=_0x33469c,_0x23435a=(_0x326866=(_0x57cd8f=_0x3d2d88[_0x2bb8dd(0x1e7)])==null?void 0x0:_0x57cd8f[_0x2bb8dd(0x230)](_0x52c847=>_0x52c847[_0x2bb8dd(0x247)]===_0x20a37b['COMMENT'])[_0x2bb8dd(0x1e9)](_0x24efd7=>_0x24efd7['rangeId']))!=null?_0x326866:[],_0x136a5a=JSON[_0x2bb8dd(0x221)](_0x3d2d88),_0x161502=_0x33469c[_0x2bb8dd(0x233)],_0x100d9b=_0x33469c['id'],_0x504d21={'memberId':(await this[_0x2bb8dd(0x23f)][_0x2bb8dd(0x1fc)](_0x484fbb))['getMemberID'](),'unitId':_0x484fbb,'threadId':_0x161502,'mention':_0x23435a,'content':_0x136a5a,'replyId':_0x100d9b},_0x54da1f=await this[_0x2bb8dd(0x21f)][_0x2bb8dd(0x240)](_0x2bb8dd(0x20b)+_0x484fbb+_0x2bb8dd(0x22e),{'body':_0x504d21});return!_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)]||_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)][_0x2bb8dd(0x20a)]===0x1;}async[_0x2069b1(0x1f6)](_0x526be0){const _0x2c8d26=_0x2069b1,{unitId:_0x3222c2}=_0x526be0,_0x4d38e0=_0x526be0[_0x2c8d26(0x233)],_0x2d0a68={'memberId':this[_0x2c8d26(0x224)][_0x2c8d26(0x207)]()[_0x2c8d26(0x214)],'unitId':_0x3222c2,'threadId':_0x4d38e0,'solved':_0x526be0['resolved']?I['Solved']:I[_0x2c8d26(0x246)]},_0x36fd32=await this['_httpService'][_0x2c8d26(0x240)](_0x2c8d26(0x20b)+_0x3222c2+_0x2c8d26(0x225),{'body':_0x2d0a68});return!_0x36fd32[_0x2c8d26(0x1eb)]['error']||_0x36fd32[_0x2c8d26(0x1eb)][_0x2c8d26(0x1ef)][_0x2c8d26(0x20a)]===0x1;}async['deleteComment'](_0x23cc3f,_0x570924,_0x20daa7,_0x2c124e){const _0x5168ef=_0x2069b1,_0x406cea={'memberId':(await this[_0x5168ef(0x23f)][_0x5168ef(0x1fc)](_0x23cc3f))[_0x5168ef(0x23d)](),'threadId':_0x20daa7,'replyId':_0x2c124e,'unitId':_0x23cc3f},_0x575c63=await this[_0x5168ef(0x21f)]['post']('/universer-api/comment/unit/'+_0x23cc3f+_0x5168ef(0x20c),{'body':_0x406cea});return!_0x575c63['body'][_0x5168ef(0x1ef)]||_0x575c63[_0x5168ef(0x1eb)][_0x5168ef(0x1ef)]['code']===0x1;}async[_0x2069b1(0x203)](_0x5bf68c,_0x1da9d9,_0x13095e){const _0x5f1305=_0x2069b1,_0x917eb7={'unitId':_0x5bf68c,'threadId':_0x13095e},_0x1de068=await this[_0x5f1305(0x21f)][_0x5f1305(0x240)](_0x5f1305(0x20b)+_0x5bf68c+'/list',{'body':_0x917eb7}),_0x58a87f=_0x13095e['map'](_0x38c997=>ee(_0x1de068[_0x5f1305(0x1eb)]['comments'][_0x38c997],_0x5bf68c,_0x1da9d9))[_0x5f1305(0x230)](Boolean);return Object[_0x5f1305(0x1f5)](_0x1de068[_0x5f1305(0x1eb)][_0x5f1305(0x236)])[_0x5f1305(0x206)](_0x1a2e90=>{const _0x29c53b=_0x5f1305;this[_0x29c53b(0x224)][_0x29c53b(0x1fd)](_0x1a2e90);}),_0x58a87f;}[_0x2069b1(0x21e)](_0x5b685d){const _0x35c709=_0x2069b1;return{'id':_0x5b685d['id'],'threadId':_0x5b685d['threadId'],'ref':_0x5b685d[_0x35c709(0x1fa)]};}};f=Q([_(0x0,_0x29435d(_0x28bbac)),_(0x1,_0x29435d(_0x4a0daf)),_(0x2,_0x29435d(_0x497b32)),_(0x3,_0x29435d(_0x4a982a))],f);var re=Object[_0x2069b1(0x1f0)],te=(_0x53a279,_0x1e8bf8,_0x5da0b2,_0x41acd3)=>{const _0x4f0473=_0x2069b1;for(var _0x402979=_0x41acd3>0x1?void 0x0:_0x41acd3?re(_0x1e8bf8,_0x5da0b2):_0x1e8bf8,_0x8614a8=_0x53a279[_0x4f0473(0x243)]-0x1,_0x3993e3;_0x8614a8>=0x0;_0x8614a8--)(_0x3993e3=_0x53a279[_0x8614a8])&&(_0x402979=_0x3993e3(_0x402979)||_0x402979);return _0x402979;},N=(_0x3edf70,_0x404ed6)=>(_0x342394,_0x2ea15a)=>_0x404ed6(_0x342394,_0x2ea15a,_0x3edf70);let g=class extends _0xcf5e6a{constructor(_0x10394d,_0x3d1afd){const _0x31a5c4=_0x2069b1;super(),this[_0x31a5c4(0x1ea)]=_0x10394d,this[_0x31a5c4(0x23b)]=_0x3d1afd,this['_initDataSource']();}[_0x2069b1(0x218)](){const _0x3ee648=_0x2069b1;this['_threadCommentDataSourceService'][_0x3ee648(0x220)]=this['_threadCommentDataSource'],this[_0x3ee648(0x1ea)][_0x3ee648(0x248)]=!0x1;}};g=te([N(0x0,_0x50d99d),N(0x1,_0x29435d(f))],g);var se=Object[_0x2069b1(0x219)],oe=Object[_0x2069b1(0x1f0)],ne=(_0x145b1f,_0x1d1939,_0x483275)=>_0x1d1939 in _0x145b1f?se(_0x145b1f,_0x1d1939,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x483275}):_0x145b1f[_0x1d1939]=_0x483275,ie=(_0x5c0722,_0x1a2999,_0x186fe8,_0x27cb6)=>{for(var _0x23c14e=_0x27cb6>0x1?void 0x0:_0x27cb6?oe(_0x1a2999,_0x186fe8):_0x1a2999,_0x3aa58f=_0x5c0722['length']-0x1,_0x296568;_0x3aa58f>=0x0;_0x3aa58f--)(_0x296568=_0x5c0722[_0x3aa58f])&&(_0x23c14e=_0x296568(_0x23c14e)||_0x23c14e);return _0x23c14e;},w=(_0x9c69e8,_0x3e5640)=>(_0x5c9264,_0x5b91d0)=>_0x3e5640(_0x5c9264,_0x5b91d0,_0x9c69e8),$=(_0x1188fa,_0xecfa3c,_0x3f0e32)=>ne(_0x1188fa,typeof _0xecfa3c!=_0x2069b1(0x237)?_0xecfa3c+'':_0xecfa3c,_0x3f0e32);let b=class extends _0x336457{constructor(_0x5b7b71=M,_0x54a116,_0x232ede){const _0x4a7efd=_0x2069b1;super(),this[_0x4a7efd(0x1fe)]=_0x5b7b71,this['_injector']=_0x54a116,this[_0x4a7efd(0x227)]=_0x232ede;const {..._0x55939b}=_0x29ae8d({},M,this[_0x4a7efd(0x1fe)]);this[_0x4a7efd(0x227)][_0x4a7efd(0x228)](z,_0x55939b);}[_0x2069b1(0x1ee)](){[[f],[g],[S]]['forEach'](_0x53b308=>{const _0x125688=_0x43de;this[_0x125688(0x20e)]['add'](_0x53b308);});}['onReady'](){const _0x828de8=_0x2069b1;this['_injector'][_0x828de8(0x1f8)](g),this[_0x828de8(0x20e)][_0x828de8(0x1f8)](S);}};$(b,_0x2069b1(0x234),W),$(b,_0x2069b1(0x229),_0x388da4[_0x2069b1(0x1ff)]),b=ie([_0x4bdd65(_0x40bc7d,_0x293a48,_0x177d79),w(0x1,_0x29435d(_0x4a982a)),w(0x2,_0x10e4b8)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x297170=_0x31ac;(function(_0xc07465,_0x3389ea){const _0x20f3da=_0x31ac,_0x426425=_0xc07465();while(!![]){try{const _0x8681e=parseInt(_0x20f3da(0x107))/0x1*(parseInt(_0x20f3da(0x11f))/0x2)+parseInt(_0x20f3da(0x14a))/0x3*(parseInt(_0x20f3da(0x11e))/0x4)+-parseInt(_0x20f3da(0x135))/0x5*(parseInt(_0x20f3da(0x101))/0x6)+-parseInt(_0x20f3da(0x157))/0x7+-parseInt(_0x20f3da(0x11b))/0x8+-parseInt(_0x20f3da(0x129))/0x9+parseInt(_0x20f3da(0xfd))/0xa;if(_0x8681e===_0x3389ea)break;else _0x426425['push'](_0x426425['shift']());}catch(_0x15324e){_0x426425['push'](_0x426425['shift']());}}}(_0x8653,0x428f0));import{CommentService as _0x402890,CollaborationSessionService as _0x288d12,UniverCollaborationClientPlugin as _0x32f6c5}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x3729ac}from'@univerjs-pro/license';import{dayjs as _0x14c484,UserManagerService as _0x95a105,Inject as _0x3ff32b,Injector as _0x47bae4,Disposable as _0x5963a4,CustomRangeType as _0x9ed84b,UniverInstanceType as _0x2678d6,DependentOn as _0x557d35,IConfigService as _0x309048,Plugin as _0x341216,merge as _0x2c3e44}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x16c7d9}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x47dbdb,IThreadCommentDataSourceService as _0x373199}from'@univerjs/thread-comment';import{bufferTime as _0x2cb961}from'rxjs';import{HTTPService as _0x48d5dd}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x3518fa=>(_0x3518fa[_0x3518fa[_0x297170(0x106)]=0x0]=_0x297170(0x106),_0x3518fa[_0x3518fa[_0x297170(0x110)]=0x1]=_0x297170(0x110),_0x3518fa[_0x3518fa[_0x297170(0x134)]=-0x1]=_0x297170(0x134),_0x3518fa))(I||{}),v=(_0x5883e3=>(_0x5883e3[_0x5883e3[_0x297170(0x158)]=0x0]='Unknown',_0x5883e3[_0x5883e3['Add']=0x1]='Add',_0x5883e3[_0x5883e3[_0x297170(0x144)]=0x2]='Reply',_0x5883e3[_0x5883e3[_0x297170(0x124)]=0x3]=_0x297170(0x124),_0x5883e3[_0x5883e3['Delete']=0x4]='Delete',_0x5883e3[_0x5883e3[_0x297170(0x12c)]=0x5]='Solve',_0x5883e3[_0x5883e3[_0x297170(0x134)]=-0x1]='UNRECOGNIZED',_0x5883e3))(v||{});const D=_0x7b9742=>_0x14c484(new Date(+_0x7b9742))[_0x297170(0x156)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x1a4b51,_0x3f5962)=>{const _0x39f0cb=_0x297170,_0x4cb4c2=_0x1a4b51[_0x39f0cb(0x12d)](_0x95a105),_0x30f6f9=_0x1a4b51[_0x39f0cb(0x12d)](_0x48d5dd);_0x3f5962[_0x39f0cb(0x13a)](_0x21e445=>{const _0x17298d=_0x39f0cb;_0x4cb4c2[_0x17298d(0xfa)](_0x21e445)&&_0x3f5962[_0x17298d(0x100)](_0x21e445);}),_0x3f5962[_0x39f0cb(0x126)]&&(await _0x30f6f9[_0x39f0cb(0x12d)](_0x39f0cb(0x10c),{'params':{'userIDs':[..._0x3f5962]}}))['body'][_0x39f0cb(0x108)]['forEach'](_0x4b56e7=>{const _0x406ffb=_0x39f0cb;_0x4b56e7&&_0x4cb4c2[_0x406ffb(0x10b)](_0x4b56e7);});};var K=Object[_0x297170(0x141)],V=(_0xc97fb3,_0x126c51,_0x1e6d93,_0x3c4003)=>{const _0x3de073=_0x297170;for(var _0x4fea08=_0x3c4003>0x1?void 0x0:_0x3c4003?K(_0x126c51,_0x1e6d93):_0x126c51,_0x1e3d37=_0xc97fb3[_0x3de073(0x121)]-0x1,_0x461261;_0x1e3d37>=0x0;_0x1e3d37--)(_0x461261=_0xc97fb3[_0x1e3d37])&&(_0x4fea08=_0x461261(_0x4fea08)||_0x4fea08);return _0x4fea08;},p=(_0x31e203,_0x3d4932)=>(_0x3e528a,_0xf3a76)=>_0x3d4932(_0x3e528a,_0xf3a76,_0x31e203);let S=class extends _0x5963a4{constructor(_0x16e23e,_0x34eca4,_0x407fbd,_0x3c0d92){const _0x44c808=_0x297170;super(),this[_0x44c808(0x13e)]=_0x16e23e,this['_threadCommentModel']=_0x34eca4,this[_0x44c808(0x12a)]=_0x407fbd,this[_0x44c808(0x10a)]=_0x3c0d92,this[_0x44c808(0x13d)](),this[_0x44c808(0x133)]();}['_initUserSync'](){const _0x20d196=_0x297170;this['disposeWithMe'](this[_0x20d196(0x120)][_0x20d196(0x109)]['pipe'](_0x2cb961(0x10))[_0x20d196(0x131)](_0x147f5c=>{const _0x4e198f=_0x20d196,_0x56af3c=new Set();_0x147f5c[_0x4e198f(0x13a)](_0x47d622=>{const _0x4cc4a3=_0x4e198f;switch(_0x47d622[_0x4cc4a3(0x13c)]){case _0x4cc4a3(0x116):{const _0x16a166=_0x47d622[_0x4cc4a3(0x122)]['personId'];_0x56af3c['add'](_0x16a166);break;}}}),B(this[_0x4e198f(0x10a)],_0x56af3c);}));}[_0x297170(0x13d)](){const _0xbcc2b0=_0x297170;this[_0xbcc2b0(0x111)](this[_0xbcc2b0(0x13e)]['commentUpdate$'][_0xbcc2b0(0x131)](async _0x463f1e=>{const _0x3c1d79=_0xbcc2b0;var _0x1a0523,_0x5d5bf3,_0x1399e1,_0x4f4acd;const _0x3c71a8=(_0x1a0523=this[_0x3c1d79(0x120)][_0x3c1d79(0x140)](_0x463f1e[_0x3c1d79(0x10f)])[_0x3c1d79(0x154)](_0x4d2534=>_0x4d2534[_0x3c1d79(0x11d)]===_0x463f1e[_0x3c1d79(0x11d)]))==null?void 0x0:_0x1a0523['root'];if(!_0x3c71a8)return;const {unitId:_0x167d17,subUnitId:_0x1197a4}=_0x3c71a8;switch(_0x463f1e[_0x3c1d79(0x142)]&&this[_0x3c1d79(0x12a)][_0x3c1d79(0x10b)](_0x463f1e['user']),_0x463f1e[_0x3c1d79(0x13c)]){case v[_0x3c1d79(0x132)]:break;case v[_0x3c1d79(0x144)]:{this[_0x3c1d79(0x120)][_0x3c1d79(0x127)](_0x167d17,_0x1197a4,{'unitId':_0x167d17,'subUnitId':_0x1197a4,'ref':'','id':_0x463f1e[_0x3c1d79(0x136)],'dT':D(+_0x463f1e[_0x3c1d79(0x14e)]),'threadId':_0x463f1e['threadId'],'personId':(_0x1399e1=(_0x5d5bf3=_0x463f1e['user'])==null?void 0x0:_0x5d5bf3['userID'])!=null?_0x1399e1:_0x463f1e[_0x3c1d79(0x12f)],'text':JSON[_0x3c1d79(0x125)](_0x463f1e[_0x3c1d79(0x114)]),'parentId':_0x3c71a8['id']});break;}case v['Delete']:{const _0x3d558f=this[_0x3c1d79(0x120)][_0x3c1d79(0x14d)](_0x167d17,_0x1197a4,_0x463f1e[_0x3c1d79(0x136)]);_0x3d558f&&_0x3d558f['parentId']&&this['_threadCommentModel'][_0x3c1d79(0x137)](_0x167d17,_0x1197a4,_0x463f1e[_0x3c1d79(0x136)]);break;}case v[_0x3c1d79(0x124)]:{this['_threadCommentModel'][_0x3c1d79(0x138)](_0x167d17,_0x1197a4,{'commentId':_0x463f1e[_0x3c1d79(0x136)],'text':JSON[_0x3c1d79(0x125)](_0x463f1e[_0x3c1d79(0x114)])});break;}case v['Solve']:{const _0x437ec6=(_0x4f4acd=this[_0x3c1d79(0x120)]['getUnit'](_0x463f1e[_0x3c1d79(0x10f)])[_0x3c1d79(0x154)](_0x1a2b04=>_0x1a2b04['threadId']===_0x463f1e[_0x3c1d79(0x11d)]))==null?void 0x0:_0x4f4acd[_0x3c1d79(0x14b)];_0x437ec6&&this[_0x3c1d79(0x120)][_0x3c1d79(0xfe)](_0x167d17,_0x1197a4,_0x437ec6['id'],_0x463f1e[_0x3c1d79(0x103)]===I['Solved']);break;}}}));}};S=V([p(0x0,_0x3ff32b(_0x402890)),p(0x1,_0x3ff32b(_0x47dbdb)),p(0x2,_0x3ff32b(_0x95a105)),p(0x3,_0x3ff32b(_0x47bae4))],S);const z='thread-comment-data-source.config',M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x28ff8a,_0x2fb894,_0x495986,_0x362829)=>{const _0x1b199c=_0x297170;for(var _0x8f0b6d=_0x362829>0x1?void 0x0:_0x362829?k(_0x2fb894,_0x495986):_0x2fb894,_0x1af1d5=_0x28ff8a[_0x1b199c(0x121)]-0x1,_0x37cbc0;_0x1af1d5>=0x0;_0x1af1d5--)(_0x37cbc0=_0x28ff8a[_0x1af1d5])&&(_0x8f0b6d=_0x37cbc0(_0x8f0b6d)||_0x8f0b6d);return _0x8f0b6d;},_=(_0x12b65c,_0x1c7902)=>(_0x5ed37e,_0x2fed6d)=>_0x1c7902(_0x5ed37e,_0x2fed6d,_0x12b65c);function X(_0x3184ff,_0x2d6b4b){const _0xcaa39=_0x297170,_0x1d5c88=_0x3184ff[_0xcaa39(0xfb)][0x0];return{..._0x2d6b4b,'id':_0x1d5c88['replyId'],'resolved':_0x3184ff['solved']===0x1,'dT':D(_0x1d5c88[_0xcaa39(0x14e)]),'personId':_0x1d5c88[_0xcaa39(0x12f)],'threadId':_0x1d5c88[_0xcaa39(0x11d)]};}function ee(_0x47b1c7,_0x428aa3,_0x4cd724){const _0x564aae=_0x297170;var _0x2ac0a5,_0x38e522;if(((_0x38e522=(_0x2ac0a5=_0x47b1c7==null?void 0x0:_0x47b1c7[_0x564aae(0xfb)])==null?void 0x0:_0x2ac0a5['length'])!=null?_0x38e522:0x0)>0x0){const _0x2592d3=(_0x562d01,_0x5749f7)=>({'id':_0x562d01['replyId'],'threadId':_0x562d01[_0x564aae(0x11d)],'dT':D(_0x562d01[_0x564aae(0x14e)]),'personId':_0x562d01[_0x564aae(0x12f)],'resolved':_0x47b1c7['solved']===I[_0x564aae(0x110)],'unitId':_0x428aa3,'subUnitId':_0x4cd724,'text':JSON['parse'](_0x562d01[_0x564aae(0x114)]),'parentId':_0x5749f7}),_0x19c2f4=_0x2592d3(_0x47b1c7[_0x564aae(0xfb)][0x0]);return{..._0x19c2f4,'children':_0x47b1c7['replies']['slice'](0x1)['map'](_0x80f21f=>_0x2592d3(_0x80f21f,_0x19c2f4['id']))};}return null;}let f=class{constructor(_0x5557e5,_0x16bf2a,_0x13e01e,_0x455c67){const _0xa36daf=_0x297170;this[_0xa36daf(0x115)]=_0x5557e5,this['_userService']=_0x16bf2a,this[_0xa36daf(0x113)]=_0x13e01e,this[_0xa36daf(0x10a)]=_0x455c67;}async[_0x297170(0x127)](_0x2aa293){const _0x21200b=_0x297170;var _0x41aeb9,_0x3fe16c;const {parentId:_0x291a68,unitId:_0x4a6a21,text:_0x29c4e6,threadId:_0x59e976}=_0x2aa293,_0x3c73e6=(_0x3fe16c=(_0x41aeb9=_0x29c4e6['customRanges'])==null?void 0x0:_0x41aeb9[_0x21200b(0x119)](_0x599dfe=>_0x599dfe['rangeType']===_0x9ed84b['COMMENT'])[_0x21200b(0x150)](_0x4f9cbe=>_0x4f9cbe[_0x21200b(0x149)]))!=null?_0x3fe16c:[],_0x3a927e=JSON[_0x21200b(0x143)](_0x29c4e6),_0x894962=(await this[_0x21200b(0x113)][_0x21200b(0x12e)](_0x4a6a21))[_0x21200b(0x148)]();if(_0x291a68){const _0xf7b59={'memberId':_0x894962,'unitId':_0x4a6a21,'content':_0x3a927e,'mention':_0x3c73e6,'threadId':_0x59e976},_0x336f01=(await this[_0x21200b(0x115)][_0x21200b(0x155)](_0x21200b(0x11a)+_0x4a6a21+'/reply',{'body':_0xf7b59}))[_0x21200b(0x104)]['reply'];return{..._0x2aa293,'id':_0x336f01['replyId'],'dT':_0x14c484(+_0x336f01[_0x21200b(0x14e)])[_0x21200b(0x156)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x336f01[_0x21200b(0x12f)]};}else{const _0x27932b={'memberId':_0x894962,'unitId':_0x4a6a21,'content':_0x3a927e,'mention':_0x3c73e6},_0x52d768=await this[_0x21200b(0x115)][_0x21200b(0x155)](_0x21200b(0x11a)+_0x4a6a21+'/add',{'body':_0x27932b});return X(_0x52d768[_0x21200b(0x104)][_0x21200b(0x14c)],_0x2aa293);}}async['updateComment'](_0x4275a5){const _0x457dc0=_0x297170;var _0x3ee75a,_0x24bdcb;const {text:_0x3e620e,unitId:_0x3e0aef}=_0x4275a5,_0x1e13ba=(_0x24bdcb=(_0x3ee75a=_0x3e620e['customRanges'])==null?void 0x0:_0x3ee75a[_0x457dc0(0x119)](_0x576a6d=>_0x576a6d[_0x457dc0(0x102)]===_0x9ed84b[_0x457dc0(0x130)])[_0x457dc0(0x150)](_0x1a4377=>_0x1a4377[_0x457dc0(0x149)]))!=null?_0x24bdcb:[],_0x1b3d75=JSON['stringify'](_0x3e620e),_0xf2f4e6=_0x4275a5['threadId'],_0x485d71=_0x4275a5['id'],_0x2b4b03={'memberId':(await this[_0x457dc0(0x113)][_0x457dc0(0x12e)](_0x3e0aef))['getMemberID'](),'unitId':_0x3e0aef,'threadId':_0xf2f4e6,'mention':_0x1e13ba,'content':_0x1b3d75,'replyId':_0x485d71},_0x44539d=await this[_0x457dc0(0x115)][_0x457dc0(0x155)]('/universer-api/comment/unit/'+_0x3e0aef+_0x457dc0(0xff),{'body':_0x2b4b03});return!_0x44539d[_0x457dc0(0x104)][_0x457dc0(0x14f)]||_0x44539d['body'][_0x457dc0(0x14f)][_0x457dc0(0x145)]===0x1;}async[_0x297170(0xfe)](_0x4388ea){const _0x4577a2=_0x297170,{unitId:_0x42e453}=_0x4388ea,_0x300be7=_0x4388ea['threadId'],_0x203583={'memberId':this[_0x4577a2(0x12a)][_0x4577a2(0x146)]()[_0x4577a2(0x117)],'unitId':_0x42e453,'threadId':_0x300be7,'solved':_0x4388ea[_0x4577a2(0x152)]?I[_0x4577a2(0x110)]:I[_0x4577a2(0x106)]},_0xd88d6=await this['_httpService']['post'](_0x4577a2(0x11a)+_0x42e453+'/solved',{'body':_0x203583});return!_0xd88d6[_0x4577a2(0x104)][_0x4577a2(0x14f)]||_0xd88d6[_0x4577a2(0x104)][_0x4577a2(0x14f)][_0x4577a2(0x145)]===0x1;}async['deleteComment'](_0x3fd85c,_0x18fefd,_0x489806,_0x15076b){const _0xa9eea6=_0x297170,_0x631d8c={'memberId':(await this['_sessionService'][_0xa9eea6(0x12e)](_0x3fd85c))[_0xa9eea6(0x148)](),'threadId':_0x489806,'replyId':_0x15076b,'unitId':_0x3fd85c},_0x5620b2=await this[_0xa9eea6(0x115)][_0xa9eea6(0x155)](_0xa9eea6(0x11a)+_0x3fd85c+_0xa9eea6(0x118),{'body':_0x631d8c});return!_0x5620b2[_0xa9eea6(0x104)][_0xa9eea6(0x14f)]||_0x5620b2[_0xa9eea6(0x104)][_0xa9eea6(0x14f)][_0xa9eea6(0x145)]===0x1;}async[_0x297170(0x10d)](_0x1bb5dc,_0x47b91c,_0x31be4b){const _0x21c9f4=_0x297170,_0x203d0b={'unitId':_0x1bb5dc,'threadId':_0x31be4b},_0x347204=await this['_httpService'][_0x21c9f4(0x155)](_0x21c9f4(0x11a)+_0x1bb5dc+'/list',{'body':_0x203d0b}),_0x3175fa=_0x31be4b[_0x21c9f4(0x150)](_0x21ef01=>ee(_0x347204['body'][_0x21c9f4(0x13b)][_0x21ef01],_0x1bb5dc,_0x47b91c))['filter'](Boolean);return Object[_0x21c9f4(0x10e)](_0x347204[_0x21c9f4(0x104)]['users'])[_0x21c9f4(0x13a)](_0x2e2be9=>{const _0x552646=_0x21c9f4;this[_0x552646(0x12a)][_0x552646(0x10b)](_0x2e2be9);}),_0x3175fa;}[_0x297170(0x147)](_0xc5e6f9){const _0x337170=_0x297170;return{'id':_0xc5e6f9['id'],'threadId':_0xc5e6f9['threadId'],'ref':_0xc5e6f9[_0x337170(0x13f)]};}};f=Q([_(0x0,_0x3ff32b(_0x48d5dd)),_(0x1,_0x3ff32b(_0x95a105)),_(0x2,_0x3ff32b(_0x288d12)),_(0x3,_0x3ff32b(_0x47bae4))],f);var re=Object[_0x297170(0x141)],te=(_0x457479,_0x5bc6ad,_0x3da56e,_0x377ae9)=>{for(var _0x5eb2a8=_0x377ae9>0x1?void 0x0:_0x377ae9?re(_0x5bc6ad,_0x3da56e):_0x5bc6ad,_0x39e7d9=_0x457479['length']-0x1,_0x2c78cc;_0x39e7d9>=0x0;_0x39e7d9--)(_0x2c78cc=_0x457479[_0x39e7d9])&&(_0x5eb2a8=_0x2c78cc(_0x5eb2a8)||_0x5eb2a8);return _0x5eb2a8;},N=(_0x5e6060,_0x3d014b)=>(_0x2a4acf,_0x199fdd)=>_0x3d014b(_0x2a4acf,_0x199fdd,_0x5e6060);function _0x8653(){const _0x28528e=['Add','_initUserSync','UNRECOGNIZED','5DiDFMz','replyId','deleteComment','updateComment','_threadCommentDataSourceService','forEach','comments','type','_init','_commentService','ref','getUnit','getOwnPropertyDescriptor','user','stringify','Reply','code','getCurrentUser','saveCommentToSnapshot','getMemberID','rangeId','3eTCogY','root','comment','getComment','createTimestamp','error','map','dataSource','resolved','_threadCommentDataSource','find','post','format','172333QGzNtl','Unknown','getUser','replies','pluginName','1220970MdGIXG','resolveComment','/edit','delete','1711902WgvgCy','rangeType','solved','body','onStarting','OpenOrReOpen','103NmfUIF','users','commentUpdate$','_injector','addUser','/universer-api/user/list','listComments','values','unitId','Solved','disposeWithMe','_config','_sessionService','content','_httpService','add','userID','/delete','filter','/universer-api/comment/unit/','2354984vEiZUJ','syncUpdateMutationToColla','threadId','1617556yvFYPg','8198OXsyWT','_threadCommentModel','length','payload','onReady','Edit','parse','size','addComment','_configService','645750vyYLTg','_userService','setConfig','Solve','get','requireSession','userId','COMMENT','subscribe'];_0x8653=function(){return _0x28528e;};return _0x8653();}let g=class extends _0x5963a4{constructor(_0x33c47a,_0x49917b){const _0x5c615a=_0x297170;super(),this[_0x5c615a(0x139)]=_0x33c47a,this[_0x5c615a(0x153)]=_0x49917b,this['_initDataSource']();}['_initDataSource'](){const _0xc9355f=_0x297170;this[_0xc9355f(0x139)][_0xc9355f(0x151)]=this[_0xc9355f(0x153)],this['_threadCommentDataSourceService'][_0xc9355f(0x11c)]=!0x1;}};function _0x31ac(_0x497322,_0x50a33){const _0x865386=_0x8653();return _0x31ac=function(_0x31ac2d,_0xb9e28f){_0x31ac2d=_0x31ac2d-0xfa;let _0x162a10=_0x865386[_0x31ac2d];return _0x162a10;},_0x31ac(_0x497322,_0x50a33);}g=te([N(0x0,_0x373199),N(0x1,_0x3ff32b(f))],g);var se=Object['defineProperty'],oe=Object[_0x297170(0x141)],ne=(_0x1dab4c,_0x139882,_0x41354c)=>_0x139882 in _0x1dab4c?se(_0x1dab4c,_0x139882,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x41354c}):_0x1dab4c[_0x139882]=_0x41354c,ie=(_0x4752d3,_0xf5acd2,_0x5136fb,_0x190eb4)=>{const _0x53a8a4=_0x297170;for(var _0x359ab7=_0x190eb4>0x1?void 0x0:_0x190eb4?oe(_0xf5acd2,_0x5136fb):_0xf5acd2,_0x4fba82=_0x4752d3[_0x53a8a4(0x121)]-0x1,_0x13b13d;_0x4fba82>=0x0;_0x4fba82--)(_0x13b13d=_0x4752d3[_0x4fba82])&&(_0x359ab7=_0x13b13d(_0x359ab7)||_0x359ab7);return _0x359ab7;},w=(_0x48566f,_0x1b73c8)=>(_0x339429,_0x482147)=>_0x1b73c8(_0x339429,_0x482147,_0x48566f),$=(_0x5e0f3e,_0x12d9e5,_0x3bdc21)=>ne(_0x5e0f3e,typeof _0x12d9e5!='symbol'?_0x12d9e5+'':_0x12d9e5,_0x3bdc21);let b=class extends _0x341216{constructor(_0x313507=M,_0x1b58fa,_0x5165ba){const _0x2221f8=_0x297170;super(),this['_config']=_0x313507,this[_0x2221f8(0x10a)]=_0x1b58fa,this[_0x2221f8(0x128)]=_0x5165ba;const {..._0x4384e8}=_0x2c3e44({},M,this[_0x2221f8(0x112)]);this[_0x2221f8(0x128)][_0x2221f8(0x12b)](z,_0x4384e8);}[_0x297170(0x105)](){const _0x5b3bac=_0x297170;[[f],[g],[S]][_0x5b3bac(0x13a)](_0x5b3774=>{const _0x50a89d=_0x5b3bac;this[_0x50a89d(0x10a)][_0x50a89d(0x116)](_0x5b3774);});}[_0x297170(0x123)](){const _0x2c0756=_0x297170;this[_0x2c0756(0x10a)][_0x2c0756(0x12d)](g),this[_0x2c0756(0x10a)]['get'](S);}};$(b,_0x297170(0xfc),W),$(b,_0x297170(0x13c),_0x2678d6['UNIVER_UNKNOWN']),b=ie([_0x557d35(_0x16c7d9,_0x32f6c5,_0x3729ac),w(0x1,_0x3ff32b(_0x47bae4)),w(0x2,_0x309048)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2069b1=_0x43de;(function(_0x380a17,_0x180abc){const _0x512c22=_0x43de,_0xf23808=_0x380a17();while(!![]){try{const _0x23b653=-parseInt(_0x512c22(0x202))/0x1*(-parseInt(_0x512c22(0x211))/0x2)+parseInt(_0x512c22(0x212))/0x3*(parseInt(_0x512c22(0x1f7))/0x4)+parseInt(_0x512c22(0x204))/0x5*(-parseInt(_0x512c22(0x235))/0x6)+-parseInt(_0x512c22(0x20f))/0x7+parseInt(_0x512c22(0x231))/0x8*(-parseInt(_0x512c22(0x1ed))/0x9)+-parseInt(_0x512c22(0x1f1))/0xa+parseInt(_0x512c22(0x249))/0xb;if(_0x23b653===_0x180abc)break;else _0xf23808['push'](_0xf23808['shift']());}catch(_0x4008b3){_0xf23808['push'](_0xf23808['shift']());}}}(_0x5a9a,0xc9b63));import{CommentService as _0x13b92b,CollaborationSessionService as _0x497b32,UniverCollaborationClientPlugin as _0x293a48}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x177d79}from'@univerjs-pro/license';import{dayjs as _0x3db8db,UserManagerService as _0x4a0daf,Inject as _0x29435d,Injector as _0x4a982a,Disposable as _0xcf5e6a,CustomRangeType as _0x20a37b,UniverInstanceType as _0x388da4,DependentOn as _0x4bdd65,IConfigService as _0x10e4b8,Plugin as _0x336457,merge as _0x29ae8d}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x40bc7d}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x307483,IThreadCommentDataSourceService as _0x50d99d}from'@univerjs/thread-comment';import{bufferTime as _0x2cdc2a}from'rxjs';import{HTTPService as _0x28bbac}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x2869f4=>(_0x2869f4[_0x2869f4['OpenOrReOpen']=0x0]=_0x2069b1(0x246),_0x2869f4[_0x2869f4[_0x2069b1(0x23a)]=0x1]='Solved',_0x2869f4[_0x2869f4[_0x2069b1(0x208)]=-0x1]='UNRECOGNIZED',_0x2869f4))(I||{}),v=(_0x4886b4=>(_0x4886b4[_0x4886b4[_0x2069b1(0x22a)]=0x0]=_0x2069b1(0x22a),_0x4886b4[_0x4886b4['Add']=0x1]=_0x2069b1(0x1ec),_0x4886b4[_0x4886b4[_0x2069b1(0x245)]=0x2]=_0x2069b1(0x245),_0x4886b4[_0x4886b4[_0x2069b1(0x244)]=0x3]=_0x2069b1(0x244),_0x4886b4[_0x4886b4[_0x2069b1(0x20d)]=0x4]=_0x2069b1(0x20d),_0x4886b4[_0x4886b4[_0x2069b1(0x241)]=0x5]=_0x2069b1(0x241),_0x4886b4[_0x4886b4[_0x2069b1(0x208)]=-0x1]=_0x2069b1(0x208),_0x4886b4))(v||{});const D=_0x370191=>_0x3db8db(new Date(+_0x370191))[_0x2069b1(0x210)](_0x2069b1(0x232)),B=async(_0x191f0d,_0x23776b)=>{const _0x187ad9=_0x2069b1,_0x3ecd4a=_0x191f0d[_0x187ad9(0x1f8)](_0x4a0daf),_0x478deb=_0x191f0d[_0x187ad9(0x1f8)](_0x28bbac);_0x23776b[_0x187ad9(0x206)](_0x3b836a=>{_0x3ecd4a['getUser'](_0x3b836a)&&_0x23776b['delete'](_0x3b836a);}),_0x23776b['size']&&(await _0x478deb[_0x187ad9(0x1f8)](_0x187ad9(0x1f3),{'params':{'userIDs':[..._0x23776b]}}))[_0x187ad9(0x1eb)][_0x187ad9(0x236)][_0x187ad9(0x206)](_0x2ab20f=>{const _0x28dba8=_0x187ad9;_0x2ab20f&&_0x3ecd4a[_0x28dba8(0x1fd)](_0x2ab20f);});};var K=Object[_0x2069b1(0x1f0)],V=(_0xc1efc,_0x23a962,_0x2f879a,_0x39b1b5)=>{const _0x48ea24=_0x2069b1;for(var _0x2271cc=_0x39b1b5>0x1?void 0x0:_0x39b1b5?K(_0x23a962,_0x2f879a):_0x23a962,_0x442cad=_0xc1efc[_0x48ea24(0x243)]-0x1,_0x140cdf;_0x442cad>=0x0;_0x442cad--)(_0x140cdf=_0xc1efc[_0x442cad])&&(_0x2271cc=_0x140cdf(_0x2271cc)||_0x2271cc);return _0x2271cc;},p=(_0x20cc3e,_0x213cb1)=>(_0x4562f0,_0x36ca17)=>_0x213cb1(_0x4562f0,_0x36ca17,_0x20cc3e);let S=class extends _0xcf5e6a{constructor(_0x5e4639,_0x4ad17a,_0x1df9ef,_0x43e464){const _0x592c51=_0x2069b1;super(),this[_0x592c51(0x1f2)]=_0x5e4639,this[_0x592c51(0x201)]=_0x4ad17a,this['_userService']=_0x1df9ef,this['_injector']=_0x43e464,this['_init'](),this[_0x592c51(0x217)]();}['_initUserSync'](){const _0x1bb593=_0x2069b1;this['disposeWithMe'](this[_0x1bb593(0x201)][_0x1bb593(0x21a)][_0x1bb593(0x1e6)](_0x2cdc2a(0x10))[_0x1bb593(0x242)](_0x14c196=>{const _0x5196a3=_0x1bb593,_0x1ac635=new Set();_0x14c196[_0x5196a3(0x206)](_0x5f3b47=>{const _0x8685af=_0x5196a3;switch(_0x5f3b47[_0x8685af(0x229)]){case _0x8685af(0x226):{const _0x3eb9ac=_0x5f3b47[_0x8685af(0x239)]['personId'];_0x1ac635[_0x8685af(0x226)](_0x3eb9ac);break;}}}),B(this[_0x5196a3(0x20e)],_0x1ac635);}));}['_init'](){const _0x191103=_0x2069b1;this['disposeWithMe'](this[_0x191103(0x1f2)][_0x191103(0x21a)]['subscribe'](async _0x576bff=>{const _0x54e210=_0x191103;var _0x1e86ed,_0x513627,_0x562641,_0x5c215c;const _0x3fe2bf=(_0x1e86ed=this['_threadCommentModel'][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0xc814d3=>_0xc814d3[_0x54e210(0x233)]===_0x576bff[_0x54e210(0x233)]))==null?void 0x0:_0x1e86ed[_0x54e210(0x1fb)];if(!_0x3fe2bf)return;const {unitId:_0x38e42b,subUnitId:_0x32a05e}=_0x3fe2bf;switch(_0x576bff[_0x54e210(0x22b)]&&this[_0x54e210(0x224)][_0x54e210(0x1fd)](_0x576bff['user']),_0x576bff[_0x54e210(0x229)]){case v[_0x54e210(0x1ec)]:break;case v['Reply']:{this['_threadCommentModel'][_0x54e210(0x1e8)](_0x38e42b,_0x32a05e,{'unitId':_0x38e42b,'subUnitId':_0x32a05e,'ref':'','id':_0x576bff[_0x54e210(0x23e)],'dT':D(+_0x576bff[_0x54e210(0x23c)]),'threadId':_0x576bff[_0x54e210(0x233)],'personId':(_0x562641=(_0x513627=_0x576bff[_0x54e210(0x22b)])==null?void 0x0:_0x513627[_0x54e210(0x214)])!=null?_0x562641:_0x576bff[_0x54e210(0x223)],'text':JSON[_0x54e210(0x216)](_0x576bff[_0x54e210(0x238)]),'parentId':_0x3fe2bf['id']});break;}case v[_0x54e210(0x20d)]:{const _0x15bd4d=this[_0x54e210(0x201)][_0x54e210(0x215)](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);_0x15bd4d&&_0x15bd4d[_0x54e210(0x209)]&&this[_0x54e210(0x201)]['deleteComment'](_0x38e42b,_0x32a05e,_0x576bff[_0x54e210(0x23e)]);break;}case v[_0x54e210(0x244)]:{this[_0x54e210(0x201)][_0x54e210(0x22c)](_0x38e42b,_0x32a05e,{'commentId':_0x576bff['replyId'],'text':JSON['parse'](_0x576bff[_0x54e210(0x238)])});break;}case v['Solve']:{const _0x50c2c4=(_0x5c215c=this[_0x54e210(0x201)][_0x54e210(0x22d)](_0x576bff[_0x54e210(0x21d)])[_0x54e210(0x21c)](_0x107d79=>_0x107d79[_0x54e210(0x233)]===_0x576bff['threadId']))==null?void 0x0:_0x5c215c[_0x54e210(0x1fb)];_0x50c2c4&&this[_0x54e210(0x201)][_0x54e210(0x1f6)](_0x38e42b,_0x32a05e,_0x50c2c4['id'],_0x576bff['solved']===I[_0x54e210(0x23a)]);break;}}}));}};function _0x5a9a(){const _0x5366f2=['commentUpdate$','replies','find','unitId','saveCommentToSnapshot','_httpService','dataSource','stringify','solved','userId','_userService','/solved','add','_configService','setConfig','type','Unknown','user','updateComment','getUnit','/edit','/reply','filter','69256DAIiqt','YYYY/MM/DD\x20HH:mm','threadId','pluginName','2082jCSCpC','users','symbol','content','payload','Solved','_threadCommentDataSource','createTimestamp','getMemberID','replyId','_sessionService','post','Solve','subscribe','length','Edit','Reply','OpenOrReOpen','rangeType','syncUpdateMutationToColla','31023069BMRycz','reply','pipe','customRanges','addComment','map','_threadCommentDataSourceService','body','Add','1629QhDmIA','onStarting','error','getOwnPropertyDescriptor','7244530jbqmzq','_commentService','/universer-api/user/list','COMMENT','values','resolveComment','36YvsnLp','get','/add','ref','root','requireSession','addUser','_config','UNIVER_UNKNOWN','comment','_threadCommentModel','424AGAVSP','listComments','10655TPPakK','rangeId','forEach','getCurrentUser','UNRECOGNIZED','parentId','code','/universer-api/comment/unit/','/delete','Delete','_injector','3187954BAQHAN','format','844drDleX','437751EsPYEn','thread-comment-data-source.config','userID','getComment','parse','_initUserSync','_initDataSource','defineProperty'];_0x5a9a=function(){return _0x5366f2;};return _0x5a9a();}function _0x43de(_0x266f57,_0xd09ba3){const _0x5a9a09=_0x5a9a();return _0x43de=function(_0x43de40,_0x5853ef){_0x43de40=_0x43de40-0x1e6;let _0x3a8bd3=_0x5a9a09[_0x43de40];return _0x3a8bd3;},_0x43de(_0x266f57,_0xd09ba3);}S=V([p(0x0,_0x29435d(_0x13b92b)),p(0x1,_0x29435d(_0x307483)),p(0x2,_0x29435d(_0x4a0daf)),p(0x3,_0x29435d(_0x4a982a))],S);const z=_0x2069b1(0x213),M={};var k=Object[_0x2069b1(0x1f0)],Q=(_0x4b650e,_0x2d1575,_0x32a1f4,_0x254d33)=>{for(var _0x4ff3c5=_0x254d33>0x1?void 0x0:_0x254d33?k(_0x2d1575,_0x32a1f4):_0x2d1575,_0xcc5436=_0x4b650e['length']-0x1,_0x3c0264;_0xcc5436>=0x0;_0xcc5436--)(_0x3c0264=_0x4b650e[_0xcc5436])&&(_0x4ff3c5=_0x3c0264(_0x4ff3c5)||_0x4ff3c5);return _0x4ff3c5;},_=(_0x2bd5f4,_0x32c032)=>(_0x28a6e4,_0x3e8e36)=>_0x32c032(_0x28a6e4,_0x3e8e36,_0x2bd5f4);function X(_0x2f4f42,_0x2b125f){const _0x51c332=_0x2069b1,_0x5056fc=_0x2f4f42[_0x51c332(0x21b)][0x0];return{..._0x2b125f,'id':_0x5056fc['replyId'],'resolved':_0x2f4f42[_0x51c332(0x222)]===0x1,'dT':D(_0x5056fc[_0x51c332(0x23c)]),'personId':_0x5056fc[_0x51c332(0x223)],'threadId':_0x5056fc[_0x51c332(0x233)]};}function ee(_0x300d9d,_0x1645fb,_0x3e6823){const _0x1e4b94=_0x2069b1;var _0x395378,_0x3d0378;if(((_0x3d0378=(_0x395378=_0x300d9d==null?void 0x0:_0x300d9d[_0x1e4b94(0x21b)])==null?void 0x0:_0x395378[_0x1e4b94(0x243)])!=null?_0x3d0378:0x0)>0x0){const _0x2be729=(_0x1fe7c3,_0x22b6aa)=>({'id':_0x1fe7c3[_0x1e4b94(0x23e)],'threadId':_0x1fe7c3['threadId'],'dT':D(_0x1fe7c3[_0x1e4b94(0x23c)]),'personId':_0x1fe7c3[_0x1e4b94(0x223)],'resolved':_0x300d9d[_0x1e4b94(0x222)]===I[_0x1e4b94(0x23a)],'unitId':_0x1645fb,'subUnitId':_0x3e6823,'text':JSON[_0x1e4b94(0x216)](_0x1fe7c3['content']),'parentId':_0x22b6aa}),_0x25549e=_0x2be729(_0x300d9d['replies'][0x0]);return{..._0x25549e,'children':_0x300d9d['replies']['slice'](0x1)[_0x1e4b94(0x1e9)](_0x42081c=>_0x2be729(_0x42081c,_0x25549e['id']))};}return null;}let f=class{constructor(_0x2973e1,_0x4c581d,_0x4112ae,_0x3c713d){const _0x4f683f=_0x2069b1;this[_0x4f683f(0x21f)]=_0x2973e1,this[_0x4f683f(0x224)]=_0x4c581d,this[_0x4f683f(0x23f)]=_0x4112ae,this['_injector']=_0x3c713d;}async[_0x2069b1(0x1e8)](_0x57ba0c){const _0xc74b=_0x2069b1;var _0x260f16,_0x3aec62;const {parentId:_0x37b97d,unitId:_0x25ebf1,text:_0x5881ae,threadId:_0x208bba}=_0x57ba0c,_0x22a188=(_0x3aec62=(_0x260f16=_0x5881ae['customRanges'])==null?void 0x0:_0x260f16['filter'](_0x4cf826=>_0x4cf826['rangeType']===_0x20a37b[_0xc74b(0x1f4)])[_0xc74b(0x1e9)](_0x4947a6=>_0x4947a6[_0xc74b(0x205)]))!=null?_0x3aec62:[],_0x53dc8e=JSON['stringify'](_0x5881ae),_0x2893aa=(await this[_0xc74b(0x23f)][_0xc74b(0x1fc)](_0x25ebf1))[_0xc74b(0x23d)]();if(_0x37b97d){const _0x447f4c={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188,'threadId':_0x208bba},_0x8537e3=(await this[_0xc74b(0x21f)][_0xc74b(0x240)](_0xc74b(0x20b)+_0x25ebf1+_0xc74b(0x22f),{'body':_0x447f4c}))[_0xc74b(0x1eb)][_0xc74b(0x24a)];return{..._0x57ba0c,'id':_0x8537e3[_0xc74b(0x23e)],'dT':_0x3db8db(+_0x8537e3['createTimestamp'])[_0xc74b(0x210)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x8537e3['userId']};}else{const _0xbaf400={'memberId':_0x2893aa,'unitId':_0x25ebf1,'content':_0x53dc8e,'mention':_0x22a188},_0x3beb00=await this[_0xc74b(0x21f)][_0xc74b(0x240)]('/universer-api/comment/unit/'+_0x25ebf1+_0xc74b(0x1f9),{'body':_0xbaf400});return X(_0x3beb00['body'][_0xc74b(0x200)],_0x57ba0c);}}async['updateComment'](_0x33469c){const _0x2bb8dd=_0x2069b1;var _0x57cd8f,_0x326866;const {text:_0x3d2d88,unitId:_0x484fbb}=_0x33469c,_0x23435a=(_0x326866=(_0x57cd8f=_0x3d2d88[_0x2bb8dd(0x1e7)])==null?void 0x0:_0x57cd8f[_0x2bb8dd(0x230)](_0x52c847=>_0x52c847[_0x2bb8dd(0x247)]===_0x20a37b['COMMENT'])[_0x2bb8dd(0x1e9)](_0x24efd7=>_0x24efd7['rangeId']))!=null?_0x326866:[],_0x136a5a=JSON[_0x2bb8dd(0x221)](_0x3d2d88),_0x161502=_0x33469c[_0x2bb8dd(0x233)],_0x100d9b=_0x33469c['id'],_0x504d21={'memberId':(await this[_0x2bb8dd(0x23f)][_0x2bb8dd(0x1fc)](_0x484fbb))['getMemberID'](),'unitId':_0x484fbb,'threadId':_0x161502,'mention':_0x23435a,'content':_0x136a5a,'replyId':_0x100d9b},_0x54da1f=await this[_0x2bb8dd(0x21f)][_0x2bb8dd(0x240)](_0x2bb8dd(0x20b)+_0x484fbb+_0x2bb8dd(0x22e),{'body':_0x504d21});return!_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)]||_0x54da1f[_0x2bb8dd(0x1eb)][_0x2bb8dd(0x1ef)][_0x2bb8dd(0x20a)]===0x1;}async[_0x2069b1(0x1f6)](_0x526be0){const _0x2c8d26=_0x2069b1,{unitId:_0x3222c2}=_0x526be0,_0x4d38e0=_0x526be0[_0x2c8d26(0x233)],_0x2d0a68={'memberId':this[_0x2c8d26(0x224)][_0x2c8d26(0x207)]()[_0x2c8d26(0x214)],'unitId':_0x3222c2,'threadId':_0x4d38e0,'solved':_0x526be0['resolved']?I['Solved']:I[_0x2c8d26(0x246)]},_0x36fd32=await this['_httpService'][_0x2c8d26(0x240)](_0x2c8d26(0x20b)+_0x3222c2+_0x2c8d26(0x225),{'body':_0x2d0a68});return!_0x36fd32[_0x2c8d26(0x1eb)]['error']||_0x36fd32[_0x2c8d26(0x1eb)][_0x2c8d26(0x1ef)][_0x2c8d26(0x20a)]===0x1;}async['deleteComment'](_0x23cc3f,_0x570924,_0x20daa7,_0x2c124e){const _0x5168ef=_0x2069b1,_0x406cea={'memberId':(await this[_0x5168ef(0x23f)][_0x5168ef(0x1fc)](_0x23cc3f))[_0x5168ef(0x23d)](),'threadId':_0x20daa7,'replyId':_0x2c124e,'unitId':_0x23cc3f},_0x575c63=await this[_0x5168ef(0x21f)]['post']('/universer-api/comment/unit/'+_0x23cc3f+_0x5168ef(0x20c),{'body':_0x406cea});return!_0x575c63['body'][_0x5168ef(0x1ef)]||_0x575c63[_0x5168ef(0x1eb)][_0x5168ef(0x1ef)]['code']===0x1;}async[_0x2069b1(0x203)](_0x5bf68c,_0x1da9d9,_0x13095e){const _0x5f1305=_0x2069b1,_0x917eb7={'unitId':_0x5bf68c,'threadId':_0x13095e},_0x1de068=await this[_0x5f1305(0x21f)][_0x5f1305(0x240)](_0x5f1305(0x20b)+_0x5bf68c+'/list',{'body':_0x917eb7}),_0x58a87f=_0x13095e['map'](_0x38c997=>ee(_0x1de068[_0x5f1305(0x1eb)]['comments'][_0x38c997],_0x5bf68c,_0x1da9d9))[_0x5f1305(0x230)](Boolean);return Object[_0x5f1305(0x1f5)](_0x1de068[_0x5f1305(0x1eb)][_0x5f1305(0x236)])[_0x5f1305(0x206)](_0x1a2e90=>{const _0x29c53b=_0x5f1305;this[_0x29c53b(0x224)][_0x29c53b(0x1fd)](_0x1a2e90);}),_0x58a87f;}[_0x2069b1(0x21e)](_0x5b685d){const _0x35c709=_0x2069b1;return{'id':_0x5b685d['id'],'threadId':_0x5b685d['threadId'],'ref':_0x5b685d[_0x35c709(0x1fa)]};}};f=Q([_(0x0,_0x29435d(_0x28bbac)),_(0x1,_0x29435d(_0x4a0daf)),_(0x2,_0x29435d(_0x497b32)),_(0x3,_0x29435d(_0x4a982a))],f);var re=Object[_0x2069b1(0x1f0)],te=(_0x53a279,_0x1e8bf8,_0x5da0b2,_0x41acd3)=>{const _0x4f0473=_0x2069b1;for(var _0x402979=_0x41acd3>0x1?void 0x0:_0x41acd3?re(_0x1e8bf8,_0x5da0b2):_0x1e8bf8,_0x8614a8=_0x53a279[_0x4f0473(0x243)]-0x1,_0x3993e3;_0x8614a8>=0x0;_0x8614a8--)(_0x3993e3=_0x53a279[_0x8614a8])&&(_0x402979=_0x3993e3(_0x402979)||_0x402979);return _0x402979;},N=(_0x3edf70,_0x404ed6)=>(_0x342394,_0x2ea15a)=>_0x404ed6(_0x342394,_0x2ea15a,_0x3edf70);let g=class extends _0xcf5e6a{constructor(_0x10394d,_0x3d1afd){const _0x31a5c4=_0x2069b1;super(),this[_0x31a5c4(0x1ea)]=_0x10394d,this[_0x31a5c4(0x23b)]=_0x3d1afd,this['_initDataSource']();}[_0x2069b1(0x218)](){const _0x3ee648=_0x2069b1;this['_threadCommentDataSourceService'][_0x3ee648(0x220)]=this['_threadCommentDataSource'],this[_0x3ee648(0x1ea)][_0x3ee648(0x248)]=!0x1;}};g=te([N(0x0,_0x50d99d),N(0x1,_0x29435d(f))],g);var se=Object[_0x2069b1(0x219)],oe=Object[_0x2069b1(0x1f0)],ne=(_0x145b1f,_0x1d1939,_0x483275)=>_0x1d1939 in _0x145b1f?se(_0x145b1f,_0x1d1939,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x483275}):_0x145b1f[_0x1d1939]=_0x483275,ie=(_0x5c0722,_0x1a2999,_0x186fe8,_0x27cb6)=>{for(var _0x23c14e=_0x27cb6>0x1?void 0x0:_0x27cb6?oe(_0x1a2999,_0x186fe8):_0x1a2999,_0x3aa58f=_0x5c0722['length']-0x1,_0x296568;_0x3aa58f>=0x0;_0x3aa58f--)(_0x296568=_0x5c0722[_0x3aa58f])&&(_0x23c14e=_0x296568(_0x23c14e)||_0x23c14e);return _0x23c14e;},w=(_0x9c69e8,_0x3e5640)=>(_0x5c9264,_0x5b91d0)=>_0x3e5640(_0x5c9264,_0x5b91d0,_0x9c69e8),$=(_0x1188fa,_0xecfa3c,_0x3f0e32)=>ne(_0x1188fa,typeof _0xecfa3c!=_0x2069b1(0x237)?_0xecfa3c+'':_0xecfa3c,_0x3f0e32);let b=class extends _0x336457{constructor(_0x5b7b71=M,_0x54a116,_0x232ede){const _0x4a7efd=_0x2069b1;super(),this[_0x4a7efd(0x1fe)]=_0x5b7b71,this['_injector']=_0x54a116,this[_0x4a7efd(0x227)]=_0x232ede;const {..._0x55939b}=_0x29ae8d({},M,this[_0x4a7efd(0x1fe)]);this[_0x4a7efd(0x227)][_0x4a7efd(0x228)](z,_0x55939b);}[_0x2069b1(0x1ee)](){[[f],[g],[S]]['forEach'](_0x53b308=>{const _0x125688=_0x43de;this[_0x125688(0x20e)]['add'](_0x53b308);});}['onReady'](){const _0x828de8=_0x2069b1;this['_injector'][_0x828de8(0x1f8)](g),this[_0x828de8(0x20e)][_0x828de8(0x1f8)](S);}};$(b,_0x2069b1(0x234),W),$(b,_0x2069b1(0x229),_0x388da4[_0x2069b1(0x1ff)]),b=ie([_0x4bdd65(_0x40bc7d,_0x293a48,_0x177d79),w(0x1,_0x29435d(_0x4a982a)),w(0x2,_0x10e4b8)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
|
1
|
+
const _0x297170=_0x31ac;(function(_0xc07465,_0x3389ea){const _0x20f3da=_0x31ac,_0x426425=_0xc07465();while(!![]){try{const _0x8681e=parseInt(_0x20f3da(0x107))/0x1*(parseInt(_0x20f3da(0x11f))/0x2)+parseInt(_0x20f3da(0x14a))/0x3*(parseInt(_0x20f3da(0x11e))/0x4)+-parseInt(_0x20f3da(0x135))/0x5*(parseInt(_0x20f3da(0x101))/0x6)+-parseInt(_0x20f3da(0x157))/0x7+-parseInt(_0x20f3da(0x11b))/0x8+-parseInt(_0x20f3da(0x129))/0x9+parseInt(_0x20f3da(0xfd))/0xa;if(_0x8681e===_0x3389ea)break;else _0x426425['push'](_0x426425['shift']());}catch(_0x15324e){_0x426425['push'](_0x426425['shift']());}}}(_0x8653,0x428f0));import{CommentService as _0x402890,CollaborationSessionService as _0x288d12,UniverCollaborationClientPlugin as _0x32f6c5}from'@univerjs-pro/collaboration-client';import{UniverLicensePlugin as _0x3729ac}from'@univerjs-pro/license';import{dayjs as _0x14c484,UserManagerService as _0x95a105,Inject as _0x3ff32b,Injector as _0x47bae4,Disposable as _0x5963a4,CustomRangeType as _0x9ed84b,UniverInstanceType as _0x2678d6,DependentOn as _0x557d35,IConfigService as _0x309048,Plugin as _0x341216,merge as _0x2c3e44}from'@univerjs/core';import{UniverThreadCommentUIPlugin as _0x16c7d9}from'@univerjs/thread-comment-ui';import{ThreadCommentModel as _0x47dbdb,IThreadCommentDataSourceService as _0x373199}from'@univerjs/thread-comment';import{bufferTime as _0x2cb961}from'rxjs';import{HTTPService as _0x48d5dd}from'@univerjs/network';const W='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var I=(_0x3518fa=>(_0x3518fa[_0x3518fa[_0x297170(0x106)]=0x0]=_0x297170(0x106),_0x3518fa[_0x3518fa[_0x297170(0x110)]=0x1]=_0x297170(0x110),_0x3518fa[_0x3518fa[_0x297170(0x134)]=-0x1]=_0x297170(0x134),_0x3518fa))(I||{}),v=(_0x5883e3=>(_0x5883e3[_0x5883e3[_0x297170(0x158)]=0x0]='Unknown',_0x5883e3[_0x5883e3['Add']=0x1]='Add',_0x5883e3[_0x5883e3[_0x297170(0x144)]=0x2]='Reply',_0x5883e3[_0x5883e3[_0x297170(0x124)]=0x3]=_0x297170(0x124),_0x5883e3[_0x5883e3['Delete']=0x4]='Delete',_0x5883e3[_0x5883e3[_0x297170(0x12c)]=0x5]='Solve',_0x5883e3[_0x5883e3[_0x297170(0x134)]=-0x1]='UNRECOGNIZED',_0x5883e3))(v||{});const D=_0x7b9742=>_0x14c484(new Date(+_0x7b9742))[_0x297170(0x156)]('YYYY/MM/DD\x20HH:mm'),B=async(_0x1a4b51,_0x3f5962)=>{const _0x39f0cb=_0x297170,_0x4cb4c2=_0x1a4b51[_0x39f0cb(0x12d)](_0x95a105),_0x30f6f9=_0x1a4b51[_0x39f0cb(0x12d)](_0x48d5dd);_0x3f5962[_0x39f0cb(0x13a)](_0x21e445=>{const _0x17298d=_0x39f0cb;_0x4cb4c2[_0x17298d(0xfa)](_0x21e445)&&_0x3f5962[_0x17298d(0x100)](_0x21e445);}),_0x3f5962[_0x39f0cb(0x126)]&&(await _0x30f6f9[_0x39f0cb(0x12d)](_0x39f0cb(0x10c),{'params':{'userIDs':[..._0x3f5962]}}))['body'][_0x39f0cb(0x108)]['forEach'](_0x4b56e7=>{const _0x406ffb=_0x39f0cb;_0x4b56e7&&_0x4cb4c2[_0x406ffb(0x10b)](_0x4b56e7);});};var K=Object[_0x297170(0x141)],V=(_0xc97fb3,_0x126c51,_0x1e6d93,_0x3c4003)=>{const _0x3de073=_0x297170;for(var _0x4fea08=_0x3c4003>0x1?void 0x0:_0x3c4003?K(_0x126c51,_0x1e6d93):_0x126c51,_0x1e3d37=_0xc97fb3[_0x3de073(0x121)]-0x1,_0x461261;_0x1e3d37>=0x0;_0x1e3d37--)(_0x461261=_0xc97fb3[_0x1e3d37])&&(_0x4fea08=_0x461261(_0x4fea08)||_0x4fea08);return _0x4fea08;},p=(_0x31e203,_0x3d4932)=>(_0x3e528a,_0xf3a76)=>_0x3d4932(_0x3e528a,_0xf3a76,_0x31e203);let S=class extends _0x5963a4{constructor(_0x16e23e,_0x34eca4,_0x407fbd,_0x3c0d92){const _0x44c808=_0x297170;super(),this[_0x44c808(0x13e)]=_0x16e23e,this['_threadCommentModel']=_0x34eca4,this[_0x44c808(0x12a)]=_0x407fbd,this[_0x44c808(0x10a)]=_0x3c0d92,this[_0x44c808(0x13d)](),this[_0x44c808(0x133)]();}['_initUserSync'](){const _0x20d196=_0x297170;this['disposeWithMe'](this[_0x20d196(0x120)][_0x20d196(0x109)]['pipe'](_0x2cb961(0x10))[_0x20d196(0x131)](_0x147f5c=>{const _0x4e198f=_0x20d196,_0x56af3c=new Set();_0x147f5c[_0x4e198f(0x13a)](_0x47d622=>{const _0x4cc4a3=_0x4e198f;switch(_0x47d622[_0x4cc4a3(0x13c)]){case _0x4cc4a3(0x116):{const _0x16a166=_0x47d622[_0x4cc4a3(0x122)]['personId'];_0x56af3c['add'](_0x16a166);break;}}}),B(this[_0x4e198f(0x10a)],_0x56af3c);}));}[_0x297170(0x13d)](){const _0xbcc2b0=_0x297170;this[_0xbcc2b0(0x111)](this[_0xbcc2b0(0x13e)]['commentUpdate$'][_0xbcc2b0(0x131)](async _0x463f1e=>{const _0x3c1d79=_0xbcc2b0;var _0x1a0523,_0x5d5bf3,_0x1399e1,_0x4f4acd;const _0x3c71a8=(_0x1a0523=this[_0x3c1d79(0x120)][_0x3c1d79(0x140)](_0x463f1e[_0x3c1d79(0x10f)])[_0x3c1d79(0x154)](_0x4d2534=>_0x4d2534[_0x3c1d79(0x11d)]===_0x463f1e[_0x3c1d79(0x11d)]))==null?void 0x0:_0x1a0523['root'];if(!_0x3c71a8)return;const {unitId:_0x167d17,subUnitId:_0x1197a4}=_0x3c71a8;switch(_0x463f1e[_0x3c1d79(0x142)]&&this[_0x3c1d79(0x12a)][_0x3c1d79(0x10b)](_0x463f1e['user']),_0x463f1e[_0x3c1d79(0x13c)]){case v[_0x3c1d79(0x132)]:break;case v[_0x3c1d79(0x144)]:{this[_0x3c1d79(0x120)][_0x3c1d79(0x127)](_0x167d17,_0x1197a4,{'unitId':_0x167d17,'subUnitId':_0x1197a4,'ref':'','id':_0x463f1e[_0x3c1d79(0x136)],'dT':D(+_0x463f1e[_0x3c1d79(0x14e)]),'threadId':_0x463f1e['threadId'],'personId':(_0x1399e1=(_0x5d5bf3=_0x463f1e['user'])==null?void 0x0:_0x5d5bf3['userID'])!=null?_0x1399e1:_0x463f1e[_0x3c1d79(0x12f)],'text':JSON[_0x3c1d79(0x125)](_0x463f1e[_0x3c1d79(0x114)]),'parentId':_0x3c71a8['id']});break;}case v['Delete']:{const _0x3d558f=this[_0x3c1d79(0x120)][_0x3c1d79(0x14d)](_0x167d17,_0x1197a4,_0x463f1e[_0x3c1d79(0x136)]);_0x3d558f&&_0x3d558f['parentId']&&this['_threadCommentModel'][_0x3c1d79(0x137)](_0x167d17,_0x1197a4,_0x463f1e[_0x3c1d79(0x136)]);break;}case v[_0x3c1d79(0x124)]:{this['_threadCommentModel'][_0x3c1d79(0x138)](_0x167d17,_0x1197a4,{'commentId':_0x463f1e[_0x3c1d79(0x136)],'text':JSON[_0x3c1d79(0x125)](_0x463f1e[_0x3c1d79(0x114)])});break;}case v['Solve']:{const _0x437ec6=(_0x4f4acd=this[_0x3c1d79(0x120)]['getUnit'](_0x463f1e[_0x3c1d79(0x10f)])[_0x3c1d79(0x154)](_0x1a2b04=>_0x1a2b04['threadId']===_0x463f1e[_0x3c1d79(0x11d)]))==null?void 0x0:_0x4f4acd[_0x3c1d79(0x14b)];_0x437ec6&&this[_0x3c1d79(0x120)][_0x3c1d79(0xfe)](_0x167d17,_0x1197a4,_0x437ec6['id'],_0x463f1e[_0x3c1d79(0x103)]===I['Solved']);break;}}}));}};S=V([p(0x0,_0x3ff32b(_0x402890)),p(0x1,_0x3ff32b(_0x47dbdb)),p(0x2,_0x3ff32b(_0x95a105)),p(0x3,_0x3ff32b(_0x47bae4))],S);const z='thread-comment-data-source.config',M={};var k=Object['getOwnPropertyDescriptor'],Q=(_0x28ff8a,_0x2fb894,_0x495986,_0x362829)=>{const _0x1b199c=_0x297170;for(var _0x8f0b6d=_0x362829>0x1?void 0x0:_0x362829?k(_0x2fb894,_0x495986):_0x2fb894,_0x1af1d5=_0x28ff8a[_0x1b199c(0x121)]-0x1,_0x37cbc0;_0x1af1d5>=0x0;_0x1af1d5--)(_0x37cbc0=_0x28ff8a[_0x1af1d5])&&(_0x8f0b6d=_0x37cbc0(_0x8f0b6d)||_0x8f0b6d);return _0x8f0b6d;},_=(_0x12b65c,_0x1c7902)=>(_0x5ed37e,_0x2fed6d)=>_0x1c7902(_0x5ed37e,_0x2fed6d,_0x12b65c);function X(_0x3184ff,_0x2d6b4b){const _0xcaa39=_0x297170,_0x1d5c88=_0x3184ff[_0xcaa39(0xfb)][0x0];return{..._0x2d6b4b,'id':_0x1d5c88['replyId'],'resolved':_0x3184ff['solved']===0x1,'dT':D(_0x1d5c88[_0xcaa39(0x14e)]),'personId':_0x1d5c88[_0xcaa39(0x12f)],'threadId':_0x1d5c88[_0xcaa39(0x11d)]};}function ee(_0x47b1c7,_0x428aa3,_0x4cd724){const _0x564aae=_0x297170;var _0x2ac0a5,_0x38e522;if(((_0x38e522=(_0x2ac0a5=_0x47b1c7==null?void 0x0:_0x47b1c7[_0x564aae(0xfb)])==null?void 0x0:_0x2ac0a5['length'])!=null?_0x38e522:0x0)>0x0){const _0x2592d3=(_0x562d01,_0x5749f7)=>({'id':_0x562d01['replyId'],'threadId':_0x562d01[_0x564aae(0x11d)],'dT':D(_0x562d01[_0x564aae(0x14e)]),'personId':_0x562d01[_0x564aae(0x12f)],'resolved':_0x47b1c7['solved']===I[_0x564aae(0x110)],'unitId':_0x428aa3,'subUnitId':_0x4cd724,'text':JSON['parse'](_0x562d01[_0x564aae(0x114)]),'parentId':_0x5749f7}),_0x19c2f4=_0x2592d3(_0x47b1c7[_0x564aae(0xfb)][0x0]);return{..._0x19c2f4,'children':_0x47b1c7['replies']['slice'](0x1)['map'](_0x80f21f=>_0x2592d3(_0x80f21f,_0x19c2f4['id']))};}return null;}let f=class{constructor(_0x5557e5,_0x16bf2a,_0x13e01e,_0x455c67){const _0xa36daf=_0x297170;this[_0xa36daf(0x115)]=_0x5557e5,this['_userService']=_0x16bf2a,this[_0xa36daf(0x113)]=_0x13e01e,this[_0xa36daf(0x10a)]=_0x455c67;}async[_0x297170(0x127)](_0x2aa293){const _0x21200b=_0x297170;var _0x41aeb9,_0x3fe16c;const {parentId:_0x291a68,unitId:_0x4a6a21,text:_0x29c4e6,threadId:_0x59e976}=_0x2aa293,_0x3c73e6=(_0x3fe16c=(_0x41aeb9=_0x29c4e6['customRanges'])==null?void 0x0:_0x41aeb9[_0x21200b(0x119)](_0x599dfe=>_0x599dfe['rangeType']===_0x9ed84b['COMMENT'])[_0x21200b(0x150)](_0x4f9cbe=>_0x4f9cbe[_0x21200b(0x149)]))!=null?_0x3fe16c:[],_0x3a927e=JSON[_0x21200b(0x143)](_0x29c4e6),_0x894962=(await this[_0x21200b(0x113)][_0x21200b(0x12e)](_0x4a6a21))[_0x21200b(0x148)]();if(_0x291a68){const _0xf7b59={'memberId':_0x894962,'unitId':_0x4a6a21,'content':_0x3a927e,'mention':_0x3c73e6,'threadId':_0x59e976},_0x336f01=(await this[_0x21200b(0x115)][_0x21200b(0x155)](_0x21200b(0x11a)+_0x4a6a21+'/reply',{'body':_0xf7b59}))[_0x21200b(0x104)]['reply'];return{..._0x2aa293,'id':_0x336f01['replyId'],'dT':_0x14c484(+_0x336f01[_0x21200b(0x14e)])[_0x21200b(0x156)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x336f01[_0x21200b(0x12f)]};}else{const _0x27932b={'memberId':_0x894962,'unitId':_0x4a6a21,'content':_0x3a927e,'mention':_0x3c73e6},_0x52d768=await this[_0x21200b(0x115)][_0x21200b(0x155)](_0x21200b(0x11a)+_0x4a6a21+'/add',{'body':_0x27932b});return X(_0x52d768[_0x21200b(0x104)][_0x21200b(0x14c)],_0x2aa293);}}async['updateComment'](_0x4275a5){const _0x457dc0=_0x297170;var _0x3ee75a,_0x24bdcb;const {text:_0x3e620e,unitId:_0x3e0aef}=_0x4275a5,_0x1e13ba=(_0x24bdcb=(_0x3ee75a=_0x3e620e['customRanges'])==null?void 0x0:_0x3ee75a[_0x457dc0(0x119)](_0x576a6d=>_0x576a6d[_0x457dc0(0x102)]===_0x9ed84b[_0x457dc0(0x130)])[_0x457dc0(0x150)](_0x1a4377=>_0x1a4377[_0x457dc0(0x149)]))!=null?_0x24bdcb:[],_0x1b3d75=JSON['stringify'](_0x3e620e),_0xf2f4e6=_0x4275a5['threadId'],_0x485d71=_0x4275a5['id'],_0x2b4b03={'memberId':(await this[_0x457dc0(0x113)][_0x457dc0(0x12e)](_0x3e0aef))['getMemberID'](),'unitId':_0x3e0aef,'threadId':_0xf2f4e6,'mention':_0x1e13ba,'content':_0x1b3d75,'replyId':_0x485d71},_0x44539d=await this[_0x457dc0(0x115)][_0x457dc0(0x155)]('/universer-api/comment/unit/'+_0x3e0aef+_0x457dc0(0xff),{'body':_0x2b4b03});return!_0x44539d[_0x457dc0(0x104)][_0x457dc0(0x14f)]||_0x44539d['body'][_0x457dc0(0x14f)][_0x457dc0(0x145)]===0x1;}async[_0x297170(0xfe)](_0x4388ea){const _0x4577a2=_0x297170,{unitId:_0x42e453}=_0x4388ea,_0x300be7=_0x4388ea['threadId'],_0x203583={'memberId':this[_0x4577a2(0x12a)][_0x4577a2(0x146)]()[_0x4577a2(0x117)],'unitId':_0x42e453,'threadId':_0x300be7,'solved':_0x4388ea[_0x4577a2(0x152)]?I[_0x4577a2(0x110)]:I[_0x4577a2(0x106)]},_0xd88d6=await this['_httpService']['post'](_0x4577a2(0x11a)+_0x42e453+'/solved',{'body':_0x203583});return!_0xd88d6[_0x4577a2(0x104)][_0x4577a2(0x14f)]||_0xd88d6[_0x4577a2(0x104)][_0x4577a2(0x14f)][_0x4577a2(0x145)]===0x1;}async['deleteComment'](_0x3fd85c,_0x18fefd,_0x489806,_0x15076b){const _0xa9eea6=_0x297170,_0x631d8c={'memberId':(await this['_sessionService'][_0xa9eea6(0x12e)](_0x3fd85c))[_0xa9eea6(0x148)](),'threadId':_0x489806,'replyId':_0x15076b,'unitId':_0x3fd85c},_0x5620b2=await this[_0xa9eea6(0x115)][_0xa9eea6(0x155)](_0xa9eea6(0x11a)+_0x3fd85c+_0xa9eea6(0x118),{'body':_0x631d8c});return!_0x5620b2[_0xa9eea6(0x104)][_0xa9eea6(0x14f)]||_0x5620b2[_0xa9eea6(0x104)][_0xa9eea6(0x14f)][_0xa9eea6(0x145)]===0x1;}async[_0x297170(0x10d)](_0x1bb5dc,_0x47b91c,_0x31be4b){const _0x21c9f4=_0x297170,_0x203d0b={'unitId':_0x1bb5dc,'threadId':_0x31be4b},_0x347204=await this['_httpService'][_0x21c9f4(0x155)](_0x21c9f4(0x11a)+_0x1bb5dc+'/list',{'body':_0x203d0b}),_0x3175fa=_0x31be4b[_0x21c9f4(0x150)](_0x21ef01=>ee(_0x347204['body'][_0x21c9f4(0x13b)][_0x21ef01],_0x1bb5dc,_0x47b91c))['filter'](Boolean);return Object[_0x21c9f4(0x10e)](_0x347204[_0x21c9f4(0x104)]['users'])[_0x21c9f4(0x13a)](_0x2e2be9=>{const _0x552646=_0x21c9f4;this[_0x552646(0x12a)][_0x552646(0x10b)](_0x2e2be9);}),_0x3175fa;}[_0x297170(0x147)](_0xc5e6f9){const _0x337170=_0x297170;return{'id':_0xc5e6f9['id'],'threadId':_0xc5e6f9['threadId'],'ref':_0xc5e6f9[_0x337170(0x13f)]};}};f=Q([_(0x0,_0x3ff32b(_0x48d5dd)),_(0x1,_0x3ff32b(_0x95a105)),_(0x2,_0x3ff32b(_0x288d12)),_(0x3,_0x3ff32b(_0x47bae4))],f);var re=Object[_0x297170(0x141)],te=(_0x457479,_0x5bc6ad,_0x3da56e,_0x377ae9)=>{for(var _0x5eb2a8=_0x377ae9>0x1?void 0x0:_0x377ae9?re(_0x5bc6ad,_0x3da56e):_0x5bc6ad,_0x39e7d9=_0x457479['length']-0x1,_0x2c78cc;_0x39e7d9>=0x0;_0x39e7d9--)(_0x2c78cc=_0x457479[_0x39e7d9])&&(_0x5eb2a8=_0x2c78cc(_0x5eb2a8)||_0x5eb2a8);return _0x5eb2a8;},N=(_0x5e6060,_0x3d014b)=>(_0x2a4acf,_0x199fdd)=>_0x3d014b(_0x2a4acf,_0x199fdd,_0x5e6060);function _0x8653(){const _0x28528e=['Add','_initUserSync','UNRECOGNIZED','5DiDFMz','replyId','deleteComment','updateComment','_threadCommentDataSourceService','forEach','comments','type','_init','_commentService','ref','getUnit','getOwnPropertyDescriptor','user','stringify','Reply','code','getCurrentUser','saveCommentToSnapshot','getMemberID','rangeId','3eTCogY','root','comment','getComment','createTimestamp','error','map','dataSource','resolved','_threadCommentDataSource','find','post','format','172333QGzNtl','Unknown','getUser','replies','pluginName','1220970MdGIXG','resolveComment','/edit','delete','1711902WgvgCy','rangeType','solved','body','onStarting','OpenOrReOpen','103NmfUIF','users','commentUpdate$','_injector','addUser','/universer-api/user/list','listComments','values','unitId','Solved','disposeWithMe','_config','_sessionService','content','_httpService','add','userID','/delete','filter','/universer-api/comment/unit/','2354984vEiZUJ','syncUpdateMutationToColla','threadId','1617556yvFYPg','8198OXsyWT','_threadCommentModel','length','payload','onReady','Edit','parse','size','addComment','_configService','645750vyYLTg','_userService','setConfig','Solve','get','requireSession','userId','COMMENT','subscribe'];_0x8653=function(){return _0x28528e;};return _0x8653();}let g=class extends _0x5963a4{constructor(_0x33c47a,_0x49917b){const _0x5c615a=_0x297170;super(),this[_0x5c615a(0x139)]=_0x33c47a,this[_0x5c615a(0x153)]=_0x49917b,this['_initDataSource']();}['_initDataSource'](){const _0xc9355f=_0x297170;this[_0xc9355f(0x139)][_0xc9355f(0x151)]=this[_0xc9355f(0x153)],this['_threadCommentDataSourceService'][_0xc9355f(0x11c)]=!0x1;}};function _0x31ac(_0x497322,_0x50a33){const _0x865386=_0x8653();return _0x31ac=function(_0x31ac2d,_0xb9e28f){_0x31ac2d=_0x31ac2d-0xfa;let _0x162a10=_0x865386[_0x31ac2d];return _0x162a10;},_0x31ac(_0x497322,_0x50a33);}g=te([N(0x0,_0x373199),N(0x1,_0x3ff32b(f))],g);var se=Object['defineProperty'],oe=Object[_0x297170(0x141)],ne=(_0x1dab4c,_0x139882,_0x41354c)=>_0x139882 in _0x1dab4c?se(_0x1dab4c,_0x139882,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x41354c}):_0x1dab4c[_0x139882]=_0x41354c,ie=(_0x4752d3,_0xf5acd2,_0x5136fb,_0x190eb4)=>{const _0x53a8a4=_0x297170;for(var _0x359ab7=_0x190eb4>0x1?void 0x0:_0x190eb4?oe(_0xf5acd2,_0x5136fb):_0xf5acd2,_0x4fba82=_0x4752d3[_0x53a8a4(0x121)]-0x1,_0x13b13d;_0x4fba82>=0x0;_0x4fba82--)(_0x13b13d=_0x4752d3[_0x4fba82])&&(_0x359ab7=_0x13b13d(_0x359ab7)||_0x359ab7);return _0x359ab7;},w=(_0x48566f,_0x1b73c8)=>(_0x339429,_0x482147)=>_0x1b73c8(_0x339429,_0x482147,_0x48566f),$=(_0x5e0f3e,_0x12d9e5,_0x3bdc21)=>ne(_0x5e0f3e,typeof _0x12d9e5!='symbol'?_0x12d9e5+'':_0x12d9e5,_0x3bdc21);let b=class extends _0x341216{constructor(_0x313507=M,_0x1b58fa,_0x5165ba){const _0x2221f8=_0x297170;super(),this['_config']=_0x313507,this[_0x2221f8(0x10a)]=_0x1b58fa,this[_0x2221f8(0x128)]=_0x5165ba;const {..._0x4384e8}=_0x2c3e44({},M,this[_0x2221f8(0x112)]);this[_0x2221f8(0x128)][_0x2221f8(0x12b)](z,_0x4384e8);}[_0x297170(0x105)](){const _0x5b3bac=_0x297170;[[f],[g],[S]][_0x5b3bac(0x13a)](_0x5b3774=>{const _0x50a89d=_0x5b3bac;this[_0x50a89d(0x10a)][_0x50a89d(0x116)](_0x5b3774);});}[_0x297170(0x123)](){const _0x2c0756=_0x297170;this[_0x2c0756(0x10a)][_0x2c0756(0x12d)](g),this[_0x2c0756(0x10a)]['get'](S);}};$(b,_0x297170(0xfc),W),$(b,_0x297170(0x13c),_0x2678d6['UNIVER_UNKNOWN']),b=ie([_0x557d35(_0x16c7d9,_0x32f6c5,_0x3729ac),w(0x1,_0x3ff32b(_0x47bae4)),w(0x2,_0x309048)],b);export{b as UniverThreadCommentDataSourcePlugin};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x583c(_0x448ca6,_0x43c3b5){const _0x4372d5=_0x4372();return _0x583c=function(_0x583cc9,_0x564864){_0x583cc9=_0x583cc9-0xe9;let _0x4b6854=_0x4372d5[_0x583cc9];return _0x4b6854;},_0x583c(_0x448ca6,_0x43c3b5);}function _0x4372(){const _0x17ea52=['replies','payload','Disposable','unitId','parse','addComment','Injector','onStarting','replyId','dataSource','ref','rangeType','5641480ODDsKa','_sessionService','OpenOrReOpen','Reply','addUser','_injector','426JrNbJl','thread-comment-data-source.config','YYYY/MM/DD\x20HH:mm','70eGtqvj','Solved','/universer-api/user/list','CustomRangeType','ThreadCommentModel','comments','2513vaCMhY','Solve','solved','@univerjs/core','_configService','UniverProLicense','/universer-api/comment/unit/','_initDataSource','getUnit','_userService','Add','Plugin','disposeWithMe','createTimestamp','4458FcyKrD','userId','4035361QwfyBM','dayjs','error','/delete','2087120AXdMEk','syncUpdateMutationToColla','post','UniverThreadCommentDataSourcePlugin','add','COMMENT','@univerjs/thread-comment','11478qqZZJE','delete','getUser','UNIVER_UNKNOWN','_httpService','format','pipe','object','/reply','toStringTag','_config','1570167vfSmmT','root','user','comment','updateComment','size','_commentService','customRanges','_threadCommentDataSource','IThreadCommentDataSourceService','Edit','content','@univerjs/thread-comment-ui','resolveComment','defineProperty','filter','/solved','Unknown','merge','@univerjs-pro/collaboration-client','getOwnPropertyDescriptor','stringify','commentUpdate$','DependentOn','8MrJhIq','find','personId','CollaborationSessionService','forEach','UNRECOGNIZED','@univerjs-pro/license','exports','_initUserSync','_init','/list','length','getMemberID','_threadCommentModel','478134deHNxF','body','_threadCommentDataSourceService','Delete','rangeId','getCurrentUser','UniverThreadCommentUIPlugin','values','code','UniverCore','reply','bufferTime','users','Module','UniverProThreadCommentDatasource','UniverInstanceType','map','deleteComment','IConfigService','UniverThreadCommentUi','function','threadId','UniverCollaborationClientPlugin','rxjs','HTTPService','Inject','get','requireSession','subscribe','parentId','@univerjs/network','UniverNetwork','/edit','userID','setConfig','UserManagerService'];_0x4372=function(){return _0x17ea52;};return _0x4372();}(function(_0x42e37a,_0x5b650d){const _0x2bf550=_0x583c,_0x316d48=_0x42e37a();while(!![]){try{const _0x27fa08=parseInt(_0x2bf550(0xf4))/0x1*(parseInt(_0x2bf550(0x10b))/0x2)+parseInt(_0x2bf550(0x149))/0x3+-parseInt(_0x2bf550(0x13b))/0x4*(-parseInt(_0x2bf550(0x111))/0x5)+parseInt(_0x2bf550(0x118))/0x6*(parseInt(_0x2bf550(0xfd))/0x7)+parseInt(_0x2bf550(0xee))/0x8+-parseInt(_0x2bf550(0x123))/0x9+parseInt(_0x2bf550(0xf7))/0xa*(-parseInt(_0x2bf550(0x10d))/0xb);if(_0x27fa08===_0x5b650d)break;else _0x316d48['push'](_0x316d48['shift']());}catch(_0x103e61){_0x316d48['push'](_0x316d48['shift']());}}}(_0x4372,0x90da0),function(_0x3712fb,_0xc64564){const _0x23e2e0=_0x583c;typeof exports==_0x23e2e0(0x11f)&&typeof module<'u'?_0xc64564(exports,require(_0x23e2e0(0x136)),require(_0x23e2e0(0x141)),require(_0x23e2e0(0x100)),require('@univerjs/thread-comment-ui'),require(_0x23e2e0(0x117)),require(_0x23e2e0(0x160)),require(_0x23e2e0(0x167))):typeof define==_0x23e2e0(0x15d)&&define['amd']?define([_0x23e2e0(0x142),_0x23e2e0(0x136),_0x23e2e0(0x141),_0x23e2e0(0x100),_0x23e2e0(0x12f),_0x23e2e0(0x117),_0x23e2e0(0x160),_0x23e2e0(0x167)],_0xc64564):(_0x3712fb=typeof globalThis<'u'?globalThis:_0x3712fb||self,_0xc64564(_0x3712fb[_0x23e2e0(0x157)]={},_0x3712fb['UniverProCollaborationClient'],_0x3712fb[_0x23e2e0(0x102)],_0x3712fb[_0x23e2e0(0x152)],_0x3712fb[_0x23e2e0(0x15c)],_0x3712fb['UniverThreadComment'],_0x3712fb[_0x23e2e0(0x160)],_0x3712fb[_0x23e2e0(0x168)]));}(this,function(_0x6a332c,_0x5ed8c0,_0x3750e3,_0x575f15,_0x4a658b,_0x254c84,_0x211f0d,_0x2daee6){'use strict';const _0x239848=_0x583c;const _0x5902bc='UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN';var _0x3af9f5=(_0x4a6fa3=>(_0x4a6fa3[_0x4a6fa3[_0x239848(0xf0)]=0x0]=_0x239848(0xf0),_0x4a6fa3[_0x4a6fa3['Solved']=0x1]=_0x239848(0xf8),_0x4a6fa3[_0x4a6fa3[_0x239848(0x140)]=-0x1]=_0x239848(0x140),_0x4a6fa3))(_0x3af9f5||{}),_0x1b4ca8=(_0x576bd7=>(_0x576bd7[_0x576bd7[_0x239848(0x134)]=0x0]=_0x239848(0x134),_0x576bd7[_0x576bd7[_0x239848(0x107)]=0x1]=_0x239848(0x107),_0x576bd7[_0x576bd7[_0x239848(0xf1)]=0x2]=_0x239848(0xf1),_0x576bd7[_0x576bd7[_0x239848(0x12d)]=0x3]=_0x239848(0x12d),_0x576bd7[_0x576bd7[_0x239848(0x14c)]=0x4]=_0x239848(0x14c),_0x576bd7[_0x576bd7[_0x239848(0xfe)]=0x5]=_0x239848(0xfe),_0x576bd7[_0x576bd7[_0x239848(0x140)]=-0x1]='UNRECOGNIZED',_0x576bd7))(_0x1b4ca8||{});const _0x1aed35=_0x3d6807=>_0x575f15[_0x239848(0x10e)](new Date(+_0x3d6807))[_0x239848(0x11d)](_0x239848(0xf6)),_0x24af04=async(_0x6d4a36,_0x1ced8e)=>{const _0x1527eb=_0x239848,_0x345032=_0x6d4a36['get'](_0x575f15[_0x1527eb(0x16c)]),_0x5f5452=_0x6d4a36[_0x1527eb(0x163)](_0x2daee6[_0x1527eb(0x161)]);_0x1ced8e[_0x1527eb(0x13f)](_0x3ad163=>{const _0x14d846=_0x1527eb;_0x345032[_0x14d846(0x11a)](_0x3ad163)&&_0x1ced8e[_0x14d846(0x119)](_0x3ad163);}),_0x1ced8e[_0x1527eb(0x128)]&&(await _0x5f5452[_0x1527eb(0x163)](_0x1527eb(0xf9),{'params':{'userIDs':[..._0x1ced8e]}}))[_0x1527eb(0x14a)][_0x1527eb(0x155)][_0x1527eb(0x13f)](_0x2c89ca=>{const _0x2e143e=_0x1527eb;_0x2c89ca&&_0x345032[_0x2e143e(0xf2)](_0x2c89ca);});};var _0x28c919=Object['getOwnPropertyDescriptor'],_0x4faf2b=(_0x3b0835,_0x2e6b16,_0x412557,_0x3f645b)=>{const _0x460452=_0x239848;for(var _0x3b7c8a=_0x3f645b>0x1?void 0x0:_0x3f645b?_0x28c919(_0x2e6b16,_0x412557):_0x2e6b16,_0x7c31a2=_0x3b0835[_0x460452(0x146)]-0x1,_0x4dc9c9;_0x7c31a2>=0x0;_0x7c31a2--)(_0x4dc9c9=_0x3b0835[_0x7c31a2])&&(_0x3b7c8a=_0x4dc9c9(_0x3b7c8a)||_0x3b7c8a);return _0x3b7c8a;},_0x28c0d4=(_0x4f852f,_0x48ebab)=>(_0x75d321,_0x9d5c6f)=>_0x48ebab(_0x75d321,_0x9d5c6f,_0x4f852f);let _0x2a7b45=class extends _0x575f15[_0x239848(0x16f)]{constructor(_0x2cbb2e,_0x4777c8,_0x41ba7a,_0x3dd1f9){const _0x535eda=_0x239848;super(),this[_0x535eda(0x129)]=_0x2cbb2e,this[_0x535eda(0x148)]=_0x4777c8,this['_userService']=_0x41ba7a,this[_0x535eda(0xf3)]=_0x3dd1f9,this['_init'](),this['_initUserSync']();}[_0x239848(0x143)](){const _0x4a2ca2=_0x239848;this[_0x4a2ca2(0x109)](this['_threadCommentModel'][_0x4a2ca2(0x139)][_0x4a2ca2(0x11e)](_0x211f0d[_0x4a2ca2(0x154)](0x10))[_0x4a2ca2(0x165)](_0x5c99da=>{const _0x308905=_0x4a2ca2,_0x5da793=new Set();_0x5c99da[_0x308905(0x13f)](_0x289e45=>{const _0x275902=_0x308905;switch(_0x289e45['type']){case'add':{const _0x4bb9cf=_0x289e45[_0x275902(0x16e)][_0x275902(0x13d)];_0x5da793[_0x275902(0x115)](_0x4bb9cf);break;}}}),_0x24af04(this[_0x308905(0xf3)],_0x5da793);}));}[_0x239848(0x144)](){const _0x132b08=_0x239848;this['disposeWithMe'](this[_0x132b08(0x129)]['commentUpdate$'][_0x132b08(0x165)](async _0x55c948=>{const _0x2c8dc8=_0x132b08;var _0x3e186c,_0x18a275,_0x246f5a,_0x14f9cf;const _0x3c8284=(_0x3e186c=this[_0x2c8dc8(0x148)][_0x2c8dc8(0x105)](_0x55c948[_0x2c8dc8(0x170)])[_0x2c8dc8(0x13c)](_0x53a8ab=>_0x53a8ab[_0x2c8dc8(0x15e)]===_0x55c948['threadId']))==null?void 0x0:_0x3e186c[_0x2c8dc8(0x124)];if(!_0x3c8284)return;const {unitId:_0x362d42,subUnitId:_0x61ac69}=_0x3c8284;switch(_0x55c948[_0x2c8dc8(0x125)]&&this[_0x2c8dc8(0x106)][_0x2c8dc8(0xf2)](_0x55c948[_0x2c8dc8(0x125)]),_0x55c948['type']){case _0x1b4ca8[_0x2c8dc8(0x107)]:break;case _0x1b4ca8[_0x2c8dc8(0xf1)]:{this[_0x2c8dc8(0x148)][_0x2c8dc8(0x172)](_0x362d42,_0x61ac69,{'unitId':_0x362d42,'subUnitId':_0x61ac69,'ref':'','id':_0x55c948[_0x2c8dc8(0xea)],'dT':_0x1aed35(+_0x55c948[_0x2c8dc8(0x10a)]),'threadId':_0x55c948['threadId'],'personId':(_0x246f5a=(_0x18a275=_0x55c948[_0x2c8dc8(0x125)])==null?void 0x0:_0x18a275[_0x2c8dc8(0x16a)])!=null?_0x246f5a:_0x55c948['userId'],'text':JSON[_0x2c8dc8(0x171)](_0x55c948['content']),'parentId':_0x3c8284['id']});break;}case _0x1b4ca8['Delete']:{const _0x30d789=this[_0x2c8dc8(0x148)]['getComment'](_0x362d42,_0x61ac69,_0x55c948['replyId']);_0x30d789&&_0x30d789[_0x2c8dc8(0x166)]&&this[_0x2c8dc8(0x148)][_0x2c8dc8(0x15a)](_0x362d42,_0x61ac69,_0x55c948['replyId']);break;}case _0x1b4ca8['Edit']:{this[_0x2c8dc8(0x148)][_0x2c8dc8(0x127)](_0x362d42,_0x61ac69,{'commentId':_0x55c948[_0x2c8dc8(0xea)],'text':JSON[_0x2c8dc8(0x171)](_0x55c948[_0x2c8dc8(0x12e)])});break;}case _0x1b4ca8[_0x2c8dc8(0xfe)]:{const _0x9f7010=(_0x14f9cf=this[_0x2c8dc8(0x148)][_0x2c8dc8(0x105)](_0x55c948[_0x2c8dc8(0x170)])['find'](_0x261594=>_0x261594['threadId']===_0x55c948[_0x2c8dc8(0x15e)]))==null?void 0x0:_0x14f9cf[_0x2c8dc8(0x124)];_0x9f7010&&this['_threadCommentModel']['resolveComment'](_0x362d42,_0x61ac69,_0x9f7010['id'],_0x55c948[_0x2c8dc8(0xff)]===_0x3af9f5['Solved']);break;}}}));}};_0x2a7b45=_0x4faf2b([_0x28c0d4(0x0,_0x575f15[_0x239848(0x162)](_0x5ed8c0['CommentService'])),_0x28c0d4(0x1,_0x575f15['Inject'](_0x254c84[_0x239848(0xfb)])),_0x28c0d4(0x2,_0x575f15[_0x239848(0x162)](_0x575f15[_0x239848(0x16c)])),_0x28c0d4(0x3,_0x575f15[_0x239848(0x162)](_0x575f15[_0x239848(0x173)]))],_0x2a7b45);const _0x5d5fcb=_0x239848(0xf5),_0x3c7908={};var _0x5e0987=Object[_0x239848(0x137)],_0x548227=(_0x230faf,_0x4b5bf2,_0x7fe616,_0x3fae5b)=>{for(var _0x58efa0=_0x3fae5b>0x1?void 0x0:_0x3fae5b?_0x5e0987(_0x4b5bf2,_0x7fe616):_0x4b5bf2,_0x1a2f57=_0x230faf['length']-0x1,_0x215b48;_0x1a2f57>=0x0;_0x1a2f57--)(_0x215b48=_0x230faf[_0x1a2f57])&&(_0x58efa0=_0x215b48(_0x58efa0)||_0x58efa0);return _0x58efa0;},_0x44d073=(_0x4386d7,_0x3d3d02)=>(_0x5cc2d9,_0x438af7)=>_0x3d3d02(_0x5cc2d9,_0x438af7,_0x4386d7);function _0x474a87(_0x556243,_0x9fe308){const _0x19290e=_0x239848,_0x582d55=_0x556243['replies'][0x0];return{..._0x9fe308,'id':_0x582d55[_0x19290e(0xea)],'resolved':_0x556243[_0x19290e(0xff)]===0x1,'dT':_0x1aed35(_0x582d55[_0x19290e(0x10a)]),'personId':_0x582d55[_0x19290e(0x10c)],'threadId':_0x582d55[_0x19290e(0x15e)]};}function _0xde0284(_0x77f13f,_0x102563,_0x46d7a7){const _0x3d9d4e=_0x239848;var _0x43ae80,_0x118c7d;if(((_0x118c7d=(_0x43ae80=_0x77f13f==null?void 0x0:_0x77f13f[_0x3d9d4e(0x16d)])==null?void 0x0:_0x43ae80[_0x3d9d4e(0x146)])!=null?_0x118c7d:0x0)>0x0){const _0x49eaf6=(_0x59c2e1,_0x21354a)=>({'id':_0x59c2e1[_0x3d9d4e(0xea)],'threadId':_0x59c2e1[_0x3d9d4e(0x15e)],'dT':_0x1aed35(_0x59c2e1[_0x3d9d4e(0x10a)]),'personId':_0x59c2e1['userId'],'resolved':_0x77f13f['solved']===_0x3af9f5[_0x3d9d4e(0xf8)],'unitId':_0x102563,'subUnitId':_0x46d7a7,'text':JSON['parse'](_0x59c2e1[_0x3d9d4e(0x12e)]),'parentId':_0x21354a}),_0x498fb9=_0x49eaf6(_0x77f13f[_0x3d9d4e(0x16d)][0x0]);return{..._0x498fb9,'children':_0x77f13f[_0x3d9d4e(0x16d)]['slice'](0x1)[_0x3d9d4e(0x159)](_0x2c317f=>_0x49eaf6(_0x2c317f,_0x498fb9['id']))};}return null;}let _0x3476f6=class{constructor(_0x43e627,_0x14173d,_0x328d92,_0x1c2fe7){const _0x36be8c=_0x239848;this[_0x36be8c(0x11c)]=_0x43e627,this[_0x36be8c(0x106)]=_0x14173d,this[_0x36be8c(0xef)]=_0x328d92,this[_0x36be8c(0xf3)]=_0x1c2fe7;}async[_0x239848(0x172)](_0x376dd5){const _0x487659=_0x239848;var _0x336521,_0x5bd9b2;const {parentId:_0x41e3f7,unitId:_0x245607,text:_0x5136b2,threadId:_0x14214e}=_0x376dd5,_0x112ef9=(_0x5bd9b2=(_0x336521=_0x5136b2[_0x487659(0x12a)])==null?void 0x0:_0x336521[_0x487659(0x132)](_0x3022a8=>_0x3022a8[_0x487659(0xed)]===_0x575f15[_0x487659(0xfa)][_0x487659(0x116)])[_0x487659(0x159)](_0x311131=>_0x311131[_0x487659(0x14d)]))!=null?_0x5bd9b2:[],_0x157c45=JSON['stringify'](_0x5136b2),_0x36d97a=(await this[_0x487659(0xef)][_0x487659(0x164)](_0x245607))[_0x487659(0x147)]();if(_0x41e3f7){const _0x2036a7={'memberId':_0x36d97a,'unitId':_0x245607,'content':_0x157c45,'mention':_0x112ef9,'threadId':_0x14214e},_0x5931f3=(await this[_0x487659(0x11c)][_0x487659(0x113)]('/universer-api/comment/unit/'+_0x245607+_0x487659(0x120),{'body':_0x2036a7}))[_0x487659(0x14a)][_0x487659(0x153)];return{..._0x376dd5,'id':_0x5931f3[_0x487659(0xea)],'dT':_0x575f15[_0x487659(0x10e)](+_0x5931f3['createTimestamp'])[_0x487659(0x11d)]('YYYY/MM/DD\x20HH:mm'),'personId':_0x5931f3[_0x487659(0x10c)]};}else{const _0x6928ca={'memberId':_0x36d97a,'unitId':_0x245607,'content':_0x157c45,'mention':_0x112ef9},_0x3c9198=await this[_0x487659(0x11c)][_0x487659(0x113)](_0x487659(0x103)+_0x245607+'/add',{'body':_0x6928ca});return _0x474a87(_0x3c9198['body'][_0x487659(0x126)],_0x376dd5);}}async['updateComment'](_0x46aeb9){const _0x1f40ac=_0x239848;var _0x272c4f,_0x358791;const {text:_0x23420a,unitId:_0x552a69}=_0x46aeb9,_0x11c2a3=(_0x358791=(_0x272c4f=_0x23420a['customRanges'])==null?void 0x0:_0x272c4f[_0x1f40ac(0x132)](_0x305076=>_0x305076[_0x1f40ac(0xed)]===_0x575f15[_0x1f40ac(0xfa)][_0x1f40ac(0x116)])['map'](_0x5c2d8e=>_0x5c2d8e[_0x1f40ac(0x14d)]))!=null?_0x358791:[],_0x405748=JSON[_0x1f40ac(0x138)](_0x23420a),_0x98cbe1=_0x46aeb9['threadId'],_0x4793e5=_0x46aeb9['id'],_0x4a5dc7={'memberId':(await this[_0x1f40ac(0xef)][_0x1f40ac(0x164)](_0x552a69))[_0x1f40ac(0x147)](),'unitId':_0x552a69,'threadId':_0x98cbe1,'mention':_0x11c2a3,'content':_0x405748,'replyId':_0x4793e5},_0x144f91=await this[_0x1f40ac(0x11c)][_0x1f40ac(0x113)](_0x1f40ac(0x103)+_0x552a69+_0x1f40ac(0x169),{'body':_0x4a5dc7});return!_0x144f91[_0x1f40ac(0x14a)]['error']||_0x144f91[_0x1f40ac(0x14a)]['error'][_0x1f40ac(0x151)]===0x1;}async[_0x239848(0x130)](_0xd52baa){const _0x305033=_0x239848,{unitId:_0x33eab6}=_0xd52baa,_0x4a7e29=_0xd52baa[_0x305033(0x15e)],_0x15d8b1={'memberId':this[_0x305033(0x106)][_0x305033(0x14e)]()[_0x305033(0x16a)],'unitId':_0x33eab6,'threadId':_0x4a7e29,'solved':_0xd52baa['resolved']?_0x3af9f5[_0x305033(0xf8)]:_0x3af9f5[_0x305033(0xf0)]},_0x5b51e2=await this[_0x305033(0x11c)][_0x305033(0x113)](_0x305033(0x103)+_0x33eab6+_0x305033(0x133),{'body':_0x15d8b1});return!_0x5b51e2[_0x305033(0x14a)][_0x305033(0x10f)]||_0x5b51e2[_0x305033(0x14a)][_0x305033(0x10f)][_0x305033(0x151)]===0x1;}async[_0x239848(0x15a)](_0x55e9c7,_0xa77323,_0x4babf3,_0x14157c){const _0x2bb11a=_0x239848,_0x456b3b={'memberId':(await this['_sessionService'][_0x2bb11a(0x164)](_0x55e9c7))[_0x2bb11a(0x147)](),'threadId':_0x4babf3,'replyId':_0x14157c,'unitId':_0x55e9c7},_0x303020=await this[_0x2bb11a(0x11c)][_0x2bb11a(0x113)]('/universer-api/comment/unit/'+_0x55e9c7+_0x2bb11a(0x110),{'body':_0x456b3b});return!_0x303020[_0x2bb11a(0x14a)][_0x2bb11a(0x10f)]||_0x303020[_0x2bb11a(0x14a)][_0x2bb11a(0x10f)]['code']===0x1;}async['listComments'](_0x5baf61,_0x1bdb8b,_0x4be464){const _0x5116bb=_0x239848,_0x40396f={'unitId':_0x5baf61,'threadId':_0x4be464},_0x2f50c6=await this[_0x5116bb(0x11c)][_0x5116bb(0x113)]('/universer-api/comment/unit/'+_0x5baf61+_0x5116bb(0x145),{'body':_0x40396f}),_0x23179a=_0x4be464['map'](_0x1a8042=>_0xde0284(_0x2f50c6[_0x5116bb(0x14a)][_0x5116bb(0xfc)][_0x1a8042],_0x5baf61,_0x1bdb8b))['filter'](Boolean);return Object[_0x5116bb(0x150)](_0x2f50c6[_0x5116bb(0x14a)][_0x5116bb(0x155)])['forEach'](_0xc4978b=>{const _0x350a23=_0x5116bb;this[_0x350a23(0x106)][_0x350a23(0xf2)](_0xc4978b);}),_0x23179a;}['saveCommentToSnapshot'](_0x60b7c){const _0x1a44e9=_0x239848;return{'id':_0x60b7c['id'],'threadId':_0x60b7c[_0x1a44e9(0x15e)],'ref':_0x60b7c[_0x1a44e9(0xec)]};}};_0x3476f6=_0x548227([_0x44d073(0x0,_0x575f15[_0x239848(0x162)](_0x2daee6[_0x239848(0x161)])),_0x44d073(0x1,_0x575f15[_0x239848(0x162)](_0x575f15[_0x239848(0x16c)])),_0x44d073(0x2,_0x575f15[_0x239848(0x162)](_0x5ed8c0[_0x239848(0x13e)])),_0x44d073(0x3,_0x575f15['Inject'](_0x575f15[_0x239848(0x173)]))],_0x3476f6);var _0x1490a1=Object[_0x239848(0x137)],_0x84035a=(_0x3d2720,_0x3a949b,_0x54a797,_0x1712d2)=>{const _0x4a753e=_0x239848;for(var _0x24cf1c=_0x1712d2>0x1?void 0x0:_0x1712d2?_0x1490a1(_0x3a949b,_0x54a797):_0x3a949b,_0x5118a8=_0x3d2720[_0x4a753e(0x146)]-0x1,_0x1bb2d2;_0x5118a8>=0x0;_0x5118a8--)(_0x1bb2d2=_0x3d2720[_0x5118a8])&&(_0x24cf1c=_0x1bb2d2(_0x24cf1c)||_0x24cf1c);return _0x24cf1c;},_0x2bf312=(_0x8c54c4,_0x5d9bb1)=>(_0x52d04c,_0x2f17e9)=>_0x5d9bb1(_0x52d04c,_0x2f17e9,_0x8c54c4);let _0x24dbfc=class extends _0x575f15[_0x239848(0x16f)]{constructor(_0x1f0cdd,_0x544a83){const _0x24df9e=_0x239848;super(),this['_threadCommentDataSourceService']=_0x1f0cdd,this['_threadCommentDataSource']=_0x544a83,this[_0x24df9e(0x104)]();}[_0x239848(0x104)](){const _0xba6664=_0x239848;this[_0xba6664(0x14b)][_0xba6664(0xeb)]=this[_0xba6664(0x12b)],this[_0xba6664(0x14b)][_0xba6664(0x112)]=!0x1;}};_0x24dbfc=_0x84035a([_0x2bf312(0x0,_0x254c84[_0x239848(0x12c)]),_0x2bf312(0x1,_0x575f15['Inject'](_0x3476f6))],_0x24dbfc);var _0x17f487=Object[_0x239848(0x131)],_0xe44086=Object[_0x239848(0x137)],_0x261cdc=(_0x4d6a2c,_0x55f7b5,_0x246ac7)=>_0x55f7b5 in _0x4d6a2c?_0x17f487(_0x4d6a2c,_0x55f7b5,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x246ac7}):_0x4d6a2c[_0x55f7b5]=_0x246ac7,_0x124413=(_0x24d9c9,_0x3773e1,_0x2b77c5,_0x5227b5)=>{const _0x16b290=_0x239848;for(var _0x1e1512=_0x5227b5>0x1?void 0x0:_0x5227b5?_0xe44086(_0x3773e1,_0x2b77c5):_0x3773e1,_0x38017b=_0x24d9c9[_0x16b290(0x146)]-0x1,_0x11d34f;_0x38017b>=0x0;_0x38017b--)(_0x11d34f=_0x24d9c9[_0x38017b])&&(_0x1e1512=_0x11d34f(_0x1e1512)||_0x1e1512);return _0x1e1512;},_0x15bec8=(_0x18d74d,_0x379dff)=>(_0x2a84dc,_0x3a3db4)=>_0x379dff(_0x2a84dc,_0x3a3db4,_0x18d74d),_0x13025c=(_0xea726c,_0x5cd399,_0x257adb)=>_0x261cdc(_0xea726c,typeof _0x5cd399!='symbol'?_0x5cd399+'':_0x5cd399,_0x257adb);_0x6a332c[_0x239848(0x114)]=class extends _0x575f15[_0x239848(0x108)]{constructor(_0x6eaf9c=_0x3c7908,_0x513f2b,_0x25107a){const _0xea7218=_0x239848;super(),this[_0xea7218(0x122)]=_0x6eaf9c,this[_0xea7218(0xf3)]=_0x513f2b,this[_0xea7218(0x101)]=_0x25107a;const {..._0x2477b0}=_0x575f15[_0xea7218(0x135)]({},_0x3c7908,this[_0xea7218(0x122)]);this[_0xea7218(0x101)][_0xea7218(0x16b)](_0x5d5fcb,_0x2477b0);}[_0x239848(0xe9)](){const _0x4aba69=_0x239848;[[_0x3476f6],[_0x24dbfc],[_0x2a7b45]][_0x4aba69(0x13f)](_0x38a5db=>{const _0x21eb6b=_0x4aba69;this['_injector'][_0x21eb6b(0x115)](_0x38a5db);});}['onReady'](){const _0x5c4dfb=_0x239848;this[_0x5c4dfb(0xf3)][_0x5c4dfb(0x163)](_0x24dbfc),this['_injector'][_0x5c4dfb(0x163)](_0x2a7b45);}},_0x13025c(_0x6a332c[_0x239848(0x114)],'pluginName',_0x5902bc),_0x13025c(_0x6a332c[_0x239848(0x114)],'type',_0x575f15[_0x239848(0x158)][_0x239848(0x11b)]),_0x6a332c[_0x239848(0x114)]=_0x124413([_0x575f15[_0x239848(0x13a)](_0x4a658b[_0x239848(0x14f)],_0x5ed8c0[_0x239848(0x15f)],_0x3750e3['UniverLicensePlugin']),_0x15bec8(0x1,_0x575f15['Inject'](_0x575f15['Injector'])),_0x15bec8(0x2,_0x575f15[_0x239848(0x15b)])],_0x6a332c[_0x239848(0x114)]),Object[_0x239848(0x131)](_0x6a332c,Symbol[_0x239848(0x121)],{'value':_0x239848(0x156)});}));
|
|
1
|
+
function _0x1112(){const _0x4b0cba=['Add','solved','replies','Edit','_config','IConfigService','pluginName','UniverThreadCommentDataSourcePlugin','_httpService','customRanges','_threadCommentDataSourceService','map','2664204jdvbHY','_initDataSource','size','UNIVER_THREAD_COMMENT_DATA_SOURCE_PLUGIN','Solve','getUnit','2793801oyiLSv','Inject','addComment','root','disposeWithMe','Disposable','@univerjs/thread-comment-ui','dataSource','getUser','code','getComment','pipe','toStringTag','_commentService','object','/reply','subscribe','4eZZEEr','get','_sessionService','@univerjs/thread-comment','type','UniverProThreadCommentDatasource','body','@univerjs/core','UniverLicensePlugin','COMMENT','userID','reply','UserManagerService','6UcrZLU','/edit','commentUpdate$','CustomRangeType','find','personId','forEach','HTTPService','CollaborationSessionService','parse','UNRECOGNIZED','6659710TBUZyt','Solved','/solved','payload','userId','add','ref','deleteComment','369AmeUqr','dayjs','_init','unitId','_threadCommentModel','_initUserSync','@univerjs/network','254472kaXVmc','rangeType','values','delete','_threadCommentDataSource','user','listComments','Delete','1520958SDnoQM','/universer-api/comment/unit/','UniverProLicense','11799240rxStyU','resolveComment','bufferTime','_injector','/list','onReady','stringify','/universer-api/user/list','Unknown','/delete','Reply','threadId','rxjs','onStarting','_userService','rangeId','content','DependentOn','addUser','YYYY/MM/DD\x20HH:mm','@univerjs-pro/license','format','getOwnPropertyDescriptor','Injector','Plugin','replyId','UniverThreadComment','error','8149533aBUdKt','filter','ThreadCommentModel','parentId','defineProperty','getMemberID','saveCommentToSnapshot','CommentService','createTimestamp','function','@univerjs-pro/collaboration-client','_configService','post','OpenOrReOpen','requireSession','syncUpdateMutationToColla','users','setConfig','UniverProCollaborationClient','IThreadCommentDataSourceService','UniverCore'];_0x1112=function(){return _0x4b0cba;};return _0x1112();}function _0x161e(_0x14ee43,_0x2c0c88){const _0x111207=_0x1112();return _0x161e=function(_0x161e95,_0x1f046b){_0x161e95=_0x161e95-0x6e;let _0x2fddd1=_0x111207[_0x161e95];return _0x2fddd1;},_0x161e(_0x14ee43,_0x2c0c88);}(function(_0x1edce7,_0x4d7f6c){const _0x334bb7=_0x161e,_0x3fbab4=_0x1edce7();while(!![]){try{const _0x17f395=-parseInt(_0x334bb7(0xe0))/0x1+parseInt(_0x334bb7(0xb1))/0x2*(parseInt(_0x334bb7(0xa0))/0x3)+parseInt(_0x334bb7(0x9a))/0x4+-parseInt(_0x334bb7(0xc9))/0x5+parseInt(_0x334bb7(0xbe))/0x6*(parseInt(_0x334bb7(0x79))/0x7)+-parseInt(_0x334bb7(0xd8))/0x8*(-parseInt(_0x334bb7(0xd1))/0x9)+-parseInt(_0x334bb7(0xe3))/0xa;if(_0x17f395===_0x4d7f6c)break;else _0x3fbab4['push'](_0x3fbab4['shift']());}catch(_0xaf17ab){_0x3fbab4['push'](_0x3fbab4['shift']());}}}(_0x1112,0xeb635),function(_0x13e501,_0x1fa985){const _0x1c9895=_0x161e;typeof exports==_0x1c9895(0xae)&&typeof module<'u'?_0x1fa985(exports,require(_0x1c9895(0x83)),require(_0x1c9895(0x71)),require(_0x1c9895(0xb8)),require(_0x1c9895(0xa6)),require(_0x1c9895(0xb4)),require(_0x1c9895(0xef)),require('@univerjs/network')):typeof define==_0x1c9895(0x82)&&define['amd']?define(['exports',_0x1c9895(0x83),_0x1c9895(0x71),_0x1c9895(0xb8),_0x1c9895(0xa6),_0x1c9895(0xb4),'rxjs',_0x1c9895(0xd7)],_0x1fa985):(_0x13e501=typeof globalThis<'u'?globalThis:_0x13e501||self,_0x1fa985(_0x13e501[_0x1c9895(0xb6)]={},_0x13e501[_0x1c9895(0x8b)],_0x13e501[_0x1c9895(0xe2)],_0x13e501[_0x1c9895(0x8d)],_0x13e501['UniverThreadCommentUi'],_0x13e501[_0x1c9895(0x77)],_0x13e501['rxjs'],_0x13e501['UniverNetwork']));}(this,function(_0x51a636,_0x2b6358,_0x59453f,_0x54ffd4,_0x3067d4,_0x2ebc91,_0x157b87,_0x250d5f){'use strict';const _0x572099=_0x161e;const _0x3b74b7=_0x572099(0x9d);var _0xdf7756=(_0x186fea=>(_0x186fea[_0x186fea[_0x572099(0x86)]=0x0]=_0x572099(0x86),_0x186fea[_0x186fea[_0x572099(0xca)]=0x1]='Solved',_0x186fea[_0x186fea[_0x572099(0xc8)]=-0x1]=_0x572099(0xc8),_0x186fea))(_0xdf7756||{}),_0x3715e2=(_0x28258d=>(_0x28258d[_0x28258d[_0x572099(0xeb)]=0x0]=_0x572099(0xeb),_0x28258d[_0x28258d[_0x572099(0x8e)]=0x1]='Add',_0x28258d[_0x28258d[_0x572099(0xed)]=0x2]=_0x572099(0xed),_0x28258d[_0x28258d['Edit']=0x3]=_0x572099(0x91),_0x28258d[_0x28258d[_0x572099(0xdf)]=0x4]='Delete',_0x28258d[_0x28258d[_0x572099(0x9e)]=0x5]=_0x572099(0x9e),_0x28258d[_0x28258d[_0x572099(0xc8)]=-0x1]=_0x572099(0xc8),_0x28258d))(_0x3715e2||{});const _0x90f2d8=_0x4d6ca6=>_0x54ffd4[_0x572099(0xd2)](new Date(+_0x4d6ca6))[_0x572099(0x72)](_0x572099(0x70)),_0x98a820=async(_0xb4e071,_0x2d6b41)=>{const _0x4fde0b=_0x572099,_0x2f61e1=_0xb4e071['get'](_0x54ffd4['UserManagerService']),_0x4a548d=_0xb4e071[_0x4fde0b(0xb2)](_0x250d5f[_0x4fde0b(0xc5)]);_0x2d6b41[_0x4fde0b(0xc4)](_0x2324f1=>{const _0x5d6587=_0x4fde0b;_0x2f61e1[_0x5d6587(0xa8)](_0x2324f1)&&_0x2d6b41[_0x5d6587(0xdb)](_0x2324f1);}),_0x2d6b41[_0x4fde0b(0x9c)]&&(await _0x4a548d[_0x4fde0b(0xb2)](_0x4fde0b(0xea),{'params':{'userIDs':[..._0x2d6b41]}}))[_0x4fde0b(0xb7)][_0x4fde0b(0x89)]['forEach'](_0x2a0195=>{_0x2a0195&&_0x2f61e1['addUser'](_0x2a0195);});};var _0x29f4ff=Object['getOwnPropertyDescriptor'],_0x25e013=(_0x136a56,_0x5b47ad,_0x3d566c,_0x3cea01)=>{for(var _0x448435=_0x3cea01>0x1?void 0x0:_0x3cea01?_0x29f4ff(_0x5b47ad,_0x3d566c):_0x5b47ad,_0x4bcb8a=_0x136a56['length']-0x1,_0x1c2bc6;_0x4bcb8a>=0x0;_0x4bcb8a--)(_0x1c2bc6=_0x136a56[_0x4bcb8a])&&(_0x448435=_0x1c2bc6(_0x448435)||_0x448435);return _0x448435;},_0x5cd4a0=(_0xac2cf4,_0x943a75)=>(_0x5387ee,_0x5a063d)=>_0x943a75(_0x5387ee,_0x5a063d,_0xac2cf4);let _0x5bf372=class extends _0x54ffd4['Disposable']{constructor(_0xa26889,_0x32d3a0,_0x2a9bb0,_0x1c7642){const _0x385ce1=_0x572099;super(),this[_0x385ce1(0xad)]=_0xa26889,this[_0x385ce1(0xd5)]=_0x32d3a0,this[_0x385ce1(0xf1)]=_0x2a9bb0,this[_0x385ce1(0xe6)]=_0x1c7642,this[_0x385ce1(0xd3)](),this[_0x385ce1(0xd6)]();}[_0x572099(0xd6)](){const _0x4f52cc=_0x572099;this[_0x4f52cc(0xa4)](this[_0x4f52cc(0xd5)][_0x4f52cc(0xc0)][_0x4f52cc(0xab)](_0x157b87[_0x4f52cc(0xe5)](0x10))['subscribe'](_0x353ec2=>{const _0x45ea74=_0x4f52cc,_0x392500=new Set();_0x353ec2['forEach'](_0x5d69a8=>{const _0x3b7b06=_0x161e;switch(_0x5d69a8['type']){case _0x3b7b06(0xce):{const _0x4f12bf=_0x5d69a8[_0x3b7b06(0xcc)][_0x3b7b06(0xc3)];_0x392500['add'](_0x4f12bf);break;}}}),_0x98a820(this[_0x45ea74(0xe6)],_0x392500);}));}[_0x572099(0xd3)](){const _0x363196=_0x572099;this[_0x363196(0xa4)](this['_commentService'][_0x363196(0xc0)][_0x363196(0xb0)](async _0x381a48=>{const _0xfa0907=_0x363196;var _0x4e343a,_0x459d32,_0x5596ce,_0x219bca;const _0x1fe0da=(_0x4e343a=this['_threadCommentModel']['getUnit'](_0x381a48[_0xfa0907(0xd4)])[_0xfa0907(0xc2)](_0x4a30aa=>_0x4a30aa['threadId']===_0x381a48[_0xfa0907(0xee)]))==null?void 0x0:_0x4e343a['root'];if(!_0x1fe0da)return;const {unitId:_0x4bbfdd,subUnitId:_0x3c8e46}=_0x1fe0da;switch(_0x381a48['user']&&this[_0xfa0907(0xf1)]['addUser'](_0x381a48[_0xfa0907(0xdd)]),_0x381a48[_0xfa0907(0xb5)]){case _0x3715e2[_0xfa0907(0x8e)]:break;case _0x3715e2['Reply']:{this[_0xfa0907(0xd5)][_0xfa0907(0xa2)](_0x4bbfdd,_0x3c8e46,{'unitId':_0x4bbfdd,'subUnitId':_0x3c8e46,'ref':'','id':_0x381a48['replyId'],'dT':_0x90f2d8(+_0x381a48['createTimestamp']),'threadId':_0x381a48[_0xfa0907(0xee)],'personId':(_0x5596ce=(_0x459d32=_0x381a48[_0xfa0907(0xdd)])==null?void 0x0:_0x459d32[_0xfa0907(0xbb)])!=null?_0x5596ce:_0x381a48[_0xfa0907(0xcd)],'text':JSON['parse'](_0x381a48[_0xfa0907(0xf3)]),'parentId':_0x1fe0da['id']});break;}case _0x3715e2[_0xfa0907(0xdf)]:{const _0x7aa9c3=this[_0xfa0907(0xd5)][_0xfa0907(0xaa)](_0x4bbfdd,_0x3c8e46,_0x381a48[_0xfa0907(0x76)]);_0x7aa9c3&&_0x7aa9c3[_0xfa0907(0x7c)]&&this[_0xfa0907(0xd5)][_0xfa0907(0xd0)](_0x4bbfdd,_0x3c8e46,_0x381a48[_0xfa0907(0x76)]);break;}case _0x3715e2[_0xfa0907(0x91)]:{this['_threadCommentModel']['updateComment'](_0x4bbfdd,_0x3c8e46,{'commentId':_0x381a48['replyId'],'text':JSON[_0xfa0907(0xc7)](_0x381a48[_0xfa0907(0xf3)])});break;}case _0x3715e2[_0xfa0907(0x9e)]:{const _0x63de75=(_0x219bca=this[_0xfa0907(0xd5)][_0xfa0907(0x9f)](_0x381a48[_0xfa0907(0xd4)])[_0xfa0907(0xc2)](_0x40c982=>_0x40c982[_0xfa0907(0xee)]===_0x381a48[_0xfa0907(0xee)]))==null?void 0x0:_0x219bca[_0xfa0907(0xa3)];_0x63de75&&this[_0xfa0907(0xd5)][_0xfa0907(0xe4)](_0x4bbfdd,_0x3c8e46,_0x63de75['id'],_0x381a48[_0xfa0907(0x8f)]===_0xdf7756[_0xfa0907(0xca)]);break;}}}));}};_0x5bf372=_0x25e013([_0x5cd4a0(0x0,_0x54ffd4[_0x572099(0xa1)](_0x2b6358[_0x572099(0x80)])),_0x5cd4a0(0x1,_0x54ffd4['Inject'](_0x2ebc91[_0x572099(0x7b)])),_0x5cd4a0(0x2,_0x54ffd4[_0x572099(0xa1)](_0x54ffd4[_0x572099(0xbd)])),_0x5cd4a0(0x3,_0x54ffd4['Inject'](_0x54ffd4[_0x572099(0x74)]))],_0x5bf372);const _0xc03f36='thread-comment-data-source.config',_0xa91f75={};var _0x44e6f5=Object[_0x572099(0x73)],_0x560841=(_0x2c627c,_0x45fa1d,_0x34bfb3,_0x2f67b6)=>{for(var _0x3ecac3=_0x2f67b6>0x1?void 0x0:_0x2f67b6?_0x44e6f5(_0x45fa1d,_0x34bfb3):_0x45fa1d,_0x575842=_0x2c627c['length']-0x1,_0x467e2a;_0x575842>=0x0;_0x575842--)(_0x467e2a=_0x2c627c[_0x575842])&&(_0x3ecac3=_0x467e2a(_0x3ecac3)||_0x3ecac3);return _0x3ecac3;},_0x2481fc=(_0x253287,_0x561a56)=>(_0x2b6d3b,_0x3686bb)=>_0x561a56(_0x2b6d3b,_0x3686bb,_0x253287);function _0x582824(_0x5d02be,_0x792373){const _0x5c68b0=_0x572099,_0x15e4ee=_0x5d02be['replies'][0x0];return{..._0x792373,'id':_0x15e4ee['replyId'],'resolved':_0x5d02be['solved']===0x1,'dT':_0x90f2d8(_0x15e4ee['createTimestamp']),'personId':_0x15e4ee[_0x5c68b0(0xcd)],'threadId':_0x15e4ee['threadId']};}function _0x4cedc5(_0xd69e4f,_0x2bd781,_0x524556){const _0x26f8c3=_0x572099;var _0x3f1dd1,_0x230b24;if(((_0x230b24=(_0x3f1dd1=_0xd69e4f==null?void 0x0:_0xd69e4f[_0x26f8c3(0x90)])==null?void 0x0:_0x3f1dd1['length'])!=null?_0x230b24:0x0)>0x0){const _0x157ce0=(_0x4c06a7,_0x15aeea)=>({'id':_0x4c06a7['replyId'],'threadId':_0x4c06a7[_0x26f8c3(0xee)],'dT':_0x90f2d8(_0x4c06a7[_0x26f8c3(0x81)]),'personId':_0x4c06a7[_0x26f8c3(0xcd)],'resolved':_0xd69e4f[_0x26f8c3(0x8f)]===_0xdf7756[_0x26f8c3(0xca)],'unitId':_0x2bd781,'subUnitId':_0x524556,'text':JSON['parse'](_0x4c06a7[_0x26f8c3(0xf3)]),'parentId':_0x15aeea}),_0x1af92b=_0x157ce0(_0xd69e4f['replies'][0x0]);return{..._0x1af92b,'children':_0xd69e4f[_0x26f8c3(0x90)]['slice'](0x1)['map'](_0x2f3bf3=>_0x157ce0(_0x2f3bf3,_0x1af92b['id']))};}return null;}let _0x555366=class{constructor(_0xa2339d,_0x225475,_0x53a667,_0xdd2ea8){const _0x181265=_0x572099;this[_0x181265(0x96)]=_0xa2339d,this[_0x181265(0xf1)]=_0x225475,this[_0x181265(0xb3)]=_0x53a667,this[_0x181265(0xe6)]=_0xdd2ea8;}async[_0x572099(0xa2)](_0x2aa453){const _0x298d08=_0x572099;var _0x5a7a0f,_0xca09e7;const {parentId:_0x27f1ba,unitId:_0x4eeb5a,text:_0x3bed92,threadId:_0x1bc5db}=_0x2aa453,_0x313b24=(_0xca09e7=(_0x5a7a0f=_0x3bed92[_0x298d08(0x97)])==null?void 0x0:_0x5a7a0f[_0x298d08(0x7a)](_0x484631=>_0x484631['rangeType']===_0x54ffd4[_0x298d08(0xc1)][_0x298d08(0xba)])[_0x298d08(0x99)](_0x3f3a87=>_0x3f3a87['rangeId']))!=null?_0xca09e7:[],_0x476eb1=JSON['stringify'](_0x3bed92),_0x4f949b=(await this['_sessionService']['requireSession'](_0x4eeb5a))[_0x298d08(0x7e)]();if(_0x27f1ba){const _0x1692ba={'memberId':_0x4f949b,'unitId':_0x4eeb5a,'content':_0x476eb1,'mention':_0x313b24,'threadId':_0x1bc5db},_0x1d8132=(await this['_httpService'][_0x298d08(0x85)](_0x298d08(0xe1)+_0x4eeb5a+_0x298d08(0xaf),{'body':_0x1692ba}))[_0x298d08(0xb7)][_0x298d08(0xbc)];return{..._0x2aa453,'id':_0x1d8132[_0x298d08(0x76)],'dT':_0x54ffd4[_0x298d08(0xd2)](+_0x1d8132[_0x298d08(0x81)])['format'](_0x298d08(0x70)),'personId':_0x1d8132[_0x298d08(0xcd)]};}else{const _0x249eda={'memberId':_0x4f949b,'unitId':_0x4eeb5a,'content':_0x476eb1,'mention':_0x313b24},_0x5b7ed4=await this[_0x298d08(0x96)][_0x298d08(0x85)]('/universer-api/comment/unit/'+_0x4eeb5a+'/add',{'body':_0x249eda});return _0x582824(_0x5b7ed4[_0x298d08(0xb7)]['comment'],_0x2aa453);}}async['updateComment'](_0x2810e5){const _0x3c9a3b=_0x572099;var _0x216e58,_0x158df2;const {text:_0x17c710,unitId:_0x312bbe}=_0x2810e5,_0x26e05e=(_0x158df2=(_0x216e58=_0x17c710[_0x3c9a3b(0x97)])==null?void 0x0:_0x216e58[_0x3c9a3b(0x7a)](_0x41cd11=>_0x41cd11[_0x3c9a3b(0xd9)]===_0x54ffd4['CustomRangeType'][_0x3c9a3b(0xba)])['map'](_0x173ac9=>_0x173ac9[_0x3c9a3b(0xf2)]))!=null?_0x158df2:[],_0x1c5914=JSON[_0x3c9a3b(0xe9)](_0x17c710),_0x3adfca=_0x2810e5[_0x3c9a3b(0xee)],_0x4ac943=_0x2810e5['id'],_0x4329ed={'memberId':(await this[_0x3c9a3b(0xb3)][_0x3c9a3b(0x87)](_0x312bbe))[_0x3c9a3b(0x7e)](),'unitId':_0x312bbe,'threadId':_0x3adfca,'mention':_0x26e05e,'content':_0x1c5914,'replyId':_0x4ac943},_0x47d476=await this[_0x3c9a3b(0x96)][_0x3c9a3b(0x85)](_0x3c9a3b(0xe1)+_0x312bbe+_0x3c9a3b(0xbf),{'body':_0x4329ed});return!_0x47d476[_0x3c9a3b(0xb7)][_0x3c9a3b(0x78)]||_0x47d476[_0x3c9a3b(0xb7)][_0x3c9a3b(0x78)][_0x3c9a3b(0xa9)]===0x1;}async['resolveComment'](_0x30292f){const _0x17f947=_0x572099,{unitId:_0x48741d}=_0x30292f,_0x249d2f=_0x30292f[_0x17f947(0xee)],_0x535fbc={'memberId':this['_userService']['getCurrentUser']()[_0x17f947(0xbb)],'unitId':_0x48741d,'threadId':_0x249d2f,'solved':_0x30292f['resolved']?_0xdf7756[_0x17f947(0xca)]:_0xdf7756[_0x17f947(0x86)]},_0x29694a=await this[_0x17f947(0x96)][_0x17f947(0x85)](_0x17f947(0xe1)+_0x48741d+_0x17f947(0xcb),{'body':_0x535fbc});return!_0x29694a[_0x17f947(0xb7)][_0x17f947(0x78)]||_0x29694a[_0x17f947(0xb7)]['error'][_0x17f947(0xa9)]===0x1;}async[_0x572099(0xd0)](_0x4f305f,_0x5afb70,_0x406ea2,_0x571a14){const _0x3dfb63=_0x572099,_0x4e74ca={'memberId':(await this[_0x3dfb63(0xb3)][_0x3dfb63(0x87)](_0x4f305f))[_0x3dfb63(0x7e)](),'threadId':_0x406ea2,'replyId':_0x571a14,'unitId':_0x4f305f},_0x11d6f0=await this[_0x3dfb63(0x96)][_0x3dfb63(0x85)](_0x3dfb63(0xe1)+_0x4f305f+_0x3dfb63(0xec),{'body':_0x4e74ca});return!_0x11d6f0['body'][_0x3dfb63(0x78)]||_0x11d6f0[_0x3dfb63(0xb7)][_0x3dfb63(0x78)][_0x3dfb63(0xa9)]===0x1;}async[_0x572099(0xde)](_0x1012db,_0x1ba1b9,_0x4a1561){const _0x16e622=_0x572099,_0x4247ff={'unitId':_0x1012db,'threadId':_0x4a1561},_0x111852=await this[_0x16e622(0x96)][_0x16e622(0x85)](_0x16e622(0xe1)+_0x1012db+_0x16e622(0xe7),{'body':_0x4247ff}),_0x2d8a6d=_0x4a1561[_0x16e622(0x99)](_0x1793ba=>_0x4cedc5(_0x111852[_0x16e622(0xb7)]['comments'][_0x1793ba],_0x1012db,_0x1ba1b9))[_0x16e622(0x7a)](Boolean);return Object[_0x16e622(0xda)](_0x111852[_0x16e622(0xb7)][_0x16e622(0x89)])[_0x16e622(0xc4)](_0x517e71=>{const _0x47f05b=_0x16e622;this[_0x47f05b(0xf1)][_0x47f05b(0x6f)](_0x517e71);}),_0x2d8a6d;}[_0x572099(0x7f)](_0x5a98d7){const _0x37308b=_0x572099;return{'id':_0x5a98d7['id'],'threadId':_0x5a98d7[_0x37308b(0xee)],'ref':_0x5a98d7[_0x37308b(0xcf)]};}};_0x555366=_0x560841([_0x2481fc(0x0,_0x54ffd4[_0x572099(0xa1)](_0x250d5f[_0x572099(0xc5)])),_0x2481fc(0x1,_0x54ffd4[_0x572099(0xa1)](_0x54ffd4[_0x572099(0xbd)])),_0x2481fc(0x2,_0x54ffd4[_0x572099(0xa1)](_0x2b6358[_0x572099(0xc6)])),_0x2481fc(0x3,_0x54ffd4[_0x572099(0xa1)](_0x54ffd4[_0x572099(0x74)]))],_0x555366);var _0x3487d8=Object[_0x572099(0x73)],_0x4a4a93=(_0x1497d7,_0x473e2b,_0x263bb5,_0x2d1017)=>{for(var _0x263252=_0x2d1017>0x1?void 0x0:_0x2d1017?_0x3487d8(_0x473e2b,_0x263bb5):_0x473e2b,_0x156827=_0x1497d7['length']-0x1,_0x4d1cd2;_0x156827>=0x0;_0x156827--)(_0x4d1cd2=_0x1497d7[_0x156827])&&(_0x263252=_0x4d1cd2(_0x263252)||_0x263252);return _0x263252;},_0x56c455=(_0x23c27d,_0x5a3956)=>(_0x1e0545,_0x2f55a0)=>_0x5a3956(_0x1e0545,_0x2f55a0,_0x23c27d);let _0x396e23=class extends _0x54ffd4[_0x572099(0xa5)]{constructor(_0x378bd5,_0x2d308e){const _0x5d053d=_0x572099;super(),this['_threadCommentDataSourceService']=_0x378bd5,this[_0x5d053d(0xdc)]=_0x2d308e,this[_0x5d053d(0x9b)]();}['_initDataSource'](){const _0x3ec657=_0x572099;this[_0x3ec657(0x98)][_0x3ec657(0xa7)]=this['_threadCommentDataSource'],this[_0x3ec657(0x98)][_0x3ec657(0x88)]=!0x1;}};_0x396e23=_0x4a4a93([_0x56c455(0x0,_0x2ebc91[_0x572099(0x8c)]),_0x56c455(0x1,_0x54ffd4[_0x572099(0xa1)](_0x555366))],_0x396e23);var _0x5dca1a=Object[_0x572099(0x7d)],_0x5b0d88=Object[_0x572099(0x73)],_0x34a1dd=(_0x53d08a,_0x1d495a,_0x4d1628)=>_0x1d495a in _0x53d08a?_0x5dca1a(_0x53d08a,_0x1d495a,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4d1628}):_0x53d08a[_0x1d495a]=_0x4d1628,_0x249dab=(_0x167c6c,_0x3ec4e2,_0x39ed15,_0x39935c)=>{for(var _0x17b2b9=_0x39935c>0x1?void 0x0:_0x39935c?_0x5b0d88(_0x3ec4e2,_0x39ed15):_0x3ec4e2,_0x4c0e69=_0x167c6c['length']-0x1,_0x5042c8;_0x4c0e69>=0x0;_0x4c0e69--)(_0x5042c8=_0x167c6c[_0x4c0e69])&&(_0x17b2b9=_0x5042c8(_0x17b2b9)||_0x17b2b9);return _0x17b2b9;},_0x3436a3=(_0x971775,_0x4e5239)=>(_0x57eadf,_0x3fad5a)=>_0x4e5239(_0x57eadf,_0x3fad5a,_0x971775),_0x537625=(_0x1a370f,_0x56557b,_0x51ac59)=>_0x34a1dd(_0x1a370f,typeof _0x56557b!='symbol'?_0x56557b+'':_0x56557b,_0x51ac59);_0x51a636[_0x572099(0x95)]=class extends _0x54ffd4[_0x572099(0x75)]{constructor(_0x348933=_0xa91f75,_0x2a8e72,_0x49a954){const _0x4f69df=_0x572099;super(),this[_0x4f69df(0x92)]=_0x348933,this[_0x4f69df(0xe6)]=_0x2a8e72,this[_0x4f69df(0x84)]=_0x49a954;const {..._0x1dcccb}=_0x54ffd4['merge']({},_0xa91f75,this[_0x4f69df(0x92)]);this['_configService'][_0x4f69df(0x8a)](_0xc03f36,_0x1dcccb);}[_0x572099(0xf0)](){const _0x43f506=_0x572099;[[_0x555366],[_0x396e23],[_0x5bf372]][_0x43f506(0xc4)](_0x4e3a8d=>{const _0x34ed3a=_0x43f506;this[_0x34ed3a(0xe6)]['add'](_0x4e3a8d);});}[_0x572099(0xe8)](){const _0x26eabd=_0x572099;this['_injector'][_0x26eabd(0xb2)](_0x396e23),this[_0x26eabd(0xe6)][_0x26eabd(0xb2)](_0x5bf372);}},_0x537625(_0x51a636['UniverThreadCommentDataSourcePlugin'],_0x572099(0x94),_0x3b74b7),_0x537625(_0x51a636['UniverThreadCommentDataSourcePlugin'],'type',_0x54ffd4['UniverInstanceType']['UNIVER_UNKNOWN']),_0x51a636[_0x572099(0x95)]=_0x249dab([_0x54ffd4[_0x572099(0x6e)](_0x3067d4['UniverThreadCommentUIPlugin'],_0x2b6358['UniverCollaborationClientPlugin'],_0x59453f[_0x572099(0xb9)]),_0x3436a3(0x1,_0x54ffd4[_0x572099(0xa1)](_0x54ffd4[_0x572099(0x74)])),_0x3436a3(0x2,_0x54ffd4[_0x572099(0x93)])],_0x51a636[_0x572099(0x95)]),Object['defineProperty'](_0x51a636,Symbol[_0x572099(0xac)],{'value':'Module'});}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/thread-comment-datasource",
|
|
3
|
-
"version": "0.7.0-nightly.
|
|
3
|
+
"version": "0.7.0-nightly.202505131607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -45,16 +45,16 @@
|
|
|
45
45
|
"rxjs": ">=7.0.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@univerjs-pro/
|
|
49
|
-
"@univerjs
|
|
50
|
-
"@univerjs/
|
|
51
|
-
"@univerjs/
|
|
52
|
-
"@univerjs/
|
|
53
|
-
"@univerjs/thread-comment
|
|
54
|
-
"@univerjs/
|
|
48
|
+
"@univerjs-pro/collaboration-client": "0.7.0-nightly.202505131607",
|
|
49
|
+
"@univerjs/core": "0.7.0-nightly.202505131607",
|
|
50
|
+
"@univerjs/protocol": "0.1.46-alpha.3",
|
|
51
|
+
"@univerjs-pro/license": "0.7.0-nightly.202505131607",
|
|
52
|
+
"@univerjs/thread-comment-ui": "0.7.0-nightly.202505131607",
|
|
53
|
+
"@univerjs/thread-comment": "0.7.0-nightly.202505131607",
|
|
54
|
+
"@univerjs/network": "0.7.0-nightly.202505131607"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"rxjs": "
|
|
57
|
+
"rxjs": "7.8.2",
|
|
58
58
|
"typescript": "^5.8.3",
|
|
59
59
|
"vite": "^6.3.5",
|
|
60
60
|
"vitest": "^3.1.3",
|