@ckeditor/ckeditor5-real-time-collaboration 47.6.0-alpha.6 → 47.6.0-alpha.7

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/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0xd3e8aa,Plugin as _0x25e6f2,PendingActions as _0x53b958,Context as _0x5e153d}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x407ddd,CKEditorError as _0x30f693,Collection as _0xb4bb92,global as _0x44b0ca,version as nt,uid as _0x25094b,KeystrokeHandler as _0x553934}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x45abe3,View as _0x57df8e,ListView as _0x11ceb4,ListItemView as et,LabelView as it,BalloonPanelView as _0x4ba438,clickOutsideHandler as _0x2c85ae,BodyCollection as _0x2b3595}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x5c8a09,History as _0xb38147,NoOperation as _0x444f10,InsertOperation as _0x121a73,MarkerOperation as _0x37d9f5,RootAttributeOperation as _0x40624e,transformOperationSets as _0x417964,OperationFactory as _0x2b0580}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x36ce39,CollaborativeEditingService as _0x47837b,User as ct,CommentsService as _0x3f87de,TrackChangesService as tt,RevisionHistoryService as _0xbde25a,EditorService as _0x9c7fbf}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x31dbe9,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x32c2dc}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3d55c6}from'es-toolkit/compat';class n extends _0xd3e8aa{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x45abe3];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x8ab8ae){super(_0x8ab8ae),this['set']('state',_0x36ce39['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x407ddd())();}['init'](){const _0x3025a2=this['context'],_0xd20496=_0x3025a2['plugins']['get']('CloudServices'),_0x531fd6=_0x3025a2['plugins']['get'](_0x45abe3);if(!_0xd20496['token'])throw new _0x30f693('websocketgateway-missing-token',this);if(!_0xd20496['webSocketUrl'])throw new _0x30f693('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),n['WebSocketGateway']['connect'](_0xd20496['token'],_0xd20496['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x189c10=>{if(this['connection']=_0x189c10,this['bind']('state')['to'](_0x189c10,'state',this,'_isBrowserOffline',(_0x5ddad5,_0x6b9eb2)=>('connected'!==_0x5ddad5&&(this['_shouldPluginsReconnect']=!0x0),_0x6b9eb2||_0x5ddad5!==_0x36ce39['CONNECTED']?_0x36ce39['DISCONNECTED']:this['state']==_0x36ce39['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x36ce39['CONNECTING']):_0x36ce39['CONNECTED'])),this['connection']['on']('error',(_0x358490,_0xe14b4b)=>{if('limitExceeded'!==_0xe14b4b['code'])throw console['error'](_0xe14b4b),new _0x30f693('cloudservices-init',null,{'originalError':_0xe14b4b});_0x531fd6['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'});}),!_0x189c10['me'])return new Promise(_0x306c80=>_0x189c10['on']('change:me',_0x306c80));})['catch'](_0x4e8a6c=>{throw console['error'](_0x4e8a6c),new _0x30f693('cloudservices-init',null,{'originalError':_0x4e8a6c});});}['addToReconnectionStack'](_0x11870b){if('function'!=typeof _0x11870b['reconnect'])throw new _0x30f693('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x11870b))throw new _0x30f693('websocketgateway-plugin-already-registered',this,{'name':_0x11870b['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x11870b);}['removeFromReconnectionStack'](_0x392f71){this['_reconnectionStack']['delete'](_0x392f71);}['isInReconnectionStack'](_0xcd5c9e){return this['_reconnectionStack']['has'](_0xcd5c9e);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1c571b=>_0x1c571b['reconnect']())))['then'](()=>this['state']=_0x36ce39['CONNECTED'])['catch'](_0x5b3f3d=>{throw console['error'](_0x5b3f3d),new _0x30f693('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x36ce39['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0xd3e8aa{['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[n,_0x31dbe9];}constructor(_0x42c1da){super(_0x42c1da),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0xb4bb92(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x31dbe9);}['init'](){const _0x558251=this['context']['plugins']['get'](n);this['listenTo'](_0x558251,'change:state',(_0x5cbd43,_0x2ba6de,_0x4fbc5c)=>{if('connected'!==_0x4fbc5c)this['channelSessions']['forEach'](_0x449d8c=>_0x449d8c['clear']()),this['channelConnectedUsers']['forEach'](_0x2cc509=>_0x2cc509['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0xa25a4e,_0x3e2881]of this['_registeredSessions'])for(const _0x416414 of _0x3e2881)this['_handleSessionAdd'](_0xa25a4e,_0x416414);}}),this['_createUser'](_0x558251['connection']['me'],!0x0);}['register'](_0x2e1f1e,_0x2b98d8){if(this['_registeredSessions']['has'](_0x2e1f1e))throw new _0x30f693('sessions-register-already-registered',null,{'channelId':_0x2e1f1e});this['_registeredSessions']['set'](_0x2e1f1e,_0x2b98d8),this['channelSessions']['set'](_0x2e1f1e,new _0xb4bb92()),this['channelConnectedUsers']['set'](_0x2e1f1e,new _0xb4bb92()),this['listenTo'](_0x2b98d8,'add',(_0x4b2ac3,_0x3a959b)=>this['_handleSessionAdd'](_0x2e1f1e,_0x3a959b)),this['listenTo'](_0x2b98d8,'remove',(_0x7da0a2,_0x2f9c1d)=>this['_handleSessionRemove'](_0x2e1f1e,_0x2f9c1d));for(const _0x5e0df4 of _0x2b98d8)this['_handleSessionAdd'](_0x2e1f1e,_0x5e0df4);}['unregister'](_0x45be40){if(!this['_registeredSessions']['has'](_0x45be40))throw new _0x30f693('sessions-unregister-not-exist',null,{'channelId':_0x45be40});const _0xc2cbf8=this['_registeredSessions']['get'](_0x45be40);this['stopListening'](_0xc2cbf8);for(const _0x4180e4 of _0xc2cbf8)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x45be40,_0x4180e4);this['_registeredSessions']['delete'](_0x45be40),this['channelSessions']['delete'](_0x45be40),this['channelConnectedUsers']['delete'](_0x45be40);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x3c15e5){for(const _0x439d68 of this['channelSessions']['values']())for(const _0x4c3274 of _0x439d68)if(_0x4c3274['id']===_0x3c15e5)return _0x4c3274['user'];}['getUserSessions'](_0x1836d4,_0x15397d){const _0x3b0aa6=_0x15397d?[this['channelSessions']['get'](_0x15397d)]:this['channelSessions']['values'](),_0xbf6b69=new Set();for(const _0x2baebc of _0x3b0aa6)for(const _0x463b2b of _0x2baebc)_0x463b2b['user']['id']===_0x1836d4['id']&&_0xbf6b69['add'](_0x463b2b['id']);return _0xbf6b69;}['getUserRole'](_0x5b765f){for(const _0x1f4c53 of this['channelSessions']['values']())for(const _0x58694f of _0x1f4c53)if(_0x58694f['user']===_0x5b765f)return _0x58694f['role'];}['_handleSessionAdd'](_0x5eae77,_0x474035){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x5d58d3=_0x474035['user'],_0xe8062c=this['_users']['getUser'](_0x5d58d3['id'])||this['_createUser'](_0x5d58d3),_0x4ad183=Object['assign']({},_0x474035,{'user':_0xe8062c});if(this['channelSessions']['get'](_0x5eae77)['add'](_0x4ad183),!_0x5d58d3['hiddenInPresenceList']){const _0x33d572=this['channelConnectedUsers']['get'](_0x5eae77);_0x33d572['has'](_0xe8062c['id'])||_0x33d572['add'](_0xe8062c),this['allConnectedUsers']['has'](_0xe8062c['id'])||_0x5d58d3['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xe8062c,_0xe8062c['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x5eae77,{'channelId':_0x5eae77,'session':_0x4ad183});}['_handleSessionRemove'](_0x2cf462,_0x54cd52){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x71417e=this['channelConnectedUsers']['get'](_0x2cf462),_0x5c9368=_0x54cd52['user'];_0x5c9368['id']&&(this['channelSessions']['get'](_0x2cf462)['remove'](_0x54cd52['id']),_0x71417e['has'](_0x5c9368['id'])&&!this['getUserSessions'](_0x5c9368,_0x2cf462)['size']&&_0x71417e['remove'](_0x5c9368['id']),this['allConnectedUsers']['get'](_0x5c9368['id'])&&!this['getUserSessions'](_0x5c9368)['size']&&this['allConnectedUsers']['remove'](_0x5c9368['id']));}['_createUser'](_0x51dab1,_0x339122){const _0x35a41b=this['_users']['addUser'](_0x51dab1);return _0x339122&&this['_users']['defineMe'](_0x51dab1['id']),_0x35a41b['orderNumber']=this['_uniqueUsersCount']++,_0x35a41b;}}class G extends _0x25e6f2{['_domEmitter']=new(_0x407ddd())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2038ab=this['editor'],_0xcdcb34=_0x2038ab['plugins']['get'](i);_0x2038ab['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x679b8,{writer:_0x5e4106})=>function(_0x562c6f,_0x581e9c,_0x5990bb,_0x111d69){const _0x5d59c7=_0x562c6f['markerName']['split'](':')[0x2],_0x8f917d=_0x5990bb['getUserBySessionId'](_0x5d59c7);if(!_0x8f917d||_0x5d59c7===_0x5990bb['mySessionId'])return;if(!_0x111d69['model']['schema']['checkChild'](_0x562c6f['markerRange']['start'],'$text'))return;const _0x64411={'class':'ck-user__marker\x20'+_0x8f917d['color']['getMarkerClass'](),'data-name':_0x8f917d['name'],'data-session-id':_0x5d59c7},_0x5e4611=_0x111d69['model']['markers']['get'](_0x562c6f['markerName']),_0x1d3843=_0x5e4611['getStart'](),_0x23834c=_0x1d3843['nodeAfter'],_0x56e9d4=_0x111d69['model']['schema'];if(_0x23834c&&_0x56e9d4['isObject'](_0x23834c)&&_0x56e9d4['isInline'](_0x23834c)&&!_0x111d69['model']['markers']['get']('user:range:'+_0x5d59c7)['getRange']()['isCollapsed'])return;const _0x1dffbd=_0x1d3843['parent'];return _0x111d69['model']['schema']['isLimit'](_0x1dffbd)&&!_0x111d69['model']['hasContent'](_0x1dffbd)&&(_0x64411['contenteditable']=!0x1),function(_0x516784,_0x42382e,_0x3f3f0a){const _0x46b1ad=_0x516784['createUIElement']('span',_0x42382e);return _0x516784['setCustomProperty']('userPositionMarker',!0x0,_0x46b1ad),_0x46b1ad['render']=function(_0x5ce25d){const _0x209313=this['toDomElement'](_0x5ce25d),_0x10bf98=document['createElement']('span');return _0x10bf98['classList']['add']('ck-user__marker-tooltip'),_0x10bf98['setAttribute']('contenteditable','false'),_0x10bf98['setAttribute']('spellcheck','false'),_0x10bf98['textContent']=_0x3f3f0a['name'],_0x209313['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x10bf98['outerHTML']+'⁠',_0x209313['addEventListener']('mouseenter',()=>{_0x209313['classList']['add']('ck-user__marker_hovered');}),_0x209313['addEventListener']('mouseleave',()=>{_0x209313['classList']['remove']('ck-user__marker_hovered');}),_0x209313;},_0x46b1ad['isSimilar']=function(_0xce37c6){return!(!this['getCustomProperty']('userPositionMarker')||!_0xce37c6['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xce37c6['getAttribute']('data-session-id'));},_0x46b1ad;}(_0x581e9c,_0x64411,_0x8f917d);}(_0x679b8,_0x5e4106,_0xcdcb34,_0x2038ab)}),_0x2038ab['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4fd11d=>function(_0x38e633,_0x1d70ef){const _0x513fc5=_0x38e633['markerName']['split'](':')[0x2];if(_0x513fc5===_0x1d70ef['mySessionId'])return null;const _0x13174e=_0x1d70ef['getUserBySessionId'](_0x513fc5);if(!_0x13174e)return{'id':_0x513fc5,'classes':[]};return{'id':_0x513fc5,'classes':['ck-user__selection',_0x13174e['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x513fc5},'priority':0x7d0+_0x13174e['orderNumber']};}(_0x4fd11d,_0xcdcb34)}),function(_0x2e0495){const _0x2d78a7=_0x2e0495['model'],_0x32e74d=new Map(),_0x5c359a=_0x2e0495['plugins']['get'](i);_0x2d78a7['markers']['on']('update:user:range',(_0x1c9ac1,_0x4050c4,_0x85db45,_0xf92286)=>{if(!_0xf92286&&_0x32e74d['get'](_0x4050c4['name']))return _0x32e74d['get'](_0x4050c4['name'])['detach'](),void _0x32e74d['delete'](_0x4050c4['name']);const _0x214103=_0x4050c4['name']['split'](':')[0x2];if(_0x214103===_0x5c359a['mySessionId'])return;const _0x163c81='user:position:'+_0x214103;_0x2d78a7['markers']['has'](_0x163c81)&&_0x2e0495['editing']['reconvertMarker'](_0x163c81),_0x4050c4['on']('change:range',(_0x3d7c12,_0x37652a,_0xa0262a)=>{if('$graveyard'!=_0x37652a['root']['rootName']&&'$graveyard'==_0x4050c4['getRange']()['root']['rootName']&&!_0x32e74d['has'](_0x4050c4['name'])){const _0xf7a943=_0x2d78a7['schema']['getNearestSelectionRange'](_0xa0262a['deletionPosition']);if(_0xf7a943){const _0x5cff03=_0x5c8a09['fromRange'](_0xf7a943);_0x32e74d['set'](_0x4050c4['name'],_0x5cff03),_0x5cff03['on']('change:range',(_0x53e8ed,_0x10b747,_0x120bb1)=>{if('$graveyard'==_0x5cff03['root']['rootName']){const _0x317993=_0x2d78a7['schema']['getNearestSelectionRange'](_0x120bb1['deletionPosition']);_0x317993?(_0x5cff03['start']=_0x317993['start'],_0x5cff03['end']=_0x317993['end']):(_0x32e74d['delete'](_0x4050c4['name']),_0x5cff03['detach']());}});}}});}),_0x2d78a7['document']['on']('change',()=>{_0x32e74d['size']>0x0&&_0x2d78a7['enqueueChange']({'isUndoable':!0x1},_0x646cf9=>{for(const [_0x3090b4,_0x3ab27d]of _0x32e74d)'$graveyard'==_0x2d78a7['markers']['get'](_0x3090b4)['getRange']()['root']['rootName']&&(te(_0x3090b4['split'](':')[0x2],_0x3ab27d['toRange'](),_0x2d78a7,_0x646cf9),_0x3ab27d['detach']());_0x32e74d['clear']();});});}(_0x2038ab),this['_domEmitter']['listenTo'](_0x44b0ca['document'],'keydown',(_0x26cde0,{key:_0x669b6c})=>{'Escape'===_0x669b6c&&function(_0x3308fe){_0x3308fe['editing']['view']['change'](_0x54b80f=>{for(const _0x420879 of _0x3308fe['model']['markers']){if(!_0x420879['name']['startsWith']('user:position'))continue;const _0x11e37a=_0x3308fe['editing']['mapper']['markerNameToElements'](_0x420879['name']);if(_0x11e37a){for(const _0x261ad6 of _0x11e37a)_0x54b80f['removeClass']('ck-user__marker_hovered',_0x261ad6);}}});}(_0x2038ab);},{'useCapture':!0x0});}['afterInit'](){const _0x35ce90=this['editor'],_0x2c1651=_0x35ce90['commands']['get']('undo');_0x2c1651&&_0x35ce90['model']['on']('applyOperation',(_0x330e78,_0x3b3911)=>{const _0x3fb5b0=_0x3b3911[0x0];if(!_0x3fb5b0['isDocumentOperation'])return;if('marker'!=_0x3fb5b0['type']||!_0x3fb5b0['name']['startsWith']('user:'))return;const _0x2b1dcd=_0x3fb5b0['batch'];_0x2c1651['_createdBatches']['has'](_0x2b1dcd)&&(_0x3fb5b0['newRange']=_0x3fb5b0['oldRange']?_0x35ce90['model']['createRange'](_0x3fb5b0['oldRange']['start'],_0x3fb5b0['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x108284=this['editor'],_0x4860eb=_0x108284['model']['document'],_0x5bd8fe=_0x108284['plugins']['get'](i);_0x108284['model']['enqueueChange']({'isUndoable':!0x1},_0x4cfd09=>{const _0x477c50='user:range:'+_0x5bd8fe['mySessionId'],_0x1dedbe='user:position:'+_0x5bd8fe['mySessionId'],_0x1f8bf6=_0x108284['model']['markers']['has'](_0x477c50);_0x108284['editing']['view']['hasDomSelection']?te(_0x5bd8fe['mySessionId'],_0x4860eb['selection']['getFirstRange'](),_0x108284['model'],_0x4cfd09):_0x1f8bf6&&(_0x4cfd09['removeMarker'](_0x477c50),_0x4cfd09['removeMarker'](_0x1dedbe));});}}function te(_0x52e566,_0x210384,_0x55d0b8,_0x20ef5c){const _0x41791f='user:range:'+_0x52e566,_0x1cd1d5='user:position:'+_0x52e566,_0x13b80c=_0x210384['getContainedElement']();let _0x116e00=_0x210384['start'];if(_0x13b80c&&_0x13b80c['is']('element','tableCell')){const _0xb82334=function(_0x3c87d8,_0x3196f1){for(const _0x3fa61b of _0x3c87d8['getPositions']())if(_0x3196f1['schema']['checkChild'](_0x3fa61b,'$text'))return _0x3fa61b;}(_0x210384,_0x55d0b8);_0xb82334&&(_0x116e00=_0xb82334,_0x210384=_0x20ef5c['createRange'](_0x116e00));}const _0x333b6c=_0x20ef5c['createRange'](_0x116e00);_0x55d0b8['markers']['has'](_0x41791f)?(_0x20ef5c['updateMarker'](_0x41791f,{'range':_0x210384}),_0x20ef5c['updateMarker'](_0x1cd1d5,{'range':_0x333b6c})):(_0x20ef5c['addMarker'](_0x41791f,{'range':_0x210384,'usingOperation':!0x0}),_0x20ef5c['addMarker'](_0x1cd1d5,{'range':_0x333b6c,'usingOperation':!0x0}));}function $(_0x2676c0,_0x3070dc,_0x41a2af){const _0x5004bf=_0x2676c0['t'],t=_0x2676c0['t'];switch(_0x3070dc){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 _0x5004bf({'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'},_0x41a2af);default:return'';}}let Q=0x1;class l extends _0x25e6f2{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x47837b)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x53b958,_0x31dbe9,_0x45abe3];}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 _0x3b3df5=this['serverHistory']['getOperations']();for(let _0x419a39=_0x3b3df5['length']-0x1;_0x419a39>=0x0;_0x419a39--){const _0x229b0e=_0x3b3df5[_0x419a39];if(!this['_disconnectionOperations']['has'](_0x229b0e))return _0x229b0e['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0xffd400){if(super(_0xffd400),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0xb38147(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x30f693('collaboration-missing-channelid',this);const _0x4afe76=_0xffd400['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x4afe76,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x32c2dc(),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 Z(this['_disconnectionOperations']);}['init'](){const _0x3aeced=this['editor'],_0x1eb7e9=_0x3aeced['plugins']['get'](_0x31dbe9),_0x2128a7=_0x3aeced['plugins']['get'](n);this['listenTo'](_0x1eb7e9,'getOperationAuthor',(_0x180056,_0x13357c)=>{const _0xf40e79=_0x13357c[0x0];_0xf40e79['_authorId']&&(_0x180056['return']=_0x1eb7e9['getUser'](_0xf40e79['_authorId']),_0x180056['stop']()),null===_0xf40e79['_authorId']&&(_0x180056['return']=null,_0x180056['stop']());},{'priority':'high'}),this['listenTo'](_0x3aeced['model']['document']['selection'],'change:range',(_0x272c82,_0x9f1e74)=>{_0x9f1e74['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3aeced['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3aeced['model']['on']('applyOperation',(_0x53f354,_0x511a33)=>{const _0x154dfb=_0x511a33[0x0];_0x154dfb['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x154dfb),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2128a7,'state',this,'_hasSynchronizationProblem',(_0x5687de,_0x51486d)=>'connected'===_0x5687de&&!_0x51486d),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3aeced['disableReadOnlyMode']('rtc-offline'):_0x3aeced['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3aeced['disableReadOnlyMode']('rtc-offline'):_0x3aeced['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x177f6b=this['editor']['plugins']['get'](i),_0x1f0142=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x177f6b['unregister'](this['_channelId']);const _0x340177=await this['_service']['reconnect'](_0x1f0142['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x340177)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x28df99=await this['_service']['getConnectedSessions']();_0x177f6b['register'](this['_channelId'],_0x28df99),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2e9b4f){if(function(_0x1a7bf8){return'404'===_0x1a7bf8['code'];}(_0x2e9b4f)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x2847e9){return'409'===_0x2847e9['code'];}(_0x2e9b4f)){const _0x59c754=$(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'](_0x59c754);}else{if(!(_0x2e9b4f instanceof X))throw _0x2e9b4f;this['_handleReconnectionError']();}}}}['destroy'](){const _0x44fe19=this['editor']['plugins']['get'](n),_0x54aed2=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x54aed2['channelSessions']['has'](this['_channelId'])&&_0x54aed2['unregister'](this['_channelId']),_0x44fe19['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x2e3533){if(this['sessionId']!==_0x2e3533['sessionId']&&this['_lastSyncedOperationId']!==_0x2e3533['lastOperationId'])throw new X();return this['sessionId']=_0x2e3533['sessionId'],this['_handleServerResponse']([],{..._0x2e3533,'wereChangesApplied':!0x1,'data':_0x2e3533['data']},'reconnect');}async['_connectService'](_0x4630d3,_0x122ced=!0x1){const {connection:_0x39b277}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x39b277,this['_channelId'])['then'](_0xa2a8f3=>this['_initSessionsHandling'](_0xa2a8f3))['catch'](_0x105240=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x105240);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x49fafa,_0x330dea)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x330dea);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x5ddcd5=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4630d3);this['_isPendingUpdate']=!0x0;const _0x484f8a=await this['_service']['connect'](_0x39b277,this['_compressOperations'](_0x4630d3),_0x5ddcd5);if(this['sessionId']=_0x484f8a['sessionId'],_0x122ced){if(!_0x484f8a['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x484f8a['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4630d3,_0x484f8a,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x484f8a,_0x4630d3);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x44587c=this['editor']['plugins']['get'](i),_0x510d26=this['editor']['plugins']['get'](G),_0xb81b3d=_0x44587c['channelSessions']['get'](this['_channelId']);_0xb81b3d&&_0xb81b3d['length']>0x1?_0x510d26['createUserMarkerOperations']():this['listenTo'](_0x44587c,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x44587c['channelSessions']['get'](this['_channelId'])['length']&&_0x510d26['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x516509,_0x180f14,_0xafbb62,_0x2b48ae){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x180f14){const _0x55499a=this['_decompressOperations'](_0xafbb62,_0x2b48ae);await this['_fetchMissingUsers'](_0x55499a),this['_handleExternalOperations'](_0x55499a,_0x180f14,_0xafbb62['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3555ec}=this['editor'];let _0x5b4e86;try{_0x5b4e86=await this['_service']['getDocumentDetails']();}catch{const _0x15fc11=$(_0x3555ec,'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'](_0x15fc11);}const _0x37d50b=_0x5b4e86['currentDocumentSession']||_0x5b4e86['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x37d50b['lastOperationId']){const _0x4be4c1=$(_0x3555ec,'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 void this['_handleReconnectionError'](_0x4be4c1);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x260e24){const _0x56b06c=this['editor']['plugins']['get'](i);this['listenTo'](_0x56b06c,'sessionAdd:'+this['_channelId'],(_0x5ccb8f,{session:_0x3228af})=>{if(_0x3228af['id']===_0x56b06c['mySessionId']){_0x5ccb8f['off']();const _0x4f6a5e=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3515e1=_0x3228af['permissions'];_0x4f6a5e&&_0x4f6a5e['isEnabled']&&(_0x3515e1=_0x3515e1['filter'](_0x27d1fa=>'document:write'!==_0x27d1fa)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3515e1,this['_channelId']);}}),_0x56b06c['register'](this['_channelId'],_0x260e24);}['_initThrowingOnDataSet'](){const _0x54bbae=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x532f64)=>{if(!_0x532f64[_0x532f64['length']-0x1]['suppressErrorInCollaboration'])throw new _0x30f693('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x54bbae['apply'](this['editor']['data'],_0x532f64);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4505c2,[_0x3c1915])=>{if(this['_document']['version'])throw new _0x30f693('realtimecollaborationclient-init-document-already-initialized',this);_0x4505c2['stop'](),this['_setPendingAction']();const _0x3322df=this['editor']['config']['get']('rootsAttributes'),_0x4aa84b=this['_getOperationsFromInitData'](_0x3c1915,_0x3322df);0x0==_0x4aa84b['length']&&_0x4aa84b['push'](new _0x444f10(0x0)),_0x4505c2['return']=this['_connectService'](_0x4aa84b)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x80d16a=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x80d16a))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x185c45,[_0x266f08,_0x279ba6])=>{_0x185c45['stop']();const _0x311487=this['editor']['model']['document']['getRoot'](_0x266f08);if(!this['_knownRootNames']['has'](_0x266f08)){const _0x45e683=_0x279ba6&&_0x279ba6['data']?_0x279ba6['data']:'',_0x4b0979=_0x279ba6&&_0x279ba6['attributes']?_0x279ba6['attributes']:{};await this['_loadRoot'](_0x266f08,_0x45e683,_0x4b0979);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x311487['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x311487);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x3582ef){const _0x391e75=this['editor']['plugins']['get'](_0x31dbe9),{connection:_0x421c1c}=this['editor']['plugins']['get'](n),_0xc36a28=new Set();for(const _0x13c1bf of _0x3582ef){const _0x256f87=_0x13c1bf['_authorId'];_0x256f87&&!_0x391e75['getUser'](_0x256f87)&&_0xc36a28['add'](_0x256f87);}if(0x0===_0xc36a28['size'])return;const _0x5693d8=await ct['getMany'](_0x421c1c,Array['from'](_0xc36a28));for(const _0x90e0bd of _0x5693d8)_0x391e75['getUser'](_0x90e0bd['id'])||_0x391e75['addUser'](_0x90e0bd);}['_getOperationsFromInitData'](_0x242b7b,_0x4adf96={}){const _0x39af80=this['editor']['model'],_0x4fc861=[];let _0x1db366=0x0;const _0x1ac473='string'==typeof _0x242b7b?{'main':_0x242b7b}:_0x242b7b;for(const _0x630d81 of Object['keys'](_0x1ac473)){if(!this['_document']['roots']['has'](_0x630d81))throw new _0x30f693('realtimecollaborationclient-init-non-existent-root',this);const _0x5144fe=this['editor']['data']['parse'](_0x1ac473[_0x630d81]),_0x3bd865=this['_document']['getRoot'](_0x630d81),_0x530d97=new _0x121a73(_0x39af80['createPositionAt'](_0x3bd865,0x0),_0x5144fe,_0x1db366++);_0x4fc861['push'](_0x530d97);for(const [_0x41f3d2,_0x1b4bcd]of _0x5144fe['markers']){const _0x586cfe=_0x39af80['createRange'](_0x39af80['createPositionFromPath'](_0x3bd865,_0x1b4bcd['start']['path']['slice']()),_0x39af80['createPositionFromPath'](_0x3bd865,_0x1b4bcd['end']['path']['slice']())),_0x2d962b=new _0x37d9f5(_0x41f3d2,null,_0x586cfe,_0x39af80['markers'],!0x0,_0x1db366++);_0x4fc861['push'](_0x2d962b);}}if(_0x4adf96)for(const [_0x2a7af8,_0x3a7f8a]of Object['entries'](_0x4adf96)){const _0x2b8c69=_0x39af80['document']['getRoot'](_0x2a7af8);if(!_0x2b8c69)throw new _0x30f693('multi-root-editor-root-attributes-no-root',null);for(const [_0x58cc0b,_0x4deb8c]of Object['entries'](_0x3a7f8a))if(null!==_0x4deb8c){const _0x5177a3=new _0x40624e(_0x2b8c69,_0x58cc0b,null,_0x4deb8c,_0x1db366++);_0x4fc861['push'](_0x5177a3);}}return _0x4fc861;}async['_loadRoot'](_0x1980c5,_0x5e136e,_0x28306d){this['_getOperationsFromInitData']({[_0x1980c5]:_0x5e136e},{[_0x1980c5]:_0x28306d})['forEach']((_0x7074f9,_0x433c41)=>{_0x7074f9['baseVersion']=this['_document']['version']+_0x433c41,_0x7074f9['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x7074f9);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5f5c1e,_0x46442d){let _0x2b2a91;this['_offset']=_0x5f5c1e['offset'];const _0x138205=_0x5f5c1e['wereChangesApplied']&&!_0x5f5c1e['initData'],_0xfc0a85=_0x138205?0x0:_0x5f5c1e['data']['baseVersion'];if(_0x46442d['forEach'](_0x1c3b8c=>{_0x1c3b8c['_isInit']=!0x0,_0x1c3b8c['createdAt']=_0x5f5c1e['sessionCreatedAt'],_0x1c3b8c['_authorId']=null;}),_0x138205)_0x2b2a91=_0x46442d,this['_applyOperationsSet'](_0x2b2a91,_0x138205);else{if(_0x5f5c1e['initData']){const _0x5c86e8=this['_getOperationsFromInitData'](_0x5f5c1e['initData']);this['_document']['history']['version']=-_0x5c86e8['length'],_0x5c86e8['forEach'](_0x283441=>{_0x283441['baseVersion']-=_0x5c86e8['length'],_0x283441['createdAt']=_0x5f5c1e['sessionCreatedAt'],_0x283441['_isInit']=!0x0,_0x283441['_authorId']=null;}),this['_applyOperationsSet'](_0x5c86e8,!0x0),this['serverHistory']['version']=-_0x5c86e8['length']+this['_offset'],this['_updateServerHistory'](_0x5c86e8);}this['_document']['history']['version']=_0xfc0a85,_0x2b2a91=this['_decompressOperations'](_0x5f5c1e['data'],_0x5f5c1e['metadata']),await this['_fetchMissingUsers'](_0x2b2a91),this['_applyOperationsSet'](_0x2b2a91,_0x138205);}_0x5f5c1e['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2b2a91,_0x5f5c1e['lastOperationId']),this['_lastSyncedOperationId']=_0x5f5c1e['lastOperationId']),this['serverHistory']['version']=_0xfc0a85+this['_offset'],this['_updateServerHistory'](_0x2b2a91),_0x46442d['filter'](_0x14eeb2=>{const _0x19b234=this['_getAffectedRoot'](_0x14eeb2);return _0x19b234&&!this['_knownRootNames']['has'](_0x19b234);})['forEach']((_0x345f7a,_0x37ae72)=>{_0x345f7a['baseVersion']=this['_document']['version']+_0x37ae72,this['_saveOperationInBuffer'](_0x345f7a);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4a48f8,_0x305c2a){const _0x5128f7=_0x305c2a&&_0x305c2a['message'];if(_0x5128f7&&_0x5128f7['startsWith']('realtimecollaborationclient'))throw _0x305c2a;const _0x15601d=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x15601d['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x30f693(_0x4a48f8,this['editor'],_0x5128f7?{'originalError':_0x5128f7}:void 0x0);}['_saveOperationInBuffer'](_0xb213c){this['_knownOperations']['has'](_0xb213c)||(this['_knownOperations']['add'](_0xb213c),this['_bufferedOperations']['push'](_0xb213c),this['_pendingAction']||'marker'==_0xb213c['type']&&!_0xb213c['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3ced10=!0x1){!_0x3ced10&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x131c27=>{_0x131c27&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x38a765=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x20d53b){return _0x20d53b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x20d53b['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x20d53b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x38a765)||this['_crash'](_0x38a765['message'],_0x38a765);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x4a9f3d=>{this['on']('change:_isPendingUpdate',()=>{_0x4a9f3d();});});}async['_sendBufferedOperations'](){const _0x55134d=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x55134d['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x405449=[...this['_bufferedOperations']];for(const _0x3eb494 of _0x405449)_0x3eb494['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3eb494);const _0x2de3b8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x405449),_0x516656=Q++,_0x5d269f=this['_compressOperations'](_0x405449),_0x572466=await this['_service']['sendOperations'](_0x5d269f,_0x5d269f['baseVersion'],_0x2de3b8);try{return await this['_handleServerResponse'](_0x405449,_0x572466,_0x516656);}catch(_0x315e78){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x315e78);}}async['_handleServerResponse'](_0x3179e7,_0x4a1221,_0x4d85cd){if('error'in _0x4a1221)throw _0x4a1221['error'];let _0x4174cd=!0x1;if(_0x4a1221['wereChangesApplied']){_0x4a1221['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4a1221['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x18e395=>!_0x3179e7['includes'](_0x18e395));for(const _0xc10254 of _0x3179e7)_0xc10254['createdAt']='lastOperationAcceptedAt'in _0x4a1221&&_0x4a1221['lastOperationAcceptedAt']||void 0x0;Y(_0x3179e7,_0x4a1221['version']-_0x3179e7['length']),this['_updateServerHistory'](_0x3179e7);const _0x34abc2=_0x3179e7['filter'](_0x59cf53=>{if(!_0x59cf53['_isInit'])return!0x1;const _0x218197=this['_getAffectedRoot'](_0x59cf53);return _0x218197&&!this['_knownRootNames']['has'](_0x218197);});Y(_0x34abc2,this['_document']['version']),this['_applyOperationsSet'](_0x34abc2),_0x4174cd=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x2880d8=this['_decompressOperations'](_0x4a1221['data'],_0x4a1221['metadata'])['filter'](_0x25ac29=>_0x25ac29['baseVersion']>=this['_lastServerVersion']);_0x2880d8['forEach'](_0x587aa2=>this['_addKnownRoot'](_0x587aa2)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x51b191=>!_0x51b191['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x51b191))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x2880d8),_0x4174cd=this['_handleExternalOperations'](_0x2880d8,_0x4a1221['version'],_0x4a1221['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4174cd?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2b2b42,_0x4ea9ce,_0x19503e){try{const _0x2882f5={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4e2eff,operationsB:_0x59d65b,originalOperations:_0x1d31e7}=_0x417964(_0x2b2b42,this['_bufferedOperations'],_0x2882f5);Y(_0x4e2eff,this['_document']['version']),Y(_0x59d65b,_0x4ea9ce);for(const _0x4d61eb of _0x4e2eff){const _0x45609b=_0x1d31e7['get'](_0x4d61eb);_0x4d61eb['_authorId']=_0x45609b?_0x45609b['_authorId']:null;}_0x19503e&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2b2b42,_0x19503e),this['_lastSyncedOperationId']=_0x19503e),this['_bufferedOperations']=[..._0x59d65b],this['_applyOperationsSet'](_0x4e2eff),this['_updateServerHistory'](_0x2b2b42);}catch(_0x482c10){return console['error'](_0x482c10),!0x1;}return!0x0;}['_applyOperationsSet'](_0x18c0dc,_0x314442=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4d2094=>{for(const _0x53341a of _0x18c0dc)this['_knownOperations']['add'](_0x53341a),this['_addKnownRoot'](_0x53341a),_0x4d2094['batch']['addOperation'](_0x53341a),this['editor']['model']['applyOperation'](_0x53341a);});}['_addKnownRoot'](_0x5a81dc){const _0x16077e=this['_getAffectedRoot'](_0x5a81dc);_0x16077e&&this['_knownRootNames']['add'](_0x16077e);}['_getAffectedRoot'](_0x56a9e4){let _0x3a48b4,_0x39da59;switch(_0x56a9e4['type']){case'insert':_0x3a48b4=_0x56a9e4['position']['root'];break;case'marker':if(_0x39da59=_0x56a9e4['newRange'],!_0x39da59)return null;_0x3a48b4=_0x39da59['root'];break;case'addRootAttribute':_0x3a48b4=_0x56a9e4['root'];break;case'addRoot':_0x3a48b4=_0x56a9e4['affectedSelectable'];break;case'move':_0x3a48b4=_0x56a9e4['targetPosition']['root'];break;default:return null;}return _0x3a48b4['rootName'];}['_updateServerHistory'](_0x4c6087){_0x4c6087['forEach'](_0x5c6207=>{const _0x508929=_0x5c6207['clone']();_0x508929['_authorId']=_0x5c6207['_authorId'],_0x508929['_isInit']=!!_0x5c6207['_isInit'],_0x508929['createdAt']=_0x5c6207['createdAt'],_0x508929['baseVersion']+=this['_offset'],_0x5c6207['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x508929),this['serverHistory']['addOperation'](_0x508929);});}['_handleReconnectionError'](_0x236c22){const _0x57121e=this['editor']['plugins']['get']('Notification'),_0x2b1e30=this['editor']['locale'];_0x236c22||(_0x236c22=$(_0x2b1e30,'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.')),_0x57121e['showWarning'](_0x236c22,{'title':$(_0x2b1e30,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x53b958)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x53b958)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x3a8898){const _0x3f1997=_0x3a8898['map'](_0x5e293e=>_0x5e293e['toJSON']());return this['_compressor']['compress'](_0x3f1997);}['_decompressOperations'](_0x3f37d5,_0x3dad06){return this['_compressor']['decompress'](_0x3f37d5)['map']((_0x2668f0,_0x516be1)=>{const _0x53a56f='init'==_0x3dad06[_0x516be1]['type'];if('InsertOperation'==_0x2668f0['__className']){const _0x18be89=_0x2668f0['position']['root'];!this['_document']['getRoot'](_0x18be89)&&(this['_document']['createRoot']('$root',_0x18be89)['_isAttached']=!0x1);}const _0x140a3e=_0x2b0580['fromJSON'](_0x2668f0,this['_document']);return _0x140a3e['wasUndone']=_0x2668f0['wasUndone'],_0x140a3e['_isInit']=_0x53a56f,_0x140a3e['_authorId']=_0x53a56f?null:_0x3dad06[_0x516be1]['userId'],_0x140a3e['_isDisconnection']='cs:removeUser'===_0x3dad06[_0x516be1]['type'],_0x140a3e['createdAt']=_0x3dad06[_0x516be1]['createdAt'],_0x140a3e;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0xcb5f66=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0xcb5f66&&_0xcb5f66['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x568dc4,_0x3cc55a){for(const _0x14ee1c of _0x568dc4)_0x14ee1c['baseVersion']=_0x3cc55a++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0xce9941){this['_ignoredOperations']=_0xce9941,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xcba047){let _0x5beb65=_0xcba047['length'];for(;_0x5beb65--;){const _0x13c842=_0xcba047[_0x5beb65];if(!this['_ignoredOperations']['has'](_0x13c842)){if(!this['_operationToId']['has'](_0x13c842)){const _0x84890=_0x25094b()['slice'](0x1,0x12);this['_operationToId']['set'](_0x13c842,_0x84890);}return this['_operationToId']['get'](_0x13c842);}}}['setIdForTheLastOperation'](_0x3b4a9a,_0x6b391f){if(!_0x6b391f)return;let _0x38e1df=_0x3b4a9a['length'];for(;_0x38e1df--;){const _0x1d3d63=_0x3b4a9a[_0x38e1df];this['_ignoredOperations']['has'](_0x1d3d63)||this['_operationToId']['set'](_0x1d3d63,_0x6b391f);}}}class a extends _0x25e6f2{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0xd3e8aa{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x3f87de)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x31dbe9];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x438042){super(_0x438042),this['_services']=new Map();}async['init'](){const _0x26e3fd=this['context'],_0x8ac9ab=_0x26e3fd['plugins']['get']('CommentsRepository');if(_0x26e3fd['plugins']['get'](n)['addToReconnectionStack'](this),_0x8ac9ab['adapter']={'addCommentThread':async({channelId:_0x32b8fb,threadId:_0x5767e9,comments:_0x5cb43b,resolvedAt:_0x35a4ec,resolvedBy:_0x5a68d2,context:_0x5edbd8,attributes:_0x589aef})=>{const _0x3398df=await this['_getService'](_0x32b8fb)['addCommentThread']({'commentThreadId':_0x5767e9,'comments':_0x5cb43b['map'](_0x2ed691=>function(_0x31288e,_0x18cd45,_0x29c149){return{'commentThreadId':_0x29c149,'commentId':_0x31288e['commentId'],'userId':_0x31288e['authorId'],'content':_0x31288e['content'],'documentId':_0x18cd45,'createdAt':_0x31288e['createdAt'],'attributes':_0x31288e['attributes']||{}};}(_0x2ed691,_0x32b8fb,_0x5767e9)),'resolvedAt':_0x35a4ec,'resolvedBy':_0x5a68d2,'context':_0x5edbd8,'attributes':_0x589aef})['catch'](at);return{'threadId':_0x3398df['commentThreadId'],'comments':_0x3398df['comments']};},'getCommentThread':async({channelId:_0x4a2bf1,threadId:_0x205f40})=>{const _0xcd86f8=await this['_getService'](_0x4a2bf1)['getCommentThread'](_0x205f40)['catch'](F)['catch'](at);return _0xcd86f8?_0xcd86f8['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0xcd86f8]),{'threadId':_0xcd86f8['commentThreadId'],'comments':_0xcd86f8['comments']['map'](S),'context':_0xcd86f8['context'],'resolvedAt':_0xcd86f8['resolvedAt'],'resolvedBy':_0xcd86f8['resolvedBy'],'attributes':_0xcd86f8['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3cc539,threadId:_0x21e9d2,context:_0x6f087d,unlinkedAt:_0x3c7ccd,attributes:_0x16c534})=>this['_getService'](_0x3cc539)['updateCommentThread']({'commentThreadId':_0x21e9d2,'context':_0x6f087d,'attributes':_0x16c534,'unlinkedAt':_0x3c7ccd})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x3e696a,threadId:_0x643f19})=>{const _0x51523c=await this['_getService'](_0x3e696a)['resolveCommentThread'](_0x643f19)['catch'](F)['catch'](at);return{'threadId':_0x51523c['commentThreadId'],'resolvedAt':_0x51523c['resolvedAt'],'resolvedBy':_0x51523c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3cd763,threadId:_0x4e2a35})=>this['_getService'](_0x3cd763)['reopenCommentThread'](_0x4e2a35)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0xfa297f,threadId:_0x1c65e3})=>this['_getService'](_0xfa297f)['removeCommentThread'](_0x1c65e3)['catch'](F)['catch'](at),'addComment':({channelId:_0xf06df1,threadId:_0x4ac1a9,commentId:_0x1285f6,content:_0x3d69fe,attributes:_0xed5e17})=>this['_getService'](_0xf06df1)['addComment'](_0x4ac1a9,_0x1285f6,_0x3d69fe,_0xed5e17)['catch'](at),'updateComment':({channelId:_0x27a0ee,threadId:_0x5baa3c,commentId:_0x1390ab,content:_0xc3f26f,attributes:_0x16e5b9})=>this['_getService'](_0x27a0ee)['updateComment'](_0x5baa3c,_0x1390ab,_0xc3f26f,_0x16e5b9)['catch'](F)['catch'](at),'removeComment':({channelId:_0x2e2ecd,threadId:_0x29690d,commentId:_0x6b0a7e})=>this['_getService'](_0x2e2ecd)['removeComment'](_0x29690d,_0x6b0a7e)['catch'](F)['catch'](at)},_0x26e3fd instanceof _0x5e153d){const _0x2b581d=_0x26e3fd['config']['get']('collaboration.channelId'),_0x28b7ea=_0x26e3fd['plugins']['get'](i);await this['_setUpService'](_0x2b581d);const _0x51806b=await this['_services']['get'](_0x2b581d)['getConnectedSessions']();this['listenTo'](_0x28b7ea,'sessionAdd:'+_0x2b581d,(_0x560507,{session:_0x2ef81d})=>{_0x2ef81d['id']===_0x28b7ea['mySessionId']&&(_0x560507['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2ef81d['permissions'],_0x2b581d));}),_0x28b7ea['register'](_0x2b581d,_0x51806b);}}async['_setUpService'](_0x4b6698){if(this['_services']['has'](_0x4b6698))throw new _0x30f693('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4b6698});const _0x4046c0=this['context']['plugins']['get']('CommentsRepository'),_0x559654=new s['CommentsService'](_0x4b6698);this['_services']['set'](_0x4b6698,_0x559654),this['listenTo'](_0x559654,'commentThreadAdded',(_0xbf7a28,_0x216199)=>{const {commentThreadId:_0x4a853d,documentId:_0x214beb,context:_0x1cd0c0,attributes:_0x54c541,resolvedAt:_0x2b7c40,resolvedBy:_0x2b120c,comments:_0x17d59d}=_0x216199;_0x4046c0['getCommentThread'](_0x4a853d)||_0x4046c0['addCommentThread']({'threadId':_0x4a853d,'channelId':_0x214beb,'comments':_0x17d59d?_0x17d59d['map'](S):[],'context':_0x1cd0c0,'attributes':_0x54c541,'resolvedAt':_0x2b7c40,'resolvedBy':_0x2b120c,'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadUpdated',(_0x3c40b6,{commentThreadId:_0x1480a9,documentId:_0x1e4df3,context:_0xf4dc9,unlinkedAt:_0x4277a7,attributes:_0x36d2fc})=>{_0x4046c0['getCommentThread'](_0x1480a9)&&_0x4046c0['updateCommentThread']({'threadId':_0x1480a9,'channelId':_0x1e4df3,'context':_0xf4dc9,'unlinkedAt':_0x4277a7,'attributes':_0x36d2fc,'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadResolved',(_0x30b8c4,{commentThreadId:_0x2f4bc6,resolvedBy:_0xfebd65,resolvedAt:_0x1c09f1})=>{const _0x554a4e=_0x4046c0['getCommentThread'](_0x2f4bc6);_0x554a4e&&_0x554a4e['resolve']({'resolvedBy':_0xfebd65,'resolvedAt':_0x1c09f1,'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadReopened',(_0x191ff4,{commentThreadId:_0x243049})=>{const _0x26e2fd=_0x4046c0['getCommentThread'](_0x243049);_0x26e2fd&&_0x26e2fd['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadRemoved',(_0xac9ae8,{commentThreadId:_0x463188})=>{const _0x47fae4=_0x4046c0['getCommentThread'](_0x463188);_0x47fae4&&_0x47fae4['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentAdded',(_0x5c4287,_0x222913)=>{const _0x308584=_0x222913['commentThreadId'],_0x221c35=_0x4046c0['getCommentThread'](_0x308584);_0x221c35&&_0x221c35['addComment']({...S(_0x222913),'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentUpdated',(_0x34a174,{commentThreadId:_0x28d150,commentId:_0x3a69f6,content:_0x168c68,attributes:_0x2d3b3f})=>{const _0x3e14ab=_0x4046c0['getCommentThread'](_0x28d150);if(_0x3e14ab){const _0x49c148=_0x3e14ab['getComment'](_0x3a69f6);_0x49c148&&_0x49c148['update']({'content':_0x168c68,'attributes':_0x2d3b3f,'isFromAdapter':!0x0});}}),this['listenTo'](_0x559654,'commentRemoved',(_0x17e89b,{commentThreadId:_0x4b819f,commentId:_0x1691b8})=>{const _0x4a741e=_0x4046c0['getCommentThread'](_0x4b819f);if(_0x4a741e){const _0x224f39=_0x4a741e['getComment'](_0x1691b8);_0x224f39&&_0x224f39['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4b6698);}['destroy'](){if(this['context']instanceof _0x5e153d){const _0x382479=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x382479);}}['_terminateService'](_0x350c5f){if(!this['_services']['has'](_0x350c5f))throw new _0x30f693('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x350c5f});this['_getService'](_0x350c5f)['disconnect'](),this['_services']['delete'](_0x350c5f);}async['reconnect'](){for(const _0x522da9 of this['_services']['keys']())await this['_connectService'](_0x522da9);if(this['context']instanceof _0x5e153d){const _0x3540c3=this['context']['config']['get']('collaboration.channelId'),_0x4c53e1=this['context']['plugins']['get'](i);_0x4c53e1['unregister'](_0x3540c3);const _0xc0a60=await this['_services']['get'](_0x3540c3)['getConnectedSessions']();_0x4c53e1['register'](_0x3540c3,_0xc0a60);}}async['_connectService'](_0x3d7ca7){const {connection:_0x216c90}=this['context']['plugins']['get'](n),_0x43b4b4=this['context']['plugins']['get']('CommentsRepository'),_0x203b37=this['_services']['get'](_0x3d7ca7),_0x58cb1e=await _0x203b37['connect'](_0x216c90);await this['_fetchMissingUsersForThreads'](_0x58cb1e);const _0x1f7b9f=new Set(Array['from'](_0x43b4b4['getCommentThreads']({'channelId':_0x3d7ca7}),_0x225c70=>_0x225c70['id']));for(const _0x3ed929 of _0x58cb1e)_0x3ed929['deletedAt']||_0x1f7b9f['delete'](_0x3ed929['commentThreadId']);for(const _0x930f8 of _0x1f7b9f)_0x43b4b4['getCommentThread'](_0x930f8)['remove']({'isFromAdapter':!0x0});for(const _0x39dccd of _0x58cb1e){let _0x460667=_0x43b4b4['getCommentThread'](_0x39dccd['commentThreadId']);const {commentThreadId:_0x34097d,context:_0x5f52fe,attributes:_0x384d55,resolvedBy:_0x3e60c1,resolvedAt:_0x40296c,unlinkedAt:_0x387a31,deletedAt:_0x1f29cd}=_0x39dccd;if(_0x1f29cd)continue;_0x460667||(_0x460667=_0x43b4b4['addCommentThread']({'channelId':_0x3d7ca7,'threadId':_0x34097d,'context':_0x5f52fe,'attributes':_0x384d55||{},'resolvedBy':_0x3e60c1,'resolvedAt':_0x40296c,'unlinkedAt':_0x387a31,'isFromAdapter':!0x0}));const _0x4b77cb=new Set(Array['from'](_0x460667['comments'],_0x4e2981=>_0x4e2981['id']));for(const _0x1f33f2 of _0x39dccd['comments'])_0x4b77cb['delete'](_0x1f33f2['commentId']);for(const _0x211cd5 of _0x4b77cb)_0x460667['getComment'](_0x211cd5)['remove']({'isFromAdapter':!0x0});for(const _0x7f06fa of _0x39dccd['comments']){const _0x40dfc5=_0x460667['getComment'](_0x7f06fa['commentId']);_0x40dfc5?_0x40dfc5['content']!==_0x7f06fa['content']&&_0x40dfc5['update']({'content':_0x7f06fa['content'],'isFromAdapter':!0x0}):_0x460667['addComment'](Object['assign'](S(_0x7f06fa),{'isFromAdapter':!0x0}));}}}['_getService'](_0xf9fe84){if(!this['_services']['has'](_0xf9fe84))throw new _0x30f693('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xf9fe84});return this['_services']['get'](_0xf9fe84);}async['_fetchMissingUsersForThreads'](_0x3f4348){const _0x3fbc3a=this['context']['plugins']['get'](_0x31dbe9),{connection:_0x1e6b57}=this['context']['plugins']['get'](n),_0x20399c=new Set();for(const {resolvedBy:_0x536270,comments:_0x5b5ef1}of _0x3f4348){_0x536270&&!_0x3fbc3a['getUser'](_0x536270)&&_0x20399c['add'](_0x536270);for(const {userId:_0x5544a6}of _0x5b5ef1)_0x3fbc3a['getUser'](_0x5544a6)||_0x20399c['add'](_0x5544a6);}if(0x0===_0x20399c['size'])return;const _0x16b6df=await ct['getMany'](_0x1e6b57,Array['from'](_0x20399c));for(const _0x2af7ec of _0x16b6df)_0x3fbc3a['getUser'](_0x2af7ec['id'])||_0x3fbc3a['addUser'](_0x2af7ec);}}async function F(_0x22d904){if('404'!==_0x22d904['code'])throw _0x22d904;}function at(_0xa2d506){if((_0x43c7d7=_0xa2d506)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x43c7d7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x43c7d7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x43c7d7;throw _0xa2d506;}function S(_0x560fd5){return{'threadId':_0x560fd5['commentThreadId'],'commentId':_0x560fd5['commentId'],'content':_0x560fd5['content'],'createdAt':_0x560fd5['createdAt'],'authorId':_0x560fd5['userId'],'attributes':_0x560fd5['attributes']||{}};}class m extends _0x25e6f2{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9ae782){super(_0x9ae782);const _0x4bda1f=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4bda1f);}['init'](){const _0x553083=this['editor']['plugins']['get'](n),_0x4986f4=this['editor']['plugins']['get']('TrackChangesEditing');return _0x4986f4['adapter']={'getSuggestion':async _0x11f6f0=>{await this['_waitForServiceReady']();const _0xe2d58f=await this['_trackChangesService']['get'](_0x11f6f0)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0xe2d58f]),_0xe2d58f;},'addSuggestion':async({id:_0x21180a,type:_0x535b25,data:_0x4320c6,originalSuggestionId:_0x5bda73,attributes:_0x229ccb})=>{await this['_waitForServiceReady']();const _0x28f6be={'id':_0x21180a,'type':_0x535b25,'data':_0x4320c6,'originalSuggestionId':_0x5bda73,'attributes':_0x229ccb},_0x216eb7=await this['_trackChangesService']['add'](_0x21180a,_0x535b25,_0x4320c6,_0x5bda73,_0x229ccb)['catch'](_0x419652=>{if(ht(_0x419652))return new Promise(_0x3d2cd9=>{this['_bufferedRequests']['set'](_0x21180a,{'resolve':_0x3d2cd9,'suggestionData':_0x28f6be});});throw _0x419652;});return this['_bufferedRequests']['delete'](_0x21180a),_0x216eb7;},'updateSuggestion':async(_0x1337b5,_0x253e66)=>{if(await this['_waitForServiceReady'](),'open'!==_0x253e66['state'])return this['_trackChangesService']['update'](_0x1337b5,_0x253e66)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x3631d3,_0x5a79e8)=>{_0x4986f4['hasSuggestion'](_0x5a79e8['id'])&&(_0x4986f4['getSuggestion'](_0x5a79e8['id'])['attributes']=_0x5a79e8['attributes']);}),this['_trackChangesService']['connect'](_0x553083['connection'])['then'](_0x2bc027=>(_0x553083['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2bc027)['then'](()=>{for(const _0x2524dc of _0x2bc027){_0x4986f4['addSuggestionData'](_0x2524dc)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5573c4=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1756df}=this['editor']['plugins']['get'](n),_0x282bf3=await this['_trackChangesService']['connect'](_0x1756df);await this['_fetchMissingUsersForThreads'](_0x282bf3);for(const {suggestionData:_0x903966,resolve:_0x5e00b6}of this['_bufferedRequests']['values']()){let _0x2092e2=_0x282bf3['find'](_0x267af2=>_0x267af2['id']===_0x903966['id']);_0x2092e2||(_0x2092e2=await this['_trackChangesService']['add'](_0x903966['id'],_0x903966['type'],_0x903966['data'],_0x903966['originalSuggestionId'])),_0x5e00b6(_0x2092e2);}for(const _0x2a5972 of _0x282bf3)_0x5573c4['hasSuggestion'](_0x2a5972['id'])||_0x5573c4['addSuggestionData'](_0x2a5972);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x51976e=>{this['listenTo'](this['_trackChangesService'],'connected',_0x562d03=>{_0x562d03['off'](),_0x51976e();});});}async['_fetchMissingUsersForThreads'](_0x4d2c1f){const _0x1d8ad2=this['editor']['plugins']['get'](_0x31dbe9),{connection:_0x2970cc}=this['editor']['plugins']['get'](n),_0x3f71b0=new Set();for(const {authorId:_0x944054}of _0x4d2c1f)_0x1d8ad2['getUser'](_0x944054)||_0x3f71b0['add'](_0x944054);if(0x0===_0x3f71b0['size'])return;const _0x27556e=await ct['getMany'](_0x2970cc,Array['from'](_0x3f71b0));for(const _0x25a647 of _0x27556e)_0x1d8ad2['getUser'](_0x25a647['id'])||_0x1d8ad2['addUser'](_0x25a647);}}function k(_0x5cbc7d){if(ht(_0x5cbc7d))return new Promise(()=>{});throw _0x5cbc7d;}function ht(_0xaa1c46){return _0xaa1c46['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xaa1c46['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x25e6f2{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3468ab=this['editor']['plugins']['get'](n),_0x387b0f=this['editor']['plugins']['get']('CommentsEditing'),_0x550146=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3468ab,'change:state',(_0xe6b296,_0x38cb01,_0x5bc166)=>{_0x387b0f['isThreadsLoadingPaused']='connected'!==_0x5bc166;});}),this['listenTo'](_0x3468ab,'change:state',(_0x3507c4,_0x3d014b,_0x4461b1)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x4461b1);}),_0x550146['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x25e6f2{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x25e6f2{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0xbde25a)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x31dbe9];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x109caa){super(_0x109caa);const _0x3e73e6=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x3e73e6);}async['init'](){const _0x5b5bb7=this['editor']['plugins']['get'](l),_0x47bdd8=_0x5b5bb7['serverHistory'],_0x3f51a3=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x47bdd8,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5b5bb7['sessionId']});const _0x5f4711=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x55dc8a=await _0x9c7fbf['isBundleUploaded'](_0x3f51a3['connection'],_0x5f4711);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1f364c})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1f364c)),'updateRevisions':async _0x548b14=>{await this['_waitForServiceReady']();const _0x5c2dd9=this['_revisionTracker']['currentRevision'];if(_0x55dc8a&&0x1===_0x548b14['length']&&_0x548b14[0x0]['id']===_0x5c2dd9['id'])return _0x548b14;for(const _0x42c44d of _0x548b14)_0x42c44d['id']===_0x5c2dd9['id']&&(_0x42c44d['isEmptyCurrent']=_0x42c44d['fromVersion']===_0x42c44d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x548b14,this['_lastRequestId'])['then'](_0x5808fd=>(this['_lastRequestId']=_0x5808fd,_0x548b14))['catch'](_0x3dfde3=>{if(q(_0x3dfde3)||'400'===_0x3dfde3['code']&&void 0x0!==_0x3dfde3['data']['wrongRequestId']){for(const _0x1ae0f7 of _0x548b14){!this['_revisionTracker']['repository']['getRevision'](_0x1ae0f7['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1ae0f7['id'],_0x1ae0f7,!0x1);}if(q(_0x3dfde3))throw _0x3dfde3;return _0x548b14;}throw _0x3dfde3;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x248be5,{revisionsData:_0x1c2330,requestId:_0x25b666})=>{Math['max'](..._0x1c2330['map'](_0x14e5cb=>_0x14e5cb['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1c2330,_0x25b666);}):this['_handleRevisionsUpdate'](_0x1c2330,_0x25b666);});const {revisions:_0x13d796,requestId:_0x36017e}=await this['_revisionHistoryService']['connect'](_0x3f51a3['connection']);_0x3f51a3['addToReconnectionStack'](this),this['_lastRequestId']=_0x36017e,await this['_fetchMissingUsers'](_0x13d796);for(const _0x3737e2 of _0x13d796)this['_revisionTracker']['addRevisionData'](_0x3737e2);this['listenTo'](_0x5b5bb7,'change:_isConnected',(_0x477cb5,_0x2a485c,_0x3acce6)=>{_0x3acce6&&(this['_oldOffset']=_0x5b5bb7['_offset'],_0x477cb5['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3f51a3,'state',_0x2059e1=>_0x2059e1===_0x36ce39['CONNECTED']);}async['reconnect'](){const _0x3e87aa=this['editor']['plugins']['get'](n),_0x584678=this['editor']['plugins']['get'](l),_0x161c54=async()=>{const _0x3eadda=this['_revisionTracker']['currentRevision'],_0x1d137f=_0x3eadda['id'],_0x4bf3bf=_0x1d137f!==_0x584678['sessionId'];if(_0x4bf3bf){const _0x2069f4=_0x584678['_offset']-this['_oldOffset'],_0x29293f=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x3eadda['toVersion']+_0x2069f4!==_0x29293f){const _0x5faf31=_0x3eadda['fromVersion']+_0x2069f4,_0x538ac5=this['editor']['plugins']['get'](_0x31dbe9),_0x458181=this['_revisionTracker']['buildRevisionData']({'revision':_0x3eadda,'from':_0x5faf31,'to':_0x29293f});_0x458181['id']=_0x3eadda['id'];const _0x13897e=_0x458181['authorsIds']['map'](_0x1b9ce3=>_0x538ac5['getUser'](_0x1b9ce3));_0x3eadda['_update']({..._0x458181,'authors':_0x13897e},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x3eadda['id'],_0x458181,!0x0);}this['_revisionTracker']['_startingVersion']=_0x29293f,(_0x3eadda['toVersion']===_0x3eadda['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x1d137f)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x1d137f),this['_revisionTracker']['_createCurrentRevision'](_0x29293f));}const {revisions:_0x315384,requestId:_0x38457b}=await this['_revisionHistoryService']['reconnect'](_0x3e87aa['connection'],this['_lastRequestId']);_0x4bf3bf&&_0x315384['length']>0x0?_0x584678['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x315384),this['_handleRevisionsUpdate'](_0x315384,_0x38457b),this['_revisionTracker']['sendBufferedUpdates']());};return _0x584678['_isConnected']?_0x161c54():new Promise((_0x4c5675,_0x885f4f)=>{_0x584678['once']('change:_isConnected',()=>{_0x161c54()['then'](_0x4c5675)['catch'](_0x885f4f);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5ee1e6=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0xb6243e=>{_0xb6243e['off'](),_0x5ee1e6();});});}['_getLatestVersionFromServerOperations'](){const _0x24e2ff=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2660e5 of _0x24e2ff)if('marker'!==_0x2660e5['type']||_0x2660e5['affectsData'])return _0x2660e5['baseVersion']+0x1;}['_getLatestVersion'](){const _0x939813=this['editor']['plugins']['get'](l);return new Promise(_0xb7b4d8=>{_0x939813['_isPendingUpdate']?_0x939813['once']('change:_isPendingUpdate',()=>{_0xb7b4d8(this['_getLatestVersionFromServerOperations']());}):_0xb7b4d8(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x26c684,_0x3f90fb){const _0x5745dd=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3f90fb;for(const _0x12a9c0 of _0x26c684){const _0x43a35f=_0x5745dd['getRevision'](_0x12a9c0['id']);if(_0x43a35f){if((_0x12a9c0['fromVersion']||_0x12a9c0['toVersion'])&&(_0x12a9c0['diffData']=null),_0x43a35f===this['_revisionTracker']['currentRevision']){const _0x21e08f=Math['max'](_0x43a35f['toVersion'],_0x12a9c0['toVersion']),_0x105aca=Math['max'](_0x43a35f['fromVersion'],_0x12a9c0['fromVersion']);let _0x2613b6;_0x43a35f['toVersion']===_0x12a9c0['toVersion']&&_0x43a35f['fromVersion']===_0x12a9c0['fromVersion']?(_0x2613b6=!0x0,this['_preventResendingRevisionData'](_0x12a9c0)):_0x12a9c0['toVersion']===_0x21e08f&&_0x12a9c0['fromVersion']===_0x105aca?_0x2613b6=!0x1:(_0x43a35f['toVersion']===_0x21e08f&&_0x43a35f['fromVersion']===_0x105aca||this['_fixRevision']({'revision':_0x43a35f,'from':_0x105aca,'to':_0x21e08f}),_0x2613b6=!0x0),_0x2613b6&&(delete _0x12a9c0['fromVersion'],delete _0x12a9c0['toVersion'],delete _0x12a9c0['diffData'],delete _0x12a9c0['createdAt'],delete _0x12a9c0['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x12a9c0),this['_preventResendingRevisionData'](_0x12a9c0);}else this['_revisionTracker']['addRevisionData'](_0x12a9c0);}const _0x976de7=_0x5745dd['getRevisions']();_0x976de7['reverse']();for(let _0x1c26c6=0x0;_0x1c26c6<_0x976de7['length']-0x1;_0x1c26c6++){const _0x2b6d8c=_0x976de7[_0x1c26c6],_0x4f12a0=_0x976de7[_0x1c26c6+0x1];if(_0x2b6d8c['fromVersion']<_0x4f12a0['toVersion']){const _0x5a1326=_0x4f12a0['toVersion'],_0x30fd17=Math['max'](_0x5a1326,_0x2b6d8c['toVersion']);this['_fixRevision']({'revision':_0x2b6d8c,'from':_0x5a1326,'to':_0x30fd17});}}}['_fixRevision']({revision:_0x26520b,from:_0x51ad3b,to:_0x5e08c2}={}){const _0x15cc2c=this['editor']['plugins']['get'](_0x31dbe9),_0x167ee0=this['_revisionTracker']['buildRevisionData']({'revision':_0x26520b,'from':_0x51ad3b,'to':_0x5e08c2});_0x167ee0['authors']=_0x167ee0['authorsIds']['map'](_0x468a43=>_0x15cc2c['getUser'](_0x468a43)),_0x26520b['_update'](_0x167ee0);}['_preventResendingRevisionData'](_0x5419c9){const _0x4e5425={};_0x4e5425['id']=_0x5419c9['id'];for(const _0x890383 of Object['keys'](_0x5419c9))'id'!==_0x890383&&(_0x4e5425[_0x890383]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4e5425['id'],_0x4e5425,!0x0);}async['_fetchMissingUsers'](_0x226dc6){const _0x2c7316=this['editor']['plugins']['get'](_0x31dbe9),{connection:_0x149203}=this['editor']['plugins']['get'](n),_0x10f01c=new Set();for(const _0x216a69 of _0x226dc6){for(const _0x37fb6a of _0x216a69['authorsIds'])_0x167891(_0x37fb6a);_0x216a69['creatorId']&&_0x167891(_0x216a69['creatorId']);}if(0x0===_0x10f01c['size'])return;const _0x2e82d0=await ct['getMany'](_0x149203,Array['from'](_0x10f01c));for(const _0x58bcc9 of _0x2e82d0)_0x2c7316['getUser'](_0x58bcc9['id'])||_0x2c7316['addUser'](_0x58bcc9);function _0x167891(_0x45938c){_0x2c7316['getUser'](_0x45938c)||_0x10f01c['add'](_0x45938c);}}}function q(_0x18502b){return _0x18502b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x18502b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x18502b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x25e6f2{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x57df8e{['_collapseAt'];constructor(_0x38e3ec,_0x247069=0x6){super(_0x38e3ec);const _0x2ccaf1=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x247069,this['bind']('isHidden')['to'](this,'usersCount',_0x151bc8=>_0x151bc8<_0x247069),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x2ccaf1['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x2ccaf1['to']('usersCount',_0x1fa742=>'+'+(_0x1fa742-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x57df8e{['items'];['keystrokes'];constructor(_0x37d30e){super(_0x37d30e);const _0x51406c=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x553934(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x51406c['if']('hasPopup'),'aria-expanded':_0x51406c['to']('isExpanded',_0x2d5acd=>this['hasPopup']&&String(_0x2d5acd)),'aria-label':_0x51406c['to']('hasPopup',_0xe41e97=>$(_0x37d30e,_0xe41e97?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x51406c['to']('hasPopup',_0x3f68d8=>!!_0x3f68d8&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x51406c['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x51406c['to'](_0x42c4a5=>{const _0x8d4033=_0x42c4a5,_0x3174aa=document['querySelector']('.ck-presence-list__dropdown-list'),_0x1a9c93=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3174aa?.['contains'](_0x8d4033['relatedTarget'])||_0x1a9c93?.['contains'](_0x8d4033['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x560989,_0x4d6d3b,_0x2b6ee7)=>{this['element']&&(_0x2b6ee7?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 v extends _0x57df8e{['counterView'];['inlineListView'];constructor(_0x3c05c2,_0x3013c6=0x6){super(_0x3c05c2);const _0xbf089b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x3013c6),this['inlineListView']=new is(_0x3c05c2),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2d372e of this['inlineListView']['items'])_0x2d372e['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',_0xbf089b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x57df8e{['listWrapperView'];constructor(_0x45f14c,_0x3761c1){super(_0x45f14c);const _0x318c8c=this['bindTemplate'];this['listWrapperView']=new ut(_0x45f14c,_0x3761c1),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x45f14c,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x318c8c['to'](_0x4e7993=>{const _0xc00a5d=_0x4e7993,_0x41c18f=document['querySelector']('.ck-presence-list__list'),_0x4cceb5=document['querySelector']('.ck-balloon-panel_with-arrow');_0x41c18f?.['contains'](_0xc00a5d['relatedTarget'])||_0x4cceb5?.['contains'](_0xc00a5d['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x11ceb4{constructor(_0x2dea4c,_0x11a822){super(_0x2dea4c);const _0x50bbb6=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x11a822?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x50bbb6['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x50bbb6['to']('role'),'aria-label':_0x50bbb6['to']('ariaLabel'),'aria-labelledby':_0x50bbb6['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x44b0ca['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x576dc5=this['element'];_0x576dc5&&(this['_isScrollable']=Math['max'](_0x576dc5['scrollHeight'],_0x576dc5['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x3c17c8,_0x14e040,_0xc0ed91){super(_0x3c17c8);const _0x136911=this['bindTemplate'];this['userView']=new st(_0x3c17c8,_0x14e040);const _0x400a6c={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x14e040['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x14e040['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x14e040['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xc0ed91&&(_0x400a6c['tag']='button',_0x400a6c['on']={'click':_0x136911['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x400a6c);}['focus'](){this['element']['focus']();}}class A extends _0x57df8e{['userView'];['markerView'];constructor(_0x203725,_0x44aba2,_0x3da50f){super(_0x203725);const _0x5c8e88=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x203725,_0x44aba2),this['markerView']=new ot(_0x203725,_0x44aba2);const _0x555c13=new it(_0x203725);_0x555c13['template']['tag']='span',_0x555c13['text']=_0x44aba2['name'];const _0xe2ff12={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5c8e88['to']('isFocusable',_0x2397a8=>!!_0x2397a8&&0x0),'aria-labelledby':_0x555c13['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5c8e88['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5c8e88['to']('hasTooltip',_0xbb1444=>!_0xbb1444),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x555c13]};_0x3da50f&&(_0xe2ff12['tag']='button',_0xe2ff12['on']={'click':_0x5c8e88['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xe2ff12);}}class ot extends _0x57df8e{constructor(_0xf51a62,_0x840914){super(_0xf51a62),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x840914['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0xd3e8aa{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b5ce4){super(_0x3b5ce4),this['context']['config']['define']('presenceList',x);const _0x2819c5=_0x3b5ce4['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2819c5)throw new _0x30f693('presencelist-collapseat-invalid-format',this);if(_0x2819c5<0x1)throw new _0x30f693('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0xb4bb92(),this['balloonPanelView']=new _0x4ba438(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x104ca8 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x104ca8);this['listenTo'](this['_allConnectedUsers'],'add',(_0x172a8f,_0x13c685)=>{this['_handleUserAdd'](_0x13c685);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1078d8,_0x5a42e0)=>{this['_handleUserRemove'](_0x5a42e0);});}['_createView'](){const _0x1ba3c3=this['context'],_0x4866ed=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4560ce=this['balloonPanelView'];if(!_0x3d55c6(_0x1ba3c3['config']['get']('presenceList.container')))throw new _0x30f693('presencelist-missing-container',this);return _0x4866ed['counterView']['bind']('usersCount')['to'](this),_0x4866ed['bind']('isCollapsed')['to'](this,'usersCount',_0xec40d=>{const {collapseAt:_0x1fba3a}=_0x1ba3c3['config']['get']('presenceList'),_0x1658ee=_0xec40d>=_0x1fba3a;if(_0x1658ee&&!_0x4866ed['inlineListView']['items']['find'](_0x15cdc0=>_0x15cdc0 instanceof b)){const _0x326108=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x326108&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x4866ed['inlineListView']['items']['add'](_0x4866ed['counterView']);}return _0x1658ee||this['hideDropdown'](),_0x1658ee;}),_0x4866ed['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xee2111=>{const _0x5d1fd6=_0x1ba3c3['config']['get']('presenceList'),_0x757bc5=new A(_0x1ba3c3['locale'],_0xee2111,!!_0x5d1fd6['onClick']);return _0x757bc5['bind']('hasTooltip')['to'](_0x4866ed,'isCollapsed',_0x33b23a=>!_0x33b23a),_0x757bc5['bind']('isFocusable')['to'](_0x4866ed,'isCollapsed',_0x3e5019=>!_0x3e5019),_0x5d1fd6['onClick']&&this['listenTo'](_0x757bc5,'execute',()=>{this['view']['isCollapsed']||_0x5d1fd6['onClick'](_0xee2111,_0x757bc5['element']);}),_0x757bc5;}),this['listenTo'](_0x4866ed['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x4866ed['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x4866ed['inlineListView']['keystrokes']['set']('Enter',(_0x4f1e44,_0x672cce)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x672cce());}),_0x4866ed['render'](),_0x4560ce['render'](),_0x2c85ae({'emitter':_0x4866ed,'activator':()=>_0x4560ce['isVisible'],'contextElements':[_0x4560ce['element'],_0x4866ed['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1ba3c3['config']['get']('presenceList.container')['appendChild'](_0x4866ed['element']),this['_bodyCollection']=new _0x2b3595(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x4866ed;}['_handleUserAdd'](_0x311b7d){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x311b7d['isMe'])return;const _0x2e2db7=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2e2db7-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x1ce863=_0x311b7d['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x311b7d,_0x1ce863);}['_handleUserRemove'](_0x13a4e5){this['usersCount']--;const {collapseAt:_0x4b84e6}=this['context']['config']['get']('presenceList'),_0xa33863=this['usersCount']>=_0x4b84e6;if(this['currentDisplayedUsers']['get'](_0x13a4e5['id']))this['currentDisplayedUsers']['remove'](_0x13a4e5['id']);else{if(_0xa33863&&this['currentDisplayedUsers']['length']+0x1===_0x4b84e6-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0xa33863?0x1:0x0)<this['usersCount']){for(const _0x404129 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x404129['id'])&&(this['currentDisplayedUsers']['add'](_0x404129,Math['min'](this['currentDisplayedUsers']['length']-(_0xa33863?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0xa33863?0x1:0x0)===_0x4b84e6-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4f0829=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x4f0829['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x30c6d0}=this['presenceDropdownView'];_0x30c6d0['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x453096=>{if(!_0x4f0829['displayMe']&&_0x453096['isMe'])return null;const _0x43fc8d=new j(this['context']['locale'],_0x453096,!!_0x4f0829['onClick']);return _0x4f0829['onClick']&&this['listenTo'](_0x43fc8d,'execute',()=>{_0x4f0829['onClick'](_0x453096,_0x43fc8d['element']);}),_0x43fc8d;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x30c6d0['focus'](),_0x30c6d0['checkIfScrollable']();const _0x32e31a=(_0x44a3d9,_0x31d81c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x31d81c();};_0x30c6d0['keystrokes']['set']('Esc',_0x32e31a),_0x30c6d0['keystrokes']['set']('Shift+Tab',_0x32e31a),_0x30c6d0['keystrokes']['set']('Tab',(_0x2f23fc,_0x1def47)=>{!function(_0x6068d){const _0xa3f8bd=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x30f71a=>_0x30f71a+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3ae25a=[...document['body']['querySelectorAll'](_0xa3f8bd)]['filter'](_0x173fa7=>_0x173fa7===document['activeElement']||_0x173fa7['offsetWidth']+_0x173fa7['offsetHeight']>0x0)['sort']((_0x3dc78d,_0x135f8e)=>(_0x3dc78d['tabIndex']||0x0)-(_0x135f8e['tabIndex']||0x0)),_0x5c3430=_0x3ae25a['indexOf'](_0x6068d),_0x3f0a3a=_0x3ae25a[(_0x5c3430+0x1)%_0x3ae25a['length']];_0x3f0a3a&&_0x3f0a3a['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1def47();}),_0x30c6d0['focusTracker']['add'](this['view']['element']),_0x30c6d0['focusTracker']['on']('change:isFocused',(_0x443c4c,_0x2c6750,_0x14f63d)=>{_0x14f63d||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 ft extends _0xd3e8aa{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x40a1a8,Plugin as _0x31ff,PendingActions as _0x2c44fe,Context as _0x57ac9b}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x140526,CKEditorError as _0x328f65,Collection as _0x29861b,global as _0x5e8016,version as nt,uid as _0xcb092b,KeystrokeHandler as _0x21aca9}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x12fa96,View as _0x6e663b,ListView as _0x313e4e,ListItemView as et,LabelView as it,BalloonPanelView as _0x5d09ed,clickOutsideHandler as _0x58b989,BodyCollection as _0x167620}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x15b8a4,History as _0x5d5f43,NoOperation as _0x1d09c0,InsertOperation as _0x23e88b,MarkerOperation as _0x17eeff,RootAttributeOperation as _0x450ef9,transformOperationSets as _0x16055d,OperationFactory as _0x2b56e0}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0xcf5e5e,CollaborativeEditingService as _0x399838,User as ct,CommentsService as _0x1ee08e,TrackChangesService as tt,RevisionHistoryService as _0x18bbb1,EditorService as _0x5a4c8b}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x14b601,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x28347f}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x15c0ae}from'es-toolkit/compat';class n extends _0x40a1a8{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x12fa96];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x513dc4){super(_0x513dc4),this['set']('state',_0xcf5e5e['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x140526())();}['init'](){const _0x5e286e=this['context'],_0x311e71=_0x5e286e['plugins']['get']('CloudServices'),_0x4a21f9=_0x5e286e['plugins']['get'](_0x12fa96);if(!_0x311e71['token'])throw new _0x328f65('websocketgateway-missing-token',this);if(!_0x311e71['webSocketUrl'])throw new _0x328f65('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),n['WebSocketGateway']['connect'](_0x311e71['token'],_0x311e71['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x7aff8f=>{if(this['connection']=_0x7aff8f,this['bind']('state')['to'](_0x7aff8f,'state',this,'_isBrowserOffline',(_0x4f15d9,_0x3ea633)=>('connected'!==_0x4f15d9&&(this['_shouldPluginsReconnect']=!0x0),_0x3ea633||_0x4f15d9!==_0xcf5e5e['CONNECTED']?_0xcf5e5e['DISCONNECTED']:this['state']==_0xcf5e5e['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0xcf5e5e['CONNECTING']):_0xcf5e5e['CONNECTED'])),this['connection']['on']('error',(_0x8de3f6,_0x24d31c)=>{if('limitExceeded'!==_0x24d31c['code'])throw console['error'](_0x24d31c),new _0x328f65('cloudservices-init',null,{'originalError':_0x24d31c});_0x4a21f9['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'});}),!_0x7aff8f['me'])return new Promise(_0x33a5c6=>_0x7aff8f['on']('change:me',_0x33a5c6));})['catch'](_0x5b1e00=>{throw console['error'](_0x5b1e00),new _0x328f65('cloudservices-init',null,{'originalError':_0x5b1e00});});}['addToReconnectionStack'](_0x31a4ff){if('function'!=typeof _0x31a4ff['reconnect'])throw new _0x328f65('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x31a4ff))throw new _0x328f65('websocketgateway-plugin-already-registered',this,{'name':_0x31a4ff['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x31a4ff);}['removeFromReconnectionStack'](_0x4dad9c){this['_reconnectionStack']['delete'](_0x4dad9c);}['isInReconnectionStack'](_0x3bb2d7){return this['_reconnectionStack']['has'](_0x3bb2d7);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0xd9548f=>_0xd9548f['reconnect']())))['then'](()=>this['state']=_0xcf5e5e['CONNECTED'])['catch'](_0x56de9e=>{throw console['error'](_0x56de9e),new _0x328f65('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0xcf5e5e['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x40a1a8{['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[n,_0x14b601];}constructor(_0x2d5a63){super(_0x2d5a63),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x29861b(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x14b601);}['init'](){const _0x4af3cf=this['context']['plugins']['get'](n);this['listenTo'](_0x4af3cf,'change:state',(_0x59eb88,_0x177393,_0x3193c9)=>{if('connected'!==_0x3193c9)this['channelSessions']['forEach'](_0x4ed2f1=>_0x4ed2f1['clear']()),this['channelConnectedUsers']['forEach'](_0x28c058=>_0x28c058['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x42295e,_0x38c1e0]of this['_registeredSessions'])for(const _0x116b0d of _0x38c1e0)this['_handleSessionAdd'](_0x42295e,_0x116b0d);}}),this['_createUser'](_0x4af3cf['connection']['me'],!0x0);}['register'](_0x53ad61,_0x188112){if(this['_registeredSessions']['has'](_0x53ad61))throw new _0x328f65('sessions-register-already-registered',null,{'channelId':_0x53ad61});this['_registeredSessions']['set'](_0x53ad61,_0x188112),this['channelSessions']['set'](_0x53ad61,new _0x29861b()),this['channelConnectedUsers']['set'](_0x53ad61,new _0x29861b()),this['listenTo'](_0x188112,'add',(_0x23c274,_0x53333f)=>this['_handleSessionAdd'](_0x53ad61,_0x53333f)),this['listenTo'](_0x188112,'remove',(_0x4438af,_0x31e757)=>this['_handleSessionRemove'](_0x53ad61,_0x31e757));for(const _0x4ae2f7 of _0x188112)this['_handleSessionAdd'](_0x53ad61,_0x4ae2f7);}['unregister'](_0x27b1d0){if(!this['_registeredSessions']['has'](_0x27b1d0))throw new _0x328f65('sessions-unregister-not-exist',null,{'channelId':_0x27b1d0});const _0x25bbb2=this['_registeredSessions']['get'](_0x27b1d0);this['stopListening'](_0x25bbb2);for(const _0x200e88 of _0x25bbb2)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x27b1d0,_0x200e88);this['_registeredSessions']['delete'](_0x27b1d0),this['channelSessions']['delete'](_0x27b1d0),this['channelConnectedUsers']['delete'](_0x27b1d0);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x2d8f40){for(const _0x3d2d3b of this['channelSessions']['values']())for(const _0x412fee of _0x3d2d3b)if(_0x412fee['id']===_0x2d8f40)return _0x412fee['user'];}['getUserSessions'](_0x1f6551,_0xf92878){const _0x443b1a=_0xf92878?[this['channelSessions']['get'](_0xf92878)]:this['channelSessions']['values'](),_0x1c0ce7=new Set();for(const _0x3b1f93 of _0x443b1a)for(const _0x3bd9ed of _0x3b1f93)_0x3bd9ed['user']['id']===_0x1f6551['id']&&_0x1c0ce7['add'](_0x3bd9ed['id']);return _0x1c0ce7;}['getUserRole'](_0x39b097){for(const _0x230402 of this['channelSessions']['values']())for(const _0x34275b of _0x230402)if(_0x34275b['user']===_0x39b097)return _0x34275b['role'];}['_handleSessionAdd'](_0x1cccbe,_0x52d8c0){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1fbf3b=_0x52d8c0['user'],_0x41cdfd=this['_users']['getUser'](_0x1fbf3b['id'])||this['_createUser'](_0x1fbf3b),_0x207710=Object['assign']({},_0x52d8c0,{'user':_0x41cdfd});if(this['channelSessions']['get'](_0x1cccbe)['add'](_0x207710),!_0x1fbf3b['hiddenInPresenceList']){const _0xd5197=this['channelConnectedUsers']['get'](_0x1cccbe);_0xd5197['has'](_0x41cdfd['id'])||_0xd5197['add'](_0x41cdfd),this['allConnectedUsers']['has'](_0x41cdfd['id'])||_0x1fbf3b['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x41cdfd,_0x41cdfd['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x1cccbe,{'channelId':_0x1cccbe,'session':_0x207710});}['_handleSessionRemove'](_0x589f02,_0x32e886){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x2f961a=this['channelConnectedUsers']['get'](_0x589f02),_0x24890a=_0x32e886['user'];_0x24890a['id']&&(this['channelSessions']['get'](_0x589f02)['remove'](_0x32e886['id']),_0x2f961a['has'](_0x24890a['id'])&&!this['getUserSessions'](_0x24890a,_0x589f02)['size']&&_0x2f961a['remove'](_0x24890a['id']),this['allConnectedUsers']['get'](_0x24890a['id'])&&!this['getUserSessions'](_0x24890a)['size']&&this['allConnectedUsers']['remove'](_0x24890a['id']));}['_createUser'](_0xabef22,_0x38a247){const _0x58aa13=this['_users']['addUser'](_0xabef22);return _0x38a247&&this['_users']['defineMe'](_0xabef22['id']),_0x58aa13['orderNumber']=this['_uniqueUsersCount']++,_0x58aa13;}}class G extends _0x31ff{['_domEmitter']=new(_0x140526())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4ba2bb=this['editor'],_0x3cf76b=_0x4ba2bb['plugins']['get'](i);_0x4ba2bb['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x25160d,{writer:_0x3572be})=>function(_0x5b183c,_0x2d124f,_0xa8d4cf,_0x14a5ca){const _0x9f3b28=_0x5b183c['markerName']['split'](':')[0x2],_0x1a543c=_0xa8d4cf['getUserBySessionId'](_0x9f3b28);if(!_0x1a543c||_0x9f3b28===_0xa8d4cf['mySessionId'])return;if(!_0x14a5ca['model']['schema']['checkChild'](_0x5b183c['markerRange']['start'],'$text'))return;const _0x548553={'class':'ck-user__marker\x20'+_0x1a543c['color']['getMarkerClass'](),'data-name':_0x1a543c['name'],'data-session-id':_0x9f3b28},_0x1b604e=_0x14a5ca['model']['markers']['get'](_0x5b183c['markerName']),_0x2b3a9c=_0x1b604e['getStart'](),_0x4cea91=_0x2b3a9c['nodeAfter'],_0xe9cb02=_0x14a5ca['model']['schema'];if(_0x4cea91&&_0xe9cb02['isObject'](_0x4cea91)&&_0xe9cb02['isInline'](_0x4cea91)&&!_0x14a5ca['model']['markers']['get']('user:range:'+_0x9f3b28)['getRange']()['isCollapsed'])return;const _0x1abe79=_0x2b3a9c['parent'];return _0x14a5ca['model']['schema']['isLimit'](_0x1abe79)&&!_0x14a5ca['model']['hasContent'](_0x1abe79)&&(_0x548553['contenteditable']=!0x1),function(_0xbe437c,_0x24d49d,_0xba76c1){const _0xab804e=_0xbe437c['createUIElement']('span',_0x24d49d);return _0xbe437c['setCustomProperty']('userPositionMarker',!0x0,_0xab804e),_0xab804e['render']=function(_0x4daa2b){const _0x46dafd=this['toDomElement'](_0x4daa2b),_0x3524e6=document['createElement']('span');return _0x3524e6['classList']['add']('ck-user__marker-tooltip'),_0x3524e6['setAttribute']('contenteditable','false'),_0x3524e6['setAttribute']('spellcheck','false'),_0x3524e6['textContent']=_0xba76c1['name'],_0x46dafd['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3524e6['outerHTML']+'⁠',_0x46dafd['addEventListener']('mouseenter',()=>{_0x46dafd['classList']['add']('ck-user__marker_hovered');}),_0x46dafd['addEventListener']('mouseleave',()=>{_0x46dafd['classList']['remove']('ck-user__marker_hovered');}),_0x46dafd;},_0xab804e['isSimilar']=function(_0x2d8ae5){return!(!this['getCustomProperty']('userPositionMarker')||!_0x2d8ae5['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x2d8ae5['getAttribute']('data-session-id'));},_0xab804e;}(_0x2d124f,_0x548553,_0x1a543c);}(_0x25160d,_0x3572be,_0x3cf76b,_0x4ba2bb)}),_0x4ba2bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x33bee1=>function(_0x5326cd,_0x680353){const _0xa855ac=_0x5326cd['markerName']['split'](':')[0x2];if(_0xa855ac===_0x680353['mySessionId'])return null;const _0x30f4ff=_0x680353['getUserBySessionId'](_0xa855ac);if(!_0x30f4ff)return{'id':_0xa855ac,'classes':[]};return{'id':_0xa855ac,'classes':['ck-user__selection',_0x30f4ff['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xa855ac},'priority':0x7d0+_0x30f4ff['orderNumber']};}(_0x33bee1,_0x3cf76b)}),function(_0x3c5b9a){const _0x5e8c69=_0x3c5b9a['model'],_0x394197=new Map(),_0x51956b=_0x3c5b9a['plugins']['get'](i);_0x5e8c69['markers']['on']('update:user:range',(_0x21cfc9,_0x46c71d,_0x35227c,_0x42a81d)=>{if(!_0x42a81d&&_0x394197['get'](_0x46c71d['name']))return _0x394197['get'](_0x46c71d['name'])['detach'](),void _0x394197['delete'](_0x46c71d['name']);const _0xcfb60a=_0x46c71d['name']['split'](':')[0x2];if(_0xcfb60a===_0x51956b['mySessionId'])return;const _0x554de9='user:position:'+_0xcfb60a;_0x5e8c69['markers']['has'](_0x554de9)&&_0x3c5b9a['editing']['reconvertMarker'](_0x554de9),_0x46c71d['on']('change:range',(_0x5d23e2,_0x3c90fd,_0x30abab)=>{if('$graveyard'!=_0x3c90fd['root']['rootName']&&'$graveyard'==_0x46c71d['getRange']()['root']['rootName']&&!_0x394197['has'](_0x46c71d['name'])){const _0x25a29c=_0x5e8c69['schema']['getNearestSelectionRange'](_0x30abab['deletionPosition']);if(_0x25a29c){const _0x26768b=_0x15b8a4['fromRange'](_0x25a29c);_0x394197['set'](_0x46c71d['name'],_0x26768b),_0x26768b['on']('change:range',(_0x3c5d7a,_0x4ec820,_0x374f81)=>{if('$graveyard'==_0x26768b['root']['rootName']){const _0x216a52=_0x5e8c69['schema']['getNearestSelectionRange'](_0x374f81['deletionPosition']);_0x216a52?(_0x26768b['start']=_0x216a52['start'],_0x26768b['end']=_0x216a52['end']):(_0x394197['delete'](_0x46c71d['name']),_0x26768b['detach']());}});}}});}),_0x5e8c69['document']['on']('change',()=>{_0x394197['size']>0x0&&_0x5e8c69['enqueueChange']({'isUndoable':!0x1},_0x501b67=>{for(const [_0x4ec043,_0x2cd4a3]of _0x394197)'$graveyard'==_0x5e8c69['markers']['get'](_0x4ec043)['getRange']()['root']['rootName']&&(te(_0x4ec043['split'](':')[0x2],_0x2cd4a3['toRange'](),_0x5e8c69,_0x501b67),_0x2cd4a3['detach']());_0x394197['clear']();});});}(_0x4ba2bb),this['_domEmitter']['listenTo'](_0x5e8016['document'],'keydown',(_0x32abc0,{key:_0x312da8})=>{'Escape'===_0x312da8&&function(_0x3d4631){_0x3d4631['editing']['view']['change'](_0x566024=>{for(const _0x24a0a2 of _0x3d4631['model']['markers']){if(!_0x24a0a2['name']['startsWith']('user:position'))continue;const _0x3bb272=_0x3d4631['editing']['mapper']['markerNameToElements'](_0x24a0a2['name']);if(_0x3bb272){for(const _0x41c55f of _0x3bb272)_0x566024['removeClass']('ck-user__marker_hovered',_0x41c55f);}}});}(_0x4ba2bb);},{'useCapture':!0x0});}['afterInit'](){const _0x3c7b34=this['editor'],_0x324800=_0x3c7b34['commands']['get']('undo');_0x324800&&_0x3c7b34['model']['on']('applyOperation',(_0x6235a3,_0x17228d)=>{const _0x43c777=_0x17228d[0x0];if(!_0x43c777['isDocumentOperation'])return;if('marker'!=_0x43c777['type']||!_0x43c777['name']['startsWith']('user:'))return;const _0x3e5050=_0x43c777['batch'];_0x324800['_createdBatches']['has'](_0x3e5050)&&(_0x43c777['newRange']=_0x43c777['oldRange']?_0x3c7b34['model']['createRange'](_0x43c777['oldRange']['start'],_0x43c777['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x51c23c=this['editor'],_0x89f78c=_0x51c23c['model']['document'],_0x182d6d=_0x51c23c['plugins']['get'](i);_0x51c23c['model']['enqueueChange']({'isUndoable':!0x1},_0x4b2672=>{const _0x4cfe97='user:range:'+_0x182d6d['mySessionId'],_0x22966f='user:position:'+_0x182d6d['mySessionId'],_0x205778=_0x51c23c['model']['markers']['has'](_0x4cfe97);_0x51c23c['editing']['view']['hasDomSelection']?te(_0x182d6d['mySessionId'],_0x89f78c['selection']['getFirstRange'](),_0x51c23c['model'],_0x4b2672):_0x205778&&(_0x4b2672['removeMarker'](_0x4cfe97),_0x4b2672['removeMarker'](_0x22966f));});}}function te(_0x2810ca,_0x1db297,_0xbd83d4,_0xfdbc7e){const _0x74bbdb='user:range:'+_0x2810ca,_0x53e21d='user:position:'+_0x2810ca,_0x381acd=_0x1db297['getContainedElement']();let _0x4ad960=_0x1db297['start'];if(_0x381acd&&_0x381acd['is']('element','tableCell')){const _0x5c2754=function(_0x5dee30,_0x1d1b8d){for(const _0x3deb14 of _0x5dee30['getPositions']())if(_0x1d1b8d['schema']['checkChild'](_0x3deb14,'$text'))return _0x3deb14;}(_0x1db297,_0xbd83d4);_0x5c2754&&(_0x4ad960=_0x5c2754,_0x1db297=_0xfdbc7e['createRange'](_0x4ad960));}const _0x1ca987=_0xfdbc7e['createRange'](_0x4ad960);_0xbd83d4['markers']['has'](_0x74bbdb)?(_0xfdbc7e['updateMarker'](_0x74bbdb,{'range':_0x1db297}),_0xfdbc7e['updateMarker'](_0x53e21d,{'range':_0x1ca987})):(_0xfdbc7e['addMarker'](_0x74bbdb,{'range':_0x1db297,'usingOperation':!0x0}),_0xfdbc7e['addMarker'](_0x53e21d,{'range':_0x1ca987,'usingOperation':!0x0}));}function $(_0x2a2042,_0x4ad236,_0x1fd940){const _0x126913=_0x2a2042['t'],t=_0x2a2042['t'];switch(_0x4ad236){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 _0x126913({'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'},_0x1fd940);default:return'';}}let Q=0x1;class l extends _0x31ff{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x399838)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x2c44fe,_0x14b601,_0x12fa96];}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 _0x441fb5=this['serverHistory']['getOperations']();for(let _0x181842=_0x441fb5['length']-0x1;_0x181842>=0x0;_0x181842--){const _0x148907=_0x441fb5[_0x181842];if(!this['_disconnectionOperations']['has'](_0x148907))return _0x148907['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x4bda33){if(super(_0x4bda33),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5d5f43(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x328f65('collaboration-missing-channelid',this);const _0x3f5344=_0x4bda33['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x3f5344,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x28347f(),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 Z(this['_disconnectionOperations']);}['init'](){const _0x531204=this['editor'],_0x3fd350=_0x531204['plugins']['get'](_0x14b601),_0x40ca70=_0x531204['plugins']['get'](n);this['listenTo'](_0x3fd350,'getOperationAuthor',(_0x386ab6,_0x43be44)=>{const _0x3f203=_0x43be44[0x0];_0x3f203['_authorId']&&(_0x386ab6['return']=_0x3fd350['getUser'](_0x3f203['_authorId']),_0x386ab6['stop']()),null===_0x3f203['_authorId']&&(_0x386ab6['return']=null,_0x386ab6['stop']());},{'priority':'high'}),this['listenTo'](_0x531204['model']['document']['selection'],'change:range',(_0x355656,_0x4cf7b4)=>{_0x4cf7b4['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x531204['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x531204['model']['on']('applyOperation',(_0x35a98e,_0x54335f)=>{const _0x377264=_0x54335f[0x0];_0x377264['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x377264),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x40ca70,'state',this,'_hasSynchronizationProblem',(_0xd36025,_0x4e3f9b)=>'connected'===_0xd36025&&!_0x4e3f9b),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x531204['disableReadOnlyMode']('rtc-offline'):_0x531204['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x531204['disableReadOnlyMode']('rtc-offline'):_0x531204['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x25970b=this['editor']['plugins']['get'](i),_0x2b1feb=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x25970b['unregister'](this['_channelId']);const _0x3caa5d=await this['_service']['reconnect'](_0x2b1feb['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x3caa5d)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x205f8c=await this['_service']['getConnectedSessions']();_0x25970b['register'](this['_channelId'],_0x205f8c),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x44ba23){if(function(_0xca5818){return'404'===_0xca5818['code'];}(_0x44ba23)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x11e74c){return'409'===_0x11e74c['code'];}(_0x44ba23)){const _0x19daf1=$(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'](_0x19daf1);}else{if(!(_0x44ba23 instanceof X))throw _0x44ba23;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2350ab=this['editor']['plugins']['get'](n),_0x45807e=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x45807e['channelSessions']['has'](this['_channelId'])&&_0x45807e['unregister'](this['_channelId']),_0x2350ab['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x3059a9){if(this['sessionId']!==_0x3059a9['sessionId']&&this['_lastSyncedOperationId']!==_0x3059a9['lastOperationId'])throw new X();return this['sessionId']=_0x3059a9['sessionId'],this['_handleServerResponse']([],{..._0x3059a9,'wereChangesApplied':!0x1,'data':_0x3059a9['data']},'reconnect');}async['_connectService'](_0x3eb05b,_0x582716=!0x1){const {connection:_0x4f1772}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x4f1772,this['_channelId'])['then'](_0x3f9698=>this['_initSessionsHandling'](_0x3f9698))['catch'](_0x3bf67b=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3bf67b);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4fe170,_0x1d4d2c)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1d4d2c);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x170627=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3eb05b);this['_isPendingUpdate']=!0x0;const _0x3dc051=await this['_service']['connect'](_0x4f1772,this['_compressOperations'](_0x3eb05b),_0x170627);if(this['sessionId']=_0x3dc051['sessionId'],_0x582716){if(!_0x3dc051['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3dc051['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3eb05b,_0x3dc051,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3dc051,_0x3eb05b);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1c96b6=this['editor']['plugins']['get'](i),_0x489839=this['editor']['plugins']['get'](G),_0x316d7b=_0x1c96b6['channelSessions']['get'](this['_channelId']);_0x316d7b&&_0x316d7b['length']>0x1?_0x489839['createUserMarkerOperations']():this['listenTo'](_0x1c96b6,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1c96b6['channelSessions']['get'](this['_channelId'])['length']&&_0x489839['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x38c3c1,_0x114d81,_0x48d38d,_0x5a8b1a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x114d81){const _0x2d29eb=this['_decompressOperations'](_0x48d38d,_0x5a8b1a);await this['_fetchMissingUsers'](_0x2d29eb),this['_handleExternalOperations'](_0x2d29eb,_0x114d81,_0x48d38d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0xef505c}=this['editor'];let _0xe164e1;try{_0xe164e1=await this['_service']['getDocumentDetails']();}catch{const _0x9dcf9=$(_0xef505c,'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'](_0x9dcf9);}const _0x4e4c62=_0xe164e1['currentDocumentSession']||_0xe164e1['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x4e4c62['lastOperationId']){const _0x2b2615=$(_0xef505c,'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 void this['_handleReconnectionError'](_0x2b2615);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4a1ab2){const _0x475658=this['editor']['plugins']['get'](i);this['listenTo'](_0x475658,'sessionAdd:'+this['_channelId'],(_0x5676fe,{session:_0x48f9fe})=>{if(_0x48f9fe['id']===_0x475658['mySessionId']){_0x5676fe['off']();const _0x43c2ee=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x13d03b=_0x48f9fe['permissions'];_0x43c2ee&&_0x43c2ee['isEnabled']&&(_0x13d03b=_0x13d03b['filter'](_0x5a0e8d=>'document:write'!==_0x5a0e8d)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x13d03b,this['_channelId']);}}),_0x475658['register'](this['_channelId'],_0x4a1ab2);}['_initThrowingOnDataSet'](){const _0x484338=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2ca886)=>{if(!_0x2ca886[_0x2ca886['length']-0x1]['suppressErrorInCollaboration'])throw new _0x328f65('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x484338['apply'](this['editor']['data'],_0x2ca886);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0xc3ab2,[_0x32d292])=>{if(this['_document']['version'])throw new _0x328f65('realtimecollaborationclient-init-document-already-initialized',this);_0xc3ab2['stop'](),this['_setPendingAction']();const _0x4327ae=this['editor']['config']['get']('rootsAttributes'),_0x2896bf=this['_getOperationsFromInitData'](_0x32d292,_0x4327ae);0x0==_0x2896bf['length']&&_0x2896bf['push'](new _0x1d09c0(0x0)),_0xc3ab2['return']=this['_connectService'](_0x2896bf)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4889ea=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4889ea))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x255dbc,[_0x174574,_0x1fa617])=>{_0x255dbc['stop']();const _0x34fef1=this['editor']['model']['document']['getRoot'](_0x174574);if(!this['_knownRootNames']['has'](_0x174574)){const _0x3920e3=_0x1fa617&&_0x1fa617['data']?_0x1fa617['data']:'',_0x408eab=_0x1fa617&&_0x1fa617['attributes']?_0x1fa617['attributes']:{};await this['_loadRoot'](_0x174574,_0x3920e3,_0x408eab);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x34fef1['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x34fef1);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x8662b3){const _0x5eab00=this['editor']['plugins']['get'](_0x14b601),{connection:_0x1cd22c}=this['editor']['plugins']['get'](n),_0x3dbe68=new Set();for(const _0x3e34a1 of _0x8662b3){const _0x18811f=_0x3e34a1['_authorId'];_0x18811f&&!_0x5eab00['getUser'](_0x18811f)&&_0x3dbe68['add'](_0x18811f);}if(0x0===_0x3dbe68['size'])return;const _0x37912b=await ct['getMany'](_0x1cd22c,Array['from'](_0x3dbe68));for(const _0x32311a of _0x37912b)_0x5eab00['getUser'](_0x32311a['id'])||_0x5eab00['addUser'](_0x32311a);}['_getOperationsFromInitData'](_0x56b555,_0x5c2d78={}){const _0x6f24ef=this['editor']['model'],_0x3daa12=[];let _0x4cbf2a=0x0;const _0x5818bd='string'==typeof _0x56b555?{'main':_0x56b555}:_0x56b555;for(const _0x5186af of Object['keys'](_0x5818bd)){if(!this['_document']['roots']['has'](_0x5186af))throw new _0x328f65('realtimecollaborationclient-init-non-existent-root',this);const _0x338de0=this['editor']['data']['parse'](_0x5818bd[_0x5186af]),_0x5dfe6d=this['_document']['getRoot'](_0x5186af),_0x5f2243=new _0x23e88b(_0x6f24ef['createPositionAt'](_0x5dfe6d,0x0),_0x338de0,_0x4cbf2a++);_0x3daa12['push'](_0x5f2243);for(const [_0x2d14ff,_0x22ea05]of _0x338de0['markers']){const _0x4f2e0d=_0x6f24ef['createRange'](_0x6f24ef['createPositionFromPath'](_0x5dfe6d,_0x22ea05['start']['path']['slice']()),_0x6f24ef['createPositionFromPath'](_0x5dfe6d,_0x22ea05['end']['path']['slice']())),_0x1964f4=new _0x17eeff(_0x2d14ff,null,_0x4f2e0d,_0x6f24ef['markers'],!0x0,_0x4cbf2a++);_0x3daa12['push'](_0x1964f4);}}if(_0x5c2d78)for(const [_0x1987ff,_0x56dc6c]of Object['entries'](_0x5c2d78)){const _0x259be4=_0x6f24ef['document']['getRoot'](_0x1987ff);if(!_0x259be4)throw new _0x328f65('multi-root-editor-root-attributes-no-root',null);for(const [_0x2d840d,_0x201e5b]of Object['entries'](_0x56dc6c))if(null!==_0x201e5b){const _0x26849d=new _0x450ef9(_0x259be4,_0x2d840d,null,_0x201e5b,_0x4cbf2a++);_0x3daa12['push'](_0x26849d);}}return _0x3daa12;}async['_loadRoot'](_0x1d5a84,_0x47bb6a,_0x37ff26){this['_getOperationsFromInitData']({[_0x1d5a84]:_0x47bb6a},{[_0x1d5a84]:_0x37ff26})['forEach']((_0x41749a,_0x543c41)=>{_0x41749a['baseVersion']=this['_document']['version']+_0x543c41,_0x41749a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x41749a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5aff61,_0x47d6a6){let _0x3226aa;this['_offset']=_0x5aff61['offset'];const _0x733a72=_0x5aff61['wereChangesApplied']&&!_0x5aff61['initData'],_0x5b576d=_0x733a72?0x0:_0x5aff61['data']['baseVersion'];if(_0x47d6a6['forEach'](_0x12ddba=>{_0x12ddba['_isInit']=!0x0,_0x12ddba['createdAt']=_0x5aff61['sessionCreatedAt'],_0x12ddba['_authorId']=null;}),_0x733a72)_0x3226aa=_0x47d6a6,this['_applyOperationsSet'](_0x3226aa,_0x733a72);else{if(_0x5aff61['initData']){const _0x1f250=this['_getOperationsFromInitData'](_0x5aff61['initData']);this['_document']['history']['version']=-_0x1f250['length'],_0x1f250['forEach'](_0x2e0b83=>{_0x2e0b83['baseVersion']-=_0x1f250['length'],_0x2e0b83['createdAt']=_0x5aff61['sessionCreatedAt'],_0x2e0b83['_isInit']=!0x0,_0x2e0b83['_authorId']=null;}),this['_applyOperationsSet'](_0x1f250,!0x0),this['serverHistory']['version']=-_0x1f250['length']+this['_offset'],this['_updateServerHistory'](_0x1f250);}this['_document']['history']['version']=_0x5b576d,_0x3226aa=this['_decompressOperations'](_0x5aff61['data'],_0x5aff61['metadata']),await this['_fetchMissingUsers'](_0x3226aa),this['_applyOperationsSet'](_0x3226aa,_0x733a72);}_0x5aff61['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3226aa,_0x5aff61['lastOperationId']),this['_lastSyncedOperationId']=_0x5aff61['lastOperationId']),this['serverHistory']['version']=_0x5b576d+this['_offset'],this['_updateServerHistory'](_0x3226aa),_0x47d6a6['filter'](_0xba9247=>{const _0x2755c1=this['_getAffectedRoot'](_0xba9247);return _0x2755c1&&!this['_knownRootNames']['has'](_0x2755c1);})['forEach']((_0x27f57f,_0x5ddffa)=>{_0x27f57f['baseVersion']=this['_document']['version']+_0x5ddffa,this['_saveOperationInBuffer'](_0x27f57f);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x39cf36,_0x4b0be2){const _0x391a2f=_0x4b0be2&&_0x4b0be2['message'];if(_0x391a2f&&_0x391a2f['startsWith']('realtimecollaborationclient'))throw _0x4b0be2;const _0x15193f=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x15193f['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x328f65(_0x39cf36,this['editor'],_0x391a2f?{'originalError':_0x391a2f}:void 0x0);}['_saveOperationInBuffer'](_0x1cada4){this['_knownOperations']['has'](_0x1cada4)||(this['_knownOperations']['add'](_0x1cada4),this['_bufferedOperations']['push'](_0x1cada4),this['_pendingAction']||'marker'==_0x1cada4['type']&&!_0x1cada4['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x9f6be3=!0x1){!_0x9f6be3&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x516879=>{_0x516879&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x5b26b4=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x473a58){return _0x473a58['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x473a58['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x473a58['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x5b26b4)||this['_crash'](_0x5b26b4['message'],_0x5b26b4);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5c8eb8=>{this['on']('change:_isPendingUpdate',()=>{_0x5c8eb8();});});}async['_sendBufferedOperations'](){const _0x588b03=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x588b03['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3afe9a=[...this['_bufferedOperations']];for(const _0x242380 of _0x3afe9a)_0x242380['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x242380);const _0x5ae2e7=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3afe9a),_0x468fe1=Q++,_0x4f53db=this['_compressOperations'](_0x3afe9a),_0x3c4518=await this['_service']['sendOperations'](_0x4f53db,_0x4f53db['baseVersion'],_0x5ae2e7);try{return await this['_handleServerResponse'](_0x3afe9a,_0x3c4518,_0x468fe1);}catch(_0x2b6d36){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2b6d36);}}async['_handleServerResponse'](_0x4b3f40,_0x475f81,_0x52c741){if('error'in _0x475f81)throw _0x475f81['error'];let _0xa16267=!0x1;if(_0x475f81['wereChangesApplied']){_0x475f81['lastOperationId']&&(this['_lastSyncedOperationId']=_0x475f81['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5c1aad=>!_0x4b3f40['includes'](_0x5c1aad));for(const _0x4dcfeb of _0x4b3f40)_0x4dcfeb['createdAt']='lastOperationAcceptedAt'in _0x475f81&&_0x475f81['lastOperationAcceptedAt']||void 0x0;Y(_0x4b3f40,_0x475f81['version']-_0x4b3f40['length']),this['_updateServerHistory'](_0x4b3f40);const _0x208ebf=_0x4b3f40['filter'](_0x255053=>{if(!_0x255053['_isInit'])return!0x1;const _0xcc0869=this['_getAffectedRoot'](_0x255053);return _0xcc0869&&!this['_knownRootNames']['has'](_0xcc0869);});Y(_0x208ebf,this['_document']['version']),this['_applyOperationsSet'](_0x208ebf),_0xa16267=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x5e3a03=this['_decompressOperations'](_0x475f81['data'],_0x475f81['metadata'])['filter'](_0x304d33=>_0x304d33['baseVersion']>=this['_lastServerVersion']);_0x5e3a03['forEach'](_0x3f356b=>this['_addKnownRoot'](_0x3f356b)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1ce753=>!_0x1ce753['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1ce753))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x5e3a03),_0xa16267=this['_handleExternalOperations'](_0x5e3a03,_0x475f81['version'],_0x475f81['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0xa16267?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3d5b8f,_0x19acf8,_0x2ecd64){try{const _0x2669ce={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x25d110,operationsB:_0x1de407,originalOperations:_0x541734}=_0x16055d(_0x3d5b8f,this['_bufferedOperations'],_0x2669ce);Y(_0x25d110,this['_document']['version']),Y(_0x1de407,_0x19acf8);for(const _0xa835d3 of _0x25d110){const _0x4d8833=_0x541734['get'](_0xa835d3);_0xa835d3['_authorId']=_0x4d8833?_0x4d8833['_authorId']:null;}_0x2ecd64&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3d5b8f,_0x2ecd64),this['_lastSyncedOperationId']=_0x2ecd64),this['_bufferedOperations']=[..._0x1de407],this['_applyOperationsSet'](_0x25d110),this['_updateServerHistory'](_0x3d5b8f);}catch(_0x4b4160){return console['error'](_0x4b4160),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5a4c60,_0x138851=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5c415d=>{for(const _0x5a1ff6 of _0x5a4c60)this['_knownOperations']['add'](_0x5a1ff6),this['_addKnownRoot'](_0x5a1ff6),_0x5c415d['batch']['addOperation'](_0x5a1ff6),this['editor']['model']['applyOperation'](_0x5a1ff6);});}['_addKnownRoot'](_0x1c379a){const _0xb10b2f=this['_getAffectedRoot'](_0x1c379a);_0xb10b2f&&this['_knownRootNames']['add'](_0xb10b2f);}['_getAffectedRoot'](_0x16d2ca){let _0x9f7a20,_0x34591d;switch(_0x16d2ca['type']){case'insert':_0x9f7a20=_0x16d2ca['position']['root'];break;case'marker':if(_0x34591d=_0x16d2ca['newRange'],!_0x34591d)return null;_0x9f7a20=_0x34591d['root'];break;case'addRootAttribute':_0x9f7a20=_0x16d2ca['root'];break;case'addRoot':_0x9f7a20=_0x16d2ca['affectedSelectable'];break;case'move':_0x9f7a20=_0x16d2ca['targetPosition']['root'];break;default:return null;}return _0x9f7a20['rootName'];}['_updateServerHistory'](_0x21c058){_0x21c058['forEach'](_0x1e894b=>{const _0x44019f=_0x1e894b['clone']();_0x44019f['_authorId']=_0x1e894b['_authorId'],_0x44019f['_isInit']=!!_0x1e894b['_isInit'],_0x44019f['createdAt']=_0x1e894b['createdAt'],_0x44019f['baseVersion']+=this['_offset'],_0x1e894b['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x44019f),this['serverHistory']['addOperation'](_0x44019f);});}['_handleReconnectionError'](_0x137045){const _0x813324=this['editor']['plugins']['get']('Notification'),_0x48dc9f=this['editor']['locale'];_0x137045||(_0x137045=$(_0x48dc9f,'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.')),_0x813324['showWarning'](_0x137045,{'title':$(_0x48dc9f,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x2c44fe)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x2c44fe)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x33be1f){const _0x252919=_0x33be1f['map'](_0x371ed1=>_0x371ed1['toJSON']());return this['_compressor']['compress'](_0x252919);}['_decompressOperations'](_0x26ec49,_0x52f8ba){return this['_compressor']['decompress'](_0x26ec49)['map']((_0x51b291,_0x880a7f)=>{const _0x4180c5='init'==_0x52f8ba[_0x880a7f]['type'];if('InsertOperation'==_0x51b291['__className']){const _0x299769=_0x51b291['position']['root'];!this['_document']['getRoot'](_0x299769)&&(this['_document']['createRoot']('$root',_0x299769)['_isAttached']=!0x1);}const _0x3c0514=_0x2b56e0['fromJSON'](_0x51b291,this['_document']);return _0x3c0514['wasUndone']=_0x51b291['wasUndone'],_0x3c0514['_isInit']=_0x4180c5,_0x3c0514['_authorId']=_0x4180c5?null:_0x52f8ba[_0x880a7f]['userId'],_0x3c0514['_isDisconnection']='cs:removeUser'===_0x52f8ba[_0x880a7f]['type'],_0x3c0514['createdAt']=_0x52f8ba[_0x880a7f]['createdAt'],_0x3c0514;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x443276=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x443276&&_0x443276['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x198a46,_0x15a9e5){for(const _0x4daa05 of _0x198a46)_0x4daa05['baseVersion']=_0x15a9e5++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0x429dcb){this['_ignoredOperations']=_0x429dcb,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x43e9f9){let _0x1a55b3=_0x43e9f9['length'];for(;_0x1a55b3--;){const _0x559792=_0x43e9f9[_0x1a55b3];if(!this['_ignoredOperations']['has'](_0x559792)){if(!this['_operationToId']['has'](_0x559792)){const _0x2a015b=_0xcb092b()['slice'](0x1,0x12);this['_operationToId']['set'](_0x559792,_0x2a015b);}return this['_operationToId']['get'](_0x559792);}}}['setIdForTheLastOperation'](_0x29fa89,_0x19ec0f){if(!_0x19ec0f)return;let _0x2a5950=_0x29fa89['length'];for(;_0x2a5950--;){const _0x27b672=_0x29fa89[_0x2a5950];this['_ignoredOperations']['has'](_0x27b672)||this['_operationToId']['set'](_0x27b672,_0x19ec0f);}}}class a extends _0x31ff{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x40a1a8{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x1ee08e)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x14b601];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xde657a){super(_0xde657a),this['_services']=new Map();}async['init'](){const _0x8b8087=this['context'],_0x67ee50=_0x8b8087['plugins']['get']('CommentsRepository');if(_0x8b8087['plugins']['get'](n)['addToReconnectionStack'](this),_0x67ee50['adapter']={'addCommentThread':async({channelId:_0x53c692,threadId:_0x22279a,comments:_0x31928e,resolvedAt:_0x2c64e9,resolvedBy:_0x45a438,context:_0x19f58f,attributes:_0x182ea2})=>{const _0x4ec0b8=await this['_getService'](_0x53c692)['addCommentThread']({'commentThreadId':_0x22279a,'comments':_0x31928e['map'](_0x335700=>function(_0x391c05,_0x177b05,_0x1a4ff2){return{'commentThreadId':_0x1a4ff2,'commentId':_0x391c05['commentId'],'userId':_0x391c05['authorId'],'content':_0x391c05['content'],'documentId':_0x177b05,'createdAt':_0x391c05['createdAt'],'attributes':_0x391c05['attributes']||{}};}(_0x335700,_0x53c692,_0x22279a)),'resolvedAt':_0x2c64e9,'resolvedBy':_0x45a438,'context':_0x19f58f,'attributes':_0x182ea2})['catch'](at);return{'threadId':_0x4ec0b8['commentThreadId'],'comments':_0x4ec0b8['comments']};},'getCommentThread':async({channelId:_0x3728c5,threadId:_0x369cc5})=>{const _0x12718e=await this['_getService'](_0x3728c5)['getCommentThread'](_0x369cc5)['catch'](f)['catch'](at);return _0x12718e?_0x12718e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x12718e]),{'threadId':_0x12718e['commentThreadId'],'comments':_0x12718e['comments']['map'](p),'context':_0x12718e['context'],'resolvedAt':_0x12718e['resolvedAt'],'resolvedBy':_0x12718e['resolvedBy'],'attributes':_0x12718e['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x450b25,threadId:_0x18aaa4,context:_0x59ad35,unlinkedAt:_0x1c5a58,attributes:_0x444de8})=>this['_getService'](_0x450b25)['updateCommentThread']({'commentThreadId':_0x18aaa4,'context':_0x59ad35,'attributes':_0x444de8,'unlinkedAt':_0x1c5a58})['catch'](f)['catch'](at),'resolveCommentThread':async({channelId:_0x1939e9,threadId:_0x1e64b0})=>{const _0x3892ba=await this['_getService'](_0x1939e9)['resolveCommentThread'](_0x1e64b0)['catch'](f)['catch'](at);return{'threadId':_0x3892ba['commentThreadId'],'resolvedAt':_0x3892ba['resolvedAt'],'resolvedBy':_0x3892ba['resolvedBy']};},'reopenCommentThread':async({channelId:_0x1a73c8,threadId:_0x334aee})=>this['_getService'](_0x1a73c8)['reopenCommentThread'](_0x334aee)['catch'](f)['catch'](at),'removeCommentThread':({channelId:_0x15ccad,threadId:_0x17a167})=>this['_getService'](_0x15ccad)['removeCommentThread'](_0x17a167)['catch'](f)['catch'](at),'addComment':({channelId:_0x5a4408,threadId:_0x4605f8,commentId:_0x261dcc,content:_0x3b73d3,attributes:_0x29042f})=>this['_getService'](_0x5a4408)['addComment'](_0x4605f8,_0x261dcc,_0x3b73d3,_0x29042f)['catch'](at),'updateComment':({channelId:_0x553322,threadId:_0x14c0d7,commentId:_0x58f0e4,content:_0x518a05,attributes:_0x12150a})=>this['_getService'](_0x553322)['updateComment'](_0x14c0d7,_0x58f0e4,_0x518a05,_0x12150a)['catch'](f)['catch'](at),'removeComment':({channelId:_0x3364f8,threadId:_0x660a25,commentId:_0xc0236b})=>this['_getService'](_0x3364f8)['removeComment'](_0x660a25,_0xc0236b)['catch'](f)['catch'](at)},_0x8b8087 instanceof _0x57ac9b){const _0x45994e=_0x8b8087['config']['get']('collaboration.channelId'),_0x2499f3=_0x8b8087['plugins']['get'](i);await this['_setUpService'](_0x45994e);const _0x416be4=await this['_services']['get'](_0x45994e)['getConnectedSessions']();this['listenTo'](_0x2499f3,'sessionAdd:'+_0x45994e,(_0xabbc57,{session:_0x224cc6})=>{_0x224cc6['id']===_0x2499f3['mySessionId']&&(_0xabbc57['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x224cc6['permissions'],_0x45994e));}),_0x2499f3['register'](_0x45994e,_0x416be4);}}async['_setUpService'](_0xac6dbd){if(this['_services']['has'](_0xac6dbd))throw new _0x328f65('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0xac6dbd});const _0x5eeef3=this['context']['plugins']['get']('CommentsRepository'),_0x18aefc=new s['CommentsService'](_0xac6dbd);this['_services']['set'](_0xac6dbd,_0x18aefc),this['listenTo'](_0x18aefc,'commentThreadAdded',(_0x111590,_0x526bbe)=>{const {commentThreadId:_0x117951,documentId:_0x2abd14,context:_0x34ce27,attributes:_0x411dda,resolvedAt:_0x44ca9f,resolvedBy:_0x58c54d,comments:_0x3650f0}=_0x526bbe;_0x5eeef3['getCommentThread'](_0x117951)||_0x5eeef3['addCommentThread']({'threadId':_0x117951,'channelId':_0x2abd14,'comments':_0x3650f0?_0x3650f0['map'](p):[],'context':_0x34ce27,'attributes':_0x411dda,'resolvedAt':_0x44ca9f,'resolvedBy':_0x58c54d,'isFromAdapter':!0x0});}),this['listenTo'](_0x18aefc,'commentThreadUpdated',(_0x55ebb6,{commentThreadId:_0x39d904,documentId:_0x241538,context:_0x58e511,unlinkedAt:_0x269042,attributes:_0xa0ad4b})=>{_0x5eeef3['getCommentThread'](_0x39d904)&&_0x5eeef3['updateCommentThread']({'threadId':_0x39d904,'channelId':_0x241538,'context':_0x58e511,'unlinkedAt':_0x269042,'attributes':_0xa0ad4b,'isFromAdapter':!0x0});}),this['listenTo'](_0x18aefc,'commentThreadResolved',(_0x3ebc28,{commentThreadId:_0x54cf10,resolvedBy:_0xe51fb2,resolvedAt:_0x236388})=>{const _0x45d7cd=_0x5eeef3['getCommentThread'](_0x54cf10);_0x45d7cd&&_0x45d7cd['resolve']({'resolvedBy':_0xe51fb2,'resolvedAt':_0x236388,'isFromAdapter':!0x0});}),this['listenTo'](_0x18aefc,'commentThreadReopened',(_0x113b6e,{commentThreadId:_0x3402c4})=>{const _0x1d7e46=_0x5eeef3['getCommentThread'](_0x3402c4);_0x1d7e46&&_0x1d7e46['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x18aefc,'commentThreadRemoved',(_0x56aeb7,{commentThreadId:_0x48a5c6})=>{const _0x5d8250=_0x5eeef3['getCommentThread'](_0x48a5c6);_0x5d8250&&_0x5d8250['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x18aefc,'commentAdded',(_0x3b17c8,_0x45994f)=>{const _0x4c312f=_0x45994f['commentThreadId'],_0x6fe8fe=_0x5eeef3['getCommentThread'](_0x4c312f);_0x6fe8fe&&_0x6fe8fe['addComment']({...p(_0x45994f),'isFromAdapter':!0x0});}),this['listenTo'](_0x18aefc,'commentUpdated',(_0x295a2a,{commentThreadId:_0x234dbc,commentId:_0x3f476d,content:_0x21c328,attributes:_0x2550a9})=>{const _0x3e928a=_0x5eeef3['getCommentThread'](_0x234dbc);if(_0x3e928a){const _0x14a0ec=_0x3e928a['getComment'](_0x3f476d);_0x14a0ec&&_0x14a0ec['update']({'content':_0x21c328,'attributes':_0x2550a9,'isFromAdapter':!0x0});}}),this['listenTo'](_0x18aefc,'commentRemoved',(_0x59a5e2,{commentThreadId:_0x3a9def,commentId:_0x7b342f})=>{const _0x200981=_0x5eeef3['getCommentThread'](_0x3a9def);if(_0x200981){const _0xf5f8e8=_0x200981['getComment'](_0x7b342f);_0xf5f8e8&&_0xf5f8e8['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0xac6dbd);}['destroy'](){if(this['context']instanceof _0x57ac9b){const _0x316c4a=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x316c4a);}}['_terminateService'](_0x2a2047){if(!this['_services']['has'](_0x2a2047))throw new _0x328f65('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x2a2047});this['_getService'](_0x2a2047)['disconnect'](),this['_services']['delete'](_0x2a2047);}async['reconnect'](){for(const _0x5f0839 of this['_services']['keys']())await this['_connectService'](_0x5f0839);if(this['context']instanceof _0x57ac9b){const _0x45b703=this['context']['config']['get']('collaboration.channelId'),_0x486e08=this['context']['plugins']['get'](i);_0x486e08['unregister'](_0x45b703);const _0x1a43ff=await this['_services']['get'](_0x45b703)['getConnectedSessions']();_0x486e08['register'](_0x45b703,_0x1a43ff);}}async['_connectService'](_0x2b1dbb){const {connection:_0x204e54}=this['context']['plugins']['get'](n),_0xf3e888=this['context']['plugins']['get']('CommentsRepository'),_0x19c398=this['_services']['get'](_0x2b1dbb),_0x50165d=await _0x19c398['connect'](_0x204e54);await this['_fetchMissingUsersForThreads'](_0x50165d);const _0x32f9cd=new Set(Array['from'](_0xf3e888['getCommentThreads']({'channelId':_0x2b1dbb}),_0x26f493=>_0x26f493['id']));for(const _0x5dc996 of _0x50165d)_0x5dc996['deletedAt']||_0x32f9cd['delete'](_0x5dc996['commentThreadId']);for(const _0x251165 of _0x32f9cd)_0xf3e888['getCommentThread'](_0x251165)['remove']({'isFromAdapter':!0x0});for(const _0x305897 of _0x50165d){let _0x509852=_0xf3e888['getCommentThread'](_0x305897['commentThreadId']);const {commentThreadId:_0xde472e,context:_0x125f46,attributes:_0x4f5e60,resolvedBy:_0x5232b0,resolvedAt:_0x53b326,unlinkedAt:_0x439853,deletedAt:_0x222bd7}=_0x305897;if(_0x222bd7)continue;_0x509852||(_0x509852=_0xf3e888['addCommentThread']({'channelId':_0x2b1dbb,'threadId':_0xde472e,'context':_0x125f46,'attributes':_0x4f5e60||{},'resolvedBy':_0x5232b0,'resolvedAt':_0x53b326,'unlinkedAt':_0x439853,'isFromAdapter':!0x0}));const _0x2a459e=new Set(Array['from'](_0x509852['comments'],_0x6b23bc=>_0x6b23bc['id']));for(const _0x477506 of _0x305897['comments'])_0x2a459e['delete'](_0x477506['commentId']);for(const _0x2b25d2 of _0x2a459e)_0x509852['getComment'](_0x2b25d2)['remove']({'isFromAdapter':!0x0});for(const _0x436950 of _0x305897['comments']){const _0x22b801=_0x509852['getComment'](_0x436950['commentId']);_0x22b801?_0x22b801['content']!==_0x436950['content']&&_0x22b801['update']({'content':_0x436950['content'],'isFromAdapter':!0x0}):_0x509852['addComment'](Object['assign'](p(_0x436950),{'isFromAdapter':!0x0}));}}}['_getService'](_0xcbaca1){if(!this['_services']['has'](_0xcbaca1))throw new _0x328f65('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xcbaca1});return this['_services']['get'](_0xcbaca1);}async['_fetchMissingUsersForThreads'](_0x4c7615){const _0x5c3ba7=this['context']['plugins']['get'](_0x14b601),{connection:_0x3e9ed1}=this['context']['plugins']['get'](n),_0x22d5a8=new Set();for(const {resolvedBy:_0x47d776,comments:_0x415e13}of _0x4c7615){_0x47d776&&!_0x5c3ba7['getUser'](_0x47d776)&&_0x22d5a8['add'](_0x47d776);for(const {userId:_0x4b4cfe}of _0x415e13)_0x5c3ba7['getUser'](_0x4b4cfe)||_0x22d5a8['add'](_0x4b4cfe);}if(0x0===_0x22d5a8['size'])return;const _0x10e724=await ct['getMany'](_0x3e9ed1,Array['from'](_0x22d5a8));for(const _0x3c4f31 of _0x10e724)_0x5c3ba7['getUser'](_0x3c4f31['id'])||_0x5c3ba7['addUser'](_0x3c4f31);}}async function f(_0x3a5103){if('404'!==_0x3a5103['code'])throw _0x3a5103;}function at(_0xc4c18a){if((_0x157edb=_0xc4c18a)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x157edb['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x157edb['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x157edb;throw _0xc4c18a;}function p(_0x5b257f){return{'threadId':_0x5b257f['commentThreadId'],'commentId':_0x5b257f['commentId'],'content':_0x5b257f['content'],'createdAt':_0x5b257f['createdAt'],'authorId':_0x5b257f['userId'],'attributes':_0x5b257f['attributes']||{}};}class m extends _0x31ff{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x181fd9){super(_0x181fd9);const _0x1cff20=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x1cff20);}['init'](){const _0x203256=this['editor']['plugins']['get'](n),_0x4b6410=this['editor']['plugins']['get']('TrackChangesEditing');return _0x4b6410['adapter']={'getSuggestion':async _0x5affa7=>{await this['_waitForServiceReady']();const _0x48cafd=await this['_trackChangesService']['get'](_0x5affa7)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x48cafd]),_0x48cafd;},'addSuggestion':async({id:_0x31c1d5,type:_0x351684,data:_0x41eefb,originalSuggestionId:_0x3bbc8f,attributes:_0x62be10})=>{await this['_waitForServiceReady']();const _0x41b02d={'id':_0x31c1d5,'type':_0x351684,'data':_0x41eefb,'originalSuggestionId':_0x3bbc8f,'attributes':_0x62be10},_0x230695=await this['_trackChangesService']['add'](_0x31c1d5,_0x351684,_0x41eefb,_0x3bbc8f,_0x62be10)['catch'](_0x1c7aa1=>{if(ht(_0x1c7aa1))return new Promise(_0x3bf20a=>{this['_bufferedRequests']['set'](_0x31c1d5,{'resolve':_0x3bf20a,'suggestionData':_0x41b02d});});throw _0x1c7aa1;});return this['_bufferedRequests']['delete'](_0x31c1d5),_0x230695;},'updateSuggestion':async(_0x2a8daa,_0x320eee)=>{if(await this['_waitForServiceReady'](),'open'!==_0x320eee['state'])return this['_trackChangesService']['update'](_0x2a8daa,_0x320eee)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x3fc6b5,_0x19f4d9)=>{_0x4b6410['hasSuggestion'](_0x19f4d9['id'])&&(_0x4b6410['getSuggestion'](_0x19f4d9['id'])['attributes']=_0x19f4d9['attributes']);}),this['_trackChangesService']['connect'](_0x203256['connection'])['then'](_0x423de4=>(_0x203256['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x423de4)['then'](()=>{for(const _0x463f1f of _0x423de4){_0x4b6410['addSuggestionData'](_0x463f1f)['_saved']=!0x0;}})));}async['reconnect'](){const _0x562709=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x59ae49}=this['editor']['plugins']['get'](n),_0x2befe0=await this['_trackChangesService']['connect'](_0x59ae49);await this['_fetchMissingUsersForThreads'](_0x2befe0);for(const {suggestionData:_0x53b028,resolve:_0x3527dc}of this['_bufferedRequests']['values']()){let _0xac502d=_0x2befe0['find'](_0x8dce8f=>_0x8dce8f['id']===_0x53b028['id']);_0xac502d||(_0xac502d=await this['_trackChangesService']['add'](_0x53b028['id'],_0x53b028['type'],_0x53b028['data'],_0x53b028['originalSuggestionId'])),_0x3527dc(_0xac502d);}for(const _0x381540 of _0x2befe0)_0x562709['hasSuggestion'](_0x381540['id'])||_0x562709['addSuggestionData'](_0x381540);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2cccb0=>{this['listenTo'](this['_trackChangesService'],'connected',_0x583fec=>{_0x583fec['off'](),_0x2cccb0();});});}async['_fetchMissingUsersForThreads'](_0x560583){const _0x2539dc=this['editor']['plugins']['get'](_0x14b601),{connection:_0x152c1e}=this['editor']['plugins']['get'](n),_0x4718c8=new Set();for(const {authorId:_0x22d526}of _0x560583)_0x2539dc['getUser'](_0x22d526)||_0x4718c8['add'](_0x22d526);if(0x0===_0x4718c8['size'])return;const _0x543453=await ct['getMany'](_0x152c1e,Array['from'](_0x4718c8));for(const _0xaee7b6 of _0x543453)_0x2539dc['getUser'](_0xaee7b6['id'])||_0x2539dc['addUser'](_0xaee7b6);}}function A(_0x51430f){if(ht(_0x51430f))return new Promise(()=>{});throw _0x51430f;}function ht(_0x1c9661){return _0x1c9661['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1c9661['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x31ff{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3262fa=this['editor']['plugins']['get'](n),_0x1d1892=this['editor']['plugins']['get']('CommentsEditing'),_0x8ec493=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3262fa,'change:state',(_0x50a3f2,_0x24d851,_0x3767e0)=>{_0x1d1892['isThreadsLoadingPaused']='connected'!==_0x3767e0;});}),this['listenTo'](_0x3262fa,'change:state',(_0x55c6b5,_0x5485c3,_0x151082)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x151082);}),_0x8ec493['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x31ff{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x31ff{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x18bbb1)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x14b601];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2b5122){super(_0x2b5122);const _0x407bf1=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x407bf1);}async['init'](){const _0x5db57e=this['editor']['plugins']['get'](l),_0x29af39=_0x5db57e['serverHistory'],_0x34bf53=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x29af39,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5db57e['sessionId']});const _0x2cad98=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x230233=await _0x5a4c8b['isBundleUploaded'](_0x34bf53['connection'],_0x2cad98);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x12e7b9})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x12e7b9)),'updateRevisions':async _0x3841ac=>{await this['_waitForServiceReady']();const _0x5baf29=this['_revisionTracker']['currentRevision'];if(_0x230233&&0x1===_0x3841ac['length']&&_0x3841ac[0x0]['id']===_0x5baf29['id'])return _0x3841ac;for(const _0x1e5310 of _0x3841ac)_0x1e5310['id']===_0x5baf29['id']&&(_0x1e5310['isEmptyCurrent']=_0x1e5310['fromVersion']===_0x1e5310['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3841ac,this['_lastRequestId'])['then'](_0x219f78=>(this['_lastRequestId']=_0x219f78,_0x3841ac))['catch'](_0x925e95=>{if(M(_0x925e95)||'400'===_0x925e95['code']&&void 0x0!==_0x925e95['data']['wrongRequestId']){for(const _0x4c7f6d of _0x3841ac){!this['_revisionTracker']['repository']['getRevision'](_0x4c7f6d['id'])||this['_revisionTracker']['_bufferUpdate'](_0x4c7f6d['id'],_0x4c7f6d,!0x1);}if(M(_0x925e95))throw _0x925e95;return _0x3841ac;}throw _0x925e95;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x24a584,{revisionsData:_0x2582a8,requestId:_0x4c9930})=>{Math['max'](..._0x2582a8['map'](_0x395c4c=>_0x395c4c['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2582a8,_0x4c9930);}):this['_handleRevisionsUpdate'](_0x2582a8,_0x4c9930);});const {revisions:_0x5dfbde,requestId:_0x1ef839}=await this['_revisionHistoryService']['connect'](_0x34bf53['connection']);_0x34bf53['addToReconnectionStack'](this),this['_lastRequestId']=_0x1ef839,await this['_fetchMissingUsers'](_0x5dfbde);for(const _0x6907fa of _0x5dfbde)this['_revisionTracker']['addRevisionData'](_0x6907fa);this['listenTo'](_0x5db57e,'change:_isConnected',(_0x7679af,_0x3abeb8,_0x25deb2)=>{_0x25deb2&&(this['_oldOffset']=_0x5db57e['_offset'],_0x7679af['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x34bf53,'state',_0x1d0050=>_0x1d0050===_0xcf5e5e['CONNECTED']);}async['reconnect'](){const _0x201ad3=this['editor']['plugins']['get'](n),_0x33db00=this['editor']['plugins']['get'](l),_0x34005b=async()=>{const _0x358e34=this['_revisionTracker']['currentRevision'],_0x4fe16b=_0x358e34['id'],_0x43049e=_0x4fe16b!==_0x33db00['sessionId'];if(_0x43049e){const _0x1cda63=_0x33db00['_offset']-this['_oldOffset'],_0x523154=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x358e34['toVersion']+_0x1cda63!==_0x523154){const _0x160d43=_0x358e34['fromVersion']+_0x1cda63,_0x16b730=this['editor']['plugins']['get'](_0x14b601),_0x3e3a1a=this['_revisionTracker']['buildRevisionData']({'revision':_0x358e34,'from':_0x160d43,'to':_0x523154});_0x3e3a1a['id']=_0x358e34['id'];const _0x418889=_0x3e3a1a['authorsIds']['map'](_0x4c70d1=>_0x16b730['getUser'](_0x4c70d1));_0x358e34['_update']({..._0x3e3a1a,'authors':_0x418889},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x358e34['id'],_0x3e3a1a,!0x0);}this['_revisionTracker']['_startingVersion']=_0x523154,(_0x358e34['toVersion']===_0x358e34['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x4fe16b)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x4fe16b),this['_revisionTracker']['_createCurrentRevision'](_0x523154));}const {revisions:_0x3cc4dc,requestId:_0x342bfa}=await this['_revisionHistoryService']['reconnect'](_0x201ad3['connection'],this['_lastRequestId']);_0x43049e&&_0x3cc4dc['length']>0x0?_0x33db00['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3cc4dc),this['_handleRevisionsUpdate'](_0x3cc4dc,_0x342bfa),this['_revisionTracker']['sendBufferedUpdates']());};return _0x33db00['_isConnected']?_0x34005b():new Promise((_0x1fbc82,_0x975244)=>{_0x33db00['once']('change:_isConnected',()=>{_0x34005b()['then'](_0x1fbc82)['catch'](_0x975244);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x54dd09=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x21f593=>{_0x21f593['off'](),_0x54dd09();});});}['_getLatestVersionFromServerOperations'](){const _0x220fd0=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x4e9253 of _0x220fd0)if('marker'!==_0x4e9253['type']||_0x4e9253['affectsData'])return _0x4e9253['baseVersion']+0x1;}['_getLatestVersion'](){const _0x2ae62f=this['editor']['plugins']['get'](l);return new Promise(_0x456bb1=>{_0x2ae62f['_isPendingUpdate']?_0x2ae62f['once']('change:_isPendingUpdate',()=>{_0x456bb1(this['_getLatestVersionFromServerOperations']());}):_0x456bb1(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x541760,_0x28d986){const _0xf6e2d2=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x28d986;for(const _0x1f40fa of _0x541760){const _0x5ca039=_0xf6e2d2['getRevision'](_0x1f40fa['id']);if(_0x5ca039){if((_0x1f40fa['fromVersion']||_0x1f40fa['toVersion'])&&(_0x1f40fa['diffData']=null),_0x5ca039===this['_revisionTracker']['currentRevision']){const _0x3c7e67=Math['max'](_0x5ca039['toVersion'],_0x1f40fa['toVersion']),_0x4d165b=Math['max'](_0x5ca039['fromVersion'],_0x1f40fa['fromVersion']);let _0x5241ae;_0x5ca039['toVersion']===_0x1f40fa['toVersion']&&_0x5ca039['fromVersion']===_0x1f40fa['fromVersion']?(_0x5241ae=!0x0,this['_preventResendingRevisionData'](_0x1f40fa)):_0x1f40fa['toVersion']===_0x3c7e67&&_0x1f40fa['fromVersion']===_0x4d165b?_0x5241ae=!0x1:(_0x5ca039['toVersion']===_0x3c7e67&&_0x5ca039['fromVersion']===_0x4d165b||this['_fixRevision']({'revision':_0x5ca039,'from':_0x4d165b,'to':_0x3c7e67}),_0x5241ae=!0x0),_0x5241ae&&(delete _0x1f40fa['fromVersion'],delete _0x1f40fa['toVersion'],delete _0x1f40fa['diffData'],delete _0x1f40fa['createdAt'],delete _0x1f40fa['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1f40fa),this['_preventResendingRevisionData'](_0x1f40fa);}else this['_revisionTracker']['addRevisionData'](_0x1f40fa);}const _0x451278=_0xf6e2d2['getRevisions']();_0x451278['reverse']();for(let _0x107f5a=0x0;_0x107f5a<_0x451278['length']-0x1;_0x107f5a++){const _0x40b028=_0x451278[_0x107f5a],_0x58db64=_0x451278[_0x107f5a+0x1];if(_0x40b028['fromVersion']<_0x58db64['toVersion']){const _0x1f55a9=_0x58db64['toVersion'],_0x599cf5=Math['max'](_0x1f55a9,_0x40b028['toVersion']);this['_fixRevision']({'revision':_0x40b028,'from':_0x1f55a9,'to':_0x599cf5});}}}['_fixRevision']({revision:_0x93a8ea,from:_0x3a4682,to:_0x4823ec}={}){const _0x3fdc5b=this['editor']['plugins']['get'](_0x14b601),_0xd9bb47=this['_revisionTracker']['buildRevisionData']({'revision':_0x93a8ea,'from':_0x3a4682,'to':_0x4823ec});_0xd9bb47['authors']=_0xd9bb47['authorsIds']['map'](_0x240e72=>_0x3fdc5b['getUser'](_0x240e72)),_0x93a8ea['_update'](_0xd9bb47);}['_preventResendingRevisionData'](_0x7a7d81){const _0x14223f={};_0x14223f['id']=_0x7a7d81['id'];for(const _0x481196 of Object['keys'](_0x7a7d81))'id'!==_0x481196&&(_0x14223f[_0x481196]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x14223f['id'],_0x14223f,!0x0);}async['_fetchMissingUsers'](_0x57d204){const _0xa5b53d=this['editor']['plugins']['get'](_0x14b601),{connection:_0x224e96}=this['editor']['plugins']['get'](n),_0x3005be=new Set();for(const _0x5e374f of _0x57d204){for(const _0x2acc0f of _0x5e374f['authorsIds'])_0x366ffd(_0x2acc0f);_0x5e374f['creatorId']&&_0x366ffd(_0x5e374f['creatorId']);}if(0x0===_0x3005be['size'])return;const _0x224913=await ct['getMany'](_0x224e96,Array['from'](_0x3005be));for(const _0x21183c of _0x224913)_0xa5b53d['getUser'](_0x21183c['id'])||_0xa5b53d['addUser'](_0x21183c);function _0x366ffd(_0x4190e5){_0xa5b53d['getUser'](_0x4190e5)||_0x3005be['add'](_0x4190e5);}}}function M(_0x550189){return _0x550189['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x550189['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x550189['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x31ff{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0x6e663b{['_collapseAt'];constructor(_0x6daa8e,_0x899596=0x6){super(_0x6daa8e);const _0x56ce70=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x899596,this['bind']('isHidden')['to'](this,'usersCount',_0x12deb7=>_0x12deb7<_0x899596),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x56ce70['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x56ce70['to']('usersCount',_0x17eb24=>'+'+(_0x17eb24-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x6e663b{['items'];['keystrokes'];constructor(_0x5839b2){super(_0x5839b2);const _0x47488f=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x21aca9(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x47488f['if']('hasPopup'),'aria-expanded':_0x47488f['to']('isExpanded',_0x38269d=>this['hasPopup']&&String(_0x38269d)),'aria-label':_0x47488f['to']('hasPopup',_0x29d008=>$(_0x5839b2,_0x29d008?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x47488f['to']('hasPopup',_0x3d3e22=>!!_0x3d3e22&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x47488f['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x47488f['to'](_0x56732e=>{const _0x382e76=_0x56732e,_0x2f0c73=document['querySelector']('.ck-presence-list__dropdown-list'),_0x8e8ebc=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2f0c73?.['contains'](_0x382e76['relatedTarget'])||_0x8e8ebc?.['contains'](_0x382e76['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x4a13e1,_0x2fd5e1,_0xbad81d)=>{this['element']&&(_0xbad81d?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 k extends _0x6e663b{['counterView'];['inlineListView'];constructor(_0x191b33,_0x142b30=0x6){super(_0x191b33);const _0x449f8b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0x142b30),this['inlineListView']=new is(_0x191b33),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4932e8 of this['inlineListView']['items'])_0x4932e8['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',_0x449f8b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0x6e663b{['listWrapperView'];constructor(_0x14c129,_0x4f9d3f){super(_0x14c129);const _0x4bfbdb=this['bindTemplate'];this['listWrapperView']=new ut(_0x14c129,_0x4f9d3f),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x14c129,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x4bfbdb['to'](_0x8b9ba=>{const _0x3a64c8=_0x8b9ba,_0x56df33=document['querySelector']('.ck-presence-list__list'),_0xd4ed7d=document['querySelector']('.ck-balloon-panel_with-arrow');_0x56df33?.['contains'](_0x3a64c8['relatedTarget'])||_0xd4ed7d?.['contains'](_0x3a64c8['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x313e4e{constructor(_0x883a1d,_0x291537){super(_0x883a1d);const _0x52aab3=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x291537?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x52aab3['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x52aab3['to']('role'),'aria-label':_0x52aab3['to']('ariaLabel'),'aria-labelledby':_0x52aab3['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x5e8016['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x430524=this['element'];_0x430524&&(this['_isScrollable']=Math['max'](_0x430524['scrollHeight'],_0x430524['clientHeight'])>0.8*window['innerHeight']);}}class P extends et{['userView'];constructor(_0x5cf44c,_0x2bf58b,_0x43c760){super(_0x5cf44c);const _0x1f3f41=this['bindTemplate'];this['userView']=new st(_0x5cf44c,_0x2bf58b);const _0x47bf8a={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x2bf58b['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x2bf58b['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2bf58b['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x43c760&&(_0x47bf8a['tag']='button',_0x47bf8a['on']={'click':_0x1f3f41['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x47bf8a);}['focus'](){this['element']['focus']();}}class _ extends _0x6e663b{['userView'];['markerView'];constructor(_0x2efa87,_0x2f82ab,_0x413b3e){super(_0x2efa87);const _0x306079=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x2efa87,_0x2f82ab),this['markerView']=new ot(_0x2efa87,_0x2f82ab);const _0x429f7c=new it(_0x2efa87);_0x429f7c['template']['tag']='span',_0x429f7c['text']=_0x2f82ab['name'];const _0x5162d4={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x306079['to']('isFocusable',_0x117be1=>!!_0x117be1&&0x0),'aria-labelledby':_0x429f7c['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x306079['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x306079['to']('hasTooltip',_0x4cce69=>!_0x4cce69),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x429f7c]};_0x413b3e&&(_0x5162d4['tag']='button',_0x5162d4['on']={'click':_0x306079['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5162d4);}}class ot extends _0x6e663b{constructor(_0x699781,_0x53a54f){super(_0x699781),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x53a54f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x40a1a8{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x53275c){super(_0x53275c),this['context']['config']['define']('presenceList',U);const _0x2f60ec=_0x53275c['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2f60ec)throw new _0x328f65('presencelist-collapseat-invalid-format',this);if(_0x2f60ec<0x1)throw new _0x328f65('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x29861b(),this['balloonPanelView']=new _0x5d09ed(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x331b13 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x331b13);this['listenTo'](this['_allConnectedUsers'],'add',(_0xe049d1,_0x359a58)=>{this['_handleUserAdd'](_0x359a58);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0xd22f95,_0x2ac730)=>{this['_handleUserRemove'](_0x2ac730);});}['_createView'](){const _0x44b7ba=this['context'],_0x3799b2=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x32073d=this['balloonPanelView'];if(!_0x15c0ae(_0x44b7ba['config']['get']('presenceList.container')))throw new _0x328f65('presencelist-missing-container',this);return _0x3799b2['counterView']['bind']('usersCount')['to'](this),_0x3799b2['bind']('isCollapsed')['to'](this,'usersCount',_0x2ea9a2=>{const {collapseAt:_0x1109d7}=_0x44b7ba['config']['get']('presenceList'),_0x59d72c=_0x2ea9a2>=_0x1109d7;if(_0x59d72c&&!_0x3799b2['inlineListView']['items']['find'](_0x51b944=>_0x51b944 instanceof y)){const _0x30822a=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x30822a&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3799b2['inlineListView']['items']['add'](_0x3799b2['counterView']);}return _0x59d72c||this['hideDropdown'](),_0x59d72c;}),_0x3799b2['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x3bf63e=>{const _0xcf4845=_0x44b7ba['config']['get']('presenceList'),_0x59d3c7=new _(_0x44b7ba['locale'],_0x3bf63e,!!_0xcf4845['onClick']);return _0x59d3c7['bind']('hasTooltip')['to'](_0x3799b2,'isCollapsed',_0x4e88d4=>!_0x4e88d4),_0x59d3c7['bind']('isFocusable')['to'](_0x3799b2,'isCollapsed',_0x236aa6=>!_0x236aa6),_0xcf4845['onClick']&&this['listenTo'](_0x59d3c7,'execute',()=>{this['view']['isCollapsed']||_0xcf4845['onClick'](_0x3bf63e,_0x59d3c7['element']);}),_0x59d3c7;}),this['listenTo'](_0x3799b2['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3799b2['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3799b2['inlineListView']['keystrokes']['set']('Enter',(_0x149ca2,_0x4bb427)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4bb427());}),_0x3799b2['render'](),_0x32073d['render'](),_0x58b989({'emitter':_0x3799b2,'activator':()=>_0x32073d['isVisible'],'contextElements':[_0x32073d['element'],_0x3799b2['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x44b7ba['config']['get']('presenceList.container')['appendChild'](_0x3799b2['element']),this['_bodyCollection']=new _0x167620(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3799b2;}['_handleUserAdd'](_0x125a6d){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x125a6d['isMe'])return;const _0x2f25bd=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2f25bd-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x3db6ea=_0x125a6d['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x125a6d,_0x3db6ea);}['_handleUserRemove'](_0x1ae344){this['usersCount']--;const {collapseAt:_0x27b01a}=this['context']['config']['get']('presenceList'),_0x24f660=this['usersCount']>=_0x27b01a;if(this['currentDisplayedUsers']['get'](_0x1ae344['id']))this['currentDisplayedUsers']['remove'](_0x1ae344['id']);else{if(_0x24f660&&this['currentDisplayedUsers']['length']+0x1===_0x27b01a-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x24f660?0x1:0x0)<this['usersCount']){for(const _0x7bf907 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x7bf907['id'])&&(this['currentDisplayedUsers']['add'](_0x7bf907,Math['min'](this['currentDisplayedUsers']['length']-(_0x24f660?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x24f660?0x1:0x0)===_0x27b01a-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x2b8e37=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0x2b8e37['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x55ddf1}=this['presenceDropdownView'];_0x55ddf1['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x408adc=>{if(!_0x2b8e37['displayMe']&&_0x408adc['isMe'])return null;const _0x30a984=new P(this['context']['locale'],_0x408adc,!!_0x2b8e37['onClick']);return _0x2b8e37['onClick']&&this['listenTo'](_0x30a984,'execute',()=>{_0x2b8e37['onClick'](_0x408adc,_0x30a984['element']);}),_0x30a984;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x55ddf1['focus'](),_0x55ddf1['checkIfScrollable']();const _0x2a1851=(_0x2b7747,_0x63c7fc)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x63c7fc();};_0x55ddf1['keystrokes']['set']('Esc',_0x2a1851),_0x55ddf1['keystrokes']['set']('Shift+Tab',_0x2a1851),_0x55ddf1['keystrokes']['set']('Tab',(_0x3d54ea,_0x5e05f3)=>{!function(_0x402b9f){const _0x43d592=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x115aa4=>_0x115aa4+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x23f7cc=[...document['body']['querySelectorAll'](_0x43d592)]['filter'](_0x37cfb1=>_0x37cfb1===document['activeElement']||_0x37cfb1['offsetWidth']+_0x37cfb1['offsetHeight']>0x0)['sort']((_0x14bf8b,_0x4b53aa)=>(_0x14bf8b['tabIndex']||0x0)-(_0x4b53aa['tabIndex']||0x0)),_0x23c0e9=_0x23f7cc['indexOf'](_0x402b9f),_0xac57c7=_0x23f7cc[(_0x23c0e9+0x1)%_0x23f7cc['length']];_0xac57c7&&_0xac57c7['focus']();}(this['view']['element']),this['hideDropdown'](),_0x5e05f3();}),_0x55ddf1['focusTracker']['add'](this['view']['element']),_0x55ddf1['focusTracker']['on']('change:isFocused',(_0x22e217,_0x5b6fbb,_0x1fadae)=>{_0x1fadae||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 ft extends _0x40a1a8{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};