@ckeditor/ckeditor5-real-time-collaboration 46.1.0 → 46.1.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +2 -2
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x36b4];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3bc3f9){super(_0x3bc3f9),this['set']('state',_0x71fa89['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x2c9eaa())();}['init'](){const _0x446b4f=this['context'],_0x517e4c=_0x446b4f['plugins']['get']('CloudServices'),_0x581ee=_0x446b4f['plugins']['get'](_0x36b4);if(!_0x517e4c['token'])throw new _0x51025b('websocketgateway-missing-token',this);if(!_0x517e4c['webSocketUrl'])throw new _0x51025b('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'](_0x517e4c['token'],_0x517e4c['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x18fa43=>{if(this['connection']=_0x18fa43,this['bind']('state')['to'](_0x18fa43,'state',this,'_isBrowserOffline',(_0x8ad42b,_0x550a1f)=>('connected'!==_0x8ad42b&&(this['_shouldPluginsReconnect']=!0x0),_0x550a1f||_0x8ad42b!==_0x71fa89['CONNECTED']?_0x71fa89['DISCONNECTED']:this['state']==_0x71fa89['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x71fa89['CONNECTING']):_0x71fa89['CONNECTED'])),this['connection']['on']('error',(_0x5ee7fd,_0x460ed0)=>{if('limitExceeded'!==_0x460ed0['code'])throw console['error'](_0x460ed0),new _0x51025b('cloudservices-init',null,{'originalError':_0x460ed0});_0x581ee['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'});}),!_0x18fa43['me'])return new Promise(_0xb71dd5=>_0x18fa43['on']('change:me',_0xb71dd5));})['catch'](_0x546160=>{throw console['error'](_0x546160),new _0x51025b('cloudservices-init',null,{'originalError':_0x546160});});}['addToReconnectionStack'](_0x18403d){if('function'!=typeof _0x18403d['reconnect'])throw new _0x51025b('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x18403d))throw new _0x51025b('websocketgateway-plugin-already-registered',this,{'name':_0x18403d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x18403d);}['removeFromReconnectionStack'](_0x4f7908){this['_reconnectionStack']['delete'](_0x4f7908);}['isInReconnectionStack'](_0x4d7cc5){return this['_reconnectionStack']['has'](_0x4d7cc5);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x23a4a4=>_0x23a4a4['reconnect']())))['then'](()=>this['state']=_0x71fa89['CONNECTED'])['catch'](_0x387e12=>{throw console['error'](_0x387e12),new _0x51025b('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x71fa89['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x43cd90{['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,_0x170830];}constructor(_0x5d4eaf){super(_0x5d4eaf),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x25abf6(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x170830);}['init'](){const _0xb598c3=this['context']['plugins']['get'](n);this['listenTo'](_0xb598c3,'change:state',(_0x79a27e,_0x10344b,_0x33182a)=>{if('connected'!==_0x33182a)this['channelSessions']['forEach'](_0x1c9e13=>_0x1c9e13['clear']()),this['channelConnectedUsers']['forEach'](_0x36677d=>_0x36677d['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5c4748,_0x136e51]of this['_registeredSessions'])for(const _0x55533c of _0x136e51)this['_handleSessionAdd'](_0x5c4748,_0x55533c);}}),this['_createUser'](_0xb598c3['connection']['me'],!0x0);}['register'](_0x57fb1c,_0x538f5e){if(this['_registeredSessions']['has'](_0x57fb1c))throw new _0x51025b('sessions-register-already-registered',null,{'channelId':_0x57fb1c});this['_registeredSessions']['set'](_0x57fb1c,_0x538f5e),this['channelSessions']['set'](_0x57fb1c,new _0x25abf6()),this['channelConnectedUsers']['set'](_0x57fb1c,new _0x25abf6()),this['listenTo'](_0x538f5e,'add',(_0x29695f,_0x365e5f)=>this['_handleSessionAdd'](_0x57fb1c,_0x365e5f)),this['listenTo'](_0x538f5e,'remove',(_0x32edd8,_0x268a41)=>this['_handleSessionRemove'](_0x57fb1c,_0x268a41));for(const _0x5de744 of _0x538f5e)this['_handleSessionAdd'](_0x57fb1c,_0x5de744);}['unregister'](_0x582abe){if(!this['_registeredSessions']['has'](_0x582abe))throw new _0x51025b('sessions-unregister-not-exist',null,{'channelId':_0x582abe});const _0xc5cfb7=this['_registeredSessions']['get'](_0x582abe);this['stopListening'](_0xc5cfb7);for(const _0x25db45 of _0xc5cfb7)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x582abe,_0x25db45);this['_registeredSessions']['delete'](_0x582abe),this['channelSessions']['delete'](_0x582abe),this['channelConnectedUsers']['delete'](_0x582abe);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x2a148a){for(const _0x1618fb of this['channelSessions']['values']())for(const _0x260c78 of _0x1618fb)if(_0x260c78['id']===_0x2a148a)return _0x260c78['user'];}['getUserSessions'](_0x3c8778,_0x2ceb8f){const _0x3092f6=_0x2ceb8f?[this['channelSessions']['get'](_0x2ceb8f)]:this['channelSessions']['values'](),_0x21932f=new Set();for(const _0x784f9f of _0x3092f6)for(const _0x40432c of _0x784f9f)_0x40432c['user']['id']===_0x3c8778['id']&&_0x21932f['add'](_0x40432c['id']);return _0x21932f;}['getUserRole'](_0x2c790e){for(const _0x2fb8a5 of this['channelSessions']['values']())for(const _0x5df11a of _0x2fb8a5)if(_0x5df11a['user']===_0x2c790e)return _0x5df11a['role'];}['_handleSessionAdd'](_0x3e1b47,_0x28fdd6){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x524011=_0x28fdd6['user'],_0x1abfa1=this['_users']['getUser'](_0x524011['id'])||this['_createUser'](_0x524011),_0x34e539=Object['assign']({},_0x28fdd6,{'user':_0x1abfa1});if(this['channelSessions']['get'](_0x3e1b47)['add'](_0x34e539),!_0x524011['hiddenInPresenceList']){const _0x3a102a=this['channelConnectedUsers']['get'](_0x3e1b47);_0x3a102a['has'](_0x1abfa1['id'])||_0x3a102a['add'](_0x1abfa1),this['allConnectedUsers']['has'](_0x1abfa1['id'])||_0x524011['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x1abfa1,_0x1abfa1['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x3e1b47,{'channelId':_0x3e1b47,'session':_0x34e539});}['_handleSessionRemove'](_0x1398e1,_0x1ce1a0){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x4b9b91=this['channelConnectedUsers']['get'](_0x1398e1),_0x20ed51=_0x1ce1a0['user'];_0x20ed51['id']&&(this['channelSessions']['get'](_0x1398e1)['remove'](_0x1ce1a0['id']),_0x4b9b91['has'](_0x20ed51['id'])&&!this['getUserSessions'](_0x20ed51,_0x1398e1)['size']&&_0x4b9b91['remove'](_0x20ed51['id']),this['allConnectedUsers']['get'](_0x20ed51['id'])&&!this['getUserSessions'](_0x20ed51)['size']&&this['allConnectedUsers']['remove'](_0x20ed51['id']));}['_createUser'](_0x55e1e6,_0x25f10c){const _0x286bcb=this['_users']['addUser'](_0x55e1e6);return _0x25f10c&&this['_users']['defineMe'](_0x55e1e6['id']),_0x286bcb['orderNumber']=this['_uniqueUsersCount']++,_0x286bcb;}}class B extends _0x36b438{['_domEmitter']=new(_0x2c9eaa())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4bc2e8=this['editor'],_0xbf3bf6=_0x4bc2e8['plugins']['get'](i);_0x4bc2e8['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x33bb45,{writer:_0x2948c0})=>function(_0xe3e1c2,_0x1883e7,_0x1a9c20,_0x496e12){const _0x3fc493=_0xe3e1c2['markerName']['split'](':')[0x2],_0x164d8b=_0x1a9c20['getUserBySessionId'](_0x3fc493);if(!_0x164d8b||_0x3fc493===_0x1a9c20['mySessionId'])return;if(!_0x496e12['model']['schema']['checkChild'](_0xe3e1c2['markerRange']['start'],'$text'))return;const _0x5db3ab={'class':'ck-user__marker\x20'+_0x164d8b['color']['getMarkerClass'](),'data-name':_0x164d8b['name'],'data-session-id':_0x3fc493},_0xcec918=_0x496e12['model']['markers']['get'](_0xe3e1c2['markerName']),_0x58722c=_0xcec918['getStart'](),_0x5861b3=_0x58722c['nodeAfter'],_0x313fe6=_0x496e12['model']['schema'];if(_0x5861b3&&_0x313fe6['isObject'](_0x5861b3)&&_0x313fe6['isInline'](_0x5861b3)&&!_0x496e12['model']['markers']['get']('user:range:'+_0x3fc493)['getRange']()['isCollapsed'])return;const _0x5d0dd5=_0x58722c['parent'];return _0x496e12['model']['schema']['isLimit'](_0x5d0dd5)&&!_0x496e12['model']['hasContent'](_0x5d0dd5)&&(_0x5db3ab['contenteditable']=!0x1),function(_0x5897e9,_0x1e7d68,_0x57cbaa){const _0x4b8d7e=_0x5897e9['createUIElement']('span',_0x1e7d68);return _0x5897e9['setCustomProperty']('userPositionMarker',!0x0,_0x4b8d7e),_0x4b8d7e['render']=function(_0x469d7e){const _0x345482=this['toDomElement'](_0x469d7e),_0x3367e5=document['createElement']('span');return _0x3367e5['classList']['add']('ck-user__marker-tooltip'),_0x3367e5['setAttribute']('contenteditable','false'),_0x3367e5['setAttribute']('spellcheck','false'),_0x3367e5['textContent']=_0x57cbaa['name'],_0x345482['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3367e5['outerHTML']+'',_0x345482['addEventListener']('mouseenter',()=>{_0x345482['classList']['add']('ck-user__marker_hovered');}),_0x345482['addEventListener']('mouseleave',()=>{_0x345482['classList']['remove']('ck-user__marker_hovered');}),_0x345482;},_0x4b8d7e['isSimilar']=function(_0x5f341f){return!(!this['getCustomProperty']('userPositionMarker')||!_0x5f341f['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x5f341f['getAttribute']('data-session-id'));},_0x4b8d7e;}(_0x1883e7,_0x5db3ab,_0x164d8b);}(_0x33bb45,_0x2948c0,_0xbf3bf6,_0x4bc2e8)}),_0x4bc2e8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3be1e4=>function(_0x106ab1,_0x348087){const _0x5e7a01=_0x106ab1['markerName']['split'](':')[0x2];if(_0x5e7a01===_0x348087['mySessionId'])return null;const _0x4dcfb6=_0x348087['getUserBySessionId'](_0x5e7a01);if(!_0x4dcfb6)return{'id':_0x5e7a01,'classes':[]};return{'id':_0x5e7a01,'classes':['ck-user__selection',_0x4dcfb6['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x5e7a01},'priority':0x7d0+_0x4dcfb6['orderNumber']};}(_0x3be1e4,_0xbf3bf6)}),function(_0x3fc749){const _0x125c48=_0x3fc749['model'],_0x3e1e87=new Map(),_0x518e9a=_0x3fc749['plugins']['get'](i);_0x125c48['markers']['on']('update:user:range',(_0x3311ed,_0x227b08,_0x1ec1f4,_0x1831cf)=>{if(!_0x1831cf&&_0x3e1e87['get'](_0x227b08['name']))return _0x3e1e87['get'](_0x227b08['name'])['detach'](),void _0x3e1e87['delete'](_0x227b08['name']);const _0x31ef45=_0x227b08['name']['split'](':')[0x2];if(_0x31ef45===_0x518e9a['mySessionId'])return;const _0x4ec68f='user:position:'+_0x31ef45;_0x125c48['markers']['has'](_0x4ec68f)&&_0x3fc749['editing']['reconvertMarker'](_0x4ec68f),_0x227b08['on']('change:range',(_0x3ce21f,_0x476efc,_0x27f0dd)=>{if('$graveyard'!=_0x476efc['root']['rootName']&&'$graveyard'==_0x227b08['getRange']()['root']['rootName']&&!_0x3e1e87['has'](_0x227b08['name'])){const _0x4b2cc2=_0x125c48['schema']['getNearestSelectionRange'](_0x27f0dd['deletionPosition']);if(_0x4b2cc2){const _0x63378d=_0x350dc0['fromRange'](_0x4b2cc2);_0x3e1e87['set'](_0x227b08['name'],_0x63378d),_0x63378d['on']('change:range',(_0x1f8a89,_0x1feecb,_0x4f4a3)=>{if('$graveyard'==_0x63378d['root']['rootName']){const _0x43c9af=_0x125c48['schema']['getNearestSelectionRange'](_0x4f4a3['deletionPosition']);_0x43c9af?(_0x63378d['start']=_0x43c9af['start'],_0x63378d['end']=_0x43c9af['end']):(_0x3e1e87['delete'](_0x227b08['name']),_0x63378d['detach']());}});}}});}),_0x125c48['document']['on']('change',()=>{_0x3e1e87['size']>0x0&&_0x125c48['enqueueChange']({'isUndoable':!0x1},_0x53bb93=>{for(const [_0x291066,_0x420de3]of _0x3e1e87)'$graveyard'==_0x125c48['markers']['get'](_0x291066)['getRange']()['root']['rootName']&&(K(_0x291066['split'](':')[0x2],_0x420de3['toRange'](),_0x125c48,_0x53bb93),_0x420de3['detach']());_0x3e1e87['clear']();});});}(_0x4bc2e8),this['_domEmitter']['listenTo'](_0x462adf['document'],'keydown',(_0xce9dc3,{key:_0x11dead})=>{'Escape'===_0x11dead&&function(_0x1ecb6c){_0x1ecb6c['editing']['view']['change'](_0x375abf=>{for(const _0x2f7831 of _0x1ecb6c['model']['markers']){if(!_0x2f7831['name']['startsWith']('user:position'))continue;const _0x2afa96=_0x1ecb6c['editing']['mapper']['markerNameToElements'](_0x2f7831['name']);if(_0x2afa96){for(const _0x416ea9 of _0x2afa96)_0x375abf['removeClass']('ck-user__marker_hovered',_0x416ea9);}}});}(_0x4bc2e8);},{'useCapture':!0x0});}['afterInit'](){const _0x5798d2=this['editor'],_0x2cf479=_0x5798d2['commands']['get']('undo');_0x2cf479&&_0x5798d2['model']['on']('applyOperation',(_0x336990,_0x5a95b7)=>{const _0x350144=_0x5a95b7[0x0];if(!_0x350144['isDocumentOperation'])return;if('marker'!=_0x350144['type']||!_0x350144['name']['startsWith']('user:'))return;const _0x35e6d8=_0x350144['batch'];_0x2cf479['_createdBatches']['has'](_0x35e6d8)&&(_0x350144['newRange']=_0x350144['oldRange']?_0x5798d2['model']['createRange'](_0x350144['oldRange']['start'],_0x350144['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x14646a=this['editor'],_0x361bc4=_0x14646a['model']['document'],_0x3203c1=_0x14646a['plugins']['get'](i);_0x14646a['model']['enqueueChange']({'isUndoable':!0x1},_0x1bf94d=>{const _0x39ec6a='user:range:'+_0x3203c1['mySessionId'],_0xa3d9ca='user:position:'+_0x3203c1['mySessionId'],_0x4e46bf=_0x14646a['model']['markers']['has'](_0x39ec6a);_0x14646a['editing']['view']['hasDomSelection']?K(_0x3203c1['mySessionId'],_0x361bc4['selection']['getFirstRange'](),_0x14646a['model'],_0x1bf94d):_0x4e46bf&&(_0x1bf94d['removeMarker'](_0x39ec6a),_0x1bf94d['removeMarker'](_0xa3d9ca));});}}function K(_0x3adc83,_0x18bf11,_0x5be1ea,_0x33a08a){const _0x5876e2='user:range:'+_0x3adc83,_0x8524fc='user:position:'+_0x3adc83,_0xc42644=_0x18bf11['getContainedElement']();let _0x1ec888=_0x18bf11['start'];if(_0xc42644&&_0xc42644['is']('element','tableCell')){const _0x4be3d9=function(_0x7aaa0c,_0x5174c3){for(const _0x24d977 of _0x7aaa0c['getPositions']())if(_0x5174c3['schema']['checkChild'](_0x24d977,'$text'))return _0x24d977;}(_0x18bf11,_0x5be1ea);_0x4be3d9&&(_0x1ec888=_0x4be3d9,_0x18bf11=_0x33a08a['createRange'](_0x1ec888));}const _0x13f8be=_0x33a08a['createRange'](_0x1ec888);_0x5be1ea['markers']['has'](_0x5876e2)?(_0x33a08a['updateMarker'](_0x5876e2,{'range':_0x18bf11}),_0x33a08a['updateMarker'](_0x8524fc,{'range':_0x13f8be})):(_0x33a08a['addMarker'](_0x5876e2,{'range':_0x18bf11,'usingOperation':!0x0}),_0x33a08a['addMarker'](_0x8524fc,{'range':_0x13f8be,'usingOperation':!0x0}));}function x(_0x50845f,_0x2ded3e,_0x1d4e36){const _0x3c1638=_0x50845f['t'],t=_0x50845f['t'];switch(_0x2ded3e){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 _0x3c1638({'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'},_0x1d4e36);default:return'';}}let H=0x1;class l extends _0x36b438{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x94b8a0)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,B,_0x3fc2d4,_0x170830,_0x36b4];}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 _0x3a16e4=this['serverHistory']['getOperations']();for(let _0x1130a9=_0x3a16e4['length']-0x1;_0x1130a9>=0x0;_0x1130a9--){const _0x467dff=_0x3a16e4[_0x1130a9];if(!this['_disconnectionOperations']['has'](_0x467dff))return _0x467dff['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x23d291){if(super(_0x23d291),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5b2133(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x51025b('collaboration-missing-channelid',this);const _0xe60650=_0x23d291['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xe60650,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xfac916(),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 F(this['_disconnectionOperations']);}['init'](){const _0x111ece=this['editor'],_0x39e8cd=_0x111ece['plugins']['get'](_0x170830),_0x2902dc=_0x111ece['plugins']['get'](n);this['listenTo'](_0x39e8cd,'getOperationAuthor',(_0x292519,_0x2dedd7)=>{const _0xc5858e=_0x2dedd7[0x0];_0xc5858e['_authorId']&&(_0x292519['return']=_0x39e8cd['getUser'](_0xc5858e['_authorId']),_0x292519['stop']()),null===_0xc5858e['_authorId']&&(_0x292519['return']=null,_0x292519['stop']());},{'priority':'high'}),this['listenTo'](_0x111ece['model']['document']['selection'],'change:range',(_0x169b3a,_0x42944b)=>{_0x42944b['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x111ece['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x111ece['model']['on']('applyOperation',(_0x3cad56,_0x12a6ff)=>{const _0x58bfc9=_0x12a6ff[0x0];_0x58bfc9['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x58bfc9),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2902dc,'state',this,'_hasSynchronizationProblem',(_0x5b7691,_0x393343)=>'connected'===_0x5b7691&&!_0x393343),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x111ece['disableReadOnlyMode']('rtc-offline'):_0x111ece['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x111ece['disableReadOnlyMode']('rtc-offline'):_0x111ece['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4444dd=this['editor']['plugins']['get'](i),_0x593ed4=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x4444dd['unregister'](this['_channelId']);const _0x30913a=await this['_service']['reconnect'](_0x593ed4['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x30913a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x182a42=await this['_service']['getConnectedSessions']();_0x4444dd['register'](this['_channelId'],_0x182a42),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x585809){if(function(_0x107b06){return'404'===_0x107b06['code'];}(_0x585809)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4e68bd){return'409'===_0x4e68bd['code'];}(_0x585809)){const _0x388fa8=x(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'](_0x388fa8);}else{if(!(_0x585809 instanceof V))throw _0x585809;this['_handleReconnectionError']();}}}}['destroy'](){const _0x266c7d=this['editor']['plugins']['get'](n),_0x34415b=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x34415b['channelSessions']['has'](this['_channelId'])&&_0x34415b['unregister'](this['_channelId']),_0x266c7d['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x340ce2){if(this['sessionId']!==_0x340ce2['sessionId']&&this['_lastSyncedOperationId']!==_0x340ce2['lastOperationId'])throw new V();return this['sessionId']=_0x340ce2['sessionId'],this['_handleServerResponse']([],{..._0x340ce2,'wereChangesApplied':!0x1,'data':_0x340ce2['data']},'reconnect');}async['_connectService'](_0x3d7af7,_0x2a504c=!0x1){const {connection:_0x3bbbed}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x3bbbed,this['_channelId'])['then'](_0x3996fe=>this['_initSessionsHandling'](_0x3996fe))['catch'](_0x4beca9=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4beca9);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x28bf6c,_0x131318)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x131318);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x28ceb2=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3d7af7);this['_isPendingUpdate']=!0x0;const _0x5e84f1=await this['_service']['connect'](_0x3bbbed,this['_compressOperations'](_0x3d7af7),_0x28ceb2);if(this['sessionId']=_0x5e84f1['sessionId'],_0x2a504c){if(!_0x5e84f1['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x5e84f1['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3d7af7,_0x5e84f1,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x5e84f1,_0x3d7af7);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x5afde1=this['editor']['plugins']['get'](i),_0x47677b=this['editor']['plugins']['get'](B),_0x49a1f1=_0x5afde1['channelSessions']['get'](this['_channelId']);_0x49a1f1&&_0x49a1f1['length']>0x1?_0x47677b['createUserMarkerOperations']():this['listenTo'](_0x5afde1,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x5afde1['channelSessions']['get'](this['_channelId'])['length']&&_0x47677b['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3b2771,_0xe4d96d,_0x552d6d,_0x16b704){if(!this['_isPendingUpdate']&&this['_document']['version']==_0xe4d96d){const _0x106eea=this['_decompressOperations'](_0x552d6d,_0x16b704);await this['_fetchMissingUsers'](_0x106eea),this['_handleExternalOperations'](_0x106eea,_0xe4d96d,_0x552d6d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x22c564}=this['editor'];let _0x12ed29;try{_0x12ed29=await this['_service']['getDocumentDetails']();}catch{const _0x3caea4=x(_0x22c564,'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'](_0x3caea4);}const _0x224cb4=_0x12ed29['currentDocumentSession']||_0x12ed29['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x224cb4['lastOperationId']){const _0x42dbfd=x(_0x22c564,'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'](_0x42dbfd);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x15f4d9){const _0x448597=this['editor']['plugins']['get'](i);this['listenTo'](_0x448597,'sessionAdd:'+this['_channelId'],(_0x2aa941,{session:_0x1a4e54})=>{if(_0x1a4e54['id']===_0x448597['mySessionId']){_0x2aa941['off']();const _0x88b804=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x299aed=_0x1a4e54['permissions'];_0x88b804&&_0x88b804['isEnabled']&&(_0x299aed=_0x299aed['filter'](_0x272af3=>'document:write'!==_0x272af3)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x299aed,this['_channelId']);}}),_0x448597['register'](this['_channelId'],_0x15f4d9);}['_initThrowingOnDataSet'](){const _0x262bf5=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x49eb5b)=>{if(!_0x49eb5b[_0x49eb5b['length']-0x1]['suppressErrorInCollaboration'])throw new _0x51025b('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x262bf5['apply'](this['editor']['data'],_0x49eb5b);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x9c213c,[_0x1a3389])=>{if(this['_document']['version'])throw new _0x51025b('realtimecollaborationclient-init-document-already-initialized',this);_0x9c213c['stop'](),this['_setPendingAction']();const _0x41849c=this['editor']['config']['get']('rootsAttributes'),_0x5db744=this['_getOperationsFromInitData'](_0x1a3389,_0x41849c);0x0==_0x5db744['length']&&_0x5db744['push'](new _0xcdcc1c(0x0)),_0x9c213c['return']=this['_connectService'](_0x5db744)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x11aa46=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x11aa46))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x52c3ab,[_0x44ddd7,_0x30f8f0])=>{_0x52c3ab['stop']();const _0x4a7d67=this['editor']['model']['document']['getRoot'](_0x44ddd7);if(!this['_knownRootNames']['has'](_0x44ddd7)){const _0x51153f=_0x30f8f0&&_0x30f8f0['data']?_0x30f8f0['data']:'',_0x45a726=_0x30f8f0&&_0x30f8f0['attributes']?_0x30f8f0['attributes']:{};await this['_loadRoot'](_0x44ddd7,_0x51153f,_0x45a726);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x4a7d67['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x4a7d67);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x183a69){const _0x418fb4=this['editor']['plugins']['get'](_0x170830),{connection:_0x54dbeb}=this['editor']['plugins']['get'](n),_0xc0126b=new Set();for(const _0x26980c of _0x183a69){const _0x194d2d=_0x26980c['_authorId'];_0x194d2d&&!_0x418fb4['getUser'](_0x194d2d)&&_0xc0126b['add'](_0x194d2d);}if(0x0===_0xc0126b['size'])return;const _0x414977=await ut['getMany'](_0x54dbeb,Array['from'](_0xc0126b));for(const _0x85fe10 of _0x414977)_0x418fb4['getUser'](_0x85fe10['id'])||_0x418fb4['addUser'](_0x85fe10);}['_getOperationsFromInitData'](_0x1182e7,_0x75d276={}){const _0x5358b6=this['editor']['model'],_0x22937d=[];let _0x1e2b09=0x0;const _0x42edbc='string'==typeof _0x1182e7?{'main':_0x1182e7}:_0x1182e7;for(const _0x4f508c of Object['keys'](_0x42edbc)){if(!this['_document']['roots']['has'](_0x4f508c))throw new _0x51025b('realtimecollaborationclient-init-non-existent-root',this);const _0xe6bd5f=this['editor']['data']['parse'](_0x42edbc[_0x4f508c]),_0x685ec6=this['_document']['getRoot'](_0x4f508c),_0x2955d3=new _0x3991a5(_0x5358b6['createPositionAt'](_0x685ec6,0x0),_0xe6bd5f,_0x1e2b09++);_0x22937d['push'](_0x2955d3);for(const [_0x2568c8,_0x5d7b78]of _0xe6bd5f['markers']){const _0x5c4aae=_0x5358b6['createRange'](_0x5358b6['createPositionFromPath'](_0x685ec6,_0x5d7b78['start']['path']['slice']()),_0x5358b6['createPositionFromPath'](_0x685ec6,_0x5d7b78['end']['path']['slice']())),_0x27549c=new _0x560cbe(_0x2568c8,null,_0x5c4aae,_0x5358b6['markers'],!0x0,_0x1e2b09++);_0x22937d['push'](_0x27549c);}}if(_0x75d276)for(const [_0x502d4a,_0x533605]of Object['entries'](_0x75d276)){const _0x5a11a9=_0x5358b6['document']['getRoot'](_0x502d4a);if(!_0x5a11a9)throw new _0x51025b('multi-root-editor-root-attributes-no-root',null);for(const [_0x410098,_0x1b9855]of Object['entries'](_0x533605))if(null!==_0x1b9855){const _0x3f1c92=new _0x379ae3(_0x5a11a9,_0x410098,null,_0x1b9855,_0x1e2b09++);_0x22937d['push'](_0x3f1c92);}}return _0x22937d;}async['_loadRoot'](_0x2f8a0b,_0x1aa791,_0x5cc496){this['_getOperationsFromInitData']({[_0x2f8a0b]:_0x1aa791},{[_0x2f8a0b]:_0x5cc496})['forEach']((_0xd6bfe1,_0x3faff6)=>{_0xd6bfe1['baseVersion']=this['_document']['version']+_0x3faff6,_0xd6bfe1['_isInit']=!0x0,this['_saveOperationInBuffer'](_0xd6bfe1);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x163a81,_0xbfbca5){let _0xb5ed4c;this['_offset']=_0x163a81['offset'];const _0xc58633=_0x163a81['wereChangesApplied']&&!_0x163a81['initData'],_0x19f91b=_0xc58633?0x0:_0x163a81['data']['baseVersion'];if(_0xbfbca5['forEach'](_0x48e47b=>{_0x48e47b['_isInit']=!0x0,_0x48e47b['createdAt']=_0x163a81['sessionCreatedAt'],_0x48e47b['_authorId']=null;}),_0xc58633)_0xb5ed4c=_0xbfbca5,this['_applyOperationsSet'](_0xb5ed4c,_0xc58633);else{if(_0x163a81['initData']){const _0x5499fb=this['_getOperationsFromInitData'](_0x163a81['initData']);this['_document']['history']['version']=-_0x5499fb['length'],_0x5499fb['forEach'](_0x53c1ee=>{_0x53c1ee['baseVersion']-=_0x5499fb['length'],_0x53c1ee['createdAt']=_0x163a81['sessionCreatedAt'],_0x53c1ee['_isInit']=!0x0,_0x53c1ee['_authorId']=null;}),this['_applyOperationsSet'](_0x5499fb,!0x0),this['serverHistory']['version']=-_0x5499fb['length']+this['_offset'],this['_updateServerHistory'](_0x5499fb);}this['_document']['history']['version']=_0x19f91b,_0xb5ed4c=this['_decompressOperations'](_0x163a81['data'],_0x163a81['metadata']),await this['_fetchMissingUsers'](_0xb5ed4c),this['_applyOperationsSet'](_0xb5ed4c,_0xc58633);}_0x163a81['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0xb5ed4c,_0x163a81['lastOperationId']),this['_lastSyncedOperationId']=_0x163a81['lastOperationId']),this['serverHistory']['version']=_0x19f91b+this['_offset'],this['_updateServerHistory'](_0xb5ed4c),_0xbfbca5['filter'](_0x5214c0=>{const _0xdac913=this['_getAffectedRoot'](_0x5214c0);return _0xdac913&&!this['_knownRootNames']['has'](_0xdac913);})['forEach']((_0x3ef683,_0x1f8187)=>{_0x3ef683['baseVersion']=this['_document']['version']+_0x1f8187,this['_saveOperationInBuffer'](_0x3ef683);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x56d670,_0x4d174f){const _0x33db67=_0x4d174f&&_0x4d174f['message'];if(_0x33db67&&_0x33db67['startsWith']('realtimecollaborationclient'))throw _0x4d174f;const _0x25eaf3=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x25eaf3['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x51025b(_0x56d670,this['editor'],_0x33db67?{'originalError':_0x33db67}:void 0x0);}['_saveOperationInBuffer'](_0x17c2c2){this['_knownOperations']['has'](_0x17c2c2)||(this['_knownOperations']['add'](_0x17c2c2),this['_bufferedOperations']['push'](_0x17c2c2),this['_pendingAction']||'marker'==_0x17c2c2['type']&&!_0x17c2c2['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0xac85ce=!0x1){!_0xac85ce&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x26768a=>{_0x26768a&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x50b598=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x22c791){return _0x22c791['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x22c791['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x22c791['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x50b598)||this['_crash'](_0x50b598['message'],_0x50b598);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0xe68dd3=>{this['on']('change:_isPendingUpdate',()=>{_0xe68dd3();});});}async['_sendBufferedOperations'](){const _0x53a009=this['editor']['plugins']['get'](B);if(this['_shouldSendSelectionUpdate']()&&(_0x53a009['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1ba846=[...this['_bufferedOperations']];for(const _0x2bd036 of _0x1ba846)_0x2bd036['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2bd036);const _0x345829=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1ba846),_0xed60f7=H++,_0x56705a=this['_compressOperations'](_0x1ba846),_0xfff07f=await this['_service']['sendOperations'](_0x56705a,_0x56705a['baseVersion'],_0x345829);try{return await this['_handleServerResponse'](_0x1ba846,_0xfff07f,_0xed60f7);}catch(_0x5a3ffb){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x5a3ffb);}}async['_handleServerResponse'](_0xd85c73,_0x35a797,_0x3ccb24){if('error'in _0x35a797)throw _0x35a797['error'];let _0x1169a1=!0x1;if(_0x35a797['wereChangesApplied']){_0x35a797['lastOperationId']&&(this['_lastSyncedOperationId']=_0x35a797['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5a74c7=>!_0xd85c73['includes'](_0x5a74c7));for(const _0x22fee9 of _0xd85c73)_0x22fee9['createdAt']='lastOperationAcceptedAt'in _0x35a797&&_0x35a797['lastOperationAcceptedAt']||void 0x0;W(_0xd85c73,_0x35a797['version']-_0xd85c73['length']),this['_updateServerHistory'](_0xd85c73);const _0x5b77ec=_0xd85c73['filter'](_0x46734d=>{if(!_0x46734d['_isInit'])return!0x1;const _0x433677=this['_getAffectedRoot'](_0x46734d);return _0x433677&&!this['_knownRootNames']['has'](_0x433677);});W(_0x5b77ec,this['_document']['version']),this['_applyOperationsSet'](_0x5b77ec),_0x1169a1=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3f1aab=this['_decompressOperations'](_0x35a797['data'],_0x35a797['metadata'])['filter'](_0x43f528=>_0x43f528['baseVersion']>=this['_lastServerVersion']);_0x3f1aab['forEach'](_0xae3580=>this['_addKnownRoot'](_0xae3580)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2132a7=>!_0x2132a7['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2132a7))),this['_bufferedOperations']['length']&&W(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3f1aab),_0x1169a1=this['_handleExternalOperations'](_0x3f1aab,_0x35a797['version'],_0x35a797['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x1169a1?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5c2c73,_0x2c8b91,_0x3a3d74){try{const _0x42e40f={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0xb36c16,operationsB:_0x1757f4,originalOperations:_0x403cfb}=_0x3e1311(_0x5c2c73,this['_bufferedOperations'],_0x42e40f);W(_0xb36c16,this['_document']['version']),W(_0x1757f4,_0x2c8b91);for(const _0x3f1fa1 of _0xb36c16){const _0x3047ec=_0x403cfb['get'](_0x3f1fa1);_0x3f1fa1['_authorId']=_0x3047ec?_0x3047ec['_authorId']:null;}_0x3a3d74&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5c2c73,_0x3a3d74),this['_lastSyncedOperationId']=_0x3a3d74),this['_bufferedOperations']=[..._0x1757f4],this['_applyOperationsSet'](_0xb36c16),this['_updateServerHistory'](_0x5c2c73);}catch(_0x398a8e){return console['error'](_0x398a8e),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3c9e4a,_0x47d650=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x20dbfc=>{for(const _0x4ab904 of _0x3c9e4a)this['_knownOperations']['add'](_0x4ab904),this['_addKnownRoot'](_0x4ab904),_0x20dbfc['batch']['addOperation'](_0x4ab904),this['editor']['model']['applyOperation'](_0x4ab904);});}['_addKnownRoot'](_0x1fa64d){const _0x4a8a2f=this['_getAffectedRoot'](_0x1fa64d);_0x4a8a2f&&this['_knownRootNames']['add'](_0x4a8a2f);}['_getAffectedRoot'](_0x148e84){let _0x511ed3,_0x4f8ae1;switch(_0x148e84['type']){case'insert':_0x511ed3=_0x148e84['position']['root'];break;case'marker':if(_0x4f8ae1=_0x148e84['newRange'],!_0x4f8ae1)return null;_0x511ed3=_0x4f8ae1['root'];break;case'addRootAttribute':_0x511ed3=_0x148e84['root'];break;case'addRoot':_0x511ed3=_0x148e84['affectedSelectable'];break;case'move':_0x511ed3=_0x148e84['targetPosition']['root'];break;default:return null;}return _0x511ed3['rootName'];}['_updateServerHistory'](_0x51a825){_0x51a825['forEach'](_0x117498=>{const _0x408098=_0x117498['clone']();_0x408098['_authorId']=_0x117498['_authorId'],_0x408098['_isInit']=!!_0x117498['_isInit'],_0x408098['createdAt']=_0x117498['createdAt'],_0x408098['baseVersion']+=this['_offset'],_0x117498['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x408098),this['serverHistory']['addOperation'](_0x408098);});}['_handleReconnectionError'](_0x2e0a11){const _0x15aa3f=this['editor']['plugins']['get']('Notification'),_0x2c9917=this['editor']['locale'];_0x2e0a11||(_0x2e0a11=x(_0x2c9917,'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.')),_0x15aa3f['showWarning'](_0x2e0a11,{'title':x(_0x2c9917,'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'](_0x3fc2d4)['add'](x(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3fc2d4)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x310be8){const _0x5e755d=_0x310be8['map'](_0x129535=>_0x129535['toJSON']());return this['_compressor']['compress'](_0x5e755d);}['_decompressOperations'](_0x33dfb5,_0xa865bd){return this['_compressor']['decompress'](_0x33dfb5)['map']((_0x9f6040,_0x9d543a)=>{const _0xf3d67e='init'==_0xa865bd[_0x9d543a]['type'];if('InsertOperation'==_0x9f6040['__className']){const _0x1f1d9d=_0x9f6040['position']['root'];!this['_document']['getRoot'](_0x1f1d9d)&&(this['_document']['createRoot']('$root',_0x1f1d9d)['_isAttached']=!0x1);}const _0x44435a=_0x15c984['fromJSON'](_0x9f6040,this['_document']);return _0x44435a['wasUndone']=_0x9f6040['wasUndone'],_0x44435a['_isInit']=_0xf3d67e,_0x44435a['_authorId']=_0xf3d67e?null:_0xa865bd[_0x9d543a]['userId'],_0x44435a['_isDisconnection']='cs:removeUser'===_0xa865bd[_0x9d543a]['type'],_0x44435a['createdAt']=_0xa865bd[_0x9d543a]['createdAt'],_0x44435a;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x24b8ad=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x24b8ad&&_0x24b8ad['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class V extends Error{}function W(_0x1bd5e9,_0x8e9eda){for(const _0x4a2ab1 of _0x1bd5e9)_0x4a2ab1['baseVersion']=_0x8e9eda++;}class F{['_ignoredOperations'];['_operationToId'];constructor(_0xfc5c62){this['_ignoredOperations']=_0xfc5c62,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xe69736){let _0x1a9004=_0xe69736['length'];for(;_0x1a9004--;){const _0x286e8e=_0xe69736[_0x1a9004];if(!this['_ignoredOperations']['has'](_0x286e8e)){if(!this['_operationToId']['has'](_0x286e8e)){const _0x4b8a06=_0x1acdad()['slice'](0x1,0x12);this['_operationToId']['set'](_0x286e8e,_0x4b8a06);}return this['_operationToId']['get'](_0x286e8e);}}}['setIdForTheLastOperation'](_0x2343d4,_0x128ba7){if(!_0x128ba7)return;let _0x3f17a8=_0x2343d4['length'];for(;_0x3f17a8--;){const _0x2b92b2=_0x2343d4[_0x3f17a8];this['_ignoredOperations']['has'](_0x2b92b2)||this['_operationToId']['set'](_0x2b92b2,_0x128ba7);}}}class a extends _0x36b438{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x43cd90{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x950533)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x170830];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x373c84){super(_0x373c84),this['_services']=new Map();}async['init'](){const _0xb798c3=this['context'],_0x2b52a8=_0xb798c3['plugins']['get']('CommentsRepository');if(_0xb798c3['plugins']['get'](n)['addToReconnectionStack'](this),_0x2b52a8['adapter']={'addCommentThread':async({channelId:_0x4a9728,threadId:_0x5d6ea4,comments:_0x3513fa,resolvedAt:_0x597639,resolvedBy:_0x4bc811,context:_0x45848a,attributes:_0x337132})=>{const _0xc28046=await this['_getService'](_0x4a9728)['addCommentThread']({'commentThreadId':_0x5d6ea4,'comments':_0x3513fa['map'](_0x331917=>function(_0x394b48,_0x132d80,_0x3d1e94){return{'commentThreadId':_0x3d1e94,'commentId':_0x394b48['commentId'],'userId':_0x394b48['authorId'],'content':_0x394b48['content'],'documentId':_0x132d80,'createdAt':_0x394b48['createdAt'],'attributes':_0x394b48['attributes']||{}};}(_0x331917,_0x4a9728,_0x5d6ea4)),'resolvedAt':_0x597639,'resolvedBy':_0x4bc811,'context':_0x45848a,'attributes':_0x337132})['catch'](ft);return{'threadId':_0xc28046['commentThreadId'],'comments':_0xc28046['comments']};},'getCommentThread':async({channelId:_0x1cc569,threadId:_0x3ca3c4})=>{const _0x324d67=await this['_getService'](_0x1cc569)['getCommentThread'](_0x3ca3c4)['catch'](v)['catch'](ft);return _0x324d67?_0x324d67['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x324d67]),{'threadId':_0x324d67['commentThreadId'],'comments':_0x324d67['comments']['map'](p),'context':_0x324d67['context'],'resolvedAt':_0x324d67['resolvedAt'],'resolvedBy':_0x324d67['resolvedBy'],'attributes':_0x324d67['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3eecfb,threadId:_0x3fb14e,context:_0xab1e55,unlinkedAt:_0x43addd,attributes:_0x359bae})=>this['_getService'](_0x3eecfb)['updateCommentThread']({'commentThreadId':_0x3fb14e,'context':_0xab1e55,'attributes':_0x359bae,'unlinkedAt':_0x43addd})['catch'](v)['catch'](ft),'resolveCommentThread':async({channelId:_0x44455a,threadId:_0x273a59})=>{const _0x4c823e=await this['_getService'](_0x44455a)['resolveCommentThread'](_0x273a59)['catch'](v)['catch'](ft);return{'threadId':_0x4c823e['commentThreadId'],'resolvedAt':_0x4c823e['resolvedAt'],'resolvedBy':_0x4c823e['resolvedBy']};},'reopenCommentThread':async({channelId:_0x4aebba,threadId:_0xeb4cfe})=>this['_getService'](_0x4aebba)['reopenCommentThread'](_0xeb4cfe)['catch'](v)['catch'](ft),'removeCommentThread':({channelId:_0x41c166,threadId:_0x47d909})=>this['_getService'](_0x41c166)['removeCommentThread'](_0x47d909)['catch'](v)['catch'](ft),'addComment':({channelId:_0x14b354,threadId:_0x2ecea3,commentId:_0x1df97c,content:_0x233268,attributes:_0x364b6e})=>this['_getService'](_0x14b354)['addComment'](_0x2ecea3,_0x1df97c,_0x233268,_0x364b6e)['catch'](ft),'updateComment':({channelId:_0x49ed9a,threadId:_0x26ee6f,commentId:_0x38138f,content:_0x57f69f,attributes:_0x1c0e85})=>this['_getService'](_0x49ed9a)['updateComment'](_0x26ee6f,_0x38138f,_0x57f69f,_0x1c0e85)['catch'](v)['catch'](ft),'removeComment':({channelId:_0x1a1f08,threadId:_0x112711,commentId:_0x3cdc2f})=>this['_getService'](_0x1a1f08)['removeComment'](_0x112711,_0x3cdc2f)['catch'](v)['catch'](ft)},_0xb798c3 instanceof _0xbec918){const _0x399d11=_0xb798c3['config']['get']('collaboration.channelId'),_0x597b65=_0xb798c3['plugins']['get'](i);await this['_setUpService'](_0x399d11);const _0x1911bd=await this['_services']['get'](_0x399d11)['getConnectedSessions']();this['listenTo'](_0x597b65,'sessionAdd:'+_0x399d11,(_0x31bf22,{session:_0x66b30})=>{_0x66b30['id']===_0x597b65['mySessionId']&&(_0x31bf22['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x66b30['permissions'],_0x399d11));}),_0x597b65['register'](_0x399d11,_0x1911bd);}}async['_setUpService'](_0x3d7758){if(this['_services']['has'](_0x3d7758))throw new _0x51025b('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x3d7758});const _0x261fda=this['context']['plugins']['get']('CommentsRepository'),_0x1a043a=new s['CommentsService'](_0x3d7758);this['_services']['set'](_0x3d7758,_0x1a043a),this['listenTo'](_0x1a043a,'commentThreadAdded',(_0x5010ea,_0x3b5ad4)=>{const {commentThreadId:_0x212da0,documentId:_0x3c1c05,context:_0x2ad2af,attributes:_0x3783ea,resolvedAt:_0x4fb2d6,resolvedBy:_0x5f73b2,comments:_0x31d69e}=_0x3b5ad4;_0x261fda['getCommentThread'](_0x212da0)||_0x261fda['addCommentThread']({'threadId':_0x212da0,'channelId':_0x3c1c05,'comments':_0x31d69e?_0x31d69e['map'](p):[],'context':_0x2ad2af,'attributes':_0x3783ea,'resolvedAt':_0x4fb2d6,'resolvedBy':_0x5f73b2,'isFromAdapter':!0x0});}),this['listenTo'](_0x1a043a,'commentThreadUpdated',(_0x4e6492,{commentThreadId:_0x137c93,documentId:_0x4c1caf,context:_0x3e1abd,unlinkedAt:_0x298b05,attributes:_0x3a70fc})=>{_0x261fda['getCommentThread'](_0x137c93)&&_0x261fda['updateCommentThread']({'threadId':_0x137c93,'channelId':_0x4c1caf,'context':_0x3e1abd,'unlinkedAt':_0x298b05,'attributes':_0x3a70fc,'isFromAdapter':!0x0});}),this['listenTo'](_0x1a043a,'commentThreadResolved',(_0x1b30aa,{commentThreadId:_0x1bd3fd,resolvedBy:_0x26fda1,resolvedAt:_0x53838d})=>{const _0xe2f2cd=_0x261fda['getCommentThread'](_0x1bd3fd);_0xe2f2cd&&_0xe2f2cd['resolve']({'resolvedBy':_0x26fda1,'resolvedAt':_0x53838d,'isFromAdapter':!0x0});}),this['listenTo'](_0x1a043a,'commentThreadReopened',(_0x3ec68b,{commentThreadId:_0x11008c})=>{const _0x362050=_0x261fda['getCommentThread'](_0x11008c);_0x362050&&_0x362050['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1a043a,'commentThreadRemoved',(_0x3eada3,{commentThreadId:_0x1de03f})=>{const _0x59a62a=_0x261fda['getCommentThread'](_0x1de03f);_0x59a62a&&_0x59a62a['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1a043a,'commentAdded',(_0x5dc631,_0x381e26)=>{const _0x7f5ea6=_0x381e26['commentThreadId'],_0x56d568=_0x261fda['getCommentThread'](_0x7f5ea6);_0x56d568&&_0x56d568['addComment']({...p(_0x381e26),'isFromAdapter':!0x0});}),this['listenTo'](_0x1a043a,'commentUpdated',(_0xa31e72,{commentThreadId:_0x527721,commentId:_0x453df2,content:_0x40966d,attributes:_0x4cec31})=>{const _0x7e4da=_0x261fda['getCommentThread'](_0x527721);if(_0x7e4da){const _0x1aeec8=_0x7e4da['getComment'](_0x453df2);_0x1aeec8&&_0x1aeec8['update']({'content':_0x40966d,'attributes':_0x4cec31,'isFromAdapter':!0x0});}}),this['listenTo'](_0x1a043a,'commentRemoved',(_0x40d4a0,{commentThreadId:_0x5dc6c6,commentId:_0x4bcfd8})=>{const _0x5f0932=_0x261fda['getCommentThread'](_0x5dc6c6);if(_0x5f0932){const _0x43089b=_0x5f0932['getComment'](_0x4bcfd8);_0x43089b&&_0x43089b['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x3d7758);}['destroy'](){if(this['context']instanceof _0xbec918){const _0x256cc0=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x256cc0);}}['_terminateService'](_0x7c9fe1){if(!this['_services']['has'](_0x7c9fe1))throw new _0x51025b('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x7c9fe1});this['_getService'](_0x7c9fe1)['disconnect'](),this['_services']['delete'](_0x7c9fe1);}async['reconnect'](){for(const _0x54f987 of this['_services']['keys']())await this['_connectService'](_0x54f987);if(this['context']instanceof _0xbec918){const _0x2f686f=this['context']['config']['get']('collaboration.channelId'),_0x32626e=this['context']['plugins']['get'](i);_0x32626e['unregister'](_0x2f686f);const _0x528b30=await this['_services']['get'](_0x2f686f)['getConnectedSessions']();_0x32626e['register'](_0x2f686f,_0x528b30);}}async['_connectService'](_0x23e431){const {connection:_0x594308}=this['context']['plugins']['get'](n),_0x5038b0=this['context']['plugins']['get']('CommentsRepository'),_0x3db67c=this['_services']['get'](_0x23e431),_0x115aa0=await _0x3db67c['connect'](_0x594308);await this['_fetchMissingUsersForThreads'](_0x115aa0);const _0x53a4a9=new Set(Array['from'](_0x5038b0['getCommentThreads']({'channelId':_0x23e431}),_0x1073db=>_0x1073db['id']));for(const _0xc5f589 of _0x115aa0)_0xc5f589['deletedAt']||_0x53a4a9['delete'](_0xc5f589['commentThreadId']);for(const _0xef06e1 of _0x53a4a9)_0x5038b0['getCommentThread'](_0xef06e1)['remove']({'isFromAdapter':!0x0});for(const _0x484f03 of _0x115aa0){let _0x1dfa51=_0x5038b0['getCommentThread'](_0x484f03['commentThreadId']);const {commentThreadId:_0x5d3312,context:_0x53a297,attributes:_0x24e062,resolvedBy:_0x7e2a35,resolvedAt:_0x5aeb58,unlinkedAt:_0x43d5e0,deletedAt:_0x15af31}=_0x484f03;if(_0x15af31)continue;_0x1dfa51||(_0x1dfa51=_0x5038b0['addCommentThread']({'channelId':_0x23e431,'threadId':_0x5d3312,'context':_0x53a297,'attributes':_0x24e062||{},'resolvedBy':_0x7e2a35,'resolvedAt':_0x5aeb58,'unlinkedAt':_0x43d5e0,'isFromAdapter':!0x0}));const _0x1be3b6=new Set(Array['from'](_0x1dfa51['comments'],_0x1968a6=>_0x1968a6['id']));for(const _0x10e507 of _0x484f03['comments'])_0x1be3b6['delete'](_0x10e507['commentId']);for(const _0x709a76 of _0x1be3b6)_0x1dfa51['getComment'](_0x709a76)['remove']({'isFromAdapter':!0x0});for(const _0x7b50cd of _0x484f03['comments']){const _0x28700e=_0x1dfa51['getComment'](_0x7b50cd['commentId']);_0x28700e?_0x28700e['content']!==_0x7b50cd['content']&&_0x28700e['update']({'content':_0x7b50cd['content'],'isFromAdapter':!0x0}):_0x1dfa51['addComment'](Object['assign'](p(_0x7b50cd),{'isFromAdapter':!0x0}));}}}['_getService'](_0x38a01b){if(!this['_services']['has'](_0x38a01b))throw new _0x51025b('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x38a01b});return this['_services']['get'](_0x38a01b);}async['_fetchMissingUsersForThreads'](_0x428409){const _0x43ae29=this['context']['plugins']['get'](_0x170830),{connection:_0x1591f9}=this['context']['plugins']['get'](n),_0x706be1=new Set();for(const {resolvedBy:_0x4b519f,comments:_0x1dc293}of _0x428409){_0x4b519f&&!_0x43ae29['getUser'](_0x4b519f)&&_0x706be1['add'](_0x4b519f);for(const {userId:_0xe5b8d7}of _0x1dc293)_0x43ae29['getUser'](_0xe5b8d7)||_0x706be1['add'](_0xe5b8d7);}if(0x0===_0x706be1['size'])return;const _0x1eda3e=await ut['getMany'](_0x1591f9,Array['from'](_0x706be1));for(const _0x59e991 of _0x1eda3e)_0x43ae29['getUser'](_0x59e991['id'])||_0x43ae29['addUser'](_0x59e991);}}async function v(_0x4dee09){if('404'!==_0x4dee09['code'])throw _0x4dee09;}function ft(_0x36f676){if((_0x5cf6fa=_0x36f676)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5cf6fa['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5cf6fa['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5cf6fa;throw _0x36f676;}function p(_0x44a2ce){return{'threadId':_0x44a2ce['commentThreadId'],'commentId':_0x44a2ce['commentId'],'content':_0x44a2ce['content'],'createdAt':_0x44a2ce['createdAt'],'authorId':_0x44a2ce['userId'],'attributes':_0x44a2ce['attributes']||{}};}class m extends _0x36b438{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x44c054)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x170830];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x7f63be){super(_0x7f63be);const _0x527512=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x527512);}async['init'](){const _0x219f5f=this['editor']['plugins']['get'](l),_0x5381fa=_0x219f5f['serverHistory'],_0x325182=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x5381fa,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x219f5f['sessionId']});const _0x5b0e04=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x13918e=await _0x1d7963['isBundleUploaded'](_0x325182['connection'],_0x5b0e04);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x40901f})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x40901f)),'updateRevisions':async _0xb0bf3e=>{await this['_waitForServiceReady']();const _0x511a00=this['_revisionTracker']['currentRevision'];if(_0x13918e&&0x1===_0xb0bf3e['length']&&_0xb0bf3e[0x0]['id']===_0x511a00['id'])return _0xb0bf3e;for(const _0x6b4046 of _0xb0bf3e)_0x6b4046['id']===_0x511a00['id']&&(_0x6b4046['isEmptyCurrent']=_0x6b4046['fromVersion']===_0x6b4046['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0xb0bf3e,this['_lastRequestId'])['then'](_0x526d93=>(this['_lastRequestId']=_0x526d93,_0xb0bf3e))['catch'](_0x1b632a=>{if(b(_0x1b632a)||'400'===_0x1b632a['code']&&void 0x0!==_0x1b632a['data']['wrongRequestId']){for(const _0x5937e2 of _0xb0bf3e){!this['_revisionTracker']['repository']['getRevision'](_0x5937e2['id'])||this['_revisionTracker']['_bufferUpdate'](_0x5937e2['id'],_0x5937e2,!0x1);}if(b(_0x1b632a))throw _0x1b632a;return _0xb0bf3e;}throw _0x1b632a;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x51e567,{revisionsData:_0x2f48c0,requestId:_0x35f497})=>{Math['max'](..._0x2f48c0['map'](_0x3f2ef8=>_0x3f2ef8['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x2f48c0,_0x35f497);}):this['_handleRevisionsUpdate'](_0x2f48c0,_0x35f497);});const {revisions:_0x32f379,requestId:_0x6814e}=await this['_revisionHistoryService']['connect'](_0x325182['connection']);_0x325182['addToReconnectionStack'](this),this['_lastRequestId']=_0x6814e,await this['_fetchMissingUsers'](_0x32f379);for(const _0xaa5ff4 of _0x32f379)this['_revisionTracker']['addRevisionData'](_0xaa5ff4);this['listenTo'](_0x219f5f,'change:_isConnected',(_0x9fc804,_0x22af2a,_0x4c7075)=>{_0x4c7075&&(this['_oldOffset']=_0x219f5f['_offset'],_0x9fc804['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x325182,'state',_0x2e7f35=>_0x2e7f35===_0x71fa89['CONNECTED']);}async['reconnect'](){const _0x215b79=this['editor']['plugins']['get'](n),_0x52bd49=this['editor']['plugins']['get'](l),_0x1612a1=async()=>{const _0x39edc6=this['_revisionTracker']['currentRevision'],_0x280cab=_0x39edc6['id'],_0x22c0e7=_0x280cab!==_0x52bd49['sessionId'];if(_0x22c0e7){const _0x16a845=_0x52bd49['_offset']-this['_oldOffset'],_0x3cc95e=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x39edc6['toVersion']+_0x16a845!==_0x3cc95e){const _0x19ea9a=_0x39edc6['fromVersion']+_0x16a845,_0x39c08d=this['editor']['plugins']['get'](_0x170830),_0x1085f3=this['_revisionTracker']['buildRevisionData']({'revision':_0x39edc6,'from':_0x19ea9a,'to':_0x3cc95e});_0x1085f3['id']=_0x39edc6['id'];const _0x3c00f7=_0x1085f3['authorsIds']['map'](_0x1a0cc2=>_0x39c08d['getUser'](_0x1a0cc2));_0x39edc6['_update']({..._0x1085f3,'authors':_0x3c00f7},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x39edc6['id'],_0x1085f3,!0x0);}this['_revisionTracker']['_startingVersion']=_0x3cc95e,(_0x39edc6['toVersion']===_0x39edc6['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x280cab)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x280cab),this['_revisionTracker']['_createCurrentRevision'](_0x3cc95e));}const {revisions:_0x50a806,requestId:_0x2d93fa}=await this['_revisionHistoryService']['reconnect'](_0x215b79['connection'],this['_lastRequestId']);_0x22c0e7&&_0x50a806['length']>0x0?_0x52bd49['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x50a806),this['_handleRevisionsUpdate'](_0x50a806,_0x2d93fa),this['_revisionTracker']['sendBufferedUpdates']());};return _0x52bd49['_isConnected']?_0x1612a1():new Promise((_0x38ba9f,_0x4f681c)=>{_0x52bd49['once']('change:_isConnected',()=>{_0x1612a1()['then'](_0x38ba9f)['catch'](_0x4f681c);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x2b4418=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x74626d=>{_0x74626d['off'](),_0x2b4418();});});}['_getLatestVersionFromServerOperations'](){const _0x269a48=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1a403c of _0x269a48)if('marker'!==_0x1a403c['type']||_0x1a403c['affectsData'])return _0x1a403c['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1d9a2b=this['editor']['plugins']['get'](l);return new Promise(_0x54f88d=>{_0x1d9a2b['_isPendingUpdate']?_0x1d9a2b['once']('change:_isPendingUpdate',()=>{_0x54f88d(this['_getLatestVersionFromServerOperations']());}):_0x54f88d(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3a7842,_0x5131b0){const _0x224004=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5131b0;for(const _0x3a448d of _0x3a7842){const _0x217ffe=_0x224004['getRevision'](_0x3a448d['id']);if(_0x217ffe){if((_0x3a448d['fromVersion']||_0x3a448d['toVersion'])&&(_0x3a448d['diffData']=null),_0x217ffe===this['_revisionTracker']['currentRevision']){const _0x2586ce=Math['max'](_0x217ffe['toVersion'],_0x3a448d['toVersion']),_0x29679a=Math['max'](_0x217ffe['fromVersion'],_0x3a448d['fromVersion']);let _0x552a57;_0x217ffe['toVersion']===_0x3a448d['toVersion']&&_0x217ffe['fromVersion']===_0x3a448d['fromVersion']?(_0x552a57=!0x0,this['_preventResendingRevisionData'](_0x3a448d)):_0x3a448d['toVersion']===_0x2586ce&&_0x3a448d['fromVersion']===_0x29679a?_0x552a57=!0x1:(_0x217ffe['toVersion']===_0x2586ce&&_0x217ffe['fromVersion']===_0x29679a||this['_fixRevision']({'revision':_0x217ffe,'from':_0x29679a,'to':_0x2586ce}),_0x552a57=!0x0),_0x552a57&&(delete _0x3a448d['fromVersion'],delete _0x3a448d['toVersion'],delete _0x3a448d['diffData'],delete _0x3a448d['createdAt'],delete _0x3a448d['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3a448d),this['_preventResendingRevisionData'](_0x3a448d);}else this['_revisionTracker']['addRevisionData'](_0x3a448d);}const _0x14eec9=_0x224004['getRevisions']();_0x14eec9['reverse']();for(let _0x36f858=0x0;_0x36f858<_0x14eec9['length']-0x1;_0x36f858++){const _0x4a219d=_0x14eec9[_0x36f858],_0x459fa6=_0x14eec9[_0x36f858+0x1];if(_0x4a219d['fromVersion']<_0x459fa6['toVersion']){const _0x1ca010=_0x459fa6['toVersion'],_0x1a9898=Math['max'](_0x1ca010,_0x4a219d['toVersion']);this['_fixRevision']({'revision':_0x4a219d,'from':_0x1ca010,'to':_0x1a9898});}}}['_fixRevision']({revision:_0x3dd7fa,from:_0x3878f8,to:_0x20d696}={}){const _0x5a0957=this['editor']['plugins']['get'](_0x170830),_0x1e48c6=this['_revisionTracker']['buildRevisionData']({'revision':_0x3dd7fa,'from':_0x3878f8,'to':_0x20d696});_0x1e48c6['authors']=_0x1e48c6['authorsIds']['map'](_0xcd76f2=>_0x5a0957['getUser'](_0xcd76f2)),_0x3dd7fa['_update'](_0x1e48c6);}['_preventResendingRevisionData'](_0x2a9e10){const _0x34bcae={};_0x34bcae['id']=_0x2a9e10['id'];for(const _0x155ad1 of Object['keys'](_0x2a9e10))'id'!==_0x155ad1&&(_0x34bcae[_0x155ad1]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x34bcae['id'],_0x34bcae,!0x0);}async['_fetchMissingUsers'](_0x21e2e7){const _0x262e37=this['editor']['plugins']['get'](_0x170830),{connection:_0x1e9a83}=this['editor']['plugins']['get'](n),_0x3eadfa=new Set();for(const _0x56c7aa of _0x21e2e7){for(const _0x29ee0a of _0x56c7aa['authorsIds'])_0xc5c774(_0x29ee0a);_0x56c7aa['creatorId']&&_0xc5c774(_0x56c7aa['creatorId']);}if(0x0===_0x3eadfa['size'])return;const _0x56a753=await ut['getMany'](_0x1e9a83,Array['from'](_0x3eadfa));for(const _0x37d169 of _0x56a753)_0x262e37['getUser'](_0x37d169['id'])||_0x262e37['addUser'](_0x37d169);function _0xc5c774(_0x43b93b){_0x262e37['getUser'](_0x43b93b)||_0x3eadfa['add'](_0x43b93b);}}}function b(_0x15a572){return _0x15a572['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x15a572['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x15a572['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x36b438{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class st extends _0x586628{['_collapseAt'];constructor(_0x336549,_0x1020c3=0x6){super(_0x336549);const _0x5093ec=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x1020c3,this['bind']('isHidden')['to'](this,'usersCount',_0x530ab2=>_0x530ab2<_0x1020c3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x5093ec['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':_0x5093ec['to']('usersCount',_0x1d1950=>'+'+(_0x1d1950-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x586628{['items'];['keystrokes'];constructor(_0x3a8f4e){super(_0x3a8f4e);const _0x2251f7=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x523b68(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x2251f7['if']('hasPopup'),'aria-expanded':_0x2251f7['to']('isExpanded',_0x9c6509=>this['hasPopup']&&String(_0x9c6509)),'aria-label':_0x2251f7['to']('hasPopup',_0x36efda=>x(_0x3a8f4e,_0x36efda?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x2251f7['to']('hasPopup',_0x49319d=>!!_0x49319d&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x2251f7['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x2251f7['to'](_0x130591=>{const _0x1e8145=_0x130591,_0x250d7e=document['querySelector']('.ck-presence-list__dropdown-list'),_0x45b728=document['querySelector']('.ck-balloon-panel_with-arrow');_0x250d7e?.['contains'](_0x1e8145['relatedTarget'])||_0x45b728?.['contains'](_0x1e8145['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x266a5f,_0x5a101e,_0x1dece2)=>{this['element']&&(_0x1dece2?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 tt extends _0x586628{['counterView'];['inlineListView'];constructor(_0x2cec11,_0x1b589d=0x6){super(_0x2cec11);const _0x369612=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new st(this['locale'],_0x1b589d),this['inlineListView']=new is(_0x2cec11),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x27c01b of this['inlineListView']['items'])_0x27c01b['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',_0x369612['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class it extends _0x586628{['listWrapperView'];constructor(_0x43c95d,_0x21a2f1){super(_0x43c95d);const _0x1671f0=this['bindTemplate'];this['listWrapperView']=new wt(_0x43c95d,_0x21a2f1),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':x(_0x43c95d,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x1671f0['to'](_0x3ee4be=>{const _0x4a2b21=_0x3ee4be,_0x3a7565=document['querySelector']('.ck-presence-list__list'),_0x58bcd2=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3a7565?.['contains'](_0x4a2b21['relatedTarget'])||_0x58bcd2?.['contains'](_0x4a2b21['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x1477e2{constructor(_0x4e6abc,_0x35aa29){super(_0x4e6abc);const _0x375656=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x35aa29?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x375656['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x375656['to']('role'),'aria-label':_0x375656['to']('ariaLabel'),'aria-labelledby':_0x375656['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x462adf['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1a7470=this['element'];_0x1a7470&&(this['_isScrollable']=Math['max'](_0x1a7470['scrollHeight'],_0x1a7470['clientHeight'])>0.8*window['innerHeight']);}}class et extends ct{['userView'];constructor(_0xf5fef8,_0x287c86,_0x5c9d93){super(_0xf5fef8);const _0x110994=this['bindTemplate'];this['userView']=new ot(_0xf5fef8,_0x287c86);const _0x539be6={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x287c86['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x287c86['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x287c86['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5c9d93&&(_0x539be6['tag']='button',_0x539be6['on']={'click':_0x110994['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x539be6);}['focus'](){this['element']['focus']();}}class rt extends _0x586628{['userView'];['markerView'];constructor(_0xe808e1,_0x2d275a,_0x4e982f){super(_0xe808e1);const _0x15a8be=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ot(_0xe808e1,_0x2d275a),this['markerView']=new lt(_0xe808e1,_0x2d275a);const _0x59d4fa=new at(_0xe808e1);_0x59d4fa['template']['tag']='span',_0x59d4fa['text']=_0x2d275a['name'];const _0x3fdcd4={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x15a8be['to']('isFocusable',_0x94d596=>!!_0x94d596&&0x0),'aria-labelledby':_0x59d4fa['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x15a8be['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x15a8be['to']('hasTooltip',_0x1a55b6=>!_0x1a55b6),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x59d4fa]};_0x4e982f&&(_0x3fdcd4['tag']='button',_0x3fdcd4['on']={'click':_0x15a8be['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3fdcd4);}}class lt extends _0x586628{constructor(_0x4bcbec,_0x4747da){super(_0x4bcbec),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4747da['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const ht={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x43cd90{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2f8fec){super(_0x2f8fec),this['context']['config']['define']('presenceList',ht);const _0x4ec9d4=_0x2f8fec['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4ec9d4)throw new _0x51025b('presencelist-collapseat-invalid-format',this);if(_0x4ec9d4<0x1)throw new _0x51025b('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x25abf6(),this['balloonPanelView']=new _0x1686b7(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x3b95fd of this['_allConnectedUsers'])this['_handleUserAdd'](_0x3b95fd);this['listenTo'](this['_allConnectedUsers'],'add',(_0x214073,_0x370b67)=>{this['_handleUserAdd'](_0x370b67);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x100e04,_0x217bf4)=>{this['_handleUserRemove'](_0x217bf4);});}['_createView'](){const _0x20e616=this['context'],_0x260d26=new tt(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x2a66fc=this['balloonPanelView'];if(!_0x2b1f16(_0x20e616['config']['get']('presenceList.container')))throw new _0x51025b('presencelist-missing-container',this);return _0x260d26['counterView']['bind']('usersCount')['to'](this),_0x260d26['bind']('isCollapsed')['to'](this,'usersCount',_0x2211b8=>{const {collapseAt:_0x11aaa7}=_0x20e616['config']['get']('presenceList'),_0x54182f=_0x2211b8>=_0x11aaa7;if(_0x54182f&&!_0x260d26['inlineListView']['items']['find'](_0x5d1e03=>_0x5d1e03 instanceof st)){const _0x266473=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x266473&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x260d26['inlineListView']['items']['add'](_0x260d26['counterView']);}return _0x54182f||this['hideDropdown'](),_0x54182f;}),_0x260d26['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x50423d=>{const _0x3932ab=_0x20e616['config']['get']('presenceList'),_0x12277c=new rt(_0x20e616['locale'],_0x50423d,!!_0x3932ab['onClick']);return _0x12277c['bind']('hasTooltip')['to'](_0x260d26,'isCollapsed',_0x44df4c=>!_0x44df4c),_0x12277c['bind']('isFocusable')['to'](_0x260d26,'isCollapsed',_0x54b860=>!_0x54b860),_0x3932ab['onClick']&&this['listenTo'](_0x12277c,'execute',()=>{this['view']['isCollapsed']||_0x3932ab['onClick'](_0x50423d,_0x12277c['element']);}),_0x12277c;}),this['listenTo'](_0x260d26['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x260d26['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x260d26['inlineListView']['keystrokes']['set']('Enter',(_0x5157d7,_0x1b0873)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x1b0873());}),_0x260d26['render'](),_0x2a66fc['render'](),_0x2171b3({'emitter':_0x260d26,'activator':()=>_0x2a66fc['isVisible'],'contextElements':[_0x2a66fc['element'],_0x260d26['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x20e616['config']['get']('presenceList.container')['appendChild'](_0x260d26['element']),this['_bodyCollection']=new _0x37e4eb(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x260d26;}['_handleUserAdd'](_0x23e406){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x23e406['isMe'])return;const _0x3d1425=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x3d1425-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x2f19d2=_0x23e406['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x23e406,_0x2f19d2);}['_handleUserRemove'](_0x4debd7){this['usersCount']--;const {collapseAt:_0x2ca753}=this['context']['config']['get']('presenceList'),_0x1d3949=this['usersCount']>=_0x2ca753;if(this['currentDisplayedUsers']['get'](_0x4debd7['id']))this['currentDisplayedUsers']['remove'](_0x4debd7['id']);else{if(_0x1d3949&&this['currentDisplayedUsers']['length']+0x1===_0x2ca753-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1d3949?0x1:0x0)<this['usersCount']){for(const _0x58cf9b of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x58cf9b['id'])&&(this['currentDisplayedUsers']['add'](_0x58cf9b,Math['min'](this['currentDisplayedUsers']['length']-(_0x1d3949?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1d3949?0x1:0x0)===_0x2ca753-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x47ebff=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new it(this['context']['locale'],!!_0x47ebff['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1efb3c}=this['presenceDropdownView'];_0x1efb3c['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3a691c=>{if(!_0x47ebff['displayMe']&&_0x3a691c['isMe'])return null;const _0x25c4ef=new et(this['context']['locale'],_0x3a691c,!!_0x47ebff['onClick']);return _0x47ebff['onClick']&&this['listenTo'](_0x25c4ef,'execute',()=>{_0x47ebff['onClick'](_0x3a691c,_0x25c4ef['element']);}),_0x25c4ef;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1efb3c['focus'](),_0x1efb3c['checkIfScrollable']();const _0x377c29=(_0x27f60f,_0x3d9e83)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3d9e83();};_0x1efb3c['keystrokes']['set']('Esc',_0x377c29),_0x1efb3c['keystrokes']['set']('Shift+Tab',_0x377c29),_0x1efb3c['keystrokes']['set']('Tab',(_0x353186,_0x489f59)=>{!function(_0x46162f){const _0x1cd3e0=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x2a33ce=>_0x2a33ce+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2fd432=[...document['body']['querySelectorAll'](_0x1cd3e0)]['filter'](_0x422287=>_0x422287===document['activeElement']||_0x422287['offsetWidth']+_0x422287['offsetHeight']>0x0)['sort']((_0x591af5,_0x3e33b5)=>(_0x591af5['tabIndex']||0x0)-(_0x3e33b5['tabIndex']||0x0)),_0x7f861=_0x2fd432['indexOf'](_0x46162f),_0x367287=_0x2fd432[(_0x7f861+0x1)%_0x2fd432['length']];_0x367287&&_0x367287['focus']();}(this['view']['element']),this['hideDropdown'](),_0x489f59();}),_0x1efb3c['focusTracker']['add'](this['view']['element']),_0x1efb3c['focusTracker']['on']('change:isFocused',(_0x39a862,_0x6ea085,_0x4b3421)=>{_0x4b3421||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 vt extends _0x43cd90{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,vt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,pt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
|
23
|
+
import{ContextPlugin as _0x488dd2,Plugin as _0x67d212,PendingActions as _0x583c13,Context as _0x3bbf95}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x49b119,CKEditorError as _0x4c05ca,Collection as _0x588bd5,global as _0x390163,version as ht,uid as _0x11d993,KeystrokeHandler as _0x444ac9}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x5c55d3,View as _0x5afde5,ListView as _0x5ee5b8,ListItemView as ct,LabelView as lt,BalloonPanelView as _0xf94e11,clickOutsideHandler as _0x5b5b1d,BodyCollection as _0xe88368}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x639926,History as _0x46127e,NoOperation as _0x13ff47,InsertOperation as _0x5057d5,MarkerOperation as _0x47603b,RootAttributeOperation as _0x30b27a,transformOperationSets as _0x2a20bd,OperationFactory as _0x18b04b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as dt,WEB_SOCKET_GATEWAY_STATES as _0x42de26,CollaborativeEditingService as _0x73a0ef,User as ut,CommentsService as _0x3e1695,TrackChangesService as rt,RevisionHistoryService as st,EditorService as it}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x29a775,UserView as at}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x25d81b}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x196996}from'es-toolkit/compat';class n extends _0x488dd2{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x5c55d3];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x440566){super(_0x440566),this['set']('state',_0x42de26['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x49b119())();}['init'](){const _0x12dffc=this['context'],_0x4fc24a=_0x12dffc['plugins']['get']('CloudServices'),_0x5aba12=_0x12dffc['plugins']['get'](_0x5c55d3);if(!_0x4fc24a['token'])throw new _0x4c05ca('websocketgateway-missing-token',this);if(!_0x4fc24a['webSocketUrl'])throw new _0x4c05ca('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'](_0x4fc24a['token'],_0x4fc24a['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x31d1e8=>{if(this['connection']=_0x31d1e8,this['bind']('state')['to'](_0x31d1e8,'state',this,'_isBrowserOffline',(_0x5673f9,_0x1420c2)=>('connected'!==_0x5673f9&&(this['_shouldPluginsReconnect']=!0x0),_0x1420c2||_0x5673f9!==_0x42de26['CONNECTED']?_0x42de26['DISCONNECTED']:this['state']==_0x42de26['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x42de26['CONNECTING']):_0x42de26['CONNECTED'])),this['connection']['on']('error',(_0xf3d12e,_0x2b3132)=>{if('limitExceeded'!==_0x2b3132['code'])throw console['error'](_0x2b3132),new _0x4c05ca('cloudservices-init',null,{'originalError':_0x2b3132});_0x5aba12['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'});}),!_0x31d1e8['me'])return new Promise(_0x5a6856=>_0x31d1e8['on']('change:me',_0x5a6856));})['catch'](_0x405019=>{throw console['error'](_0x405019),new _0x4c05ca('cloudservices-init',null,{'originalError':_0x405019});});}['addToReconnectionStack'](_0x5c57c9){if('function'!=typeof _0x5c57c9['reconnect'])throw new _0x4c05ca('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5c57c9))throw new _0x4c05ca('websocketgateway-plugin-already-registered',this,{'name':_0x5c57c9['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5c57c9);}['removeFromReconnectionStack'](_0x3aadcb){this['_reconnectionStack']['delete'](_0x3aadcb);}['isInReconnectionStack'](_0x12e7a0){return this['_reconnectionStack']['has'](_0x12e7a0);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x264604=>_0x264604['reconnect']())))['then'](()=>this['state']=_0x42de26['CONNECTED'])['catch'](_0x5c8e25=>{throw console['error'](_0x5c8e25),new _0x4c05ca('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x42de26['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x488dd2{['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,_0x29a775];}constructor(_0x11f888){super(_0x11f888),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x588bd5(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x29a775);}['init'](){const _0x5e85cd=this['context']['plugins']['get'](n);this['listenTo'](_0x5e85cd,'change:state',(_0x39f4f7,_0x2f079b,_0x2d1e68)=>{if('connected'!==_0x2d1e68)this['channelSessions']['forEach'](_0x3653f4=>_0x3653f4['clear']()),this['channelConnectedUsers']['forEach'](_0x7ab441=>_0x7ab441['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5f5b03,_0xd9e7b2]of this['_registeredSessions'])for(const _0x5ef4ec of _0xd9e7b2)this['_handleSessionAdd'](_0x5f5b03,_0x5ef4ec);}}),this['_createUser'](_0x5e85cd['connection']['me'],!0x0);}['register'](_0x582da5,_0x8ed006){if(this['_registeredSessions']['has'](_0x582da5))throw new _0x4c05ca('sessions-register-already-registered',null,{'channelId':_0x582da5});this['_registeredSessions']['set'](_0x582da5,_0x8ed006),this['channelSessions']['set'](_0x582da5,new _0x588bd5()),this['channelConnectedUsers']['set'](_0x582da5,new _0x588bd5()),this['listenTo'](_0x8ed006,'add',(_0x2e0046,_0x3c885e)=>this['_handleSessionAdd'](_0x582da5,_0x3c885e)),this['listenTo'](_0x8ed006,'remove',(_0x71cef4,_0x14e9b2)=>this['_handleSessionRemove'](_0x582da5,_0x14e9b2));for(const _0x14d35f of _0x8ed006)this['_handleSessionAdd'](_0x582da5,_0x14d35f);}['unregister'](_0x4667d5){if(!this['_registeredSessions']['has'](_0x4667d5))throw new _0x4c05ca('sessions-unregister-not-exist',null,{'channelId':_0x4667d5});const _0x2020a9=this['_registeredSessions']['get'](_0x4667d5);this['stopListening'](_0x2020a9);for(const _0x23b4e0 of _0x2020a9)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x4667d5,_0x23b4e0);this['_registeredSessions']['delete'](_0x4667d5),this['channelSessions']['delete'](_0x4667d5),this['channelConnectedUsers']['delete'](_0x4667d5);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x4d296c){for(const _0x4f6a10 of this['channelSessions']['values']())for(const _0x30696a of _0x4f6a10)if(_0x30696a['id']===_0x4d296c)return _0x30696a['user'];}['getUserSessions'](_0x3be3ab,_0x58323b){const _0x2639ca=_0x58323b?[this['channelSessions']['get'](_0x58323b)]:this['channelSessions']['values'](),_0x919c49=new Set();for(const _0xd6be73 of _0x2639ca)for(const _0x4674bd of _0xd6be73)_0x4674bd['user']['id']===_0x3be3ab['id']&&_0x919c49['add'](_0x4674bd['id']);return _0x919c49;}['getUserRole'](_0x1f09e5){for(const _0x409236 of this['channelSessions']['values']())for(const _0x4006d0 of _0x409236)if(_0x4006d0['user']===_0x1f09e5)return _0x4006d0['role'];}['_handleSessionAdd'](_0x27f8c9,_0x4e07eb){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x56971c=_0x4e07eb['user'],_0xcb0851=this['_users']['getUser'](_0x56971c['id'])||this['_createUser'](_0x56971c),_0xd5310f=Object['assign']({},_0x4e07eb,{'user':_0xcb0851});if(this['channelSessions']['get'](_0x27f8c9)['add'](_0xd5310f),!_0x56971c['hiddenInPresenceList']){const _0x3d594c=this['channelConnectedUsers']['get'](_0x27f8c9);_0x3d594c['has'](_0xcb0851['id'])||_0x3d594c['add'](_0xcb0851),this['allConnectedUsers']['has'](_0xcb0851['id'])||_0x56971c['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xcb0851,_0xcb0851['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x27f8c9,{'channelId':_0x27f8c9,'session':_0xd5310f});}['_handleSessionRemove'](_0x13a8b6,_0x57f750){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1f2e84=this['channelConnectedUsers']['get'](_0x13a8b6),_0x19bbb8=_0x57f750['user'];_0x19bbb8['id']&&(this['channelSessions']['get'](_0x13a8b6)['remove'](_0x57f750['id']),_0x1f2e84['has'](_0x19bbb8['id'])&&!this['getUserSessions'](_0x19bbb8,_0x13a8b6)['size']&&_0x1f2e84['remove'](_0x19bbb8['id']),this['allConnectedUsers']['get'](_0x19bbb8['id'])&&!this['getUserSessions'](_0x19bbb8)['size']&&this['allConnectedUsers']['remove'](_0x19bbb8['id']));}['_createUser'](_0x38b900,_0x515814){const _0x37d532=this['_users']['addUser'](_0x38b900);return _0x515814&&this['_users']['defineMe'](_0x38b900['id']),_0x37d532['orderNumber']=this['_uniqueUsersCount']++,_0x37d532;}}class k extends _0x67d212{['_domEmitter']=new(_0x49b119())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3a4fa8=this['editor'],_0x380b54=_0x3a4fa8['plugins']['get'](i);_0x3a4fa8['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0xb6cb87,{writer:_0x20ee32})=>function(_0x5ca7bf,_0x2af965,_0x433d97,_0x2059bf){const _0x1a4446=_0x5ca7bf['markerName']['split'](':')[0x2],_0x20c0fd=_0x433d97['getUserBySessionId'](_0x1a4446);if(!_0x20c0fd||_0x1a4446===_0x433d97['mySessionId'])return;if(!_0x2059bf['model']['schema']['checkChild'](_0x5ca7bf['markerRange']['start'],'$text'))return;const _0x16b4c1={'class':'ck-user__marker\x20'+_0x20c0fd['color']['getMarkerClass'](),'data-name':_0x20c0fd['name'],'data-session-id':_0x1a4446},_0x2f8207=_0x2059bf['model']['markers']['get'](_0x5ca7bf['markerName']),_0x17f40d=_0x2f8207['getStart'](),_0x3ce09e=_0x17f40d['nodeAfter'],_0x3503fd=_0x2059bf['model']['schema'];if(_0x3ce09e&&_0x3503fd['isObject'](_0x3ce09e)&&_0x3503fd['isInline'](_0x3ce09e)&&!_0x2059bf['model']['markers']['get']('user:range:'+_0x1a4446)['getRange']()['isCollapsed'])return;const _0x2e0004=_0x17f40d['parent'];return _0x2059bf['model']['schema']['isLimit'](_0x2e0004)&&!_0x2059bf['model']['hasContent'](_0x2e0004)&&(_0x16b4c1['contenteditable']=!0x1),function(_0x3e77df,_0x321e18,_0xc973a9){const _0x3c3945=_0x3e77df['createUIElement']('span',_0x321e18);return _0x3e77df['setCustomProperty']('userPositionMarker',!0x0,_0x3c3945),_0x3c3945['render']=function(_0x520cce){const _0x5f1f75=this['toDomElement'](_0x520cce),_0x5ccbb8=document['createElement']('span');return _0x5ccbb8['classList']['add']('ck-user__marker-tooltip'),_0x5ccbb8['setAttribute']('contenteditable','false'),_0x5ccbb8['setAttribute']('spellcheck','false'),_0x5ccbb8['textContent']=_0xc973a9['name'],_0x5f1f75['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x5ccbb8['outerHTML']+'',_0x5f1f75['addEventListener']('mouseenter',()=>{_0x5f1f75['classList']['add']('ck-user__marker_hovered');}),_0x5f1f75['addEventListener']('mouseleave',()=>{_0x5f1f75['classList']['remove']('ck-user__marker_hovered');}),_0x5f1f75;},_0x3c3945['isSimilar']=function(_0x9ad70e){return!(!this['getCustomProperty']('userPositionMarker')||!_0x9ad70e['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x9ad70e['getAttribute']('data-session-id'));},_0x3c3945;}(_0x2af965,_0x16b4c1,_0x20c0fd);}(_0xb6cb87,_0x20ee32,_0x380b54,_0x3a4fa8)}),_0x3a4fa8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x57dcab=>function(_0x2be37c,_0x53813e){const _0x38371f=_0x2be37c['markerName']['split'](':')[0x2];if(_0x38371f===_0x53813e['mySessionId'])return null;const _0x375f3d=_0x53813e['getUserBySessionId'](_0x38371f);if(!_0x375f3d)return{'id':_0x38371f,'classes':[]};return{'id':_0x38371f,'classes':['ck-user__selection',_0x375f3d['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x38371f},'priority':0x7d0+_0x375f3d['orderNumber']};}(_0x57dcab,_0x380b54)}),function(_0x347130){const _0x3532be=_0x347130['model'],_0x2d6d3d=new Map(),_0x425bb7=_0x347130['plugins']['get'](i);_0x3532be['markers']['on']('update:user:range',(_0x42fd6d,_0x18fb54,_0x2b31af,_0x37ca40)=>{if(!_0x37ca40&&_0x2d6d3d['get'](_0x18fb54['name']))return _0x2d6d3d['get'](_0x18fb54['name'])['detach'](),void _0x2d6d3d['delete'](_0x18fb54['name']);const _0x5a599c=_0x18fb54['name']['split'](':')[0x2];if(_0x5a599c===_0x425bb7['mySessionId'])return;const _0x2afbf7='user:position:'+_0x5a599c;_0x3532be['markers']['has'](_0x2afbf7)&&_0x347130['editing']['reconvertMarker'](_0x2afbf7),_0x18fb54['on']('change:range',(_0x274bb7,_0x25c7f6,_0x4b8f3d)=>{if('$graveyard'!=_0x25c7f6['root']['rootName']&&'$graveyard'==_0x18fb54['getRange']()['root']['rootName']&&!_0x2d6d3d['has'](_0x18fb54['name'])){const _0x8ecc14=_0x3532be['schema']['getNearestSelectionRange'](_0x4b8f3d['deletionPosition']);if(_0x8ecc14){const _0x11f1cd=_0x639926['fromRange'](_0x8ecc14);_0x2d6d3d['set'](_0x18fb54['name'],_0x11f1cd),_0x11f1cd['on']('change:range',(_0x2647ac,_0x3aae55,_0x189afc)=>{if('$graveyard'==_0x11f1cd['root']['rootName']){const _0x134b87=_0x3532be['schema']['getNearestSelectionRange'](_0x189afc['deletionPosition']);_0x134b87?(_0x11f1cd['start']=_0x134b87['start'],_0x11f1cd['end']=_0x134b87['end']):(_0x2d6d3d['delete'](_0x18fb54['name']),_0x11f1cd['detach']());}});}}});}),_0x3532be['document']['on']('change',()=>{_0x2d6d3d['size']>0x0&&_0x3532be['enqueueChange']({'isUndoable':!0x1},_0x3927c8=>{for(const [_0x3aa6cc,_0x5637db]of _0x2d6d3d)'$graveyard'==_0x3532be['markers']['get'](_0x3aa6cc)['getRange']()['root']['rootName']&&(q(_0x3aa6cc['split'](':')[0x2],_0x5637db['toRange'](),_0x3532be,_0x3927c8),_0x5637db['detach']());_0x2d6d3d['clear']();});});}(_0x3a4fa8),this['_domEmitter']['listenTo'](_0x390163['document'],'keydown',(_0x3dc79f,{key:_0x2de668})=>{'Escape'===_0x2de668&&function(_0x133f06){_0x133f06['editing']['view']['change'](_0x1b3946=>{for(const _0x1b110a of _0x133f06['model']['markers']){if(!_0x1b110a['name']['startsWith']('user:position'))continue;const _0x3ccbd9=_0x133f06['editing']['mapper']['markerNameToElements'](_0x1b110a['name']);if(_0x3ccbd9){for(const _0x381913 of _0x3ccbd9)_0x1b3946['removeClass']('ck-user__marker_hovered',_0x381913);}}});}(_0x3a4fa8);},{'useCapture':!0x0});}['afterInit'](){const _0x5e6b3a=this['editor'],_0x1cab71=_0x5e6b3a['commands']['get']('undo');_0x1cab71&&_0x5e6b3a['model']['on']('applyOperation',(_0x4fb2c5,_0x29d0c8)=>{const _0x7ef8db=_0x29d0c8[0x0];if(!_0x7ef8db['isDocumentOperation'])return;if('marker'!=_0x7ef8db['type']||!_0x7ef8db['name']['startsWith']('user:'))return;const _0x16487b=_0x7ef8db['batch'];_0x1cab71['_createdBatches']['has'](_0x16487b)&&(_0x7ef8db['newRange']=_0x7ef8db['oldRange']?_0x5e6b3a['model']['createRange'](_0x7ef8db['oldRange']['start'],_0x7ef8db['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x29e0dd=this['editor'],_0x588018=_0x29e0dd['model']['document'],_0x19946c=_0x29e0dd['plugins']['get'](i);_0x29e0dd['model']['enqueueChange']({'isUndoable':!0x1},_0x5821d0=>{const _0x30ca85='user:range:'+_0x19946c['mySessionId'],_0x447a07='user:position:'+_0x19946c['mySessionId'],_0x29c27d=_0x29e0dd['model']['markers']['has'](_0x30ca85);_0x29e0dd['editing']['view']['hasDomSelection']?q(_0x19946c['mySessionId'],_0x588018['selection']['getFirstRange'](),_0x29e0dd['model'],_0x5821d0):_0x29c27d&&(_0x5821d0['removeMarker'](_0x30ca85),_0x5821d0['removeMarker'](_0x447a07));});}}function q(_0xf98c2d,_0x2cc4c4,_0x19d2f0,_0x5d6358){const _0x349225='user:range:'+_0xf98c2d,_0x49b274='user:position:'+_0xf98c2d,_0x471363=_0x2cc4c4['getContainedElement']();let _0x2b1daa=_0x2cc4c4['start'];if(_0x471363&&_0x471363['is']('element','tableCell')){const _0x2c464c=function(_0x138887,_0x16965b){for(const _0x1752af of _0x138887['getPositions']())if(_0x16965b['schema']['checkChild'](_0x1752af,'$text'))return _0x1752af;}(_0x2cc4c4,_0x19d2f0);_0x2c464c&&(_0x2b1daa=_0x2c464c,_0x2cc4c4=_0x5d6358['createRange'](_0x2b1daa));}const _0x428dd2=_0x5d6358['createRange'](_0x2b1daa);_0x19d2f0['markers']['has'](_0x349225)?(_0x5d6358['updateMarker'](_0x349225,{'range':_0x2cc4c4}),_0x5d6358['updateMarker'](_0x49b274,{'range':_0x428dd2})):(_0x5d6358['addMarker'](_0x349225,{'range':_0x2cc4c4,'usingOperation':!0x0}),_0x5d6358['addMarker'](_0x49b274,{'range':_0x428dd2,'usingOperation':!0x0}));}function A(_0x216ad4,_0x2e450b,_0x2e58bc){const _0x9d4bb3=_0x216ad4['t'],t=_0x216ad4['t'];switch(_0x2e450b){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 _0x9d4bb3({'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'},_0x2e58bc);default:return'';}}let D=0x1;class l extends _0x67d212{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x73a0ef)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,k,_0x583c13,_0x29a775,_0x5c55d3];}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 _0x227a4d=this['serverHistory']['getOperations']();for(let _0x1257ae=_0x227a4d['length']-0x1;_0x1257ae>=0x0;_0x1257ae--){const _0xb185b1=_0x227a4d[_0x1257ae];if(!this['_disconnectionOperations']['has'](_0xb185b1))return _0xb185b1['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0xac569c){if(super(_0xac569c),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x46127e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x4c05ca('collaboration-missing-channelid',this);const _0x37d9c9=_0xac569c['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x37d9c9,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x25d81b(),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 C(this['_disconnectionOperations']);}['init'](){const _0x4461ca=this['editor'],_0x45b527=_0x4461ca['plugins']['get'](_0x29a775),_0x35ccd2=_0x4461ca['plugins']['get'](n);this['listenTo'](_0x45b527,'getOperationAuthor',(_0x55e0b7,_0x47106a)=>{const _0x5cce1d=_0x47106a[0x0];_0x5cce1d['_authorId']&&(_0x55e0b7['return']=_0x45b527['getUser'](_0x5cce1d['_authorId']),_0x55e0b7['stop']()),null===_0x5cce1d['_authorId']&&(_0x55e0b7['return']=null,_0x55e0b7['stop']());},{'priority':'high'}),this['listenTo'](_0x4461ca['model']['document']['selection'],'change:range',(_0x5b59d7,_0x3f49d6)=>{_0x3f49d6['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4461ca['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4461ca['model']['on']('applyOperation',(_0x4e72f6,_0x567c60)=>{const _0x17cf5e=_0x567c60[0x0];_0x17cf5e['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x17cf5e),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x35ccd2,'state',this,'_hasSynchronizationProblem',(_0x336c97,_0x3416b8)=>'connected'===_0x336c97&&!_0x3416b8),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4461ca['disableReadOnlyMode']('rtc-offline'):_0x4461ca['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4461ca['disableReadOnlyMode']('rtc-offline'):_0x4461ca['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x20e9c5=this['editor']['plugins']['get'](i),_0x1a5d90=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x20e9c5['unregister'](this['_channelId']);const _0x58383b=await this['_service']['reconnect'](_0x1a5d90['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x58383b)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x6d125f=await this['_service']['getConnectedSessions']();_0x20e9c5['register'](this['_channelId'],_0x6d125f),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x410512){if(function(_0x53e1d8){return'404'===_0x53e1d8['code'];}(_0x410512)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x523ee0){return'409'===_0x523ee0['code'];}(_0x410512)){const _0x4a1cac=A(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'](_0x4a1cac);}else{if(!(_0x410512 instanceof P))throw _0x410512;this['_handleReconnectionError']();}}}}['destroy'](){const _0x5300e3=this['editor']['plugins']['get'](n),_0x400e62=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x400e62['channelSessions']['has'](this['_channelId'])&&_0x400e62['unregister'](this['_channelId']),_0x5300e3['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x143259){if(this['sessionId']!==_0x143259['sessionId']&&this['_lastSyncedOperationId']!==_0x143259['lastOperationId'])throw new P();return this['sessionId']=_0x143259['sessionId'],this['_handleServerResponse']([],{..._0x143259,'wereChangesApplied':!0x1,'data':_0x143259['data']},'reconnect');}async['_connectService'](_0x220262,_0x51de68=!0x1){const {connection:_0x5b8436}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x5b8436,this['_channelId'])['then'](_0x3539ef=>this['_initSessionsHandling'](_0x3539ef))['catch'](_0x4999c4=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4999c4);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x157a3a,_0xc7095f)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xc7095f);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3fb288=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x220262);this['_isPendingUpdate']=!0x0;const _0x312fdc=await this['_service']['connect'](_0x5b8436,this['_compressOperations'](_0x220262),_0x3fb288);if(this['sessionId']=_0x312fdc['sessionId'],_0x51de68){if(!_0x312fdc['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x312fdc['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x220262,_0x312fdc,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x312fdc,_0x220262);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x2329ae=this['editor']['plugins']['get'](i),_0x331800=this['editor']['plugins']['get'](k),_0x344338=_0x2329ae['channelSessions']['get'](this['_channelId']);_0x344338&&_0x344338['length']>0x1?_0x331800['createUserMarkerOperations']():this['listenTo'](_0x2329ae,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x2329ae['channelSessions']['get'](this['_channelId'])['length']&&_0x331800['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x46a5af,_0x444649,_0x2dcf0d,_0x23c77b){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x444649){const _0x20e662=this['_decompressOperations'](_0x2dcf0d,_0x23c77b);await this['_fetchMissingUsers'](_0x20e662),this['_handleExternalOperations'](_0x20e662,_0x444649,_0x2dcf0d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x2f0149}=this['editor'];let _0x5b45f9;try{_0x5b45f9=await this['_service']['getDocumentDetails']();}catch{const _0x491135=A(_0x2f0149,'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'](_0x491135);}const _0x4b10cf=_0x5b45f9['currentDocumentSession']||_0x5b45f9['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x4b10cf['lastOperationId']){const _0x1a8bdd=A(_0x2f0149,'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'](_0x1a8bdd);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4275ff){const _0x42dd97=this['editor']['plugins']['get'](i);this['listenTo'](_0x42dd97,'sessionAdd:'+this['_channelId'],(_0x83adc1,{session:_0x117e0e})=>{if(_0x117e0e['id']===_0x42dd97['mySessionId']){_0x83adc1['off']();const _0x200f06=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2cd364=_0x117e0e['permissions'];_0x200f06&&_0x200f06['isEnabled']&&(_0x2cd364=_0x2cd364['filter'](_0x461919=>'document:write'!==_0x461919)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2cd364,this['_channelId']);}}),_0x42dd97['register'](this['_channelId'],_0x4275ff);}['_initThrowingOnDataSet'](){const _0x50638c=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x54054c)=>{if(!_0x54054c[_0x54054c['length']-0x1]['suppressErrorInCollaboration'])throw new _0x4c05ca('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x50638c['apply'](this['editor']['data'],_0x54054c);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x8c5fb9,[_0x26ca76])=>{if(this['_document']['version'])throw new _0x4c05ca('realtimecollaborationclient-init-document-already-initialized',this);_0x8c5fb9['stop'](),this['_setPendingAction']();const _0x7b2066=this['editor']['config']['get']('rootsAttributes'),_0x4d3f47=this['_getOperationsFromInitData'](_0x26ca76,_0x7b2066);0x0==_0x4d3f47['length']&&_0x4d3f47['push'](new _0x13ff47(0x0)),_0x8c5fb9['return']=this['_connectService'](_0x4d3f47)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2f7d4e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2f7d4e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x5616ba,[_0x2b30b7,_0x1c4079])=>{_0x5616ba['stop']();const _0x357ce9=this['editor']['model']['document']['getRoot'](_0x2b30b7);if(!this['_knownRootNames']['has'](_0x2b30b7)){const _0x3cf0b9=_0x1c4079&&_0x1c4079['data']?_0x1c4079['data']:'',_0xe93396=_0x1c4079&&_0x1c4079['attributes']?_0x1c4079['attributes']:{};await this['_loadRoot'](_0x2b30b7,_0x3cf0b9,_0xe93396);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x357ce9['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x357ce9);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x5bf3ef){const _0x19d7dd=this['editor']['plugins']['get'](_0x29a775),{connection:_0x35796d}=this['editor']['plugins']['get'](n),_0x878b92=new Set();for(const _0x3f57b0 of _0x5bf3ef){const _0x393a78=_0x3f57b0['_authorId'];_0x393a78&&!_0x19d7dd['getUser'](_0x393a78)&&_0x878b92['add'](_0x393a78);}if(0x0===_0x878b92['size'])return;const _0x80880d=await ut['getMany'](_0x35796d,Array['from'](_0x878b92));for(const _0x4bc8dd of _0x80880d)_0x19d7dd['getUser'](_0x4bc8dd['id'])||_0x19d7dd['addUser'](_0x4bc8dd);}['_getOperationsFromInitData'](_0x2c83df,_0x1364f2={}){const _0x19182c=this['editor']['model'],_0x2fcff0=[];let _0x19ca93=0x0;const _0xf1f1a2='string'==typeof _0x2c83df?{'main':_0x2c83df}:_0x2c83df;for(const _0x3aa51e of Object['keys'](_0xf1f1a2)){if(!this['_document']['roots']['has'](_0x3aa51e))throw new _0x4c05ca('realtimecollaborationclient-init-non-existent-root',this);const _0x1e7271=this['editor']['data']['parse'](_0xf1f1a2[_0x3aa51e]),_0x54097e=this['_document']['getRoot'](_0x3aa51e),_0x72f37c=new _0x5057d5(_0x19182c['createPositionAt'](_0x54097e,0x0),_0x1e7271,_0x19ca93++);_0x2fcff0['push'](_0x72f37c);for(const [_0x195274,_0x6650e1]of _0x1e7271['markers']){const _0x23d20a=_0x19182c['createRange'](_0x19182c['createPositionFromPath'](_0x54097e,_0x6650e1['start']['path']['slice']()),_0x19182c['createPositionFromPath'](_0x54097e,_0x6650e1['end']['path']['slice']())),_0xb1e1b7=new _0x47603b(_0x195274,null,_0x23d20a,_0x19182c['markers'],!0x0,_0x19ca93++);_0x2fcff0['push'](_0xb1e1b7);}}if(_0x1364f2)for(const [_0x25bc61,_0x3f86c8]of Object['entries'](_0x1364f2)){const _0x46d3b2=_0x19182c['document']['getRoot'](_0x25bc61);if(!_0x46d3b2)throw new _0x4c05ca('multi-root-editor-root-attributes-no-root',null);for(const [_0x47b179,_0x48bc7e]of Object['entries'](_0x3f86c8))if(null!==_0x48bc7e){const _0x435eb7=new _0x30b27a(_0x46d3b2,_0x47b179,null,_0x48bc7e,_0x19ca93++);_0x2fcff0['push'](_0x435eb7);}}return _0x2fcff0;}async['_loadRoot'](_0x6044ab,_0x140d4b,_0x3e275f){this['_getOperationsFromInitData']({[_0x6044ab]:_0x140d4b},{[_0x6044ab]:_0x3e275f})['forEach']((_0x2d118e,_0x132b91)=>{_0x2d118e['baseVersion']=this['_document']['version']+_0x132b91,_0x2d118e['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2d118e);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1195f4,_0x1d00c5){let _0x1096ab;this['_offset']=_0x1195f4['offset'];const _0xcde539=_0x1195f4['wereChangesApplied']&&!_0x1195f4['initData'],_0x10a9ab=_0xcde539?0x0:_0x1195f4['data']['baseVersion'];if(_0x1d00c5['forEach'](_0x1166b2=>{_0x1166b2['_isInit']=!0x0,_0x1166b2['createdAt']=_0x1195f4['sessionCreatedAt'],_0x1166b2['_authorId']=null;}),_0xcde539)_0x1096ab=_0x1d00c5,this['_applyOperationsSet'](_0x1096ab,_0xcde539);else{if(_0x1195f4['initData']){const _0x4ad775=this['_getOperationsFromInitData'](_0x1195f4['initData']);this['_document']['history']['version']=-_0x4ad775['length'],_0x4ad775['forEach'](_0x45ae76=>{_0x45ae76['baseVersion']-=_0x4ad775['length'],_0x45ae76['createdAt']=_0x1195f4['sessionCreatedAt'],_0x45ae76['_isInit']=!0x0,_0x45ae76['_authorId']=null;}),this['_applyOperationsSet'](_0x4ad775,!0x0),this['serverHistory']['version']=-_0x4ad775['length']+this['_offset'],this['_updateServerHistory'](_0x4ad775);}this['_document']['history']['version']=_0x10a9ab,_0x1096ab=this['_decompressOperations'](_0x1195f4['data'],_0x1195f4['metadata']),await this['_fetchMissingUsers'](_0x1096ab),this['_applyOperationsSet'](_0x1096ab,_0xcde539);}_0x1195f4['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1096ab,_0x1195f4['lastOperationId']),this['_lastSyncedOperationId']=_0x1195f4['lastOperationId']),this['serverHistory']['version']=_0x10a9ab+this['_offset'],this['_updateServerHistory'](_0x1096ab),_0x1d00c5['filter'](_0x25d312=>{const _0x172c9e=this['_getAffectedRoot'](_0x25d312);return _0x172c9e&&!this['_knownRootNames']['has'](_0x172c9e);})['forEach']((_0x4bfb8b,_0x1b6a9d)=>{_0x4bfb8b['baseVersion']=this['_document']['version']+_0x1b6a9d,this['_saveOperationInBuffer'](_0x4bfb8b);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x59a156,_0x588297){const _0x129e16=_0x588297&&_0x588297['message'];if(_0x129e16&&_0x129e16['startsWith']('realtimecollaborationclient'))throw _0x588297;const _0x694008=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x694008['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x4c05ca(_0x59a156,this['editor'],_0x129e16?{'originalError':_0x129e16}:void 0x0);}['_saveOperationInBuffer'](_0x3b4190){this['_knownOperations']['has'](_0x3b4190)||(this['_knownOperations']['add'](_0x3b4190),this['_bufferedOperations']['push'](_0x3b4190),this['_pendingAction']||'marker'==_0x3b4190['type']&&!_0x3b4190['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x201352=!0x1){!_0x201352&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x165658=>{_0x165658&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x423ec7=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x41d924){return _0x41d924['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41d924['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x41d924['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x423ec7)||this['_crash'](_0x423ec7['message'],_0x423ec7);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x32f869=>{this['on']('change:_isPendingUpdate',()=>{_0x32f869();});});}async['_sendBufferedOperations'](){const _0x527ca2=this['editor']['plugins']['get'](k);if(this['_shouldSendSelectionUpdate']()&&(_0x527ca2['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x4cadaf=[...this['_bufferedOperations']];for(const _0x3d6915 of _0x4cadaf)_0x3d6915['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3d6915);const _0x5bddfe=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4cadaf),_0x3b7505=D++,_0x245755=this['_compressOperations'](_0x4cadaf),_0x33f7e9=await this['_service']['sendOperations'](_0x245755,_0x245755['baseVersion'],_0x5bddfe);try{return await this['_handleServerResponse'](_0x4cadaf,_0x33f7e9,_0x3b7505);}catch(_0x1936a2){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1936a2);}}async['_handleServerResponse'](_0x596d88,_0x380591,_0x564806){if('error'in _0x380591)throw _0x380591['error'];let _0x26a913=!0x1;if(_0x380591['wereChangesApplied']){_0x380591['lastOperationId']&&(this['_lastSyncedOperationId']=_0x380591['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5ef51b=>!_0x596d88['includes'](_0x5ef51b));for(const _0x564548 of _0x596d88)_0x564548['createdAt']='lastOperationAcceptedAt'in _0x380591&&_0x380591['lastOperationAcceptedAt']||void 0x0;U(_0x596d88,_0x380591['version']-_0x596d88['length']),this['_updateServerHistory'](_0x596d88);const _0x50be77=_0x596d88['filter'](_0x322632=>{if(!_0x322632['_isInit'])return!0x1;const _0x2f2bc5=this['_getAffectedRoot'](_0x322632);return _0x2f2bc5&&!this['_knownRootNames']['has'](_0x2f2bc5);});U(_0x50be77,this['_document']['version']),this['_applyOperationsSet'](_0x50be77),_0x26a913=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xf18d78=this['_decompressOperations'](_0x380591['data'],_0x380591['metadata'])['filter'](_0x412df1=>_0x412df1['baseVersion']>=this['_lastServerVersion']);_0xf18d78['forEach'](_0x5844ad=>this['_addKnownRoot'](_0x5844ad)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xdca70=>!_0xdca70['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0xdca70))),this['_bufferedOperations']['length']&&U(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xf18d78),_0x26a913=this['_handleExternalOperations'](_0xf18d78,_0x380591['version'],_0x380591['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x26a913?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x4f73c0,_0x4c1da4,_0x2a54c6){try{const _0x1c3cb1={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x89b5d8,operationsB:_0x346147,originalOperations:_0x1767be}=_0x2a20bd(_0x4f73c0,this['_bufferedOperations'],_0x1c3cb1);U(_0x89b5d8,this['_document']['version']),U(_0x346147,_0x4c1da4);for(const _0x62e4a of _0x89b5d8){const _0x5c4884=_0x1767be['get'](_0x62e4a);_0x62e4a['_authorId']=_0x5c4884?_0x5c4884['_authorId']:null;}_0x2a54c6&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4f73c0,_0x2a54c6),this['_lastSyncedOperationId']=_0x2a54c6),this['_bufferedOperations']=[..._0x346147],this['_applyOperationsSet'](_0x89b5d8),this['_updateServerHistory'](_0x4f73c0);}catch(_0x5e7018){return console['error'](_0x5e7018),!0x1;}return!0x0;}['_applyOperationsSet'](_0x35437d,_0x3d8a50=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x25d35b=>{for(const _0x2e6aa8 of _0x35437d)this['_knownOperations']['add'](_0x2e6aa8),this['_addKnownRoot'](_0x2e6aa8),_0x25d35b['batch']['addOperation'](_0x2e6aa8),this['editor']['model']['applyOperation'](_0x2e6aa8);});}['_addKnownRoot'](_0xd01fde){const _0x5d4082=this['_getAffectedRoot'](_0xd01fde);_0x5d4082&&this['_knownRootNames']['add'](_0x5d4082);}['_getAffectedRoot'](_0x341caf){let _0xe79665,_0x3d7a8a;switch(_0x341caf['type']){case'insert':_0xe79665=_0x341caf['position']['root'];break;case'marker':if(_0x3d7a8a=_0x341caf['newRange'],!_0x3d7a8a)return null;_0xe79665=_0x3d7a8a['root'];break;case'addRootAttribute':_0xe79665=_0x341caf['root'];break;case'addRoot':_0xe79665=_0x341caf['affectedSelectable'];break;case'move':_0xe79665=_0x341caf['targetPosition']['root'];break;default:return null;}return _0xe79665['rootName'];}['_updateServerHistory'](_0x298905){_0x298905['forEach'](_0x139463=>{const _0x27749a=_0x139463['clone']();_0x27749a['_authorId']=_0x139463['_authorId'],_0x27749a['_isInit']=!!_0x139463['_isInit'],_0x27749a['createdAt']=_0x139463['createdAt'],_0x27749a['baseVersion']+=this['_offset'],_0x139463['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x27749a),this['serverHistory']['addOperation'](_0x27749a);});}['_handleReconnectionError'](_0x29ae2d){const _0xa4ec1b=this['editor']['plugins']['get']('Notification'),_0x376992=this['editor']['locale'];_0x29ae2d||(_0x29ae2d=A(_0x376992,'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.')),_0xa4ec1b['showWarning'](_0x29ae2d,{'title':A(_0x376992,'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'](_0x583c13)['add'](A(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x583c13)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x139eba){const _0x3f3685=_0x139eba['map'](_0x50c397=>_0x50c397['toJSON']());return this['_compressor']['compress'](_0x3f3685);}['_decompressOperations'](_0x52567d,_0x3f2ebe){return this['_compressor']['decompress'](_0x52567d)['map']((_0x9415de,_0x4b9794)=>{const _0x1ccd36='init'==_0x3f2ebe[_0x4b9794]['type'];if('InsertOperation'==_0x9415de['__className']){const _0x382f6f=_0x9415de['position']['root'];!this['_document']['getRoot'](_0x382f6f)&&(this['_document']['createRoot']('$root',_0x382f6f)['_isAttached']=!0x1);}const _0x33f4c6=_0x18b04b['fromJSON'](_0x9415de,this['_document']);return _0x33f4c6['wasUndone']=_0x9415de['wasUndone'],_0x33f4c6['_isInit']=_0x1ccd36,_0x33f4c6['_authorId']=_0x1ccd36?null:_0x3f2ebe[_0x4b9794]['userId'],_0x33f4c6['_isDisconnection']='cs:removeUser'===_0x3f2ebe[_0x4b9794]['type'],_0x33f4c6['createdAt']=_0x3f2ebe[_0x4b9794]['createdAt'],_0x33f4c6;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x1d2a8b=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x1d2a8b&&_0x1d2a8b['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class P extends Error{}function U(_0x1ebb38,_0xf4b2e5){for(const _0x3eb19c of _0x1ebb38)_0x3eb19c['baseVersion']=_0xf4b2e5++;}class C{['_ignoredOperations'];['_operationToId'];constructor(_0x41558f){this['_ignoredOperations']=_0x41558f,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x319b4f){let _0x8666ba=_0x319b4f['length'];for(;_0x8666ba--;){const _0x4505f6=_0x319b4f[_0x8666ba];if(!this['_ignoredOperations']['has'](_0x4505f6)){if(!this['_operationToId']['has'](_0x4505f6)){const _0x52b34c=_0x11d993()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4505f6,_0x52b34c);}return this['_operationToId']['get'](_0x4505f6);}}}['setIdForTheLastOperation'](_0x4d0797,_0x1b15b8){if(!_0x1b15b8)return;let _0x2b4006=_0x4d0797['length'];for(;_0x2b4006--;){const _0x3e4208=_0x4d0797[_0x2b4006];this['_ignoredOperations']['has'](_0x3e4208)||this['_operationToId']['set'](_0x3e4208,_0x1b15b8);}}}class a extends _0x67d212{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x488dd2{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x3e1695)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x29a775];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x577295){super(_0x577295),this['_services']=new Map();}async['init'](){const _0x38b18e=this['context'],_0x40f1d5=_0x38b18e['plugins']['get']('CommentsRepository');if(_0x38b18e['plugins']['get'](n)['addToReconnectionStack'](this),_0x40f1d5['adapter']={'addCommentThread':async({channelId:_0x2b90a0,threadId:_0x31e64a,comments:_0x51d61b,resolvedAt:_0x9dde6,resolvedBy:_0x3638fe,context:_0x1eeefe,attributes:_0x2b426d})=>{const _0x12b63a=await this['_getService'](_0x2b90a0)['addCommentThread']({'commentThreadId':_0x31e64a,'comments':_0x51d61b['map'](_0x10807a=>function(_0x296057,_0x185085,_0x1fac08){return{'commentThreadId':_0x1fac08,'commentId':_0x296057['commentId'],'userId':_0x296057['authorId'],'content':_0x296057['content'],'documentId':_0x185085,'createdAt':_0x296057['createdAt'],'attributes':_0x296057['attributes']||{}};}(_0x10807a,_0x2b90a0,_0x31e64a)),'resolvedAt':_0x9dde6,'resolvedBy':_0x3638fe,'context':_0x1eeefe,'attributes':_0x2b426d})['catch'](ft);return{'threadId':_0x12b63a['commentThreadId'],'comments':_0x12b63a['comments']};},'getCommentThread':async({channelId:_0x6874ad,threadId:_0x24a597})=>{const _0x346ff4=await this['_getService'](_0x6874ad)['getCommentThread'](_0x24a597)['catch'](Z)['catch'](ft);return _0x346ff4?_0x346ff4['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x346ff4]),{'threadId':_0x346ff4['commentThreadId'],'comments':_0x346ff4['comments']['map'](et),'context':_0x346ff4['context'],'resolvedAt':_0x346ff4['resolvedAt'],'resolvedBy':_0x346ff4['resolvedBy'],'attributes':_0x346ff4['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x1a68f3,threadId:_0x57457c,context:_0x444806,unlinkedAt:_0x5be7ae,attributes:_0x4c9daf})=>this['_getService'](_0x1a68f3)['updateCommentThread']({'commentThreadId':_0x57457c,'context':_0x444806,'attributes':_0x4c9daf,'unlinkedAt':_0x5be7ae})['catch'](Z)['catch'](ft),'resolveCommentThread':async({channelId:_0x3c08ce,threadId:_0x281b69})=>{const _0x4ff68b=await this['_getService'](_0x3c08ce)['resolveCommentThread'](_0x281b69)['catch'](Z)['catch'](ft);return{'threadId':_0x4ff68b['commentThreadId'],'resolvedAt':_0x4ff68b['resolvedAt'],'resolvedBy':_0x4ff68b['resolvedBy']};},'reopenCommentThread':async({channelId:_0xd7e71f,threadId:_0x38ea9a})=>this['_getService'](_0xd7e71f)['reopenCommentThread'](_0x38ea9a)['catch'](Z)['catch'](ft),'removeCommentThread':({channelId:_0x29bb88,threadId:_0x5f1dcc})=>this['_getService'](_0x29bb88)['removeCommentThread'](_0x5f1dcc)['catch'](Z)['catch'](ft),'addComment':({channelId:_0x37e34a,threadId:_0xafb621,commentId:_0x210265,content:_0x47c4cf,attributes:_0x2f2845})=>this['_getService'](_0x37e34a)['addComment'](_0xafb621,_0x210265,_0x47c4cf,_0x2f2845)['catch'](ft),'updateComment':({channelId:_0x47dd67,threadId:_0x4df32f,commentId:_0x561025,content:_0x24158d,attributes:_0xdfdc8e})=>this['_getService'](_0x47dd67)['updateComment'](_0x4df32f,_0x561025,_0x24158d,_0xdfdc8e)['catch'](Z)['catch'](ft),'removeComment':({channelId:_0x323a17,threadId:_0x3e6cc5,commentId:_0x26201e})=>this['_getService'](_0x323a17)['removeComment'](_0x3e6cc5,_0x26201e)['catch'](Z)['catch'](ft)},_0x38b18e instanceof _0x3bbf95){const _0x1a3c69=_0x38b18e['config']['get']('collaboration.channelId'),_0x191b4b=_0x38b18e['plugins']['get'](i);await this['_setUpService'](_0x1a3c69);const _0x311040=await this['_services']['get'](_0x1a3c69)['getConnectedSessions']();this['listenTo'](_0x191b4b,'sessionAdd:'+_0x1a3c69,(_0x5a16a3,{session:_0x36a4d8})=>{_0x36a4d8['id']===_0x191b4b['mySessionId']&&(_0x5a16a3['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x36a4d8['permissions'],_0x1a3c69));}),_0x191b4b['register'](_0x1a3c69,_0x311040);}}async['_setUpService'](_0x2638ff){if(this['_services']['has'](_0x2638ff))throw new _0x4c05ca('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x2638ff});const _0x26bec8=this['context']['plugins']['get']('CommentsRepository'),_0x175331=new s['CommentsService'](_0x2638ff);this['_services']['set'](_0x2638ff,_0x175331),this['listenTo'](_0x175331,'commentThreadAdded',(_0x557604,_0x285106)=>{const {commentThreadId:_0x5d0f69,documentId:_0x3da791,context:_0x32b95d,attributes:_0x2924b7,resolvedAt:_0x15ad6b,resolvedBy:_0x240861,comments:_0x4617e4}=_0x285106;_0x26bec8['getCommentThread'](_0x5d0f69)||_0x26bec8['addCommentThread']({'threadId':_0x5d0f69,'channelId':_0x3da791,'comments':_0x4617e4?_0x4617e4['map'](et):[],'context':_0x32b95d,'attributes':_0x2924b7,'resolvedAt':_0x15ad6b,'resolvedBy':_0x240861,'isFromAdapter':!0x0});}),this['listenTo'](_0x175331,'commentThreadUpdated',(_0x59213d,{commentThreadId:_0x365990,documentId:_0x2baf5c,context:_0x3e934d,unlinkedAt:_0x41e543,attributes:_0x38d000})=>{_0x26bec8['getCommentThread'](_0x365990)&&_0x26bec8['updateCommentThread']({'threadId':_0x365990,'channelId':_0x2baf5c,'context':_0x3e934d,'unlinkedAt':_0x41e543,'attributes':_0x38d000,'isFromAdapter':!0x0});}),this['listenTo'](_0x175331,'commentThreadResolved',(_0x337294,{commentThreadId:_0x41bd79,resolvedBy:_0x30f30a,resolvedAt:_0x297075})=>{const _0x1571df=_0x26bec8['getCommentThread'](_0x41bd79);_0x1571df&&_0x1571df['resolve']({'resolvedBy':_0x30f30a,'resolvedAt':_0x297075,'isFromAdapter':!0x0});}),this['listenTo'](_0x175331,'commentThreadReopened',(_0x5a4304,{commentThreadId:_0x2720c3})=>{const _0x24a544=_0x26bec8['getCommentThread'](_0x2720c3);_0x24a544&&_0x24a544['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x175331,'commentThreadRemoved',(_0x5d5bc8,{commentThreadId:_0x58003d})=>{const _0x6c7efd=_0x26bec8['getCommentThread'](_0x58003d);_0x6c7efd&&_0x6c7efd['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x175331,'commentAdded',(_0x101ba0,_0x39050a)=>{const _0x5bff1a=_0x39050a['commentThreadId'],_0x3f8d1b=_0x26bec8['getCommentThread'](_0x5bff1a);_0x3f8d1b&&_0x3f8d1b['addComment']({...et(_0x39050a),'isFromAdapter':!0x0});}),this['listenTo'](_0x175331,'commentUpdated',(_0x58039c,{commentThreadId:_0x1789b8,commentId:_0x587589,content:_0x37a8dc,attributes:_0x41fd21})=>{const _0x4a5014=_0x26bec8['getCommentThread'](_0x1789b8);if(_0x4a5014){const _0x11f98b=_0x4a5014['getComment'](_0x587589);_0x11f98b&&_0x11f98b['update']({'content':_0x37a8dc,'attributes':_0x41fd21,'isFromAdapter':!0x0});}}),this['listenTo'](_0x175331,'commentRemoved',(_0x4f9e20,{commentThreadId:_0x2a27a3,commentId:_0x496d0d})=>{const _0x599372=_0x26bec8['getCommentThread'](_0x2a27a3);if(_0x599372){const _0x322ea6=_0x599372['getComment'](_0x496d0d);_0x322ea6&&_0x322ea6['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x2638ff);}['destroy'](){if(this['context']instanceof _0x3bbf95){const _0x574472=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x574472);}}['_terminateService'](_0x54608b){if(!this['_services']['has'](_0x54608b))throw new _0x4c05ca('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x54608b});this['_getService'](_0x54608b)['disconnect'](),this['_services']['delete'](_0x54608b);}async['reconnect'](){for(const _0x2856f0 of this['_services']['keys']())await this['_connectService'](_0x2856f0);if(this['context']instanceof _0x3bbf95){const _0x4d69c4=this['context']['config']['get']('collaboration.channelId'),_0x4cf3ae=this['context']['plugins']['get'](i);_0x4cf3ae['unregister'](_0x4d69c4);const _0x1db474=await this['_services']['get'](_0x4d69c4)['getConnectedSessions']();_0x4cf3ae['register'](_0x4d69c4,_0x1db474);}}async['_connectService'](_0x33f0b3){const {connection:_0x3c495b}=this['context']['plugins']['get'](n),_0x591f5f=this['context']['plugins']['get']('CommentsRepository'),_0x2d5579=this['_services']['get'](_0x33f0b3),_0x4e5284=await _0x2d5579['connect'](_0x3c495b);await this['_fetchMissingUsersForThreads'](_0x4e5284);const _0x2cbe53=new Set(Array['from'](_0x591f5f['getCommentThreads']({'channelId':_0x33f0b3}),_0x472cd3=>_0x472cd3['id']));for(const _0x4b567c of _0x4e5284)_0x4b567c['deletedAt']||_0x2cbe53['delete'](_0x4b567c['commentThreadId']);for(const _0x590481 of _0x2cbe53)_0x591f5f['getCommentThread'](_0x590481)['remove']({'isFromAdapter':!0x0});for(const _0x11dd4c of _0x4e5284){let _0x4e02b0=_0x591f5f['getCommentThread'](_0x11dd4c['commentThreadId']);const {commentThreadId:_0x385a5b,context:_0x37d1e6,attributes:_0x146c44,resolvedBy:_0x2024c9,resolvedAt:_0x584b83,unlinkedAt:_0x496f90,deletedAt:_0x52216c}=_0x11dd4c;if(_0x52216c)continue;_0x4e02b0||(_0x4e02b0=_0x591f5f['addCommentThread']({'channelId':_0x33f0b3,'threadId':_0x385a5b,'context':_0x37d1e6,'attributes':_0x146c44||{},'resolvedBy':_0x2024c9,'resolvedAt':_0x584b83,'unlinkedAt':_0x496f90,'isFromAdapter':!0x0}));const _0x38d04b=new Set(Array['from'](_0x4e02b0['comments'],_0x396ae5=>_0x396ae5['id']));for(const _0x3eabde of _0x11dd4c['comments'])_0x38d04b['delete'](_0x3eabde['commentId']);for(const _0x481754 of _0x38d04b)_0x4e02b0['getComment'](_0x481754)['remove']({'isFromAdapter':!0x0});for(const _0x487c16 of _0x11dd4c['comments']){const _0x23c625=_0x4e02b0['getComment'](_0x487c16['commentId']);_0x23c625?_0x23c625['content']!==_0x487c16['content']&&_0x23c625['update']({'content':_0x487c16['content'],'isFromAdapter':!0x0}):_0x4e02b0['addComment'](Object['assign'](et(_0x487c16),{'isFromAdapter':!0x0}));}}}['_getService'](_0xe7615f){if(!this['_services']['has'](_0xe7615f))throw new _0x4c05ca('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xe7615f});return this['_services']['get'](_0xe7615f);}async['_fetchMissingUsersForThreads'](_0x31e5b3){const _0xf062e1=this['context']['plugins']['get'](_0x29a775),{connection:_0xbd7bf5}=this['context']['plugins']['get'](n),_0x461328=new Set();for(const {resolvedBy:_0x4c62b9,comments:_0x296959}of _0x31e5b3){_0x4c62b9&&!_0xf062e1['getUser'](_0x4c62b9)&&_0x461328['add'](_0x4c62b9);for(const {userId:_0x123a62}of _0x296959)_0xf062e1['getUser'](_0x123a62)||_0x461328['add'](_0x123a62);}if(0x0===_0x461328['size'])return;const _0x4e71bc=await ut['getMany'](_0xbd7bf5,Array['from'](_0x461328));for(const _0x54f689 of _0x4e71bc)_0xf062e1['getUser'](_0x54f689['id'])||_0xf062e1['addUser'](_0x54f689);}}async function Z(_0xdd9a9a){if('404'!==_0xdd9a9a['code'])throw _0xdd9a9a;}function ft(_0x596c94){if((_0xa0ba9c=_0x596c94)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0xa0ba9c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xa0ba9c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0xa0ba9c;throw _0x596c94;}function et(_0x14725b){return{'threadId':_0x14725b['commentThreadId'],'commentId':_0x14725b['commentId'],'content':_0x14725b['content'],'createdAt':_0x14725b['createdAt'],'authorId':_0x14725b['userId'],'attributes':_0x14725b['attributes']||{}};}class m extends _0x67d212{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>rt)());['_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(_0x3138f0){super(_0x3138f0);const _0x34690b=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x34690b);}['init'](){const _0x5252ad=this['editor']['plugins']['get'](n),_0x44848f=this['editor']['plugins']['get']('TrackChangesEditing');return _0x44848f['adapter']={'getSuggestion':async _0x12d80f=>{await this['_waitForServiceReady']();const _0x45db1d=await this['_trackChangesService']['get'](_0x12d80f)['catch'](tt);return await this['_fetchMissingUsersForThreads']([_0x45db1d]),_0x45db1d;},'addSuggestion':async({id:_0x5a5ae8,type:_0x10ddf6,data:_0x42ccbe,originalSuggestionId:_0x3b4a08,attributes:_0x158e4e})=>{await this['_waitForServiceReady']();const _0x9b3afd={'id':_0x5a5ae8,'type':_0x10ddf6,'data':_0x42ccbe,'originalSuggestionId':_0x3b4a08,'attributes':_0x158e4e},_0x2fd40b=await this['_trackChangesService']['add'](_0x5a5ae8,_0x10ddf6,_0x42ccbe,_0x3b4a08,_0x158e4e)['catch'](_0x4de27d=>{if(mt(_0x4de27d))return new Promise(_0x30a35e=>{this['_bufferedRequests']['set'](_0x5a5ae8,{'resolve':_0x30a35e,'suggestionData':_0x9b3afd});});throw _0x4de27d;});return this['_bufferedRequests']['delete'](_0x5a5ae8),_0x2fd40b;},'updateSuggestion':async(_0x5db499,_0x13eaf0)=>{if(await this['_waitForServiceReady'](),'open'!==_0x13eaf0['state'])return this['_trackChangesService']['update'](_0x5db499,_0x13eaf0)['catch'](tt);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x185d26,_0x950ff1)=>{_0x44848f['hasSuggestion'](_0x950ff1['id'])&&(_0x44848f['getSuggestion'](_0x950ff1['id'])['attributes']=_0x950ff1['attributes']);}),this['_trackChangesService']['connect'](_0x5252ad['connection'])['then'](_0x3ce43b=>(_0x5252ad['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x3ce43b)['then'](()=>{for(const _0xd04573 of _0x3ce43b){_0x44848f['addSuggestionData'](_0xd04573)['_saved']=!0x0;}})));}async['reconnect'](){const _0x191245=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0xaf5dc5}=this['editor']['plugins']['get'](n),_0x451569=await this['_trackChangesService']['connect'](_0xaf5dc5);await this['_fetchMissingUsersForThreads'](_0x451569);for(const {suggestionData:_0x3bea99,resolve:_0x161485}of this['_bufferedRequests']['values']()){let _0x315294=_0x451569['find'](_0x5e9857=>_0x5e9857['id']===_0x3bea99['id']);_0x315294||(_0x315294=await this['_trackChangesService']['add'](_0x3bea99['id'],_0x3bea99['type'],_0x3bea99['data'],_0x3bea99['originalSuggestionId'])),_0x161485(_0x315294);}for(const _0x4a2d34 of _0x451569)_0x191245['hasSuggestion'](_0x4a2d34['id'])||_0x191245['addSuggestionData'](_0x4a2d34);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x15a731=>{this['listenTo'](this['_trackChangesService'],'connected',_0x34b65c=>{_0x34b65c['off'](),_0x15a731();});});}async['_fetchMissingUsersForThreads'](_0x38a862){const _0x183429=this['editor']['plugins']['get'](_0x29a775),{connection:_0x34636d}=this['editor']['plugins']['get'](n),_0x4fc677=new Set();for(const {authorId:_0x122fed}of _0x38a862)_0x183429['getUser'](_0x122fed)||_0x4fc677['add'](_0x122fed);if(0x0===_0x4fc677['size'])return;const _0x27b04a=await ut['getMany'](_0x34636d,Array['from'](_0x4fc677));for(const _0x5aac62 of _0x27b04a)_0x183429['getUser'](_0x5aac62['id'])||_0x183429['addUser'](_0x5aac62);}}function tt(_0x3fcd94){if(mt(_0x3fcd94))return new Promise(()=>{});throw _0x3fcd94;}function mt(_0x4baa22){return _0x4baa22['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4baa22['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x67d212{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 _0x1e8b41=this['editor']['plugins']['get'](n),_0x41b4aa=this['editor']['plugins']['get']('CommentsEditing'),_0xe2a8c4=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x1e8b41,'change:state',(_0x58db27,_0x494bac,_0x2c5d1c)=>{_0x41b4aa['isThreadsLoadingPaused']='connected'!==_0x2c5d1c;});}),this['listenTo'](_0x1e8b41,'change:state',(_0x1eb324,_0x2187e0,_0x34bfd4)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x34bfd4);}),_0xe2a8c4['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class pt extends _0x67d212{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 _0x67d212{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>st)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x29a775];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2c8090){super(_0x2c8090);const _0x5696a3=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x5696a3);}async['init'](){const _0x353f58=this['editor']['plugins']['get'](l),_0x355048=_0x353f58['serverHistory'],_0x5de3b4=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x355048,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x353f58['sessionId']});const _0x290dd0=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x258b2b=await it['isBundleUploaded'](_0x5de3b4['connection'],_0x290dd0);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1f5ca0})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1f5ca0)),'updateRevisions':async _0x34d0fd=>{await this['_waitForServiceReady']();const _0x4e3838=this['_revisionTracker']['currentRevision'];if(_0x258b2b&&0x1===_0x34d0fd['length']&&_0x34d0fd[0x0]['id']===_0x4e3838['id'])return _0x34d0fd;for(const _0x22f23f of _0x34d0fd)_0x22f23f['id']===_0x4e3838['id']&&(_0x22f23f['isEmptyCurrent']=_0x22f23f['fromVersion']===_0x22f23f['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x34d0fd,this['_lastRequestId'])['then'](_0x360e43=>(this['_lastRequestId']=_0x360e43,_0x34d0fd))['catch'](_0x299985=>{if(ot(_0x299985)||'400'===_0x299985['code']&&void 0x0!==_0x299985['data']['wrongRequestId']){for(const _0x3f579d of _0x34d0fd){!this['_revisionTracker']['repository']['getRevision'](_0x3f579d['id'])||this['_revisionTracker']['_bufferUpdate'](_0x3f579d['id'],_0x3f579d,!0x1);}if(ot(_0x299985))throw _0x299985;return _0x34d0fd;}throw _0x299985;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x279e48,{revisionsData:_0x39f9c8,requestId:_0xccf54e})=>{Math['max'](..._0x39f9c8['map'](_0x1e267e=>_0x1e267e['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x39f9c8,_0xccf54e);}):this['_handleRevisionsUpdate'](_0x39f9c8,_0xccf54e);});const {revisions:_0x3cb0a3,requestId:_0x38f898}=await this['_revisionHistoryService']['connect'](_0x5de3b4['connection']);_0x5de3b4['addToReconnectionStack'](this),this['_lastRequestId']=_0x38f898,await this['_fetchMissingUsers'](_0x3cb0a3);for(const _0x2f4326 of _0x3cb0a3)this['_revisionTracker']['addRevisionData'](_0x2f4326);this['listenTo'](_0x353f58,'change:_isConnected',(_0x5639dd,_0x1f751d,_0x5140bd)=>{_0x5140bd&&(this['_oldOffset']=_0x353f58['_offset'],_0x5639dd['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5de3b4,'state',_0x568292=>_0x568292===_0x42de26['CONNECTED']);}async['reconnect'](){const _0x21d3b8=this['editor']['plugins']['get'](n),_0x45b575=this['editor']['plugins']['get'](l),_0x116c5=async()=>{const _0x2344ad=this['_revisionTracker']['currentRevision'],_0x3cd66f=_0x2344ad['id'],_0x2b169b=_0x3cd66f!==_0x45b575['sessionId'];if(_0x2b169b){const _0x10658a=_0x45b575['_offset']-this['_oldOffset'],_0x1acb86=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2344ad['toVersion']+_0x10658a!==_0x1acb86){const _0x2dce3d=_0x2344ad['fromVersion']+_0x10658a,_0x192fd2=this['editor']['plugins']['get'](_0x29a775),_0x43a03d=this['_revisionTracker']['buildRevisionData']({'revision':_0x2344ad,'from':_0x2dce3d,'to':_0x1acb86});_0x43a03d['id']=_0x2344ad['id'];const _0x3f0a89=_0x43a03d['authorsIds']['map'](_0x19feb0=>_0x192fd2['getUser'](_0x19feb0));_0x2344ad['_update']({..._0x43a03d,'authors':_0x3f0a89},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2344ad['id'],_0x43a03d,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1acb86,(_0x2344ad['toVersion']===_0x2344ad['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x3cd66f)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x3cd66f),this['_revisionTracker']['_createCurrentRevision'](_0x1acb86));}const {revisions:_0xc66bf6,requestId:_0x2f076e}=await this['_revisionHistoryService']['reconnect'](_0x21d3b8['connection'],this['_lastRequestId']);_0x2b169b&&_0xc66bf6['length']>0x0?_0x45b575['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0xc66bf6),this['_handleRevisionsUpdate'](_0xc66bf6,_0x2f076e),this['_revisionTracker']['sendBufferedUpdates']());};return _0x45b575['_isConnected']?_0x116c5():new Promise((_0x1e82f7,_0x407a3b)=>{_0x45b575['once']('change:_isConnected',()=>{_0x116c5()['then'](_0x1e82f7)['catch'](_0x407a3b);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x2a4655=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x2211b0=>{_0x2211b0['off'](),_0x2a4655();});});}['_getLatestVersionFromServerOperations'](){const _0x19a044=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x381359 of _0x19a044)if('marker'!==_0x381359['type']||_0x381359['affectsData'])return _0x381359['baseVersion']+0x1;}['_getLatestVersion'](){const _0x3faf0a=this['editor']['plugins']['get'](l);return new Promise(_0x286df6=>{_0x3faf0a['_isPendingUpdate']?_0x3faf0a['once']('change:_isPendingUpdate',()=>{_0x286df6(this['_getLatestVersionFromServerOperations']());}):_0x286df6(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x35e0b2,_0x4bfa87){const _0x24c784=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x4bfa87;for(const _0x3fe149 of _0x35e0b2){const _0xef0b7b=_0x24c784['getRevision'](_0x3fe149['id']);if(_0xef0b7b){if((_0x3fe149['fromVersion']||_0x3fe149['toVersion'])&&(_0x3fe149['diffData']=null),_0xef0b7b===this['_revisionTracker']['currentRevision']){const _0x59d813=Math['max'](_0xef0b7b['toVersion'],_0x3fe149['toVersion']),_0x4f48c5=Math['max'](_0xef0b7b['fromVersion'],_0x3fe149['fromVersion']);let _0xedbb0a;_0xef0b7b['toVersion']===_0x3fe149['toVersion']&&_0xef0b7b['fromVersion']===_0x3fe149['fromVersion']?(_0xedbb0a=!0x0,this['_preventResendingRevisionData'](_0x3fe149)):_0x3fe149['toVersion']===_0x59d813&&_0x3fe149['fromVersion']===_0x4f48c5?_0xedbb0a=!0x1:(_0xef0b7b['toVersion']===_0x59d813&&_0xef0b7b['fromVersion']===_0x4f48c5||this['_fixRevision']({'revision':_0xef0b7b,'from':_0x4f48c5,'to':_0x59d813}),_0xedbb0a=!0x0),_0xedbb0a&&(delete _0x3fe149['fromVersion'],delete _0x3fe149['toVersion'],delete _0x3fe149['diffData'],delete _0x3fe149['createdAt'],delete _0x3fe149['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3fe149),this['_preventResendingRevisionData'](_0x3fe149);}else this['_revisionTracker']['addRevisionData'](_0x3fe149);}const _0x35d26b=_0x24c784['getRevisions']();_0x35d26b['reverse']();for(let _0x2aff95=0x0;_0x2aff95<_0x35d26b['length']-0x1;_0x2aff95++){const _0x489e9b=_0x35d26b[_0x2aff95],_0x41d549=_0x35d26b[_0x2aff95+0x1];if(_0x489e9b['fromVersion']<_0x41d549['toVersion']){const _0x4813a5=_0x41d549['toVersion'],_0x4605bb=Math['max'](_0x4813a5,_0x489e9b['toVersion']);this['_fixRevision']({'revision':_0x489e9b,'from':_0x4813a5,'to':_0x4605bb});}}}['_fixRevision']({revision:_0x2a5185,from:_0x57f440,to:_0x44689c}={}){const _0x297f3b=this['editor']['plugins']['get'](_0x29a775),_0x4c76a3=this['_revisionTracker']['buildRevisionData']({'revision':_0x2a5185,'from':_0x57f440,'to':_0x44689c});_0x4c76a3['authors']=_0x4c76a3['authorsIds']['map'](_0x2894e7=>_0x297f3b['getUser'](_0x2894e7)),_0x2a5185['_update'](_0x4c76a3);}['_preventResendingRevisionData'](_0x28651b){const _0x1b8477={};_0x1b8477['id']=_0x28651b['id'];for(const _0x1dd1ba of Object['keys'](_0x28651b))'id'!==_0x1dd1ba&&(_0x1b8477[_0x1dd1ba]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1b8477['id'],_0x1b8477,!0x0);}async['_fetchMissingUsers'](_0x58ec83){const _0x22402c=this['editor']['plugins']['get'](_0x29a775),{connection:_0x117370}=this['editor']['plugins']['get'](n),_0x355c40=new Set();for(const _0x4e3d37 of _0x58ec83){for(const _0x3f8a08 of _0x4e3d37['authorsIds'])_0x59df89(_0x3f8a08);_0x4e3d37['creatorId']&&_0x59df89(_0x4e3d37['creatorId']);}if(0x0===_0x355c40['size'])return;const _0x553d0d=await ut['getMany'](_0x117370,Array['from'](_0x355c40));for(const _0x2cfe88 of _0x553d0d)_0x22402c['getUser'](_0x2cfe88['id'])||_0x22402c['addUser'](_0x2cfe88);function _0x59df89(_0x19685e){_0x22402c['getUser'](_0x19685e)||_0x355c40['add'](_0x19685e);}}}function ot(_0x2b7d51){return _0x2b7d51['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x2b7d51['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2b7d51['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x67d212{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 _0x5afde5{['_collapseAt'];constructor(_0x2eba26,_0x333fde=0x6){super(_0x2eba26);const _0x5a67de=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x333fde,this['bind']('isHidden')['to'](this,'usersCount',_0x5ceed3=>_0x5ceed3<_0x333fde),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x5a67de['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':_0x5a67de['to']('usersCount',_0x15d855=>'+'+(_0x15d855-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x5afde5{['items'];['keystrokes'];constructor(_0xb7927d){super(_0xb7927d);const _0x397ec5=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x444ac9(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x397ec5['if']('hasPopup'),'aria-expanded':_0x397ec5['to']('isExpanded',_0x45215b=>this['hasPopup']&&String(_0x45215b)),'aria-label':_0x397ec5['to']('hasPopup',_0x32641b=>A(_0xb7927d,_0x32641b?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x397ec5['to']('hasPopup',_0x251add=>!!_0x251add&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x397ec5['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x397ec5['to'](_0xf06572=>{const _0x2e1f44=_0xf06572,_0x5b11fa=document['querySelector']('.ck-presence-list__dropdown-list'),_0x5a2b4c=document['querySelector']('.ck-balloon-panel_with-arrow');_0x5b11fa?.['contains'](_0x2e1f44['relatedTarget'])||_0x5a2b4c?.['contains'](_0x2e1f44['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x5c8ac5,_0x341d8f,_0x42a810)=>{this['element']&&(_0x42a810?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 z extends _0x5afde5{['counterView'];['inlineListView'];constructor(_0x7148df,_0x590466=0x6){super(_0x7148df);const _0x467f47=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new B(this['locale'],_0x590466),this['inlineListView']=new is(_0x7148df),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x135794 of this['inlineListView']['items'])_0x135794['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',_0x467f47['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class H extends _0x5afde5{['listWrapperView'];constructor(_0x27ef86,_0x1afa8e){super(_0x27ef86);const _0xe144e=this['bindTemplate'];this['listWrapperView']=new wt(_0x27ef86,_0x1afa8e),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':A(_0x27ef86,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0xe144e['to'](_0x13ecb2=>{const _0x1a98af=_0x13ecb2,_0x2f70be=document['querySelector']('.ck-presence-list__list'),_0xa2f18a=document['querySelector']('.ck-balloon-panel_with-arrow');_0x2f70be?.['contains'](_0x1a98af['relatedTarget'])||_0xa2f18a?.['contains'](_0x1a98af['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x5ee5b8{constructor(_0x63f491,_0xa8187){super(_0x63f491);const _0x3df2f1=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xa8187?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3df2f1['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3df2f1['to']('role'),'aria-label':_0x3df2f1['to']('ariaLabel'),'aria-labelledby':_0x3df2f1['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x390163['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x8430e=this['element'];_0x8430e&&(this['_isScrollable']=Math['max'](_0x8430e['scrollHeight'],_0x8430e['clientHeight'])>0.8*window['innerHeight']);}}class J extends ct{['userView'];constructor(_0x37b0cd,_0x1fe6c7,_0xe1fdaa){super(_0x37b0cd);const _0x372b45=this['bindTemplate'];this['userView']=new at(_0x37b0cd,_0x1fe6c7);const _0x109d72={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x1fe6c7['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x1fe6c7['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1fe6c7['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xe1fdaa&&(_0x109d72['tag']='button',_0x109d72['on']={'click':_0x372b45['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x109d72);}['focus'](){this['element']['focus']();}}class K extends _0x5afde5{['userView'];['markerView'];constructor(_0x1c3ba0,_0x4c158d,_0x11b111){super(_0x1c3ba0);const _0x5adbfe=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new at(_0x1c3ba0,_0x4c158d),this['markerView']=new nt(_0x1c3ba0,_0x4c158d);const _0x2b577f=new lt(_0x1c3ba0);_0x2b577f['template']['tag']='span',_0x2b577f['text']=_0x4c158d['name'];const _0x2633ab={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5adbfe['to']('isFocusable',_0xb662e7=>!!_0xb662e7&&0x0),'aria-labelledby':_0x2b577f['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5adbfe['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5adbfe['to']('hasTooltip',_0x13d4f6=>!_0x13d4f6),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2b577f]};_0x11b111&&(_0x2633ab['tag']='button',_0x2633ab['on']={'click':_0x5adbfe['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2633ab);}}class nt extends _0x5afde5{constructor(_0x59fe00,_0x5753e2){super(_0x59fe00),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5753e2['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const Q={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x488dd2{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x34b646){super(_0x34b646),this['context']['config']['define']('presenceList',Q);const _0x37e2a3=_0x34b646['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x37e2a3)throw new _0x4c05ca('presencelist-collapseat-invalid-format',this);if(_0x37e2a3<0x1)throw new _0x4c05ca('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x588bd5(),this['balloonPanelView']=new _0xf94e11(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x55da6e of this['_allConnectedUsers'])this['_handleUserAdd'](_0x55da6e);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4d7014,_0x9da7bb)=>{this['_handleUserAdd'](_0x9da7bb);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x33d3f0,_0x31f00a)=>{this['_handleUserRemove'](_0x31f00a);});}['_createView'](){const _0x3c10aa=this['context'],_0x36ac84=new z(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x405f76=this['balloonPanelView'];if(!_0x196996(_0x3c10aa['config']['get']('presenceList.container')))throw new _0x4c05ca('presencelist-missing-container',this);return _0x36ac84['counterView']['bind']('usersCount')['to'](this),_0x36ac84['bind']('isCollapsed')['to'](this,'usersCount',_0x3736b3=>{const {collapseAt:_0x3735d9}=_0x3c10aa['config']['get']('presenceList'),_0x2acdc8=_0x3736b3>=_0x3735d9;if(_0x2acdc8&&!_0x36ac84['inlineListView']['items']['find'](_0xe9f78a=>_0xe9f78a instanceof B)){const _0xe16fb4=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0xe16fb4&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x36ac84['inlineListView']['items']['add'](_0x36ac84['counterView']);}return _0x2acdc8||this['hideDropdown'](),_0x2acdc8;}),_0x36ac84['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1b92c7=>{const _0x23cbff=_0x3c10aa['config']['get']('presenceList'),_0x5cc2f9=new K(_0x3c10aa['locale'],_0x1b92c7,!!_0x23cbff['onClick']);return _0x5cc2f9['bind']('hasTooltip')['to'](_0x36ac84,'isCollapsed',_0xf9e8c5=>!_0xf9e8c5),_0x5cc2f9['bind']('isFocusable')['to'](_0x36ac84,'isCollapsed',_0x161d85=>!_0x161d85),_0x23cbff['onClick']&&this['listenTo'](_0x5cc2f9,'execute',()=>{this['view']['isCollapsed']||_0x23cbff['onClick'](_0x1b92c7,_0x5cc2f9['element']);}),_0x5cc2f9;}),this['listenTo'](_0x36ac84['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x36ac84['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x36ac84['inlineListView']['keystrokes']['set']('Enter',(_0x54b463,_0x24c605)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x24c605());}),_0x36ac84['render'](),_0x405f76['render'](),_0x5b5b1d({'emitter':_0x36ac84,'activator':()=>_0x405f76['isVisible'],'contextElements':[_0x405f76['element'],_0x36ac84['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x3c10aa['config']['get']('presenceList.container')['appendChild'](_0x36ac84['element']),this['_bodyCollection']=new _0xe88368(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x36ac84;}['_handleUserAdd'](_0x129c5f){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x129c5f['isMe'])return;const _0x554a25=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x554a25-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x147466=_0x129c5f['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x129c5f,_0x147466);}['_handleUserRemove'](_0x37a5ed){this['usersCount']--;const {collapseAt:_0x3d9b0f}=this['context']['config']['get']('presenceList'),_0x1b8c62=this['usersCount']>=_0x3d9b0f;if(this['currentDisplayedUsers']['get'](_0x37a5ed['id']))this['currentDisplayedUsers']['remove'](_0x37a5ed['id']);else{if(_0x1b8c62&&this['currentDisplayedUsers']['length']+0x1===_0x3d9b0f-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1b8c62?0x1:0x0)<this['usersCount']){for(const _0x25b012 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x25b012['id'])&&(this['currentDisplayedUsers']['add'](_0x25b012,Math['min'](this['currentDisplayedUsers']['length']-(_0x1b8c62?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1b8c62?0x1:0x0)===_0x3d9b0f-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3d2d2f=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new H(this['context']['locale'],!!_0x3d2d2f['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x53f942}=this['presenceDropdownView'];_0x53f942['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5cab75=>{if(!_0x3d2d2f['displayMe']&&_0x5cab75['isMe'])return null;const _0x236c62=new J(this['context']['locale'],_0x5cab75,!!_0x3d2d2f['onClick']);return _0x3d2d2f['onClick']&&this['listenTo'](_0x236c62,'execute',()=>{_0x3d2d2f['onClick'](_0x5cab75,_0x236c62['element']);}),_0x236c62;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x53f942['focus'](),_0x53f942['checkIfScrollable']();const _0x827094=(_0x37087d,_0x306894)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x306894();};_0x53f942['keystrokes']['set']('Esc',_0x827094),_0x53f942['keystrokes']['set']('Shift+Tab',_0x827094),_0x53f942['keystrokes']['set']('Tab',(_0x54d08d,_0x438a42)=>{!function(_0x221c2e){const _0x455da7=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4736a6=>_0x4736a6+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xdf1615=[...document['body']['querySelectorAll'](_0x455da7)]['filter'](_0x34c43e=>_0x34c43e===document['activeElement']||_0x34c43e['offsetWidth']+_0x34c43e['offsetHeight']>0x0)['sort']((_0x29511f,_0x273911)=>(_0x29511f['tabIndex']||0x0)-(_0x273911['tabIndex']||0x0)),_0x139e70=_0xdf1615['indexOf'](_0x221c2e),_0x4fd735=_0xdf1615[(_0x139e70+0x1)%_0xdf1615['length']];_0x4fd735&&_0x4fd735['focus']();}(this['view']['element']),this['hideDropdown'](),_0x438a42();}),_0x53f942['focusTracker']['add'](this['view']['element']),_0x53f942['focusTracker']['on']('change:isFocused',(_0x5611aa,_0x38cb0b,_0x146330)=>{_0x146330||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 vt extends _0x488dd2{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,vt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,pt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','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.':'','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.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','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.':'','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.':''},'getPluralForm':_0x2f083d=>0x1!=_0x2f083d}};
|