@ckeditor/ckeditor5-real-time-collaboration 44.0.0-alpha.11 → 44.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +1 -1
- package/dist/index.js +6 -6
- package/package.json +9 -9
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0xc3140];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5e3804){super(_0x5e3804),this['set']('state',_0x10fa10['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x392eb0);}['init'](){const _0x2e3391=this['context'],_0x282cc2=_0x2e3391['plugins']['get']('CloudServices'),_0x54f525=_0x2e3391['plugins']['get'](_0xc3140);if(!_0x282cc2['token'])throw new _0x21f60b('websocketgateway-missing-token',this);if(!_0x282cc2['webSocketUrl'])throw new _0x21f60b('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x282cc2['token'],_0x282cc2['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4c4f29=>{if(this['connection']=_0x4c4f29,this['bind']('state')['to'](_0x4c4f29,'state',this,'_isBrowserOffline',(_0x4e2158,_0xdda007)=>('connected'!==_0x4e2158&&(this['_shouldPluginsReconnect']=!0x0),_0xdda007||_0x4e2158!==_0x10fa10['CONNECTED']?_0x10fa10['DISCONNECTED']:this['state']==_0x10fa10['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x10fa10['CONNECTING']):_0x10fa10['CONNECTED'])),this['connection']['on']('error',(_0x3ac2c6,_0x483ec5)=>{if('limitExceeded'!==_0x483ec5['code'])throw console['error'](_0x483ec5),new _0x21f60b('cloudservices-init',null,{'originalError':_0x483ec5});_0x54f525['showWarning']('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':'real-time-collaboration'});}),!_0x4c4f29['me'])return new Promise(_0x2dfc19=>_0x4c4f29['on']('change:me',_0x2dfc19));})['catch'](_0xf13f22=>{throw console['error'](_0xf13f22),new _0x21f60b('cloudservices-init',null,{'originalError':_0xf13f22});});}['addToReconnectionStack'](_0x3c8418){if('function'!=typeof _0x3c8418['reconnect'])throw new _0x21f60b('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3c8418))throw new _0x21f60b('websocketgateway-plugin-already-registered',this,{'name':_0x3c8418['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3c8418);}['removeFromReconnectionStack'](_0x282a32){this['_reconnectionStack']['delete'](_0x282a32);}['isInReconnectionStack'](_0x2b5282){return this['_reconnectionStack']['has'](_0x2b5282);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x21bc00=>_0x21bc00['reconnect']())))['then'](()=>this['state']=_0x10fa10['CONNECTED'])['catch'](_0x2d95c0=>{throw console['error'](_0x2d95c0),new _0x21f60b('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x10fa10['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x498445{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x5bb3d9];}constructor(_0x2de938){super(_0x2de938),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x14b0f5(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5bb3d9);}['init'](){const _0x5e28ac=this['context']['plugins']['get'](c);this['listenTo'](_0x5e28ac,'change:state',(_0x449e93,_0x1046a0,_0x49bf61)=>{if('connected'!==_0x49bf61)this['channelSessions']['forEach'](_0x4d7129=>_0x4d7129['clear']()),this['channelConnectedUsers']['forEach'](_0x4a809e=>_0x4a809e['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x17a123,_0x1af7e3]of this['_registeredSessions'])for(const _0x167a61 of _0x1af7e3)this['_handleSessionAdd'](_0x17a123,_0x167a61);}}),this['_createUser'](_0x5e28ac['connection']['me'],!0x0);}['register'](_0x5c4c28,_0x20b3fb){if(this['_registeredSessions']['has'](_0x5c4c28))throw new _0x21f60b('sessions-register-already-registered',null,{'channelId':_0x5c4c28});this['_registeredSessions']['set'](_0x5c4c28,_0x20b3fb),this['channelSessions']['set'](_0x5c4c28,new _0x14b0f5()),this['channelConnectedUsers']['set'](_0x5c4c28,new _0x14b0f5()),this['listenTo'](_0x20b3fb,'add',(_0x2af32c,_0x587a2d)=>this['_handleSessionAdd'](_0x5c4c28,_0x587a2d)),this['listenTo'](_0x20b3fb,'remove',(_0x37a043,_0x289970)=>this['_handleSessionRemove'](_0x5c4c28,_0x289970));for(const _0x14ab5f of _0x20b3fb)this['_handleSessionAdd'](_0x5c4c28,_0x14ab5f);}['unregister'](_0x47abb9){if(!this['_registeredSessions']['has'](_0x47abb9))throw new _0x21f60b('sessions-unregister-not-exist',null,{'channelId':_0x47abb9});const _0x2722cf=this['_registeredSessions']['get'](_0x47abb9);this['stopListening'](_0x2722cf);for(const _0x205d79 of _0x2722cf)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x47abb9,_0x205d79);this['_registeredSessions']['delete'](_0x47abb9),this['channelSessions']['delete'](_0x47abb9),this['channelConnectedUsers']['delete'](_0x47abb9);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x4b9a08){for(const _0x3bda7d of this['channelSessions']['values']())for(const _0x558e69 of _0x3bda7d)if(_0x558e69['id']===_0x4b9a08)return _0x558e69['user'];}['getUserSessions'](_0x5a625b,_0x3c227e){const _0x44c5a0=_0x3c227e?[this['channelSessions']['get'](_0x3c227e)]:this['channelSessions']['values'](),_0x30075a=new Set();for(const _0x4d435f of _0x44c5a0)for(const _0x21e159 of _0x4d435f)_0x21e159['user']['id']===_0x5a625b['id']&&_0x30075a['add'](_0x21e159['id']);return _0x30075a;}['getUserRole'](_0xe022b5){for(const _0x1cd068 of this['channelSessions']['values']())for(const _0x1095b8 of _0x1cd068)if(_0x1095b8['user']===_0xe022b5)return _0x1095b8['role'];}['_handleSessionAdd'](_0x2b0686,_0x39024e){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0xb6a776=_0x39024e['user'],_0x27c26e=this['_users']['getUser'](_0xb6a776['id'])||this['_createUser'](_0xb6a776),_0xb0ca59=Object['assign']({},_0x39024e,{'user':_0x27c26e});this['channelSessions']['get'](_0x2b0686)['add'](_0xb0ca59);const _0x396194=this['channelConnectedUsers']['get'](_0x2b0686);_0x396194['has'](_0x27c26e['id'])||_0x396194['add'](_0x27c26e),this['allConnectedUsers']['has'](_0x27c26e['id'])||this['allConnectedUsers']['add'](_0x27c26e,_0x27c26e['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x2b0686,{'channelId':_0x2b0686,'session':_0xb0ca59});}['_handleSessionRemove'](_0x4d4bfd,_0x338adf){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x413003=this['channelConnectedUsers']['get'](_0x4d4bfd),_0x726b47=_0x338adf['user'];_0x726b47['id']&&(this['channelSessions']['get'](_0x4d4bfd)['remove'](_0x338adf['id']),_0x413003['has'](_0x726b47['id'])&&!this['getUserSessions'](_0x726b47,_0x4d4bfd)['size']&&_0x413003['remove'](_0x726b47['id']),this['allConnectedUsers']['get'](_0x726b47['id'])&&!this['getUserSessions'](_0x726b47)['size']&&this['allConnectedUsers']['remove'](_0x726b47['id']));}['_createUser'](_0x1fb050,_0x3826e1){const _0x139c56=this['_users']['addUser'](_0x1fb050);return _0x3826e1&&this['_users']['defineMe'](_0x1fb050['id']),_0x139c56['orderNumber']=this['_uniqueUsersCount']++,_0x139c56;}}class E extends _0x293c5a{['_domEmitter']=new(_0x392eb0())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1d8de7=this['editor'],_0x403e3a=_0x1d8de7['plugins']['get'](i);_0x1d8de7['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3db9d8,{writer:_0x34e73c})=>function(_0x56f0ee,_0x3ed3b6,_0x4c83c1,_0xf42218){const _0x2c4633=_0x56f0ee['markerName']['split'](':')[0x2],_0x216054=_0x4c83c1['getUserBySessionId'](_0x2c4633);if(!_0x216054||_0x2c4633===_0x4c83c1['mySessionId'])return;if(!_0xf42218['model']['schema']['checkChild'](_0x56f0ee['markerRange']['start'],'$text'))return;const _0x23fc64={'class':'ck-user__marker\x20'+_0x216054['color']['getMarkerClass'](),'data-name':_0x216054['name'],'data-session-id':_0x2c4633},_0x3cfec8=_0xf42218['model']['markers']['get'](_0x56f0ee['markerName']),_0x233525=_0x3cfec8['getStart'](),_0x58e358=_0x233525['nodeAfter'],_0x372862=_0xf42218['model']['schema'];if(_0x58e358&&_0x372862['isObject'](_0x58e358)&&_0x372862['isInline'](_0x58e358)&&!_0xf42218['model']['markers']['get']('user:range:'+_0x2c4633)['getRange']()['isCollapsed'])return;const _0x4c5780=_0x233525['parent'];return _0xf42218['model']['schema']['isLimit'](_0x4c5780)&&!_0xf42218['model']['hasContent'](_0x4c5780)&&(_0x23fc64['contenteditable']=!0x1),function(_0x4c071f,_0x54f712,_0x1fcedd){const _0x5b2ed2=_0x4c071f['createUIElement']('span',_0x54f712);return _0x4c071f['setCustomProperty']('userPositionMarker',!0x0,_0x5b2ed2),_0x5b2ed2['render']=function(_0x3e4109){const _0x53bc70=this['toDomElement'](_0x3e4109);return _0x53bc70['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x1fcedd['name']+'</span>',_0x53bc70['addEventListener']('mouseenter',()=>{_0x53bc70['classList']['add']('ck-user__marker_hovered');}),_0x53bc70['addEventListener']('mouseleave',()=>{_0x53bc70['classList']['remove']('ck-user__marker_hovered');}),_0x53bc70;},_0x5b2ed2['isSimilar']=function(_0x25a41a){return!(!this['getCustomProperty']('userPositionMarker')||!_0x25a41a['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x25a41a['getAttribute']('data-session-id'));},_0x5b2ed2;}(_0x3ed3b6,_0x23fc64,_0x216054);}(_0x3db9d8,_0x34e73c,_0x403e3a,_0x1d8de7)}),_0x1d8de7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1752b3=>function(_0x16a8b6,_0x53727c){const _0xa7a749=_0x16a8b6['markerName']['split'](':')[0x2];if(_0xa7a749===_0x53727c['mySessionId'])return null;const _0x6aa159=_0x53727c['getUserBySessionId'](_0xa7a749);if(!_0x6aa159)return{'id':_0xa7a749,'classes':[]};return{'id':_0xa7a749,'classes':['ck-user__selection',_0x6aa159['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xa7a749},'priority':0x7d0+_0x6aa159['orderNumber']};}(_0x1752b3,_0x403e3a)}),function(_0x2512ed){const _0x14e2a0=_0x2512ed['model'],_0x2861c4=new Map(),_0x5b2edf=_0x2512ed['plugins']['get'](i);_0x14e2a0['markers']['on']('update:user:range',(_0x343d0a,_0x4efef6,_0x2c0085,_0x3c4667)=>{if(!_0x3c4667&&_0x2861c4['get'](_0x4efef6['name']))return _0x2861c4['get'](_0x4efef6['name'])['detach'](),void _0x2861c4['delete'](_0x4efef6['name']);const _0x2c5e60=_0x4efef6['name']['split'](':')[0x2];if(_0x2c5e60===_0x5b2edf['mySessionId'])return;const _0x5e49d8='user:position:'+_0x2c5e60;_0x14e2a0['markers']['has'](_0x5e49d8)&&_0x2512ed['editing']['reconvertMarker'](_0x5e49d8),_0x4efef6['on']('change:range',(_0x4775bc,_0x3b6172,_0x4e98a1)=>{if('$graveyard'!=_0x3b6172['root']['rootName']&&'$graveyard'==_0x4efef6['getRange']()['root']['rootName']&&!_0x2861c4['has'](_0x4efef6['name'])){const _0x3c8c1f=_0x14e2a0['schema']['getNearestSelectionRange'](_0x4e98a1['deletionPosition']);if(_0x3c8c1f){const _0x136a4b=ut['fromRange'](_0x3c8c1f);_0x2861c4['set'](_0x4efef6['name'],_0x136a4b),_0x136a4b['on']('change:range',(_0x9c8611,_0x4d2944,_0x42ca8e)=>{if('$graveyard'==_0x136a4b['root']['rootName']){const _0xe7958c=_0x14e2a0['schema']['getNearestSelectionRange'](_0x42ca8e['deletionPosition']);_0xe7958c?(_0x136a4b['start']=_0xe7958c['start'],_0x136a4b['end']=_0xe7958c['end']):(_0x2861c4['delete'](_0x4efef6['name']),_0x136a4b['detach']());}});}}});}),_0x14e2a0['document']['on']('change',()=>{_0x2861c4['size']>0x0&&_0x14e2a0['enqueueChange']({'isUndoable':!0x1},_0x19f021=>{for(const [_0x252f86,_0x248ddb]of _0x2861c4)'$graveyard'==_0x14e2a0['markers']['get'](_0x252f86)['getRange']()['root']['rootName']&&(Q(_0x252f86['split'](':')[0x2],_0x248ddb['toRange'](),_0x14e2a0,_0x19f021),_0x248ddb['detach']());_0x2861c4['clear']();});});}(_0x1d8de7),this['_domEmitter']['listenTo'](_0xd7a97b['document'],'keydown',(_0x175a04,{key:_0x67a474})=>{'Escape'===_0x67a474&&function(_0x4497f0){_0x4497f0['editing']['view']['change'](_0x33d27b=>{for(const _0x469bde of _0x4497f0['model']['markers']){if(!_0x469bde['name']['startsWith']('user:position'))continue;const _0x288e90=_0x4497f0['editing']['mapper']['markerNameToElements'](_0x469bde['name']);if(_0x288e90){for(const _0xcac5c8 of _0x288e90)_0x33d27b['removeClass']('ck-user__marker_hovered',_0xcac5c8);}}});}(_0x1d8de7);},{'useCapture':!0x0});}['afterInit'](){const _0x3b56ef=this['editor'],_0x511b8c=_0x3b56ef['commands']['get']('undo');_0x511b8c&&_0x3b56ef['model']['on']('applyOperation',(_0x40fa28,_0x4ceb3b)=>{const _0x19d713=_0x4ceb3b[0x0];if('marker'!=_0x19d713['type']||!_0x19d713['name']['startsWith']('user:'))return;const _0x370c7e=_0x19d713['batch'];_0x511b8c['_createdBatches']['has'](_0x370c7e)&&(_0x19d713['newRange']=_0x19d713['oldRange']?_0x3b56ef['model']['createRange'](_0x19d713['oldRange']['start'],_0x19d713['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x1debb4=this['editor'],_0x17c935=_0x1debb4['model']['document'],_0x5d4197=_0x1debb4['plugins']['get'](i);_0x1debb4['model']['enqueueChange']({'isUndoable':!0x1},_0x496491=>{const _0xc0d773='user:range:'+_0x5d4197['mySessionId'],_0x56ae8e='user:position:'+_0x5d4197['mySessionId'],_0x3b3d7a=_0x1debb4['model']['markers']['has'](_0xc0d773);_0x1debb4['editing']['view']['hasDomSelection']?Q(_0x5d4197['mySessionId'],_0x17c935['selection']['getFirstRange'](),_0x1debb4['model'],_0x496491):_0x3b3d7a&&(_0x496491['removeMarker'](_0xc0d773),_0x496491['removeMarker'](_0x56ae8e));});}}function Q(_0x5a96f1,_0x4b909a,_0x568201,_0x1efc79){const _0x4b14cf='user:range:'+_0x5a96f1,_0x59a2ac='user:position:'+_0x5a96f1,_0x221572=_0x4b909a['getContainedElement']();let _0xebcc13=_0x4b909a['start'];_0x221572&&_0x221572['is']('element','tableCell')&&(_0xebcc13=function(_0x1a815a,_0x5c4ea6){for(const _0x4afdb2 of _0x1a815a['getPositions']())if(_0x5c4ea6['schema']['checkChild'](_0x4afdb2,'$text'))return _0x4afdb2;}(_0x4b909a,_0x568201),_0x4b909a=_0x1efc79['createRange'](_0xebcc13));const _0x5607bf=_0x1efc79['createRange'](_0xebcc13);_0x568201['markers']['has'](_0x4b14cf)?(_0x1efc79['updateMarker'](_0x4b14cf,{'range':_0x4b909a}),_0x1efc79['updateMarker'](_0x59a2ac,{'range':_0x5607bf})):(_0x1efc79['addMarker'](_0x4b14cf,{'range':_0x4b909a,'usingOperation':!0x0}),_0x1efc79['addMarker'](_0x59a2ac,{'range':_0x5607bf,'usingOperation':!0x0}));}function B(_0x248d0c,_0x148e48,_0x302027){const _0x4c03fe=_0x248d0c['t'],t=_0x248d0c['t'];switch(_0x148e48){case'PENDING_ACTION_SENDING_DATA':return t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'});case'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.':return t('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.');case'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'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.':return t('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.');case'Synchronization\x20issue':return t('Synchronization\x20issue');case'Connected\x20users\x20list\x20dropdown\x20menu':return t('Connected\x20users\x20list\x20dropdown\x20menu');case'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':return t('Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)');case'Connected\x20users\x20list':return t('Connected\x20users\x20list');case'PENDING_ACTION_REVISION_HISTORY':return _0x4c03fe({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'CONNECTED_USERS':return t({'string':'1\x20connected\x20user\x20(me)','plural':'%0\x20connected\x20users','id':'CONNECTED_USERS'},_0x302027);default:return'';}}let F=0x1;class l extends _0x293c5a{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x33852f)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,E,_0x3e80ae,_0x5bb3d9,_0xc3140];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x248355=this['serverHistory']['getOperations']();for(let _0x189501=_0x248355['length']-0x1;_0x189501>=0x0;_0x189501--){const _0x443b9a=_0x248355[_0x189501];if(!this['_disconnectionOperations']['has'](_0x443b9a))return _0x443b9a['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3de8f7){if(super(_0x3de8f7),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x1c51e7(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x21f60b('collaboration-missing-channelid',this);const _0x26f5d5=_0x3de8f7['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x26f5d5,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2e47fa(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new G(this['_disconnectionOperations']);}['init'](){const _0x4be335=this['editor'],_0x3becb9=_0x4be335['plugins']['get'](_0x5bb3d9),_0x28620a=_0x4be335['plugins']['get'](c);this['listenTo'](_0x3becb9,'getOperationAuthor',(_0x45f7f7,_0x10a872)=>{const _0x54cef5=_0x10a872[0x0];_0x54cef5['_authorId']&&(_0x45f7f7['return']=_0x3becb9['getUser'](_0x54cef5['_authorId']),_0x45f7f7['stop']()),null===_0x54cef5['_authorId']&&(_0x45f7f7['return']=null,_0x45f7f7['stop']());},{'priority':'high'}),this['listenTo'](_0x4be335['model']['document']['selection'],'change:range',(_0x232589,_0x4c471d)=>{_0x4c471d['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4be335['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4be335['model']['on']('applyOperation',(_0x25ef98,_0x4fa056)=>{const _0x47c1b0=_0x4fa056[0x0];_0x47c1b0['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x47c1b0),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x28620a,'state',this,'_hasSynchronizationProblem',(_0x3ecc44,_0x505f35)=>'connected'===_0x3ecc44&&!_0x505f35),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4be335['disableReadOnlyMode']('rtc-offline'):_0x4be335['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4be335['disableReadOnlyMode']('rtc-offline'):_0x4be335['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x11c6d1=this['editor']['plugins']['get'](i),_0x48da7c=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x11c6d1['unregister'](this['_channelId']);const _0x4347fc=await this['_service']['reconnect'](_0x48da7c['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4347fc)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1f5a07=await this['_service']['getConnectedSessions']();_0x11c6d1['register'](this['_channelId'],_0x1f5a07),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xf5af78){if(function(_0x2a3da4){return'404'===_0x2a3da4['code'];}(_0xf5af78)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x163fac){return'409'===_0x163fac['code'];}(_0xf5af78)){const _0xf382b7=B(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0xf382b7);}else{if(!(_0xf5af78 instanceof H))throw _0xf5af78;this['_handleReconnectionError']();}}}}['destroy'](){const _0x3badf0=this['editor']['plugins']['get'](c),_0x5d6592=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x5d6592['channelSessions']['has'](this['_channelId'])&&_0x5d6592['unregister'](this['_channelId']),_0x3badf0['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x31ed0e){if(this['sessionId']!==_0x31ed0e['sessionId']&&this['_lastSyncedOperationId']!==_0x31ed0e['lastOperationId'])throw new H();return this['sessionId']=_0x31ed0e['sessionId'],this['_handleServerResponse']([],{..._0x31ed0e,'wereChangesApplied':!0x1,'data':_0x31ed0e['data']},'reconnect');}async['_connectService'](_0x3c0d32,_0x264e08=!0x1){const {connection:_0x3cac8a}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x3cac8a,this['_channelId'])['then'](_0x590d27=>this['_initSessionsHandling'](_0x590d27))['catch'](_0x439c5c=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x439c5c);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x21f834,_0x3bcbe5)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x3bcbe5);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3fab32=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3c0d32);this['_isPendingUpdate']=!0x0;const _0x287be5=await this['_service']['connect'](_0x3cac8a,this['_compressOperations'](_0x3c0d32),_0x3fab32);if(this['sessionId']=_0x287be5['sessionId'],_0x264e08){if(!_0x287be5['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x287be5['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3c0d32,_0x287be5,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x287be5,_0x3c0d32);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x481c56=this['editor']['plugins']['get'](i),_0x4aa256=this['editor']['plugins']['get'](E),_0x3ee5c3=_0x481c56['channelSessions']['get'](this['_channelId']);_0x3ee5c3&&_0x3ee5c3['length']>0x1?_0x4aa256['createUserMarkerOperations']():this['listenTo'](_0x481c56,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x481c56['channelSessions']['get'](this['_channelId'])['length']&&_0x4aa256['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x14b13f,_0x1b6984,_0x48a212,_0x4c8618){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1b6984){const _0x20289e=this['_decompressOperations'](_0x48a212,_0x4c8618);await this['_fetchMissingUsers'](_0x20289e),this['_handleExternalOperations'](_0x20289e,_0x1b6984,_0x48a212['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3ed86e}=this['editor'];let _0x321c21;try{_0x321c21=await this['_service']['getDocumentDetails']();}catch(_0xd4be33){const _0x24b3c0=B(_0x3ed86e,'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x24b3c0);}const _0x235a50=_0x321c21['currentDocumentSession']||_0x321c21['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x235a50['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x5abbcb=B(_0x3ed86e,'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.');this['_handleReconnectionError'](_0x5abbcb);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x116764){const _0x316652=this['editor']['plugins']['get'](i);this['listenTo'](_0x316652,'sessionAdd:'+this['_channelId'],(_0x1e8c63,{session:_0x251302})=>{if(_0x251302['id']===_0x316652['mySessionId']){_0x1e8c63['off']();const _0x1e3045=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x691676=_0x251302['permissions'];_0x1e3045&&_0x1e3045['isEnabled']&&(_0x691676=_0x691676['filter'](_0x59f6f6=>'document:write'!==_0x59f6f6)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x691676,this['_channelId']);}}),_0x316652['register'](this['_channelId'],_0x116764);}['_initThrowingOnDataSet'](){const _0x185fa9=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1a3378)=>{if(!_0x1a3378[_0x1a3378['length']-0x1]['suppressErrorInCollaboration'])throw new _0x21f60b('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x185fa9['apply'](this['editor']['data'],_0x1a3378);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2aad45,[_0x1a13e0])=>{if(this['_document']['version'])throw new _0x21f60b('realtimecollaborationclient-init-document-already-initialized',this);_0x2aad45['stop'](),this['_setPendingAction']();const _0x6777bc=this['editor']['config']['get']('rootsAttributes'),_0x2aa075=this['_getOperationsFromInitData'](_0x1a13e0,_0x6777bc);0x0==_0x2aa075['length']&&_0x2aa075['push'](new _0x44dfc9(0x0)),_0x2aad45['return']=this['_connectService'](_0x2aa075)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x55f51c=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x55f51c))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x48f731,[_0x4905a5,_0x219b22])=>{_0x48f731['stop']();const _0x643846=this['editor']['model']['document']['getRoot'](_0x4905a5);if(!this['_knownRootNames']['has'](_0x4905a5)){const _0x2aa3a3=_0x219b22&&_0x219b22['data']?_0x219b22['data']:'',_0x5f1a91=_0x219b22&&_0x219b22['attributes']?_0x219b22['attributes']:{};await this['_loadRoot'](_0x4905a5,_0x2aa3a3,_0x5f1a91);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x643846['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x643846);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x55a609){const _0x7897a1=this['editor']['plugins']['get'](_0x5bb3d9),{connection:_0x1c940b}=this['editor']['plugins']['get'](c),_0x4d1db1=new Set();for(const _0xcce476 of _0x55a609){const _0x2e87f3=_0xcce476['_authorId'];_0x2e87f3&&!_0x7897a1['getUser'](_0x2e87f3)&&_0x4d1db1['add'](_0x2e87f3);}if(0x0===_0x4d1db1['size'])return;const _0x171231=await mt['getMany'](_0x1c940b,Array['from'](_0x4d1db1));for(const _0xa8835c of _0x171231)_0x7897a1['getUser'](_0xa8835c['id'])||_0x7897a1['addUser'](_0xa8835c);}['_getOperationsFromInitData'](_0x1b624c,_0xd642b4={}){const _0x117cb7=this['editor']['model'],_0x5b6428=[];let _0x1900d1=0x0;const _0x1f3302='string'==typeof _0x1b624c?{'main':_0x1b624c}:_0x1b624c;for(const _0x1187f5 of Object['keys'](_0x1f3302)){if(!this['_document']['roots']['has'](_0x1187f5))throw new _0x21f60b('realtimecollaborationclient-init-non-existent-root',this);const _0x326d9d=this['editor']['data']['parse'](_0x1f3302[_0x1187f5]),_0x5c187b=this['_document']['getRoot'](_0x1187f5),_0x5c970f=new _0x49f73c(_0x117cb7['createPositionAt'](_0x5c187b,0x0),_0x326d9d,_0x1900d1++);_0x5b6428['push'](_0x5c970f);for(const [_0x391b9e,_0x8727fe]of _0x326d9d['markers']){const _0x5a3652=_0x117cb7['createRange'](_0x117cb7['createPositionFromPath'](_0x5c187b,_0x8727fe['start']['path']['slice']()),_0x117cb7['createPositionFromPath'](_0x5c187b,_0x8727fe['end']['path']['slice']())),_0x381d69=new _0x547001(_0x391b9e,null,_0x5a3652,_0x117cb7['markers'],!0x0,_0x1900d1++);_0x5b6428['push'](_0x381d69);}}if(_0xd642b4)for(const [_0x49797a,_0xd58822]of Object['entries'](_0xd642b4)){const _0x771b1c=_0x117cb7['document']['getRoot'](_0x49797a);if(!_0x771b1c)throw new _0x21f60b('multi-root-editor-root-attributes-no-root',null);for(const [_0x4902ac,_0x567ccb]of Object['entries'](_0xd58822))if(null!==_0x567ccb){const _0x25d276=new _0x5af919(_0x771b1c,_0x4902ac,null,_0x567ccb,_0x1900d1++);_0x5b6428['push'](_0x25d276);}}return _0x5b6428;}async['_loadRoot'](_0x27935a,_0x3f46fb,_0x1029b7){this['_getOperationsFromInitData']({[_0x27935a]:_0x3f46fb},{[_0x27935a]:_0x1029b7})['forEach']((_0x25b23d,_0x5e93d3)=>{_0x25b23d['baseVersion']=this['_document']['version']+_0x5e93d3,_0x25b23d['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x25b23d);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x71472d,_0x4aa134){let _0x5aeb8d;this['_offset']=_0x71472d['offset'];const _0x46e1c8=_0x71472d['wereChangesApplied']&&!_0x71472d['initData'],_0x4ae3e7=_0x46e1c8?0x0:_0x71472d['data']['baseVersion'];if(_0x4aa134['forEach'](_0xf4db7c=>{_0xf4db7c['_isInit']=!0x0,_0xf4db7c['createdAt']=_0x71472d['sessionCreatedAt'],_0xf4db7c['_authorId']=null;}),_0x46e1c8)_0x5aeb8d=_0x4aa134,this['_applyOperationsSet'](_0x5aeb8d,_0x46e1c8);else{if(_0x71472d['initData']){const _0x56b9b9=this['_getOperationsFromInitData'](_0x71472d['initData']);this['_document']['history']['version']=-_0x56b9b9['length'],_0x56b9b9['forEach'](_0xd8cdf5=>{_0xd8cdf5['baseVersion']-=_0x56b9b9['length'],_0xd8cdf5['createdAt']=_0x71472d['sessionCreatedAt'],_0xd8cdf5['_isInit']=!0x0,_0xd8cdf5['_authorId']=null;}),this['_applyOperationsSet'](_0x56b9b9,!0x0),this['serverHistory']['version']=-_0x56b9b9['length']+this['_offset'],this['_updateServerHistory'](_0x56b9b9);}this['_document']['history']['version']=_0x4ae3e7,_0x5aeb8d=this['_decompressOperations'](_0x71472d['data'],_0x71472d['metadata']),await this['_fetchMissingUsers'](_0x5aeb8d),this['_applyOperationsSet'](_0x5aeb8d,_0x46e1c8);}_0x71472d['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5aeb8d,_0x71472d['lastOperationId']),this['_lastSyncedOperationId']=_0x71472d['lastOperationId']),this['serverHistory']['version']=_0x4ae3e7+this['_offset'],this['_updateServerHistory'](_0x5aeb8d),_0x4aa134['filter'](_0x455ba7=>{const _0x570fb3=this['_getAffectedRoot'](_0x455ba7);return _0x570fb3&&!this['_knownRootNames']['has'](_0x570fb3);})['forEach']((_0x348f83,_0x10e134)=>{_0x348f83['baseVersion']=this['_document']['version']+_0x10e134,this['_saveOperationInBuffer'](_0x348f83);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x23f673,_0x96763b,_0x405c5f){throw this['_isPendingUpdate']=!0x0,_0x96763b&&console['error'](_0x96763b),_0x405c5f&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x21f60b(_0x23f673,this['editor']);}['_saveOperationInBuffer'](_0x18b0ed){this['_knownOperations']['has'](_0x18b0ed)||(this['_knownOperations']['add'](_0x18b0ed),this['_bufferedOperations']['push'](_0x18b0ed),this['_pendingAction']||'marker'==_0x18b0ed['type']&&!_0x18b0ed['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x25170a=!0x1){!_0x25170a&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xe7a651=>{_0xe7a651&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x53d828=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x1ada99){return _0x1ada99['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1ada99['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x1ada99['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x53d828)||this['_crash'](_0x53d828['message'],_0x53d828,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x58a336=>{this['on']('change:_isPendingUpdate',()=>{_0x58a336();});});}async['_sendBufferedOperations'](){const _0x3f8395=this['editor']['plugins']['get'](E);if(this['_shouldSendSelectionUpdate']()&&(_0x3f8395['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3eb942=[...this['_bufferedOperations']];for(const _0x4e5069 of _0x3eb942)_0x4e5069['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4e5069);const _0x369cdf=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3eb942),_0x47dfa7=F++,_0x581efe=this['_compressOperations'](_0x3eb942),_0x33e1d6=await this['_service']['sendOperations'](_0x581efe,_0x581efe['baseVersion'],_0x369cdf);try{return await this['_handleServerResponse'](_0x3eb942,_0x33e1d6,_0x47dfa7);}catch(_0x2a85e8){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2a85e8);}}async['_handleServerResponse'](_0x19e6de,_0x393525,_0x54a047){if('error'in _0x393525)throw _0x393525['error'];let _0x20a5cf=!0x1;if(_0x393525['wereChangesApplied']){_0x393525['lastOperationId']&&(this['_lastSyncedOperationId']=_0x393525['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x24dbbc=>!_0x19e6de['includes'](_0x24dbbc));for(const _0x4d98f8 of _0x19e6de)_0x4d98f8['createdAt']='lastOperationAcceptedAt'in _0x393525&&_0x393525['lastOperationAcceptedAt']||void 0x0;q(_0x19e6de,_0x393525['version']-_0x19e6de['length']),this['_updateServerHistory'](_0x19e6de);const _0x4718a8=_0x19e6de['filter'](_0x2d2880=>{if(!_0x2d2880['_isInit'])return!0x1;const _0x2c3744=this['_getAffectedRoot'](_0x2d2880);return _0x2c3744&&!this['_knownRootNames']['has'](_0x2c3744);});q(_0x4718a8,this['_document']['version']),this['_applyOperationsSet'](_0x4718a8),_0x20a5cf=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x33b220=this['_decompressOperations'](_0x393525['data'],_0x393525['metadata'])['filter'](_0x59b48f=>_0x59b48f['baseVersion']>=this['_lastServerVersion']);_0x33b220['forEach'](_0xdbdc7d=>this['_addKnownRoot'](_0xdbdc7d)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1d78c6=>!_0x1d78c6['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1d78c6))),this['_bufferedOperations']['length']&&q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x33b220),_0x20a5cf=this['_handleExternalOperations'](_0x33b220,_0x393525['version'],_0x393525['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x20a5cf?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x40331b,_0x3422b4,_0x445ec0){try{const _0x15ff69={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4ff16d,operationsB:_0x31c715,originalOperations:_0x490e59}=_0x49a2a4(_0x40331b,this['_bufferedOperations'],_0x15ff69);q(_0x4ff16d,this['_document']['version']),q(_0x31c715,_0x3422b4);for(const _0x80788d of _0x4ff16d){const _0x126815=_0x490e59['get'](_0x80788d);_0x80788d['_authorId']=_0x126815?_0x126815['_authorId']:null;}_0x445ec0&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x40331b,_0x445ec0),this['_lastSyncedOperationId']=_0x445ec0),this['_bufferedOperations']=[..._0x31c715],this['_applyOperationsSet'](_0x4ff16d),this['_updateServerHistory'](_0x40331b);}catch(_0x5382a1){return console['error'](_0x5382a1),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3c7241,_0x17140a=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1824ed=>{for(const _0x495ff8 of _0x3c7241)this['_knownOperations']['add'](_0x495ff8),this['_addKnownRoot'](_0x495ff8),_0x1824ed['batch']['addOperation'](_0x495ff8),this['editor']['model']['applyOperation'](_0x495ff8);});}['_addKnownRoot'](_0x28bb6e){const _0x2aece8=this['_getAffectedRoot'](_0x28bb6e);_0x2aece8&&this['_knownRootNames']['add'](_0x2aece8);}['_getAffectedRoot'](_0x36fd12){let _0x470184,_0x244788;switch(_0x36fd12['type']){case'insert':_0x470184=_0x36fd12['position']['root'];break;case'marker':if(_0x244788=_0x36fd12['newRange'],!_0x244788)return null;_0x470184=_0x244788['root'];break;case'addRootAttribute':_0x470184=_0x36fd12['root'];break;case'addRoot':_0x470184=_0x36fd12['affectedSelectable'];break;case'move':_0x470184=_0x36fd12['targetPosition']['root'];break;default:return null;}return _0x470184['rootName'];}['_updateServerHistory'](_0x1642f7){_0x1642f7['forEach'](_0x2f76c2=>{const _0x3ceb84=_0x2f76c2['clone']();_0x3ceb84['_authorId']=_0x2f76c2['_authorId'],_0x3ceb84['_isInit']=!!_0x2f76c2['_isInit'],_0x3ceb84['createdAt']=_0x2f76c2['createdAt'],_0x3ceb84['baseVersion']+=this['_offset'],_0x2f76c2['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3ceb84),this['serverHistory']['addOperation'](_0x3ceb84);});}['_handleReconnectionError'](_0xf403e){const _0xecf8e9=this['editor']['plugins']['get']('Notification'),_0x3f0e1b=this['editor']['locale'];_0xf403e||(_0xf403e=B(_0x3f0e1b,'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.')),_0xecf8e9['showWarning'](_0xf403e,{'title':B(_0x3f0e1b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x3e80ae)['add'](B(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3e80ae)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x243910){const _0x16b63f=_0x243910['map'](_0x8eff86=>_0x8eff86['toJSON']());return this['_compressor']['compress'](_0x16b63f);}['_decompressOperations'](_0x59baad,_0x20afc8){return this['_compressor']['decompress'](_0x59baad)['map']((_0x46f76f,_0x4a7511)=>{const _0x24f3f8='init'==_0x20afc8[_0x4a7511]['type'];if('InsertOperation'==_0x46f76f['__className']){const _0x44cd8e=_0x46f76f['position']['root'];!this['_document']['getRoot'](_0x44cd8e)&&(this['_document']['createRoot']('$root',_0x44cd8e)['_isAttached']=!0x1);}const _0xd2eec9=_0x2400d3['fromJSON'](_0x46f76f,this['_document']);return _0xd2eec9['wasUndone']=_0x46f76f['wasUndone'],_0xd2eec9['_isInit']=_0x24f3f8,_0xd2eec9['_authorId']=_0x24f3f8?null:_0x20afc8[_0x4a7511]['userId'],_0xd2eec9['_isDisconnection']='cs:removeUser'===_0x20afc8[_0x4a7511]['type'],_0xd2eec9['createdAt']=_0x20afc8[_0x4a7511]['createdAt'],_0xd2eec9;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x34f9aa=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x34f9aa&&_0x34f9aa['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class H extends Error{}function q(_0x1819a5,_0x3bec52){for(const _0x5aa732 of _0x1819a5)_0x5aa732['baseVersion']=_0x3bec52++;}class G{['_ignoredOperations'];['_operationToId'];constructor(_0x470eb4){this['_ignoredOperations']=_0x470eb4,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4f2b6e){let _0x177727=_0x4f2b6e['length'];for(;_0x177727--;){const _0x569778=_0x4f2b6e[_0x177727];if(!this['_ignoredOperations']['has'](_0x569778)){if(!this['_operationToId']['has'](_0x569778)){const _0x376d70=_0x446026()['slice'](0x1,0x12);this['_operationToId']['set'](_0x569778,_0x376d70);}return this['_operationToId']['get'](_0x569778);}}}['setIdForTheLastOperation'](_0x324998,_0x5578a3){if(!_0x5578a3)return;let _0x2713e0=_0x324998['length'];for(;_0x2713e0--;){const _0x44877d=_0x324998[_0x2713e0];this['_ignoredOperations']['has'](_0x44877d)||this['_operationToId']['set'](_0x44877d,_0x5578a3);}}}class n extends _0x293c5a{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x498445{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>nt)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x5bb3d9];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x21d1b3){super(_0x21d1b3),this['_services']=new Map();}async['init'](){const _0x4eee5d=this['context'],_0x112256=_0x4eee5d['plugins']['get']('CommentsRepository');if(_0x4eee5d['plugins']['get'](c)['addToReconnectionStack'](this),_0x112256['adapter']={'addCommentThread':async({channelId:_0x190f0b,threadId:_0x18dd83,comments:_0xcd036c,resolvedAt:_0x25e431,resolvedBy:_0x55b96a,context:_0x28707b,attributes:_0x3db0f3})=>{const _0x258c3e=await this['_getService'](_0x190f0b)['addCommentThread']({'commentThreadId':_0x18dd83,'comments':_0xcd036c['map'](_0x18519a=>function(_0x5d71ca,_0x221150,_0x56931f){return{'commentThreadId':_0x56931f,'commentId':_0x5d71ca['commentId'],'userId':_0x5d71ca['authorId'],'content':_0x5d71ca['content'],'documentId':_0x221150,'createdAt':_0x5d71ca['createdAt'],'attributes':_0x5d71ca['attributes']||{}};}(_0x18519a,_0x190f0b,_0x18dd83)),'resolvedAt':_0x25e431,'resolvedBy':_0x55b96a,'context':_0x28707b,'attributes':_0x3db0f3})['catch'](gt);return{'threadId':_0x258c3e['commentThreadId'],'comments':_0x258c3e['comments']};},'getCommentThread':async({channelId:_0x4dfc22,threadId:_0x1362a8})=>{const _0x41e92e=await this['_getService'](_0x4dfc22)['getCommentThread'](_0x1362a8)['catch'](gt);return _0x41e92e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x41e92e]),{'threadId':_0x41e92e['commentThreadId'],'comments':_0x41e92e['comments']['map'](ct),'context':_0x41e92e['context'],'resolvedAt':_0x41e92e['resolvedAt'],'resolvedBy':_0x41e92e['resolvedBy'],'attributes':_0x41e92e['attributes']||{}});},'updateCommentThread':async({channelId:_0xe012a5,threadId:_0xb2ce4b,context:_0x377470,unlinkedAt:_0x597d32,attributes:_0x4f1e0e})=>this['_getService'](_0xe012a5)['updateCommentThread']({'commentThreadId':_0xb2ce4b,'context':_0x377470,'attributes':_0x4f1e0e,'unlinkedAt':_0x597d32})['catch'](rt)['catch'](gt),'resolveCommentThread':async({channelId:_0x7bd567,threadId:_0x209c6a})=>{const _0x5b0b7c=await this['_getService'](_0x7bd567)['resolveCommentThread'](_0x209c6a)['catch'](rt)['catch'](gt);return{'threadId':_0x5b0b7c['commentThreadId'],'resolvedAt':_0x5b0b7c['resolvedAt'],'resolvedBy':_0x5b0b7c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x360eb5,threadId:_0x2046a2})=>this['_getService'](_0x360eb5)['reopenCommentThread'](_0x2046a2)['catch'](rt)['catch'](gt),'removeCommentThread':({channelId:_0x4cf518,threadId:_0x321901})=>this['_getService'](_0x4cf518)['removeCommentThread'](_0x321901)['catch'](rt)['catch'](gt),'addComment':({channelId:_0x32f267,threadId:_0x2b6d85,commentId:_0x522ab2,content:_0x39bc25,attributes:_0x439d53})=>this['_getService'](_0x32f267)['addComment'](_0x2b6d85,_0x522ab2,_0x39bc25,_0x439d53)['catch'](gt),'updateComment':({channelId:_0x470e70,threadId:_0x1305bf,commentId:_0x9c11b1,content:_0x2a0bee,attributes:_0x5b50e5})=>this['_getService'](_0x470e70)['updateComment'](_0x1305bf,_0x9c11b1,_0x2a0bee,_0x5b50e5)['catch'](rt)['catch'](gt),'removeComment':({channelId:_0x5aa8d4,threadId:_0x5c8382,commentId:_0x36cfc0})=>this['_getService'](_0x5aa8d4)['removeComment'](_0x5c8382,_0x36cfc0)['catch'](rt)['catch'](gt)},_0x4eee5d instanceof ot){const _0x5963d0=_0x4eee5d['config']['get']('collaboration.channelId'),_0xcb54ab=_0x4eee5d['plugins']['get'](i);await this['_setUpService'](_0x5963d0);const _0x4250bd=await this['_services']['get'](_0x5963d0)['getConnectedSessions']();this['listenTo'](_0xcb54ab,'sessionAdd:'+_0x5963d0,(_0x4c68ec,{session:_0x193ed4})=>{_0x193ed4['id']===_0xcb54ab['mySessionId']&&(_0x4c68ec['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x193ed4['permissions'],_0x5963d0));}),_0xcb54ab['register'](_0x5963d0,_0x4250bd);}}async['_setUpService'](_0x35dde7){if(this['_services']['has'](_0x35dde7))throw new _0x21f60b('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x35dde7});const _0x357a93=this['context']['plugins']['get']('CommentsRepository'),_0xd1aef=new a['CommentsService'](_0x35dde7);this['_services']['set'](_0x35dde7,_0xd1aef),this['listenTo'](_0xd1aef,'commentThreadAdded',(_0x19d841,_0x8f307e)=>{const {commentThreadId:_0x38cdf3,documentId:_0x58e59d,context:_0x4377ad,attributes:_0x4ff7b7,resolvedAt:_0x5a167c,resolvedBy:_0x38799e,comments:_0x24907d}=_0x8f307e;_0x357a93['getCommentThread'](_0x38cdf3)||_0x357a93['addCommentThread']({'threadId':_0x38cdf3,'channelId':_0x58e59d,'comments':_0x24907d?_0x24907d['map'](ct):[],'context':_0x4377ad,'attributes':_0x4ff7b7,'resolvedAt':_0x5a167c,'resolvedBy':_0x38799e,'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadUpdated',(_0x38e265,{commentThreadId:_0x568481,documentId:_0x4cfd0b,context:_0x11903c,unlinkedAt:_0x1115e7,attributes:_0x4823a6})=>{_0x357a93['getCommentThread'](_0x568481)&&_0x357a93['updateCommentThread']({'threadId':_0x568481,'channelId':_0x4cfd0b,'context':_0x11903c,'unlinkedAt':_0x1115e7,'attributes':_0x4823a6,'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadResolved',(_0x475717,{commentThreadId:_0x16ea4c,resolvedBy:_0x54f2cc,resolvedAt:_0x34f80d})=>{const _0x2bcf00=_0x357a93['getCommentThread'](_0x16ea4c);_0x2bcf00&&_0x2bcf00['resolve']({'resolvedBy':_0x54f2cc,'resolvedAt':_0x34f80d,'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadReopened',(_0x1ccbd1,{commentThreadId:_0x15cbde})=>{const _0x1ad789=_0x357a93['getCommentThread'](_0x15cbde);_0x1ad789&&_0x1ad789['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadRemoved',(_0x4169cc,{commentThreadId:_0x356136})=>{const _0x35d019=_0x357a93['getCommentThread'](_0x356136);_0x35d019&&_0x35d019['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentAdded',(_0x2ebe70,_0x252184)=>{const _0xf40bb4=_0x252184['commentThreadId'],_0x4cef26=_0x357a93['getCommentThread'](_0xf40bb4);_0x4cef26&&_0x4cef26['addComment']({...ct(_0x252184),'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentUpdated',(_0xe22384,{commentThreadId:_0x23fafd,commentId:_0x3f1eaf,content:_0x311143,attributes:_0x632c4f})=>{const _0x5d4dd8=_0x357a93['getCommentThread'](_0x23fafd);if(_0x5d4dd8){const _0x1b78d9=_0x5d4dd8['getComment'](_0x3f1eaf);_0x1b78d9&&_0x1b78d9['update']({'content':_0x311143,'attributes':_0x632c4f,'isFromAdapter':!0x0});}}),this['listenTo'](_0xd1aef,'commentRemoved',(_0x242e61,{commentThreadId:_0x44c987,commentId:_0x184854})=>{const _0xcf15fd=_0x357a93['getCommentThread'](_0x44c987);if(_0xcf15fd){const _0x4dca65=_0xcf15fd['getComment'](_0x184854);_0x4dca65&&_0x4dca65['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x35dde7);}['destroy'](){if(this['context']instanceof ot){const _0x3adfe5=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3adfe5);}}['_terminateService'](_0x53f3d2){if(!this['_services']['has'](_0x53f3d2))throw new _0x21f60b('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x53f3d2});this['_getService'](_0x53f3d2)['disconnect'](),this['_services']['delete'](_0x53f3d2);}async['reconnect'](){for(const _0x4d2168 of this['_services']['keys']())await this['_connectService'](_0x4d2168);if(this['context']instanceof ot){const _0x5be1dd=this['context']['config']['get']('collaboration.channelId'),_0x305ef5=this['context']['plugins']['get'](i);_0x305ef5['unregister'](_0x5be1dd);const _0xe15103=await this['_services']['get'](_0x5be1dd)['getConnectedSessions']();_0x305ef5['register'](_0x5be1dd,_0xe15103);}}async['_connectService'](_0x2c0ee2){const {connection:_0x4b841d}=this['context']['plugins']['get'](c),_0x11d956=this['context']['plugins']['get']('CommentsRepository'),_0x266d6e=this['_services']['get'](_0x2c0ee2),_0x2eae30=await _0x266d6e['connect'](_0x4b841d);await this['_fetchMissingUsersForThreads'](_0x2eae30);const _0x3ce377=new Set(Array['from'](_0x11d956['getCommentThreads']({'channelId':_0x2c0ee2}),_0x5180fd=>_0x5180fd['id']));for(const _0x740309 of _0x2eae30)_0x740309['deletedAt']||_0x3ce377['delete'](_0x740309['commentThreadId']);for(const _0x55d054 of _0x3ce377)_0x11d956['getCommentThread'](_0x55d054)['remove']({'isFromAdapter':!0x0});for(const _0x3699e9 of _0x2eae30){let _0x296511=_0x11d956['getCommentThread'](_0x3699e9['commentThreadId']);const {commentThreadId:_0x271290,context:_0x454dc2,attributes:_0x566ebc,resolvedBy:_0x4c8b90,resolvedAt:_0x4add4b,unlinkedAt:_0x55c4dc,deletedAt:_0x125e3b}=_0x3699e9;if(_0x125e3b)continue;_0x296511||(_0x296511=_0x11d956['addCommentThread']({'channelId':_0x2c0ee2,'threadId':_0x271290,'context':_0x454dc2,'attributes':_0x566ebc||{},'resolvedBy':_0x4c8b90,'resolvedAt':_0x4add4b,'unlinkedAt':_0x55c4dc,'isFromAdapter':!0x0}));const _0x498bae=new Set(Array['from'](_0x296511['comments'],_0x383f4b=>_0x383f4b['id']));for(const _0x1abdb0 of _0x3699e9['comments'])_0x498bae['delete'](_0x1abdb0['commentId']);for(const _0xb7a48 of _0x498bae)_0x296511['getComment'](_0xb7a48)['remove']({'isFromAdapter':!0x0});for(const _0x511d6d of _0x3699e9['comments']){const _0x239277=_0x296511['getComment'](_0x511d6d['commentId']);_0x239277?_0x239277['content']!==_0x511d6d['content']&&_0x239277['update']({'content':_0x511d6d['content'],'isFromAdapter':!0x0}):_0x296511['addComment'](Object['assign'](ct(_0x511d6d),{'isFromAdapter':!0x0}));}}}['_getService'](_0x2f7ab5){if(!this['_services']['has'](_0x2f7ab5))throw new _0x21f60b('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x2f7ab5});return this['_services']['get'](_0x2f7ab5);}async['_fetchMissingUsersForThreads'](_0x1471b3){const _0x422238=this['context']['plugins']['get'](_0x5bb3d9),{connection:_0x394073}=this['context']['plugins']['get'](c),_0x17ee89=new Set();for(const {resolvedBy:_0x1b3b6d,comments:_0x4e1908}of _0x1471b3){_0x1b3b6d&&!_0x422238['getUser'](_0x1b3b6d)&&_0x17ee89['add'](_0x1b3b6d);for(const {userId:_0x4bba8a}of _0x4e1908)_0x422238['getUser'](_0x4bba8a)||_0x17ee89['add'](_0x4bba8a);}if(0x0===_0x17ee89['size'])return;const _0x4bcf4d=await mt['getMany'](_0x394073,Array['from'](_0x17ee89));for(const _0x252ceb of _0x4bcf4d)_0x422238['getUser'](_0x252ceb['id'])||_0x422238['addUser'](_0x252ceb);}}async function rt(_0x386c24){if('404'!==_0x386c24['code'])throw _0x386c24;}function gt(_0x2f9ea5){if((_0x5b731f=_0x2f9ea5)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5b731f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5b731f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5b731f;throw _0x2f9ea5;}function ct(_0x3cde89){return{'threadId':_0x3cde89['commentThreadId'],'commentId':_0x3cde89['commentId'],'content':_0x3cde89['content'],'createdAt':_0x3cde89['createdAt'],'authorId':_0x3cde89['userId'],'attributes':_0x3cde89['attributes']||{}};}class f extends _0x293c5a{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>tt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x5bb3d9];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ad4b9){super(_0x2ad4b9);const _0x615fd7=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x615fd7);}async['init'](){const _0x1e8196=this['editor']['plugins']['get'](l),_0x39affd=_0x1e8196['serverHistory'],_0x4e7de0=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x39affd,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x1e8196['sessionId']});const _0x575dbc=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x134e9d=await _0x5527f2['isBundleUploaded'](_0x4e7de0['connection'],_0x575dbc);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x461fba})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x461fba)),'updateRevisions':async _0x52b03d=>{await this['_waitForServiceReady']();const _0x219bc2=this['_revisionTracker']['currentRevision'];if(_0x134e9d&&0x1===_0x52b03d['length']&&_0x52b03d[0x0]['id']===_0x219bc2['id'])return _0x52b03d;for(const _0x124582 of _0x52b03d)_0x124582['id']===_0x219bc2['id']&&(_0x124582['isEmptyCurrent']=_0x124582['fromVersion']===_0x124582['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x52b03d,this['_lastRequestId'])['then'](_0x8672fb=>(this['_lastRequestId']=_0x8672fb,_0x52b03d))['catch'](_0xb9dc79=>{if(it(_0xb9dc79)||'400'===_0xb9dc79['code']&&void 0x0!==_0xb9dc79['data']['wrongRequestId']){for(const _0x388545 of _0x52b03d){!this['_revisionTracker']['repository']['getRevision'](_0x388545['id'])||this['_revisionTracker']['_bufferUpdate'](_0x388545['id'],_0x388545,!0x1);}if(it(_0xb9dc79))throw _0xb9dc79;return _0x52b03d;}throw _0xb9dc79;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x29f106,{revisionsData:_0x3a5866,requestId:_0x108e21})=>{Math['max'](..._0x3a5866['map'](_0x3fe91f=>_0x3fe91f['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3a5866,_0x108e21);}):this['_handleRevisionsUpdate'](_0x3a5866,_0x108e21);});const {revisions:_0x4e37b4,requestId:_0x58a6f8}=await this['_revisionHistoryService']['connect'](_0x4e7de0['connection']);_0x4e7de0['addToReconnectionStack'](this),this['_lastRequestId']=_0x58a6f8,await this['_fetchMissingUsers'](_0x4e37b4);for(const _0x1f9203 of _0x4e37b4)this['_revisionTracker']['addRevisionData'](_0x1f9203);this['listenTo'](_0x1e8196,'change:_isConnected',(_0x545540,_0x3f3e70,_0x22f49e)=>{_0x22f49e&&(this['_oldOffset']=_0x1e8196['_offset'],_0x545540['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4e7de0,'state',_0x15225d=>_0x15225d===_0x10fa10['CONNECTED']);}async['reconnect'](){const _0x1ca5ba=this['editor']['plugins']['get'](c),_0xf89d22=this['editor']['plugins']['get'](l),_0x373b46=async()=>{const _0x457de6=this['_revisionTracker']['currentRevision'],_0xc38d78=_0x457de6['id'],_0x2a41bf=_0xc38d78!==_0xf89d22['sessionId'];if(_0x2a41bf){const _0x85e7e2=_0xf89d22['_offset']-this['_oldOffset'],_0x1a528a=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x457de6['toVersion']+_0x85e7e2!==_0x1a528a){const _0x409ccd=_0x457de6['fromVersion']+_0x85e7e2,_0x4f49f9=this['editor']['plugins']['get'](_0x5bb3d9),_0x17a000=this['_revisionTracker']['buildRevisionData']({'revision':_0x457de6,'from':_0x409ccd,'to':_0x1a528a});_0x17a000['id']=_0x457de6['id'];const _0x1bd294=_0x17a000['authorsIds']['map'](_0xa13e6e=>_0x4f49f9['getUser'](_0xa13e6e));_0x457de6['_update']({..._0x17a000,'authors':_0x1bd294},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x457de6['id'],_0x17a000,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1a528a,(_0x457de6['toVersion']===_0x457de6['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xc38d78)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xc38d78),this['_revisionTracker']['_createCurrentRevision'](_0x1a528a));}const {revisions:_0x3dea0b,requestId:_0x4b46c8}=await this['_revisionHistoryService']['reconnect'](_0x1ca5ba['connection'],this['_lastRequestId']);_0x2a41bf&&_0x3dea0b['length']>0x0?_0xf89d22['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3dea0b),this['_handleRevisionsUpdate'](_0x3dea0b,_0x4b46c8),this['_revisionTracker']['sendBufferedUpdates']());};return _0xf89d22['_isConnected']?_0x373b46():new Promise((_0x1787de,_0x40a07a)=>{_0xf89d22['once']('change:_isConnected',()=>{_0x373b46()['then'](_0x1787de)['catch'](_0x40a07a);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x289604=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5bf5b9=>{_0x5bf5b9['off'](),_0x289604();});});}['_getLatestVersionFromServerOperations'](){const _0x411c5f=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x9b1116 of _0x411c5f)if('marker'!==_0x9b1116['type']||_0x9b1116['affectsData'])return _0x9b1116['baseVersion']+0x1;}['_getLatestVersion'](){const _0x37bf6d=this['editor']['plugins']['get'](l);return new Promise(_0x545275=>{_0x37bf6d['_isPendingUpdate']?_0x37bf6d['once']('change:_isPendingUpdate',()=>{_0x545275(this['_getLatestVersionFromServerOperations']());}):_0x545275(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x5270a8,_0xadb77f){const _0x95842f=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xadb77f;for(const _0x48d475 of _0x5270a8){const _0x3e6b1f=_0x95842f['getRevision'](_0x48d475['id']);if(_0x3e6b1f){if((_0x48d475['fromVersion']||_0x48d475['toVersion'])&&(_0x48d475['diffData']=null),_0x3e6b1f===this['_revisionTracker']['currentRevision']){const _0x17e8b4=Math['max'](_0x3e6b1f['toVersion'],_0x48d475['toVersion']),_0x1994f2=Math['max'](_0x3e6b1f['fromVersion'],_0x48d475['fromVersion']);let _0x11fea2;_0x3e6b1f['toVersion']===_0x48d475['toVersion']&&_0x3e6b1f['fromVersion']===_0x48d475['fromVersion']?(_0x11fea2=!0x0,this['_preventResendingRevisionData'](_0x48d475)):_0x48d475['toVersion']===_0x17e8b4&&_0x48d475['fromVersion']===_0x1994f2?_0x11fea2=!0x1:(_0x3e6b1f['toVersion']===_0x17e8b4&&_0x3e6b1f['fromVersion']===_0x1994f2||this['_fixRevision']({'revision':_0x3e6b1f,'from':_0x1994f2,'to':_0x17e8b4}),_0x11fea2=!0x0),_0x11fea2&&(delete _0x48d475['fromVersion'],delete _0x48d475['toVersion'],delete _0x48d475['diffData'],delete _0x48d475['createdAt'],delete _0x48d475['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x48d475),this['_preventResendingRevisionData'](_0x48d475);}else this['_revisionTracker']['addRevisionData'](_0x48d475);}const _0x55d80e=_0x95842f['getRevisions']();_0x55d80e['reverse']();for(let _0x26c902=0x0;_0x26c902<_0x55d80e['length']-0x1;_0x26c902++){const _0x304bff=_0x55d80e[_0x26c902],_0xd3a746=_0x55d80e[_0x26c902+0x1];if(_0x304bff['fromVersion']<_0xd3a746['toVersion']){const _0x2d5856=_0xd3a746['toVersion'],_0x2e4f94=Math['max'](_0x2d5856,_0x304bff['toVersion']);this['_fixRevision']({'revision':_0x304bff,'from':_0x2d5856,'to':_0x2e4f94});}}}['_fixRevision']({revision:_0x3694dd,from:_0x32d799,to:_0x42b774}={}){const _0x465a26=this['editor']['plugins']['get'](_0x5bb3d9),_0x4f43db=this['_revisionTracker']['buildRevisionData']({'revision':_0x3694dd,'from':_0x32d799,'to':_0x42b774});_0x4f43db['authors']=_0x4f43db['authorsIds']['map'](_0x22ebdf=>_0x465a26['getUser'](_0x22ebdf)),_0x3694dd['_update'](_0x4f43db);}['_preventResendingRevisionData'](_0x49db6d){const _0x2f5127={};_0x2f5127['id']=_0x49db6d['id'];for(const _0x2466c2 of Object['keys'](_0x49db6d))'id'!==_0x2466c2&&(_0x2f5127[_0x2466c2]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x2f5127['id'],_0x2f5127,!0x0);}async['_fetchMissingUsers'](_0x4be4c6){const _0x5b803c=this['editor']['plugins']['get'](_0x5bb3d9),{connection:_0x2e29be}=this['editor']['plugins']['get'](c),_0x3e2e38=new Set();for(const _0x4ddf25 of _0x4be4c6){for(const _0x4fce2e of _0x4ddf25['authorsIds'])_0x264e32(_0x4fce2e);_0x4ddf25['creatorId']&&_0x264e32(_0x4ddf25['creatorId']);}if(0x0===_0x3e2e38['size'])return;const _0x42ff37=await mt['getMany'](_0x2e29be,Array['from'](_0x3e2e38));for(const _0x11880a of _0x42ff37)_0x5b803c['getUser'](_0x11880a['id'])||_0x5b803c['addUser'](_0x11880a);function _0x264e32(_0x148b32){_0x5b803c['getUser'](_0x148b32)||_0x3e2e38['add'](_0x148b32);}}}function it(_0x5c8907){return _0x5c8907['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5c8907['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5c8907['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x293c5a{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x21b85b{constructor(_0x213c98){super(_0x213c98);const _0x16a8e2=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x16a8e2['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x16a8e2['to']('usersCount',_0x3acc2e=>B(_0x213c98,'CONNECTED_USERS',_0x3acc2e))}]});}}class es extends _0x21b85b{['items'];['keystrokes'];constructor(_0x162092){super(_0x162092);const _0x4414bc=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x193412(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x4414bc['if']('hasPopup'),'aria-expanded':_0x4414bc['to']('isExpanded',_0x568d62=>this['hasPopup']&&String(_0x568d62)),'aria-label':_0x4414bc['to']('hasPopup',_0x155ca9=>B(_0x162092,_0x155ca9?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x4414bc['to']('hasPopup',_0x4db310=>!!_0x4db310&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x4414bc['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x2f2405,_0x5ef8dc,_0x51c809)=>{this['element']&&(_0x51c809?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class L extends _0x21b85b{['counterView'];['inlineListView'];constructor(_0x2f9c6f){super(_0x2f9c6f);const _0x2a775f=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x2f9c6f),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4e67b5 of this['inlineListView']['items'])_0x4e67b5['tooltipPosition']='s';this['inlineListView']['items']['first']&&(this['inlineListView']['items']['first']['tooltipPosition']='se');}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list','ck-reset','ck-rounded-corners',_0x2a775f['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x21b85b{['listWrapperView'];constructor(_0x498b03,_0x4d97b6){super(_0x498b03),this['listWrapperView']=new vt(_0x498b03,_0x4d97b6),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':B(_0x498b03,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x6126fa{constructor(_0x128d21,_0x4fa3ce){super(_0x128d21);const _0x540d57=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4fa3ce?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x540d57['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x540d57['to']('role'),'aria-label':_0x540d57['to']('ariaLabel'),'aria-labelledby':_0x540d57['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xd7a97b['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1dd649=this['element'];_0x1dd649&&(this['_isScrollable']=Math['max'](_0x1dd649['scrollHeight'],_0x1dd649['clientHeight'])>0.8*window['innerHeight']);}}class k extends at{['userView'];constructor(_0x29a61b,_0x29d298,_0x543f3e){super(_0x29a61b);const _0x32be63=this['bindTemplate'];this['userView']=new lt(_0x29a61b,_0x29d298);const _0x3a8a47={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x29d298['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x29d298['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x29d298['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x543f3e&&(_0x3a8a47['tag']='button',_0x3a8a47['on']={'click':_0x32be63['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3a8a47);}['focus'](){this['element']['focus']();}}class y extends _0x21b85b{['userView'];['markerView'];constructor(_0x19a293,_0x1b07d3,_0x3d3626){super(_0x19a293);const _0x44df01=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new lt(_0x19a293,_0x1b07d3),this['markerView']=new dt(_0x19a293,_0x1b07d3);const _0x46de41=new pt(_0x19a293);_0x46de41['template']['tag']='span',_0x46de41['text']=_0x1b07d3['name'];const _0x27e4b7={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x44df01['to']('isFocusable',_0x1ae8f2=>!!_0x1ae8f2&&0x0),'aria-labelledby':_0x46de41['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x44df01['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x44df01['to']('hasTooltip',_0x2f08af=>!_0x2f08af),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x46de41]};_0x3d3626&&(_0x27e4b7['tag']='button',_0x27e4b7['on']={'click':_0x44df01['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x27e4b7);}}class dt extends _0x21b85b{constructor(_0x3d47db,_0x4e2b59){super(_0x3d47db),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4e2b59['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x498445{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x171045){super(_0x171045),this['context']['config']['define']('presenceList',A);const _0x49474f=_0x171045['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x49474f)throw new _0x21f60b('presencelist-collapseat-invalid-format',this);if(_0x49474f<0x1)throw new _0x21f60b('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x14b0f5(),this['balloonPanelView']=new _0x4b6953(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x129d31 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x129d31);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1476e4,_0x2b2218)=>{this['_handleUserAdd'](_0x2b2218);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x12266f,_0x4ad08d)=>{this['_handleUserRemove'](_0x4ad08d);});}['_createView'](){const _0x19b574=this['context'],_0x50fbd8=new L(this['context']['locale']),_0x1d68ce=this['balloonPanelView'];if(!_0x1cfdb0(_0x19b574['config']['get']('presenceList.container')))throw new _0x21f60b('presencelist-missing-container',this);return _0x50fbd8['counterView']['bind']('usersCount')['to'](this),_0x50fbd8['bind']('isCollapsed')['to'](this,'usersCount',_0x5583f3=>{const {collapseAt:_0x4a6c1c,displayMe:_0x3388a5}=_0x19b574['config']['get']('presenceList'),_0x2dd5a7=_0x5583f3>=_0x4a6c1c;return _0x50fbd8['counterView']['isHidden']=!(0x1==_0x5583f3&&_0x3388a5||_0x2dd5a7),_0x2dd5a7||this['hideDropdown'](),_0x2dd5a7;}),_0x50fbd8['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x4146d5=>{const _0x3b859c=_0x19b574['config']['get']('presenceList'),_0x2e1c1c=new y(_0x19b574['locale'],_0x4146d5,!!_0x3b859c['onClick']);return _0x2e1c1c['bind']('hasTooltip')['to'](_0x50fbd8,'isCollapsed',_0x166299=>!_0x166299),_0x2e1c1c['bind']('isFocusable')['to'](_0x50fbd8,'isCollapsed',_0x2c69a2=>!_0x2c69a2),_0x3b859c['onClick']&&this['listenTo'](_0x2e1c1c,'execute',()=>{this['view']['isCollapsed']||_0x3b859c['onClick'](_0x4146d5,_0x2e1c1c['element']);}),_0x2e1c1c;}),this['listenTo'](_0x50fbd8['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x50fbd8['inlineListView']['keystrokes']['set']('Enter',(_0x459010,_0x3db2ff)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3db2ff());}),_0x50fbd8['render'](),_0x1d68ce['render'](),_0x5a78ed({'emitter':_0x50fbd8,'activator':()=>_0x1d68ce['isVisible'],'contextElements':[_0x1d68ce['element'],_0x50fbd8['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x19b574['config']['get']('presenceList.container')['appendChild'](_0x50fbd8['element']),this['_bodyCollection']=new _0xba0c8a(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x50fbd8;}['_handleUserAdd'](_0x34d03e){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x34d03e['isMe'])return;const _0x2a8c37=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x2a8c37&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x17e800=_0x34d03e['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x34d03e,_0x17e800);}['_handleUserRemove'](_0x10d16a){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x10d16a['id'])&&(this['currentDisplayedUsers']['remove'](_0x10d16a['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x228ded of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x228ded['id']))return void this['currentDisplayedUsers']['add'](_0x228ded,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4613b3=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x4613b3['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x3a7d84}=this['presenceDropdownView'];_0x3a7d84['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x110fa3=>{if(!_0x4613b3['displayMe']&&_0x110fa3['isMe'])return null;const _0xa123f8=new k(this['context']['locale'],_0x110fa3,!!_0x4613b3['onClick']);return _0x4613b3['onClick']&&this['listenTo'](_0xa123f8,'execute',()=>{_0x4613b3['onClick'](_0x110fa3,_0xa123f8['element']);}),_0xa123f8;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x3a7d84['focus'](),_0x3a7d84['checkIfScrollable']();const _0x473ed9=(_0x40addc,_0x3cfb69)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3cfb69();};_0x3a7d84['keystrokes']['set']('Esc',_0x473ed9),_0x3a7d84['keystrokes']['set']('Shift+Tab',_0x473ed9),_0x3a7d84['keystrokes']['set']('Tab',(_0x35a6ef,_0x42c4ee)=>{!function(_0x4c1e92){const _0xdc53a0=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x58858c=>_0x58858c+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x6ec23e=[...document['body']['querySelectorAll'](_0xdc53a0)]['filter'](_0x32253e=>_0x32253e===document['activeElement']||_0x32253e['offsetWidth']+_0x32253e['offsetHeight']>0x0)['sort']((_0x7d30b5,_0x13bb00)=>(_0x7d30b5['tabIndex']||0x0)-(_0x13bb00['tabIndex']||0x0)),_0x3c5159=_0x6ec23e['indexOf'](_0x4c1e92),_0x1b56b0=_0x6ec23e[(_0x3c5159+0x1)%_0x6ec23e['length']];_0x1b56b0&&_0x1b56b0['focus']();}(this['view']['element']),this['hideDropdown'](),_0x42c4ee();}),_0x3a7d84['focusTracker']['add'](this['view']['element']),_0x3a7d84['focusTracker']['on']('change:isFocused',(_0x514e9b,_0x4a2f38,_0x6dcb47)=>{_0x6dcb47||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x498445{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
|
|
23
|
+
import{ContextPlugin as _0x2b0246,Plugin as _0x342830,PendingActions as _0x1ae75e,Context as _0x4b2ff7}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x2c0325,CKEditorError as _0x53fe02,Collection as _0x52b573,global as _0x288752,version as ht,uid as _0x349317,KeystrokeHandler as _0x5625dc}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x53b052,View as _0x3fc612,ListView as _0x23aa7d,ListItemView as ct,LabelView as pt,BalloonPanelView as _0x5dcfb5,clickOutsideHandler as _0x361fc0,BodyCollection as _0x18513d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ut,History as _0x81f02a,NoOperation as _0x13b973,InsertOperation as _0x89b830,MarkerOperation as _0x3bf37d,RootAttributeOperation as _0x1b198c,transformSets as _0x34975a,OperationFactory as _0x353046}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ft,WEB_SOCKET_GATEWAY_STATES as _0x30ee06,CollaborativeEditingService as _0x17db4f,User as mt,CommentsService as tt,TrackChangesService as at,RevisionHistoryService as st,EditorService as it}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x255773,UserView as lt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x210a8e}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3db76d}from'lodash-es';class c extends _0x2b0246{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x53b052];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49d53c){super(_0x49d53c),this['set']('state',_0x30ee06['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x2c0325);}['init'](){const _0x44f3ba=this['context'],_0x50e36b=_0x44f3ba['plugins']['get']('CloudServices'),_0x36174b=_0x44f3ba['plugins']['get'](_0x53b052);if(!_0x50e36b['token'])throw new _0x53fe02('websocketgateway-missing-token',this);if(!_0x50e36b['webSocketUrl'])throw new _0x53fe02('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x50e36b['token'],_0x50e36b['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4a9fea=>{if(this['connection']=_0x4a9fea,this['bind']('state')['to'](_0x4a9fea,'state',this,'_isBrowserOffline',(_0x46cab5,_0x16e3a5)=>('connected'!==_0x46cab5&&(this['_shouldPluginsReconnect']=!0x0),_0x16e3a5||_0x46cab5!==_0x30ee06['CONNECTED']?_0x30ee06['DISCONNECTED']:this['state']==_0x30ee06['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x30ee06['CONNECTING']):_0x30ee06['CONNECTED'])),this['connection']['on']('error',(_0x1f5eab,_0x1fb9ce)=>{if('limitExceeded'!==_0x1fb9ce['code'])throw console['error'](_0x1fb9ce),new _0x53fe02('cloudservices-init',null,{'originalError':_0x1fb9ce});_0x36174b['showWarning']('The\x20limit\x20of\x20maximum\x20concurrent\x20connections\x20that\x20the\x20collaboration\x20server\x20can\x20handle\x20has\x20been\x20reached.\x20Try\x20opening\x20the\x20document\x20again\x20in\x20a\x20few\x20minutes.\x20Please\x20contact\x20your\x20system\x20administrator\x20if\x20the\x20problem\x20persists.',{'title':'Connected\x20users\x20limit\x20exceeded','namespace':'real-time-collaboration'});}),!_0x4a9fea['me'])return new Promise(_0x101733=>_0x4a9fea['on']('change:me',_0x101733));})['catch'](_0x4058fb=>{throw console['error'](_0x4058fb),new _0x53fe02('cloudservices-init',null,{'originalError':_0x4058fb});});}['addToReconnectionStack'](_0x1eeb36){if('function'!=typeof _0x1eeb36['reconnect'])throw new _0x53fe02('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1eeb36))throw new _0x53fe02('websocketgateway-plugin-already-registered',this,{'name':_0x1eeb36['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1eeb36);}['removeFromReconnectionStack'](_0x4050b3){this['_reconnectionStack']['delete'](_0x4050b3);}['isInReconnectionStack'](_0xf8670d){return this['_reconnectionStack']['has'](_0xf8670d);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1d66f4=>_0x1d66f4['reconnect']())))['then'](()=>this['state']=_0x30ee06['CONNECTED'])['catch'](_0x474025=>{throw console['error'](_0x474025),new _0x53fe02('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x30ee06['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x2b0246{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x255773];}constructor(_0x3aa3cf){super(_0x3aa3cf),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x52b573(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x255773);}['init'](){const _0x19683c=this['context']['plugins']['get'](c);this['listenTo'](_0x19683c,'change:state',(_0x1294d8,_0x4407e2,_0x8cbee7)=>{if('connected'!==_0x8cbee7)this['channelSessions']['forEach'](_0x17d201=>_0x17d201['clear']()),this['channelConnectedUsers']['forEach'](_0xc1171e=>_0xc1171e['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x152d1e,_0x46a72d]of this['_registeredSessions'])for(const _0x29273f of _0x46a72d)this['_handleSessionAdd'](_0x152d1e,_0x29273f);}}),this['_createUser'](_0x19683c['connection']['me'],!0x0);}['register'](_0x5d1048,_0x2cf023){if(this['_registeredSessions']['has'](_0x5d1048))throw new _0x53fe02('sessions-register-already-registered',null,{'channelId':_0x5d1048});this['_registeredSessions']['set'](_0x5d1048,_0x2cf023),this['channelSessions']['set'](_0x5d1048,new _0x52b573()),this['channelConnectedUsers']['set'](_0x5d1048,new _0x52b573()),this['listenTo'](_0x2cf023,'add',(_0x400b28,_0x31fdd3)=>this['_handleSessionAdd'](_0x5d1048,_0x31fdd3)),this['listenTo'](_0x2cf023,'remove',(_0x1c9257,_0x2efeda)=>this['_handleSessionRemove'](_0x5d1048,_0x2efeda));for(const _0x569c6b of _0x2cf023)this['_handleSessionAdd'](_0x5d1048,_0x569c6b);}['unregister'](_0x39f9c9){if(!this['_registeredSessions']['has'](_0x39f9c9))throw new _0x53fe02('sessions-unregister-not-exist',null,{'channelId':_0x39f9c9});const _0x409b8d=this['_registeredSessions']['get'](_0x39f9c9);this['stopListening'](_0x409b8d);for(const _0x5bcc88 of _0x409b8d)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x39f9c9,_0x5bcc88);this['_registeredSessions']['delete'](_0x39f9c9),this['channelSessions']['delete'](_0x39f9c9),this['channelConnectedUsers']['delete'](_0x39f9c9);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x35f205){for(const _0x2cd049 of this['channelSessions']['values']())for(const _0x3f65ce of _0x2cd049)if(_0x3f65ce['id']===_0x35f205)return _0x3f65ce['user'];}['getUserSessions'](_0x5dffc9,_0x83bd64){const _0x1b9ba2=_0x83bd64?[this['channelSessions']['get'](_0x83bd64)]:this['channelSessions']['values'](),_0x5915e8=new Set();for(const _0x20828e of _0x1b9ba2)for(const _0x39f02a of _0x20828e)_0x39f02a['user']['id']===_0x5dffc9['id']&&_0x5915e8['add'](_0x39f02a['id']);return _0x5915e8;}['getUserRole'](_0x3bc2eb){for(const _0x3eaa71 of this['channelSessions']['values']())for(const _0x4eacb5 of _0x3eaa71)if(_0x4eacb5['user']===_0x3bc2eb)return _0x4eacb5['role'];}['_handleSessionAdd'](_0x5e5bda,_0x4d434d){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x11dbae=_0x4d434d['user'],_0x46de75=this['_users']['getUser'](_0x11dbae['id'])||this['_createUser'](_0x11dbae),_0x278b8b=Object['assign']({},_0x4d434d,{'user':_0x46de75});this['channelSessions']['get'](_0x5e5bda)['add'](_0x278b8b);const _0x2f2741=this['channelConnectedUsers']['get'](_0x5e5bda);_0x2f2741['has'](_0x46de75['id'])||_0x2f2741['add'](_0x46de75),this['allConnectedUsers']['has'](_0x46de75['id'])||this['allConnectedUsers']['add'](_0x46de75,_0x46de75['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x5e5bda,{'channelId':_0x5e5bda,'session':_0x278b8b});}['_handleSessionRemove'](_0x4dd672,_0x448126){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x1ebcb2=this['channelConnectedUsers']['get'](_0x4dd672),_0x1ddd3a=_0x448126['user'];_0x1ddd3a['id']&&(this['channelSessions']['get'](_0x4dd672)['remove'](_0x448126['id']),_0x1ebcb2['has'](_0x1ddd3a['id'])&&!this['getUserSessions'](_0x1ddd3a,_0x4dd672)['size']&&_0x1ebcb2['remove'](_0x1ddd3a['id']),this['allConnectedUsers']['get'](_0x1ddd3a['id'])&&!this['getUserSessions'](_0x1ddd3a)['size']&&this['allConnectedUsers']['remove'](_0x1ddd3a['id']));}['_createUser'](_0x4590a5,_0xd57629){const _0x39210e=this['_users']['addUser'](_0x4590a5);return _0xd57629&&this['_users']['defineMe'](_0x4590a5['id']),_0x39210e['orderNumber']=this['_uniqueUsersCount']++,_0x39210e;}}class E extends _0x342830{['_domEmitter']=new(_0x2c0325())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x28f888=this['editor'],_0x23b847=_0x28f888['plugins']['get'](i);_0x28f888['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x25b6a2,{writer:_0x3cf73b})=>function(_0x1d9c0c,_0xa91095,_0x23e868,_0x4800e3){const _0x4231b7=_0x1d9c0c['markerName']['split'](':')[0x2],_0x1e48f2=_0x23e868['getUserBySessionId'](_0x4231b7);if(!_0x1e48f2||_0x4231b7===_0x23e868['mySessionId'])return;if(!_0x4800e3['model']['schema']['checkChild'](_0x1d9c0c['markerRange']['start'],'$text'))return;const _0x4f5d91={'class':'ck-user__marker\x20'+_0x1e48f2['color']['getMarkerClass'](),'data-name':_0x1e48f2['name'],'data-session-id':_0x4231b7},_0x5c4d48=_0x4800e3['model']['markers']['get'](_0x1d9c0c['markerName']),_0x41f46c=_0x5c4d48['getStart'](),_0x43238f=_0x41f46c['nodeAfter'],_0x534225=_0x4800e3['model']['schema'];if(_0x43238f&&_0x534225['isObject'](_0x43238f)&&_0x534225['isInline'](_0x43238f)&&!_0x4800e3['model']['markers']['get']('user:range:'+_0x4231b7)['getRange']()['isCollapsed'])return;const _0x1de52c=_0x41f46c['parent'];return _0x4800e3['model']['schema']['isLimit'](_0x1de52c)&&!_0x4800e3['model']['hasContent'](_0x1de52c)&&(_0x4f5d91['contenteditable']=!0x1),function(_0x222fde,_0x2e87d7,_0x5e1c9b){const _0x4ae875=_0x222fde['createUIElement']('span',_0x2e87d7);return _0x222fde['setCustomProperty']('userPositionMarker',!0x0,_0x4ae875),_0x4ae875['render']=function(_0x400dec){const _0x1ed0fc=this['toDomElement'](_0x400dec);return _0x1ed0fc['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x5e1c9b['name']+'</span>',_0x1ed0fc['addEventListener']('mouseenter',()=>{_0x1ed0fc['classList']['add']('ck-user__marker_hovered');}),_0x1ed0fc['addEventListener']('mouseleave',()=>{_0x1ed0fc['classList']['remove']('ck-user__marker_hovered');}),_0x1ed0fc;},_0x4ae875['isSimilar']=function(_0x18e57f){return!(!this['getCustomProperty']('userPositionMarker')||!_0x18e57f['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x18e57f['getAttribute']('data-session-id'));},_0x4ae875;}(_0xa91095,_0x4f5d91,_0x1e48f2);}(_0x25b6a2,_0x3cf73b,_0x23b847,_0x28f888)}),_0x28f888['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3d9a8f=>function(_0x5c43c7,_0x86221f){const _0x608e13=_0x5c43c7['markerName']['split'](':')[0x2];if(_0x608e13===_0x86221f['mySessionId'])return null;const _0x589c2e=_0x86221f['getUserBySessionId'](_0x608e13);if(!_0x589c2e)return{'id':_0x608e13,'classes':[]};return{'id':_0x608e13,'classes':['ck-user__selection',_0x589c2e['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x608e13},'priority':0x7d0+_0x589c2e['orderNumber']};}(_0x3d9a8f,_0x23b847)}),function(_0x4cfc4e){const _0x45d651=_0x4cfc4e['model'],_0x54339f=new Map(),_0x1522b4=_0x4cfc4e['plugins']['get'](i);_0x45d651['markers']['on']('update:user:range',(_0x36a311,_0x419d73,_0x5cbb0d,_0x4620cd)=>{if(!_0x4620cd&&_0x54339f['get'](_0x419d73['name']))return _0x54339f['get'](_0x419d73['name'])['detach'](),void _0x54339f['delete'](_0x419d73['name']);const _0x582500=_0x419d73['name']['split'](':')[0x2];if(_0x582500===_0x1522b4['mySessionId'])return;const _0x5eb715='user:position:'+_0x582500;_0x45d651['markers']['has'](_0x5eb715)&&_0x4cfc4e['editing']['reconvertMarker'](_0x5eb715),_0x419d73['on']('change:range',(_0x2363f1,_0x57967d,_0x1fabf6)=>{if('$graveyard'!=_0x57967d['root']['rootName']&&'$graveyard'==_0x419d73['getRange']()['root']['rootName']&&!_0x54339f['has'](_0x419d73['name'])){const _0x4a6d15=_0x45d651['schema']['getNearestSelectionRange'](_0x1fabf6['deletionPosition']);if(_0x4a6d15){const _0x252fd0=ut['fromRange'](_0x4a6d15);_0x54339f['set'](_0x419d73['name'],_0x252fd0),_0x252fd0['on']('change:range',(_0x435404,_0x3bac94,_0x372eb2)=>{if('$graveyard'==_0x252fd0['root']['rootName']){const _0x5b6b42=_0x45d651['schema']['getNearestSelectionRange'](_0x372eb2['deletionPosition']);_0x5b6b42?(_0x252fd0['start']=_0x5b6b42['start'],_0x252fd0['end']=_0x5b6b42['end']):(_0x54339f['delete'](_0x419d73['name']),_0x252fd0['detach']());}});}}});}),_0x45d651['document']['on']('change',()=>{_0x54339f['size']>0x0&&_0x45d651['enqueueChange']({'isUndoable':!0x1},_0x21c261=>{for(const [_0x1bcf2b,_0x3788e4]of _0x54339f)'$graveyard'==_0x45d651['markers']['get'](_0x1bcf2b)['getRange']()['root']['rootName']&&(Q(_0x1bcf2b['split'](':')[0x2],_0x3788e4['toRange'](),_0x45d651,_0x21c261),_0x3788e4['detach']());_0x54339f['clear']();});});}(_0x28f888),this['_domEmitter']['listenTo'](_0x288752['document'],'keydown',(_0x7af782,{key:_0x1ea882})=>{'Escape'===_0x1ea882&&function(_0x8d84fe){_0x8d84fe['editing']['view']['change'](_0x3a8353=>{for(const _0x55475c of _0x8d84fe['model']['markers']){if(!_0x55475c['name']['startsWith']('user:position'))continue;const _0x27b201=_0x8d84fe['editing']['mapper']['markerNameToElements'](_0x55475c['name']);if(_0x27b201){for(const _0x4f9ba2 of _0x27b201)_0x3a8353['removeClass']('ck-user__marker_hovered',_0x4f9ba2);}}});}(_0x28f888);},{'useCapture':!0x0});}['afterInit'](){const _0x4ab17a=this['editor'],_0x1bf34f=_0x4ab17a['commands']['get']('undo');_0x1bf34f&&_0x4ab17a['model']['on']('applyOperation',(_0x49dd80,_0x426b84)=>{const _0x1feb86=_0x426b84[0x0];if('marker'!=_0x1feb86['type']||!_0x1feb86['name']['startsWith']('user:'))return;const _0x4340da=_0x1feb86['batch'];_0x1bf34f['_createdBatches']['has'](_0x4340da)&&(_0x1feb86['newRange']=_0x1feb86['oldRange']?_0x4ab17a['model']['createRange'](_0x1feb86['oldRange']['start'],_0x1feb86['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x237364=this['editor'],_0x471eb1=_0x237364['model']['document'],_0x52b516=_0x237364['plugins']['get'](i);_0x237364['model']['enqueueChange']({'isUndoable':!0x1},_0x1d8f5e=>{const _0x4c4937='user:range:'+_0x52b516['mySessionId'],_0x3e4022='user:position:'+_0x52b516['mySessionId'],_0x3f8627=_0x237364['model']['markers']['has'](_0x4c4937);_0x237364['editing']['view']['hasDomSelection']?Q(_0x52b516['mySessionId'],_0x471eb1['selection']['getFirstRange'](),_0x237364['model'],_0x1d8f5e):_0x3f8627&&(_0x1d8f5e['removeMarker'](_0x4c4937),_0x1d8f5e['removeMarker'](_0x3e4022));});}}function Q(_0x5f20c6,_0x5916cf,_0x3ff761,_0x3e8a65){const _0x1fe50a='user:range:'+_0x5f20c6,_0x39025a='user:position:'+_0x5f20c6,_0x2d958a=_0x5916cf['getContainedElement']();let _0x4600ab=_0x5916cf['start'];_0x2d958a&&_0x2d958a['is']('element','tableCell')&&(_0x4600ab=function(_0x4b479a,_0x3f4dc4){for(const _0x561ccb of _0x4b479a['getPositions']())if(_0x3f4dc4['schema']['checkChild'](_0x561ccb,'$text'))return _0x561ccb;}(_0x5916cf,_0x3ff761),_0x5916cf=_0x3e8a65['createRange'](_0x4600ab));const _0x2472ce=_0x3e8a65['createRange'](_0x4600ab);_0x3ff761['markers']['has'](_0x1fe50a)?(_0x3e8a65['updateMarker'](_0x1fe50a,{'range':_0x5916cf}),_0x3e8a65['updateMarker'](_0x39025a,{'range':_0x2472ce})):(_0x3e8a65['addMarker'](_0x1fe50a,{'range':_0x5916cf,'usingOperation':!0x0}),_0x3e8a65['addMarker'](_0x39025a,{'range':_0x2472ce,'usingOperation':!0x0}));}function B(_0x4b374f,_0x77a663,_0x53ff1e){const _0x3a7917=_0x4b374f['t'],t=_0x4b374f['t'];switch(_0x77a663){case'PENDING_ACTION_SENDING_DATA':return t({'string':'Sending\x20data\x20to\x20the\x20server.','id':'PENDING_ACTION_SENDING_DATA'});case'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.':return t('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.');case'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':return t('The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');case'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.':return t('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.');case'Synchronization\x20issue':return t('Synchronization\x20issue');case'Connected\x20users\x20list\x20dropdown\x20menu':return t('Connected\x20users\x20list\x20dropdown\x20menu');case'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':return t('Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)');case'Connected\x20users\x20list':return t('Connected\x20users\x20list');case'PENDING_ACTION_REVISION_HISTORY':return _0x3a7917({'string':'Unsaved\x20change\x20in\x20revision\x20history.','id':'PENDING_ACTION_REVISION_HISTORY'});case'CONNECTED_USERS':return t({'string':'1\x20connected\x20user\x20(me)','plural':'%0\x20connected\x20users','id':'CONNECTED_USERS'},_0x53ff1e);default:return'';}}let F=0x1;class l extends _0x342830{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x17db4f)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,E,_0x1ae75e,_0x255773,_0x53b052];}static get['pluginName'](){return'RealTimeCollaborationClient';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['cloudDocumentVersion'](){return this['_lastServerVersion']+this['_offset'];}get['_lastServerVersion'](){return this['serverHistory']['version']-this['_offset'];}get['lastSyncVersion'](){const _0x1ff5e5=this['serverHistory']['getOperations']();for(let _0x58082b=_0x1ff5e5['length']-0x1;_0x58082b>=0x0;_0x58082b--){const _0x169149=_0x1ff5e5[_0x58082b];if(!this['_disconnectionOperations']['has'](_0x169149))return _0x169149['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x211127){if(super(_0x211127),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x81f02a(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x53fe02('collaboration-missing-channelid',this);const _0xb441af=_0x211127['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0xb441af,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x210a8e(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new G(this['_disconnectionOperations']);}['init'](){const _0x136429=this['editor'],_0x1cc4a2=_0x136429['plugins']['get'](_0x255773),_0x29e5fd=_0x136429['plugins']['get'](c);this['listenTo'](_0x1cc4a2,'getOperationAuthor',(_0x469d6a,_0x127ba6)=>{const _0x51ca2c=_0x127ba6[0x0];_0x51ca2c['_authorId']&&(_0x469d6a['return']=_0x1cc4a2['getUser'](_0x51ca2c['_authorId']),_0x469d6a['stop']()),null===_0x51ca2c['_authorId']&&(_0x469d6a['return']=null,_0x469d6a['stop']());},{'priority':'high'}),this['listenTo'](_0x136429['model']['document']['selection'],'change:range',(_0x3944ba,_0x49413c)=>{_0x49413c['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x136429['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x136429['model']['on']('applyOperation',(_0x597714,_0x4f15e1)=>{const _0x186410=_0x4f15e1[0x0];_0x186410['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x186410),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x29e5fd,'state',this,'_hasSynchronizationProblem',(_0x40c9d9,_0x2d18d0)=>'connected'===_0x40c9d9&&!_0x2d18d0),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x136429['disableReadOnlyMode']('rtc-offline'):_0x136429['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x136429['disableReadOnlyMode']('rtc-offline'):_0x136429['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x19d79c=this['editor']['plugins']['get'](i),_0x52b6a8=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x19d79c['unregister'](this['_channelId']);const _0x5ced09=await this['_service']['reconnect'](_0x52b6a8['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5ced09)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x49627f=await this['_service']['getConnectedSessions']();_0x19d79c['register'](this['_channelId'],_0x49627f),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x500ff7){if(function(_0x265cc7){return'404'===_0x265cc7['code'];}(_0x500ff7)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5e7941){return'409'===_0x5e7941['code'];}(_0x500ff7)){const _0x155c87=B(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x155c87);}else{if(!(_0x500ff7 instanceof H))throw _0x500ff7;this['_handleReconnectionError']();}}}}['destroy'](){const _0x4a38fc=this['editor']['plugins']['get'](c),_0x226370=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x226370['channelSessions']['has'](this['_channelId'])&&_0x226370['unregister'](this['_channelId']),_0x4a38fc['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x558f46){if(this['sessionId']!==_0x558f46['sessionId']&&this['_lastSyncedOperationId']!==_0x558f46['lastOperationId'])throw new H();return this['sessionId']=_0x558f46['sessionId'],this['_handleServerResponse']([],{..._0x558f46,'wereChangesApplied':!0x1,'data':_0x558f46['data']},'reconnect');}async['_connectService'](_0x5d28c1,_0x4a0809=!0x1){const {connection:_0x2a6a78}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2a6a78,this['_channelId'])['then'](_0x51d43c=>this['_initSessionsHandling'](_0x51d43c))['catch'](_0x4c8fdc=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4c8fdc);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4de652,_0x8db249)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x8db249);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x784c9e=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5d28c1);this['_isPendingUpdate']=!0x0;const _0x1665cf=await this['_service']['connect'](_0x2a6a78,this['_compressOperations'](_0x5d28c1),_0x784c9e);if(this['sessionId']=_0x1665cf['sessionId'],_0x4a0809){if(!_0x1665cf['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x1665cf['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x5d28c1,_0x1665cf,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x1665cf,_0x5d28c1);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1cb253=this['editor']['plugins']['get'](i),_0x138d18=this['editor']['plugins']['get'](E),_0x32cfba=_0x1cb253['channelSessions']['get'](this['_channelId']);_0x32cfba&&_0x32cfba['length']>0x1?_0x138d18['createUserMarkerOperations']():this['listenTo'](_0x1cb253,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1cb253['channelSessions']['get'](this['_channelId'])['length']&&_0x138d18['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x38c915,_0x1c9243,_0x1a066b,_0x26db35){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1c9243){const _0x1d7896=this['_decompressOperations'](_0x1a066b,_0x26db35);await this['_fetchMissingUsers'](_0x1d7896),this['_handleExternalOperations'](_0x1d7896,_0x1c9243,_0x1a066b['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x169f4a}=this['editor'];let _0x4d9106;try{_0x4d9106=await this['_service']['getDocumentDetails']();}catch(_0x559afd){const _0x5c4329=B(_0x169f4a,'The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x5c4329);}const _0x157013=_0x4d9106['currentDocumentSession']||_0x4d9106['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x157013['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x2c6077=B(_0x169f4a,'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.');this['_handleReconnectionError'](_0x2c6077);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x5a7807){const _0x4a7410=this['editor']['plugins']['get'](i);this['listenTo'](_0x4a7410,'sessionAdd:'+this['_channelId'],(_0x4e5319,{session:_0x24c1c0})=>{if(_0x24c1c0['id']===_0x4a7410['mySessionId']){_0x4e5319['off']();const _0x4cbda0=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4d3f5e=_0x24c1c0['permissions'];_0x4cbda0&&_0x4cbda0['isEnabled']&&(_0x4d3f5e=_0x4d3f5e['filter'](_0x14bdbd=>'document:write'!==_0x14bdbd)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4d3f5e,this['_channelId']);}}),_0x4a7410['register'](this['_channelId'],_0x5a7807);}['_initThrowingOnDataSet'](){const _0x5a65cd=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x75238f)=>{if(!_0x75238f[_0x75238f['length']-0x1]['suppressErrorInCollaboration'])throw new _0x53fe02('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5a65cd['apply'](this['editor']['data'],_0x75238f);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2c1e25,[_0x7ef386])=>{if(this['_document']['version'])throw new _0x53fe02('realtimecollaborationclient-init-document-already-initialized',this);_0x2c1e25['stop'](),this['_setPendingAction']();const _0x57802e=this['editor']['config']['get']('rootsAttributes'),_0x243b86=this['_getOperationsFromInitData'](_0x7ef386,_0x57802e);0x0==_0x243b86['length']&&_0x243b86['push'](new _0x13b973(0x0)),_0x2c1e25['return']=this['_connectService'](_0x243b86)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x255f77=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x255f77))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x419b4a,[_0x9867e2,_0x5e94bb])=>{_0x419b4a['stop']();const _0x3b467f=this['editor']['model']['document']['getRoot'](_0x9867e2);if(!this['_knownRootNames']['has'](_0x9867e2)){const _0x515e1f=_0x5e94bb&&_0x5e94bb['data']?_0x5e94bb['data']:'',_0x4a119f=_0x5e94bb&&_0x5e94bb['attributes']?_0x5e94bb['attributes']:{};await this['_loadRoot'](_0x9867e2,_0x515e1f,_0x4a119f);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3b467f['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3b467f);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x2d12bb){const _0x35b7a4=this['editor']['plugins']['get'](_0x255773),{connection:_0x40f49c}=this['editor']['plugins']['get'](c),_0x14fdf2=new Set();for(const _0xaf8fc9 of _0x2d12bb){const _0x3a952d=_0xaf8fc9['_authorId'];_0x3a952d&&!_0x35b7a4['getUser'](_0x3a952d)&&_0x14fdf2['add'](_0x3a952d);}if(0x0===_0x14fdf2['size'])return;const _0x175d7c=await mt['getMany'](_0x40f49c,Array['from'](_0x14fdf2));for(const _0xfb0066 of _0x175d7c)_0x35b7a4['getUser'](_0xfb0066['id'])||_0x35b7a4['addUser'](_0xfb0066);}['_getOperationsFromInitData'](_0x33f736,_0x5b11c3={}){const _0x406b2b=this['editor']['model'],_0x4964e4=[];let _0x38582f=0x0;const _0x247317='string'==typeof _0x33f736?{'main':_0x33f736}:_0x33f736;for(const _0x3b3ee2 of Object['keys'](_0x247317)){if(!this['_document']['roots']['has'](_0x3b3ee2))throw new _0x53fe02('realtimecollaborationclient-init-non-existent-root',this);const _0x2bf06e=this['editor']['data']['parse'](_0x247317[_0x3b3ee2]),_0x46c393=this['_document']['getRoot'](_0x3b3ee2),_0x375720=new _0x89b830(_0x406b2b['createPositionAt'](_0x46c393,0x0),_0x2bf06e,_0x38582f++);_0x4964e4['push'](_0x375720);for(const [_0x351e3e,_0x550e08]of _0x2bf06e['markers']){const _0x35ccc0=_0x406b2b['createRange'](_0x406b2b['createPositionFromPath'](_0x46c393,_0x550e08['start']['path']['slice']()),_0x406b2b['createPositionFromPath'](_0x46c393,_0x550e08['end']['path']['slice']())),_0x4938ac=new _0x3bf37d(_0x351e3e,null,_0x35ccc0,_0x406b2b['markers'],!0x0,_0x38582f++);_0x4964e4['push'](_0x4938ac);}}if(_0x5b11c3)for(const [_0x809c1f,_0x204f29]of Object['entries'](_0x5b11c3)){const _0xde6942=_0x406b2b['document']['getRoot'](_0x809c1f);if(!_0xde6942)throw new _0x53fe02('multi-root-editor-root-attributes-no-root',null);for(const [_0x221793,_0x31c472]of Object['entries'](_0x204f29))if(null!==_0x31c472){const _0x1cc470=new _0x1b198c(_0xde6942,_0x221793,null,_0x31c472,_0x38582f++);_0x4964e4['push'](_0x1cc470);}}return _0x4964e4;}async['_loadRoot'](_0xedaa4d,_0x5a4ade,_0x24f4f4){this['_getOperationsFromInitData']({[_0xedaa4d]:_0x5a4ade},{[_0xedaa4d]:_0x24f4f4})['forEach']((_0x1f7089,_0x1ddfa9)=>{_0x1f7089['baseVersion']=this['_document']['version']+_0x1ddfa9,_0x1f7089['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x1f7089);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5b6ec8,_0x13059d){let _0xc19d52;this['_offset']=_0x5b6ec8['offset'];const _0x56ec3e=_0x5b6ec8['wereChangesApplied']&&!_0x5b6ec8['initData'],_0x30c2e3=_0x56ec3e?0x0:_0x5b6ec8['data']['baseVersion'];if(_0x13059d['forEach'](_0xc29168=>{_0xc29168['_isInit']=!0x0,_0xc29168['createdAt']=_0x5b6ec8['sessionCreatedAt'],_0xc29168['_authorId']=null;}),_0x56ec3e)_0xc19d52=_0x13059d,this['_applyOperationsSet'](_0xc19d52,_0x56ec3e);else{if(_0x5b6ec8['initData']){const _0x4e2a6b=this['_getOperationsFromInitData'](_0x5b6ec8['initData']);this['_document']['history']['version']=-_0x4e2a6b['length'],_0x4e2a6b['forEach'](_0x559b68=>{_0x559b68['baseVersion']-=_0x4e2a6b['length'],_0x559b68['createdAt']=_0x5b6ec8['sessionCreatedAt'],_0x559b68['_isInit']=!0x0,_0x559b68['_authorId']=null;}),this['_applyOperationsSet'](_0x4e2a6b,!0x0),this['serverHistory']['version']=-_0x4e2a6b['length']+this['_offset'],this['_updateServerHistory'](_0x4e2a6b);}this['_document']['history']['version']=_0x30c2e3,_0xc19d52=this['_decompressOperations'](_0x5b6ec8['data'],_0x5b6ec8['metadata']),await this['_fetchMissingUsers'](_0xc19d52),this['_applyOperationsSet'](_0xc19d52,_0x56ec3e);}_0x5b6ec8['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xc19d52,_0x5b6ec8['lastOperationId']),this['_lastSyncedOperationId']=_0x5b6ec8['lastOperationId']),this['serverHistory']['version']=_0x30c2e3+this['_offset'],this['_updateServerHistory'](_0xc19d52),_0x13059d['filter'](_0x1b7653=>{const _0x48accf=this['_getAffectedRoot'](_0x1b7653);return _0x48accf&&!this['_knownRootNames']['has'](_0x48accf);})['forEach']((_0x229ce2,_0x37c4f6)=>{_0x229ce2['baseVersion']=this['_document']['version']+_0x37c4f6,this['_saveOperationInBuffer'](_0x229ce2);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x551013,_0x43e17a,_0x2c8fb4){throw this['_isPendingUpdate']=!0x0,_0x43e17a&&console['error'](_0x43e17a),_0x2c8fb4&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x53fe02(_0x551013,this['editor']);}['_saveOperationInBuffer'](_0x56b2ab){this['_knownOperations']['has'](_0x56b2ab)||(this['_knownOperations']['add'](_0x56b2ab),this['_bufferedOperations']['push'](_0x56b2ab),this['_pendingAction']||'marker'==_0x56b2ab['type']&&!_0x56b2ab['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x28fca6=!0x1){!_0x28fca6&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2515e3=>{_0x2515e3&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3aef30=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x51e7b9){return _0x51e7b9['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x51e7b9['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x51e7b9['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3aef30)||this['_crash'](_0x3aef30['message'],_0x3aef30,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x16e95d=>{this['on']('change:_isPendingUpdate',()=>{_0x16e95d();});});}async['_sendBufferedOperations'](){const _0x3fd9da=this['editor']['plugins']['get'](E);if(this['_shouldSendSelectionUpdate']()&&(_0x3fd9da['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1215a3=[...this['_bufferedOperations']];for(const _0x1a57d1 of _0x1215a3)_0x1a57d1['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1a57d1);const _0x5713b7=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1215a3),_0x1d9c39=F++,_0x4904c6=this['_compressOperations'](_0x1215a3),_0x2c17b6=await this['_service']['sendOperations'](_0x4904c6,_0x4904c6['baseVersion'],_0x5713b7);try{return await this['_handleServerResponse'](_0x1215a3,_0x2c17b6,_0x1d9c39);}catch(_0x545a2a){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x545a2a);}}async['_handleServerResponse'](_0x46e5da,_0xbaf731,_0x3c1fa2){if('error'in _0xbaf731)throw _0xbaf731['error'];let _0xabda16=!0x1;if(_0xbaf731['wereChangesApplied']){_0xbaf731['lastOperationId']&&(this['_lastSyncedOperationId']=_0xbaf731['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2b7f58=>!_0x46e5da['includes'](_0x2b7f58));for(const _0x1318fe of _0x46e5da)_0x1318fe['createdAt']='lastOperationAcceptedAt'in _0xbaf731&&_0xbaf731['lastOperationAcceptedAt']||void 0x0;q(_0x46e5da,_0xbaf731['version']-_0x46e5da['length']),this['_updateServerHistory'](_0x46e5da);const _0x301181=_0x46e5da['filter'](_0x36b384=>{if(!_0x36b384['_isInit'])return!0x1;const _0x573b40=this['_getAffectedRoot'](_0x36b384);return _0x573b40&&!this['_knownRootNames']['has'](_0x573b40);});q(_0x301181,this['_document']['version']),this['_applyOperationsSet'](_0x301181),_0xabda16=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x163bcf=this['_decompressOperations'](_0xbaf731['data'],_0xbaf731['metadata'])['filter'](_0x4bdb95=>_0x4bdb95['baseVersion']>=this['_lastServerVersion']);_0x163bcf['forEach'](_0x13a8fe=>this['_addKnownRoot'](_0x13a8fe)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5847e3=>!_0x5847e3['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5847e3))),this['_bufferedOperations']['length']&&q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x163bcf),_0xabda16=this['_handleExternalOperations'](_0x163bcf,_0xbaf731['version'],_0xbaf731['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0xabda16?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x13bdc0,_0x1ff581,_0x413178){try{const _0x2932a8={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x308715,operationsB:_0x28b2f3,originalOperations:_0x4b58f8}=_0x34975a(_0x13bdc0,this['_bufferedOperations'],_0x2932a8);q(_0x308715,this['_document']['version']),q(_0x28b2f3,_0x1ff581);for(const _0x1d0a98 of _0x308715){const _0x308f6c=_0x4b58f8['get'](_0x1d0a98);_0x1d0a98['_authorId']=_0x308f6c?_0x308f6c['_authorId']:null;}_0x413178&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x13bdc0,_0x413178),this['_lastSyncedOperationId']=_0x413178),this['_bufferedOperations']=[..._0x28b2f3],this['_applyOperationsSet'](_0x308715),this['_updateServerHistory'](_0x13bdc0);}catch(_0x59b2e8){return console['error'](_0x59b2e8),!0x1;}return!0x0;}['_applyOperationsSet'](_0x13bfa1,_0x1b5fa1=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x718bf8=>{for(const _0x4d2871 of _0x13bfa1)this['_knownOperations']['add'](_0x4d2871),this['_addKnownRoot'](_0x4d2871),_0x718bf8['batch']['addOperation'](_0x4d2871),this['editor']['model']['applyOperation'](_0x4d2871);});}['_addKnownRoot'](_0x1ea19b){const _0x58e2e2=this['_getAffectedRoot'](_0x1ea19b);_0x58e2e2&&this['_knownRootNames']['add'](_0x58e2e2);}['_getAffectedRoot'](_0x1f8e77){let _0x2123c5,_0x4690a8;switch(_0x1f8e77['type']){case'insert':_0x2123c5=_0x1f8e77['position']['root'];break;case'marker':if(_0x4690a8=_0x1f8e77['newRange'],!_0x4690a8)return null;_0x2123c5=_0x4690a8['root'];break;case'addRootAttribute':_0x2123c5=_0x1f8e77['root'];break;case'addRoot':_0x2123c5=_0x1f8e77['affectedSelectable'];break;case'move':_0x2123c5=_0x1f8e77['targetPosition']['root'];break;default:return null;}return _0x2123c5['rootName'];}['_updateServerHistory'](_0x4b88bf){_0x4b88bf['forEach'](_0x311f97=>{const _0x4fd64a=_0x311f97['clone']();_0x4fd64a['_authorId']=_0x311f97['_authorId'],_0x4fd64a['_isInit']=!!_0x311f97['_isInit'],_0x4fd64a['createdAt']=_0x311f97['createdAt'],_0x4fd64a['baseVersion']+=this['_offset'],_0x311f97['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4fd64a),this['serverHistory']['addOperation'](_0x4fd64a);});}['_handleReconnectionError'](_0x1a2f41){const _0x59b817=this['editor']['plugins']['get']('Notification'),_0x115040=this['editor']['locale'];_0x1a2f41||(_0x1a2f41=B(_0x115040,'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.')),_0x59b817['showWarning'](_0x1a2f41,{'title':B(_0x115040,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x1ae75e)['add'](B(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1ae75e)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x10abf4){const _0x5e2ee5=_0x10abf4['map'](_0x48113f=>_0x48113f['toJSON']());return this['_compressor']['compress'](_0x5e2ee5);}['_decompressOperations'](_0x2687bc,_0x439ad7){return this['_compressor']['decompress'](_0x2687bc)['map']((_0x9a625c,_0x30b9fc)=>{const _0x14b68b='init'==_0x439ad7[_0x30b9fc]['type'];if('InsertOperation'==_0x9a625c['__className']){const _0xe8f54d=_0x9a625c['position']['root'];!this['_document']['getRoot'](_0xe8f54d)&&(this['_document']['createRoot']('$root',_0xe8f54d)['_isAttached']=!0x1);}const _0x3d5d1b=_0x353046['fromJSON'](_0x9a625c,this['_document']);return _0x3d5d1b['wasUndone']=_0x9a625c['wasUndone'],_0x3d5d1b['_isInit']=_0x14b68b,_0x3d5d1b['_authorId']=_0x14b68b?null:_0x439ad7[_0x30b9fc]['userId'],_0x3d5d1b['_isDisconnection']='cs:removeUser'===_0x439ad7[_0x30b9fc]['type'],_0x3d5d1b['createdAt']=_0x439ad7[_0x30b9fc]['createdAt'],_0x3d5d1b;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5733c3=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5733c3&&_0x5733c3['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class H extends Error{}function q(_0x15c6e6,_0x4b5af0){for(const _0x9b8f08 of _0x15c6e6)_0x9b8f08['baseVersion']=_0x4b5af0++;}class G{['_ignoredOperations'];['_operationToId'];constructor(_0x22e38b){this['_ignoredOperations']=_0x22e38b,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4d213a){let _0x19cbef=_0x4d213a['length'];for(;_0x19cbef--;){const _0x57bc59=_0x4d213a[_0x19cbef];if(!this['_ignoredOperations']['has'](_0x57bc59)){if(!this['_operationToId']['has'](_0x57bc59)){const _0x4045e3=_0x349317()['slice'](0x1,0x12);this['_operationToId']['set'](_0x57bc59,_0x4045e3);}return this['_operationToId']['get'](_0x57bc59);}}}['setIdForTheLastOperation'](_0xc7509,_0x281e7e){if(!_0x281e7e)return;let _0x59d472=_0xc7509['length'];for(;_0x59d472--;){const _0x1db38b=_0xc7509[_0x59d472];this['_ignoredOperations']['has'](_0x1db38b)||this['_operationToId']['set'](_0x1db38b,_0x281e7e);}}}class n extends _0x342830{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x2b0246{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>tt)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x255773];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x18d574){super(_0x18d574),this['_services']=new Map();}async['init'](){const _0x2e6803=this['context'],_0x13c7fd=_0x2e6803['plugins']['get']('CommentsRepository');if(_0x2e6803['plugins']['get'](c)['addToReconnectionStack'](this),_0x13c7fd['adapter']={'addCommentThread':async({channelId:_0x4f60f7,threadId:_0x59991b,comments:_0x260757,resolvedAt:_0x11c646,resolvedBy:_0x4b4e7f,context:_0x34e384,attributes:_0x1d4d95})=>{const _0x306b95=await this['_getService'](_0x4f60f7)['addCommentThread']({'commentThreadId':_0x59991b,'comments':_0x260757['map'](_0x44a15f=>function(_0x45a6e2,_0x52123e,_0x4dd61a){return{'commentThreadId':_0x4dd61a,'commentId':_0x45a6e2['commentId'],'userId':_0x45a6e2['authorId'],'content':_0x45a6e2['content'],'documentId':_0x52123e,'createdAt':_0x45a6e2['createdAt'],'attributes':_0x45a6e2['attributes']||{}};}(_0x44a15f,_0x4f60f7,_0x59991b)),'resolvedAt':_0x11c646,'resolvedBy':_0x4b4e7f,'context':_0x34e384,'attributes':_0x1d4d95})['catch'](gt);return{'threadId':_0x306b95['commentThreadId'],'comments':_0x306b95['comments']};},'getCommentThread':async({channelId:_0x33ac5a,threadId:_0x4d7186})=>{const _0x2185aa=await this['_getService'](_0x33ac5a)['getCommentThread'](_0x4d7186)['catch'](gt);return _0x2185aa['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2185aa]),{'threadId':_0x2185aa['commentThreadId'],'comments':_0x2185aa['comments']['map'](nt),'context':_0x2185aa['context'],'resolvedAt':_0x2185aa['resolvedAt'],'resolvedBy':_0x2185aa['resolvedBy'],'attributes':_0x2185aa['attributes']||{}});},'updateCommentThread':async({channelId:_0x103738,threadId:_0x4c1614,context:_0x16f801,unlinkedAt:_0xea093a,attributes:_0x17f21c})=>this['_getService'](_0x103738)['updateCommentThread']({'commentThreadId':_0x4c1614,'context':_0x16f801,'attributes':_0x17f21c,'unlinkedAt':_0xea093a})['catch'](et)['catch'](gt),'resolveCommentThread':async({channelId:_0x304092,threadId:_0xdf6672})=>{const _0x1bc210=await this['_getService'](_0x304092)['resolveCommentThread'](_0xdf6672)['catch'](et)['catch'](gt);return{'threadId':_0x1bc210['commentThreadId'],'resolvedAt':_0x1bc210['resolvedAt'],'resolvedBy':_0x1bc210['resolvedBy']};},'reopenCommentThread':async({channelId:_0xe5828b,threadId:_0x4bd54c})=>this['_getService'](_0xe5828b)['reopenCommentThread'](_0x4bd54c)['catch'](et)['catch'](gt),'removeCommentThread':({channelId:_0x580460,threadId:_0x5859a3})=>this['_getService'](_0x580460)['removeCommentThread'](_0x5859a3)['catch'](et)['catch'](gt),'addComment':({channelId:_0x202753,threadId:_0xf580c4,commentId:_0x1db225,content:_0x367739,attributes:_0x2cc9e7})=>this['_getService'](_0x202753)['addComment'](_0xf580c4,_0x1db225,_0x367739,_0x2cc9e7)['catch'](gt),'updateComment':({channelId:_0x41b585,threadId:_0x2de0b6,commentId:_0x44efb5,content:_0x4e72f8,attributes:_0xefc3f7})=>this['_getService'](_0x41b585)['updateComment'](_0x2de0b6,_0x44efb5,_0x4e72f8,_0xefc3f7)['catch'](et)['catch'](gt),'removeComment':({channelId:_0x5919a2,threadId:_0x253954,commentId:_0x1da6bb})=>this['_getService'](_0x5919a2)['removeComment'](_0x253954,_0x1da6bb)['catch'](et)['catch'](gt)},_0x2e6803 instanceof _0x4b2ff7){const _0x161f33=_0x2e6803['config']['get']('collaboration.channelId'),_0x50201d=_0x2e6803['plugins']['get'](i);await this['_setUpService'](_0x161f33);const _0xf98303=await this['_services']['get'](_0x161f33)['getConnectedSessions']();this['listenTo'](_0x50201d,'sessionAdd:'+_0x161f33,(_0x5a1626,{session:_0x2ac378})=>{_0x2ac378['id']===_0x50201d['mySessionId']&&(_0x5a1626['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2ac378['permissions'],_0x161f33));}),_0x50201d['register'](_0x161f33,_0xf98303);}}async['_setUpService'](_0x4d3d8f){if(this['_services']['has'](_0x4d3d8f))throw new _0x53fe02('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4d3d8f});const _0x77686d=this['context']['plugins']['get']('CommentsRepository'),_0x35d19f=new a['CommentsService'](_0x4d3d8f);this['_services']['set'](_0x4d3d8f,_0x35d19f),this['listenTo'](_0x35d19f,'commentThreadAdded',(_0x11c50d,_0x52d50c)=>{const {commentThreadId:_0x131b23,documentId:_0x13f5fe,context:_0x188a05,attributes:_0x1cbeea,resolvedAt:_0x276a53,resolvedBy:_0x4e68c4,comments:_0x384cc1}=_0x52d50c;_0x77686d['getCommentThread'](_0x131b23)||_0x77686d['addCommentThread']({'threadId':_0x131b23,'channelId':_0x13f5fe,'comments':_0x384cc1?_0x384cc1['map'](nt):[],'context':_0x188a05,'attributes':_0x1cbeea,'resolvedAt':_0x276a53,'resolvedBy':_0x4e68c4,'isFromAdapter':!0x0});}),this['listenTo'](_0x35d19f,'commentThreadUpdated',(_0x2e23ba,{commentThreadId:_0x11962c,documentId:_0x8ba7d3,context:_0xf354b0,unlinkedAt:_0x4052e0,attributes:_0x54dfb9})=>{_0x77686d['getCommentThread'](_0x11962c)&&_0x77686d['updateCommentThread']({'threadId':_0x11962c,'channelId':_0x8ba7d3,'context':_0xf354b0,'unlinkedAt':_0x4052e0,'attributes':_0x54dfb9,'isFromAdapter':!0x0});}),this['listenTo'](_0x35d19f,'commentThreadResolved',(_0x187dc2,{commentThreadId:_0x5be490,resolvedBy:_0x5dfc9f,resolvedAt:_0xa11637})=>{const _0xdbcba8=_0x77686d['getCommentThread'](_0x5be490);_0xdbcba8&&_0xdbcba8['resolve']({'resolvedBy':_0x5dfc9f,'resolvedAt':_0xa11637,'isFromAdapter':!0x0});}),this['listenTo'](_0x35d19f,'commentThreadReopened',(_0x2c03a5,{commentThreadId:_0x20565e})=>{const _0x301f5b=_0x77686d['getCommentThread'](_0x20565e);_0x301f5b&&_0x301f5b['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35d19f,'commentThreadRemoved',(_0x274af2,{commentThreadId:_0x4f1ae2})=>{const _0x2c00b8=_0x77686d['getCommentThread'](_0x4f1ae2);_0x2c00b8&&_0x2c00b8['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35d19f,'commentAdded',(_0x530ff7,_0x5c2072)=>{const _0x57c34a=_0x5c2072['commentThreadId'],_0x3fa9e4=_0x77686d['getCommentThread'](_0x57c34a);_0x3fa9e4&&_0x3fa9e4['addComment']({...nt(_0x5c2072),'isFromAdapter':!0x0});}),this['listenTo'](_0x35d19f,'commentUpdated',(_0x57fa91,{commentThreadId:_0x459aef,commentId:_0x548417,content:_0x46ee65,attributes:_0x4b116c})=>{const _0x192f33=_0x77686d['getCommentThread'](_0x459aef);if(_0x192f33){const _0x4f1b15=_0x192f33['getComment'](_0x548417);_0x4f1b15&&_0x4f1b15['update']({'content':_0x46ee65,'attributes':_0x4b116c,'isFromAdapter':!0x0});}}),this['listenTo'](_0x35d19f,'commentRemoved',(_0x248bd4,{commentThreadId:_0xa4524,commentId:_0x33addc})=>{const _0x379f09=_0x77686d['getCommentThread'](_0xa4524);if(_0x379f09){const _0xdba278=_0x379f09['getComment'](_0x33addc);_0xdba278&&_0xdba278['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4d3d8f);}['destroy'](){if(this['context']instanceof _0x4b2ff7){const _0x3c5c2b=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3c5c2b);}}['_terminateService'](_0x39eb5a){if(!this['_services']['has'](_0x39eb5a))throw new _0x53fe02('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x39eb5a});this['_getService'](_0x39eb5a)['disconnect'](),this['_services']['delete'](_0x39eb5a);}async['reconnect'](){for(const _0x1b2bd8 of this['_services']['keys']())await this['_connectService'](_0x1b2bd8);if(this['context']instanceof _0x4b2ff7){const _0x327871=this['context']['config']['get']('collaboration.channelId'),_0x5ddb04=this['context']['plugins']['get'](i);_0x5ddb04['unregister'](_0x327871);const _0x3987d6=await this['_services']['get'](_0x327871)['getConnectedSessions']();_0x5ddb04['register'](_0x327871,_0x3987d6);}}async['_connectService'](_0x39e796){const {connection:_0x30ac81}=this['context']['plugins']['get'](c),_0x54fc29=this['context']['plugins']['get']('CommentsRepository'),_0x4ab463=this['_services']['get'](_0x39e796),_0x1dc4f2=await _0x4ab463['connect'](_0x30ac81);await this['_fetchMissingUsersForThreads'](_0x1dc4f2);const _0x3d4a90=new Set(Array['from'](_0x54fc29['getCommentThreads']({'channelId':_0x39e796}),_0x5d38bb=>_0x5d38bb['id']));for(const _0x8abb76 of _0x1dc4f2)_0x8abb76['deletedAt']||_0x3d4a90['delete'](_0x8abb76['commentThreadId']);for(const _0x56bcb4 of _0x3d4a90)_0x54fc29['getCommentThread'](_0x56bcb4)['remove']({'isFromAdapter':!0x0});for(const _0x23a00e of _0x1dc4f2){let _0x12d394=_0x54fc29['getCommentThread'](_0x23a00e['commentThreadId']);const {commentThreadId:_0x4e34ee,context:_0x400541,attributes:_0x1138b0,resolvedBy:_0x5df1e5,resolvedAt:_0x4c8868,unlinkedAt:_0x31a893,deletedAt:_0x35c891}=_0x23a00e;if(_0x35c891)continue;_0x12d394||(_0x12d394=_0x54fc29['addCommentThread']({'channelId':_0x39e796,'threadId':_0x4e34ee,'context':_0x400541,'attributes':_0x1138b0||{},'resolvedBy':_0x5df1e5,'resolvedAt':_0x4c8868,'unlinkedAt':_0x31a893,'isFromAdapter':!0x0}));const _0x55a06f=new Set(Array['from'](_0x12d394['comments'],_0x4c51d9=>_0x4c51d9['id']));for(const _0x3cf799 of _0x23a00e['comments'])_0x55a06f['delete'](_0x3cf799['commentId']);for(const _0x50059d of _0x55a06f)_0x12d394['getComment'](_0x50059d)['remove']({'isFromAdapter':!0x0});for(const _0x23ae08 of _0x23a00e['comments']){const _0x6457b8=_0x12d394['getComment'](_0x23ae08['commentId']);_0x6457b8?_0x6457b8['content']!==_0x23ae08['content']&&_0x6457b8['update']({'content':_0x23ae08['content'],'isFromAdapter':!0x0}):_0x12d394['addComment'](Object['assign'](nt(_0x23ae08),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5a1468){if(!this['_services']['has'](_0x5a1468))throw new _0x53fe02('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5a1468});return this['_services']['get'](_0x5a1468);}async['_fetchMissingUsersForThreads'](_0x3191c7){const _0x4d9a84=this['context']['plugins']['get'](_0x255773),{connection:_0x39de39}=this['context']['plugins']['get'](c),_0x524707=new Set();for(const {resolvedBy:_0x330f73,comments:_0x36479c}of _0x3191c7){_0x330f73&&!_0x4d9a84['getUser'](_0x330f73)&&_0x524707['add'](_0x330f73);for(const {userId:_0x70b8f8}of _0x36479c)_0x4d9a84['getUser'](_0x70b8f8)||_0x524707['add'](_0x70b8f8);}if(0x0===_0x524707['size'])return;const _0x5a64e3=await mt['getMany'](_0x39de39,Array['from'](_0x524707));for(const _0x49f363 of _0x5a64e3)_0x4d9a84['getUser'](_0x49f363['id'])||_0x4d9a84['addUser'](_0x49f363);}}async function et(_0x181b3f){if('404'!==_0x181b3f['code'])throw _0x181b3f;}function gt(_0x3839d6){if((_0x18ba51=_0x3839d6)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x18ba51['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x18ba51['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x18ba51;throw _0x3839d6;}function nt(_0x1f98c6){return{'threadId':_0x1f98c6['commentThreadId'],'commentId':_0x1f98c6['commentId'],'content':_0x1f98c6['content'],'createdAt':_0x1f98c6['createdAt'],'authorId':_0x1f98c6['userId'],'attributes':_0x1f98c6['attributes']||{}};}class f extends _0x342830{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1fdf59){super(_0x1fdf59);const _0x24ea18=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x24ea18);}['init'](){const _0x436980=this['editor']['plugins']['get'](c),_0x50759c=this['editor']['plugins']['get']('TrackChangesEditing');return _0x50759c['adapter']={'getSuggestion':async _0x8f1ea=>{await this['_waitForServiceReady']();const _0x109ad4=await this['_trackChangesService']['get'](_0x8f1ea)['catch'](ot);return await this['_fetchMissingUsersForThreads']([_0x109ad4]),_0x109ad4;},'addSuggestion':async({id:_0x3e82cd,type:_0x2d1c1c,data:_0x542c0a,originalSuggestionId:_0x38e02f,attributes:_0x251891})=>{await this['_waitForServiceReady']();const _0x5e4c4f={'id':_0x3e82cd,'type':_0x2d1c1c,'data':_0x542c0a,'originalSuggestionId':_0x38e02f,'attributes':_0x251891},_0x5d431c=await this['_trackChangesService']['add'](_0x3e82cd,_0x2d1c1c,_0x542c0a,_0x38e02f,_0x251891)['catch'](_0x2c81c4=>{if(wt(_0x2c81c4))return new Promise(_0x226440=>{this['_bufferedRequests']['set'](_0x3e82cd,{'resolve':_0x226440,'suggestionData':_0x5e4c4f});});throw _0x2c81c4;});return this['_bufferedRequests']['delete'](_0x3e82cd),_0x5d431c;},'updateSuggestion':async(_0x3a16cd,_0x4a8f04)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4a8f04['state'])return this['_trackChangesService']['update'](_0x3a16cd,_0x4a8f04)['catch'](ot);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x55b385,_0x52ad99)=>{_0x50759c['hasSuggestion'](_0x52ad99['id'])&&(_0x50759c['getSuggestion'](_0x52ad99['id'])['attributes']=_0x52ad99['attributes']);}),this['_trackChangesService']['connect'](_0x436980['connection'])['then'](_0x3a9499=>(_0x436980['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x3a9499)['then'](()=>{for(const _0x5d0657 of _0x3a9499){_0x50759c['addSuggestionData'](_0x5d0657)['_saved']=!0x0;}})));}async['reconnect'](){const _0xf12bab=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x48b5a6}=this['editor']['plugins']['get'](c),_0x1b84dc=await this['_trackChangesService']['connect'](_0x48b5a6);await this['_fetchMissingUsersForThreads'](_0x1b84dc);for(const {suggestionData:_0x1a118d,resolve:_0x18ef1b}of this['_bufferedRequests']['values']()){let _0x236124=_0x1b84dc['find'](_0x4e59aa=>_0x4e59aa['id']===_0x1a118d['id']);_0x236124||(_0x236124=await this['_trackChangesService']['add'](_0x1a118d['id'],_0x1a118d['type'],_0x1a118d['data'],_0x1a118d['originalSuggestionId'])),_0x18ef1b(_0x236124);}for(const _0x1d92de of _0x1b84dc)_0xf12bab['hasSuggestion'](_0x1d92de['id'])||_0xf12bab['addSuggestionData'](_0x1d92de);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2e9971=>{this['listenTo'](this['_trackChangesService'],'connected',_0x115b03=>{_0x115b03['off'](),_0x2e9971();});});}async['_fetchMissingUsersForThreads'](_0x5e1ae1){const _0xbf5d69=this['editor']['plugins']['get'](_0x255773),{connection:_0x1ff57b}=this['editor']['plugins']['get'](c),_0x2b6995=new Set();for(const {authorId:_0x14f4be}of _0x5e1ae1)_0xbf5d69['getUser'](_0x14f4be)||_0x2b6995['add'](_0x14f4be);if(0x0===_0x2b6995['size'])return;const _0x287456=await mt['getMany'](_0x1ff57b,Array['from'](_0x2b6995));for(const _0x248824 of _0x287456)_0xbf5d69['getUser'](_0x248824['id'])||_0xbf5d69['addUser'](_0x248824);}}function ot(_0x4d1415){if(wt(_0x4d1415))return new Promise(()=>{});throw _0x4d1415;}function wt(_0x18a906){return _0x18a906['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x18a906['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x342830{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1aa4d1=this['editor']['plugins']['get'](c),_0x324420=this['editor']['plugins']['get']('CommentsEditing'),_0x9d9398=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x1aa4d1,'change:state',(_0x2f7f35,_0x34dc0d,_0x533919)=>{_0x324420['isThreadsLoadingPaused']='connected'!==_0x533919;});}),this['listenTo'](_0x1aa4d1,'change:state',(_0x56075c,_0x16a432,_0x18534e)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x18534e);}),_0x9d9398['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x342830{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x342830{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>st)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x255773];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c3d79){super(_0x4c3d79);const _0x2f719a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x2f719a);}async['init'](){const _0x4cb814=this['editor']['plugins']['get'](l),_0x1c62ef=_0x4cb814['serverHistory'],_0x4c54b4=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x1c62ef,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4cb814['sessionId']});const _0xaa51f6=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x12ae1f=await it['isBundleUploaded'](_0x4c54b4['connection'],_0xaa51f6);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4062d7})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4062d7)),'updateRevisions':async _0x1d913b=>{await this['_waitForServiceReady']();const _0x581547=this['_revisionTracker']['currentRevision'];if(_0x12ae1f&&0x1===_0x1d913b['length']&&_0x1d913b[0x0]['id']===_0x581547['id'])return _0x1d913b;for(const _0x4ea6eb of _0x1d913b)_0x4ea6eb['id']===_0x581547['id']&&(_0x4ea6eb['isEmptyCurrent']=_0x4ea6eb['fromVersion']===_0x4ea6eb['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x1d913b,this['_lastRequestId'])['then'](_0x155dc1=>(this['_lastRequestId']=_0x155dc1,_0x1d913b))['catch'](_0x3e488f=>{if(rt(_0x3e488f)||'400'===_0x3e488f['code']&&void 0x0!==_0x3e488f['data']['wrongRequestId']){for(const _0x2e9a7c of _0x1d913b){!this['_revisionTracker']['repository']['getRevision'](_0x2e9a7c['id'])||this['_revisionTracker']['_bufferUpdate'](_0x2e9a7c['id'],_0x2e9a7c,!0x1);}if(rt(_0x3e488f))throw _0x3e488f;return _0x1d913b;}throw _0x3e488f;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x40bc76,{revisionsData:_0x241f09,requestId:_0x35f7ae})=>{Math['max'](..._0x241f09['map'](_0x14c9a1=>_0x14c9a1['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x241f09,_0x35f7ae);}):this['_handleRevisionsUpdate'](_0x241f09,_0x35f7ae);});const {revisions:_0x2b432e,requestId:_0x1a8106}=await this['_revisionHistoryService']['connect'](_0x4c54b4['connection']);_0x4c54b4['addToReconnectionStack'](this),this['_lastRequestId']=_0x1a8106,await this['_fetchMissingUsers'](_0x2b432e);for(const _0x18a6f1 of _0x2b432e)this['_revisionTracker']['addRevisionData'](_0x18a6f1);this['listenTo'](_0x4cb814,'change:_isConnected',(_0x35e3e2,_0x4b85b5,_0x449107)=>{_0x449107&&(this['_oldOffset']=_0x4cb814['_offset'],_0x35e3e2['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4c54b4,'state',_0x35c102=>_0x35c102===_0x30ee06['CONNECTED']);}async['reconnect'](){const _0xb29a6c=this['editor']['plugins']['get'](c),_0x3dd36e=this['editor']['plugins']['get'](l),_0x8d3203=async()=>{const _0x4f0800=this['_revisionTracker']['currentRevision'],_0x35778d=_0x4f0800['id'],_0x32a32f=_0x35778d!==_0x3dd36e['sessionId'];if(_0x32a32f){const _0x56e87c=_0x3dd36e['_offset']-this['_oldOffset'],_0xb3abe6=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x4f0800['toVersion']+_0x56e87c!==_0xb3abe6){const _0x16d5c8=_0x4f0800['fromVersion']+_0x56e87c,_0x8e685f=this['editor']['plugins']['get'](_0x255773),_0x1eff3f=this['_revisionTracker']['buildRevisionData']({'revision':_0x4f0800,'from':_0x16d5c8,'to':_0xb3abe6});_0x1eff3f['id']=_0x4f0800['id'];const _0x10bd6d=_0x1eff3f['authorsIds']['map'](_0x4acd80=>_0x8e685f['getUser'](_0x4acd80));_0x4f0800['_update']({..._0x1eff3f,'authors':_0x10bd6d},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4f0800['id'],_0x1eff3f,!0x0);}this['_revisionTracker']['_startingVersion']=_0xb3abe6,(_0x4f0800['toVersion']===_0x4f0800['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x35778d)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x35778d),this['_revisionTracker']['_createCurrentRevision'](_0xb3abe6));}const {revisions:_0x1d93fe,requestId:_0x219bb7}=await this['_revisionHistoryService']['reconnect'](_0xb29a6c['connection'],this['_lastRequestId']);_0x32a32f&&_0x1d93fe['length']>0x0?_0x3dd36e['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x1d93fe),this['_handleRevisionsUpdate'](_0x1d93fe,_0x219bb7),this['_revisionTracker']['sendBufferedUpdates']());};return _0x3dd36e['_isConnected']?_0x8d3203():new Promise((_0x40e2dc,_0x29ca43)=>{_0x3dd36e['once']('change:_isConnected',()=>{_0x8d3203()['then'](_0x40e2dc)['catch'](_0x29ca43);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4207d7=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x21c1dd=>{_0x21c1dd['off'](),_0x4207d7();});});}['_getLatestVersionFromServerOperations'](){const _0x425825=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1ecef9 of _0x425825)if('marker'!==_0x1ecef9['type']||_0x1ecef9['affectsData'])return _0x1ecef9['baseVersion']+0x1;}['_getLatestVersion'](){const _0x58022c=this['editor']['plugins']['get'](l);return new Promise(_0x46cd12=>{_0x58022c['_isPendingUpdate']?_0x58022c['once']('change:_isPendingUpdate',()=>{_0x46cd12(this['_getLatestVersionFromServerOperations']());}):_0x46cd12(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x591447,_0xdcaaaa){const _0x23f725=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xdcaaaa;for(const _0x3df45d of _0x591447){const _0x36c724=_0x23f725['getRevision'](_0x3df45d['id']);if(_0x36c724){if((_0x3df45d['fromVersion']||_0x3df45d['toVersion'])&&(_0x3df45d['diffData']=null),_0x36c724===this['_revisionTracker']['currentRevision']){const _0x529701=Math['max'](_0x36c724['toVersion'],_0x3df45d['toVersion']),_0x41b073=Math['max'](_0x36c724['fromVersion'],_0x3df45d['fromVersion']);let _0x42bdee;_0x36c724['toVersion']===_0x3df45d['toVersion']&&_0x36c724['fromVersion']===_0x3df45d['fromVersion']?(_0x42bdee=!0x0,this['_preventResendingRevisionData'](_0x3df45d)):_0x3df45d['toVersion']===_0x529701&&_0x3df45d['fromVersion']===_0x41b073?_0x42bdee=!0x1:(_0x36c724['toVersion']===_0x529701&&_0x36c724['fromVersion']===_0x41b073||this['_fixRevision']({'revision':_0x36c724,'from':_0x41b073,'to':_0x529701}),_0x42bdee=!0x0),_0x42bdee&&(delete _0x3df45d['fromVersion'],delete _0x3df45d['toVersion'],delete _0x3df45d['diffData'],delete _0x3df45d['createdAt'],delete _0x3df45d['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3df45d),this['_preventResendingRevisionData'](_0x3df45d);}else this['_revisionTracker']['addRevisionData'](_0x3df45d);}const _0x29b64c=_0x23f725['getRevisions']();_0x29b64c['reverse']();for(let _0x130b0c=0x0;_0x130b0c<_0x29b64c['length']-0x1;_0x130b0c++){const _0x1bfe4f=_0x29b64c[_0x130b0c],_0x96fcba=_0x29b64c[_0x130b0c+0x1];if(_0x1bfe4f['fromVersion']<_0x96fcba['toVersion']){const _0x3d47ec=_0x96fcba['toVersion'],_0x58ae5b=Math['max'](_0x3d47ec,_0x1bfe4f['toVersion']);this['_fixRevision']({'revision':_0x1bfe4f,'from':_0x3d47ec,'to':_0x58ae5b});}}}['_fixRevision']({revision:_0x44e4ff,from:_0x59430b,to:_0x2240a1}={}){const _0x35ce02=this['editor']['plugins']['get'](_0x255773),_0x8b5de2=this['_revisionTracker']['buildRevisionData']({'revision':_0x44e4ff,'from':_0x59430b,'to':_0x2240a1});_0x8b5de2['authors']=_0x8b5de2['authorsIds']['map'](_0x2f670c=>_0x35ce02['getUser'](_0x2f670c)),_0x44e4ff['_update'](_0x8b5de2);}['_preventResendingRevisionData'](_0x59c753){const _0x538e7a={};_0x538e7a['id']=_0x59c753['id'];for(const _0x28d6e2 of Object['keys'](_0x59c753))'id'!==_0x28d6e2&&(_0x538e7a[_0x28d6e2]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x538e7a['id'],_0x538e7a,!0x0);}async['_fetchMissingUsers'](_0x494d9c){const _0x40756c=this['editor']['plugins']['get'](_0x255773),{connection:_0x122948}=this['editor']['plugins']['get'](c),_0x2ee792=new Set();for(const _0x563072 of _0x494d9c){for(const _0x1879fb of _0x563072['authorsIds'])_0x44db92(_0x1879fb);_0x563072['creatorId']&&_0x44db92(_0x563072['creatorId']);}if(0x0===_0x2ee792['size'])return;const _0x48a614=await mt['getMany'](_0x122948,Array['from'](_0x2ee792));for(const _0x1c0af7 of _0x48a614)_0x40756c['getUser'](_0x1c0af7['id'])||_0x40756c['addUser'](_0x1c0af7);function _0x44db92(_0x38ac73){_0x40756c['getUser'](_0x38ac73)||_0x2ee792['add'](_0x38ac73);}}}function rt(_0x2ed493){return _0x2ed493['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x2ed493['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2ed493['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x342830{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x3fc612{constructor(_0xf13da0){super(_0xf13da0);const _0x10b382=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x10b382['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x10b382['to']('usersCount',_0x38e829=>B(_0xf13da0,'CONNECTED_USERS',_0x38e829))}]});}}class es extends _0x3fc612{['items'];['keystrokes'];constructor(_0x33a571){super(_0x33a571);const _0x53492f=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5625dc(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x53492f['if']('hasPopup'),'aria-expanded':_0x53492f['to']('isExpanded',_0x1c39df=>this['hasPopup']&&String(_0x1c39df)),'aria-label':_0x53492f['to']('hasPopup',_0x1d249e=>B(_0x33a571,_0x1d249e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x53492f['to']('hasPopup',_0x49d070=>!!_0x49d070&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x53492f['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0xc47306,_0x582f5b,_0x8d933c)=>{this['element']&&(_0x8d933c?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class L extends _0x3fc612{['counterView'];['inlineListView'];constructor(_0x414b96){super(_0x414b96);const _0x11a593=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x414b96),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x247edf of this['inlineListView']['items'])_0x247edf['tooltipPosition']='s';this['inlineListView']['items']['first']&&(this['inlineListView']['items']['first']['tooltipPosition']='se');}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list','ck-reset','ck-rounded-corners',_0x11a593['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x3fc612{['listWrapperView'];constructor(_0x4c69d9,_0x29e7db){super(_0x4c69d9),this['listWrapperView']=new vt(_0x4c69d9,_0x29e7db),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':B(_0x4c69d9,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x23aa7d{constructor(_0x112d2a,_0x53ab32){super(_0x112d2a);const _0x4566d6=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x53ab32?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x4566d6['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x4566d6['to']('role'),'aria-label':_0x4566d6['to']('ariaLabel'),'aria-labelledby':_0x4566d6['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x288752['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x396b30=this['element'];_0x396b30&&(this['_isScrollable']=Math['max'](_0x396b30['scrollHeight'],_0x396b30['clientHeight'])>0.8*window['innerHeight']);}}class k extends ct{['userView'];constructor(_0x268b90,_0x1938eb,_0x3cb998){super(_0x268b90);const _0x2c4b56=this['bindTemplate'];this['userView']=new lt(_0x268b90,_0x1938eb);const _0x471805={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x1938eb['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x1938eb['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1938eb['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x3cb998&&(_0x471805['tag']='button',_0x471805['on']={'click':_0x2c4b56['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x471805);}['focus'](){this['element']['focus']();}}class y extends _0x3fc612{['userView'];['markerView'];constructor(_0x16c997,_0x17d3ff,_0x473556){super(_0x16c997);const _0x27f86e=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new lt(_0x16c997,_0x17d3ff),this['markerView']=new dt(_0x16c997,_0x17d3ff);const _0x4e50f8=new pt(_0x16c997);_0x4e50f8['template']['tag']='span',_0x4e50f8['text']=_0x17d3ff['name'];const _0x3a25c1={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x27f86e['to']('isFocusable',_0x33fad3=>!!_0x33fad3&&0x0),'aria-labelledby':_0x4e50f8['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x27f86e['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x27f86e['to']('hasTooltip',_0x47d2a6=>!_0x47d2a6),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4e50f8]};_0x473556&&(_0x3a25c1['tag']='button',_0x3a25c1['on']={'click':_0x27f86e['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3a25c1);}}class dt extends _0x3fc612{constructor(_0x595607,_0x1d4c0d){super(_0x595607),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1d4c0d['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x2b0246{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x14afa7){super(_0x14afa7),this['context']['config']['define']('presenceList',A);const _0x37c2ea=_0x14afa7['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x37c2ea)throw new _0x53fe02('presencelist-collapseat-invalid-format',this);if(_0x37c2ea<0x1)throw new _0x53fe02('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x52b573(),this['balloonPanelView']=new _0x5dcfb5(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4d06e5 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4d06e5);this['listenTo'](this['_allConnectedUsers'],'add',(_0x9bacee,_0x37a463)=>{this['_handleUserAdd'](_0x37a463);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1a8789,_0x426fab)=>{this['_handleUserRemove'](_0x426fab);});}['_createView'](){const _0x5ee785=this['context'],_0x583912=new L(this['context']['locale']),_0x5dc601=this['balloonPanelView'];if(!_0x3db76d(_0x5ee785['config']['get']('presenceList.container')))throw new _0x53fe02('presencelist-missing-container',this);return _0x583912['counterView']['bind']('usersCount')['to'](this),_0x583912['bind']('isCollapsed')['to'](this,'usersCount',_0x1785c0=>{const {collapseAt:_0x5c7d7d,displayMe:_0xaea360}=_0x5ee785['config']['get']('presenceList'),_0x43ac5a=_0x1785c0>=_0x5c7d7d;return _0x583912['counterView']['isHidden']=!(0x1==_0x1785c0&&_0xaea360||_0x43ac5a),_0x43ac5a||this['hideDropdown'](),_0x43ac5a;}),_0x583912['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1831e6=>{const _0x4e2661=_0x5ee785['config']['get']('presenceList'),_0xfe0526=new y(_0x5ee785['locale'],_0x1831e6,!!_0x4e2661['onClick']);return _0xfe0526['bind']('hasTooltip')['to'](_0x583912,'isCollapsed',_0x1439b7=>!_0x1439b7),_0xfe0526['bind']('isFocusable')['to'](_0x583912,'isCollapsed',_0xd6ac9d=>!_0xd6ac9d),_0x4e2661['onClick']&&this['listenTo'](_0xfe0526,'execute',()=>{this['view']['isCollapsed']||_0x4e2661['onClick'](_0x1831e6,_0xfe0526['element']);}),_0xfe0526;}),this['listenTo'](_0x583912['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x583912['inlineListView']['keystrokes']['set']('Enter',(_0x11448e,_0x340313)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x340313());}),_0x583912['render'](),_0x5dc601['render'](),_0x361fc0({'emitter':_0x583912,'activator':()=>_0x5dc601['isVisible'],'contextElements':[_0x5dc601['element'],_0x583912['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x5ee785['config']['get']('presenceList.container')['appendChild'](_0x583912['element']),this['_bodyCollection']=new _0x18513d(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x583912;}['_handleUserAdd'](_0x251021){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x251021['isMe'])return;const _0x2df42b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x2df42b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x4b1e88=_0x251021['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x251021,_0x4b1e88);}['_handleUserRemove'](_0xb03d64){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0xb03d64['id'])&&(this['currentDisplayedUsers']['remove'](_0xb03d64['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x4a86f5 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4a86f5['id']))return void this['currentDisplayedUsers']['add'](_0x4a86f5,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x38c533=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x38c533['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x521a73}=this['presenceDropdownView'];_0x521a73['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5162f2=>{if(!_0x38c533['displayMe']&&_0x5162f2['isMe'])return null;const _0x30ea3a=new k(this['context']['locale'],_0x5162f2,!!_0x38c533['onClick']);return _0x38c533['onClick']&&this['listenTo'](_0x30ea3a,'execute',()=>{_0x38c533['onClick'](_0x5162f2,_0x30ea3a['element']);}),_0x30ea3a;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x521a73['focus'](),_0x521a73['checkIfScrollable']();const _0x31b72d=(_0x1cb27d,_0x5c6914)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x5c6914();};_0x521a73['keystrokes']['set']('Esc',_0x31b72d),_0x521a73['keystrokes']['set']('Shift+Tab',_0x31b72d),_0x521a73['keystrokes']['set']('Tab',(_0x4f617e,_0x18234e)=>{!function(_0x40d566){const _0x1734ac=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x24ea50=>_0x24ea50+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x14ce17=[...document['body']['querySelectorAll'](_0x1734ac)]['filter'](_0x2f8891=>_0x2f8891===document['activeElement']||_0x2f8891['offsetWidth']+_0x2f8891['offsetHeight']>0x0)['sort']((_0x5f4384,_0x12737d)=>(_0x5f4384['tabIndex']||0x0)-(_0x12737d['tabIndex']||0x0)),_0x4eecbb=_0x14ce17['indexOf'](_0x40d566),_0xeb7b28=_0x14ce17[(_0x4eecbb+0x1)%_0x14ce17['length']];_0xeb7b28&&_0xeb7b28['focus']();}(this['view']['element']),this['hideDropdown'](),_0x18234e();}),_0x521a73['focusTracker']['add'](this['view']['element']),_0x521a73['focusTracker']['on']('change:isFocused',(_0x4078ab,_0x5a6b6e,_0x2a567a)=>{_0x2a567a||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x2b0246{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-real-time-collaboration",
|
|
3
|
-
"version": "44.0.0-alpha.
|
|
3
|
+
"version": "44.0.0-alpha.12",
|
|
4
4
|
"description": "A set of CKEditor 5 features enabling real-time collaboration within the editor using CKEditor Cloud Services.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@ckeditor/ckeditor-cloud-services-collaboration": "52.6.11",
|
|
45
|
-
"@ckeditor/ckeditor5-core": "44.0.0-alpha.
|
|
46
|
-
"@ckeditor/ckeditor5-engine": "44.0.0-alpha.
|
|
47
|
-
"@ckeditor/ckeditor5-operations-compressor": "44.0.0-alpha.
|
|
48
|
-
"@ckeditor/ckeditor5-theme-lark": "44.0.0-alpha.
|
|
49
|
-
"@ckeditor/ckeditor5-ui": "44.0.0-alpha.
|
|
50
|
-
"@ckeditor/ckeditor5-utils": "44.0.0-alpha.
|
|
51
|
-
"ckeditor5": "44.0.0-alpha.
|
|
52
|
-
"ckeditor5-collaboration": "44.0.0-alpha.
|
|
45
|
+
"@ckeditor/ckeditor5-core": "44.0.0-alpha.12",
|
|
46
|
+
"@ckeditor/ckeditor5-engine": "44.0.0-alpha.12",
|
|
47
|
+
"@ckeditor/ckeditor5-operations-compressor": "44.0.0-alpha.12",
|
|
48
|
+
"@ckeditor/ckeditor5-theme-lark": "44.0.0-alpha.12",
|
|
49
|
+
"@ckeditor/ckeditor5-ui": "44.0.0-alpha.12",
|
|
50
|
+
"@ckeditor/ckeditor5-utils": "44.0.0-alpha.12",
|
|
51
|
+
"ckeditor5": "44.0.0-alpha.12",
|
|
52
|
+
"ckeditor5-collaboration": "44.0.0-alpha.12",
|
|
53
53
|
"lodash-es": "4.17.21"
|
|
54
54
|
},
|
|
55
55
|
"types": "src/index.d.ts",
|