@ckeditor/ckeditor5-real-time-collaboration 38.2.0-alpha.1 → 39.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +0 -1
  2. package/build/real-time-collaboration.js +1 -1
  3. package/package.json +7 -8
  4. package/src/augmentation.d.ts +7 -3
  5. package/src/augmentation.js +1 -1
  6. package/src/common-translations.d.ts +5 -1
  7. package/src/common-translations.js +2 -2
  8. package/src/config.d.ts +5 -1
  9. package/src/config.js +1 -1
  10. package/src/index.d.ts +14 -10
  11. package/src/index.js +2 -2
  12. package/src/presencelist/presencelistui.d.ts +11 -7
  13. package/src/presencelist/presencelistui.js +2 -2
  14. package/src/presencelist/view/presencecounterview.d.ts +6 -2
  15. package/src/presencelist/view/presencecounterview.js +2 -2
  16. package/src/presencelist/view/presencedropdownlistitemview.d.ts +7 -3
  17. package/src/presencelist/view/presencedropdownlistitemview.js +2 -2
  18. package/src/presencelist/view/presencedropdownlistview.d.ts +6 -2
  19. package/src/presencelist/view/presencedropdownlistview.js +2 -2
  20. package/src/presencelist/view/presenceinlinelistitemview.d.ts +7 -3
  21. package/src/presencelist/view/presenceinlinelistitemview.js +2 -2
  22. package/src/presencelist/view/presenceinlinelistview.d.ts +7 -3
  23. package/src/presencelist/view/presenceinlinelistview.js +2 -2
  24. package/src/presencelist/view/presencelistview.d.ts +8 -4
  25. package/src/presencelist/view/presencelistview.js +2 -2
  26. package/src/presencelist.d.ts +7 -3
  27. package/src/presencelist.js +2 -2
  28. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +9 -5
  29. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  30. package/src/realtimecollaborativecomments.d.ts +8 -4
  31. package/src/realtimecollaborativecomments.js +2 -2
  32. package/src/realtimecollaborativeediting/realtimecollaborationclient.d.ts +21 -7
  33. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  34. package/src/realtimecollaborativeediting/sessions.d.ts +9 -5
  35. package/src/realtimecollaborativeediting/sessions.js +2 -2
  36. package/src/realtimecollaborativeediting/usermarkers.d.ts +6 -2
  37. package/src/realtimecollaborativeediting/usermarkers.js +2 -2
  38. package/src/realtimecollaborativeediting/websocketgateway.d.ts +7 -3
  39. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  40. package/src/realtimecollaborativeediting.d.ts +6 -2
  41. package/src/realtimecollaborativeediting.js +2 -2
  42. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +10 -6
  43. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  44. package/src/realtimecollaborativerevisionhistory.d.ts +7 -3
  45. package/src/realtimecollaborativerevisionhistory.js +2 -2
  46. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +8 -4
  47. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  48. package/src/realtimecollaborativetrackchanges.d.ts +7 -3
  49. package/src/realtimecollaborativetrackchanges.js +2 -2
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2355=['_terminateService','resolve','createdAt','_fetchMissingUsersForThreads','commentThreadRemoved','authorId','get','getCommentThread','CommentsService','permissions','removeCommentThread','context','cloudservicescommentsadapter-service-not-exist','404','getComment','unregister','getConnectedSessions','commentThreadReopened','collaboration.channelId','content','reopen','startsWith','register','commentUpdated','updateComment','CommentsRepository','Permissions','set','addUser','_getService','map','plugins','delete','cloudservicescommentsadapter-disconnect-not-exist','getUser','init','getCommentThreads','_services','update','updateCommentThread','config','listenTo','addToReconnectionStack','_setUpService','attributes','setPermissions','resolveCommentThread','comments','addComment','removeComment','keys','remove','off','message','commentId','resolvedBy','requires','sessionAdd:','commentAdded','disconnect','has','commentThreadId','add','catch','from','_connectService','destroy','assign','reconnect','addCommentThread','userId'];(function(_0x26a20c,_0x235565){const _0x32324f=function(_0x253b88){while(--_0x253b88){_0x26a20c['push'](_0x26a20c['shift']());}};_0x32324f(++_0x235565);}(_0x2355,0x106));const _0x3232=function(_0x26a20c,_0x235565){_0x26a20c=_0x26a20c-0x0;let _0x32324f=_0x2355[_0x26a20c];return _0x32324f;};import{Context as _0x2b71ba,ContextPlugin as _0x3da48e}from'ckeditor5/src/core.js';import{CKEditorError as _0x529f4d}from'ckeditor5/src/utils.js';import{Users as _0x4203a2}from'ckeditor5-collaboration';import{User as _0x4501bd}from'@ckeditor/ckeditor-cloud-services-collaboration';import{CommentsService as _0x46b8a0}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';import _0x9ee385 from'../realtimecollaborativeediting/websocketgateway.js';import _0x5d7cd3 from'../realtimecollaborativeediting/sessions.js';export default class a extends _0x3da48e{static get[_0x3232('0x7')](){return[_0x9ee385,_0x3232('0x2f'),_0x5d7cd3,_0x4203a2];}constructor(_0x26d10c){super(_0x26d10c),this[_0x3232('0x3b')]=new Map();}async[_0x3232('0x39')](){const _0x3e8cc9=this[_0x3232('0x21')],_0x531c69=_0x3e8cc9['plugins'][_0x3232('0x1c')](_0x3232('0x2f'));if(_0x3e8cc9[_0x3232('0x35')][_0x3232('0x1c')](_0x9ee385)[_0x3232('0x40')](this),_0x531c69['adapter']={'addCommentThread':async({channelId:_0xbb70ec,threadId:_0x2ce8d2,comments:_0x430dea,resolvedAt:_0x66ab7b,resolvedBy:_0x484c74,context:_0x3568a0,attributes:_0x28ad38})=>{const _0x251ded=await this['_getService'](_0xbb70ec)['addCommentThread']({'commentThreadId':_0x2ce8d2,'comments':_0x430dea[_0x3232('0x34')](_0x593606=>function(_0x523a73,_0xc4c9bc,_0x2a8b8e){return{'commentThreadId':_0x2a8b8e,'commentId':_0x523a73[_0x3232('0x5')],'userId':_0x523a73[_0x3232('0x1b')],'content':_0x523a73[_0x3232('0x29')],'documentId':_0xc4c9bc,'createdAt':_0x523a73[_0x3232('0x18')],'attributes':_0x523a73[_0x3232('0x42')]||{}};}(_0x593606,_0xbb70ec,_0x2ce8d2)),'resolvedAt':_0x66ab7b,'resolvedBy':_0x484c74,'context':_0x3568a0,'attributes':_0x28ad38})['catch'](B);return{'threadId':_0x251ded['commentThreadId'],'comments':_0x251ded[_0x3232('0x45')]};},'getCommentThread':async({channelId:_0x4122ae,threadId:_0x1021fc})=>{const _0x4a864c=await this['_getService'](_0x4122ae)[_0x3232('0x1d')](_0x1021fc)['catch'](B);return await this['_fetchMissingUsersForThreads']([_0x4a864c]),{'threadId':_0x4a864c[_0x3232('0xc')],'comments':_0x4a864c['comments'][_0x3232('0x34')](R),'context':_0x4a864c[_0x3232('0x21')],'resolvedAt':_0x4a864c['resolvedAt'],'resolvedBy':_0x4a864c[_0x3232('0x6')],'attributes':_0x4a864c[_0x3232('0x42')]||{}};},'updateCommentThread':async({channelId:_0x1cd636,threadId:_0x41b066,context:_0x2fab9d,attributes:_0x5c3a42})=>this[_0x3232('0x33')](_0x1cd636)[_0x3232('0x3d')]({'commentThreadId':_0x41b066,'context':_0x2fab9d,'attributes':_0x5c3a42})[_0x3232('0xe')](F)['catch'](B),'resolveCommentThread':async({channelId:_0x465798,threadId:_0x47da69})=>{const _0x2d13d9=await this[_0x3232('0x33')](_0x465798)[_0x3232('0x44')](_0x47da69)['catch'](F)[_0x3232('0xe')](B);return{'threadId':_0x2d13d9[_0x3232('0xc')],'resolvedAt':_0x2d13d9['resolvedAt'],'resolvedBy':_0x2d13d9['resolvedBy']};},'reopenCommentThread':async({channelId:_0x89c277,threadId:_0x322239})=>this[_0x3232('0x33')](_0x89c277)['reopenCommentThread'](_0x322239)['catch'](F)[_0x3232('0xe')](B),'removeCommentThread':({channelId:_0x586e0c,threadId:_0x1ffdb4})=>this[_0x3232('0x33')](_0x586e0c)[_0x3232('0x20')](_0x1ffdb4)[_0x3232('0xe')](F)['catch'](B),'addComment':({channelId:_0x2f5c06,threadId:_0x2a9157,commentId:_0x638e9,content:_0x17c469,attributes:_0x39896e})=>this['_getService'](_0x2f5c06)[_0x3232('0x46')](_0x2a9157,_0x638e9,_0x17c469,_0x39896e)[_0x3232('0xe')](B),'updateComment':({channelId:_0x1d01ad,threadId:_0x363c79,commentId:_0x4ccb34,content:_0x546530,attributes:_0x2c4c6c})=>this[_0x3232('0x33')](_0x1d01ad)[_0x3232('0x2e')](_0x363c79,_0x4ccb34,_0x546530,_0x2c4c6c)[_0x3232('0xe')](F)['catch'](B),'removeComment':({channelId:_0xa0f850,threadId:_0x1613b3,commentId:_0x44de9b})=>this[_0x3232('0x33')](_0xa0f850)[_0x3232('0x0')](_0x1613b3,_0x44de9b)['catch'](F)[_0x3232('0xe')](B)},_0x3e8cc9 instanceof _0x2b71ba){const _0x4cbfcc=_0x3e8cc9['config']['get']('collaboration.channelId'),_0x409283=_0x3e8cc9['plugins'][_0x3232('0x1c')](_0x5d7cd3);await this[_0x3232('0x41')](_0x4cbfcc);const _0x456320=await this[_0x3232('0x3b')]['get'](_0x4cbfcc)['getConnectedSessions']();this[_0x3232('0x3f')](_0x409283,_0x3232('0x8')+_0x4cbfcc,(_0x273bb2,{session:_0x3d42de})=>{_0x3d42de['id']===_0x409283['mySessionId']&&(_0x273bb2[_0x3232('0x3')](),this[_0x3232('0x21')][_0x3232('0x35')][_0x3232('0x1c')](_0x3232('0x30'))[_0x3232('0x43')](_0x3d42de[_0x3232('0x1f')],_0x4cbfcc));}),_0x409283['register'](_0x4cbfcc,_0x456320);}}async['_setUpService'](_0x1aee51){if(this[_0x3232('0x3b')][_0x3232('0xb')](_0x1aee51))throw new _0x529f4d('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x1aee51});const _0x16685c=this[_0x3232('0x21')]['plugins']['get'](_0x3232('0x2f')),_0x407465=new a['CommentsService'](_0x1aee51);this[_0x3232('0x3b')][_0x3232('0x31')](_0x1aee51,_0x407465),this[_0x3232('0x3f')](_0x407465,'commentThreadAdded',(_0x262dae,_0x57a73d)=>{const {commentThreadId:_0x4a545f,documentId:_0x366a69,context:_0x2b329b,attributes:_0x3062fd,resolvedAt:_0x5c2b3b,resolvedBy:_0x240fbd,comments:_0x1af4a7}=_0x57a73d;_0x16685c[_0x3232('0x1d')](_0x4a545f)||_0x16685c['addCommentThread']({'threadId':_0x4a545f,'channelId':_0x366a69,'comments':_0x1af4a7?_0x1af4a7['map'](R):[],'context':_0x2b329b,'attributes':_0x3062fd,'resolvedAt':_0x5c2b3b,'resolvedBy':_0x240fbd,'isFromAdapter':!0x0});}),this[_0x3232('0x3f')](_0x407465,'commentThreadUpdated',(_0xcc18cb,{commentThreadId:_0x59e717,documentId:_0x4cbcb1,context:_0x24b861,attributes:_0x308f87})=>{_0x16685c[_0x3232('0x1d')](_0x59e717)&&_0x16685c['updateCommentThread']({'threadId':_0x59e717,'channelId':_0x4cbcb1,'context':_0x24b861,'attributes':_0x308f87,'isFromAdapter':!0x0});}),this[_0x3232('0x3f')](_0x407465,'commentThreadResolved',(_0x426fc9,{commentThreadId:_0x63767d,resolvedBy:_0x2b7b54,resolvedAt:_0x172206})=>{const _0x569f9a=_0x16685c[_0x3232('0x1d')](_0x63767d);_0x569f9a&&_0x569f9a[_0x3232('0x17')]({'resolvedBy':_0x2b7b54,'resolvedAt':_0x172206,'isFromAdapter':!0x0});}),this['listenTo'](_0x407465,_0x3232('0x27'),(_0x480855,{commentThreadId:_0x22c4ed})=>{const _0x4f8788=_0x16685c['getCommentThread'](_0x22c4ed);_0x4f8788&&_0x4f8788[_0x3232('0x2a')]({'isFromAdapter':!0x0});}),this[_0x3232('0x3f')](_0x407465,_0x3232('0x1a'),(_0x42cbe7,{commentThreadId:_0x768a57})=>{const _0x3334bb=_0x16685c['getCommentThread'](_0x768a57);_0x3334bb&&_0x3334bb[_0x3232('0x2')]({'isFromAdapter':!0x0});}),this[_0x3232('0x3f')](_0x407465,_0x3232('0x9'),(_0x2e3153,_0xb15400)=>{const _0x141330=_0xb15400['commentThreadId'],_0x33604b=_0x16685c[_0x3232('0x1d')](_0x141330);_0x33604b&&_0x33604b[_0x3232('0x46')]({...R(_0xb15400),'isFromAdapter':!0x0});}),this[_0x3232('0x3f')](_0x407465,_0x3232('0x2d'),(_0x69ba8f,{commentThreadId:_0x532e44,commentId:_0x71b53d,content:_0x4a08ef,attributes:_0x21569d})=>{const _0x129ad2=_0x16685c[_0x3232('0x1d')](_0x532e44);if(_0x129ad2){const _0x31e1c9=_0x129ad2['getComment'](_0x71b53d);_0x31e1c9&&_0x31e1c9[_0x3232('0x3c')]({'content':_0x4a08ef,'attributes':_0x21569d,'isFromAdapter':!0x0});}}),this[_0x3232('0x3f')](_0x407465,'commentRemoved',(_0x3ce713,{commentThreadId:_0x1fbb55,commentId:_0x5b310d})=>{const _0x68dd09=_0x16685c['getCommentThread'](_0x1fbb55);if(_0x68dd09){const _0x3c92cf=_0x68dd09[_0x3232('0x24')](_0x5b310d);_0x3c92cf&&_0x3c92cf[_0x3232('0x2')]({'isFromAdapter':!0x0});}}),await this[_0x3232('0x10')](_0x1aee51);}[_0x3232('0x11')](){if(this[_0x3232('0x21')]instanceof _0x2b71ba){const _0x36a14e=this[_0x3232('0x21')]['config'][_0x3232('0x1c')](_0x3232('0x28'));this['_terminateService'](_0x36a14e);}}[_0x3232('0x16')](_0x50d9da){if(!this[_0x3232('0x3b')][_0x3232('0xb')](_0x50d9da))throw new _0x529f4d(_0x3232('0x37'),null,{'channelId':_0x50d9da});this['_getService'](_0x50d9da)[_0x3232('0xa')](),this['_services'][_0x3232('0x36')](_0x50d9da);}async[_0x3232('0x13')](){for(const _0x5abf64 of this[_0x3232('0x3b')][_0x3232('0x1')]())await this[_0x3232('0x10')](_0x5abf64);if(this[_0x3232('0x21')]instanceof _0x2b71ba){const _0x221019=this[_0x3232('0x21')][_0x3232('0x3e')]['get'](_0x3232('0x28')),_0x57124e=this[_0x3232('0x21')][_0x3232('0x35')]['get'](_0x5d7cd3);_0x57124e[_0x3232('0x25')](_0x221019);const _0x1a1bef=await this['_services'][_0x3232('0x1c')](_0x221019)[_0x3232('0x26')]();_0x57124e[_0x3232('0x2c')](_0x221019,_0x1a1bef);}}async[_0x3232('0x10')](_0x137d43){const {connection:_0x3f4fef}=this[_0x3232('0x21')][_0x3232('0x35')][_0x3232('0x1c')](_0x9ee385),_0x27a29a=this[_0x3232('0x21')][_0x3232('0x35')][_0x3232('0x1c')](_0x3232('0x2f')),_0x28ba6f=this[_0x3232('0x3b')][_0x3232('0x1c')](_0x137d43),_0x53057e=await _0x28ba6f['connect'](_0x3f4fef);await this[_0x3232('0x19')](_0x53057e);const _0x5cc7e1=new Set(Array[_0x3232('0xf')](_0x27a29a[_0x3232('0x3a')]({'channelId':_0x137d43}),_0x522a5a=>_0x522a5a['id']));for(const _0xc89447 of _0x53057e)_0x5cc7e1['delete'](_0xc89447[_0x3232('0xc')]);for(const _0x3b4039 of _0x5cc7e1)_0x27a29a[_0x3232('0x1d')](_0x3b4039)[_0x3232('0x2')]({'isFromAdapter':!0x0});for(const _0x58f5c1 of _0x53057e){let _0x25a2c0=_0x27a29a[_0x3232('0x1d')](_0x58f5c1['commentThreadId']);const {commentThreadId:_0x130eba,context:_0x11cb20,attributes:_0x169210,resolvedBy:_0x5c479c,resolvedAt:_0x3a5bdd,deletedAt:_0x36f8fd}=_0x58f5c1;_0x25a2c0||(_0x25a2c0=_0x27a29a[_0x3232('0x14')]({'channelId':_0x137d43,'threadId':_0x130eba,'context':_0x11cb20,'attributes':_0x169210||{},'resolvedBy':_0x5c479c,'resolvedAt':_0x3a5bdd,'deletedAt':_0x36f8fd,'isFromAdapter':!0x0}));const _0x1807b5=new Set(Array[_0x3232('0xf')](_0x25a2c0[_0x3232('0x45')],_0x470404=>_0x470404['id']));for(const _0x4dfc5f of _0x58f5c1[_0x3232('0x45')])_0x1807b5[_0x3232('0x36')](_0x4dfc5f['commentId']);for(const _0x54e564 of _0x1807b5)_0x25a2c0[_0x3232('0x24')](_0x54e564)[_0x3232('0x2')]({'isFromAdapter':!0x0});for(const _0x22ff3c of _0x58f5c1[_0x3232('0x45')]){const _0x16c422=_0x25a2c0[_0x3232('0x24')](_0x22ff3c['commentId']);_0x16c422?_0x16c422[_0x3232('0x29')]!==_0x22ff3c[_0x3232('0x29')]&&_0x16c422[_0x3232('0x3c')]({'content':_0x22ff3c[_0x3232('0x29')],'isFromAdapter':!0x0}):_0x25a2c0[_0x3232('0x46')](Object[_0x3232('0x12')](R(_0x22ff3c),{'isFromAdapter':!0x0}));}}}[_0x3232('0x33')](_0x46bcc1){if(!this[_0x3232('0x3b')][_0x3232('0xb')](_0x46bcc1))throw new _0x529f4d(_0x3232('0x22'),null,{'channelId':_0x46bcc1});return this[_0x3232('0x3b')][_0x3232('0x1c')](_0x46bcc1);}async[_0x3232('0x19')](_0x269016){const _0x46f901=this[_0x3232('0x21')][_0x3232('0x35')][_0x3232('0x1c')](_0x4203a2),{connection:_0x379594}=this[_0x3232('0x21')][_0x3232('0x35')][_0x3232('0x1c')](_0x9ee385),_0x189597=new Set();for(const {resolvedBy:_0x3d8815,comments:_0x28e54e}of _0x269016){_0x3d8815&&!_0x46f901['getUser'](_0x3d8815)&&_0x189597[_0x3232('0xd')](_0x3d8815);for(const {userId:_0x596dd0}of _0x28e54e)_0x46f901[_0x3232('0x38')](_0x596dd0)||_0x189597['add'](_0x596dd0);}if(0x0===_0x189597['size'])return;const _0x2e730b=await _0x4501bd['getMany'](_0x379594,Array[_0x3232('0xf')](_0x189597));for(const _0x40abf7 of _0x2e730b)_0x46f901['getUser'](_0x40abf7['id'])||_0x46f901[_0x3232('0x32')](_0x40abf7);}}async function F(_0xf1bc17){if(_0x3232('0x23')!==_0xf1bc17['code'])throw _0xf1bc17;}function B(_0x3b7a43){if((_0x34689c=_0x3b7a43)[_0x3232('0x4')][_0x3232('0x2b')]('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x34689c[_0x3232('0x4')][_0x3232('0x2b')]('cloud-services-internal-error:\x20Not\x20connected.')||_0x34689c[_0x3232('0x4')][_0x3232('0x2b')]('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x34689c;throw _0x3b7a43;}function R(_0x47b372){return{'threadId':_0x47b372[_0x3232('0xc')],'commentId':_0x47b372[_0x3232('0x5')],'content':_0x47b372[_0x3232('0x29')],'createdAt':_0x47b372[_0x3232('0x18')],'authorId':_0x47b372[_0x3232('0x15')],'attributes':_0x47b372['attributes']||{}};}a[_0x3232('0x1e')]=_0x46b8a0;
23
+ const _0x18b0=['collaboration.channelId','connect','get','_setUpService','commentRemoved','commentThreadAdded','reopen','authorId','createdAt','remove','CommentsService','map','getUser','attributes','size','commentUpdated','code','listenTo','disconnect','_connectService','catch','CommentsRepository','Permissions','updateCommentThread','startsWith','removeComment','commentThreadResolved','setPermissions','content','resolvedAt','addToReconnectionStack','commentAdded','404','_services','commentThreadRemoved','addComment','mySessionId','add','destroy','_getService','_fetchMissingUsersForThreads','has','commentId','unregister','assign','register','update','commentThreadReopened','getComment','cloud-services-internal-error:\x20Not\x20connected.','set','config','cloud-services-internal-error:\x20Request\x20timeout.','context','comments','cloudservicescommentsadapter-service-not-exist','addUser','cloudservicescommentsadapter-connect-already-connected','getCommentThread','init','reconnect','delete','addCommentThread','commentThreadId','getCommentThreads','getMany','adapter','message','resolveCommentThread','reopenCommentThread','plugins','resolvedBy','_terminateService','keys','permissions'];(function(_0x115666,_0x18b09e){const _0x8d8840=function(_0x201bee){while(--_0x201bee){_0x115666['push'](_0x115666['shift']());}};_0x8d8840(++_0x18b09e);}(_0x18b0,0xac));const _0x8d88=function(_0x115666,_0x18b09e){_0x115666=_0x115666-0x0;let _0x8d8840=_0x18b0[_0x115666];return _0x8d8840;};import{Context as _0xf73f82,ContextPlugin as _0x1ed7e2}from'ckeditor5/src/core';import{CKEditorError as _0x1031f2}from'ckeditor5/src/utils';import{Users as _0x4d3d01}from'ckeditor5-collaboration/src/collaboration-core';import{User as _0x30baf8}from'@ckeditor/ckeditor-cloud-services-collaboration';import{CommentsService as _0x496468}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';import _0x847e8 from'../realtimecollaborativeediting/websocketgateway';import _0x15c83a from'../realtimecollaborativeediting/sessions';export default class a extends _0x1ed7e2{static get['requires'](){return[_0x847e8,_0x8d88('0x4a'),_0x15c83a,_0x4d3d01];}constructor(_0x3728d8){super(_0x3728d8),this[_0x8d88('0xb')]=new Map();}async[_0x8d88('0x25')](){const _0x42e8fc=this[_0x8d88('0x1f')],_0x1e6884=_0x42e8fc[_0x8d88('0x30')][_0x8d88('0x37')](_0x8d88('0x4a'));if(_0x42e8fc[_0x8d88('0x30')]['get'](_0x847e8)[_0x8d88('0x8')](this),_0x1e6884[_0x8d88('0x2c')]={'addCommentThread':async({channelId:_0x5da6ec,threadId:_0x317a34,comments:_0x49a550,resolvedAt:_0x137a63,resolvedBy:_0x2d5303,context:_0x5ec276,attributes:_0x31081c})=>{const _0x33d16a=await this[_0x8d88('0x11')](_0x5da6ec)[_0x8d88('0x28')]({'commentThreadId':_0x317a34,'comments':_0x49a550[_0x8d88('0x40')](_0xca3945=>function(_0x42b378,_0x229ef8,_0x1e358a){return{'commentThreadId':_0x1e358a,'commentId':_0x42b378[_0x8d88('0x14')],'userId':_0x42b378[_0x8d88('0x3c')],'content':_0x42b378[_0x8d88('0x6')],'documentId':_0x229ef8,'createdAt':_0x42b378['createdAt'],'attributes':_0x42b378[_0x8d88('0x42')]||{}};}(_0xca3945,_0x5da6ec,_0x317a34)),'resolvedAt':_0x137a63,'resolvedBy':_0x2d5303,'context':_0x5ec276,'attributes':_0x31081c})[_0x8d88('0x49')](B);return{'threadId':_0x33d16a[_0x8d88('0x29')],'comments':_0x33d16a[_0x8d88('0x20')]};},'getCommentThread':async({channelId:_0x40d424,threadId:_0x4cc792})=>{const _0x45a9c4=await this[_0x8d88('0x11')](_0x40d424)['getCommentThread'](_0x4cc792)[_0x8d88('0x49')](B);return await this[_0x8d88('0x12')]([_0x45a9c4]),{'threadId':_0x45a9c4[_0x8d88('0x29')],'comments':_0x45a9c4['comments']['map'](R),'context':_0x45a9c4['context'],'resolvedAt':_0x45a9c4['resolvedAt'],'resolvedBy':_0x45a9c4[_0x8d88('0x31')],'attributes':_0x45a9c4[_0x8d88('0x42')]||{}};},'updateCommentThread':async({channelId:_0x327950,threadId:_0x337767,context:_0x54f16f,attributes:_0x1f0076})=>this[_0x8d88('0x11')](_0x327950)[_0x8d88('0x1')]({'commentThreadId':_0x337767,'context':_0x54f16f,'attributes':_0x1f0076})['catch'](F)[_0x8d88('0x49')](B),'resolveCommentThread':async({channelId:_0x1face4,threadId:_0x5bacac})=>{const _0x1063d2=await this[_0x8d88('0x11')](_0x1face4)[_0x8d88('0x2e')](_0x5bacac)['catch'](F)[_0x8d88('0x49')](B);return{'threadId':_0x1063d2[_0x8d88('0x29')],'resolvedAt':_0x1063d2[_0x8d88('0x7')],'resolvedBy':_0x1063d2[_0x8d88('0x31')]};},'reopenCommentThread':async({channelId:_0x2930ff,threadId:_0x5914b7})=>this[_0x8d88('0x11')](_0x2930ff)[_0x8d88('0x2f')](_0x5914b7)[_0x8d88('0x49')](F)[_0x8d88('0x49')](B),'removeCommentThread':({channelId:_0x504243,threadId:_0x2d5865})=>this[_0x8d88('0x11')](_0x504243)['removeCommentThread'](_0x2d5865)[_0x8d88('0x49')](F)[_0x8d88('0x49')](B),'addComment':({channelId:_0x878e52,threadId:_0x41ff7b,commentId:_0x14ef55,content:_0x272555,attributes:_0x5b4b6a})=>this[_0x8d88('0x11')](_0x878e52)[_0x8d88('0xd')](_0x41ff7b,_0x14ef55,_0x272555,_0x5b4b6a)[_0x8d88('0x49')](B),'updateComment':({channelId:_0x340444,threadId:_0x2b1bf7,commentId:_0x20ba31,content:_0x40e0b3,attributes:_0x259bb0})=>this[_0x8d88('0x11')](_0x340444)['updateComment'](_0x2b1bf7,_0x20ba31,_0x40e0b3,_0x259bb0)[_0x8d88('0x49')](F)[_0x8d88('0x49')](B),'removeComment':({channelId:_0x394cee,threadId:_0x67a02c,commentId:_0x573e33})=>this['_getService'](_0x394cee)[_0x8d88('0x3')](_0x67a02c,_0x573e33)['catch'](F)['catch'](B)},_0x42e8fc instanceof _0xf73f82){const _0x132ebe=_0x42e8fc[_0x8d88('0x1d')][_0x8d88('0x37')]('collaboration.channelId'),_0x2c00d0=_0x42e8fc[_0x8d88('0x30')]['get'](_0x15c83a);await this[_0x8d88('0x38')](_0x132ebe);const _0x28e698=await this['_services'][_0x8d88('0x37')](_0x132ebe)['getConnectedSessions']();this[_0x8d88('0x46')](_0x2c00d0,'sessionAdd:'+_0x132ebe,(_0x2e4076,{session:_0xbdec77})=>{_0xbdec77['id']===_0x2c00d0[_0x8d88('0xe')]&&(_0x2e4076['off'](),this['context'][_0x8d88('0x30')]['get'](_0x8d88('0x0'))[_0x8d88('0x5')](_0xbdec77[_0x8d88('0x34')],_0x132ebe));}),_0x2c00d0[_0x8d88('0x17')](_0x132ebe,_0x28e698);}}async[_0x8d88('0x38')](_0x3dfcd9){if(this[_0x8d88('0xb')][_0x8d88('0x13')](_0x3dfcd9))throw new _0x1031f2(_0x8d88('0x23'),null,{'channelId':_0x3dfcd9});const _0x2da5e5=this[_0x8d88('0x1f')][_0x8d88('0x30')][_0x8d88('0x37')](_0x8d88('0x4a')),_0x4e9ae2=new a[(_0x8d88('0x3f'))](_0x3dfcd9);this[_0x8d88('0xb')][_0x8d88('0x1c')](_0x3dfcd9,_0x4e9ae2),this[_0x8d88('0x46')](_0x4e9ae2,_0x8d88('0x3a'),(_0x443ed1,_0x427746)=>{const {commentThreadId:_0x1a06a2,documentId:_0x46ea3a,context:_0x240216,attributes:_0x2b8c00,resolvedAt:_0x4ed863,resolvedBy:_0x261777,comments:_0x32878a}=_0x427746;_0x2da5e5[_0x8d88('0x24')](_0x1a06a2)||_0x2da5e5[_0x8d88('0x28')]({'threadId':_0x1a06a2,'channelId':_0x46ea3a,'comments':_0x32878a?_0x32878a[_0x8d88('0x40')](R):[],'context':_0x240216,'attributes':_0x2b8c00,'resolvedAt':_0x4ed863,'resolvedBy':_0x261777,'isFromAdapter':!0x0});}),this['listenTo'](_0x4e9ae2,'commentThreadUpdated',(_0x48347e,{commentThreadId:_0x2118bc,documentId:_0x5e6960,context:_0x5320ca,attributes:_0x10d6b9})=>{_0x2da5e5[_0x8d88('0x24')](_0x2118bc)&&_0x2da5e5[_0x8d88('0x1')]({'threadId':_0x2118bc,'channelId':_0x5e6960,'context':_0x5320ca,'attributes':_0x10d6b9,'isFromAdapter':!0x0});}),this['listenTo'](_0x4e9ae2,_0x8d88('0x4'),(_0xdeac1,{commentThreadId:_0x4b9c6a,resolvedBy:_0x40c763,resolvedAt:_0x546462})=>{const _0x3d07f1=_0x2da5e5[_0x8d88('0x24')](_0x4b9c6a);_0x3d07f1&&_0x3d07f1['resolve']({'resolvedBy':_0x40c763,'resolvedAt':_0x546462,'isFromAdapter':!0x0});}),this[_0x8d88('0x46')](_0x4e9ae2,_0x8d88('0x19'),(_0x2addfc,{commentThreadId:_0x44ee9f})=>{const _0x43b694=_0x2da5e5[_0x8d88('0x24')](_0x44ee9f);_0x43b694&&_0x43b694[_0x8d88('0x3b')]({'isFromAdapter':!0x0});}),this['listenTo'](_0x4e9ae2,_0x8d88('0xc'),(_0x307579,{commentThreadId:_0x2e9307})=>{const _0xc6c37c=_0x2da5e5['getCommentThread'](_0x2e9307);_0xc6c37c&&_0xc6c37c[_0x8d88('0x3e')]({'isFromAdapter':!0x0});}),this[_0x8d88('0x46')](_0x4e9ae2,_0x8d88('0x9'),(_0xc2d643,_0x48529c)=>{const _0x24753b=_0x48529c[_0x8d88('0x29')],_0x1d837f=_0x2da5e5[_0x8d88('0x24')](_0x24753b);_0x1d837f&&_0x1d837f[_0x8d88('0xd')]({...R(_0x48529c),'isFromAdapter':!0x0});}),this[_0x8d88('0x46')](_0x4e9ae2,_0x8d88('0x44'),(_0x4d2fbb,{commentThreadId:_0x28bde4,commentId:_0x3528ef,content:_0x51e247,attributes:_0x1eb25d})=>{const _0x4af649=_0x2da5e5['getCommentThread'](_0x28bde4);if(_0x4af649){const _0x47cc41=_0x4af649[_0x8d88('0x1a')](_0x3528ef);_0x47cc41&&_0x47cc41[_0x8d88('0x18')]({'content':_0x51e247,'attributes':_0x1eb25d,'isFromAdapter':!0x0});}}),this[_0x8d88('0x46')](_0x4e9ae2,_0x8d88('0x39'),(_0x57ada2,{commentThreadId:_0xdfbe50,commentId:_0x5ed12f})=>{const _0x554189=_0x2da5e5['getCommentThread'](_0xdfbe50);if(_0x554189){const _0x404849=_0x554189[_0x8d88('0x1a')](_0x5ed12f);_0x404849&&_0x404849[_0x8d88('0x3e')]({'isFromAdapter':!0x0});}}),await this[_0x8d88('0x48')](_0x3dfcd9);}[_0x8d88('0x10')](){if(this[_0x8d88('0x1f')]instanceof _0xf73f82){const _0x5db90c=this[_0x8d88('0x1f')][_0x8d88('0x1d')][_0x8d88('0x37')](_0x8d88('0x35'));this[_0x8d88('0x32')](_0x5db90c);}}['_terminateService'](_0x3c17f8){if(!this[_0x8d88('0xb')][_0x8d88('0x13')](_0x3c17f8))throw new _0x1031f2('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x3c17f8});this[_0x8d88('0x11')](_0x3c17f8)[_0x8d88('0x47')](),this['_services'][_0x8d88('0x27')](_0x3c17f8);}async[_0x8d88('0x26')](){for(const _0x41b24d of this[_0x8d88('0xb')][_0x8d88('0x33')]())await this[_0x8d88('0x48')](_0x41b24d);if(this[_0x8d88('0x1f')]instanceof _0xf73f82){const _0x562583=this[_0x8d88('0x1f')][_0x8d88('0x1d')][_0x8d88('0x37')](_0x8d88('0x35')),_0x132722=this[_0x8d88('0x1f')][_0x8d88('0x30')]['get'](_0x15c83a);_0x132722[_0x8d88('0x15')](_0x562583);const _0x2ca431=await this['_services']['get'](_0x562583)['getConnectedSessions']();_0x132722[_0x8d88('0x17')](_0x562583,_0x2ca431);}}async[_0x8d88('0x48')](_0x1a360e){const {connection:_0x554475}=this['context'][_0x8d88('0x30')][_0x8d88('0x37')](_0x847e8),_0x297a00=this[_0x8d88('0x1f')]['plugins'][_0x8d88('0x37')](_0x8d88('0x4a')),_0x30502d=this[_0x8d88('0xb')][_0x8d88('0x37')](_0x1a360e),_0x250a1d=await _0x30502d[_0x8d88('0x36')](_0x554475);await this['_fetchMissingUsersForThreads'](_0x250a1d);const _0x20b2dd=new Set(Array['from'](_0x297a00[_0x8d88('0x2a')]({'channelId':_0x1a360e}),_0xb98f64=>_0xb98f64['id']));for(const _0x8b3d95 of _0x250a1d)_0x20b2dd[_0x8d88('0x27')](_0x8b3d95[_0x8d88('0x29')]);for(const _0x16e818 of _0x20b2dd)_0x297a00['getCommentThread'](_0x16e818)[_0x8d88('0x3e')]({'isFromAdapter':!0x0});for(const _0x288312 of _0x250a1d){let _0x35c79d=_0x297a00[_0x8d88('0x24')](_0x288312[_0x8d88('0x29')]);const {commentThreadId:_0x13f6b6,context:_0x8e8a75,attributes:_0x200e1a,resolvedBy:_0x2a7947,resolvedAt:_0x4e934e,deletedAt:_0xa36fc1}=_0x288312;_0x35c79d||(_0x35c79d=_0x297a00['addCommentThread']({'channelId':_0x1a360e,'threadId':_0x13f6b6,'context':_0x8e8a75,'attributes':_0x200e1a||{},'resolvedBy':_0x2a7947,'resolvedAt':_0x4e934e,'deletedAt':_0xa36fc1,'isFromAdapter':!0x0}));const _0x2fe79f=new Set(Array['from'](_0x35c79d[_0x8d88('0x20')],_0x1ecda8=>_0x1ecda8['id']));for(const _0x2a2e39 of _0x288312[_0x8d88('0x20')])_0x2fe79f['delete'](_0x2a2e39[_0x8d88('0x14')]);for(const _0x583af3 of _0x2fe79f)_0x35c79d[_0x8d88('0x1a')](_0x583af3)['remove']({'isFromAdapter':!0x0});for(const _0xc97469 of _0x288312[_0x8d88('0x20')]){const _0x2d96ad=_0x35c79d[_0x8d88('0x1a')](_0xc97469[_0x8d88('0x14')]);_0x2d96ad?_0x2d96ad['content']!==_0xc97469[_0x8d88('0x6')]&&_0x2d96ad[_0x8d88('0x18')]({'content':_0xc97469[_0x8d88('0x6')],'isFromAdapter':!0x0}):_0x35c79d[_0x8d88('0xd')](Object[_0x8d88('0x16')](R(_0xc97469),{'isFromAdapter':!0x0}));}}}[_0x8d88('0x11')](_0x338b9e){if(!this[_0x8d88('0xb')][_0x8d88('0x13')](_0x338b9e))throw new _0x1031f2(_0x8d88('0x21'),null,{'channelId':_0x338b9e});return this['_services']['get'](_0x338b9e);}async[_0x8d88('0x12')](_0x25b8e6){const _0x33e19e=this[_0x8d88('0x1f')][_0x8d88('0x30')]['get'](_0x4d3d01),{connection:_0x292148}=this[_0x8d88('0x1f')][_0x8d88('0x30')][_0x8d88('0x37')](_0x847e8),_0xd81145=new Set();for(const {resolvedBy:_0x1b47c6,comments:_0x552aec}of _0x25b8e6){_0x1b47c6&&!_0x33e19e[_0x8d88('0x41')](_0x1b47c6)&&_0xd81145[_0x8d88('0xf')](_0x1b47c6);for(const {userId:_0x4660c3}of _0x552aec)_0x33e19e[_0x8d88('0x41')](_0x4660c3)||_0xd81145[_0x8d88('0xf')](_0x4660c3);}if(0x0===_0xd81145[_0x8d88('0x43')])return;const _0x517b9e=await _0x30baf8[_0x8d88('0x2b')](_0x292148,Array['from'](_0xd81145));for(const _0xeece19 of _0x517b9e)_0x33e19e[_0x8d88('0x41')](_0xeece19['id'])||_0x33e19e[_0x8d88('0x22')](_0xeece19);}}async function F(_0xd0ff05){if(_0x8d88('0xa')!==_0xd0ff05[_0x8d88('0x45')])throw _0xd0ff05;}function B(_0x487e75){if((_0x17ffaa=_0x487e75)['message'][_0x8d88('0x2')]('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x17ffaa[_0x8d88('0x2d')]['startsWith'](_0x8d88('0x1b'))||_0x17ffaa[_0x8d88('0x2d')]['startsWith'](_0x8d88('0x1e')))return new Promise(()=>{});var _0x17ffaa;throw _0x487e75;}function R(_0x3eb155){return{'threadId':_0x3eb155[_0x8d88('0x29')],'commentId':_0x3eb155['commentId'],'content':_0x3eb155['content'],'createdAt':_0x3eb155[_0x8d88('0x3d')],'authorId':_0x3eb155['userId'],'attributes':_0x3eb155[_0x8d88('0x42')]||{}};}a[_0x8d88('0x3f')]=_0x496468;
@@ -1,11 +1,15 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativecomments
3
7
  * @publicApi
4
8
  */
5
- import { Plugin } from 'ckeditor5/src/core.js';
6
- import CloudServicesCommentsAdapter from './realtimecollaborativecomments/cloudservicescommentsadapter.js';
7
- import RealTimeCollaborativeEditing from './realtimecollaborativeediting.js';
8
- import WebSocketGateway from './realtimecollaborativeediting/websocketgateway.js';
9
+ import { Plugin } from 'ckeditor5/src/core';
10
+ import CloudServicesCommentsAdapter from './realtimecollaborativecomments/cloudservicescommentsadapter';
11
+ import RealTimeCollaborativeEditing from './realtimecollaborativeediting';
12
+ import WebSocketGateway from './realtimecollaborativeediting/websocketgateway';
9
13
  /**
10
14
  * Enables the real-time collaborative comments feature.
11
15
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3ef7=['change:state','switchReadOnly','requires','destroy','data','CommentsEditing','config','connected','pluginName','listenTo','RealTimeCollaborativeComments','isThreadsLoadingPaused','CommentsRepository','_setUpService','get','ready','once','plugins','collaboration.channelId','editor'];(function(_0x17f72f,_0x3ef7d1){const _0x5dd64a=function(_0x4a67fb){while(--_0x4a67fb){_0x17f72f['push'](_0x17f72f['shift']());}};_0x5dd64a(++_0x3ef7d1);}(_0x3ef7,0xc8));const _0x5dd6=function(_0x17f72f,_0x3ef7d1){_0x17f72f=_0x17f72f-0x0;let _0x5dd64a=_0x3ef7[_0x17f72f];return _0x5dd64a;};import{Plugin as _0x398d18}from'ckeditor5/src/core.js';import _0x42782f from'./realtimecollaborativecomments/cloudservicescommentsadapter.js';import _0x388384 from'./realtimecollaborativeediting.js';import _0x262ffe from'./realtimecollaborativeediting/websocketgateway.js';export default class m extends _0x398d18{static get[_0x5dd6('0x2')](){return['Comments',_0x42782f,_0x388384,_0x262ffe];}static get[_0x5dd6('0x8')](){return _0x5dd6('0xa');}['init'](){const _0x3606bd=this['editor'][_0x5dd6('0x11')]['get'](_0x262ffe),_0x37f6fd=this[_0x5dd6('0x13')][_0x5dd6('0x11')][_0x5dd6('0xe')](_0x5dd6('0x5')),_0x25d78c=this[_0x5dd6('0x13')]['plugins']['get'](_0x42782f);return this['editor'][_0x5dd6('0x4')][_0x5dd6('0x10')](_0x5dd6('0xf'),()=>{this[_0x5dd6('0x9')](_0x3606bd,_0x5dd6('0x0'),(_0x1f7a9d,_0x1ce785,_0x33c391)=>{_0x37f6fd[_0x5dd6('0xb')]=_0x5dd6('0x7')!==_0x33c391;});}),this[_0x5dd6('0x9')](_0x3606bd,_0x5dd6('0x0'),(_0x511f13,_0x49fbb9,_0x506767)=>{this[_0x5dd6('0x13')]['plugins']['get'](_0x5dd6('0xc'))[_0x5dd6('0x1')](_0x5dd6('0x7')!==_0x506767);}),_0x25d78c[_0x5dd6('0xd')](this[_0x5dd6('0x13')]['config']['get'](_0x5dd6('0x12')));}[_0x5dd6('0x3')](){this[_0x5dd6('0x13')][_0x5dd6('0x11')][_0x5dd6('0xe')](_0x42782f)['_terminateService'](this[_0x5dd6('0x13')][_0x5dd6('0x6')][_0x5dd6('0xe')](_0x5dd6('0x12'))),super[_0x5dd6('0x3')]();}}
23
+ const _0x493e=['_setUpService','collaboration.channelId','data','requires','plugins','destroy','listenTo','isThreadsLoadingPaused','get','connected','init','Comments','config','once','ready','editor','CommentsRepository','change:state','CommentsEditing'];(function(_0x418646,_0x493ef2){const _0x293425=function(_0x407ab5){while(--_0x407ab5){_0x418646['push'](_0x418646['shift']());}};_0x293425(++_0x493ef2);}(_0x493e,0x177));const _0x2934=function(_0x418646,_0x493ef2){_0x418646=_0x418646-0x0;let _0x293425=_0x493e[_0x418646];return _0x293425;};import{Plugin as _0x4758aa}from'ckeditor5/src/core';import _0x337234 from'./realtimecollaborativecomments/cloudservicescommentsadapter';import _0x5ccb4d from'./realtimecollaborativeediting';import _0x43cc44 from'./realtimecollaborativeediting/websocketgateway';export default class m extends _0x4758aa{static get[_0x2934('0x8')](){return[_0x2934('0x10'),_0x337234,_0x5ccb4d,_0x43cc44];}static get['pluginName'](){return'RealTimeCollaborativeComments';}[_0x2934('0xf')](){const _0xc0496d=this[_0x2934('0x1')]['plugins'][_0x2934('0xd')](_0x43cc44),_0x7741ab=this[_0x2934('0x1')]['plugins'][_0x2934('0xd')](_0x2934('0x4')),_0xe85c55=this[_0x2934('0x1')][_0x2934('0x9')][_0x2934('0xd')](_0x337234);return this[_0x2934('0x1')][_0x2934('0x7')][_0x2934('0x12')](_0x2934('0x0'),()=>{this[_0x2934('0xb')](_0xc0496d,_0x2934('0x3'),(_0x1f27ed,_0x2ea615,_0x580c2d)=>{_0x7741ab[_0x2934('0xc')]=_0x2934('0xe')!==_0x580c2d;});}),this[_0x2934('0xb')](_0xc0496d,_0x2934('0x3'),(_0x5ebcf2,_0x2252a3,_0x5594cd)=>{this[_0x2934('0x1')][_0x2934('0x9')][_0x2934('0xd')](_0x2934('0x2'))['switchReadOnly'](_0x2934('0xe')!==_0x5594cd);}),_0xe85c55[_0x2934('0x5')](this['editor']['config'][_0x2934('0xd')](_0x2934('0x6')));}[_0x2934('0xa')](){this['editor']['plugins'][_0x2934('0xd')](_0x337234)['_terminateService'](this['editor'][_0x2934('0x11')][_0x2934('0xd')](_0x2934('0x6'))),super[_0x2934('0xa')]();}}
@@ -1,14 +1,18 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativeediting/realtimecollaborationclient
3
7
  * @publicApi
4
8
  */
5
- import { Plugin, PendingActions, type Editor } from 'ckeditor5/src/core.js';
6
- import { Notification } from 'ckeditor5/src/ui.js';
7
- import WebSocketGateway from './websocketgateway.js';
8
- import Sessions from './sessions.js';
9
- import UserMarkers from './usermarkers.js';
10
- import { Users, type CollaborationHistory } from 'ckeditor5-collaboration';
11
- import { CollaborativeEditingService } from '@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';
9
+ import { Plugin, PendingActions, type Editor } from 'ckeditor5/src/core';
10
+ import { Notification } from 'ckeditor5/src/ui';
11
+ import WebSocketGateway from './websocketgateway';
12
+ import Sessions from './sessions';
13
+ import UserMarkers from './usermarkers';
14
+ import { Users, type CollaborationHistory } from 'ckeditor5-collaboration/src/collaboration-core';
15
+ import { CollaborativeEditingService } from '@ckeditor/ckeditor-cloud-services-collaboration/src/services';
12
16
  /**
13
17
  * Handles the real-time collaborative editing.
14
18
  */
@@ -102,6 +106,16 @@ export default class RealTimeCollaborationClient extends Plugin {
102
106
  * Fetches missing users based on author IDs of the given operations.
103
107
  */
104
108
  private _fetchMissingUsers;
109
+ /**
110
+ * Performs root loading in a way that is safe for real-time collaboration. Synchronizes with the server and use the local data only
111
+ * if the given root has not been loaded on any other client yet. Returns a promise which resolves after the root is ready.
112
+ *
113
+ * It transforms given data and root attributes into operations and tries to send them to the server. The operations are sent in
114
+ * a regular way. The root is ready after they are finally applied on the server.
115
+ *
116
+ * @private
117
+ */
118
+ private _loadRoot;
105
119
  /**
106
120
  * Handles the initial connection.
107
121
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5c9e=['position','set','_crash','_fetchMissingUsers','$root','_currentBufferDelay','finally','_initThrowingOnDataSet','push','_authorId','connected','_bufferedOperations','getRoot','model','_knownOperations','PENDING_ACTION_SENDING_DATA','realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration','getMany','size','disconnected','plugins','batch','entries','_compressor','then','_initSessionsHandling','unregister','channelSessions','offset','_handleInitialConnectionData','reconnect','_lastSyncedOperationId','applyOperation','_isPendingUpdate','suppressErrorInCollaboration','_sendBufferedOperationsDelayId','serverHistory','init','disableReadOnlyMode','markers','_decompressOperations','stop','includes','isAttached','metadata','_service','length','_operationToId','cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.','CommentsOnly','bind','createPositionAt','getIdOfTheLastOperation','listenTo','get','_handleExternalOperations','realtimecollaborationclient-init-session-connection-error','realtimecollaborationclient-initservice-internal-error','stopListening','getUser','forEach','addRoot','editing','locale','collaboration.channelId','_shouldSendSelectionUpdate','initData','realtimecollaborationclient-init-non-existent-root','_connectService','apply','_lastServerVersion','return','cs:removeUser','code','filter','wereChangesApplied','_disconnectService','_hasSynchronizationProblem','setPermissions','realtimecollaborationclient-sendbufferedoperations','_handleReconnectionResponse','state','add','root','keys','userId','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','collaboration-missing-channelid','bufferOperation','cloud-services-internal-error:\x20Request\x20timeout.','_getOperationsFromInitData','toJSON','_connectAfterSessionHasBeenFlushed','_hasSelectionChanged','_sendBufferedOperationsDelayed','createUserMarkerOperations','slice','high','operationsReceived','getConnectedSessions','remove','fromJSON','_pendingAction','_disconnectionOperations','document:write','enqueueChange','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','selection','type','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','_saveOperationInBuffer','round','__className','rtc-offline','message','_handleReceivedOperations','_channelId','baseVersion','createPositionFromPath','_isConnected','isUndoneOperation','startsWith','rootName','from','_handleReconnectionError','version','error','real-time-collaboration','editor','sessionAdd:','getOperations','catch','collaboration','wasUndone','change:hasDomSelection','start','has','_updateServerHistory','lastOperationId','_document','getReversed','sendOperations','_isDisconnection','_isAttached','setIdForTheLastOperation','marker','_isInit','change:range','realtimecollaborationclient-init-document-already-initialized','getDocumentDetails','currentDocumentSession','_setPendingAction','document','_handleSendingSelectionMarkers','_offset','_applyOperationsSet','fire','reset','createRange','differ','addUser','_compressOperations','RealTimeCollaborationClient','data','roots','destroy','isEnabled','map','_ignoredOperations','enableReadOnlyMode','cloud-services-internal-error:\x20Not\x20connected.','_operationIdentifier','rootsAttributes','_baseBufferDelay','_isEditingAllowed','view','realtimecollaborationclient-handleserverresponse','sessionCreatedAt','end','lastSyncVersion','config','history','getOperationAuthor','_clearPendingAction','_sendBufferedOperations','_handleServerResponse','showWarning','clone','Notification','_refreshUserSelectionMarkers','requires','_shouldSendUpdate','connect','CollaborativeEditingService','createdAt','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','Permissions','sessionId','_setUpDataInit','detachRoot'];(function(_0x5d4fe8,_0x5c9ea1){const _0x16b9e4=function(_0x28a5de){while(--_0x28a5de){_0x5d4fe8['push'](_0x5d4fe8['shift']());}};_0x16b9e4(++_0x5c9ea1);}(_0x5c9e,0x1ec));const _0x16b9=function(_0x5d4fe8,_0x5c9ea1){_0x5d4fe8=_0x5d4fe8-0x0;let _0x16b9e4=_0x5c9e[_0x5d4fe8];return _0x16b9e4;};import{Plugin as _0x4a8471,PendingActions as _0x17ed1e}from'ckeditor5/src/core.js';import{CKEditorError as _0x2c60b5,version as _0x5a1495,uid as _0x163706}from'ckeditor5/src/utils.js';import{Notification as _0x417fa4}from'ckeditor5/src/ui.js';import{transformSets as _0xa1a534,InsertOperation as _0x597791,MarkerOperation as _0x3d7998,RootAttributeOperation as _0xe1b817,RootOperation as _0x37e440,OperationFactory as _0x536bb6,History as _0x4ef03e}from'ckeditor5/src/engine.js';import _0x4f552f from'./websocketgateway.js';import _0x117482 from'./sessions.js';import _0x42f9dc from'./usermarkers.js';import{getTranslation as _0x599e51}from'../common-translations.js';import _0x269aec from'@ckeditor/ckeditor5-operations-compressor/src/compressor.js';import{Users as _0x3afc70}from'ckeditor5-collaboration';import{User as _0x3689eb}from'@ckeditor/ckeditor-cloud-services-collaboration';import{CollaborativeEditingService as _0x29e4f9}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';let $=0x1;export default class l extends _0x4a8471{static get[_0x16b9('0x62')](){return[_0x4f552f,_0x117482,_0x42f9dc,_0x17ed1e,_0x3afc70,_0x417fa4];}static get['pluginName'](){return _0x16b9('0x46');}get['cloudDocumentVersion'](){return this[_0x16b9('0xb2')]+this[_0x16b9('0x3e')];}get[_0x16b9('0xb2')](){return this[_0x16b9('0x90')][_0x16b9('0x21')]-this[_0x16b9('0x3e')];}get[_0x16b9('0x57')](){const _0x4585c5=this[_0x16b9('0x90')][_0x16b9('0x26')]();for(let _0x5c3515=_0x4585c5[_0x16b9('0x9a')]-0x1;_0x5c3515>=0x0;_0x5c3515--){const _0x5dad1e=_0x4585c5[_0x5c3515];if(!this[_0x16b9('0xb')][_0x16b9('0x2c')](_0x5dad1e))return _0x5dad1e['baseVersion']+0x1-this[_0x16b9('0x3e')];}return 0x0;}constructor(_0x241e32){if(super(_0x241e32),this['_offset']=0x0,this[_0x16b9('0x69')]=null,this['serverHistory']=new _0x4ef03e(),this['editor'][_0x16b9('0x58')]['define'](_0x16b9('0x28'),{}),this['_channelId']=this['editor'][_0x16b9('0x58')][_0x16b9('0xa2')](_0x16b9('0xac')),!this[_0x16b9('0x18')])throw new _0x2c60b5(_0x16b9('0xc3'),this);const _0x46d1f3=_0x241e32['config'][_0x16b9('0xa2')]('cloudServices.bundleVersion')||_0x5a1495;this[_0x16b9('0x99')]=new l[(_0x16b9('0x65'))](_0x46d1f3,this[_0x16b9('0x18')]),this[_0x16b9('0x2f')]=this['editor'][_0x16b9('0x79')][_0x16b9('0x3c')],this[_0x16b9('0x83')]=new _0x269aec(),this[_0x16b9('0x77')]=[],this[_0x16b9('0x7a')]=new WeakSet(),this[_0x16b9('0x6d')]('_isPendingUpdate',!0x1),this[_0x16b9('0x6d')](_0x16b9('0xb9'),!0x1),this[_0x16b9('0xa')]=null,this[_0x16b9('0x1')]=!0x1,this[_0x16b9('0x8f')]=null,this['_baseBufferDelay']=0x12c,this[_0x16b9('0x71')]=this[_0x16b9('0x51')],this[_0x16b9('0x8b')]=null,this[_0x16b9('0xb')]=new WeakSet(),this[_0x16b9('0x4f')]=new Q(this['_disconnectionOperations']);}[_0x16b9('0x91')](){const _0x4f3086=this['editor'],_0x54c566=_0x4f3086['plugins'][_0x16b9('0xa2')](_0x3afc70),_0x2fd855=_0x4f3086[_0x16b9('0x80')][_0x16b9('0xa2')](_0x4f552f);this[_0x16b9('0xa1')](_0x54c566,_0x16b9('0x5a'),(_0x55be79,_0x2414c6)=>{const _0x5ba917=_0x2414c6[0x0];_0x5ba917[_0x16b9('0x75')]&&(_0x55be79[_0x16b9('0xb3')]=_0x54c566[_0x16b9('0xa7')](_0x5ba917[_0x16b9('0x75')]),_0x55be79['stop']()),null===_0x5ba917[_0x16b9('0x75')]&&(_0x55be79['return']=null,_0x55be79[_0x16b9('0x95')]());},{'priority':_0x16b9('0x5')}),this[_0x16b9('0xa1')](_0x4f3086[_0x16b9('0x79')][_0x16b9('0x3c')][_0x16b9('0xf')],_0x16b9('0x37'),(_0x5f0d7e,_0x4d66cd)=>{_0x4d66cd['directChange']&&this[_0x16b9('0x61')]();}),this[_0x16b9('0xa1')](_0x4f3086[_0x16b9('0xaa')][_0x16b9('0x53')],_0x16b9('0x2a'),()=>{this[_0x16b9('0x61')]();}),this[_0x16b9('0x73')](),_0x4f3086['model']['on'](_0x16b9('0x8c'),(_0x3c5ed0,_0x334f2b)=>{const _0x35fec8=_0x334f2b[0x0];_0x35fec8['isDocumentOperation']&&(this[_0x16b9('0x12')](_0x35fec8),this[_0x16b9('0x63')]()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2fd855,_0x16b9('0xbd'),this,_0x16b9('0xb9'),(_0x5ef3de,_0x5c51a9)=>_0x16b9('0x76')===_0x5ef3de&&!_0x5c51a9),this['on']('change:_isEditingAllowed',()=>{this[_0x16b9('0x52')]?_0x4f3086[_0x16b9('0x92')](_0x16b9('0x15')):_0x4f3086[_0x16b9('0x4d')](_0x16b9('0x15'));}),this[_0x16b9('0x52')]?_0x4f3086[_0x16b9('0x92')]('rtc-offline'):_0x4f3086[_0x16b9('0x4d')](_0x16b9('0x15')),this[_0x16b9('0x6d')]('_isConnected',!0x1);}async[_0x16b9('0x8a')](){const _0x4741d2=this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x117482),_0x4385eb=this[_0x16b9('0x24')]['plugins'][_0x16b9('0xa2')](_0x4f552f);try{this['_isPendingUpdate']=!0x0,_0x4741d2[_0x16b9('0x86')](this[_0x16b9('0x18')]);const _0x383b56=await this[_0x16b9('0x99')]['reconnect'](_0x4385eb['connection'],this['lastSyncVersion']);await this[_0x16b9('0xbc')](_0x383b56)&&(this[_0x16b9('0x8d')]=!0x1,this['_clearPendingAction']());const _0xc5998f=await this[_0x16b9('0x99')]['getConnectedSessions']();_0x4741d2['register'](this[_0x16b9('0x18')],_0xc5998f),this['_handleSendingSelectionMarkers'](),this[_0x16b9('0x1b')]=!0x0;}catch(_0xb9e9d0){if(function(_0x4e7e5){return'404'===_0x4e7e5['code'];}(_0xb9e9d0)&&this[_0x16b9('0x69')])await this[_0x16b9('0x0')]();else{if(function(_0x3a0890){return'409'===_0x3a0890[_0x16b9('0xb5')];}(_0xb9e9d0)){const _0x59ce26=_0x599e51(this['editor'][_0x16b9('0xab')],_0x16b9('0xe'));this['_handleReconnectionError'](_0x59ce26);}else{if(!(_0xb9e9d0 instanceof J))throw _0xb9e9d0;this[_0x16b9('0x20')]();}}}}[_0x16b9('0x49')](){const _0xf037ce=this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x4f552f),_0x186ef5=this[_0x16b9('0x24')][_0x16b9('0x80')]['get'](_0x117482);this['editor'][_0x16b9('0x4d')]('rtc-destroyed'),_0x186ef5[_0x16b9('0x87')][_0x16b9('0x2c')](this['_channelId'])&&_0x186ef5[_0x16b9('0x86')](this[_0x16b9('0x18')]),_0xf037ce['removeFromReconnectionStack'](this),this[_0x16b9('0xb8')](),super[_0x16b9('0x49')]();}async[_0x16b9('0xbc')](_0x2366ab){if(this[_0x16b9('0x69')]!==_0x2366ab[_0x16b9('0x69')]&&this[_0x16b9('0x8b')]!==_0x2366ab[_0x16b9('0x2e')])throw new J();return this[_0x16b9('0x69')]=_0x2366ab[_0x16b9('0x69')],this['_handleServerResponse']([],{..._0x2366ab,'wereChangesApplied':!0x1,'data':_0x2366ab[_0x16b9('0x47')]},_0x16b9('0x8a'));}async[_0x16b9('0xb0')](_0x10d746,_0xdcb90f=!0x1){const {connection:_0x3e6f2a}=this[_0x16b9('0x24')]['plugins'][_0x16b9('0xa2')](_0x4f552f);l[_0x16b9('0x65')][_0x16b9('0x7')](_0x3e6f2a,this[_0x16b9('0x18')])[_0x16b9('0x84')](_0x4e9704=>this[_0x16b9('0x85')](_0x4e9704))['catch'](_0x2f278b=>{this[_0x16b9('0x6e')](_0x16b9('0xa4'),_0x2f278b);}),this[_0x16b9('0xa1')](this['_service'],_0x16b9('0x6'),this[_0x16b9('0x17')][_0x16b9('0x9e')](this)),this[_0x16b9('0xa1')](this[_0x16b9('0x99')],'error',(_0xda6e64,_0x5d5709)=>{this[_0x16b9('0x6e')](_0x16b9('0xa5'),_0x5d5709);}),this[_0x16b9('0xa1')](this['_service'],_0x16b9('0x7f'),()=>{this['_isConnected']=!0x1;});const _0x267ceb=this[_0x16b9('0x4f')]['getIdOfTheLastOperation'](_0x10d746),_0x65b833=await this[_0x16b9('0x99')][_0x16b9('0x64')](_0x3e6f2a,this[_0x16b9('0x45')](_0x10d746),_0x267ceb);if(this[_0x16b9('0x69')]=_0x65b833[_0x16b9('0x69')],_0x65b833['wereChangesApplied']&&(this['_isPendingUpdate']=!0x1,this[_0x16b9('0x5b')]()),_0xdcb90f){if(!_0x65b833['wereChangesApplied'])return void this[_0x16b9('0x20')]();this[_0x16b9('0x90')][_0x16b9('0x41')](),this[_0x16b9('0x3e')]=_0x65b833[_0x16b9('0x88')],this[_0x16b9('0x90')][_0x16b9('0x21')]=this[_0x16b9('0x3e')],await this['_handleServerResponse'](_0x10d746,_0x65b833,'reconnection:\x20flushed\x20session');}else await this[_0x16b9('0x89')](_0x65b833,_0x10d746);this[_0x16b9('0x3d')](),this[_0x16b9('0x1b')]=!0x0;}[_0x16b9('0x3d')](){const _0x233d79=this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x117482),_0x2d869d=this[_0x16b9('0x24')][_0x16b9('0x80')]['get'](_0x42f9dc),_0xe21fcf=_0x233d79[_0x16b9('0x87')][_0x16b9('0xa2')](this['_channelId']);_0xe21fcf&&_0xe21fcf[_0x16b9('0x9a')]>0x1?_0x2d869d[_0x16b9('0x3')]():this[_0x16b9('0xa1')](_0x233d79,'sessionAdd:'+this[_0x16b9('0x18')],()=>{0x2===_0x233d79[_0x16b9('0x87')][_0x16b9('0xa2')](this['_channelId'])[_0x16b9('0x9a')]&&_0x2d869d[_0x16b9('0x3')]();});}async[_0x16b9('0x17')](_0x2994c4,_0x42041b,_0x4754a9,_0x417387){if(!this[_0x16b9('0x8d')]&&this[_0x16b9('0x2f')]['version']==_0x42041b){const _0x13b04a=this[_0x16b9('0x94')](_0x4754a9,_0x417387);await this[_0x16b9('0x6f')](_0x13b04a),this[_0x16b9('0xa3')](_0x13b04a,_0x42041b,_0x4754a9[_0x16b9('0x2e')])||this[_0x16b9('0x6e')]('realtimecollaborationclient-initservice-incorrect-server-operation');}}async[_0x16b9('0x0')](){this[_0x16b9('0xb8')]();const {locale:_0x1e3dbc}=this[_0x16b9('0x24')];let _0xa45264;try{_0xa45264=await this[_0x16b9('0x99')][_0x16b9('0x39')]();}catch(_0x29c044){const _0x14dbec=_0x599e51(_0x1e3dbc,_0x16b9('0xc2'));return void this[_0x16b9('0x20')](_0x14dbec);}const _0x4f303c=_0xa45264[_0x16b9('0x3a')]||_0xa45264['lastDocumentSession'];if(this[_0x16b9('0x8b')]===_0x4f303c[_0x16b9('0x2e')])await this[_0x16b9('0xb0')](this[_0x16b9('0x24')][_0x16b9('0x79')][_0x16b9('0x3c')][_0x16b9('0x59')][_0x16b9('0x26')](),!0x0);else{const _0x7c32a1=_0x599e51(_0x1e3dbc,_0x16b9('0x67'));this[_0x16b9('0x20')](_0x7c32a1);}}[_0x16b9('0xb8')](){this['_service']['disconnect'](),this[_0x16b9('0x77')]=[],clearTimeout(this[_0x16b9('0x8f')]),this[_0x16b9('0xa6')](this[_0x16b9('0x99')]);}[_0x16b9('0x85')](_0x1b4d63){const _0x2b03aa=this[_0x16b9('0x24')][_0x16b9('0x80')]['get'](_0x117482);this[_0x16b9('0xa1')](_0x2b03aa,_0x16b9('0x25')+this[_0x16b9('0x18')],(_0xba7578,{session:_0x4ada45})=>{if(_0x4ada45['id']===_0x2b03aa['mySessionId']){_0xba7578['off']();const _0x1a6089=this['editor'][_0x16b9('0x80')]['has'](_0x16b9('0x9d'))&&this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x16b9('0x9d'));let _0xd6fbaa=_0x4ada45['permissions'];_0x1a6089&&_0x1a6089[_0x16b9('0x4a')]&&(_0xd6fbaa=_0xd6fbaa[_0x16b9('0xb6')](_0x6212a2=>_0x16b9('0xc')!==_0x6212a2)),this[_0x16b9('0x24')]['plugins']['get'](_0x16b9('0x68'))[_0x16b9('0xba')](_0xd6fbaa,this[_0x16b9('0x18')]);}}),_0x2b03aa['register'](this[_0x16b9('0x18')],_0x1b4d63);}[_0x16b9('0x73')](){const _0xabf7ce=this[_0x16b9('0x24')]['data']['set'];this[_0x16b9('0x24')]['data'][_0x16b9('0x6d')]=(..._0x15a202)=>{if(!_0x15a202[_0x15a202[_0x16b9('0x9a')]-0x1][_0x16b9('0x8e')])throw new _0x2c60b5(_0x16b9('0x7c'),this);_0xabf7ce[_0x16b9('0xb1')](this[_0x16b9('0x24')]['data'],_0x15a202);};}[_0x16b9('0x6a')](){this['editor'][_0x16b9('0x47')]['on']('init',(_0x157571,[_0x1e1d31])=>{if(this[_0x16b9('0x2f')][_0x16b9('0x21')])throw new _0x2c60b5(_0x16b9('0x38'),this);_0x157571['stop'](),this[_0x16b9('0x3b')]();const _0x2f558a=this[_0x16b9('0x24')][_0x16b9('0x58')]['get'](_0x16b9('0x50')),_0x5f21c8=this['_getOperationsFromInitData'](_0x1e1d31,_0x2f558a);_0x157571[_0x16b9('0xb3')]=this[_0x16b9('0xb0')](_0x5f21c8)['then'](()=>{this[_0x16b9('0x24')]['plugins'][_0x16b9('0xa2')](_0x4f552f)['addToReconnectionStack'](this),this['editor']['data'][_0x16b9('0x40')]('ready');})['catch'](_0x451062=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x451062))[_0x16b9('0x72')](()=>this[_0x16b9('0x5b')]());},{'priority':'high'});}async[_0x16b9('0x6f')](_0x1ab40a){const _0x5e2d7c=this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x3afc70),{connection:_0x4cb4ef}=this['editor'][_0x16b9('0x80')][_0x16b9('0xa2')](_0x4f552f),_0x3f39e0=new Set();for(const _0x50d295 of _0x1ab40a){const _0xb16f3a=_0x50d295['_authorId'];_0xb16f3a&&!_0x5e2d7c[_0x16b9('0xa7')](_0xb16f3a)&&_0x3f39e0[_0x16b9('0xbe')](_0xb16f3a);}if(0x0===_0x3f39e0[_0x16b9('0x7e')])return;const _0x458d3b=await _0x3689eb[_0x16b9('0x7d')](_0x4cb4ef,Array[_0x16b9('0x1f')](_0x3f39e0));for(const _0x4a57d0 of _0x458d3b)_0x5e2d7c[_0x16b9('0xa7')](_0x4a57d0['id'])||_0x5e2d7c[_0x16b9('0x44')](_0x4a57d0);}[_0x16b9('0xc6')](_0x56eca0,_0x20f17d={}){const _0x1f6984=this[_0x16b9('0x24')]['model'],_0x3ac995=[];let _0x2f01a2=0x0;const _0x1c20b8='string'==typeof _0x56eca0?{'main':_0x56eca0}:_0x56eca0;for(const _0x181758 of Object[_0x16b9('0xc0')](_0x1c20b8)){if(!this[_0x16b9('0x2f')][_0x16b9('0x48')][_0x16b9('0x2c')](_0x181758))throw new _0x2c60b5(_0x16b9('0xaf'),this);const _0x128242=this[_0x16b9('0x24')]['data']['parse'](_0x1c20b8[_0x181758]),_0x178215=this[_0x16b9('0x2f')]['getRoot'](_0x181758),_0x99894c=new _0x597791(_0x1f6984[_0x16b9('0x9f')](_0x178215,0x0),_0x128242,_0x2f01a2++);_0x3ac995[_0x16b9('0x74')](_0x99894c);for(const [_0x8557c9,_0x546658]of _0x128242[_0x16b9('0x93')]){const _0x52e7ff=_0x1f6984[_0x16b9('0x42')](_0x1f6984[_0x16b9('0x1a')](_0x178215,_0x546658[_0x16b9('0x2b')]['path'][_0x16b9('0x4')]()),_0x1f6984[_0x16b9('0x1a')](_0x178215,_0x546658[_0x16b9('0x56')]['path']['slice']())),_0xfa0bd=new _0x3d7998(_0x8557c9,null,_0x52e7ff,_0x1f6984[_0x16b9('0x93')],!0x0,_0x2f01a2++);_0x3ac995[_0x16b9('0x74')](_0xfa0bd);}}if(_0x20f17d)for(const [_0x24b833,_0x266e8d]of Object[_0x16b9('0x82')](_0x20f17d)){const _0x2cbc1b=_0x1f6984[_0x16b9('0x3c')][_0x16b9('0x78')](_0x24b833);if(!_0x2cbc1b)throw new _0x2c60b5('multi-root-editor-root-attributes-no-root',null);for(const [_0x49476d,_0x1fd388]of Object[_0x16b9('0x82')](_0x266e8d))if(null!==_0x1fd388){const _0x45f1bf=new _0xe1b817(_0x2cbc1b,_0x49476d,null,_0x1fd388,_0x2f01a2++);_0x3ac995[_0x16b9('0x74')](_0x45f1bf);}}return _0x3ac995;}async[_0x16b9('0x89')](_0x997fa4,_0x4f1445){let _0x5f0b62;this[_0x16b9('0x3e')]=_0x997fa4['offset'];const _0x1f8072=_0x997fa4['wereChangesApplied']&&!_0x997fa4[_0x16b9('0xae')],_0x560913=_0x1f8072?0x0:_0x997fa4['data'][_0x16b9('0x19')];if(_0x1f8072)_0x5f0b62=_0x4f1445,_0x5f0b62[_0x16b9('0xa8')](_0xc5457d=>{_0xc5457d[_0x16b9('0x66')]=_0x997fa4[_0x16b9('0x55')],_0xc5457d[_0x16b9('0x36')]=!0x0,_0xc5457d['_authorId']=null;}),this['_applyOperationsSet'](_0x5f0b62,_0x1f8072);else{if(_0x997fa4[_0x16b9('0xae')]){const _0x544913=this[_0x16b9('0xc6')](_0x997fa4[_0x16b9('0xae')]);this[_0x16b9('0x2f')][_0x16b9('0x59')][_0x16b9('0x21')]=-_0x544913['length'],_0x544913[_0x16b9('0xa8')](_0x5832fb=>{_0x5832fb[_0x16b9('0x19')]-=_0x544913[_0x16b9('0x9a')],_0x5832fb[_0x16b9('0x66')]=_0x997fa4[_0x16b9('0x55')],_0x5832fb[_0x16b9('0x36')]=!0x0,_0x5832fb['_authorId']=null;}),this[_0x16b9('0x3f')](_0x544913,!0x0),this[_0x16b9('0x90')][_0x16b9('0x21')]=-_0x544913['length']+this[_0x16b9('0x3e')],this[_0x16b9('0x2d')](_0x544913);}this[_0x16b9('0x2f')][_0x16b9('0x59')][_0x16b9('0x21')]=_0x560913,_0x5f0b62=this[_0x16b9('0x94')](_0x997fa4[_0x16b9('0x47')],_0x997fa4[_0x16b9('0x98')]),await this['_fetchMissingUsers'](_0x5f0b62),this['_applyOperationsSet'](_0x5f0b62,_0x1f8072);}_0x997fa4['lastOperationId']&&(this[_0x16b9('0x4f')][_0x16b9('0x34')](_0x5f0b62,_0x997fa4[_0x16b9('0x2e')]),this[_0x16b9('0x8b')]=_0x997fa4['lastOperationId']),this[_0x16b9('0x90')][_0x16b9('0x21')]=_0x560913+this[_0x16b9('0x3e')],this[_0x16b9('0x2d')](_0x5f0b62);}[_0x16b9('0x6e')](_0x23788b,_0x4adeb8){throw this['_isPendingUpdate']=!0x0,_0x4adeb8&&console[_0x16b9('0x22')](_0x4adeb8),new _0x2c60b5(_0x23788b,this['editor']);}['_saveOperationInBuffer'](_0x3ef4f2){this['_knownOperations'][_0x16b9('0x2c')](_0x3ef4f2)||(this['_knownOperations'][_0x16b9('0xbe')](_0x3ef4f2),this['_bufferedOperations'][_0x16b9('0x74')](_0x3ef4f2),this[_0x16b9('0xa')]||_0x16b9('0x35')==_0x3ef4f2[_0x16b9('0x10')]&&!_0x3ef4f2['affectsData']||this[_0x16b9('0x3b')]());}[_0x16b9('0x2')](_0x5959e4=!0x1){!_0x5959e4&&this[_0x16b9('0x8d')]||(this[_0x16b9('0x8d')]=!0x0,clearTimeout(this[_0x16b9('0x8f')]),this[_0x16b9('0x8f')]=setTimeout(()=>{this[_0x16b9('0x5c')]()[_0x16b9('0x84')](_0x31182f=>{_0x31182f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})[_0x16b9('0x27')](_0x3d710d=>{if(this[_0x16b9('0x5b')](),this[_0x16b9('0x8d')]=!0x1,!function(_0xf978f5){return _0xf978f5[_0x16b9('0x16')][_0x16b9('0x1d')](_0x16b9('0x4e'))||_0xf978f5[_0x16b9('0x16')][_0x16b9('0x1d')](_0x16b9('0x9c'))||_0xf978f5[_0x16b9('0x16')][_0x16b9('0x1d')](_0x16b9('0xc5'));}(_0x3d710d))throw _0x3d710d;});},this[_0x16b9('0x71')]));}async[_0x16b9('0x5c')](){const _0x4b3811=this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x42f9dc);if(this[_0x16b9('0xad')]()&&(_0x4b3811[_0x16b9('0x3')](),this[_0x16b9('0x1')]=!0x1),!this[_0x16b9('0x63')]())return!0x0;const _0x263bcf=[...this[_0x16b9('0x77')]];for(const _0x42d166 of _0x263bcf)_0x42d166[_0x16b9('0x29')]=this[_0x16b9('0x2f')][_0x16b9('0x59')][_0x16b9('0x1c')](_0x42d166);const _0x5ca218=this['_operationIdentifier'][_0x16b9('0xa0')](_0x263bcf),_0x5a0ce7=$++,_0x5a69f0=this[_0x16b9('0x45')](_0x263bcf),_0x583844=await this[_0x16b9('0x99')][_0x16b9('0x31')](_0x5a69f0,_0x5a69f0['baseVersion'],_0x5ca218);try{return await this[_0x16b9('0x5d')](_0x263bcf,_0x583844,_0x5a0ce7);}catch(_0xbcc14c){return this['_crash'](_0x16b9('0xbb'),_0xbcc14c);}}async['_handleServerResponse'](_0x5c61b9,_0x54a1b6,_0x6b1578){if(_0x16b9('0x22')in _0x54a1b6)throw _0x54a1b6['error'];let _0x4e542e=!0x1;if(_0x54a1b6[_0x16b9('0xb7')]){_0x54a1b6[_0x16b9('0x2e')]&&(this['_lastSyncedOperationId']=_0x54a1b6['lastOperationId']),this[_0x16b9('0x77')]=this['_bufferedOperations'][_0x16b9('0xb6')](_0x222cf4=>!_0x5c61b9[_0x16b9('0x96')](_0x222cf4));for(const _0x123189 of _0x5c61b9)_0x123189[_0x16b9('0x66')]='lastOperationAcceptedAt'in _0x54a1b6&&_0x54a1b6['lastOperationAcceptedAt']||void 0x0;this[_0x16b9('0x2d')](_0x5c61b9),_0x4e542e=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xa910c8=this['_decompressOperations'](_0x54a1b6[_0x16b9('0x47')],_0x54a1b6[_0x16b9('0x98')])[_0x16b9('0xb6')](_0x17aee3=>_0x17aee3['baseVersion']>=this[_0x16b9('0xb2')]);await this[_0x16b9('0x6f')](_0xa910c8),_0x4e542e=this[_0x16b9('0xa3')](_0xa910c8,_0x54a1b6[_0x16b9('0x21')],_0x54a1b6['lastOperationId']),this[_0x16b9('0x71')]=Math[_0x16b9('0x13')](this['_currentBufferDelay']/0x2);}return _0x4e542e?!this[_0x16b9('0x63')]()||(this[_0x16b9('0x2')](!0x0),!0x1):this[_0x16b9('0x6e')](_0x16b9('0x54'));}[_0x16b9('0xa3')](_0x487660,_0x7f666c,_0x42042b){try{const _0x420a93={'document':this[_0x16b9('0x2f')],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x38ce9a,operationsB:_0x31dacc,originalOperations:_0x414689}=_0xa1a534(_0x487660,this[_0x16b9('0x77')],_0x420a93);K(_0x38ce9a,this[_0x16b9('0x2f')][_0x16b9('0x21')]),K(_0x31dacc,_0x7f666c);for(const _0x4e546f of _0x38ce9a){const _0xee207a=_0x414689[_0x16b9('0xa2')](_0x4e546f);_0x4e546f[_0x16b9('0x75')]=_0xee207a?_0xee207a['_authorId']:null;}_0x42042b&&(this['_operationIdentifier'][_0x16b9('0x34')](_0x487660,_0x42042b),this[_0x16b9('0x8b')]=_0x42042b),this['_bufferedOperations']=[..._0x31dacc],this[_0x16b9('0x3f')](_0x38ce9a),this[_0x16b9('0x2d')](_0x487660);}catch(_0x94fa2b){return console['error'](_0x94fa2b),!0x1;}return!0x0;}[_0x16b9('0x3f')](_0x26ebba,_0x3ac16b=!0x1){this[_0x16b9('0x24')]['model'][_0x16b9('0xd')]({'isUndoable':!0x1,'isLocal':!0x1},_0x4783cc=>{for(const _0x513063 of _0x26ebba)this[_0x16b9('0x7a')][_0x16b9('0xbe')](_0x513063),_0x4783cc[_0x16b9('0x81')]['addOperation'](_0x513063),this[_0x16b9('0x24')][_0x16b9('0x79')]['applyOperation'](_0x513063);});}[_0x16b9('0x2d')](_0x382041){_0x382041[_0x16b9('0xa8')](_0x392ad4=>{const _0x17ba51=_0x392ad4[_0x16b9('0x5f')]();_0x17ba51['_authorId']=_0x392ad4[_0x16b9('0x75')],_0x17ba51['_isInit']=!!_0x392ad4[_0x16b9('0x36')],_0x17ba51[_0x16b9('0x66')]=_0x392ad4['createdAt'],_0x17ba51[_0x16b9('0x19')]+=this['_offset'],_0x392ad4[_0x16b9('0x32')]&&this[_0x16b9('0xb')][_0x16b9('0xbe')](_0x17ba51),this[_0x16b9('0x90')]['addOperation'](_0x17ba51);});}[_0x16b9('0x20')](_0x3e6a9d){const _0x383bf9=this[_0x16b9('0x24')]['plugins'][_0x16b9('0xa2')](_0x16b9('0x60')),_0x287e5e=this[_0x16b9('0x24')][_0x16b9('0xab')];_0x3e6a9d||(_0x3e6a9d=_0x599e51(_0x287e5e,_0x16b9('0x11'))),_0x383bf9[_0x16b9('0x5e')](_0x3e6a9d,{'title':_0x599e51(_0x287e5e,'Synchronization\x20issue'),'namespace':_0x16b9('0x23')}),this[_0x16b9('0xb9')]=!0x0,clearTimeout(this[_0x16b9('0x8f')]),this[_0x16b9('0x77')]=[],this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x4f552f)[_0x16b9('0x49')]();}[_0x16b9('0x3b')](){this['_pendingAction']||(this[_0x16b9('0xa')]=this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x17ed1e)[_0x16b9('0xbe')](_0x599e51(this['editor'][_0x16b9('0xab')],_0x16b9('0x7b'))));}['_clearPendingAction'](){this[_0x16b9('0xa')]&&(this[_0x16b9('0x24')][_0x16b9('0x80')][_0x16b9('0xa2')](_0x17ed1e)[_0x16b9('0x8')](this[_0x16b9('0xa')]),this[_0x16b9('0xa')]=null);}[_0x16b9('0x45')](_0x4b0936){const _0x313199=_0x4b0936[_0x16b9('0x4b')](_0x1e2fa1=>_0x1e2fa1[_0x16b9('0xc7')]());return this[_0x16b9('0x83')]['compress'](_0x313199);}[_0x16b9('0x94')](_0x3f0180,_0x805f17){const _0x5994c7=new Set();return this['_compressor']['decompress'](_0x3f0180)[_0x16b9('0x4b')]((_0x2e759a,_0x3adf53)=>{const _0x201841=_0x16b9('0x91')==_0x805f17[_0x3adf53][_0x16b9('0x10')];if(_0x201841&&'InsertOperation'==_0x2e759a[_0x16b9('0x14')]){const _0x3e5d26=_0x2e759a[_0x16b9('0x6c')][_0x16b9('0xbf')];if(!this['_document']['getRoot'](_0x3e5d26)){const _0x59f2e4=new _0x37e440(_0x3e5d26,_0x16b9('0x70'),!0x0,this[_0x16b9('0x2f')],null);this[_0x16b9('0x2f')][_0x16b9('0x78')](_0x3e5d26)[_0x16b9('0x33')]=!0x0,this['_document'][_0x16b9('0x43')][_0x16b9('0xc4')](_0x59f2e4);}}const _0xd240d=_0x536bb6[_0x16b9('0x9')](_0x2e759a,this[_0x16b9('0x2f')]);if(_0x16b9('0x6b')==_0xd240d['type'])_0x5994c7['add'](_0x2e759a[_0x16b9('0x1e')]);else{if(_0x16b9('0xa9')==_0xd240d[_0x16b9('0x10')]){const _0x5f4e99=this[_0x16b9('0x2f')][_0x16b9('0x78')](_0x2e759a[_0x16b9('0x1e')]);_0x5f4e99&&_0x5f4e99[_0x16b9('0x97')]()&&!_0x5994c7[_0x16b9('0x2c')](_0x2e759a[_0x16b9('0x1e')])&&(_0x5f4e99['_isAttached']=!0x1,this[_0x16b9('0x2f')]['differ'][_0x16b9('0xc4')](_0xd240d[_0x16b9('0x30')]()));}}return _0xd240d[_0x16b9('0x29')]=_0x2e759a[_0x16b9('0x29')],_0xd240d[_0x16b9('0x36')]=_0x201841,_0xd240d[_0x16b9('0x75')]=_0x201841?null:_0x805f17[_0x3adf53][_0x16b9('0xc1')],_0xd240d[_0x16b9('0x32')]=_0x16b9('0xb4')===_0x805f17[_0x3adf53][_0x16b9('0x10')],_0xd240d[_0x16b9('0x66')]=_0x805f17[_0x3adf53][_0x16b9('0x66')],_0xd240d;});}[_0x16b9('0x61')](){this[_0x16b9('0x1')]=!0x0,this[_0x16b9('0xad')]()?this['_sendBufferedOperationsDelayed']():this[_0x16b9('0x1')]=!0x1;}[_0x16b9('0xad')](){const _0x3037f9=this['editor'][_0x16b9('0x80')][_0x16b9('0xa2')](_0x117482)[_0x16b9('0x87')][_0x16b9('0xa2')](this['_channelId']);return!this[_0x16b9('0x24')]['isReadOnly']&&!!_0x3037f9&&_0x3037f9['length']>0x1&&this[_0x16b9('0x1')];}[_0x16b9('0x63')](){return this[_0x16b9('0x77')][_0x16b9('0x9a')]>0x0||this[_0x16b9('0xad')]();}}l[_0x16b9('0x65')]=_0x29e4f9;class J extends Error{}function K(_0x3d863a,_0xf5addc){for(const _0x4bc783 of _0x3d863a)_0x4bc783[_0x16b9('0x19')]=_0xf5addc++;}class Q{constructor(_0x4afa48){this[_0x16b9('0x4c')]=_0x4afa48,this['_operationToId']=new WeakMap();}[_0x16b9('0xa0')](_0x534bcd){let _0x409ed0=_0x534bcd[_0x16b9('0x9a')];for(;_0x409ed0--;){const _0x1fb4ef=_0x534bcd[_0x409ed0];if(!this[_0x16b9('0x4c')][_0x16b9('0x2c')](_0x1fb4ef)){if(!this[_0x16b9('0x9b')][_0x16b9('0x2c')](_0x1fb4ef)){const _0x466b7f=_0x163706()['slice'](0x1,0x12);this[_0x16b9('0x9b')][_0x16b9('0x6d')](_0x1fb4ef,_0x466b7f);}return this['_operationToId'][_0x16b9('0xa2')](_0x1fb4ef);}}}[_0x16b9('0x34')](_0x34a053,_0x41d18b){if(!_0x41d18b)return;let _0x54e734=_0x34a053[_0x16b9('0x9a')];for(;_0x54e734--;){const _0x24f02c=_0x34a053[_0x54e734];this[_0x16b9('0x4c')][_0x16b9('0x2c')](_0x24f02c)||this[_0x16b9('0x9b')][_0x16b9('0x6d')](_0x24f02c,_0x41d18b);}}}
23
+ const _0x56d9=['_sendBufferedOperations','decompress','_loadRoot','addOperation','_fetchMissingUsers','init','setIdForTheLastOperation','disconnected','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','getIdOfTheLastOperation','wereChangesApplied','size','__className','getConnectedSessions','initData','_saveOperationInBuffer','rootsAttributes','remove','_authorId','marker','collaboration','_hasSelectionChanged','unregister','_sendBufferedOperationsDelayed','affectsData','realtimecollaborationclient-init-connection-failed','add','filter','createUserMarkerOperations','_lastServerVersion','markers','_document','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','_compressOperations','_handleReconnectionError','enableReadOnlyMode','view','path','cloudDocumentVersion','CollaborativeEditingService','connected','_handleSendingSelectionMarkers','getOperations','_shouldSendUpdate','lastSyncVersion','isUndoneOperation','keys','offset','_handleInitialConnectionData','data','root','reset','reconnect','entries','apply','includes','showWarning','_sendBufferedOperationsDelayId','string','_crash','realtimecollaborationclient-init-non-existent-root','_disconnectService','fire','round','_pendingAction','error','state','rtc-destroyed','realtimecollaborationclient-init-session-connection-error','_hasSynchronizationProblem','Synchronization\x20issue','_isAttached','_initSessionsHandling','PENDING_ACTION_SENDING_DATA','history','CommentsOnly','return','_operationToId','connect','stopListening','addRootAttribute','_handleReconnectionResponse','lastOperationId','_refreshUserSelectionMarkers','loadRoot','_shouldSendSelectionUpdate','pluginName','_handleExternalOperations','connection','destroy','_knownRootNames','_knownOperations','_isPendingUpdate','_isDisconnection','sendOperations','permissions','getUser','requires','_initThrowingOnDataSet','baseVersion','version','_lastSyncedOperationId','_currentBufferDelay','_setUpDataInit','ready','serverHistory','plugins','_addKnownRoot','get','_ignoredOperations','cloudServices.bundleVersion','model','_waitUntilSynced','wasUndone','createdAt','catch','stop','isEnabled','move','document','setPermissions','Notification','_offset','finally','lastDocumentSession','compress','high','_disconnectionOperations','metadata','change:range','409','addUser','sessionCreatedAt','has','enqueueChange','realtimecollaborationclient-initservice-incorrect-server-operation','_bufferRootLoad','register','_compressor','_updateServerHistory','userId','push','listenTo','_clearPendingAction','config','length','_handleReceivedOperations','realtimecollaborationclient-handleserverresponse','_connectService','lastOperationAcceptedAt','newRange','end','_getOperationsFromInitData','isReadOnly','clone','disableReadOnlyMode','message','sessionId','map','locale','_service','selection','createRange','collaboration.channelId','startsWith','channelSessions','change:_isPendingUpdate','RealTimeCollaborationClient','multi-root-editor-root-attributes-no-root','affectedSelectable','disconnect','editor','_handleServerResponse','set','addToReconnectionStack','targetPosition','getRoot','currentDocumentSession','_getAffectedRoot','_applyOperationsSet','collaboration-missing-channelid','createPositionFromPath','_operationIdentifier','toJSON','createRoot','from','then','_isEditingAllowed','real-time-collaboration','rtc-offline','cs:removeUser','_bufferedOperations','_channelId','forEach','mySessionId','Permissions','roots','document:write','define','addRoot','insert','createPositionAt','realtimecollaborationclient-initservice-internal-error','type','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.','bind','change:hasDomSelection','realtimecollaborationclient-init-document-already-initialized','_isConnected','applyOperation','_setPendingAction','_decompressOperations','code','start','slice','_baseBufferDelay','reconnection:\x20flushed\x20session','directChange','_isInit'];(function(_0x3d500d,_0x56d954){const _0x5003dd=function(_0x25d113){while(--_0x25d113){_0x3d500d['push'](_0x3d500d['shift']());}};_0x5003dd(++_0x56d954);}(_0x56d9,0x165));const _0x5003=function(_0x3d500d,_0x56d954){_0x3d500d=_0x3d500d-0x0;let _0x5003dd=_0x56d9[_0x3d500d];return _0x5003dd;};import{Plugin as _0x2b888e,PendingActions as _0x2b213d}from'ckeditor5/src/core';import{CKEditorError as _0x137034,version as _0x2075fc,uid as _0x58dd9a}from'ckeditor5/src/utils';import{Notification as _0x265e19}from'ckeditor5/src/ui';import{transformSets as _0x3c721f,NoOperation as _0x59c1fa,InsertOperation as _0x22f1ee,MarkerOperation as _0x44d5f2,RootAttributeOperation as _0x214a23,OperationFactory as _0x56a06e,History as _0x1a90e1}from'ckeditor5/src/engine';import _0x2da5a1 from'./websocketgateway';import _0x12b03b from'./sessions';import _0x1a8059 from'./usermarkers';import{getTranslation as _0x2eb069}from'../common-translations';import _0x336cb3 from'@ckeditor/ckeditor5-operations-compressor/src/compressor';import{Users as _0x19598e}from'ckeditor5-collaboration/src/collaboration-core';import{User as _0x18a942}from'@ckeditor/ckeditor-cloud-services-collaboration';import{CollaborativeEditingService as _0x494eb0}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services';let $=0x1;export default class l extends _0x2b888e{static get[_0x5003('0xb2')](){return[_0x2da5a1,_0x12b03b,_0x1a8059,_0x2b213d,_0x19598e,_0x265e19];}static get[_0x5003('0xa7')](){return _0x5003('0x1d');}get[_0x5003('0x77')](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this[_0x5003('0xba')][_0x5003('0xb5')]-this[_0x5003('0xcb')];}get[_0x5003('0x7d')](){const _0x1d87c2=this[_0x5003('0xba')]['getOperations']();for(let _0x579614=_0x1d87c2[_0x5003('0x7')]-0x1;_0x579614>=0x0;_0x579614--){const _0x312f91=_0x1d87c2[_0x579614];if(!this[_0x5003('0xd0')][_0x5003('0xd6')](_0x312f91))return _0x312f91[_0x5003('0xb4')]+0x1-this[_0x5003('0xcb')];}return 0x0;}constructor(_0x44246d){if(super(_0x44246d),this[_0x5003('0xcb')]=0x0,this[_0x5003('0x13')]=null,this[_0x5003('0xba')]=new _0x1a90e1(),this[_0x5003('0x21')]['config'][_0x5003('0x3c')](_0x5003('0x65'),{}),this[_0x5003('0x36')]=this[_0x5003('0x21')][_0x5003('0x6')][_0x5003('0xbd')](_0x5003('0x19')),!this[_0x5003('0x36')])throw new _0x137034(_0x5003('0x2a'),this);const _0x583908=_0x44246d[_0x5003('0x6')]['get'](_0x5003('0xbf'))||_0x2075fc;this['_service']=new l['CollaborativeEditingService'](_0x583908,this['_channelId']),this[_0x5003('0x70')]=this[_0x5003('0x21')]['model'][_0x5003('0xc8')],this['_compressor']=new _0x336cb3(),this[_0x5003('0x35')]=[],this[_0x5003('0xac')]=new WeakSet(),this[_0x5003('0xab')]=new Set(),this[_0x5003('0x23')]('_isPendingUpdate',!0x1),this[_0x5003('0x23')](_0x5003('0x96'),!0x1),this[_0x5003('0x91')]=null,this[_0x5003('0x66')]=!0x1,this[_0x5003('0x8a')]=null,this[_0x5003('0x4d')]=0x12c,this[_0x5003('0xb7')]=this[_0x5003('0x4d')],this[_0x5003('0xb6')]=null,this[_0x5003('0xd0')]=new WeakSet(),this['_operationIdentifier']=new Q(this['_disconnectionOperations']);}[_0x5003('0x56')](){const _0x2be49c=this[_0x5003('0x21')],_0x55d3ba=_0x2be49c['plugins']['get'](_0x19598e),_0x2acd24=_0x2be49c[_0x5003('0xbb')][_0x5003('0xbd')](_0x2da5a1);this[_0x5003('0x4')](_0x55d3ba,'getOperationAuthor',(_0x171452,_0x541e22)=>{const _0x13feef=_0x541e22[0x0];_0x13feef['_authorId']&&(_0x171452['return']=_0x55d3ba['getUser'](_0x13feef['_authorId']),_0x171452['stop']()),null===_0x13feef[_0x5003('0x63')]&&(_0x171452[_0x5003('0x9d')]=null,_0x171452[_0x5003('0xc5')]());},{'priority':'high'}),this[_0x5003('0x4')](_0x2be49c['model'][_0x5003('0xc8')][_0x5003('0x17')],_0x5003('0xd2'),(_0x57acbb,_0x3870c7)=>{_0x3870c7[_0x5003('0x4f')]&&this[_0x5003('0xa4')]();}),this[_0x5003('0x4')](_0x2be49c['editing'][_0x5003('0x75')],_0x5003('0x44'),()=>{this[_0x5003('0xa4')]();}),this[_0x5003('0xb3')](),_0x2be49c[_0x5003('0xc0')]['on']('applyOperation',(_0x1a5933,_0x1afc87)=>{const _0x3fa07f=_0x1afc87[0x0];_0x3fa07f['isDocumentOperation']&&(this[_0x5003('0x60')](_0x3fa07f),this[_0x5003('0x7c')]()&&this[_0x5003('0x68')]());}),this[_0x5003('0xb8')](),this[_0x5003('0x43')](_0x5003('0x31'))['to'](_0x2acd24,_0x5003('0x93'),this,'_hasSynchronizationProblem',(_0x5cb7a2,_0x5b511b)=>_0x5003('0x79')===_0x5cb7a2&&!_0x5b511b),this['on']('change:_isEditingAllowed',()=>{this[_0x5003('0x31')]?_0x2be49c[_0x5003('0x11')](_0x5003('0x33')):_0x2be49c[_0x5003('0x74')](_0x5003('0x33'));}),this['_isEditingAllowed']?_0x2be49c['disableReadOnlyMode'](_0x5003('0x33')):_0x2be49c['enableReadOnlyMode'](_0x5003('0x33')),this[_0x5003('0x23')]('_isConnected',!0x1);}async[_0x5003('0x85')](){const _0x56067b=this[_0x5003('0x21')][_0x5003('0xbb')]['get'](_0x12b03b),_0x5cdfab=this[_0x5003('0x21')]['plugins'][_0x5003('0xbd')](_0x2da5a1);try{this[_0x5003('0xad')]=!0x0,_0x56067b[_0x5003('0x67')](this[_0x5003('0x36')]);const _0x4205d2=await this[_0x5003('0x16')][_0x5003('0x85')](_0x5cdfab[_0x5003('0xa9')],this[_0x5003('0x7d')]);await this[_0x5003('0xa2')](_0x4205d2)&&(this[_0x5003('0xad')]=!0x1,this[_0x5003('0x5')]());const _0x5c7c5d=await this[_0x5003('0x16')][_0x5003('0x5e')]();_0x56067b[_0x5003('0xda')](this[_0x5003('0x36')],_0x5c7c5d),this[_0x5003('0x7a')](),this['_isConnected']=!0x0;}catch(_0x164a96){if(function(_0x439598){return'404'===_0x439598[_0x5003('0x4a')];}(_0x164a96)&&this[_0x5003('0x13')])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x35c4ab){return _0x5003('0xd3')===_0x35c4ab[_0x5003('0x4a')];}(_0x164a96)){const _0x125d25=_0x2eb069(this[_0x5003('0x21')][_0x5003('0x15')],_0x5003('0x42'));this[_0x5003('0x73')](_0x125d25);}else{if(!(_0x164a96 instanceof K))throw _0x164a96;this['_handleReconnectionError']();}}}}[_0x5003('0xaa')](){const _0x17c8b7=this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xbd')](_0x2da5a1),_0x232546=this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xbd')](_0x12b03b);this[_0x5003('0x21')]['enableReadOnlyMode'](_0x5003('0x94')),_0x232546['channelSessions']['has'](this[_0x5003('0x36')])&&_0x232546[_0x5003('0x67')](this[_0x5003('0x36')]),_0x17c8b7['removeFromReconnectionStack'](this),this[_0x5003('0x8e')](),super[_0x5003('0xaa')]();}async[_0x5003('0xa2')](_0x188c74){if(this['sessionId']!==_0x188c74['sessionId']&&this[_0x5003('0xb6')]!==_0x188c74[_0x5003('0xa3')])throw new K();return this['sessionId']=_0x188c74['sessionId'],this[_0x5003('0x22')]([],{..._0x188c74,'wereChangesApplied':!0x1,'data':_0x188c74[_0x5003('0x82')]},_0x5003('0x85'));}async['_connectService'](_0x52d2ce,_0x1ee194=!0x1){const {connection:_0x3b3ee7}=this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xbd')](_0x2da5a1);l[_0x5003('0x78')]['getConnectedSessions'](_0x3b3ee7,this[_0x5003('0x36')])[_0x5003('0x30')](_0xea1543=>this[_0x5003('0x99')](_0xea1543))[_0x5003('0xc4')](_0x410389=>{this[_0x5003('0x8c')](_0x5003('0x95'),_0x410389);}),this[_0x5003('0x4')](this[_0x5003('0x16')],'operationsReceived',this[_0x5003('0x8')][_0x5003('0x43')](this)),this[_0x5003('0x4')](this[_0x5003('0x16')],_0x5003('0x92'),(_0x36c0a0,_0x3f9fc6)=>{this['_crash'](_0x5003('0x40'),_0x3f9fc6);}),this[_0x5003('0x4')](this[_0x5003('0x16')],_0x5003('0x58'),()=>{this[_0x5003('0x46')]=!0x1;});const _0x1af2d0=this['_operationIdentifier'][_0x5003('0x5a')](_0x52d2ce);this[_0x5003('0xad')]=!0x0;const _0x5df550=await this[_0x5003('0x16')][_0x5003('0x9f')](_0x3b3ee7,this['_compressOperations'](_0x52d2ce),_0x1af2d0);if(this[_0x5003('0x13')]=_0x5df550['sessionId'],_0x1ee194){if(!_0x5df550[_0x5003('0x5b')])return void this[_0x5003('0x73')]();this[_0x5003('0xad')]=!0x1,this[_0x5003('0x5')](),this['serverHistory'][_0x5003('0x84')](),this[_0x5003('0xcb')]=_0x5df550[_0x5003('0x80')],this[_0x5003('0xba')][_0x5003('0xb5')]=this[_0x5003('0xcb')],await this[_0x5003('0x22')](_0x52d2ce,_0x5df550,_0x5003('0x4e'));}else await this[_0x5003('0x81')](_0x5df550,_0x52d2ce);this[_0x5003('0x7a')](),this[_0x5003('0x46')]=!0x0;}[_0x5003('0x7a')](){const _0x2dd3c2=this['editor'][_0x5003('0xbb')][_0x5003('0xbd')](_0x12b03b),_0x14b14c=this[_0x5003('0x21')][_0x5003('0xbb')]['get'](_0x1a8059),_0x588846=_0x2dd3c2[_0x5003('0x1b')][_0x5003('0xbd')](this[_0x5003('0x36')]);_0x588846&&_0x588846[_0x5003('0x7')]>0x1?_0x14b14c[_0x5003('0x6d')]():this[_0x5003('0x4')](_0x2dd3c2,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2dd3c2[_0x5003('0x1b')][_0x5003('0xbd')](this[_0x5003('0x36')])[_0x5003('0x7')]&&_0x14b14c[_0x5003('0x6d')]();});}async[_0x5003('0x8')](_0x4c04a8,_0x3bd681,_0x220585,_0x29d65e){if(!this[_0x5003('0xad')]&&this[_0x5003('0x70')][_0x5003('0xb5')]==_0x3bd681){const _0x464916=this[_0x5003('0x49')](_0x220585,_0x29d65e);await this[_0x5003('0x55')](_0x464916),this[_0x5003('0xa8')](_0x464916,_0x3bd681,_0x220585[_0x5003('0xa3')])||this[_0x5003('0x8c')](_0x5003('0xd8'));}}async['_connectAfterSessionHasBeenFlushed'](){this[_0x5003('0x8e')]();const {locale:_0x4ff8be}=this[_0x5003('0x21')];let _0x30da86;try{_0x30da86=await this[_0x5003('0x16')]['getDocumentDetails']();}catch(_0x1dc1de){const _0x27bfdc=_0x2eb069(_0x4ff8be,_0x5003('0x71'));return void this[_0x5003('0x73')](_0x27bfdc);}const _0xcf6ef9=_0x30da86[_0x5003('0x27')]||_0x30da86[_0x5003('0xcd')];if(this['_lastSyncedOperationId']===_0xcf6ef9[_0x5003('0xa3')])await this['_connectService'](this[_0x5003('0x21')][_0x5003('0xc0')][_0x5003('0xc8')][_0x5003('0x9b')][_0x5003('0x7b')](),!0x0);else{const _0x320b78=_0x2eb069(_0x4ff8be,_0x5003('0x59'));this[_0x5003('0x73')](_0x320b78);}}['_disconnectService'](){this[_0x5003('0x16')][_0x5003('0x20')](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this[_0x5003('0xa0')](this[_0x5003('0x16')]);}[_0x5003('0x99')](_0x35bd93){const _0x236e49=this['editor']['plugins'][_0x5003('0xbd')](_0x12b03b);this[_0x5003('0x4')](_0x236e49,'sessionAdd:'+this[_0x5003('0x36')],(_0x1c3e78,{session:_0x4b6374})=>{if(_0x4b6374['id']===_0x236e49[_0x5003('0x38')]){_0x1c3e78['off']();const _0x211126=this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xd6')](_0x5003('0x9c'))&&this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xbd')](_0x5003('0x9c'));let _0x2405f0=_0x4b6374[_0x5003('0xb0')];_0x211126&&_0x211126[_0x5003('0xc6')]&&(_0x2405f0=_0x2405f0['filter'](_0x2e0247=>_0x5003('0x3b')!==_0x2e0247)),this['editor'][_0x5003('0xbb')][_0x5003('0xbd')](_0x5003('0x39'))[_0x5003('0xc9')](_0x2405f0,this[_0x5003('0x36')]);}}),_0x236e49[_0x5003('0xda')](this['_channelId'],_0x35bd93);}[_0x5003('0xb3')](){const _0x5e8674=this['editor'][_0x5003('0x82')][_0x5003('0x23')];this['editor'][_0x5003('0x82')][_0x5003('0x23')]=(..._0x49792f)=>{if(!_0x49792f[_0x49792f[_0x5003('0x7')]-0x1]['suppressErrorInCollaboration'])throw new _0x137034('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5e8674[_0x5003('0x87')](this['editor'][_0x5003('0x82')],_0x49792f);};}[_0x5003('0xb8')](){this[_0x5003('0x21')]['data']['on'](_0x5003('0x56'),(_0x207910,[_0xc3d9f6])=>{if(this[_0x5003('0x70')][_0x5003('0xb5')])throw new _0x137034(_0x5003('0x45'),this);_0x207910[_0x5003('0xc5')](),this[_0x5003('0x48')]();const _0x3a4154=this['editor'][_0x5003('0x6')][_0x5003('0xbd')](_0x5003('0x61')),_0x319be3=this[_0x5003('0xe')](_0xc3d9f6,_0x3a4154);0x0==_0x319be3[_0x5003('0x7')]&&_0x319be3[_0x5003('0x3')](new _0x59c1fa(0x0)),_0x207910[_0x5003('0x9d')]=this[_0x5003('0xa')](_0x319be3)[_0x5003('0x30')](()=>{this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xbd')](_0x2da5a1)[_0x5003('0x24')](this),this['editor'][_0x5003('0x82')][_0x5003('0x8f')](_0x5003('0xb9'));})['catch'](_0xfd9a43=>this['_crash'](_0x5003('0x6a'),_0xfd9a43))[_0x5003('0xcc')](()=>this[_0x5003('0x5')]());},{'priority':_0x5003('0xcf')}),this['editor']['on'](_0x5003('0xa5'),async(_0x122c52,[_0x2eac5a,_0x163626])=>{_0x122c52[_0x5003('0xc5')]();const _0x334633=this[_0x5003('0x21')]['model'][_0x5003('0xc8')]['getRoot'](_0x2eac5a);if(!this[_0x5003('0xab')][_0x5003('0xd6')](_0x2eac5a)){const _0x1928c3=_0x163626&&_0x163626[_0x5003('0x82')]?_0x163626[_0x5003('0x82')]:'',_0x1f69ed=_0x163626&&_0x163626['attributes']?_0x163626['attributes']:{};await this[_0x5003('0x53')](_0x2eac5a,_0x1928c3,_0x1f69ed);}this[_0x5003('0x21')][_0x5003('0xc0')]['enqueueChange']({'isUndoable':!0x1},()=>{_0x334633['_isLoaded']=!0x0,this[_0x5003('0x21')][_0x5003('0xc0')][_0x5003('0xc8')]['differ'][_0x5003('0xd9')](_0x334633);});},{'priority':'high'});}async[_0x5003('0x55')](_0x44dad4){const _0x4ad68b=this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xbd')](_0x19598e),{connection:_0x44256c}=this[_0x5003('0x21')]['plugins'][_0x5003('0xbd')](_0x2da5a1),_0x50ccb2=new Set();for(const _0x1a37ef of _0x44dad4){const _0x1aec72=_0x1a37ef[_0x5003('0x63')];_0x1aec72&&!_0x4ad68b['getUser'](_0x1aec72)&&_0x50ccb2['add'](_0x1aec72);}if(0x0===_0x50ccb2[_0x5003('0x5c')])return;const _0x43422a=await _0x18a942['getMany'](_0x44256c,Array[_0x5003('0x2f')](_0x50ccb2));for(const _0x4e3701 of _0x43422a)_0x4ad68b[_0x5003('0xb1')](_0x4e3701['id'])||_0x4ad68b[_0x5003('0xd4')](_0x4e3701);}[_0x5003('0xe')](_0x4750c0,_0x47634c={}){const _0x31676b=this[_0x5003('0x21')]['model'],_0x12bb19=[];let _0x372dce=0x0;const _0x3bbb08=_0x5003('0x8b')==typeof _0x4750c0?{'main':_0x4750c0}:_0x4750c0;for(const _0x5c5562 of Object[_0x5003('0x7f')](_0x3bbb08)){if(!this[_0x5003('0x70')][_0x5003('0x3a')][_0x5003('0xd6')](_0x5c5562))throw new _0x137034(_0x5003('0x8d'),this);const _0xab1239=this[_0x5003('0x21')][_0x5003('0x82')]['parse'](_0x3bbb08[_0x5c5562]),_0x839d73=this[_0x5003('0x70')][_0x5003('0x26')](_0x5c5562),_0x3f5180=new _0x22f1ee(_0x31676b[_0x5003('0x3f')](_0x839d73,0x0),_0xab1239,_0x372dce++);_0x12bb19['push'](_0x3f5180);for(const [_0x51c018,_0x59b0e8]of _0xab1239[_0x5003('0x6f')]){const _0x5323c0=_0x31676b[_0x5003('0x18')](_0x31676b[_0x5003('0x2b')](_0x839d73,_0x59b0e8[_0x5003('0x4b')]['path'][_0x5003('0x4c')]()),_0x31676b['createPositionFromPath'](_0x839d73,_0x59b0e8[_0x5003('0xd')][_0x5003('0x76')][_0x5003('0x4c')]())),_0x111bbc=new _0x44d5f2(_0x51c018,null,_0x5323c0,_0x31676b[_0x5003('0x6f')],!0x0,_0x372dce++);_0x12bb19[_0x5003('0x3')](_0x111bbc);}}if(_0x47634c)for(const [_0x328162,_0x5a548c]of Object[_0x5003('0x86')](_0x47634c)){const _0x36e9bb=_0x31676b[_0x5003('0xc8')]['getRoot'](_0x328162);if(!_0x36e9bb)throw new _0x137034(_0x5003('0x1e'),null);for(const [_0x4a5b18,_0x48a0b5]of Object[_0x5003('0x86')](_0x5a548c))if(null!==_0x48a0b5){const _0x423a3b=new _0x214a23(_0x36e9bb,_0x4a5b18,null,_0x48a0b5,_0x372dce++);_0x12bb19['push'](_0x423a3b);}}return _0x12bb19;}async[_0x5003('0x53')](_0x189852,_0x4dd330,_0x24a5c6){this['_getOperationsFromInitData']({[_0x189852]:_0x4dd330},{[_0x189852]:_0x24a5c6})[_0x5003('0x37')]((_0x17818c,_0x444ef0)=>{_0x17818c['baseVersion']=this[_0x5003('0x70')]['version']+_0x444ef0,_0x17818c[_0x5003('0x50')]=!0x0,this[_0x5003('0x60')](_0x17818c);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async[_0x5003('0x81')](_0xb3c8ef,_0x33a96b){let _0x1c86b4;this[_0x5003('0xcb')]=_0xb3c8ef[_0x5003('0x80')];const _0xff3314=_0xb3c8ef[_0x5003('0x5b')]&&!_0xb3c8ef[_0x5003('0x5f')],_0x4bb368=_0xff3314?0x0:_0xb3c8ef['data'][_0x5003('0xb4')];if(_0x33a96b[_0x5003('0x37')](_0x3e207d=>{_0x3e207d[_0x5003('0x50')]=!0x0,_0x3e207d[_0x5003('0xc3')]=_0xb3c8ef['sessionCreatedAt'],_0x3e207d[_0x5003('0x63')]=null;}),_0xff3314)_0x1c86b4=_0x33a96b,this[_0x5003('0x29')](_0x1c86b4,_0xff3314);else{if(_0xb3c8ef[_0x5003('0x5f')]){const _0x31fc97=this[_0x5003('0xe')](_0xb3c8ef['initData']);this['_document'][_0x5003('0x9b')][_0x5003('0xb5')]=-_0x31fc97[_0x5003('0x7')],_0x31fc97[_0x5003('0x37')](_0x135460=>{_0x135460[_0x5003('0xb4')]-=_0x31fc97[_0x5003('0x7')],_0x135460[_0x5003('0xc3')]=_0xb3c8ef[_0x5003('0xd5')],_0x135460['_isInit']=!0x0,_0x135460[_0x5003('0x63')]=null;}),this[_0x5003('0x29')](_0x31fc97,!0x0),this[_0x5003('0xba')][_0x5003('0xb5')]=-_0x31fc97[_0x5003('0x7')]+this['_offset'],this[_0x5003('0x1')](_0x31fc97);}this['_document'][_0x5003('0x9b')][_0x5003('0xb5')]=_0x4bb368,_0x1c86b4=this[_0x5003('0x49')](_0xb3c8ef[_0x5003('0x82')],_0xb3c8ef[_0x5003('0xd1')]),await this[_0x5003('0x55')](_0x1c86b4),this[_0x5003('0x29')](_0x1c86b4,_0xff3314);}_0xb3c8ef[_0x5003('0xa3')]&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1c86b4,_0xb3c8ef[_0x5003('0xa3')]),this[_0x5003('0xb6')]=_0xb3c8ef[_0x5003('0xa3')]),this[_0x5003('0xba')][_0x5003('0xb5')]=_0x4bb368+this[_0x5003('0xcb')],this['_updateServerHistory'](_0x1c86b4),_0x33a96b[_0x5003('0x6c')](_0x27233a=>{const _0x3f3387=this['_getAffectedRoot'](_0x27233a);return _0x3f3387&&!this[_0x5003('0xab')][_0x5003('0xd6')](_0x3f3387);})[_0x5003('0x37')]((_0x452ef6,_0xccff85)=>{_0x452ef6[_0x5003('0xb4')]=this[_0x5003('0x70')][_0x5003('0xb5')]+_0xccff85,this[_0x5003('0x60')](_0x452ef6);}),this['_shouldSendUpdate']()?(this[_0x5003('0xb7')]=0x0,this[_0x5003('0x68')](!0x0),await this['_waitUntilSynced']()):(this[_0x5003('0xad')]=!0x1,this['_clearPendingAction']());}[_0x5003('0x8c')](_0xedade4,_0x2b0811){throw this[_0x5003('0xad')]=!0x0,_0x2b0811&&console['error'](_0x2b0811),new _0x137034(_0xedade4,this[_0x5003('0x21')]);}[_0x5003('0x60')](_0x4d3500){this['_knownOperations'][_0x5003('0xd6')](_0x4d3500)||(this['_knownOperations']['add'](_0x4d3500),this[_0x5003('0x35')][_0x5003('0x3')](_0x4d3500),this[_0x5003('0x91')]||_0x5003('0x64')==_0x4d3500[_0x5003('0x41')]&&!_0x4d3500[_0x5003('0x69')]||this['_setPendingAction']());}[_0x5003('0x68')](_0x18e6f5=!0x1){!_0x18e6f5&&this[_0x5003('0xad')]||(this['_isPendingUpdate']=!0x0,clearTimeout(this[_0x5003('0x8a')]),this[_0x5003('0x8a')]=setTimeout(()=>{this[_0x5003('0x51')]()[_0x5003('0x30')](_0x22bc69=>{_0x22bc69&&(this[_0x5003('0x5')](),this[_0x5003('0xad')]=!0x1);})[_0x5003('0xc4')](_0x19da6a=>{if(this[_0x5003('0x5')](),this[_0x5003('0xad')]=!0x1,!function(_0x55646d){return _0x55646d[_0x5003('0x12')]['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x55646d[_0x5003('0x12')][_0x5003('0x1a')]('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x55646d[_0x5003('0x12')][_0x5003('0x1a')]('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x19da6a))throw _0x19da6a;});},this[_0x5003('0xb7')]));}[_0x5003('0xc1')](){return new Promise(_0x3fa766=>{this['on'](_0x5003('0x1c'),()=>{_0x3fa766();});});}async[_0x5003('0x51')](){const _0x1ca02b=this['editor'][_0x5003('0xbb')][_0x5003('0xbd')](_0x1a8059);if(this[_0x5003('0xa6')]()&&(_0x1ca02b[_0x5003('0x6d')](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xf44d24=[...this[_0x5003('0x35')]];for(const _0x528317 of _0xf44d24)_0x528317[_0x5003('0xc2')]=this['_document'][_0x5003('0x9b')][_0x5003('0x7e')](_0x528317);const _0x50d839=this['_operationIdentifier'][_0x5003('0x5a')](_0xf44d24),_0x150b47=$++,_0x487f94=this[_0x5003('0x72')](_0xf44d24),_0x36a3b9=await this[_0x5003('0x16')][_0x5003('0xaf')](_0x487f94,_0x487f94['baseVersion'],_0x50d839);try{return await this[_0x5003('0x22')](_0xf44d24,_0x36a3b9,_0x150b47);}catch(_0x4ba3f7){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4ba3f7);}}async[_0x5003('0x22')](_0x3a8cdc,_0x4bf0ea,_0x1ee4d1){if(_0x5003('0x92')in _0x4bf0ea)throw _0x4bf0ea[_0x5003('0x92')];let _0x248644=!0x1;if(_0x4bf0ea[_0x5003('0x5b')]){_0x4bf0ea['lastOperationId']&&(this[_0x5003('0xb6')]=_0x4bf0ea['lastOperationId']),this['_bufferedOperations']=this[_0x5003('0x35')][_0x5003('0x6c')](_0x3e3aac=>!_0x3a8cdc[_0x5003('0x88')](_0x3e3aac));for(const _0x3cc026 of _0x3a8cdc)_0x3cc026[_0x5003('0xc3')]=_0x5003('0xb')in _0x4bf0ea&&_0x4bf0ea['lastOperationAcceptedAt']||void 0x0;J(_0x3a8cdc,_0x4bf0ea[_0x5003('0xb5')]-_0x3a8cdc[_0x5003('0x7')]),this[_0x5003('0x1')](_0x3a8cdc);const _0x563a0d=_0x3a8cdc[_0x5003('0x6c')](_0x233aaa=>{if(!_0x233aaa[_0x5003('0x50')])return!0x1;const _0x5a5f32=this[_0x5003('0x28')](_0x233aaa);return _0x5a5f32&&!this[_0x5003('0xab')][_0x5003('0xd6')](_0x5a5f32);});J(_0x563a0d,this[_0x5003('0x70')][_0x5003('0xb5')]),this[_0x5003('0x29')](_0x563a0d),_0x248644=!0x0,this[_0x5003('0xb7')]=this[_0x5003('0x4d')];}else{const _0xc887c=this[_0x5003('0x49')](_0x4bf0ea['data'],_0x4bf0ea[_0x5003('0xd1')])['filter'](_0x586349=>_0x586349[_0x5003('0xb4')]>=this[_0x5003('0x6e')]);_0xc887c['forEach'](_0xfe3264=>this['_addKnownRoot'](_0xfe3264)),this[_0x5003('0x35')]=this['_bufferedOperations'][_0x5003('0x6c')](_0x122521=>!_0x122521[_0x5003('0x50')]||!this[_0x5003('0xab')]['has'](this['_getAffectedRoot'](_0x122521))),this[_0x5003('0x35')][_0x5003('0x7')]&&J(this[_0x5003('0x35')],this[_0x5003('0x35')][0x0][_0x5003('0xb4')]),await this[_0x5003('0x55')](_0xc887c),_0x248644=this[_0x5003('0xa8')](_0xc887c,_0x4bf0ea[_0x5003('0xb5')],_0x4bf0ea['lastOperationId']),this[_0x5003('0xb7')]=Math[_0x5003('0x90')](this['_currentBufferDelay']/0x2);}return _0x248644?!this[_0x5003('0x7c')]()||(this[_0x5003('0x68')](!0x0),!0x1):this[_0x5003('0x8c')](_0x5003('0x9'));}['_handleExternalOperations'](_0x3c2ad4,_0x5830ec,_0x2b6863){try{const _0x296191={'document':this[_0x5003('0x70')],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2f9d54,operationsB:_0x2be3e7,originalOperations:_0x223a4d}=_0x3c721f(_0x3c2ad4,this[_0x5003('0x35')],_0x296191);J(_0x2f9d54,this[_0x5003('0x70')]['version']),J(_0x2be3e7,_0x5830ec);for(const _0x588f1e of _0x2f9d54){const _0x18b795=_0x223a4d[_0x5003('0xbd')](_0x588f1e);_0x588f1e[_0x5003('0x63')]=_0x18b795?_0x18b795[_0x5003('0x63')]:null;}_0x2b6863&&(this[_0x5003('0x2c')]['setIdForTheLastOperation'](_0x3c2ad4,_0x2b6863),this[_0x5003('0xb6')]=_0x2b6863),this[_0x5003('0x35')]=[..._0x2be3e7],this[_0x5003('0x29')](_0x2f9d54),this[_0x5003('0x1')](_0x3c2ad4);}catch(_0x12bbd4){return console[_0x5003('0x92')](_0x12bbd4),!0x1;}return!0x0;}['_applyOperationsSet'](_0x39f958,_0xcc3438=!0x1){this[_0x5003('0x21')][_0x5003('0xc0')][_0x5003('0xd7')]({'isUndoable':!0x1,'isLocal':!0x1},_0x297b0a=>{for(const _0x290d13 of _0x39f958)this[_0x5003('0xac')][_0x5003('0x6b')](_0x290d13),this[_0x5003('0xbc')](_0x290d13),_0x297b0a['batch'][_0x5003('0x54')](_0x290d13),this[_0x5003('0x21')][_0x5003('0xc0')][_0x5003('0x47')](_0x290d13);});}[_0x5003('0xbc')](_0x43ae70){const _0x37df16=this[_0x5003('0x28')](_0x43ae70);_0x37df16&&this[_0x5003('0xab')]['add'](_0x37df16);}[_0x5003('0x28')](_0x161284){let _0x545def,_0x26e8c7;switch(_0x161284['type']){case _0x5003('0x3e'):_0x545def=_0x161284['position'][_0x5003('0x83')];break;case _0x5003('0x64'):if(_0x26e8c7=_0x161284[_0x5003('0xc')],!_0x26e8c7)return null;_0x545def=_0x26e8c7['root'];break;case _0x5003('0xa1'):_0x545def=_0x161284[_0x5003('0x83')];break;case _0x5003('0x3d'):_0x545def=_0x161284[_0x5003('0x1f')];break;case _0x5003('0xc7'):_0x545def=_0x161284[_0x5003('0x25')][_0x5003('0x83')];break;default:return null;}return _0x545def['rootName'];}[_0x5003('0x1')](_0x583d7b){_0x583d7b[_0x5003('0x37')](_0x2ede49=>{const _0x2a1512=_0x2ede49[_0x5003('0x10')]();_0x2a1512[_0x5003('0x63')]=_0x2ede49[_0x5003('0x63')],_0x2a1512[_0x5003('0x50')]=!!_0x2ede49[_0x5003('0x50')],_0x2a1512[_0x5003('0xc3')]=_0x2ede49[_0x5003('0xc3')],_0x2a1512[_0x5003('0xb4')]+=this[_0x5003('0xcb')],_0x2ede49[_0x5003('0xae')]&&this[_0x5003('0xd0')][_0x5003('0x6b')](_0x2a1512),this[_0x5003('0xba')][_0x5003('0x54')](_0x2a1512);});}[_0x5003('0x73')](_0x351c46){const _0x39192f=this[_0x5003('0x21')]['plugins'][_0x5003('0xbd')](_0x5003('0xca')),_0x290066=this['editor'][_0x5003('0x15')];_0x351c46||(_0x351c46=_0x2eb069(_0x290066,'The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.')),_0x39192f[_0x5003('0x89')](_0x351c46,{'title':_0x2eb069(_0x290066,_0x5003('0x97')),'namespace':_0x5003('0x32')}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this[_0x5003('0x8a')]),this[_0x5003('0x35')]=[],this[_0x5003('0x21')]['plugins'][_0x5003('0xbd')](_0x2da5a1)[_0x5003('0xaa')]();}[_0x5003('0x48')](){this[_0x5003('0x91')]||(this[_0x5003('0x91')]=this[_0x5003('0x21')]['plugins'][_0x5003('0xbd')](_0x2b213d)[_0x5003('0x6b')](_0x2eb069(this[_0x5003('0x21')][_0x5003('0x15')],_0x5003('0x9a'))));}[_0x5003('0x5')](){this[_0x5003('0x91')]&&(this[_0x5003('0x21')]['plugins'][_0x5003('0xbd')](_0x2b213d)[_0x5003('0x62')](this[_0x5003('0x91')]),this[_0x5003('0x91')]=null);}['_compressOperations'](_0x353ed3){const _0x5dfc0f=_0x353ed3[_0x5003('0x14')](_0x36ef8c=>_0x36ef8c[_0x5003('0x2d')]());return this[_0x5003('0x0')][_0x5003('0xce')](_0x5dfc0f);}[_0x5003('0x49')](_0x1d5b50,_0x28ef3b){return this['_compressor'][_0x5003('0x52')](_0x1d5b50)[_0x5003('0x14')]((_0x2df1de,_0xfd29b6)=>{const _0x2ff372='init'==_0x28ef3b[_0xfd29b6]['type'];if('InsertOperation'==_0x2df1de[_0x5003('0x5d')]){const _0x4611cc=_0x2df1de['position'][_0x5003('0x83')];!this[_0x5003('0x70')]['getRoot'](_0x4611cc)&&(this[_0x5003('0x70')][_0x5003('0x2e')]('$root',_0x4611cc)[_0x5003('0x98')]=!0x1);}const _0x285142=_0x56a06e['fromJSON'](_0x2df1de,this['_document']);return _0x285142[_0x5003('0xc2')]=_0x2df1de[_0x5003('0xc2')],_0x285142['_isInit']=_0x2ff372,_0x285142[_0x5003('0x63')]=_0x2ff372?null:_0x28ef3b[_0xfd29b6][_0x5003('0x2')],_0x285142[_0x5003('0xae')]=_0x5003('0x34')===_0x28ef3b[_0xfd29b6]['type'],_0x285142['createdAt']=_0x28ef3b[_0xfd29b6][_0x5003('0xc3')],_0x285142;});}[_0x5003('0xa4')](){this['_hasSelectionChanged']=!0x0,this[_0x5003('0xa6')]()?this[_0x5003('0x68')]():this[_0x5003('0x66')]=!0x1;}[_0x5003('0xa6')](){const _0x606fff=this[_0x5003('0x21')][_0x5003('0xbb')][_0x5003('0xbd')](_0x12b03b)[_0x5003('0x1b')][_0x5003('0xbd')](this[_0x5003('0x36')]);return!this['editor'][_0x5003('0xf')]&&!!_0x606fff&&_0x606fff['length']>0x1&&this[_0x5003('0x66')];}[_0x5003('0x7c')](){return this['_bufferedOperations'][_0x5003('0x7')]>0x0||this[_0x5003('0xa6')]();}}l[_0x5003('0x78')]=_0x494eb0;class K extends Error{}function J(_0x56a532,_0x45b66b){for(const _0x1e9983 of _0x56a532)_0x1e9983['baseVersion']=_0x45b66b++;}class Q{constructor(_0x15581a){this[_0x5003('0xbe')]=_0x15581a,this[_0x5003('0x9e')]=new WeakMap();}['getIdOfTheLastOperation'](_0x2dfea0){let _0x240452=_0x2dfea0[_0x5003('0x7')];for(;_0x240452--;){const _0x1a58b2=_0x2dfea0[_0x240452];if(!this[_0x5003('0xbe')]['has'](_0x1a58b2)){if(!this[_0x5003('0x9e')][_0x5003('0xd6')](_0x1a58b2)){const _0x47e2d6=_0x58dd9a()[_0x5003('0x4c')](0x1,0x12);this[_0x5003('0x9e')][_0x5003('0x23')](_0x1a58b2,_0x47e2d6);}return this[_0x5003('0x9e')][_0x5003('0xbd')](_0x1a58b2);}}}[_0x5003('0x57')](_0xf8e610,_0x2721ac){if(!_0x2721ac)return;let _0x3c5091=_0xf8e610[_0x5003('0x7')];for(;_0x3c5091--;){const _0x37d149=_0xf8e610[_0x3c5091];this[_0x5003('0xbe')][_0x5003('0xd6')](_0x37d149)||this[_0x5003('0x9e')]['set'](_0x37d149,_0x2721ac);}}}
@@ -1,13 +1,17 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
1
5
  /**
2
6
  * @module real-time-collaboration/realtimecollaborativeediting/sessions
3
7
  * @publicApi
4
8
  */
5
- import { ContextPlugin, type Editor, type Context } from 'ckeditor5/src/core.js';
6
- import { Collection } from 'ckeditor5/src/utils.js';
7
- import WebSocketGateway from './websocketgateway.js';
8
- import { Users, type User } from 'ckeditor5-collaboration';
9
+ import { ContextPlugin, type Editor, type Context } from 'ckeditor5/src/core';
10
+ import { Collection } from 'ckeditor5/src/utils';
11
+ import WebSocketGateway from './websocketgateway';
12
+ import { Users, type User } from 'ckeditor5-collaboration/src/collaboration-core';
9
13
  import type { User as ServerUserModel } from '@ckeditor/ckeditor-cloud-services-collaboration';
10
- import type { SessionCollection, ISocket } from '@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';
14
+ import type { SessionCollection, ISocket } from '@ckeditor/ckeditor-cloud-services-collaboration/src/services';
11
15
  type ServerUser = ServerUserModel & User;
12
16
  /**
13
17
  *
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2b7b=['allConnectedUsers','sessions-unregister-not-exist','_createUser','_handleSessionAdd','getUser','_users','values','assign','addUser','getUserRole','getUserBySessionId','role','change:state','listenTo','delete','init','remove','getUserSessions','add','pluginName','unregister','channelConnectedUsers','user','register','set','orderNumber','has','_uniqueUsersCount','sessionId','_registeredSessions','get','plugins','forEach','requires','state','channelSessions','connected','connection','size','sessionAdd:','context','stopListening','clear','_handleSessionRemove'];(function(_0x109c9f,_0x2b7bfe){const _0x2d8059=function(_0xc225e1){while(--_0xc225e1){_0x109c9f['push'](_0x109c9f['shift']());}};_0x2d8059(++_0x2b7bfe);}(_0x2b7b,0xa9));const _0x2d80=function(_0x109c9f,_0x2b7bfe){_0x109c9f=_0x109c9f-0x0;let _0x2d8059=_0x2b7b[_0x109c9f];return _0x2d8059;};import{ContextPlugin as _0x5f3eb1}from'ckeditor5/src/core.js';import{Collection as _0x3bd3b4,CKEditorError as _0xa88b3}from'ckeditor5/src/utils.js';import _0x34cffe from'./websocketgateway.js';import{Users as _0x2e69ec}from'ckeditor5-collaboration';export default class r extends _0x5f3eb1{static get[_0x2d80('0x1a')](){return'Sessions';}static get[_0x2d80('0x28')](){return[_0x34cffe,_0x2e69ec];}constructor(_0x199923){super(_0x199923),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this[_0x2d80('0x7')]=new _0x3bd3b4(),this[_0x2d80('0x24')]=new Map(),this[_0x2d80('0x22')]=0x0,this['_users']=this[_0x2d80('0x3')][_0x2d80('0x26')][_0x2d80('0x25')](_0x2e69ec);}[_0x2d80('0x16')](){const _0x2bf85b=this[_0x2d80('0x3')][_0x2d80('0x26')]['get'](_0x34cffe);this[_0x2d80('0x14')](_0x2bf85b,_0x2d80('0x13'),(_0x5cdff8,_0x297d92,_0x8234fa)=>{if(_0x2d80('0x2b')!==_0x8234fa)this['channelSessions'][_0x2d80('0x27')](_0x4cc93b=>_0x4cc93b['clear']()),this[_0x2d80('0x1c')][_0x2d80('0x27')](_0x492283=>_0x492283[_0x2d80('0x5')]()),this[_0x2d80('0x7')][_0x2d80('0x5')]();else for(const [_0xb11aaf,_0x6d80d2]of this[_0x2d80('0x24')])for(const _0x2e8ec9 of _0x6d80d2)this[_0x2d80('0xa')](_0xb11aaf,_0x2e8ec9);}),this[_0x2d80('0x9')](_0x2bf85b[_0x2d80('0x0')]['me'],!0x0);}[_0x2d80('0x1e')](_0x57846e,_0x1e2d23){if(this['_registeredSessions'][_0x2d80('0x21')](_0x57846e))throw new _0xa88b3('sessions-register-already-registered',null,{'channelId':_0x57846e});this['_registeredSessions'][_0x2d80('0x1f')](_0x57846e,_0x1e2d23),this[_0x2d80('0x2a')][_0x2d80('0x1f')](_0x57846e,new _0x3bd3b4()),this[_0x2d80('0x1c')]['set'](_0x57846e,new _0x3bd3b4()),this['listenTo'](_0x1e2d23,_0x2d80('0x19'),(_0x24d284,_0x576d10)=>this[_0x2d80('0xa')](_0x57846e,_0x576d10)),this[_0x2d80('0x14')](_0x1e2d23,_0x2d80('0x17'),(_0x399763,_0x2abcc2)=>this[_0x2d80('0x6')](_0x57846e,_0x2abcc2));for(const _0x418f82 of _0x1e2d23)this['_handleSessionAdd'](_0x57846e,_0x418f82);}[_0x2d80('0x1b')](_0x3d3a1d){if(!this[_0x2d80('0x24')]['has'](_0x3d3a1d))throw new _0xa88b3(_0x2d80('0x8'),null,{'channelId':_0x3d3a1d});const _0x3608cb=this['_registeredSessions'][_0x2d80('0x25')](_0x3d3a1d);this[_0x2d80('0x4')](_0x3608cb);for(const _0x382845 of _0x3608cb)_0x2d80('0x2b')===this[_0x2d80('0x3')][_0x2d80('0x26')][_0x2d80('0x25')](_0x34cffe)[_0x2d80('0x29')]&&this[_0x2d80('0x6')](_0x3d3a1d,_0x382845);this['_registeredSessions'][_0x2d80('0x15')](_0x3d3a1d),this['channelSessions'][_0x2d80('0x15')](_0x3d3a1d),this[_0x2d80('0x1c')][_0x2d80('0x15')](_0x3d3a1d);}get['mySessionId'](){return this[_0x2d80('0x3')][_0x2d80('0x26')]['get'](_0x34cffe)[_0x2d80('0x0')][_0x2d80('0x23')];}[_0x2d80('0x11')](_0x1c9be1){for(const _0x20659 of this[_0x2d80('0x2a')]['values']())for(const _0x268599 of _0x20659)if(_0x268599['id']===_0x1c9be1)return _0x268599['user'];}[_0x2d80('0x18')](_0x2402fc,_0x33a67d){const _0x4a98e7=_0x33a67d?[this['channelSessions'][_0x2d80('0x25')](_0x33a67d)]:this[_0x2d80('0x2a')][_0x2d80('0xd')](),_0x55fddd=new Set();for(const _0x52c1a6 of _0x4a98e7)for(const _0x351641 of _0x52c1a6)_0x351641[_0x2d80('0x1d')]['id']===_0x2402fc['id']&&_0x55fddd[_0x2d80('0x19')](_0x351641['id']);return _0x55fddd;}[_0x2d80('0x10')](_0x53680d){for(const _0xe6e3ef of this['channelSessions'][_0x2d80('0xd')]())for(const _0xe6a227 of _0xe6e3ef)if(_0xe6a227[_0x2d80('0x1d')]===_0x53680d)return _0xe6a227[_0x2d80('0x12')];}[_0x2d80('0xa')](_0x177ee5,_0x1b03e9){if(_0x2d80('0x2b')!==this['context'][_0x2d80('0x26')][_0x2d80('0x25')](_0x34cffe)['state'])return;const _0x35ade6=_0x1b03e9[_0x2d80('0x1d')],_0x376179=this[_0x2d80('0xc')][_0x2d80('0xb')](_0x35ade6['id'])||this['_createUser'](_0x35ade6),_0x3241a3=Object[_0x2d80('0xe')]({},_0x1b03e9,{'user':_0x376179});this['channelSessions']['get'](_0x177ee5)[_0x2d80('0x19')](_0x3241a3);const _0x4ba63a=this[_0x2d80('0x1c')][_0x2d80('0x25')](_0x177ee5);_0x4ba63a[_0x2d80('0x21')](_0x376179['id'])||_0x4ba63a['add'](_0x376179),this[_0x2d80('0x7')][_0x2d80('0x21')](_0x376179['id'])||this[_0x2d80('0x7')]['add'](_0x376179),this['fire'](_0x2d80('0x2')+_0x177ee5,{'channelId':_0x177ee5,'session':_0x3241a3});}[_0x2d80('0x6')](_0x6a6ebd,_0x4acd3d){if('connected'!==this[_0x2d80('0x3')][_0x2d80('0x26')]['get'](_0x34cffe)[_0x2d80('0x29')])return;const _0x91edd1=this[_0x2d80('0x1c')][_0x2d80('0x25')](_0x6a6ebd),_0x16e20e=_0x4acd3d[_0x2d80('0x1d')];_0x16e20e['id']&&(this[_0x2d80('0x2a')][_0x2d80('0x25')](_0x6a6ebd)[_0x2d80('0x17')](_0x4acd3d['id']),_0x91edd1[_0x2d80('0x21')](_0x16e20e['id'])&&!this[_0x2d80('0x18')](_0x16e20e,_0x6a6ebd)[_0x2d80('0x1')]&&_0x91edd1[_0x2d80('0x17')](_0x16e20e['id']),this[_0x2d80('0x7')][_0x2d80('0x25')](_0x16e20e['id'])&&!this[_0x2d80('0x18')](_0x16e20e)['size']&&this[_0x2d80('0x7')][_0x2d80('0x17')](_0x16e20e['id']));}[_0x2d80('0x9')](_0x283dcd,_0x538294){const _0x360203=this[_0x2d80('0xc')][_0x2d80('0xf')](_0x283dcd);return _0x538294&&this[_0x2d80('0xc')]['defineMe'](_0x283dcd['id']),_0x360203[_0x2d80('0x20')]=this[_0x2d80('0x22')]++,_0x360203;}}
23
+ const _0x3121=['assign','getUserBySessionId','unregister','register','channelSessions','_handleSessionAdd','_uniqueUsersCount','role','sessionAdd:','channelConnectedUsers','listenTo','add','getUser','connected','pluginName','user','clear','requires','change:state','_users','connection','defineMe','get','state','allConnectedUsers','Sessions','sessions-register-already-registered','orderNumber','fire','plugins','values','mySessionId','delete','set','stopListening','_createUser','getUserSessions','_registeredSessions','has','addUser','remove','getUserRole','_handleSessionRemove','context','forEach','size'];(function(_0x42ada9,_0x3121ad){const _0x3e3fa9=function(_0x1fe1ce){while(--_0x1fe1ce){_0x42ada9['push'](_0x42ada9['shift']());}};_0x3e3fa9(++_0x3121ad);}(_0x3121,0x17c));const _0x3e3f=function(_0x42ada9,_0x3121ad){_0x42ada9=_0x42ada9-0x0;let _0x3e3fa9=_0x3121[_0x42ada9];return _0x3e3fa9;};import{ContextPlugin as _0x372b72}from'ckeditor5/src/core';import{Collection as _0x821c40,CKEditorError as _0x5dfe41}from'ckeditor5/src/utils';import _0x343df9 from'./websocketgateway';import{Users as _0x375779}from'ckeditor5-collaboration/src/collaboration-core';export default class r extends _0x372b72{static get[_0x3e3f('0x2')](){return _0x3e3f('0xd');}static get[_0x3e3f('0x5')](){return[_0x343df9,_0x375779];}constructor(_0x400338){super(_0x400338),this[_0x3e3f('0x26')]=new Map(),this[_0x3e3f('0x2b')]=new Map(),this['allConnectedUsers']=new _0x821c40(),this['_registeredSessions']=new Map(),this[_0x3e3f('0x28')]=0x0,this[_0x3e3f('0x7')]=this['context'][_0x3e3f('0x11')][_0x3e3f('0xa')](_0x375779);}['init'](){const _0x265493=this[_0x3e3f('0x1f')]['plugins']['get'](_0x343df9);this['listenTo'](_0x265493,_0x3e3f('0x6'),(_0x3c8afb,_0x167833,_0x5a7fe3)=>{if(_0x3e3f('0x1')!==_0x5a7fe3)this[_0x3e3f('0x26')][_0x3e3f('0x20')](_0x30bec2=>_0x30bec2['clear']()),this[_0x3e3f('0x2b')][_0x3e3f('0x20')](_0x1a99f3=>_0x1a99f3[_0x3e3f('0x4')]()),this[_0x3e3f('0xc')][_0x3e3f('0x4')]();else for(const [_0x103b79,_0x227830]of this[_0x3e3f('0x19')])for(const _0x40046e of _0x227830)this[_0x3e3f('0x27')](_0x103b79,_0x40046e);}),this[_0x3e3f('0x17')](_0x265493['connection']['me'],!0x0);}[_0x3e3f('0x25')](_0x890b3a,_0x41cf0b){if(this[_0x3e3f('0x19')][_0x3e3f('0x1a')](_0x890b3a))throw new _0x5dfe41(_0x3e3f('0xe'),null,{'channelId':_0x890b3a});this[_0x3e3f('0x19')][_0x3e3f('0x15')](_0x890b3a,_0x41cf0b),this[_0x3e3f('0x26')]['set'](_0x890b3a,new _0x821c40()),this[_0x3e3f('0x2b')][_0x3e3f('0x15')](_0x890b3a,new _0x821c40()),this[_0x3e3f('0x2c')](_0x41cf0b,_0x3e3f('0x2d'),(_0x121517,_0x341b25)=>this[_0x3e3f('0x27')](_0x890b3a,_0x341b25)),this[_0x3e3f('0x2c')](_0x41cf0b,_0x3e3f('0x1c'),(_0xf14eb4,_0x710303)=>this[_0x3e3f('0x1e')](_0x890b3a,_0x710303));for(const _0x2aea46 of _0x41cf0b)this[_0x3e3f('0x27')](_0x890b3a,_0x2aea46);}[_0x3e3f('0x24')](_0x4f3705){if(!this[_0x3e3f('0x19')]['has'](_0x4f3705))throw new _0x5dfe41('sessions-unregister-not-exist',null,{'channelId':_0x4f3705});const _0x27c89c=this['_registeredSessions'][_0x3e3f('0xa')](_0x4f3705);this[_0x3e3f('0x16')](_0x27c89c);for(const _0x47fd49 of _0x27c89c)'connected'===this[_0x3e3f('0x1f')]['plugins'][_0x3e3f('0xa')](_0x343df9)[_0x3e3f('0xb')]&&this[_0x3e3f('0x1e')](_0x4f3705,_0x47fd49);this[_0x3e3f('0x19')][_0x3e3f('0x14')](_0x4f3705),this['channelSessions']['delete'](_0x4f3705),this[_0x3e3f('0x2b')]['delete'](_0x4f3705);}get[_0x3e3f('0x13')](){return this['context'][_0x3e3f('0x11')][_0x3e3f('0xa')](_0x343df9)[_0x3e3f('0x8')]['sessionId'];}[_0x3e3f('0x23')](_0x5d5d94){for(const _0x2b45f8 of this[_0x3e3f('0x26')][_0x3e3f('0x12')]())for(const _0x2fdcef of _0x2b45f8)if(_0x2fdcef['id']===_0x5d5d94)return _0x2fdcef[_0x3e3f('0x3')];}[_0x3e3f('0x18')](_0x3992f1,_0x34caf2){const _0x37f97a=_0x34caf2?[this['channelSessions'][_0x3e3f('0xa')](_0x34caf2)]:this[_0x3e3f('0x26')][_0x3e3f('0x12')](),_0x4f3efb=new Set();for(const _0x43e724 of _0x37f97a)for(const _0x12bd21 of _0x43e724)_0x12bd21[_0x3e3f('0x3')]['id']===_0x3992f1['id']&&_0x4f3efb[_0x3e3f('0x2d')](_0x12bd21['id']);return _0x4f3efb;}[_0x3e3f('0x1d')](_0x4cc22e){for(const _0x2eed7c of this[_0x3e3f('0x26')][_0x3e3f('0x12')]())for(const _0x45fd65 of _0x2eed7c)if(_0x45fd65[_0x3e3f('0x3')]===_0x4cc22e)return _0x45fd65[_0x3e3f('0x29')];}[_0x3e3f('0x27')](_0x4d8784,_0x23e384){if('connected'!==this[_0x3e3f('0x1f')][_0x3e3f('0x11')]['get'](_0x343df9)['state'])return;const _0x20a0e3=_0x23e384[_0x3e3f('0x3')],_0x168103=this[_0x3e3f('0x7')][_0x3e3f('0x0')](_0x20a0e3['id'])||this[_0x3e3f('0x17')](_0x20a0e3),_0x2bb694=Object[_0x3e3f('0x22')]({},_0x23e384,{'user':_0x168103});this['channelSessions'][_0x3e3f('0xa')](_0x4d8784)['add'](_0x2bb694);const _0x1b8c88=this[_0x3e3f('0x2b')][_0x3e3f('0xa')](_0x4d8784);_0x1b8c88['has'](_0x168103['id'])||_0x1b8c88[_0x3e3f('0x2d')](_0x168103),this[_0x3e3f('0xc')][_0x3e3f('0x1a')](_0x168103['id'])||this[_0x3e3f('0xc')][_0x3e3f('0x2d')](_0x168103),this[_0x3e3f('0x10')](_0x3e3f('0x2a')+_0x4d8784,{'channelId':_0x4d8784,'session':_0x2bb694});}[_0x3e3f('0x1e')](_0x36a146,_0x34e944){if(_0x3e3f('0x1')!==this[_0x3e3f('0x1f')][_0x3e3f('0x11')]['get'](_0x343df9)['state'])return;const _0x5016e4=this[_0x3e3f('0x2b')][_0x3e3f('0xa')](_0x36a146),_0x44c8d4=_0x34e944[_0x3e3f('0x3')];_0x44c8d4['id']&&(this['channelSessions'][_0x3e3f('0xa')](_0x36a146)[_0x3e3f('0x1c')](_0x34e944['id']),_0x5016e4['has'](_0x44c8d4['id'])&&!this['getUserSessions'](_0x44c8d4,_0x36a146)[_0x3e3f('0x21')]&&_0x5016e4[_0x3e3f('0x1c')](_0x44c8d4['id']),this[_0x3e3f('0xc')]['get'](_0x44c8d4['id'])&&!this[_0x3e3f('0x18')](_0x44c8d4)['size']&&this['allConnectedUsers']['remove'](_0x44c8d4['id']));}[_0x3e3f('0x17')](_0xda2254,_0x29e023){const _0x207754=this[_0x3e3f('0x7')][_0x3e3f('0x1b')](_0xda2254);return _0x29e023&&this[_0x3e3f('0x7')][_0x3e3f('0x9')](_0xda2254['id']),_0x207754[_0x3e3f('0xf')]=this[_0x3e3f('0x28')]++,_0x207754;}}
@@ -1,5 +1,9 @@
1
- import { Plugin } from 'ckeditor5/src/core.js';
2
- import Sessions from './sessions.js';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import { Plugin } from 'ckeditor5/src/core';
6
+ import Sessions from './sessions';
3
7
  import '../../theme/usermarkers.css';
4
8
  /**
5
9
  * This plugin:
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  *
4
4
  *
5
5
  *
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x452b=['user:range','isObject','document','getUserBySessionId','markerRange','markerToHighlight','toRange','model','plugins','user:position','end','removeMarker','getMarkerClass','ck-user__marker\x20','detach','editing','requires','mySessionId','contenteditable','innerHTML','set','getPositions','rootName','createUIElement','conversion','color','selection','nodeAfter','updateMarker','schema','tableCell','view','root','clear','applyOperation','getRange','checkChild','oldRange','markerToElement','getAttribute','for','user:range:','pluginName','editingDowncast','get','has','name','enqueueChange','update:user:range','_createdBatches','type','isCollapsed','toDomElement','UserMarkers','change','markers','getStart','split','⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>⁠','createRange','getSelectionClass','getNearestSelectionRange','userPositionMarker','markerName','$text','hasDomSelection','deletionPosition','isSimilar','span','startsWith','setCustomProperty','addMarker','editor','isLimit','user:position:','user:','undo','orderNumber','getCustomProperty','hasContent','data-session-id','$graveyard','init','delete','reconvertMarker','start'];(function(_0x5306e8,_0x452bba){const _0x40a6c1=function(_0xef5a8a){while(--_0xef5a8a){_0x5306e8['push'](_0x5306e8['shift']());}};_0x40a6c1(++_0x452bba);}(_0x452b,0x1c1));const _0x40a6=function(_0x5306e8,_0x452bba){_0x5306e8=_0x5306e8-0x0;let _0x40a6c1=_0x452b[_0x5306e8];return _0x40a6c1;};import{Plugin as _0x29585e}from'ckeditor5/src/core.js';import _0x4a5d97 from'./sessions.js';import{LiveRange as _0x301032}from'ckeditor5/src/engine.js';import'../../theme/usermarkers.css';export default class W extends _0x29585e{static get[_0x40a6('0x53')](){return[_0x4a5d97];}static get[_0x40a6('0x17')](){return _0x40a6('0x22');}[_0x40a6('0x3f')](){const _0x167c7d=this[_0x40a6('0x35')],_0x1e8c23=_0x167c7d[_0x40a6('0x4b')]['get'](_0x4a5d97);_0x167c7d[_0x40a6('0x5')][_0x40a6('0x15')]('editingDowncast')[_0x40a6('0x13')]({'model':_0x40a6('0x4c'),'view':(_0x2ee70c,{writer:_0x4e9d43})=>function(_0x3a5dfd,_0x53aecf,_0x195325,_0x339f03){const _0x5e9adf=_0x3a5dfd[_0x40a6('0x2c')][_0x40a6('0x26')](':')[0x2],_0x46ce76=_0x195325[_0x40a6('0x46')](_0x5e9adf);if(!_0x46ce76||_0x5e9adf===_0x195325[_0x40a6('0x54')])return;if(!_0x339f03[_0x40a6('0x4a')][_0x40a6('0xa')]['checkChild'](_0x3a5dfd[_0x40a6('0x47')][_0x40a6('0x42')],_0x40a6('0x2d')))return;const _0xd9f83f={'class':_0x40a6('0x50')+_0x46ce76[_0x40a6('0x6')][_0x40a6('0x4f')](),'data-name':_0x46ce76[_0x40a6('0x1b')],'data-session-id':_0x5e9adf},_0x4d3220=_0x339f03[_0x40a6('0x4a')][_0x40a6('0x24')][_0x40a6('0x19')](_0x3a5dfd['markerName']),_0x912083=_0x4d3220[_0x40a6('0x25')](),_0x253b38=_0x912083[_0x40a6('0x8')],_0x144a2f=_0x339f03[_0x40a6('0x4a')][_0x40a6('0xa')];if(_0x253b38&&_0x144a2f[_0x40a6('0x44')](_0x253b38)&&_0x144a2f['isInline'](_0x253b38)&&!_0x339f03[_0x40a6('0x4a')][_0x40a6('0x24')][_0x40a6('0x19')](_0x40a6('0x16')+_0x5e9adf)[_0x40a6('0x10')]()[_0x40a6('0x20')])return;const _0x40dcc1=_0x912083['parent'];return _0x339f03[_0x40a6('0x4a')][_0x40a6('0xa')][_0x40a6('0x36')](_0x40dcc1)&&!_0x339f03[_0x40a6('0x4a')][_0x40a6('0x3c')](_0x40dcc1)&&(_0xd9f83f[_0x40a6('0x55')]=!0x1),function(_0x563d6b,_0x41b414){const _0xe7b45b=_0x563d6b[_0x40a6('0x4')](_0x40a6('0x31'),_0x41b414);return _0x563d6b[_0x40a6('0x33')](_0x40a6('0x2b'),!0x0,_0xe7b45b),_0xe7b45b['render']=function(_0xb87bc){const _0x30ea8f=this[_0x40a6('0x21')](_0xb87bc);return _0x30ea8f[_0x40a6('0x0')]=_0x40a6('0x27'),_0x30ea8f;},_0xe7b45b[_0x40a6('0x30')]=function(_0x309910){return!(!this['getCustomProperty']('userPositionMarker')||!_0x309910[_0x40a6('0x3b')](_0x40a6('0x2b'))||this['getAttribute'](_0x40a6('0x3d'))!=_0x309910[_0x40a6('0x14')](_0x40a6('0x3d')));},_0xe7b45b;}(_0x53aecf,_0xd9f83f);}(_0x2ee70c,_0x4e9d43,_0x1e8c23,_0x167c7d)}),_0x167c7d[_0x40a6('0x5')]['for'](_0x40a6('0x18'))[_0x40a6('0x48')]({'model':_0x40a6('0x43'),'view':_0x5e0b1d=>function(_0x192ae4,_0x348436){const _0x387ce1=_0x192ae4[_0x40a6('0x2c')]['split'](':')[0x2];if(_0x387ce1===_0x348436[_0x40a6('0x54')])return null;const _0x42887d=_0x348436[_0x40a6('0x46')](_0x387ce1);if(!_0x42887d)return{'id':_0x387ce1,'classes':[]};return{'id':_0x387ce1,'classes':['ck-user__selection',_0x42887d[_0x40a6('0x6')][_0x40a6('0x29')]()],'attributes':{'data-session-id':_0x387ce1},'priority':0x7d0+_0x42887d[_0x40a6('0x3a')]};}(_0x5e0b1d,_0x1e8c23)}),function(_0x2eb614){const _0x2cd8bb=_0x2eb614['model'],_0xddf777=new Map(),_0x110074=_0x2eb614['plugins']['get'](_0x4a5d97);_0x2cd8bb[_0x40a6('0x24')]['on'](_0x40a6('0x1d'),(_0x2b7f6d,_0xb64dbf,_0x3ea980,_0x13bf9d)=>{if(!_0x13bf9d&&_0xddf777[_0x40a6('0x19')](_0xb64dbf[_0x40a6('0x1b')]))return _0xddf777[_0x40a6('0x19')](_0xb64dbf[_0x40a6('0x1b')])['detach'](),void _0xddf777[_0x40a6('0x40')](_0xb64dbf['name']);const _0x5b4257=_0xb64dbf[_0x40a6('0x1b')]['split'](':')[0x2];if(_0x5b4257===_0x110074['mySessionId'])return;const _0x6da620=_0x40a6('0x37')+_0x5b4257;_0x2cd8bb['markers'][_0x40a6('0x1a')](_0x6da620)&&_0x2eb614['editing'][_0x40a6('0x41')](_0x6da620),_0xb64dbf['on']('change:range',(_0x11cab0,_0x430562,_0x237e51)=>{if(_0x40a6('0x3e')!=_0x430562['root'][_0x40a6('0x3')]&&_0x40a6('0x3e')==_0xb64dbf[_0x40a6('0x10')]()[_0x40a6('0xd')][_0x40a6('0x3')]&&!_0xddf777['has'](_0xb64dbf[_0x40a6('0x1b')])){const _0x47cfd5=_0x2cd8bb[_0x40a6('0xa')][_0x40a6('0x2a')](_0x237e51[_0x40a6('0x2f')]);if(_0x47cfd5){const _0x3835f1=_0x301032['fromRange'](_0x47cfd5);_0xddf777[_0x40a6('0x1')](_0xb64dbf['name'],_0x3835f1),_0x3835f1['on']('change:range',(_0x597aa5,_0x4ec8a5,_0x1fe7dc)=>{if(_0x40a6('0x3e')==_0x3835f1[_0x40a6('0xd')][_0x40a6('0x3')]){const _0x496874=_0x2cd8bb[_0x40a6('0xa')][_0x40a6('0x2a')](_0x1fe7dc[_0x40a6('0x2f')]);_0x496874?(_0x3835f1[_0x40a6('0x42')]=_0x496874['start'],_0x3835f1[_0x40a6('0x4d')]=_0x496874[_0x40a6('0x4d')]):(_0xddf777[_0x40a6('0x40')](_0xb64dbf[_0x40a6('0x1b')]),_0x3835f1[_0x40a6('0x51')]());}});}}});}),_0x2cd8bb[_0x40a6('0x45')]['on'](_0x40a6('0x23'),()=>{_0xddf777['size']>0x0&&_0x2cd8bb[_0x40a6('0x1c')]({'isUndoable':!0x1},_0x1a5866=>{for(const [_0x148553,_0x251cc8]of _0xddf777)_0x40a6('0x3e')==_0x2cd8bb[_0x40a6('0x24')][_0x40a6('0x19')](_0x148553)[_0x40a6('0x10')]()[_0x40a6('0xd')]['rootName']&&(Y(_0x148553[_0x40a6('0x26')](':')[0x2],_0x251cc8[_0x40a6('0x49')](),_0x2cd8bb,_0x1a5866),_0x251cc8['detach']());_0xddf777[_0x40a6('0xe')]();});});}(_0x167c7d);}['afterInit'](){const _0x477e5e=this[_0x40a6('0x35')],_0x61725=_0x477e5e['commands'][_0x40a6('0x19')](_0x40a6('0x39'));_0x61725&&_0x477e5e[_0x40a6('0x4a')]['on'](_0x40a6('0xf'),(_0x385216,_0x16ab34)=>{const _0x5eeaf5=_0x16ab34[0x0];if('marker'!=_0x5eeaf5[_0x40a6('0x1f')]||!_0x5eeaf5['name'][_0x40a6('0x32')](_0x40a6('0x38')))return;const _0x2254bd=_0x5eeaf5['batch'];_0x61725[_0x40a6('0x1e')][_0x40a6('0x1a')](_0x2254bd)&&(_0x5eeaf5['newRange']=_0x5eeaf5['oldRange']?_0x477e5e[_0x40a6('0x4a')][_0x40a6('0x28')](_0x5eeaf5[_0x40a6('0x12')][_0x40a6('0x42')],_0x5eeaf5['oldRange'][_0x40a6('0x4d')]):null);},{'priority':'highest'});}['createUserMarkerOperations'](){const _0xe9422d=this[_0x40a6('0x35')],_0x236a73=_0xe9422d[_0x40a6('0x4a')][_0x40a6('0x45')],_0xbeda07=_0xe9422d['plugins']['get'](_0x4a5d97);_0xe9422d[_0x40a6('0x4a')][_0x40a6('0x1c')]({'isUndoable':!0x1},_0x57673d=>{const _0x5a2e76='user:range:'+_0xbeda07[_0x40a6('0x54')],_0x5efac1=_0x40a6('0x37')+_0xbeda07['mySessionId'],_0x5d5424=_0xe9422d['model']['markers']['has'](_0x5a2e76);_0xe9422d[_0x40a6('0x52')][_0x40a6('0xc')][_0x40a6('0x2e')]?Y(_0xbeda07[_0x40a6('0x54')],_0x236a73[_0x40a6('0x7')]['getFirstRange'](),_0xe9422d[_0x40a6('0x4a')],_0x57673d):_0x5d5424&&(_0x57673d[_0x40a6('0x4e')](_0x5a2e76),_0x57673d['removeMarker'](_0x5efac1));});}}function Y(_0xa42932,_0x596f4e,_0x13621c,_0x4e0466){const _0x2598ac='user:range:'+_0xa42932,_0x292d91='user:position:'+_0xa42932,_0x12182f=_0x596f4e['getContainedElement']();let _0x172a96=_0x596f4e[_0x40a6('0x42')];_0x12182f&&_0x12182f['is']('element',_0x40a6('0xb'))&&(_0x172a96=function(_0x2d55c5,_0x7c8982){for(const _0x31b5cb of _0x2d55c5[_0x40a6('0x2')]())if(_0x7c8982[_0x40a6('0xa')][_0x40a6('0x11')](_0x31b5cb,_0x40a6('0x2d')))return _0x31b5cb;}(_0x596f4e,_0x13621c),_0x596f4e=_0x4e0466[_0x40a6('0x28')](_0x172a96));const _0xb9aa67=_0x4e0466[_0x40a6('0x28')](_0x172a96);_0x13621c[_0x40a6('0x24')][_0x40a6('0x1a')](_0x2598ac)?(_0x4e0466[_0x40a6('0x9')](_0x2598ac,{'range':_0x596f4e}),_0x4e0466[_0x40a6('0x9')](_0x292d91,{'range':_0xb9aa67})):(_0x4e0466[_0x40a6('0x34')](_0x2598ac,{'range':_0x596f4e,'usingOperation':!0x0}),_0x4e0466['addMarker'](_0x292d91,{'range':_0xb9aa67,'usingOperation':!0x0}));}
23
+ const _0x1d06=['render','document','getMarkerClass','ck-user__selection','user:','getUserBySessionId','tableCell','markers','rootName','color','span','highest','enqueueChange','schema','toDomElement','getCustomProperty','view','ck-user__marker\x20','hasDomSelection','orderNumber','markerName','applyOperation','$graveyard','for','hasContent','type','markerToHighlight','update:user:range','setCustomProperty','commands','getContainedElement','deletionPosition','userPositionMarker','isInline','editor','fromRange','has','element','parent','end','getRange','user:range:','createUIElement','batch','UserMarkers','user:position:','createRange','selection','checkChild','user:range','getAttribute','markerToElement','editingDowncast','start','split','pluginName','detach','newRange','contenteditable','oldRange','clear','editing','get','change:range','getNearestSelectionRange','name','delete','mySessionId','isObject','getFirstRange','data-session-id','set','⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>⁠','$text','nodeAfter','root','model','undo','createUserMarkerOperations','addMarker','updateMarker','getPositions','size','getSelectionClass','toRange'];(function(_0x221597,_0x1d06fc){const _0x3a41b6=function(_0x46bce0){while(--_0x46bce0){_0x221597['push'](_0x221597['shift']());}};_0x3a41b6(++_0x1d06fc);}(_0x1d06,0xf3));const _0x3a41=function(_0x221597,_0x1d06fc){_0x221597=_0x221597-0x0;let _0x3a41b6=_0x1d06[_0x221597];return _0x3a41b6;};import{Plugin as _0x57126c}from'ckeditor5/src/core';import _0x341d92 from'./sessions';import{LiveRange as _0x4b9d0f}from'ckeditor5/src/engine';import'../../theme/usermarkers.css';export default class j extends _0x57126c{static get['requires'](){return[_0x341d92];}static get[_0x3a41('0x43')](){return _0x3a41('0x38');}['init'](){const _0x2f4f6d=this[_0x3a41('0x2e')],_0x58b2d6=_0x2f4f6d['plugins'][_0x3a41('0x4a')](_0x341d92);_0x2f4f6d['conversion'][_0x3a41('0x23')](_0x3a41('0x40'))[_0x3a41('0x3f')]({'model':'user:position','view':(_0xe58dcf,{writer:_0x3fe5b3})=>function(_0x4cb008,_0x59a21f,_0x20ccfd,_0x1d70b4){const _0x4cf991=_0x4cb008['markerName'][_0x3a41('0x42')](':')[0x2],_0x1307f3=_0x20ccfd[_0x3a41('0x11')](_0x4cf991);if(!_0x1307f3||_0x4cf991===_0x20ccfd[_0x3a41('0x4f')])return;if(!_0x1d70b4['model'][_0x3a41('0x19')][_0x3a41('0x3c')](_0x4cb008['markerRange']['start'],_0x3a41('0x0')))return;const _0x2d5628={'class':_0x3a41('0x1d')+_0x1307f3['color'][_0x3a41('0xe')](),'data-name':_0x1307f3[_0x3a41('0x4d')],'data-session-id':_0x4cf991},_0x56a7cf=_0x1d70b4[_0x3a41('0x3')][_0x3a41('0x13')][_0x3a41('0x4a')](_0x4cb008[_0x3a41('0x20')]),_0x150e5d=_0x56a7cf['getStart'](),_0x1a72be=_0x150e5d[_0x3a41('0x1')],_0x2070dc=_0x1d70b4[_0x3a41('0x3')][_0x3a41('0x19')];if(_0x1a72be&&_0x2070dc[_0x3a41('0x50')](_0x1a72be)&&_0x2070dc[_0x3a41('0x2d')](_0x1a72be)&&!_0x1d70b4['model'][_0x3a41('0x13')][_0x3a41('0x4a')](_0x3a41('0x35')+_0x4cf991)['getRange']()['isCollapsed'])return;const _0x59b265=_0x150e5d[_0x3a41('0x32')];return _0x1d70b4[_0x3a41('0x3')][_0x3a41('0x19')]['isLimit'](_0x59b265)&&!_0x1d70b4[_0x3a41('0x3')][_0x3a41('0x24')](_0x59b265)&&(_0x2d5628[_0x3a41('0x46')]=!0x1),function(_0x4b2b40,_0x39283a){const _0x5504bf=_0x4b2b40[_0x3a41('0x36')](_0x3a41('0x16'),_0x39283a);return _0x4b2b40[_0x3a41('0x28')]('userPositionMarker',!0x0,_0x5504bf),_0x5504bf[_0x3a41('0xc')]=function(_0x555c1f){const _0x5bcef9=this[_0x3a41('0x1a')](_0x555c1f);return _0x5bcef9['innerHTML']=_0x3a41('0x54'),_0x5bcef9;},_0x5504bf['isSimilar']=function(_0x102690){return!(!this[_0x3a41('0x1b')](_0x3a41('0x2c'))||!_0x102690[_0x3a41('0x1b')](_0x3a41('0x2c'))||this[_0x3a41('0x3e')](_0x3a41('0x52'))!=_0x102690[_0x3a41('0x3e')]('data-session-id'));},_0x5504bf;}(_0x59a21f,_0x2d5628);}(_0xe58dcf,_0x3fe5b3,_0x58b2d6,_0x2f4f6d)}),_0x2f4f6d['conversion'][_0x3a41('0x23')](_0x3a41('0x40'))[_0x3a41('0x26')]({'model':_0x3a41('0x3d'),'view':_0x43f9d4=>function(_0x5f34ec,_0x39b1df){const _0x2cc44f=_0x5f34ec[_0x3a41('0x20')]['split'](':')[0x2];if(_0x2cc44f===_0x39b1df[_0x3a41('0x4f')])return null;const _0x2e08ca=_0x39b1df[_0x3a41('0x11')](_0x2cc44f);if(!_0x2e08ca)return{'id':_0x2cc44f,'classes':[]};return{'id':_0x2cc44f,'classes':[_0x3a41('0xf'),_0x2e08ca[_0x3a41('0x15')][_0x3a41('0xa')]()],'attributes':{'data-session-id':_0x2cc44f},'priority':0x7d0+_0x2e08ca[_0x3a41('0x1f')]};}(_0x43f9d4,_0x58b2d6)}),function(_0x407a6a){const _0x4bcb97=_0x407a6a['model'],_0x11d7ea=new Map(),_0x23f9c2=_0x407a6a['plugins']['get'](_0x341d92);_0x4bcb97['markers']['on'](_0x3a41('0x27'),(_0x39f719,_0x5a6151,_0x54c298,_0x1dfc66)=>{if(!_0x1dfc66&&_0x11d7ea[_0x3a41('0x4a')](_0x5a6151[_0x3a41('0x4d')]))return _0x11d7ea['get'](_0x5a6151[_0x3a41('0x4d')])[_0x3a41('0x44')](),void _0x11d7ea[_0x3a41('0x4e')](_0x5a6151[_0x3a41('0x4d')]);const _0x3d5932=_0x5a6151['name'][_0x3a41('0x42')](':')[0x2];if(_0x3d5932===_0x23f9c2[_0x3a41('0x4f')])return;const _0x217b8e=_0x3a41('0x39')+_0x3d5932;_0x4bcb97['markers'][_0x3a41('0x30')](_0x217b8e)&&_0x407a6a[_0x3a41('0x49')]['reconvertMarker'](_0x217b8e),_0x5a6151['on'](_0x3a41('0x4b'),(_0x5b4246,_0x44cd59,_0x2b4441)=>{if(_0x3a41('0x22')!=_0x44cd59['root'][_0x3a41('0x14')]&&_0x3a41('0x22')==_0x5a6151[_0x3a41('0x34')]()['root']['rootName']&&!_0x11d7ea['has'](_0x5a6151['name'])){const _0x4e1c85=_0x4bcb97[_0x3a41('0x19')][_0x3a41('0x4c')](_0x2b4441[_0x3a41('0x2b')]);if(_0x4e1c85){const _0x2813f4=_0x4b9d0f[_0x3a41('0x2f')](_0x4e1c85);_0x11d7ea[_0x3a41('0x53')](_0x5a6151[_0x3a41('0x4d')],_0x2813f4),_0x2813f4['on']('change:range',(_0x1b8f55,_0x56ea57,_0x43ea75)=>{if(_0x3a41('0x22')==_0x2813f4[_0x3a41('0x2')][_0x3a41('0x14')]){const _0x41f55a=_0x4bcb97['schema'][_0x3a41('0x4c')](_0x43ea75[_0x3a41('0x2b')]);_0x41f55a?(_0x2813f4[_0x3a41('0x41')]=_0x41f55a[_0x3a41('0x41')],_0x2813f4['end']=_0x41f55a['end']):(_0x11d7ea[_0x3a41('0x4e')](_0x5a6151['name']),_0x2813f4['detach']());}});}}});}),_0x4bcb97[_0x3a41('0xd')]['on']('change',()=>{_0x11d7ea[_0x3a41('0x9')]>0x0&&_0x4bcb97[_0x3a41('0x18')]({'isUndoable':!0x1},_0x493bf9=>{for(const [_0x31eda2,_0xf9d0a6]of _0x11d7ea)_0x3a41('0x22')==_0x4bcb97[_0x3a41('0x13')]['get'](_0x31eda2)['getRange']()['root'][_0x3a41('0x14')]&&(Y(_0x31eda2['split'](':')[0x2],_0xf9d0a6[_0x3a41('0xb')](),_0x4bcb97,_0x493bf9),_0xf9d0a6[_0x3a41('0x44')]());_0x11d7ea[_0x3a41('0x48')]();});});}(_0x2f4f6d);}['afterInit'](){const _0x3c2909=this['editor'],_0x5d7715=_0x3c2909[_0x3a41('0x29')][_0x3a41('0x4a')](_0x3a41('0x4'));_0x5d7715&&_0x3c2909['model']['on'](_0x3a41('0x21'),(_0x207097,_0x4d0ce7)=>{const _0x5e45fc=_0x4d0ce7[0x0];if('marker'!=_0x5e45fc[_0x3a41('0x25')]||!_0x5e45fc['name']['startsWith'](_0x3a41('0x10')))return;const _0x512252=_0x5e45fc[_0x3a41('0x37')];_0x5d7715['_createdBatches'][_0x3a41('0x30')](_0x512252)&&(_0x5e45fc[_0x3a41('0x45')]=_0x5e45fc[_0x3a41('0x47')]?_0x3c2909[_0x3a41('0x3')][_0x3a41('0x3a')](_0x5e45fc[_0x3a41('0x47')]['start'],_0x5e45fc[_0x3a41('0x47')][_0x3a41('0x33')]):null);},{'priority':_0x3a41('0x17')});}[_0x3a41('0x5')](){const _0x10842e=this['editor'],_0xcdbe77=_0x10842e[_0x3a41('0x3')][_0x3a41('0xd')],_0x126ba4=_0x10842e['plugins']['get'](_0x341d92);_0x10842e['model'][_0x3a41('0x18')]({'isUndoable':!0x1},_0x50a3d0=>{const _0x4aa768='user:range:'+_0x126ba4[_0x3a41('0x4f')],_0x3839b5='user:position:'+_0x126ba4['mySessionId'],_0x1a4874=_0x10842e[_0x3a41('0x3')][_0x3a41('0x13')][_0x3a41('0x30')](_0x4aa768);_0x10842e[_0x3a41('0x49')][_0x3a41('0x1c')][_0x3a41('0x1e')]?Y(_0x126ba4[_0x3a41('0x4f')],_0xcdbe77[_0x3a41('0x3b')][_0x3a41('0x51')](),_0x10842e[_0x3a41('0x3')],_0x50a3d0):_0x1a4874&&(_0x50a3d0['removeMarker'](_0x4aa768),_0x50a3d0['removeMarker'](_0x3839b5));});}}function Y(_0x40abad,_0x52e125,_0x1277c2,_0x5df849){const _0x2e186d='user:range:'+_0x40abad,_0x11e475=_0x3a41('0x39')+_0x40abad,_0x994705=_0x52e125[_0x3a41('0x2a')]();let _0x5164e1=_0x52e125[_0x3a41('0x41')];_0x994705&&_0x994705['is'](_0x3a41('0x31'),_0x3a41('0x12'))&&(_0x5164e1=function(_0x3652fe,_0x5db5eb){for(const _0x8ae56b of _0x3652fe[_0x3a41('0x8')]())if(_0x5db5eb[_0x3a41('0x19')][_0x3a41('0x3c')](_0x8ae56b,_0x3a41('0x0')))return _0x8ae56b;}(_0x52e125,_0x1277c2),_0x52e125=_0x5df849[_0x3a41('0x3a')](_0x5164e1));const _0x4762d5=_0x5df849[_0x3a41('0x3a')](_0x5164e1);_0x1277c2[_0x3a41('0x13')][_0x3a41('0x30')](_0x2e186d)?(_0x5df849['updateMarker'](_0x2e186d,{'range':_0x52e125}),_0x5df849[_0x3a41('0x7')](_0x11e475,{'range':_0x4762d5})):(_0x5df849['addMarker'](_0x2e186d,{'range':_0x52e125,'usingOperation':!0x0}),_0x5df849[_0x3a41('0x6')](_0x11e475,{'range':_0x4762d5,'usingOperation':!0x0}));}