@ckeditor/ckeditor5-real-time-collaboration 46.1.1-alpha.3 → 46.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +1 -1
- 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',_0x279f17];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x26a374){super(_0x26a374),this['set']('state',_0x4efd76['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x518146())();}['init'](){const _0xfa2863=this['context'],_0x4d80aa=_0xfa2863['plugins']['get']('CloudServices'),_0x5654b3=_0xfa2863['plugins']['get'](_0x279f17);if(!_0x4d80aa['token'])throw new _0x3a0d6c('websocketgateway-missing-token',this);if(!_0x4d80aa['webSocketUrl'])throw new _0x3a0d6c('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'](_0x4d80aa['token'],_0x4d80aa['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0xd38b95=>{if(this['connection']=_0xd38b95,this['bind']('state')['to'](_0xd38b95,'state',this,'_isBrowserOffline',(_0x522c19,_0x3225d1)=>('connected'!==_0x522c19&&(this['_shouldPluginsReconnect']=!0x0),_0x3225d1||_0x522c19!==_0x4efd76['CONNECTED']?_0x4efd76['DISCONNECTED']:this['state']==_0x4efd76['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x4efd76['CONNECTING']):_0x4efd76['CONNECTED'])),this['connection']['on']('error',(_0x2b9245,_0x19829d)=>{if('limitExceeded'!==_0x19829d['code'])throw console['error'](_0x19829d),new _0x3a0d6c('cloudservices-init',null,{'originalError':_0x19829d});_0x5654b3['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'});}),!_0xd38b95['me'])return new Promise(_0x15da56=>_0xd38b95['on']('change:me',_0x15da56));})['catch'](_0xc2d8b8=>{throw console['error'](_0xc2d8b8),new _0x3a0d6c('cloudservices-init',null,{'originalError':_0xc2d8b8});});}['addToReconnectionStack'](_0x3c8e37){if('function'!=typeof _0x3c8e37['reconnect'])throw new _0x3a0d6c('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3c8e37))throw new _0x3a0d6c('websocketgateway-plugin-already-registered',this,{'name':_0x3c8e37['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3c8e37);}['removeFromReconnectionStack'](_0x1be096){this['_reconnectionStack']['delete'](_0x1be096);}['isInReconnectionStack'](_0x173b28){return this['_reconnectionStack']['has'](_0x173b28);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x3536b1=>_0x3536b1['reconnect']())))['then'](()=>this['state']=_0x4efd76['CONNECTED'])['catch'](_0x449b30=>{throw console['error'](_0x449b30),new _0x3a0d6c('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x4efd76['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x1861c7{['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,_0x393929];}constructor(_0x41c9cc){super(_0x41c9cc),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x4fdafc(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x393929);}['init'](){const _0x26b0f6=this['context']['plugins']['get'](n);this['listenTo'](_0x26b0f6,'change:state',(_0x2ab328,_0x385d2d,_0x199caa)=>{if('connected'!==_0x199caa)this['channelSessions']['forEach'](_0x333c9b=>_0x333c9b['clear']()),this['channelConnectedUsers']['forEach'](_0x547486=>_0x547486['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x56bf85,_0x2b1046]of this['_registeredSessions'])for(const _0x2f2d79 of _0x2b1046)this['_handleSessionAdd'](_0x56bf85,_0x2f2d79);}}),this['_createUser'](_0x26b0f6['connection']['me'],!0x0);}['register'](_0x1b4e32,_0x560240){if(this['_registeredSessions']['has'](_0x1b4e32))throw new _0x3a0d6c('sessions-register-already-registered',null,{'channelId':_0x1b4e32});this['_registeredSessions']['set'](_0x1b4e32,_0x560240),this['channelSessions']['set'](_0x1b4e32,new _0x4fdafc()),this['channelConnectedUsers']['set'](_0x1b4e32,new _0x4fdafc()),this['listenTo'](_0x560240,'add',(_0xdad422,_0x33df42)=>this['_handleSessionAdd'](_0x1b4e32,_0x33df42)),this['listenTo'](_0x560240,'remove',(_0x1c63c0,_0x1d2203)=>this['_handleSessionRemove'](_0x1b4e32,_0x1d2203));for(const _0x30c03f of _0x560240)this['_handleSessionAdd'](_0x1b4e32,_0x30c03f);}['unregister'](_0x37b602){if(!this['_registeredSessions']['has'](_0x37b602))throw new _0x3a0d6c('sessions-unregister-not-exist',null,{'channelId':_0x37b602});const _0x4eaae1=this['_registeredSessions']['get'](_0x37b602);this['stopListening'](_0x4eaae1);for(const _0x4d3d9a of _0x4eaae1)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x37b602,_0x4d3d9a);this['_registeredSessions']['delete'](_0x37b602),this['channelSessions']['delete'](_0x37b602),this['channelConnectedUsers']['delete'](_0x37b602);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x14db0f){for(const _0x5129db of this['channelSessions']['values']())for(const _0x26481f of _0x5129db)if(_0x26481f['id']===_0x14db0f)return _0x26481f['user'];}['getUserSessions'](_0xf7f19d,_0x2b2a26){const _0x4801e7=_0x2b2a26?[this['channelSessions']['get'](_0x2b2a26)]:this['channelSessions']['values'](),_0x55cf5b=new Set();for(const _0x2d8d26 of _0x4801e7)for(const _0x1b785e of _0x2d8d26)_0x1b785e['user']['id']===_0xf7f19d['id']&&_0x55cf5b['add'](_0x1b785e['id']);return _0x55cf5b;}['getUserRole'](_0x5483fc){for(const _0x9358d9 of this['channelSessions']['values']())for(const _0x1d0a07 of _0x9358d9)if(_0x1d0a07['user']===_0x5483fc)return _0x1d0a07['role'];}['_handleSessionAdd'](_0x3de906,_0x2d307f){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3ec79b=_0x2d307f['user'],_0x22dea5=this['_users']['getUser'](_0x3ec79b['id'])||this['_createUser'](_0x3ec79b),_0xdeeb47=Object['assign']({},_0x2d307f,{'user':_0x22dea5});if(this['channelSessions']['get'](_0x3de906)['add'](_0xdeeb47),!_0x3ec79b['hiddenInPresenceList']){const _0x9fa6fd=this['channelConnectedUsers']['get'](_0x3de906);_0x9fa6fd['has'](_0x22dea5['id'])||_0x9fa6fd['add'](_0x22dea5),this['allConnectedUsers']['has'](_0x22dea5['id'])||_0x3ec79b['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x22dea5,_0x22dea5['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x3de906,{'channelId':_0x3de906,'session':_0xdeeb47});}['_handleSessionRemove'](_0x37c710,_0x2079fa){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x2c5656=this['channelConnectedUsers']['get'](_0x37c710),_0x3a51f7=_0x2079fa['user'];_0x3a51f7['id']&&(this['channelSessions']['get'](_0x37c710)['remove'](_0x2079fa['id']),_0x2c5656['has'](_0x3a51f7['id'])&&!this['getUserSessions'](_0x3a51f7,_0x37c710)['size']&&_0x2c5656['remove'](_0x3a51f7['id']),this['allConnectedUsers']['get'](_0x3a51f7['id'])&&!this['getUserSessions'](_0x3a51f7)['size']&&this['allConnectedUsers']['remove'](_0x3a51f7['id']));}['_createUser'](_0x10f68a,_0xcaa9a7){const _0x4f3c38=this['_users']['addUser'](_0x10f68a);return _0xcaa9a7&&this['_users']['defineMe'](_0x10f68a['id']),_0x4f3c38['orderNumber']=this['_uniqueUsersCount']++,_0x4f3c38;}}class H extends _0x5b8bc3{['_domEmitter']=new(_0x518146())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1dd6be=this['editor'],_0x1d2755=_0x1dd6be['plugins']['get'](i);_0x1dd6be['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x54227d,{writer:_0x209df8})=>function(_0x5dc29d,_0x352169,_0x253e96,_0x5ee8b5){const _0x12f585=_0x5dc29d['markerName']['split'](':')[0x2],_0x1ec34b=_0x253e96['getUserBySessionId'](_0x12f585);if(!_0x1ec34b||_0x12f585===_0x253e96['mySessionId'])return;if(!_0x5ee8b5['model']['schema']['checkChild'](_0x5dc29d['markerRange']['start'],'$text'))return;const _0x3bbd42={'class':'ck-user__marker\x20'+_0x1ec34b['color']['getMarkerClass'](),'data-name':_0x1ec34b['name'],'data-session-id':_0x12f585},_0x579f6f=_0x5ee8b5['model']['markers']['get'](_0x5dc29d['markerName']),_0x46ef04=_0x579f6f['getStart'](),_0x32833a=_0x46ef04['nodeAfter'],_0x45988e=_0x5ee8b5['model']['schema'];if(_0x32833a&&_0x45988e['isObject'](_0x32833a)&&_0x45988e['isInline'](_0x32833a)&&!_0x5ee8b5['model']['markers']['get']('user:range:'+_0x12f585)['getRange']()['isCollapsed'])return;const _0x3f744d=_0x46ef04['parent'];return _0x5ee8b5['model']['schema']['isLimit'](_0x3f744d)&&!_0x5ee8b5['model']['hasContent'](_0x3f744d)&&(_0x3bbd42['contenteditable']=!0x1),function(_0x538543,_0x1f24dc,_0x238da4){const _0x592dcd=_0x538543['createUIElement']('span',_0x1f24dc);return _0x538543['setCustomProperty']('userPositionMarker',!0x0,_0x592dcd),_0x592dcd['render']=function(_0x1de785){const _0x12a749=this['toDomElement'](_0x1de785),_0x28abce=document['createElement']('span');return _0x28abce['classList']['add']('ck-user__marker-tooltip'),_0x28abce['setAttribute']('contenteditable','false'),_0x28abce['setAttribute']('spellcheck','false'),_0x28abce['textContent']=_0x238da4['name'],_0x12a749['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x28abce['outerHTML']+'',_0x12a749['addEventListener']('mouseenter',()=>{_0x12a749['classList']['add']('ck-user__marker_hovered');}),_0x12a749['addEventListener']('mouseleave',()=>{_0x12a749['classList']['remove']('ck-user__marker_hovered');}),_0x12a749;},_0x592dcd['isSimilar']=function(_0x38f091){return!(!this['getCustomProperty']('userPositionMarker')||!_0x38f091['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x38f091['getAttribute']('data-session-id'));},_0x592dcd;}(_0x352169,_0x3bbd42,_0x1ec34b);}(_0x54227d,_0x209df8,_0x1d2755,_0x1dd6be)}),_0x1dd6be['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x2f3a3f=>function(_0x27f3dd,_0xb90ba4){const _0xd0368f=_0x27f3dd['markerName']['split'](':')[0x2];if(_0xd0368f===_0xb90ba4['mySessionId'])return null;const _0x45e03e=_0xb90ba4['getUserBySessionId'](_0xd0368f);if(!_0x45e03e)return{'id':_0xd0368f,'classes':[]};return{'id':_0xd0368f,'classes':['ck-user__selection',_0x45e03e['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xd0368f},'priority':0x7d0+_0x45e03e['orderNumber']};}(_0x2f3a3f,_0x1d2755)}),function(_0x38836c){const _0x3f5983=_0x38836c['model'],_0x40f13a=new Map(),_0x222ed0=_0x38836c['plugins']['get'](i);_0x3f5983['markers']['on']('update:user:range',(_0x21317d,_0x26d263,_0x5e9a33,_0x398f13)=>{if(!_0x398f13&&_0x40f13a['get'](_0x26d263['name']))return _0x40f13a['get'](_0x26d263['name'])['detach'](),void _0x40f13a['delete'](_0x26d263['name']);const _0x254218=_0x26d263['name']['split'](':')[0x2];if(_0x254218===_0x222ed0['mySessionId'])return;const _0x5e165c='user:position:'+_0x254218;_0x3f5983['markers']['has'](_0x5e165c)&&_0x38836c['editing']['reconvertMarker'](_0x5e165c),_0x26d263['on']('change:range',(_0x181312,_0x4b53f4,_0x1027e4)=>{if('$graveyard'!=_0x4b53f4['root']['rootName']&&'$graveyard'==_0x26d263['getRange']()['root']['rootName']&&!_0x40f13a['has'](_0x26d263['name'])){const _0x43113a=_0x3f5983['schema']['getNearestSelectionRange'](_0x1027e4['deletionPosition']);if(_0x43113a){const _0xaa2c6d=_0x4e36b4['fromRange'](_0x43113a);_0x40f13a['set'](_0x26d263['name'],_0xaa2c6d),_0xaa2c6d['on']('change:range',(_0x5059be,_0x4ee07b,_0x15033e)=>{if('$graveyard'==_0xaa2c6d['root']['rootName']){const _0x280b38=_0x3f5983['schema']['getNearestSelectionRange'](_0x15033e['deletionPosition']);_0x280b38?(_0xaa2c6d['start']=_0x280b38['start'],_0xaa2c6d['end']=_0x280b38['end']):(_0x40f13a['delete'](_0x26d263['name']),_0xaa2c6d['detach']());}});}}});}),_0x3f5983['document']['on']('change',()=>{_0x40f13a['size']>0x0&&_0x3f5983['enqueueChange']({'isUndoable':!0x1},_0x441432=>{for(const [_0x908984,_0x44c373]of _0x40f13a)'$graveyard'==_0x3f5983['markers']['get'](_0x908984)['getRange']()['root']['rootName']&&(Y(_0x908984['split'](':')[0x2],_0x44c373['toRange'](),_0x3f5983,_0x441432),_0x44c373['detach']());_0x40f13a['clear']();});});}(_0x1dd6be),this['_domEmitter']['listenTo'](_0x21a1a4['document'],'keydown',(_0x18c0e2,{key:_0x595c14})=>{'Escape'===_0x595c14&&function(_0x4b771d){_0x4b771d['editing']['view']['change'](_0x1b4520=>{for(const _0x1df797 of _0x4b771d['model']['markers']){if(!_0x1df797['name']['startsWith']('user:position'))continue;const _0xf6a703=_0x4b771d['editing']['mapper']['markerNameToElements'](_0x1df797['name']);if(_0xf6a703){for(const _0x5875b3 of _0xf6a703)_0x1b4520['removeClass']('ck-user__marker_hovered',_0x5875b3);}}});}(_0x1dd6be);},{'useCapture':!0x0});}['afterInit'](){const _0x23fd6b=this['editor'],_0x156686=_0x23fd6b['commands']['get']('undo');_0x156686&&_0x23fd6b['model']['on']('applyOperation',(_0x5dbea0,_0x54ccae)=>{const _0x39f63f=_0x54ccae[0x0];if(!_0x39f63f['isDocumentOperation'])return;if('marker'!=_0x39f63f['type']||!_0x39f63f['name']['startsWith']('user:'))return;const _0xaf84d9=_0x39f63f['batch'];_0x156686['_createdBatches']['has'](_0xaf84d9)&&(_0x39f63f['newRange']=_0x39f63f['oldRange']?_0x23fd6b['model']['createRange'](_0x39f63f['oldRange']['start'],_0x39f63f['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0xd00784=this['editor'],_0x5bb8c9=_0xd00784['model']['document'],_0x2a74a7=_0xd00784['plugins']['get'](i);_0xd00784['model']['enqueueChange']({'isUndoable':!0x1},_0x416a6d=>{const _0x510b74='user:range:'+_0x2a74a7['mySessionId'],_0x32f1eb='user:position:'+_0x2a74a7['mySessionId'],_0x4ff0ab=_0xd00784['model']['markers']['has'](_0x510b74);_0xd00784['editing']['view']['hasDomSelection']?Y(_0x2a74a7['mySessionId'],_0x5bb8c9['selection']['getFirstRange'](),_0xd00784['model'],_0x416a6d):_0x4ff0ab&&(_0x416a6d['removeMarker'](_0x510b74),_0x416a6d['removeMarker'](_0x32f1eb));});}}function Y(_0x3c2e14,_0x499c51,_0x2a3f87,_0xe8a2e9){const _0x404fb7='user:range:'+_0x3c2e14,_0x707498='user:position:'+_0x3c2e14,_0x429be5=_0x499c51['getContainedElement']();let _0x29cb48=_0x499c51['start'];if(_0x429be5&&_0x429be5['is']('element','tableCell')){const _0x57b77c=function(_0x3eecc5,_0x556e48){for(const _0x19a6fb of _0x3eecc5['getPositions']())if(_0x556e48['schema']['checkChild'](_0x19a6fb,'$text'))return _0x19a6fb;}(_0x499c51,_0x2a3f87);_0x57b77c&&(_0x29cb48=_0x57b77c,_0x499c51=_0xe8a2e9['createRange'](_0x29cb48));}const _0x3782c6=_0xe8a2e9['createRange'](_0x29cb48);_0x2a3f87['markers']['has'](_0x404fb7)?(_0xe8a2e9['updateMarker'](_0x404fb7,{'range':_0x499c51}),_0xe8a2e9['updateMarker'](_0x707498,{'range':_0x3782c6})):(_0xe8a2e9['addMarker'](_0x404fb7,{'range':_0x499c51,'usingOperation':!0x0}),_0xe8a2e9['addMarker'](_0x707498,{'range':_0x3782c6,'usingOperation':!0x0}));}function V(_0x5a6b0f,_0x5ac88c,_0x25000f){const _0x4f27cc=_0x5a6b0f['t'],t=_0x5a6b0f['t'];switch(_0x5ac88c){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 _0x4f27cc({'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'},_0x25000f);default:return'';}}let q=0x1;class l extends _0x5b8bc3{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x3aabc8)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,H,_0x5790b1,_0x393929,_0x279f17];}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 _0x3429f5=this['serverHistory']['getOperations']();for(let _0x21dd6b=_0x3429f5['length']-0x1;_0x21dd6b>=0x0;_0x21dd6b--){const _0x398558=_0x3429f5[_0x21dd6b];if(!this['_disconnectionOperations']['has'](_0x398558))return _0x398558['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2c1792){if(super(_0x2c1792),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x25b8ea(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3a0d6c('collaboration-missing-channelid',this);const _0x178613=_0x2c1792['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x178613,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x136efe(),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 K(this['_disconnectionOperations']);}['init'](){const _0xbae3a=this['editor'],_0x48bbe8=_0xbae3a['plugins']['get'](_0x393929),_0x5f1ce4=_0xbae3a['plugins']['get'](n);this['listenTo'](_0x48bbe8,'getOperationAuthor',(_0x4fd98a,_0x5f2b74)=>{const _0x4bf7d8=_0x5f2b74[0x0];_0x4bf7d8['_authorId']&&(_0x4fd98a['return']=_0x48bbe8['getUser'](_0x4bf7d8['_authorId']),_0x4fd98a['stop']()),null===_0x4bf7d8['_authorId']&&(_0x4fd98a['return']=null,_0x4fd98a['stop']());},{'priority':'high'}),this['listenTo'](_0xbae3a['model']['document']['selection'],'change:range',(_0x5cadd6,_0x1e9f24)=>{_0x1e9f24['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0xbae3a['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0xbae3a['model']['on']('applyOperation',(_0x5b5eda,_0x20c6b3)=>{const _0x5a3ba0=_0x20c6b3[0x0];_0x5a3ba0['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x5a3ba0),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5f1ce4,'state',this,'_hasSynchronizationProblem',(_0x44d137,_0x26ac06)=>'connected'===_0x44d137&&!_0x26ac06),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0xbae3a['disableReadOnlyMode']('rtc-offline'):_0xbae3a['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0xbae3a['disableReadOnlyMode']('rtc-offline'):_0xbae3a['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x17484d=this['editor']['plugins']['get'](i),_0x56e7fd=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x17484d['unregister'](this['_channelId']);const _0x54b0b1=await this['_service']['reconnect'](_0x56e7fd['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x54b0b1)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4b3b06=await this['_service']['getConnectedSessions']();_0x17484d['register'](this['_channelId'],_0x4b3b06),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x5c40ed){if(function(_0x10abb3){return'404'===_0x10abb3['code'];}(_0x5c40ed)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5669d7){return'409'===_0x5669d7['code'];}(_0x5c40ed)){const _0x30828a=V(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'](_0x30828a);}else{if(!(_0x5c40ed instanceof G))throw _0x5c40ed;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1bd1f5=this['editor']['plugins']['get'](n),_0x533a0a=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x533a0a['channelSessions']['has'](this['_channelId'])&&_0x533a0a['unregister'](this['_channelId']),_0x1bd1f5['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x2d8825){if(this['sessionId']!==_0x2d8825['sessionId']&&this['_lastSyncedOperationId']!==_0x2d8825['lastOperationId'])throw new G();return this['sessionId']=_0x2d8825['sessionId'],this['_handleServerResponse']([],{..._0x2d8825,'wereChangesApplied':!0x1,'data':_0x2d8825['data']},'reconnect');}async['_connectService'](_0x3e8cf8,_0x20b5e0=!0x1){const {connection:_0x2ef280}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x2ef280,this['_channelId'])['then'](_0x286b98=>this['_initSessionsHandling'](_0x286b98))['catch'](_0xa60b67=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0xa60b67);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x21f28f,_0x351415)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x351415);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x42347b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3e8cf8);this['_isPendingUpdate']=!0x0;const _0x124419=await this['_service']['connect'](_0x2ef280,this['_compressOperations'](_0x3e8cf8),_0x42347b);if(this['sessionId']=_0x124419['sessionId'],_0x20b5e0){if(!_0x124419['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x124419['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3e8cf8,_0x124419,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x124419,_0x3e8cf8);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0xb00a37=this['editor']['plugins']['get'](i),_0x169043=this['editor']['plugins']['get'](H),_0x48740a=_0xb00a37['channelSessions']['get'](this['_channelId']);_0x48740a&&_0x48740a['length']>0x1?_0x169043['createUserMarkerOperations']():this['listenTo'](_0xb00a37,'sessionAdd:'+this['_channelId'],()=>{0x2===_0xb00a37['channelSessions']['get'](this['_channelId'])['length']&&_0x169043['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x16ea04,_0x3f5285,_0x39415f,_0x44aff3){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3f5285){const _0x1de6d9=this['_decompressOperations'](_0x39415f,_0x44aff3);await this['_fetchMissingUsers'](_0x1de6d9),this['_handleExternalOperations'](_0x1de6d9,_0x3f5285,_0x39415f['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x18a38a}=this['editor'];let _0x2d29c0;try{_0x2d29c0=await this['_service']['getDocumentDetails']();}catch{const _0x46f112=V(_0x18a38a,'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'](_0x46f112);}const _0x1d9e1c=_0x2d29c0['currentDocumentSession']||_0x2d29c0['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x1d9e1c['lastOperationId']){const _0x5afa94=V(_0x18a38a,'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'](_0x5afa94);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x124490){const _0x2ff047=this['editor']['plugins']['get'](i);this['listenTo'](_0x2ff047,'sessionAdd:'+this['_channelId'],(_0x483004,{session:_0x1d8166})=>{if(_0x1d8166['id']===_0x2ff047['mySessionId']){_0x483004['off']();const _0x4f366e=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4cbadf=_0x1d8166['permissions'];_0x4f366e&&_0x4f366e['isEnabled']&&(_0x4cbadf=_0x4cbadf['filter'](_0x19df04=>'document:write'!==_0x19df04)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4cbadf,this['_channelId']);}}),_0x2ff047['register'](this['_channelId'],_0x124490);}['_initThrowingOnDataSet'](){const _0x168b12=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x27568f)=>{if(!_0x27568f[_0x27568f['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3a0d6c('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x168b12['apply'](this['editor']['data'],_0x27568f);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x974b00,[_0x8dd10c])=>{if(this['_document']['version'])throw new _0x3a0d6c('realtimecollaborationclient-init-document-already-initialized',this);_0x974b00['stop'](),this['_setPendingAction']();const _0x9e600f=this['editor']['config']['get']('rootsAttributes'),_0x1cd819=this['_getOperationsFromInitData'](_0x8dd10c,_0x9e600f);0x0==_0x1cd819['length']&&_0x1cd819['push'](new _0x29156a(0x0)),_0x974b00['return']=this['_connectService'](_0x1cd819)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x28bf9e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x28bf9e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1a3394,[_0x3525d7,_0x46a06c])=>{_0x1a3394['stop']();const _0x207efa=this['editor']['model']['document']['getRoot'](_0x3525d7);if(!this['_knownRootNames']['has'](_0x3525d7)){const _0x4b2b1e=_0x46a06c&&_0x46a06c['data']?_0x46a06c['data']:'',_0x14dbd8=_0x46a06c&&_0x46a06c['attributes']?_0x46a06c['attributes']:{};await this['_loadRoot'](_0x3525d7,_0x4b2b1e,_0x14dbd8);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x207efa['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x207efa);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x1f9132){const _0x2d2d77=this['editor']['plugins']['get'](_0x393929),{connection:_0x106ff6}=this['editor']['plugins']['get'](n),_0x13d24c=new Set();for(const _0x19ea4a of _0x1f9132){const _0x3b9ea9=_0x19ea4a['_authorId'];_0x3b9ea9&&!_0x2d2d77['getUser'](_0x3b9ea9)&&_0x13d24c['add'](_0x3b9ea9);}if(0x0===_0x13d24c['size'])return;const _0x3bdb35=await ut['getMany'](_0x106ff6,Array['from'](_0x13d24c));for(const _0x3885d0 of _0x3bdb35)_0x2d2d77['getUser'](_0x3885d0['id'])||_0x2d2d77['addUser'](_0x3885d0);}['_getOperationsFromInitData'](_0xa76647,_0x13057={}){const _0x252bd3=this['editor']['model'],_0x67a7b6=[];let _0x37e34b=0x0;const _0x4a26b3='string'==typeof _0xa76647?{'main':_0xa76647}:_0xa76647;for(const _0x2c6618 of Object['keys'](_0x4a26b3)){if(!this['_document']['roots']['has'](_0x2c6618))throw new _0x3a0d6c('realtimecollaborationclient-init-non-existent-root',this);const _0x3e1836=this['editor']['data']['parse'](_0x4a26b3[_0x2c6618]),_0x59deb5=this['_document']['getRoot'](_0x2c6618),_0x225b53=new _0xdb4287(_0x252bd3['createPositionAt'](_0x59deb5,0x0),_0x3e1836,_0x37e34b++);_0x67a7b6['push'](_0x225b53);for(const [_0x6a19dd,_0x4f249c]of _0x3e1836['markers']){const _0x41150a=_0x252bd3['createRange'](_0x252bd3['createPositionFromPath'](_0x59deb5,_0x4f249c['start']['path']['slice']()),_0x252bd3['createPositionFromPath'](_0x59deb5,_0x4f249c['end']['path']['slice']())),_0x5845cc=new _0x3f9087(_0x6a19dd,null,_0x41150a,_0x252bd3['markers'],!0x0,_0x37e34b++);_0x67a7b6['push'](_0x5845cc);}}if(_0x13057)for(const [_0x5f3ba8,_0x4a2974]of Object['entries'](_0x13057)){const _0x294433=_0x252bd3['document']['getRoot'](_0x5f3ba8);if(!_0x294433)throw new _0x3a0d6c('multi-root-editor-root-attributes-no-root',null);for(const [_0x30de48,_0x3c7054]of Object['entries'](_0x4a2974))if(null!==_0x3c7054){const _0x176580=new _0x447550(_0x294433,_0x30de48,null,_0x3c7054,_0x37e34b++);_0x67a7b6['push'](_0x176580);}}return _0x67a7b6;}async['_loadRoot'](_0x2435c7,_0x275fc9,_0x258a30){this['_getOperationsFromInitData']({[_0x2435c7]:_0x275fc9},{[_0x2435c7]:_0x258a30})['forEach']((_0x260e24,_0x5b1247)=>{_0x260e24['baseVersion']=this['_document']['version']+_0x5b1247,_0x260e24['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x260e24);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x339407,_0x2e81e8){let _0x322a04;this['_offset']=_0x339407['offset'];const _0x2b4f58=_0x339407['wereChangesApplied']&&!_0x339407['initData'],_0x377200=_0x2b4f58?0x0:_0x339407['data']['baseVersion'];if(_0x2e81e8['forEach'](_0xce4423=>{_0xce4423['_isInit']=!0x0,_0xce4423['createdAt']=_0x339407['sessionCreatedAt'],_0xce4423['_authorId']=null;}),_0x2b4f58)_0x322a04=_0x2e81e8,this['_applyOperationsSet'](_0x322a04,_0x2b4f58);else{if(_0x339407['initData']){const _0x421cc0=this['_getOperationsFromInitData'](_0x339407['initData']);this['_document']['history']['version']=-_0x421cc0['length'],_0x421cc0['forEach'](_0x2bb657=>{_0x2bb657['baseVersion']-=_0x421cc0['length'],_0x2bb657['createdAt']=_0x339407['sessionCreatedAt'],_0x2bb657['_isInit']=!0x0,_0x2bb657['_authorId']=null;}),this['_applyOperationsSet'](_0x421cc0,!0x0),this['serverHistory']['version']=-_0x421cc0['length']+this['_offset'],this['_updateServerHistory'](_0x421cc0);}this['_document']['history']['version']=_0x377200,_0x322a04=this['_decompressOperations'](_0x339407['data'],_0x339407['metadata']),await this['_fetchMissingUsers'](_0x322a04),this['_applyOperationsSet'](_0x322a04,_0x2b4f58);}_0x339407['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x322a04,_0x339407['lastOperationId']),this['_lastSyncedOperationId']=_0x339407['lastOperationId']),this['serverHistory']['version']=_0x377200+this['_offset'],this['_updateServerHistory'](_0x322a04),_0x2e81e8['filter'](_0x24bde3=>{const _0x7a1a55=this['_getAffectedRoot'](_0x24bde3);return _0x7a1a55&&!this['_knownRootNames']['has'](_0x7a1a55);})['forEach']((_0x47a8b6,_0x427ea6)=>{_0x47a8b6['baseVersion']=this['_document']['version']+_0x427ea6,this['_saveOperationInBuffer'](_0x47a8b6);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x5d55ff,_0x3c72ab){const _0x53c681=_0x3c72ab&&_0x3c72ab['message'];if(_0x53c681&&_0x53c681['startsWith']('realtimecollaborationclient'))throw _0x3c72ab;const _0x2fdb49=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x2fdb49['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3a0d6c(_0x5d55ff,this['editor'],_0x53c681?{'originalError':_0x53c681}:void 0x0);}['_saveOperationInBuffer'](_0x15750e){this['_knownOperations']['has'](_0x15750e)||(this['_knownOperations']['add'](_0x15750e),this['_bufferedOperations']['push'](_0x15750e),this['_pendingAction']||'marker'==_0x15750e['type']&&!_0x15750e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x27871e=!0x1){!_0x27871e&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3e304b=>{_0x3e304b&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2a8b8c=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x11c406){return _0x11c406['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x11c406['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x11c406['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2a8b8c)||this['_crash'](_0x2a8b8c['message'],_0x2a8b8c);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x89f755=>{this['on']('change:_isPendingUpdate',()=>{_0x89f755();});});}async['_sendBufferedOperations'](){const _0x33071b=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x33071b['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x4ca573=[...this['_bufferedOperations']];for(const _0x3d5c57 of _0x4ca573)_0x3d5c57['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3d5c57);const _0x40a453=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4ca573),_0x2ad9b5=q++,_0x1db153=this['_compressOperations'](_0x4ca573),_0xa92398=await this['_service']['sendOperations'](_0x1db153,_0x1db153['baseVersion'],_0x40a453);try{return await this['_handleServerResponse'](_0x4ca573,_0xa92398,_0x2ad9b5);}catch(_0x4700c9){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4700c9);}}async['_handleServerResponse'](_0x135b01,_0x6d5942,_0x10182b){if('error'in _0x6d5942)throw _0x6d5942['error'];let _0x46866c=!0x1;if(_0x6d5942['wereChangesApplied']){_0x6d5942['lastOperationId']&&(this['_lastSyncedOperationId']=_0x6d5942['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1aa4a2=>!_0x135b01['includes'](_0x1aa4a2));for(const _0x10de64 of _0x135b01)_0x10de64['createdAt']='lastOperationAcceptedAt'in _0x6d5942&&_0x6d5942['lastOperationAcceptedAt']||void 0x0;$(_0x135b01,_0x6d5942['version']-_0x135b01['length']),this['_updateServerHistory'](_0x135b01);const _0x160049=_0x135b01['filter'](_0x19e9ae=>{if(!_0x19e9ae['_isInit'])return!0x1;const _0x579152=this['_getAffectedRoot'](_0x19e9ae);return _0x579152&&!this['_knownRootNames']['has'](_0x579152);});$(_0x160049,this['_document']['version']),this['_applyOperationsSet'](_0x160049),_0x46866c=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x566f19=this['_decompressOperations'](_0x6d5942['data'],_0x6d5942['metadata'])['filter'](_0x1a4e02=>_0x1a4e02['baseVersion']>=this['_lastServerVersion']);_0x566f19['forEach'](_0x11ff57=>this['_addKnownRoot'](_0x11ff57)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x52b65d=>!_0x52b65d['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x52b65d))),this['_bufferedOperations']['length']&&$(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x566f19),_0x46866c=this['_handleExternalOperations'](_0x566f19,_0x6d5942['version'],_0x6d5942['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x46866c?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x479dc9,_0x137bf7,_0x59ef3b){try{const _0x19c834={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x552164,operationsB:_0x351fe2,originalOperations:_0x23cc8b}=_0x4b0c2e(_0x479dc9,this['_bufferedOperations'],_0x19c834);$(_0x552164,this['_document']['version']),$(_0x351fe2,_0x137bf7);for(const _0x2caa92 of _0x552164){const _0x3b5701=_0x23cc8b['get'](_0x2caa92);_0x2caa92['_authorId']=_0x3b5701?_0x3b5701['_authorId']:null;}_0x59ef3b&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x479dc9,_0x59ef3b),this['_lastSyncedOperationId']=_0x59ef3b),this['_bufferedOperations']=[..._0x351fe2],this['_applyOperationsSet'](_0x552164),this['_updateServerHistory'](_0x479dc9);}catch(_0x2cc9ec){return console['error'](_0x2cc9ec),!0x1;}return!0x0;}['_applyOperationsSet'](_0x49f51f,_0x4300d3=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x405cc5=>{for(const _0x5a6efb of _0x49f51f)this['_knownOperations']['add'](_0x5a6efb),this['_addKnownRoot'](_0x5a6efb),_0x405cc5['batch']['addOperation'](_0x5a6efb),this['editor']['model']['applyOperation'](_0x5a6efb);});}['_addKnownRoot'](_0x4f6c3b){const _0x310171=this['_getAffectedRoot'](_0x4f6c3b);_0x310171&&this['_knownRootNames']['add'](_0x310171);}['_getAffectedRoot'](_0x3d396f){let _0x38e6f8,_0x579114;switch(_0x3d396f['type']){case'insert':_0x38e6f8=_0x3d396f['position']['root'];break;case'marker':if(_0x579114=_0x3d396f['newRange'],!_0x579114)return null;_0x38e6f8=_0x579114['root'];break;case'addRootAttribute':_0x38e6f8=_0x3d396f['root'];break;case'addRoot':_0x38e6f8=_0x3d396f['affectedSelectable'];break;case'move':_0x38e6f8=_0x3d396f['targetPosition']['root'];break;default:return null;}return _0x38e6f8['rootName'];}['_updateServerHistory'](_0x58f7d4){_0x58f7d4['forEach'](_0x2df677=>{const _0x200d48=_0x2df677['clone']();_0x200d48['_authorId']=_0x2df677['_authorId'],_0x200d48['_isInit']=!!_0x2df677['_isInit'],_0x200d48['createdAt']=_0x2df677['createdAt'],_0x200d48['baseVersion']+=this['_offset'],_0x2df677['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x200d48),this['serverHistory']['addOperation'](_0x200d48);});}['_handleReconnectionError'](_0x5ad368){const _0x5120e5=this['editor']['plugins']['get']('Notification'),_0x35b5c8=this['editor']['locale'];_0x5ad368||(_0x5ad368=V(_0x35b5c8,'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.')),_0x5120e5['showWarning'](_0x5ad368,{'title':V(_0x35b5c8,'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'](_0x5790b1)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x5790b1)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x8677e4){const _0x1bbe3f=_0x8677e4['map'](_0x40ff21=>_0x40ff21['toJSON']());return this['_compressor']['compress'](_0x1bbe3f);}['_decompressOperations'](_0x3b9edf,_0x43f636){return this['_compressor']['decompress'](_0x3b9edf)['map']((_0x10aa81,_0xf21710)=>{const _0x5e0734='init'==_0x43f636[_0xf21710]['type'];if('InsertOperation'==_0x10aa81['__className']){const _0x40af95=_0x10aa81['position']['root'];!this['_document']['getRoot'](_0x40af95)&&(this['_document']['createRoot']('$root',_0x40af95)['_isAttached']=!0x1);}const _0xcc715=_0xc90b3d['fromJSON'](_0x10aa81,this['_document']);return _0xcc715['wasUndone']=_0x10aa81['wasUndone'],_0xcc715['_isInit']=_0x5e0734,_0xcc715['_authorId']=_0x5e0734?null:_0x43f636[_0xf21710]['userId'],_0xcc715['_isDisconnection']='cs:removeUser'===_0x43f636[_0xf21710]['type'],_0xcc715['createdAt']=_0x43f636[_0xf21710]['createdAt'],_0xcc715;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x242d1d=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x242d1d&&_0x242d1d['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class G extends Error{}function $(_0x111fb4,_0x2bfee8){for(const _0x20488a of _0x111fb4)_0x20488a['baseVersion']=_0x2bfee8++;}class K{['_ignoredOperations'];['_operationToId'];constructor(_0x3a321e){this['_ignoredOperations']=_0x3a321e,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4b6e65){let _0x6f8f25=_0x4b6e65['length'];for(;_0x6f8f25--;){const _0x59a286=_0x4b6e65[_0x6f8f25];if(!this['_ignoredOperations']['has'](_0x59a286)){if(!this['_operationToId']['has'](_0x59a286)){const _0x516d8c=_0xc6304d()['slice'](0x1,0x12);this['_operationToId']['set'](_0x59a286,_0x516d8c);}return this['_operationToId']['get'](_0x59a286);}}}['setIdForTheLastOperation'](_0xcd5476,_0x5e2bfb){if(!_0x5e2bfb)return;let _0x22bc29=_0xcd5476['length'];for(;_0x22bc29--;){const _0x318317=_0xcd5476[_0x22bc29];this['_ignoredOperations']['has'](_0x318317)||this['_operationToId']['set'](_0x318317,_0x5e2bfb);}}}class a extends _0x5b8bc3{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x1861c7{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>et)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x393929];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2aaaab){super(_0x2aaaab),this['_services']=new Map();}async['init'](){const _0x1b17c8=this['context'],_0x485900=_0x1b17c8['plugins']['get']('CommentsRepository');if(_0x1b17c8['plugins']['get'](n)['addToReconnectionStack'](this),_0x485900['adapter']={'addCommentThread':async({channelId:_0x456cf3,threadId:_0x599765,comments:_0x379e3b,resolvedAt:_0x5d8da7,resolvedBy:_0x22c909,context:_0x4ce753,attributes:_0x1754bc})=>{const _0x448cb8=await this['_getService'](_0x456cf3)['addCommentThread']({'commentThreadId':_0x599765,'comments':_0x379e3b['map'](_0x53ef1d=>function(_0x41257d,_0x9530b2,_0x31400c){return{'commentThreadId':_0x31400c,'commentId':_0x41257d['commentId'],'userId':_0x41257d['authorId'],'content':_0x41257d['content'],'documentId':_0x9530b2,'createdAt':_0x41257d['createdAt'],'attributes':_0x41257d['attributes']||{}};}(_0x53ef1d,_0x456cf3,_0x599765)),'resolvedAt':_0x5d8da7,'resolvedBy':_0x22c909,'context':_0x4ce753,'attributes':_0x1754bc})['catch'](ft);return{'threadId':_0x448cb8['commentThreadId'],'comments':_0x448cb8['comments']};},'getCommentThread':async({channelId:_0x1b806d,threadId:_0x563313})=>{const _0x12fb5f=await this['_getService'](_0x1b806d)['getCommentThread'](_0x563313)['catch'](ot)['catch'](ft);return _0x12fb5f?_0x12fb5f['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x12fb5f]),{'threadId':_0x12fb5f['commentThreadId'],'comments':_0x12fb5f['comments']['map'](st),'context':_0x12fb5f['context'],'resolvedAt':_0x12fb5f['resolvedAt'],'resolvedBy':_0x12fb5f['resolvedBy'],'attributes':_0x12fb5f['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x5cb583,threadId:_0x498458,context:_0x12cc5c,unlinkedAt:_0x3e9662,attributes:_0x522bf6})=>this['_getService'](_0x5cb583)['updateCommentThread']({'commentThreadId':_0x498458,'context':_0x12cc5c,'attributes':_0x522bf6,'unlinkedAt':_0x3e9662})['catch'](ot)['catch'](ft),'resolveCommentThread':async({channelId:_0x276d78,threadId:_0x539b81})=>{const _0x10e3fd=await this['_getService'](_0x276d78)['resolveCommentThread'](_0x539b81)['catch'](ot)['catch'](ft);return{'threadId':_0x10e3fd['commentThreadId'],'resolvedAt':_0x10e3fd['resolvedAt'],'resolvedBy':_0x10e3fd['resolvedBy']};},'reopenCommentThread':async({channelId:_0x53bbb6,threadId:_0x152a3c})=>this['_getService'](_0x53bbb6)['reopenCommentThread'](_0x152a3c)['catch'](ot)['catch'](ft),'removeCommentThread':({channelId:_0x4ecfe3,threadId:_0x294c6a})=>this['_getService'](_0x4ecfe3)['removeCommentThread'](_0x294c6a)['catch'](ot)['catch'](ft),'addComment':({channelId:_0x47e103,threadId:_0x2f142e,commentId:_0x404b41,content:_0x5452a6,attributes:_0x5e2936})=>this['_getService'](_0x47e103)['addComment'](_0x2f142e,_0x404b41,_0x5452a6,_0x5e2936)['catch'](ft),'updateComment':({channelId:_0x5ecbb6,threadId:_0x28191b,commentId:_0x1cfa10,content:_0x5e4fea,attributes:_0x2b4f28})=>this['_getService'](_0x5ecbb6)['updateComment'](_0x28191b,_0x1cfa10,_0x5e4fea,_0x2b4f28)['catch'](ot)['catch'](ft),'removeComment':({channelId:_0x47bcda,threadId:_0x3fee26,commentId:_0x1a7137})=>this['_getService'](_0x47bcda)['removeComment'](_0x3fee26,_0x1a7137)['catch'](ot)['catch'](ft)},_0x1b17c8 instanceof tt){const _0x4eaf01=_0x1b17c8['config']['get']('collaboration.channelId'),_0x2de68b=_0x1b17c8['plugins']['get'](i);await this['_setUpService'](_0x4eaf01);const _0x7c6de9=await this['_services']['get'](_0x4eaf01)['getConnectedSessions']();this['listenTo'](_0x2de68b,'sessionAdd:'+_0x4eaf01,(_0x1f9f75,{session:_0x20bb7e})=>{_0x20bb7e['id']===_0x2de68b['mySessionId']&&(_0x1f9f75['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x20bb7e['permissions'],_0x4eaf01));}),_0x2de68b['register'](_0x4eaf01,_0x7c6de9);}}async['_setUpService'](_0x514692){if(this['_services']['has'](_0x514692))throw new _0x3a0d6c('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x514692});const _0x2ab89b=this['context']['plugins']['get']('CommentsRepository'),_0x54d6c2=new s['CommentsService'](_0x514692);this['_services']['set'](_0x514692,_0x54d6c2),this['listenTo'](_0x54d6c2,'commentThreadAdded',(_0x10ea44,_0x30fff8)=>{const {commentThreadId:_0x19cf29,documentId:_0x3fb70a,context:_0x486bdb,attributes:_0x17821b,resolvedAt:_0x198ff6,resolvedBy:_0x3b1b26,comments:_0x284f5a}=_0x30fff8;_0x2ab89b['getCommentThread'](_0x19cf29)||_0x2ab89b['addCommentThread']({'threadId':_0x19cf29,'channelId':_0x3fb70a,'comments':_0x284f5a?_0x284f5a['map'](st):[],'context':_0x486bdb,'attributes':_0x17821b,'resolvedAt':_0x198ff6,'resolvedBy':_0x3b1b26,'isFromAdapter':!0x0});}),this['listenTo'](_0x54d6c2,'commentThreadUpdated',(_0x39d4eb,{commentThreadId:_0x5910da,documentId:_0x5144a1,context:_0x5650f5,unlinkedAt:_0x1a4799,attributes:_0x59e1c7})=>{_0x2ab89b['getCommentThread'](_0x5910da)&&_0x2ab89b['updateCommentThread']({'threadId':_0x5910da,'channelId':_0x5144a1,'context':_0x5650f5,'unlinkedAt':_0x1a4799,'attributes':_0x59e1c7,'isFromAdapter':!0x0});}),this['listenTo'](_0x54d6c2,'commentThreadResolved',(_0x1f7c3d,{commentThreadId:_0xcc7c15,resolvedBy:_0x39b964,resolvedAt:_0x1d13de})=>{const _0x4369fb=_0x2ab89b['getCommentThread'](_0xcc7c15);_0x4369fb&&_0x4369fb['resolve']({'resolvedBy':_0x39b964,'resolvedAt':_0x1d13de,'isFromAdapter':!0x0});}),this['listenTo'](_0x54d6c2,'commentThreadReopened',(_0x5a3452,{commentThreadId:_0x5d9ef5})=>{const _0x4c504f=_0x2ab89b['getCommentThread'](_0x5d9ef5);_0x4c504f&&_0x4c504f['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x54d6c2,'commentThreadRemoved',(_0x289e13,{commentThreadId:_0x2c538c})=>{const _0x53aa24=_0x2ab89b['getCommentThread'](_0x2c538c);_0x53aa24&&_0x53aa24['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x54d6c2,'commentAdded',(_0x26df75,_0x359840)=>{const _0x46ecaa=_0x359840['commentThreadId'],_0x4d4943=_0x2ab89b['getCommentThread'](_0x46ecaa);_0x4d4943&&_0x4d4943['addComment']({...st(_0x359840),'isFromAdapter':!0x0});}),this['listenTo'](_0x54d6c2,'commentUpdated',(_0x541139,{commentThreadId:_0xb5e099,commentId:_0x1016c4,content:_0x329305,attributes:_0x54a599})=>{const _0x3d7673=_0x2ab89b['getCommentThread'](_0xb5e099);if(_0x3d7673){const _0x51c586=_0x3d7673['getComment'](_0x1016c4);_0x51c586&&_0x51c586['update']({'content':_0x329305,'attributes':_0x54a599,'isFromAdapter':!0x0});}}),this['listenTo'](_0x54d6c2,'commentRemoved',(_0x2b2f9c,{commentThreadId:_0x15cdc4,commentId:_0x3a26db})=>{const _0x1c0819=_0x2ab89b['getCommentThread'](_0x15cdc4);if(_0x1c0819){const _0x56f5f0=_0x1c0819['getComment'](_0x3a26db);_0x56f5f0&&_0x56f5f0['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x514692);}['destroy'](){if(this['context']instanceof tt){const _0x74d579=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x74d579);}}['_terminateService'](_0x2bfedb){if(!this['_services']['has'](_0x2bfedb))throw new _0x3a0d6c('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x2bfedb});this['_getService'](_0x2bfedb)['disconnect'](),this['_services']['delete'](_0x2bfedb);}async['reconnect'](){for(const _0x1e3fae of this['_services']['keys']())await this['_connectService'](_0x1e3fae);if(this['context']instanceof tt){const _0x7cbc19=this['context']['config']['get']('collaboration.channelId'),_0x555fc4=this['context']['plugins']['get'](i);_0x555fc4['unregister'](_0x7cbc19);const _0x3da097=await this['_services']['get'](_0x7cbc19)['getConnectedSessions']();_0x555fc4['register'](_0x7cbc19,_0x3da097);}}async['_connectService'](_0x469344){const {connection:_0x36ef8c}=this['context']['plugins']['get'](n),_0x2746a6=this['context']['plugins']['get']('CommentsRepository'),_0x5f1798=this['_services']['get'](_0x469344),_0x12a337=await _0x5f1798['connect'](_0x36ef8c);await this['_fetchMissingUsersForThreads'](_0x12a337);const _0x426232=new Set(Array['from'](_0x2746a6['getCommentThreads']({'channelId':_0x469344}),_0x5eabe2=>_0x5eabe2['id']));for(const _0x2683eb of _0x12a337)_0x2683eb['deletedAt']||_0x426232['delete'](_0x2683eb['commentThreadId']);for(const _0x586cc1 of _0x426232)_0x2746a6['getCommentThread'](_0x586cc1)['remove']({'isFromAdapter':!0x0});for(const _0x19bcae of _0x12a337){let _0x1db55c=_0x2746a6['getCommentThread'](_0x19bcae['commentThreadId']);const {commentThreadId:_0x36dc82,context:_0x246d57,attributes:_0x134fa7,resolvedBy:_0x4edc6c,resolvedAt:_0x54918e,unlinkedAt:_0x33b9f6,deletedAt:_0x53a724}=_0x19bcae;if(_0x53a724)continue;_0x1db55c||(_0x1db55c=_0x2746a6['addCommentThread']({'channelId':_0x469344,'threadId':_0x36dc82,'context':_0x246d57,'attributes':_0x134fa7||{},'resolvedBy':_0x4edc6c,'resolvedAt':_0x54918e,'unlinkedAt':_0x33b9f6,'isFromAdapter':!0x0}));const _0x5c8476=new Set(Array['from'](_0x1db55c['comments'],_0x3557a2=>_0x3557a2['id']));for(const _0x16f88d of _0x19bcae['comments'])_0x5c8476['delete'](_0x16f88d['commentId']);for(const _0x2f8ee0 of _0x5c8476)_0x1db55c['getComment'](_0x2f8ee0)['remove']({'isFromAdapter':!0x0});for(const _0x583b8e of _0x19bcae['comments']){const _0x633d0f=_0x1db55c['getComment'](_0x583b8e['commentId']);_0x633d0f?_0x633d0f['content']!==_0x583b8e['content']&&_0x633d0f['update']({'content':_0x583b8e['content'],'isFromAdapter':!0x0}):_0x1db55c['addComment'](Object['assign'](st(_0x583b8e),{'isFromAdapter':!0x0}));}}}['_getService'](_0x5ae5e4){if(!this['_services']['has'](_0x5ae5e4))throw new _0x3a0d6c('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5ae5e4});return this['_services']['get'](_0x5ae5e4);}async['_fetchMissingUsersForThreads'](_0x58d69c){const _0x3dbab4=this['context']['plugins']['get'](_0x393929),{connection:_0x2b6354}=this['context']['plugins']['get'](n),_0x54ebd0=new Set();for(const {resolvedBy:_0x5682a6,comments:_0x1c496c}of _0x58d69c){_0x5682a6&&!_0x3dbab4['getUser'](_0x5682a6)&&_0x54ebd0['add'](_0x5682a6);for(const {userId:_0xd6c8fe}of _0x1c496c)_0x3dbab4['getUser'](_0xd6c8fe)||_0x54ebd0['add'](_0xd6c8fe);}if(0x0===_0x54ebd0['size'])return;const _0x11439a=await ut['getMany'](_0x2b6354,Array['from'](_0x54ebd0));for(const _0x170c33 of _0x11439a)_0x3dbab4['getUser'](_0x170c33['id'])||_0x3dbab4['addUser'](_0x170c33);}}async function ot(_0x16690b){if('404'!==_0x16690b['code'])throw _0x16690b;}function ft(_0x32f646){if((_0x412774=_0x32f646)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x412774['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x412774['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x412774;throw _0x32f646;}function st(_0xbb018b){return{'threadId':_0xbb018b['commentThreadId'],'commentId':_0xbb018b['commentId'],'content':_0xbb018b['content'],'createdAt':_0xbb018b['createdAt'],'authorId':_0xbb018b['userId'],'attributes':_0xbb018b['attributes']||{}};}class m extends _0x5b8bc3{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x53bdb2)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x393929];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x35809d){super(_0x35809d);const _0x463e0a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x463e0a);}async['init'](){const _0x5617f6=this['editor']['plugins']['get'](l),_0x5146ea=_0x5617f6['serverHistory'],_0x44bf0b=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x5146ea,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5617f6['sessionId']});const _0x5557ee=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x2279cc=await _0x242d38['isBundleUploaded'](_0x44bf0b['connection'],_0x5557ee);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x9b5cc0})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x9b5cc0)),'updateRevisions':async _0x23d638=>{await this['_waitForServiceReady']();const _0x38fa69=this['_revisionTracker']['currentRevision'];if(_0x2279cc&&0x1===_0x23d638['length']&&_0x23d638[0x0]['id']===_0x38fa69['id'])return _0x23d638;for(const _0x42c1fe of _0x23d638)_0x42c1fe['id']===_0x38fa69['id']&&(_0x42c1fe['isEmptyCurrent']=_0x42c1fe['fromVersion']===_0x42c1fe['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x23d638,this['_lastRequestId'])['then'](_0x284702=>(this['_lastRequestId']=_0x284702,_0x23d638))['catch'](_0x304a11=>{if(P(_0x304a11)||'400'===_0x304a11['code']&&void 0x0!==_0x304a11['data']['wrongRequestId']){for(const _0x180bf5 of _0x23d638){!this['_revisionTracker']['repository']['getRevision'](_0x180bf5['id'])||this['_revisionTracker']['_bufferUpdate'](_0x180bf5['id'],_0x180bf5,!0x1);}if(P(_0x304a11))throw _0x304a11;return _0x23d638;}throw _0x304a11;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x212156,{revisionsData:_0x5268fa,requestId:_0x5a72cd})=>{Math['max'](..._0x5268fa['map'](_0x44eee6=>_0x44eee6['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5268fa,_0x5a72cd);}):this['_handleRevisionsUpdate'](_0x5268fa,_0x5a72cd);});const {revisions:_0x36a978,requestId:_0x44eeb2}=await this['_revisionHistoryService']['connect'](_0x44bf0b['connection']);_0x44bf0b['addToReconnectionStack'](this),this['_lastRequestId']=_0x44eeb2,await this['_fetchMissingUsers'](_0x36a978);for(const _0x43b6e1 of _0x36a978)this['_revisionTracker']['addRevisionData'](_0x43b6e1);this['listenTo'](_0x5617f6,'change:_isConnected',(_0x435256,_0x19ffcf,_0x515cc4)=>{_0x515cc4&&(this['_oldOffset']=_0x5617f6['_offset'],_0x435256['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x44bf0b,'state',_0x849c2=>_0x849c2===_0x4efd76['CONNECTED']);}async['reconnect'](){const _0x29586f=this['editor']['plugins']['get'](n),_0xe04232=this['editor']['plugins']['get'](l),_0x48c150=async()=>{const _0x15c689=this['_revisionTracker']['currentRevision'],_0x21a07e=_0x15c689['id'],_0x37ebe7=_0x21a07e!==_0xe04232['sessionId'];if(_0x37ebe7){const _0x409451=_0xe04232['_offset']-this['_oldOffset'],_0x42cb8c=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x15c689['toVersion']+_0x409451!==_0x42cb8c){const _0x7d2dd2=_0x15c689['fromVersion']+_0x409451,_0xd8a07e=this['editor']['plugins']['get'](_0x393929),_0x29359e=this['_revisionTracker']['buildRevisionData']({'revision':_0x15c689,'from':_0x7d2dd2,'to':_0x42cb8c});_0x29359e['id']=_0x15c689['id'];const _0x63aad9=_0x29359e['authorsIds']['map'](_0x49e190=>_0xd8a07e['getUser'](_0x49e190));_0x15c689['_update']({..._0x29359e,'authors':_0x63aad9},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x15c689['id'],_0x29359e,!0x0);}this['_revisionTracker']['_startingVersion']=_0x42cb8c,(_0x15c689['toVersion']===_0x15c689['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x21a07e)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x21a07e),this['_revisionTracker']['_createCurrentRevision'](_0x42cb8c));}const {revisions:_0x29a2ef,requestId:_0x54f1c8}=await this['_revisionHistoryService']['reconnect'](_0x29586f['connection'],this['_lastRequestId']);_0x37ebe7&&_0x29a2ef['length']>0x0?_0xe04232['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x29a2ef),this['_handleRevisionsUpdate'](_0x29a2ef,_0x54f1c8),this['_revisionTracker']['sendBufferedUpdates']());};return _0xe04232['_isConnected']?_0x48c150():new Promise((_0x57ee61,_0x85f62)=>{_0xe04232['once']('change:_isConnected',()=>{_0x48c150()['then'](_0x57ee61)['catch'](_0x85f62);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x1f07a7=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x2ac3b7=>{_0x2ac3b7['off'](),_0x1f07a7();});});}['_getLatestVersionFromServerOperations'](){const _0x1bef67=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1edf6a of _0x1bef67)if('marker'!==_0x1edf6a['type']||_0x1edf6a['affectsData'])return _0x1edf6a['baseVersion']+0x1;}['_getLatestVersion'](){const _0x568809=this['editor']['plugins']['get'](l);return new Promise(_0x44702f=>{_0x568809['_isPendingUpdate']?_0x568809['once']('change:_isPendingUpdate',()=>{_0x44702f(this['_getLatestVersionFromServerOperations']());}):_0x44702f(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x946ac0,_0x186f0b){const _0x45d485=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x186f0b;for(const _0x3fd053 of _0x946ac0){const _0x1a2967=_0x45d485['getRevision'](_0x3fd053['id']);if(_0x1a2967){if((_0x3fd053['fromVersion']||_0x3fd053['toVersion'])&&(_0x3fd053['diffData']=null),_0x1a2967===this['_revisionTracker']['currentRevision']){const _0x4fe669=Math['max'](_0x1a2967['toVersion'],_0x3fd053['toVersion']),_0x181813=Math['max'](_0x1a2967['fromVersion'],_0x3fd053['fromVersion']);let _0x125c48;_0x1a2967['toVersion']===_0x3fd053['toVersion']&&_0x1a2967['fromVersion']===_0x3fd053['fromVersion']?(_0x125c48=!0x0,this['_preventResendingRevisionData'](_0x3fd053)):_0x3fd053['toVersion']===_0x4fe669&&_0x3fd053['fromVersion']===_0x181813?_0x125c48=!0x1:(_0x1a2967['toVersion']===_0x4fe669&&_0x1a2967['fromVersion']===_0x181813||this['_fixRevision']({'revision':_0x1a2967,'from':_0x181813,'to':_0x4fe669}),_0x125c48=!0x0),_0x125c48&&(delete _0x3fd053['fromVersion'],delete _0x3fd053['toVersion'],delete _0x3fd053['diffData'],delete _0x3fd053['createdAt'],delete _0x3fd053['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3fd053),this['_preventResendingRevisionData'](_0x3fd053);}else this['_revisionTracker']['addRevisionData'](_0x3fd053);}const _0x1bf4dc=_0x45d485['getRevisions']();_0x1bf4dc['reverse']();for(let _0x17cd81=0x0;_0x17cd81<_0x1bf4dc['length']-0x1;_0x17cd81++){const _0x17e397=_0x1bf4dc[_0x17cd81],_0x542932=_0x1bf4dc[_0x17cd81+0x1];if(_0x17e397['fromVersion']<_0x542932['toVersion']){const _0x7536fe=_0x542932['toVersion'],_0x16ca53=Math['max'](_0x7536fe,_0x17e397['toVersion']);this['_fixRevision']({'revision':_0x17e397,'from':_0x7536fe,'to':_0x16ca53});}}}['_fixRevision']({revision:_0x4fe291,from:_0xe38ccd,to:_0x82589}={}){const _0x2d0dda=this['editor']['plugins']['get'](_0x393929),_0x552ea2=this['_revisionTracker']['buildRevisionData']({'revision':_0x4fe291,'from':_0xe38ccd,'to':_0x82589});_0x552ea2['authors']=_0x552ea2['authorsIds']['map'](_0x3c7671=>_0x2d0dda['getUser'](_0x3c7671)),_0x4fe291['_update'](_0x552ea2);}['_preventResendingRevisionData'](_0x4d510c){const _0x468b38={};_0x468b38['id']=_0x4d510c['id'];for(const _0xdf8d72 of Object['keys'](_0x4d510c))'id'!==_0xdf8d72&&(_0x468b38[_0xdf8d72]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x468b38['id'],_0x468b38,!0x0);}async['_fetchMissingUsers'](_0x340d96){const _0x20cc45=this['editor']['plugins']['get'](_0x393929),{connection:_0x3fcf91}=this['editor']['plugins']['get'](n),_0x18688d=new Set();for(const _0x139c20 of _0x340d96){for(const _0x37c0ae of _0x139c20['authorsIds'])_0x17ab2d(_0x37c0ae);_0x139c20['creatorId']&&_0x17ab2d(_0x139c20['creatorId']);}if(0x0===_0x18688d['size'])return;const _0x4d3d5c=await ut['getMany'](_0x3fcf91,Array['from'](_0x18688d));for(const _0x1877bb of _0x4d3d5c)_0x20cc45['getUser'](_0x1877bb['id'])||_0x20cc45['addUser'](_0x1877bb);function _0x17ab2d(_0x3293b1){_0x20cc45['getUser'](_0x3293b1)||_0x18688d['add'](_0x3293b1);}}}function P(_0x1e640b){return _0x1e640b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x1e640b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1e640b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x5b8bc3{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 _0x4e32f2{['_collapseAt'];constructor(_0x3a0436,_0x5bfae6=0x6){super(_0x3a0436);const _0x60773=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x5bfae6,this['bind']('isHidden')['to'](this,'usersCount',_0x10ba7f=>_0x10ba7f<_0x5bfae6),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x60773['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':_0x60773['to']('usersCount',_0x636827=>'+'+(_0x636827-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x4e32f2{['items'];['keystrokes'];constructor(_0x3a0ddc){super(_0x3a0ddc);const _0x5e91db=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5e36a4(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5e91db['if']('hasPopup'),'aria-expanded':_0x5e91db['to']('isExpanded',_0x4be7c9=>this['hasPopup']&&String(_0x4be7c9)),'aria-label':_0x5e91db['to']('hasPopup',_0x26dcc6=>V(_0x3a0ddc,_0x26dcc6?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5e91db['to']('hasPopup',_0x5438db=>!!_0x5438db&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x5e91db['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x5e91db['to'](_0x226248=>{const _0x2bec9a=_0x226248,_0xb097c4=document['querySelector']('.ck-presence-list__dropdown-list'),_0x621590=document['querySelector']('.ck-balloon-panel_with-arrow');_0xb097c4?.['contains'](_0x2bec9a['relatedTarget'])||_0x621590?.['contains'](_0x2bec9a['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x23748b,_0x5cda88,_0x349454)=>{this['element']&&(_0x349454?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x4e32f2{['counterView'];['inlineListView'];constructor(_0x54120c,_0x5a1608=0x6){super(_0x54120c);const _0x418545=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x5a1608),this['inlineListView']=new is(_0x54120c),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x5d3f5c of this['inlineListView']['items'])_0x5d3f5c['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',_0x418545['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x4e32f2{['listWrapperView'];constructor(_0x4b86e1,_0x29f059){super(_0x4b86e1);const _0x52a054=this['bindTemplate'];this['listWrapperView']=new wt(_0x4b86e1,_0x29f059),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x4b86e1,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x52a054['to'](_0x5e7b17=>{const _0x37f3b8=_0x5e7b17,_0x4f8291=document['querySelector']('.ck-presence-list__list'),_0x2f4341=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4f8291?.['contains'](_0x37f3b8['relatedTarget'])||_0x2f4341?.['contains'](_0x37f3b8['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x478f63{constructor(_0xf14fd8,_0x984efb){super(_0xf14fd8);const _0x3962ba=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x984efb?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3962ba['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3962ba['to']('role'),'aria-label':_0x3962ba['to']('ariaLabel'),'aria-labelledby':_0x3962ba['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x21a1a4['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4bc672=this['element'];_0x4bc672&&(this['_isScrollable']=Math['max'](_0x4bc672['scrollHeight'],_0x4bc672['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0xd74dcb,_0x5ceedc,_0x487a85){super(_0xd74dcb);const _0xcc373=this['bindTemplate'];this['userView']=new ct(_0xd74dcb,_0x5ceedc);const _0x487e01={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x5ceedc['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x5ceedc['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5ceedc['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x487a85&&(_0x487e01['tag']='button',_0x487e01['on']={'click':_0xcc373['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x487e01);}['focus'](){this['element']['focus']();}}class A extends _0x4e32f2{['userView'];['markerView'];constructor(_0xb3b926,_0x343d23,_0x543049){super(_0xb3b926);const _0x3ca392=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0xb3b926,_0x343d23),this['markerView']=new lt(_0xb3b926,_0x343d23);const _0x56f960=new at(_0xb3b926);_0x56f960['template']['tag']='span',_0x56f960['text']=_0x343d23['name'];const _0x3e6bc4={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x3ca392['to']('isFocusable',_0xd61501=>!!_0xd61501&&0x0),'aria-labelledby':_0x56f960['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x3ca392['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x3ca392['to']('hasTooltip',_0x32e45e=>!_0x32e45e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x56f960]};_0x543049&&(_0x3e6bc4['tag']='button',_0x3e6bc4['on']={'click':_0x3ca392['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3e6bc4);}}class lt extends _0x4e32f2{constructor(_0x58a9eb,_0xc6c51f){super(_0x58a9eb),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xc6c51f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x1861c7{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x597c2d){super(_0x597c2d),this['context']['config']['define']('presenceList',x);const _0x19cd93=_0x597c2d['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x19cd93)throw new _0x3a0d6c('presencelist-collapseat-invalid-format',this);if(_0x19cd93<0x1)throw new _0x3a0d6c('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x4fdafc(),this['balloonPanelView']=new _0x55c17c(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4edff8 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4edff8);this['listenTo'](this['_allConnectedUsers'],'add',(_0xe9dea7,_0x3eef36)=>{this['_handleUserAdd'](_0x3eef36);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x376d17,_0x495e08)=>{this['_handleUserRemove'](_0x495e08);});}['_createView'](){const _0x4d1b41=this['context'],_0x5a0dee=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x30079e=this['balloonPanelView'];if(!_0x4d7729(_0x4d1b41['config']['get']('presenceList.container')))throw new _0x3a0d6c('presencelist-missing-container',this);return _0x5a0dee['counterView']['bind']('usersCount')['to'](this),_0x5a0dee['bind']('isCollapsed')['to'](this,'usersCount',_0x2a9dce=>{const {collapseAt:_0xafd8d3}=_0x4d1b41['config']['get']('presenceList'),_0x39c59f=_0x2a9dce>=_0xafd8d3;if(_0x39c59f&&!_0x5a0dee['inlineListView']['items']['find'](_0x272ebe=>_0x272ebe instanceof b)){const _0x140e85=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x140e85&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x5a0dee['inlineListView']['items']['add'](_0x5a0dee['counterView']);}return _0x39c59f||this['hideDropdown'](),_0x39c59f;}),_0x5a0dee['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1b3ff5=>{const _0x4db9c1=_0x4d1b41['config']['get']('presenceList'),_0x28afac=new A(_0x4d1b41['locale'],_0x1b3ff5,!!_0x4db9c1['onClick']);return _0x28afac['bind']('hasTooltip')['to'](_0x5a0dee,'isCollapsed',_0x2d8e36=>!_0x2d8e36),_0x28afac['bind']('isFocusable')['to'](_0x5a0dee,'isCollapsed',_0x352dbe=>!_0x352dbe),_0x4db9c1['onClick']&&this['listenTo'](_0x28afac,'execute',()=>{this['view']['isCollapsed']||_0x4db9c1['onClick'](_0x1b3ff5,_0x28afac['element']);}),_0x28afac;}),this['listenTo'](_0x5a0dee['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x5a0dee['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x5a0dee['inlineListView']['keystrokes']['set']('Enter',(_0x2a50eb,_0x276da6)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x276da6());}),_0x5a0dee['render'](),_0x30079e['render'](),_0x33581a({'emitter':_0x5a0dee,'activator':()=>_0x30079e['isVisible'],'contextElements':[_0x30079e['element'],_0x5a0dee['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4d1b41['config']['get']('presenceList.container')['appendChild'](_0x5a0dee['element']),this['_bodyCollection']=new _0x20fbe5(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5a0dee;}['_handleUserAdd'](_0x365a2f){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x365a2f['isMe'])return;const _0x14211e=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x14211e-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x3fb968=_0x365a2f['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x365a2f,_0x3fb968);}['_handleUserRemove'](_0xc2e33d){this['usersCount']--;const {collapseAt:_0x3bc504}=this['context']['config']['get']('presenceList'),_0x53fb06=this['usersCount']>=_0x3bc504;if(this['currentDisplayedUsers']['get'](_0xc2e33d['id']))this['currentDisplayedUsers']['remove'](_0xc2e33d['id']);else{if(_0x53fb06&&this['currentDisplayedUsers']['length']+0x1===_0x3bc504-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x53fb06?0x1:0x0)<this['usersCount']){for(const _0x1a1c24 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1a1c24['id'])&&(this['currentDisplayedUsers']['add'](_0x1a1c24,Math['min'](this['currentDisplayedUsers']['length']-(_0x53fb06?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x53fb06?0x1:0x0)===_0x3bc504-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4fb8b0=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x4fb8b0['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0xab445f}=this['presenceDropdownView'];_0xab445f['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5bf459=>{if(!_0x4fb8b0['displayMe']&&_0x5bf459['isMe'])return null;const _0x5f48ad=new j(this['context']['locale'],_0x5bf459,!!_0x4fb8b0['onClick']);return _0x4fb8b0['onClick']&&this['listenTo'](_0x5f48ad,'execute',()=>{_0x4fb8b0['onClick'](_0x5bf459,_0x5f48ad['element']);}),_0x5f48ad;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0xab445f['focus'](),_0xab445f['checkIfScrollable']();const _0xffa0c=(_0x513948,_0x31794f)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x31794f();};_0xab445f['keystrokes']['set']('Esc',_0xffa0c),_0xab445f['keystrokes']['set']('Shift+Tab',_0xffa0c),_0xab445f['keystrokes']['set']('Tab',(_0x439f68,_0xcf6966)=>{!function(_0x52a948){const _0x45ffe1=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x5ead6c=>_0x5ead6c+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x21e0c9=[...document['body']['querySelectorAll'](_0x45ffe1)]['filter'](_0x50ce3c=>_0x50ce3c===document['activeElement']||_0x50ce3c['offsetWidth']+_0x50ce3c['offsetHeight']>0x0)['sort']((_0x1e36eb,_0x34ea06)=>(_0x1e36eb['tabIndex']||0x0)-(_0x34ea06['tabIndex']||0x0)),_0x424caf=_0x21e0c9['indexOf'](_0x52a948),_0x1a699b=_0x21e0c9[(_0x424caf+0x1)%_0x21e0c9['length']];_0x1a699b&&_0x1a699b['focus']();}(this['view']['element']),this['hideDropdown'](),_0xcf6966();}),_0xab445f['focusTracker']['add'](this['view']['element']),_0xab445f['focusTracker']['on']('change:isFocused',(_0x32cd5d,_0x3af20e,_0x35f527)=>{_0x35f527||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 _0x1861c7{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 _0x1ad809,Plugin as _0x4c92a1,PendingActions as _0x1dfa6f,Context as et}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x5236cc,CKEditorError as _0x4480f3,Collection as _0x1bed69,global as _0x4f23f6,version as ht,uid as _0x1b1925,KeystrokeHandler as _0xbb5186}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x586280,View as _0x7fb5c5,ListView as _0x483fc1,ListItemView as rt,LabelView as at,BalloonPanelView as _0x5b56e2,clickOutsideHandler as _0x4d282b,BodyCollection as _0x3ebd13}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x2f6a00,History as _0x55cfe8,NoOperation as _0x2027f0,InsertOperation as _0x2b0acb,MarkerOperation as _0x2f15c0,RootAttributeOperation as _0x184a0c,transformOperationSets as _0x3309e7,OperationFactory as _0x88f58c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as dt,WEB_SOCKET_GATEWAY_STATES as _0x53ea10,CollaborativeEditingService as _0x1fb470,User as ut,CommentsService as ot,TrackChangesService as tt,RevisionHistoryService as _0x435b29,EditorService as _0x2d1097}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x2f4184,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1185d6}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x487be0}from'es-toolkit/compat';class n extends _0x1ad809{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x586280];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c47ec){super(_0x4c47ec),this['set']('state',_0x53ea10['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x5236cc())();}['init'](){const _0x15a1ab=this['context'],_0x4d1221=_0x15a1ab['plugins']['get']('CloudServices'),_0x44c952=_0x15a1ab['plugins']['get'](_0x586280);if(!_0x4d1221['token'])throw new _0x4480f3('websocketgateway-missing-token',this);if(!_0x4d1221['webSocketUrl'])throw new _0x4480f3('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'](_0x4d1221['token'],_0x4d1221['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2c435e=>{if(this['connection']=_0x2c435e,this['bind']('state')['to'](_0x2c435e,'state',this,'_isBrowserOffline',(_0xc8125a,_0x5c1f80)=>('connected'!==_0xc8125a&&(this['_shouldPluginsReconnect']=!0x0),_0x5c1f80||_0xc8125a!==_0x53ea10['CONNECTED']?_0x53ea10['DISCONNECTED']:this['state']==_0x53ea10['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x53ea10['CONNECTING']):_0x53ea10['CONNECTED'])),this['connection']['on']('error',(_0x5f25e2,_0x442192)=>{if('limitExceeded'!==_0x442192['code'])throw console['error'](_0x442192),new _0x4480f3('cloudservices-init',null,{'originalError':_0x442192});_0x44c952['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'});}),!_0x2c435e['me'])return new Promise(_0x4fb6e1=>_0x2c435e['on']('change:me',_0x4fb6e1));})['catch'](_0x27d2a6=>{throw console['error'](_0x27d2a6),new _0x4480f3('cloudservices-init',null,{'originalError':_0x27d2a6});});}['addToReconnectionStack'](_0x3c3b81){if('function'!=typeof _0x3c3b81['reconnect'])throw new _0x4480f3('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3c3b81))throw new _0x4480f3('websocketgateway-plugin-already-registered',this,{'name':_0x3c3b81['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3c3b81);}['removeFromReconnectionStack'](_0x4f6b16){this['_reconnectionStack']['delete'](_0x4f6b16);}['isInReconnectionStack'](_0x22a8da){return this['_reconnectionStack']['has'](_0x22a8da);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x343efb=>_0x343efb['reconnect']())))['then'](()=>this['state']=_0x53ea10['CONNECTED'])['catch'](_0x57decd=>{throw console['error'](_0x57decd),new _0x4480f3('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x53ea10['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x1ad809{['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,_0x2f4184];}constructor(_0x2d3124){super(_0x2d3124),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1bed69(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x2f4184);}['init'](){const _0x1cff40=this['context']['plugins']['get'](n);this['listenTo'](_0x1cff40,'change:state',(_0x1fb7e4,_0x1335ec,_0x1cc028)=>{if('connected'!==_0x1cc028)this['channelSessions']['forEach'](_0x33e036=>_0x33e036['clear']()),this['channelConnectedUsers']['forEach'](_0x4c12b4=>_0x4c12b4['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x40ec60,_0x4090c4]of this['_registeredSessions'])for(const _0x3bec14 of _0x4090c4)this['_handleSessionAdd'](_0x40ec60,_0x3bec14);}}),this['_createUser'](_0x1cff40['connection']['me'],!0x0);}['register'](_0xfa711c,_0x56068a){if(this['_registeredSessions']['has'](_0xfa711c))throw new _0x4480f3('sessions-register-already-registered',null,{'channelId':_0xfa711c});this['_registeredSessions']['set'](_0xfa711c,_0x56068a),this['channelSessions']['set'](_0xfa711c,new _0x1bed69()),this['channelConnectedUsers']['set'](_0xfa711c,new _0x1bed69()),this['listenTo'](_0x56068a,'add',(_0x36354b,_0x58eee0)=>this['_handleSessionAdd'](_0xfa711c,_0x58eee0)),this['listenTo'](_0x56068a,'remove',(_0x5086c0,_0x3c505f)=>this['_handleSessionRemove'](_0xfa711c,_0x3c505f));for(const _0x4f0df0 of _0x56068a)this['_handleSessionAdd'](_0xfa711c,_0x4f0df0);}['unregister'](_0x559804){if(!this['_registeredSessions']['has'](_0x559804))throw new _0x4480f3('sessions-unregister-not-exist',null,{'channelId':_0x559804});const _0x156667=this['_registeredSessions']['get'](_0x559804);this['stopListening'](_0x156667);for(const _0x2fe45a of _0x156667)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x559804,_0x2fe45a);this['_registeredSessions']['delete'](_0x559804),this['channelSessions']['delete'](_0x559804),this['channelConnectedUsers']['delete'](_0x559804);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x43e595){for(const _0x5e6cd9 of this['channelSessions']['values']())for(const _0x169be2 of _0x5e6cd9)if(_0x169be2['id']===_0x43e595)return _0x169be2['user'];}['getUserSessions'](_0x53d0e7,_0x58461d){const _0x24871c=_0x58461d?[this['channelSessions']['get'](_0x58461d)]:this['channelSessions']['values'](),_0x1fd804=new Set();for(const _0x4f58c6 of _0x24871c)for(const _0x1b6d25 of _0x4f58c6)_0x1b6d25['user']['id']===_0x53d0e7['id']&&_0x1fd804['add'](_0x1b6d25['id']);return _0x1fd804;}['getUserRole'](_0x3f53c2){for(const _0x4c5617 of this['channelSessions']['values']())for(const _0x2cb538 of _0x4c5617)if(_0x2cb538['user']===_0x3f53c2)return _0x2cb538['role'];}['_handleSessionAdd'](_0x1dcf12,_0x3e1304){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x4b070c=_0x3e1304['user'],_0xba4fd3=this['_users']['getUser'](_0x4b070c['id'])||this['_createUser'](_0x4b070c),_0x40e397=Object['assign']({},_0x3e1304,{'user':_0xba4fd3});if(this['channelSessions']['get'](_0x1dcf12)['add'](_0x40e397),!_0x4b070c['hiddenInPresenceList']){const _0x39ac80=this['channelConnectedUsers']['get'](_0x1dcf12);_0x39ac80['has'](_0xba4fd3['id'])||_0x39ac80['add'](_0xba4fd3),this['allConnectedUsers']['has'](_0xba4fd3['id'])||_0x4b070c['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xba4fd3,_0xba4fd3['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x1dcf12,{'channelId':_0x1dcf12,'session':_0x40e397});}['_handleSessionRemove'](_0x145bea,_0x2a77cf){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x205f42=this['channelConnectedUsers']['get'](_0x145bea),_0x2a12bf=_0x2a77cf['user'];_0x2a12bf['id']&&(this['channelSessions']['get'](_0x145bea)['remove'](_0x2a77cf['id']),_0x205f42['has'](_0x2a12bf['id'])&&!this['getUserSessions'](_0x2a12bf,_0x145bea)['size']&&_0x205f42['remove'](_0x2a12bf['id']),this['allConnectedUsers']['get'](_0x2a12bf['id'])&&!this['getUserSessions'](_0x2a12bf)['size']&&this['allConnectedUsers']['remove'](_0x2a12bf['id']));}['_createUser'](_0xa0c6c7,_0xbb8906){const _0x2d30e9=this['_users']['addUser'](_0xa0c6c7);return _0xbb8906&&this['_users']['defineMe'](_0xa0c6c7['id']),_0x2d30e9['orderNumber']=this['_uniqueUsersCount']++,_0x2d30e9;}}class C extends _0x4c92a1{['_domEmitter']=new(_0x5236cc())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x144bb2=this['editor'],_0x2ae2b7=_0x144bb2['plugins']['get'](i);_0x144bb2['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x2ef9de,{writer:_0x4c42ba})=>function(_0x753ecd,_0x3204f4,_0x59c6cf,_0x54a3d2){const _0xc9780e=_0x753ecd['markerName']['split'](':')[0x2],_0x375a36=_0x59c6cf['getUserBySessionId'](_0xc9780e);if(!_0x375a36||_0xc9780e===_0x59c6cf['mySessionId'])return;if(!_0x54a3d2['model']['schema']['checkChild'](_0x753ecd['markerRange']['start'],'$text'))return;const _0x22ddc9={'class':'ck-user__marker\x20'+_0x375a36['color']['getMarkerClass'](),'data-name':_0x375a36['name'],'data-session-id':_0xc9780e},_0x11df36=_0x54a3d2['model']['markers']['get'](_0x753ecd['markerName']),_0x3266c8=_0x11df36['getStart'](),_0x59e8e9=_0x3266c8['nodeAfter'],_0x340964=_0x54a3d2['model']['schema'];if(_0x59e8e9&&_0x340964['isObject'](_0x59e8e9)&&_0x340964['isInline'](_0x59e8e9)&&!_0x54a3d2['model']['markers']['get']('user:range:'+_0xc9780e)['getRange']()['isCollapsed'])return;const _0x5dbd38=_0x3266c8['parent'];return _0x54a3d2['model']['schema']['isLimit'](_0x5dbd38)&&!_0x54a3d2['model']['hasContent'](_0x5dbd38)&&(_0x22ddc9['contenteditable']=!0x1),function(_0x1cc7ba,_0x24fd9a,_0x1bcd9c){const _0x46c469=_0x1cc7ba['createUIElement']('span',_0x24fd9a);return _0x1cc7ba['setCustomProperty']('userPositionMarker',!0x0,_0x46c469),_0x46c469['render']=function(_0x5ead00){const _0xdc3e75=this['toDomElement'](_0x5ead00),_0x578c0c=document['createElement']('span');return _0x578c0c['classList']['add']('ck-user__marker-tooltip'),_0x578c0c['setAttribute']('contenteditable','false'),_0x578c0c['setAttribute']('spellcheck','false'),_0x578c0c['textContent']=_0x1bcd9c['name'],_0xdc3e75['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x578c0c['outerHTML']+'',_0xdc3e75['addEventListener']('mouseenter',()=>{_0xdc3e75['classList']['add']('ck-user__marker_hovered');}),_0xdc3e75['addEventListener']('mouseleave',()=>{_0xdc3e75['classList']['remove']('ck-user__marker_hovered');}),_0xdc3e75;},_0x46c469['isSimilar']=function(_0x2d73f4){return!(!this['getCustomProperty']('userPositionMarker')||!_0x2d73f4['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x2d73f4['getAttribute']('data-session-id'));},_0x46c469;}(_0x3204f4,_0x22ddc9,_0x375a36);}(_0x2ef9de,_0x4c42ba,_0x2ae2b7,_0x144bb2)}),_0x144bb2['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x7bb488=>function(_0x36dcec,_0x54291d){const _0x5e1bbe=_0x36dcec['markerName']['split'](':')[0x2];if(_0x5e1bbe===_0x54291d['mySessionId'])return null;const _0x406108=_0x54291d['getUserBySessionId'](_0x5e1bbe);if(!_0x406108)return{'id':_0x5e1bbe,'classes':[]};return{'id':_0x5e1bbe,'classes':['ck-user__selection',_0x406108['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x5e1bbe},'priority':0x7d0+_0x406108['orderNumber']};}(_0x7bb488,_0x2ae2b7)}),function(_0x3f8af9){const _0x4b523d=_0x3f8af9['model'],_0x4ac76f=new Map(),_0x313a54=_0x3f8af9['plugins']['get'](i);_0x4b523d['markers']['on']('update:user:range',(_0x22ddd7,_0x27950c,_0x3ad668,_0x20b37c)=>{if(!_0x20b37c&&_0x4ac76f['get'](_0x27950c['name']))return _0x4ac76f['get'](_0x27950c['name'])['detach'](),void _0x4ac76f['delete'](_0x27950c['name']);const _0x1a671e=_0x27950c['name']['split'](':')[0x2];if(_0x1a671e===_0x313a54['mySessionId'])return;const _0x27e3cf='user:position:'+_0x1a671e;_0x4b523d['markers']['has'](_0x27e3cf)&&_0x3f8af9['editing']['reconvertMarker'](_0x27e3cf),_0x27950c['on']('change:range',(_0x777f2c,_0x80cbb3,_0x3f4b30)=>{if('$graveyard'!=_0x80cbb3['root']['rootName']&&'$graveyard'==_0x27950c['getRange']()['root']['rootName']&&!_0x4ac76f['has'](_0x27950c['name'])){const _0x371555=_0x4b523d['schema']['getNearestSelectionRange'](_0x3f4b30['deletionPosition']);if(_0x371555){const _0x4f0d05=_0x2f6a00['fromRange'](_0x371555);_0x4ac76f['set'](_0x27950c['name'],_0x4f0d05),_0x4f0d05['on']('change:range',(_0x41daec,_0x539af0,_0xabfc70)=>{if('$graveyard'==_0x4f0d05['root']['rootName']){const _0x9be05b=_0x4b523d['schema']['getNearestSelectionRange'](_0xabfc70['deletionPosition']);_0x9be05b?(_0x4f0d05['start']=_0x9be05b['start'],_0x4f0d05['end']=_0x9be05b['end']):(_0x4ac76f['delete'](_0x27950c['name']),_0x4f0d05['detach']());}});}}});}),_0x4b523d['document']['on']('change',()=>{_0x4ac76f['size']>0x0&&_0x4b523d['enqueueChange']({'isUndoable':!0x1},_0x18a668=>{for(const [_0x5882d3,_0x149389]of _0x4ac76f)'$graveyard'==_0x4b523d['markers']['get'](_0x5882d3)['getRange']()['root']['rootName']&&(J(_0x5882d3['split'](':')[0x2],_0x149389['toRange'](),_0x4b523d,_0x18a668),_0x149389['detach']());_0x4ac76f['clear']();});});}(_0x144bb2),this['_domEmitter']['listenTo'](_0x4f23f6['document'],'keydown',(_0x906a8f,{key:_0x24688a})=>{'Escape'===_0x24688a&&function(_0x5bda3d){_0x5bda3d['editing']['view']['change'](_0x2321b3=>{for(const _0x396129 of _0x5bda3d['model']['markers']){if(!_0x396129['name']['startsWith']('user:position'))continue;const _0x4b9cd8=_0x5bda3d['editing']['mapper']['markerNameToElements'](_0x396129['name']);if(_0x4b9cd8){for(const _0x4fc304 of _0x4b9cd8)_0x2321b3['removeClass']('ck-user__marker_hovered',_0x4fc304);}}});}(_0x144bb2);},{'useCapture':!0x0});}['afterInit'](){const _0x6b1a66=this['editor'],_0x293db2=_0x6b1a66['commands']['get']('undo');_0x293db2&&_0x6b1a66['model']['on']('applyOperation',(_0x2f7d18,_0x19cc4d)=>{const _0x492311=_0x19cc4d[0x0];if(!_0x492311['isDocumentOperation'])return;if('marker'!=_0x492311['type']||!_0x492311['name']['startsWith']('user:'))return;const _0x13e683=_0x492311['batch'];_0x293db2['_createdBatches']['has'](_0x13e683)&&(_0x492311['newRange']=_0x492311['oldRange']?_0x6b1a66['model']['createRange'](_0x492311['oldRange']['start'],_0x492311['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x301e9e=this['editor'],_0x4924b9=_0x301e9e['model']['document'],_0x3ea20a=_0x301e9e['plugins']['get'](i);_0x301e9e['model']['enqueueChange']({'isUndoable':!0x1},_0x46081a=>{const _0x139bf7='user:range:'+_0x3ea20a['mySessionId'],_0x4528d5='user:position:'+_0x3ea20a['mySessionId'],_0x423222=_0x301e9e['model']['markers']['has'](_0x139bf7);_0x301e9e['editing']['view']['hasDomSelection']?J(_0x3ea20a['mySessionId'],_0x4924b9['selection']['getFirstRange'](),_0x301e9e['model'],_0x46081a):_0x423222&&(_0x46081a['removeMarker'](_0x139bf7),_0x46081a['removeMarker'](_0x4528d5));});}}function J(_0x5af646,_0xf4d91a,_0x8010fd,_0x3b27b0){const _0x454871='user:range:'+_0x5af646,_0x95fca1='user:position:'+_0x5af646,_0x5a7da2=_0xf4d91a['getContainedElement']();let _0x25172a=_0xf4d91a['start'];if(_0x5a7da2&&_0x5a7da2['is']('element','tableCell')){const _0x3e51d3=function(_0x3f4349,_0x18241f){for(const _0x2b4920 of _0x3f4349['getPositions']())if(_0x18241f['schema']['checkChild'](_0x2b4920,'$text'))return _0x2b4920;}(_0xf4d91a,_0x8010fd);_0x3e51d3&&(_0x25172a=_0x3e51d3,_0xf4d91a=_0x3b27b0['createRange'](_0x25172a));}const _0x2a3e57=_0x3b27b0['createRange'](_0x25172a);_0x8010fd['markers']['has'](_0x454871)?(_0x3b27b0['updateMarker'](_0x454871,{'range':_0xf4d91a}),_0x3b27b0['updateMarker'](_0x95fca1,{'range':_0x2a3e57})):(_0x3b27b0['addMarker'](_0x454871,{'range':_0xf4d91a,'usingOperation':!0x0}),_0x3b27b0['addMarker'](_0x95fca1,{'range':_0x2a3e57,'usingOperation':!0x0}));}function E(_0x98b90a,_0xb00439,_0x17ad28){const _0xa26d26=_0x98b90a['t'],t=_0x98b90a['t'];switch(_0xb00439){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 _0xa26d26({'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'},_0x17ad28);default:return'';}}let H=0x1;class l extends _0x4c92a1{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x1fb470)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,C,_0x1dfa6f,_0x2f4184,_0x586280];}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 _0x4c8f12=this['serverHistory']['getOperations']();for(let _0x2f4f73=_0x4c8f12['length']-0x1;_0x2f4f73>=0x0;_0x2f4f73--){const _0xb7b12=_0x4c8f12[_0x2f4f73];if(!this['_disconnectionOperations']['has'](_0xb7b12))return _0xb7b12['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x208f8e){if(super(_0x208f8e),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x55cfe8(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x4480f3('collaboration-missing-channelid',this);const _0x36bab3=_0x208f8e['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x36bab3,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1185d6(),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 _0x56a900=this['editor'],_0x5799c6=_0x56a900['plugins']['get'](_0x2f4184),_0x44b49a=_0x56a900['plugins']['get'](n);this['listenTo'](_0x5799c6,'getOperationAuthor',(_0x264a17,_0x3e152e)=>{const _0x3bbf99=_0x3e152e[0x0];_0x3bbf99['_authorId']&&(_0x264a17['return']=_0x5799c6['getUser'](_0x3bbf99['_authorId']),_0x264a17['stop']()),null===_0x3bbf99['_authorId']&&(_0x264a17['return']=null,_0x264a17['stop']());},{'priority':'high'}),this['listenTo'](_0x56a900['model']['document']['selection'],'change:range',(_0x4deb8d,_0x48f53f)=>{_0x48f53f['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x56a900['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x56a900['model']['on']('applyOperation',(_0x18ab9e,_0x1ec6b7)=>{const _0x32752d=_0x1ec6b7[0x0];_0x32752d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x32752d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x44b49a,'state',this,'_hasSynchronizationProblem',(_0x129e33,_0x3d1ca7)=>'connected'===_0x129e33&&!_0x3d1ca7),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x56a900['disableReadOnlyMode']('rtc-offline'):_0x56a900['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x56a900['disableReadOnlyMode']('rtc-offline'):_0x56a900['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x182052=this['editor']['plugins']['get'](i),_0x14a585=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x182052['unregister'](this['_channelId']);const _0x1e0469=await this['_service']['reconnect'](_0x14a585['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1e0469)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3dbbdc=await this['_service']['getConnectedSessions']();_0x182052['register'](this['_channelId'],_0x3dbbdc),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4eca83){if(function(_0x365b2d){return'404'===_0x365b2d['code'];}(_0x4eca83)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x29f2ed){return'409'===_0x29f2ed['code'];}(_0x4eca83)){const _0x2b4a5b=E(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'](_0x2b4a5b);}else{if(!(_0x4eca83 instanceof V))throw _0x4eca83;this['_handleReconnectionError']();}}}}['destroy'](){const _0xac512c=this['editor']['plugins']['get'](n),_0x59c29c=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x59c29c['channelSessions']['has'](this['_channelId'])&&_0x59c29c['unregister'](this['_channelId']),_0xac512c['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4b07c4){if(this['sessionId']!==_0x4b07c4['sessionId']&&this['_lastSyncedOperationId']!==_0x4b07c4['lastOperationId'])throw new V();return this['sessionId']=_0x4b07c4['sessionId'],this['_handleServerResponse']([],{..._0x4b07c4,'wereChangesApplied':!0x1,'data':_0x4b07c4['data']},'reconnect');}async['_connectService'](_0x11215d,_0x2fcadb=!0x1){const {connection:_0x100518}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x100518,this['_channelId'])['then'](_0x115549=>this['_initSessionsHandling'](_0x115549))['catch'](_0x5a8102=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5a8102);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x22c805,_0x4a1dda)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x4a1dda);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0xd0591=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x11215d);this['_isPendingUpdate']=!0x0;const _0x2661f3=await this['_service']['connect'](_0x100518,this['_compressOperations'](_0x11215d),_0xd0591);if(this['sessionId']=_0x2661f3['sessionId'],_0x2fcadb){if(!_0x2661f3['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x2661f3['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x11215d,_0x2661f3,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x2661f3,_0x11215d);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1a575e=this['editor']['plugins']['get'](i),_0x348d43=this['editor']['plugins']['get'](C),_0x3d6202=_0x1a575e['channelSessions']['get'](this['_channelId']);_0x3d6202&&_0x3d6202['length']>0x1?_0x348d43['createUserMarkerOperations']():this['listenTo'](_0x1a575e,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1a575e['channelSessions']['get'](this['_channelId'])['length']&&_0x348d43['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x37cd15,_0x48cf3e,_0x73d06b,_0x2d6943){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x48cf3e){const _0x52442e=this['_decompressOperations'](_0x73d06b,_0x2d6943);await this['_fetchMissingUsers'](_0x52442e),this['_handleExternalOperations'](_0x52442e,_0x48cf3e,_0x73d06b['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x27d48b}=this['editor'];let _0x44d66b;try{_0x44d66b=await this['_service']['getDocumentDetails']();}catch{const _0x369c72=E(_0x27d48b,'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'](_0x369c72);}const _0x6b5d2d=_0x44d66b['currentDocumentSession']||_0x44d66b['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x6b5d2d['lastOperationId']){const _0x4307c1=E(_0x27d48b,'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'](_0x4307c1);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xb282a5){const _0x3bd8a6=this['editor']['plugins']['get'](i);this['listenTo'](_0x3bd8a6,'sessionAdd:'+this['_channelId'],(_0xe9a24e,{session:_0x155575})=>{if(_0x155575['id']===_0x3bd8a6['mySessionId']){_0xe9a24e['off']();const _0x230489=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2c3535=_0x155575['permissions'];_0x230489&&_0x230489['isEnabled']&&(_0x2c3535=_0x2c3535['filter'](_0x1e543e=>'document:write'!==_0x1e543e)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2c3535,this['_channelId']);}}),_0x3bd8a6['register'](this['_channelId'],_0xb282a5);}['_initThrowingOnDataSet'](){const _0x2a5d33=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2503e0)=>{if(!_0x2503e0[_0x2503e0['length']-0x1]['suppressErrorInCollaboration'])throw new _0x4480f3('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2a5d33['apply'](this['editor']['data'],_0x2503e0);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0xae6b07,[_0x398bbe])=>{if(this['_document']['version'])throw new _0x4480f3('realtimecollaborationclient-init-document-already-initialized',this);_0xae6b07['stop'](),this['_setPendingAction']();const _0xc52f8f=this['editor']['config']['get']('rootsAttributes'),_0x449875=this['_getOperationsFromInitData'](_0x398bbe,_0xc52f8f);0x0==_0x449875['length']&&_0x449875['push'](new _0x2027f0(0x0)),_0xae6b07['return']=this['_connectService'](_0x449875)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x12b3e3=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x12b3e3))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x2eb221,[_0x2892fa,_0x395fa2])=>{_0x2eb221['stop']();const _0x3b86ef=this['editor']['model']['document']['getRoot'](_0x2892fa);if(!this['_knownRootNames']['has'](_0x2892fa)){const _0x164e2e=_0x395fa2&&_0x395fa2['data']?_0x395fa2['data']:'',_0x592e06=_0x395fa2&&_0x395fa2['attributes']?_0x395fa2['attributes']:{};await this['_loadRoot'](_0x2892fa,_0x164e2e,_0x592e06);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3b86ef['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3b86ef);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x3c4845){const _0x22aaa3=this['editor']['plugins']['get'](_0x2f4184),{connection:_0x1762f8}=this['editor']['plugins']['get'](n),_0xb98b74=new Set();for(const _0xba910a of _0x3c4845){const _0x18ae0f=_0xba910a['_authorId'];_0x18ae0f&&!_0x22aaa3['getUser'](_0x18ae0f)&&_0xb98b74['add'](_0x18ae0f);}if(0x0===_0xb98b74['size'])return;const _0x2037e7=await ut['getMany'](_0x1762f8,Array['from'](_0xb98b74));for(const _0x377aa5 of _0x2037e7)_0x22aaa3['getUser'](_0x377aa5['id'])||_0x22aaa3['addUser'](_0x377aa5);}['_getOperationsFromInitData'](_0x838c25,_0x33ccf7={}){const _0xa62cbb=this['editor']['model'],_0x3e2d3d=[];let _0x34dfa0=0x0;const _0xabfd7f='string'==typeof _0x838c25?{'main':_0x838c25}:_0x838c25;for(const _0x5d83bb of Object['keys'](_0xabfd7f)){if(!this['_document']['roots']['has'](_0x5d83bb))throw new _0x4480f3('realtimecollaborationclient-init-non-existent-root',this);const _0x188303=this['editor']['data']['parse'](_0xabfd7f[_0x5d83bb]),_0x398f5d=this['_document']['getRoot'](_0x5d83bb),_0x326a39=new _0x2b0acb(_0xa62cbb['createPositionAt'](_0x398f5d,0x0),_0x188303,_0x34dfa0++);_0x3e2d3d['push'](_0x326a39);for(const [_0xd5c640,_0x23d3ac]of _0x188303['markers']){const _0x134176=_0xa62cbb['createRange'](_0xa62cbb['createPositionFromPath'](_0x398f5d,_0x23d3ac['start']['path']['slice']()),_0xa62cbb['createPositionFromPath'](_0x398f5d,_0x23d3ac['end']['path']['slice']())),_0x49c128=new _0x2f15c0(_0xd5c640,null,_0x134176,_0xa62cbb['markers'],!0x0,_0x34dfa0++);_0x3e2d3d['push'](_0x49c128);}}if(_0x33ccf7)for(const [_0x47da9d,_0x5e1a1f]of Object['entries'](_0x33ccf7)){const _0x2dbcf1=_0xa62cbb['document']['getRoot'](_0x47da9d);if(!_0x2dbcf1)throw new _0x4480f3('multi-root-editor-root-attributes-no-root',null);for(const [_0x477b45,_0xd40c12]of Object['entries'](_0x5e1a1f))if(null!==_0xd40c12){const _0x318a03=new _0x184a0c(_0x2dbcf1,_0x477b45,null,_0xd40c12,_0x34dfa0++);_0x3e2d3d['push'](_0x318a03);}}return _0x3e2d3d;}async['_loadRoot'](_0x4988de,_0x3aad42,_0x8a9613){this['_getOperationsFromInitData']({[_0x4988de]:_0x3aad42},{[_0x4988de]:_0x8a9613})['forEach']((_0x414f69,_0x496133)=>{_0x414f69['baseVersion']=this['_document']['version']+_0x496133,_0x414f69['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x414f69);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x27f07b,_0x47d422){let _0x4f42b7;this['_offset']=_0x27f07b['offset'];const _0x4faf86=_0x27f07b['wereChangesApplied']&&!_0x27f07b['initData'],_0x5b6a04=_0x4faf86?0x0:_0x27f07b['data']['baseVersion'];if(_0x47d422['forEach'](_0x22ef5f=>{_0x22ef5f['_isInit']=!0x0,_0x22ef5f['createdAt']=_0x27f07b['sessionCreatedAt'],_0x22ef5f['_authorId']=null;}),_0x4faf86)_0x4f42b7=_0x47d422,this['_applyOperationsSet'](_0x4f42b7,_0x4faf86);else{if(_0x27f07b['initData']){const _0x5689a8=this['_getOperationsFromInitData'](_0x27f07b['initData']);this['_document']['history']['version']=-_0x5689a8['length'],_0x5689a8['forEach'](_0x151886=>{_0x151886['baseVersion']-=_0x5689a8['length'],_0x151886['createdAt']=_0x27f07b['sessionCreatedAt'],_0x151886['_isInit']=!0x0,_0x151886['_authorId']=null;}),this['_applyOperationsSet'](_0x5689a8,!0x0),this['serverHistory']['version']=-_0x5689a8['length']+this['_offset'],this['_updateServerHistory'](_0x5689a8);}this['_document']['history']['version']=_0x5b6a04,_0x4f42b7=this['_decompressOperations'](_0x27f07b['data'],_0x27f07b['metadata']),await this['_fetchMissingUsers'](_0x4f42b7),this['_applyOperationsSet'](_0x4f42b7,_0x4faf86);}_0x27f07b['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4f42b7,_0x27f07b['lastOperationId']),this['_lastSyncedOperationId']=_0x27f07b['lastOperationId']),this['serverHistory']['version']=_0x5b6a04+this['_offset'],this['_updateServerHistory'](_0x4f42b7),_0x47d422['filter'](_0x2676df=>{const _0x23d0b9=this['_getAffectedRoot'](_0x2676df);return _0x23d0b9&&!this['_knownRootNames']['has'](_0x23d0b9);})['forEach']((_0x2062d4,_0x2b9b1b)=>{_0x2062d4['baseVersion']=this['_document']['version']+_0x2b9b1b,this['_saveOperationInBuffer'](_0x2062d4);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x225b2c,_0x4a83fc){const _0x429574=_0x4a83fc&&_0x4a83fc['message'];if(_0x429574&&_0x429574['startsWith']('realtimecollaborationclient'))throw _0x4a83fc;const _0x1d7117=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x1d7117['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x4480f3(_0x225b2c,this['editor'],_0x429574?{'originalError':_0x429574}:void 0x0);}['_saveOperationInBuffer'](_0x4335ce){this['_knownOperations']['has'](_0x4335ce)||(this['_knownOperations']['add'](_0x4335ce),this['_bufferedOperations']['push'](_0x4335ce),this['_pendingAction']||'marker'==_0x4335ce['type']&&!_0x4335ce['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x50d510=!0x1){!_0x50d510&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x34c4f0=>{_0x34c4f0&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x6bbe0f=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x2b74f4){return _0x2b74f4['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2b74f4['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2b74f4['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x6bbe0f)||this['_crash'](_0x6bbe0f['message'],_0x6bbe0f);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x2b7185=>{this['on']('change:_isPendingUpdate',()=>{_0x2b7185();});});}async['_sendBufferedOperations'](){const _0x347286=this['editor']['plugins']['get'](C);if(this['_shouldSendSelectionUpdate']()&&(_0x347286['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x221ff4=[...this['_bufferedOperations']];for(const _0x799980 of _0x221ff4)_0x799980['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x799980);const _0xedc562=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x221ff4),_0x1425ad=H++,_0x2cec3c=this['_compressOperations'](_0x221ff4),_0x28e139=await this['_service']['sendOperations'](_0x2cec3c,_0x2cec3c['baseVersion'],_0xedc562);try{return await this['_handleServerResponse'](_0x221ff4,_0x28e139,_0x1425ad);}catch(_0x53a9ad){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x53a9ad);}}async['_handleServerResponse'](_0x27b8be,_0x183869,_0x223f07){if('error'in _0x183869)throw _0x183869['error'];let _0xe744c2=!0x1;if(_0x183869['wereChangesApplied']){_0x183869['lastOperationId']&&(this['_lastSyncedOperationId']=_0x183869['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x27da60=>!_0x27b8be['includes'](_0x27da60));for(const _0x13b5b3 of _0x27b8be)_0x13b5b3['createdAt']='lastOperationAcceptedAt'in _0x183869&&_0x183869['lastOperationAcceptedAt']||void 0x0;W(_0x27b8be,_0x183869['version']-_0x27b8be['length']),this['_updateServerHistory'](_0x27b8be);const _0xa9fff8=_0x27b8be['filter'](_0x318f31=>{if(!_0x318f31['_isInit'])return!0x1;const _0x5e4ebd=this['_getAffectedRoot'](_0x318f31);return _0x5e4ebd&&!this['_knownRootNames']['has'](_0x5e4ebd);});W(_0xa9fff8,this['_document']['version']),this['_applyOperationsSet'](_0xa9fff8),_0xe744c2=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3139a9=this['_decompressOperations'](_0x183869['data'],_0x183869['metadata'])['filter'](_0x58d4be=>_0x58d4be['baseVersion']>=this['_lastServerVersion']);_0x3139a9['forEach'](_0x4f3ee5=>this['_addKnownRoot'](_0x4f3ee5)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x47c2a2=>!_0x47c2a2['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x47c2a2))),this['_bufferedOperations']['length']&&W(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3139a9),_0xe744c2=this['_handleExternalOperations'](_0x3139a9,_0x183869['version'],_0x183869['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0xe744c2?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2f9bd5,_0x30e6f0,_0x5f31bc){try{const _0x2ceaa0={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1ab7e4,operationsB:_0x180d86,originalOperations:_0x1f4775}=_0x3309e7(_0x2f9bd5,this['_bufferedOperations'],_0x2ceaa0);W(_0x1ab7e4,this['_document']['version']),W(_0x180d86,_0x30e6f0);for(const _0x2a57f0 of _0x1ab7e4){const _0x2775e5=_0x1f4775['get'](_0x2a57f0);_0x2a57f0['_authorId']=_0x2775e5?_0x2775e5['_authorId']:null;}_0x5f31bc&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2f9bd5,_0x5f31bc),this['_lastSyncedOperationId']=_0x5f31bc),this['_bufferedOperations']=[..._0x180d86],this['_applyOperationsSet'](_0x1ab7e4),this['_updateServerHistory'](_0x2f9bd5);}catch(_0x3743bd){return console['error'](_0x3743bd),!0x1;}return!0x0;}['_applyOperationsSet'](_0x39a775,_0x9275e8=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5afce4=>{for(const _0x4bd45a of _0x39a775)this['_knownOperations']['add'](_0x4bd45a),this['_addKnownRoot'](_0x4bd45a),_0x5afce4['batch']['addOperation'](_0x4bd45a),this['editor']['model']['applyOperation'](_0x4bd45a);});}['_addKnownRoot'](_0x3afdd4){const _0x50e4ef=this['_getAffectedRoot'](_0x3afdd4);_0x50e4ef&&this['_knownRootNames']['add'](_0x50e4ef);}['_getAffectedRoot'](_0x2af558){let _0x410d32,_0x5d01c4;switch(_0x2af558['type']){case'insert':_0x410d32=_0x2af558['position']['root'];break;case'marker':if(_0x5d01c4=_0x2af558['newRange'],!_0x5d01c4)return null;_0x410d32=_0x5d01c4['root'];break;case'addRootAttribute':_0x410d32=_0x2af558['root'];break;case'addRoot':_0x410d32=_0x2af558['affectedSelectable'];break;case'move':_0x410d32=_0x2af558['targetPosition']['root'];break;default:return null;}return _0x410d32['rootName'];}['_updateServerHistory'](_0x54044e){_0x54044e['forEach'](_0x416434=>{const _0x1fdfea=_0x416434['clone']();_0x1fdfea['_authorId']=_0x416434['_authorId'],_0x1fdfea['_isInit']=!!_0x416434['_isInit'],_0x1fdfea['createdAt']=_0x416434['createdAt'],_0x1fdfea['baseVersion']+=this['_offset'],_0x416434['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x1fdfea),this['serverHistory']['addOperation'](_0x1fdfea);});}['_handleReconnectionError'](_0x13a2a3){const _0x20d4d4=this['editor']['plugins']['get']('Notification'),_0x35b099=this['editor']['locale'];_0x13a2a3||(_0x13a2a3=E(_0x35b099,'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.')),_0x20d4d4['showWarning'](_0x13a2a3,{'title':E(_0x35b099,'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'](_0x1dfa6f)['add'](E(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1dfa6f)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x56fac9){const _0x5ca847=_0x56fac9['map'](_0x503061=>_0x503061['toJSON']());return this['_compressor']['compress'](_0x5ca847);}['_decompressOperations'](_0x29c48a,_0x46fb81){return this['_compressor']['decompress'](_0x29c48a)['map']((_0x1680fb,_0x5ed16e)=>{const _0x1cc9bb='init'==_0x46fb81[_0x5ed16e]['type'];if('InsertOperation'==_0x1680fb['__className']){const _0x214602=_0x1680fb['position']['root'];!this['_document']['getRoot'](_0x214602)&&(this['_document']['createRoot']('$root',_0x214602)['_isAttached']=!0x1);}const _0x4c7b51=_0x88f58c['fromJSON'](_0x1680fb,this['_document']);return _0x4c7b51['wasUndone']=_0x1680fb['wasUndone'],_0x4c7b51['_isInit']=_0x1cc9bb,_0x4c7b51['_authorId']=_0x1cc9bb?null:_0x46fb81[_0x5ed16e]['userId'],_0x4c7b51['_isDisconnection']='cs:removeUser'===_0x46fb81[_0x5ed16e]['type'],_0x4c7b51['createdAt']=_0x46fb81[_0x5ed16e]['createdAt'],_0x4c7b51;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x1f3cd6=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x1f3cd6&&_0x1f3cd6['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class V extends Error{}function W(_0x1c2e73,_0x28bd0b){for(const _0x40c367 of _0x1c2e73)_0x40c367['baseVersion']=_0x28bd0b++;}class F{['_ignoredOperations'];['_operationToId'];constructor(_0x14c2d7){this['_ignoredOperations']=_0x14c2d7,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x58f686){let _0x597ee8=_0x58f686['length'];for(;_0x597ee8--;){const _0x7f45cd=_0x58f686[_0x597ee8];if(!this['_ignoredOperations']['has'](_0x7f45cd)){if(!this['_operationToId']['has'](_0x7f45cd)){const _0x4df144=_0x1b1925()['slice'](0x1,0x12);this['_operationToId']['set'](_0x7f45cd,_0x4df144);}return this['_operationToId']['get'](_0x7f45cd);}}}['setIdForTheLastOperation'](_0x41021b,_0x15b770){if(!_0x15b770)return;let _0x33ddfd=_0x41021b['length'];for(;_0x33ddfd--;){const _0x1b7dbb=_0x41021b[_0x33ddfd];this['_ignoredOperations']['has'](_0x1b7dbb)||this['_operationToId']['set'](_0x1b7dbb,_0x15b770);}}}class a extends _0x4c92a1{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x1ad809{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>ot)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x2f4184];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4c438a){super(_0x4c438a),this['_services']=new Map();}async['init'](){const _0x4670c3=this['context'],_0x226a26=_0x4670c3['plugins']['get']('CommentsRepository');if(_0x4670c3['plugins']['get'](n)['addToReconnectionStack'](this),_0x226a26['adapter']={'addCommentThread':async({channelId:_0x11c9a3,threadId:_0x1a7a12,comments:_0x2a313f,resolvedAt:_0x551f80,resolvedBy:_0x59ff8d,context:_0x14f7d1,attributes:_0x524c36})=>{const _0x3692b3=await this['_getService'](_0x11c9a3)['addCommentThread']({'commentThreadId':_0x1a7a12,'comments':_0x2a313f['map'](_0x182a54=>function(_0x5e21b2,_0x5bb327,_0xd1997){return{'commentThreadId':_0xd1997,'commentId':_0x5e21b2['commentId'],'userId':_0x5e21b2['authorId'],'content':_0x5e21b2['content'],'documentId':_0x5bb327,'createdAt':_0x5e21b2['createdAt'],'attributes':_0x5e21b2['attributes']||{}};}(_0x182a54,_0x11c9a3,_0x1a7a12)),'resolvedAt':_0x551f80,'resolvedBy':_0x59ff8d,'context':_0x14f7d1,'attributes':_0x524c36})['catch'](ft);return{'threadId':_0x3692b3['commentThreadId'],'comments':_0x3692b3['comments']};},'getCommentThread':async({channelId:_0x140c2c,threadId:_0x40e6ef})=>{const _0x372faf=await this['_getService'](_0x140c2c)['getCommentThread'](_0x40e6ef)['catch'](nt)['catch'](ft);return _0x372faf?_0x372faf['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x372faf]),{'threadId':_0x372faf['commentThreadId'],'comments':_0x372faf['comments']['map'](st),'context':_0x372faf['context'],'resolvedAt':_0x372faf['resolvedAt'],'resolvedBy':_0x372faf['resolvedBy'],'attributes':_0x372faf['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x4d71f2,threadId:_0x3e17fe,context:_0x36fb77,unlinkedAt:_0x253e7c,attributes:_0x25f98b})=>this['_getService'](_0x4d71f2)['updateCommentThread']({'commentThreadId':_0x3e17fe,'context':_0x36fb77,'attributes':_0x25f98b,'unlinkedAt':_0x253e7c})['catch'](nt)['catch'](ft),'resolveCommentThread':async({channelId:_0xf1d867,threadId:_0x379ee1})=>{const _0x1fc74e=await this['_getService'](_0xf1d867)['resolveCommentThread'](_0x379ee1)['catch'](nt)['catch'](ft);return{'threadId':_0x1fc74e['commentThreadId'],'resolvedAt':_0x1fc74e['resolvedAt'],'resolvedBy':_0x1fc74e['resolvedBy']};},'reopenCommentThread':async({channelId:_0x245b23,threadId:_0x9b58a1})=>this['_getService'](_0x245b23)['reopenCommentThread'](_0x9b58a1)['catch'](nt)['catch'](ft),'removeCommentThread':({channelId:_0x50ebc2,threadId:_0x5c520e})=>this['_getService'](_0x50ebc2)['removeCommentThread'](_0x5c520e)['catch'](nt)['catch'](ft),'addComment':({channelId:_0x5917d9,threadId:_0x150f87,commentId:_0x928d8e,content:_0x57679b,attributes:_0x372ee4})=>this['_getService'](_0x5917d9)['addComment'](_0x150f87,_0x928d8e,_0x57679b,_0x372ee4)['catch'](ft),'updateComment':({channelId:_0x222ed6,threadId:_0x5567be,commentId:_0x3e3a4f,content:_0x44ae43,attributes:_0x26971b})=>this['_getService'](_0x222ed6)['updateComment'](_0x5567be,_0x3e3a4f,_0x44ae43,_0x26971b)['catch'](nt)['catch'](ft),'removeComment':({channelId:_0x48c000,threadId:_0x435293,commentId:_0x24aa00})=>this['_getService'](_0x48c000)['removeComment'](_0x435293,_0x24aa00)['catch'](nt)['catch'](ft)},_0x4670c3 instanceof et){const _0x9df69d=_0x4670c3['config']['get']('collaboration.channelId'),_0x250227=_0x4670c3['plugins']['get'](i);await this['_setUpService'](_0x9df69d);const _0x1383cd=await this['_services']['get'](_0x9df69d)['getConnectedSessions']();this['listenTo'](_0x250227,'sessionAdd:'+_0x9df69d,(_0x13d1a6,{session:_0x1d8e4e})=>{_0x1d8e4e['id']===_0x250227['mySessionId']&&(_0x13d1a6['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x1d8e4e['permissions'],_0x9df69d));}),_0x250227['register'](_0x9df69d,_0x1383cd);}}async['_setUpService'](_0x3fa6c7){if(this['_services']['has'](_0x3fa6c7))throw new _0x4480f3('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x3fa6c7});const _0x4b080e=this['context']['plugins']['get']('CommentsRepository'),_0x31fcfc=new s['CommentsService'](_0x3fa6c7);this['_services']['set'](_0x3fa6c7,_0x31fcfc),this['listenTo'](_0x31fcfc,'commentThreadAdded',(_0x119b32,_0x5de5b2)=>{const {commentThreadId:_0x425b2f,documentId:_0x6b99b0,context:_0x1f961c,attributes:_0x27e499,resolvedAt:_0x3a9143,resolvedBy:_0x585eb4,comments:_0x13b9dd}=_0x5de5b2;_0x4b080e['getCommentThread'](_0x425b2f)||_0x4b080e['addCommentThread']({'threadId':_0x425b2f,'channelId':_0x6b99b0,'comments':_0x13b9dd?_0x13b9dd['map'](st):[],'context':_0x1f961c,'attributes':_0x27e499,'resolvedAt':_0x3a9143,'resolvedBy':_0x585eb4,'isFromAdapter':!0x0});}),this['listenTo'](_0x31fcfc,'commentThreadUpdated',(_0x3c5851,{commentThreadId:_0x1dc109,documentId:_0x39cd52,context:_0x32e0bc,unlinkedAt:_0x21c1a9,attributes:_0x593258})=>{_0x4b080e['getCommentThread'](_0x1dc109)&&_0x4b080e['updateCommentThread']({'threadId':_0x1dc109,'channelId':_0x39cd52,'context':_0x32e0bc,'unlinkedAt':_0x21c1a9,'attributes':_0x593258,'isFromAdapter':!0x0});}),this['listenTo'](_0x31fcfc,'commentThreadResolved',(_0x5b6fc2,{commentThreadId:_0x4beb78,resolvedBy:_0x20fad2,resolvedAt:_0x15f643})=>{const _0x619e58=_0x4b080e['getCommentThread'](_0x4beb78);_0x619e58&&_0x619e58['resolve']({'resolvedBy':_0x20fad2,'resolvedAt':_0x15f643,'isFromAdapter':!0x0});}),this['listenTo'](_0x31fcfc,'commentThreadReopened',(_0x20888f,{commentThreadId:_0x5646b1})=>{const _0x3584e7=_0x4b080e['getCommentThread'](_0x5646b1);_0x3584e7&&_0x3584e7['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x31fcfc,'commentThreadRemoved',(_0x31ef6f,{commentThreadId:_0x92f3c5})=>{const _0x83af32=_0x4b080e['getCommentThread'](_0x92f3c5);_0x83af32&&_0x83af32['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x31fcfc,'commentAdded',(_0x19847e,_0x5b7177)=>{const _0x4b03ca=_0x5b7177['commentThreadId'],_0x3590a5=_0x4b080e['getCommentThread'](_0x4b03ca);_0x3590a5&&_0x3590a5['addComment']({...st(_0x5b7177),'isFromAdapter':!0x0});}),this['listenTo'](_0x31fcfc,'commentUpdated',(_0x54d2bd,{commentThreadId:_0x322ec6,commentId:_0x1a50f2,content:_0x16f6c9,attributes:_0x567863})=>{const _0x37fd5a=_0x4b080e['getCommentThread'](_0x322ec6);if(_0x37fd5a){const _0x1c41b9=_0x37fd5a['getComment'](_0x1a50f2);_0x1c41b9&&_0x1c41b9['update']({'content':_0x16f6c9,'attributes':_0x567863,'isFromAdapter':!0x0});}}),this['listenTo'](_0x31fcfc,'commentRemoved',(_0x5abe67,{commentThreadId:_0x70b52a,commentId:_0x35b625})=>{const _0x19feac=_0x4b080e['getCommentThread'](_0x70b52a);if(_0x19feac){const _0x439fe4=_0x19feac['getComment'](_0x35b625);_0x439fe4&&_0x439fe4['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x3fa6c7);}['destroy'](){if(this['context']instanceof et){const _0x203f08=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x203f08);}}['_terminateService'](_0x437348){if(!this['_services']['has'](_0x437348))throw new _0x4480f3('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x437348});this['_getService'](_0x437348)['disconnect'](),this['_services']['delete'](_0x437348);}async['reconnect'](){for(const _0x58b064 of this['_services']['keys']())await this['_connectService'](_0x58b064);if(this['context']instanceof et){const _0x45bf8b=this['context']['config']['get']('collaboration.channelId'),_0x1b66b1=this['context']['plugins']['get'](i);_0x1b66b1['unregister'](_0x45bf8b);const _0x241104=await this['_services']['get'](_0x45bf8b)['getConnectedSessions']();_0x1b66b1['register'](_0x45bf8b,_0x241104);}}async['_connectService'](_0x1f3a69){const {connection:_0x37cb64}=this['context']['plugins']['get'](n),_0x23d333=this['context']['plugins']['get']('CommentsRepository'),_0x95b3b6=this['_services']['get'](_0x1f3a69),_0x2c05b8=await _0x95b3b6['connect'](_0x37cb64);await this['_fetchMissingUsersForThreads'](_0x2c05b8);const _0x18c7c8=new Set(Array['from'](_0x23d333['getCommentThreads']({'channelId':_0x1f3a69}),_0x4cab12=>_0x4cab12['id']));for(const _0x972a24 of _0x2c05b8)_0x972a24['deletedAt']||_0x18c7c8['delete'](_0x972a24['commentThreadId']);for(const _0x2779b7 of _0x18c7c8)_0x23d333['getCommentThread'](_0x2779b7)['remove']({'isFromAdapter':!0x0});for(const _0x3a3049 of _0x2c05b8){let _0x2905e2=_0x23d333['getCommentThread'](_0x3a3049['commentThreadId']);const {commentThreadId:_0x5ccea7,context:_0x18e3ec,attributes:_0x3062cd,resolvedBy:_0xf576c,resolvedAt:_0x2f9296,unlinkedAt:_0xa082cd,deletedAt:_0x2d821f}=_0x3a3049;if(_0x2d821f)continue;_0x2905e2||(_0x2905e2=_0x23d333['addCommentThread']({'channelId':_0x1f3a69,'threadId':_0x5ccea7,'context':_0x18e3ec,'attributes':_0x3062cd||{},'resolvedBy':_0xf576c,'resolvedAt':_0x2f9296,'unlinkedAt':_0xa082cd,'isFromAdapter':!0x0}));const _0x482d25=new Set(Array['from'](_0x2905e2['comments'],_0x3ec9f8=>_0x3ec9f8['id']));for(const _0x5cb55c of _0x3a3049['comments'])_0x482d25['delete'](_0x5cb55c['commentId']);for(const _0x4d69da of _0x482d25)_0x2905e2['getComment'](_0x4d69da)['remove']({'isFromAdapter':!0x0});for(const _0x15efcd of _0x3a3049['comments']){const _0x31bf57=_0x2905e2['getComment'](_0x15efcd['commentId']);_0x31bf57?_0x31bf57['content']!==_0x15efcd['content']&&_0x31bf57['update']({'content':_0x15efcd['content'],'isFromAdapter':!0x0}):_0x2905e2['addComment'](Object['assign'](st(_0x15efcd),{'isFromAdapter':!0x0}));}}}['_getService'](_0x45a426){if(!this['_services']['has'](_0x45a426))throw new _0x4480f3('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x45a426});return this['_services']['get'](_0x45a426);}async['_fetchMissingUsersForThreads'](_0x195d75){const _0x461022=this['context']['plugins']['get'](_0x2f4184),{connection:_0x8008ba}=this['context']['plugins']['get'](n),_0x4a6936=new Set();for(const {resolvedBy:_0x222c25,comments:_0x53c902}of _0x195d75){_0x222c25&&!_0x461022['getUser'](_0x222c25)&&_0x4a6936['add'](_0x222c25);for(const {userId:_0x3c6a97}of _0x53c902)_0x461022['getUser'](_0x3c6a97)||_0x4a6936['add'](_0x3c6a97);}if(0x0===_0x4a6936['size'])return;const _0x3a5123=await ut['getMany'](_0x8008ba,Array['from'](_0x4a6936));for(const _0xa4baf9 of _0x3a5123)_0x461022['getUser'](_0xa4baf9['id'])||_0x461022['addUser'](_0xa4baf9);}}async function nt(_0xa7a570){if('404'!==_0xa7a570['code'])throw _0xa7a570;}function ft(_0x5beef2){if((_0xc85e00=_0x5beef2)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0xc85e00['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xc85e00['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0xc85e00;throw _0x5beef2;}function st(_0x2d6ae2){return{'threadId':_0x2d6ae2['commentThreadId'],'commentId':_0x2d6ae2['commentId'],'content':_0x2d6ae2['content'],'createdAt':_0x2d6ae2['createdAt'],'authorId':_0x2d6ae2['userId'],'attributes':_0x2d6ae2['attributes']||{}};}class m extends _0x4c92a1{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50210e){super(_0x50210e);const _0x5a6bc0=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x5a6bc0);}['init'](){const _0x42b148=this['editor']['plugins']['get'](n),_0x322dbb=this['editor']['plugins']['get']('TrackChangesEditing');return _0x322dbb['adapter']={'getSuggestion':async _0x5e37d7=>{await this['_waitForServiceReady']();const _0x1b0557=await this['_trackChangesService']['get'](_0x5e37d7)['catch'](it);return await this['_fetchMissingUsersForThreads']([_0x1b0557]),_0x1b0557;},'addSuggestion':async({id:_0x4b234e,type:_0x26cd60,data:_0x2c05fa,originalSuggestionId:_0x430c9d,attributes:_0x4406b4})=>{await this['_waitForServiceReady']();const _0x4d1919={'id':_0x4b234e,'type':_0x26cd60,'data':_0x2c05fa,'originalSuggestionId':_0x430c9d,'attributes':_0x4406b4},_0x1da13b=await this['_trackChangesService']['add'](_0x4b234e,_0x26cd60,_0x2c05fa,_0x430c9d,_0x4406b4)['catch'](_0x21c38e=>{if(mt(_0x21c38e))return new Promise(_0x2562d6=>{this['_bufferedRequests']['set'](_0x4b234e,{'resolve':_0x2562d6,'suggestionData':_0x4d1919});});throw _0x21c38e;});return this['_bufferedRequests']['delete'](_0x4b234e),_0x1da13b;},'updateSuggestion':async(_0x14f006,_0x5015e1)=>{if(await this['_waitForServiceReady'](),'open'!==_0x5015e1['state'])return this['_trackChangesService']['update'](_0x14f006,_0x5015e1)['catch'](it);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x4bcab7,_0x3cc4ff)=>{_0x322dbb['hasSuggestion'](_0x3cc4ff['id'])&&(_0x322dbb['getSuggestion'](_0x3cc4ff['id'])['attributes']=_0x3cc4ff['attributes']);}),this['_trackChangesService']['connect'](_0x42b148['connection'])['then'](_0x4c6c48=>(_0x42b148['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x4c6c48)['then'](()=>{for(const _0x32416c of _0x4c6c48){_0x322dbb['addSuggestionData'](_0x32416c)['_saved']=!0x0;}})));}async['reconnect'](){const _0x2d4f51=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x327a36}=this['editor']['plugins']['get'](n),_0x41aeca=await this['_trackChangesService']['connect'](_0x327a36);await this['_fetchMissingUsersForThreads'](_0x41aeca);for(const {suggestionData:_0x3504a2,resolve:_0x5c7c11}of this['_bufferedRequests']['values']()){let _0xb6df3=_0x41aeca['find'](_0x5b7ce7=>_0x5b7ce7['id']===_0x3504a2['id']);_0xb6df3||(_0xb6df3=await this['_trackChangesService']['add'](_0x3504a2['id'],_0x3504a2['type'],_0x3504a2['data'],_0x3504a2['originalSuggestionId'])),_0x5c7c11(_0xb6df3);}for(const _0x3487a0 of _0x41aeca)_0x2d4f51['hasSuggestion'](_0x3487a0['id'])||_0x2d4f51['addSuggestionData'](_0x3487a0);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x3bb8ea=>{this['listenTo'](this['_trackChangesService'],'connected',_0x3dbdc9=>{_0x3dbdc9['off'](),_0x3bb8ea();});});}async['_fetchMissingUsersForThreads'](_0x100d15){const _0x3892e3=this['editor']['plugins']['get'](_0x2f4184),{connection:_0x3be315}=this['editor']['plugins']['get'](n),_0x3bf966=new Set();for(const {authorId:_0xd45839}of _0x100d15)_0x3892e3['getUser'](_0xd45839)||_0x3bf966['add'](_0xd45839);if(0x0===_0x3bf966['size'])return;const _0x5a1d0d=await ut['getMany'](_0x3be315,Array['from'](_0x3bf966));for(const _0x34060c of _0x5a1d0d)_0x3892e3['getUser'](_0x34060c['id'])||_0x3892e3['addUser'](_0x34060c);}}function it(_0x568653){if(mt(_0x568653))return new Promise(()=>{});throw _0x568653;}function mt(_0x54d7f6){return _0x54d7f6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x54d7f6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x4c92a1{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 _0x2be232=this['editor']['plugins']['get'](n),_0x388863=this['editor']['plugins']['get']('CommentsEditing'),_0x39edef=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x2be232,'change:state',(_0x3953ca,_0x40fd5d,_0x416c19)=>{_0x388863['isThreadsLoadingPaused']='connected'!==_0x416c19;});}),this['listenTo'](_0x2be232,'change:state',(_0x4c1a41,_0x55bf1f,_0x3142dd)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x3142dd);}),_0x39edef['_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 _0x4c92a1{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 _0x4c92a1{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>_0x435b29)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x2f4184];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x31a334){super(_0x31a334);const _0x55be3e=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x55be3e);}async['init'](){const _0x53964d=this['editor']['plugins']['get'](l),_0x520412=_0x53964d['serverHistory'],_0x156462=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x520412,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x53964d['sessionId']});const _0x291adb=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x4e8257=await _0x2d1097['isBundleUploaded'](_0x156462['connection'],_0x291adb);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1a1b0d})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1a1b0d)),'updateRevisions':async _0x248fc0=>{await this['_waitForServiceReady']();const _0xa0bf2d=this['_revisionTracker']['currentRevision'];if(_0x4e8257&&0x1===_0x248fc0['length']&&_0x248fc0[0x0]['id']===_0xa0bf2d['id'])return _0x248fc0;for(const _0x5ddb20 of _0x248fc0)_0x5ddb20['id']===_0xa0bf2d['id']&&(_0x5ddb20['isEmptyCurrent']=_0x5ddb20['fromVersion']===_0x5ddb20['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x248fc0,this['_lastRequestId'])['then'](_0x56abde=>(this['_lastRequestId']=_0x56abde,_0x248fc0))['catch'](_0xf812e8=>{if(Z(_0xf812e8)||'400'===_0xf812e8['code']&&void 0x0!==_0xf812e8['data']['wrongRequestId']){for(const _0x22fa5f of _0x248fc0){!this['_revisionTracker']['repository']['getRevision'](_0x22fa5f['id'])||this['_revisionTracker']['_bufferUpdate'](_0x22fa5f['id'],_0x22fa5f,!0x1);}if(Z(_0xf812e8))throw _0xf812e8;return _0x248fc0;}throw _0xf812e8;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0xe33278,{revisionsData:_0x1d35a6,requestId:_0xcd45fd})=>{Math['max'](..._0x1d35a6['map'](_0x4d5111=>_0x4d5111['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1d35a6,_0xcd45fd);}):this['_handleRevisionsUpdate'](_0x1d35a6,_0xcd45fd);});const {revisions:_0x354ff4,requestId:_0x54cb80}=await this['_revisionHistoryService']['connect'](_0x156462['connection']);_0x156462['addToReconnectionStack'](this),this['_lastRequestId']=_0x54cb80,await this['_fetchMissingUsers'](_0x354ff4);for(const _0x2d9800 of _0x354ff4)this['_revisionTracker']['addRevisionData'](_0x2d9800);this['listenTo'](_0x53964d,'change:_isConnected',(_0xb67564,_0x191773,_0x253991)=>{_0x253991&&(this['_oldOffset']=_0x53964d['_offset'],_0xb67564['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x156462,'state',_0x1c73d4=>_0x1c73d4===_0x53ea10['CONNECTED']);}async['reconnect'](){const _0x1c1da5=this['editor']['plugins']['get'](n),_0xc15833=this['editor']['plugins']['get'](l),_0x4232a1=async()=>{const _0x5b9f4f=this['_revisionTracker']['currentRevision'],_0x162c7a=_0x5b9f4f['id'],_0x3ba3df=_0x162c7a!==_0xc15833['sessionId'];if(_0x3ba3df){const _0x1dc752=_0xc15833['_offset']-this['_oldOffset'],_0x18371b=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x5b9f4f['toVersion']+_0x1dc752!==_0x18371b){const _0x3e4f73=_0x5b9f4f['fromVersion']+_0x1dc752,_0xb9d6e0=this['editor']['plugins']['get'](_0x2f4184),_0x50d4d6=this['_revisionTracker']['buildRevisionData']({'revision':_0x5b9f4f,'from':_0x3e4f73,'to':_0x18371b});_0x50d4d6['id']=_0x5b9f4f['id'];const _0x4f8d79=_0x50d4d6['authorsIds']['map'](_0x224542=>_0xb9d6e0['getUser'](_0x224542));_0x5b9f4f['_update']({..._0x50d4d6,'authors':_0x4f8d79},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x5b9f4f['id'],_0x50d4d6,!0x0);}this['_revisionTracker']['_startingVersion']=_0x18371b,(_0x5b9f4f['toVersion']===_0x5b9f4f['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x162c7a)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x162c7a),this['_revisionTracker']['_createCurrentRevision'](_0x18371b));}const {revisions:_0x5c3a63,requestId:_0x2e8c82}=await this['_revisionHistoryService']['reconnect'](_0x1c1da5['connection'],this['_lastRequestId']);_0x3ba3df&&_0x5c3a63['length']>0x0?_0xc15833['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x5c3a63),this['_handleRevisionsUpdate'](_0x5c3a63,_0x2e8c82),this['_revisionTracker']['sendBufferedUpdates']());};return _0xc15833['_isConnected']?_0x4232a1():new Promise((_0x5afa49,_0x8d86ce)=>{_0xc15833['once']('change:_isConnected',()=>{_0x4232a1()['then'](_0x5afa49)['catch'](_0x8d86ce);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x54aed7=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x1cf892=>{_0x1cf892['off'](),_0x54aed7();});});}['_getLatestVersionFromServerOperations'](){const _0x278de9=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x11ef25 of _0x278de9)if('marker'!==_0x11ef25['type']||_0x11ef25['affectsData'])return _0x11ef25['baseVersion']+0x1;}['_getLatestVersion'](){const _0x41076e=this['editor']['plugins']['get'](l);return new Promise(_0x1a057b=>{_0x41076e['_isPendingUpdate']?_0x41076e['once']('change:_isPendingUpdate',()=>{_0x1a057b(this['_getLatestVersionFromServerOperations']());}):_0x1a057b(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x4290e2,_0x2f4c15){const _0x16055e=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2f4c15;for(const _0x371c1c of _0x4290e2){const _0x1dda67=_0x16055e['getRevision'](_0x371c1c['id']);if(_0x1dda67){if((_0x371c1c['fromVersion']||_0x371c1c['toVersion'])&&(_0x371c1c['diffData']=null),_0x1dda67===this['_revisionTracker']['currentRevision']){const _0x1b2271=Math['max'](_0x1dda67['toVersion'],_0x371c1c['toVersion']),_0x1bc2e3=Math['max'](_0x1dda67['fromVersion'],_0x371c1c['fromVersion']);let _0x4552e4;_0x1dda67['toVersion']===_0x371c1c['toVersion']&&_0x1dda67['fromVersion']===_0x371c1c['fromVersion']?(_0x4552e4=!0x0,this['_preventResendingRevisionData'](_0x371c1c)):_0x371c1c['toVersion']===_0x1b2271&&_0x371c1c['fromVersion']===_0x1bc2e3?_0x4552e4=!0x1:(_0x1dda67['toVersion']===_0x1b2271&&_0x1dda67['fromVersion']===_0x1bc2e3||this['_fixRevision']({'revision':_0x1dda67,'from':_0x1bc2e3,'to':_0x1b2271}),_0x4552e4=!0x0),_0x4552e4&&(delete _0x371c1c['fromVersion'],delete _0x371c1c['toVersion'],delete _0x371c1c['diffData'],delete _0x371c1c['createdAt'],delete _0x371c1c['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x371c1c),this['_preventResendingRevisionData'](_0x371c1c);}else this['_revisionTracker']['addRevisionData'](_0x371c1c);}const _0x553851=_0x16055e['getRevisions']();_0x553851['reverse']();for(let _0x22c1eb=0x0;_0x22c1eb<_0x553851['length']-0x1;_0x22c1eb++){const _0x32d984=_0x553851[_0x22c1eb],_0x196db2=_0x553851[_0x22c1eb+0x1];if(_0x32d984['fromVersion']<_0x196db2['toVersion']){const _0x56c677=_0x196db2['toVersion'],_0x48613a=Math['max'](_0x56c677,_0x32d984['toVersion']);this['_fixRevision']({'revision':_0x32d984,'from':_0x56c677,'to':_0x48613a});}}}['_fixRevision']({revision:_0x54ca13,from:_0x2b0745,to:_0x25d815}={}){const _0x3d1e77=this['editor']['plugins']['get'](_0x2f4184),_0x1620ce=this['_revisionTracker']['buildRevisionData']({'revision':_0x54ca13,'from':_0x2b0745,'to':_0x25d815});_0x1620ce['authors']=_0x1620ce['authorsIds']['map'](_0x398be6=>_0x3d1e77['getUser'](_0x398be6)),_0x54ca13['_update'](_0x1620ce);}['_preventResendingRevisionData'](_0x31aa51){const _0x508698={};_0x508698['id']=_0x31aa51['id'];for(const _0x4dc969 of Object['keys'](_0x31aa51))'id'!==_0x4dc969&&(_0x508698[_0x4dc969]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x508698['id'],_0x508698,!0x0);}async['_fetchMissingUsers'](_0x1d8999){const _0xfc44ba=this['editor']['plugins']['get'](_0x2f4184),{connection:_0xfefa2}=this['editor']['plugins']['get'](n),_0x18db3e=new Set();for(const _0x507bd8 of _0x1d8999){for(const _0x445260 of _0x507bd8['authorsIds'])_0x59893e(_0x445260);_0x507bd8['creatorId']&&_0x59893e(_0x507bd8['creatorId']);}if(0x0===_0x18db3e['size'])return;const _0x338db9=await ut['getMany'](_0xfefa2,Array['from'](_0x18db3e));for(const _0x3e9fdf of _0x338db9)_0xfc44ba['getUser'](_0x3e9fdf['id'])||_0xfc44ba['addUser'](_0x3e9fdf);function _0x59893e(_0xeb8233){_0xfc44ba['getUser'](_0xeb8233)||_0x18db3e['add'](_0xeb8233);}}}function Z(_0x1b128f){return _0x1b128f['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x1b128f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1b128f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x4c92a1{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 _0x7fb5c5{['_collapseAt'];constructor(_0x1ab801,_0x3fe2e0=0x6){super(_0x1ab801);const _0x215780=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x3fe2e0,this['bind']('isHidden')['to'](this,'usersCount',_0x545fe9=>_0x545fe9<_0x3fe2e0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x215780['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':_0x215780['to']('usersCount',_0x5dd41d=>'+'+(_0x5dd41d-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x7fb5c5{['items'];['keystrokes'];constructor(_0x8408ad){super(_0x8408ad);const _0x282f3b=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0xbb5186(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x282f3b['if']('hasPopup'),'aria-expanded':_0x282f3b['to']('isExpanded',_0x868b5f=>this['hasPopup']&&String(_0x868b5f)),'aria-label':_0x282f3b['to']('hasPopup',_0x21ad57=>E(_0x8408ad,_0x21ad57?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x282f3b['to']('hasPopup',_0x3fbc46=>!!_0x3fbc46&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x282f3b['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x282f3b['to'](_0x48dcde=>{const _0x48d5f4=_0x48dcde,_0x1876a4=document['querySelector']('.ck-presence-list__dropdown-list'),_0x500635=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1876a4?.['contains'](_0x48d5f4['relatedTarget'])||_0x500635?.['contains'](_0x48d5f4['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x3075db,_0x567a81,_0xbc4ce1)=>{this['element']&&(_0xbc4ce1?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x7fb5c5{['counterView'];['inlineListView'];constructor(_0x18a92a,_0x486c33=0x6){super(_0x18a92a);const _0x18fa6e=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x486c33),this['inlineListView']=new is(_0x18a92a),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x277723 of this['inlineListView']['items'])_0x277723['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',_0x18fa6e['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x7fb5c5{['listWrapperView'];constructor(_0x287d0d,_0xd2742){super(_0x287d0d);const _0x2473a8=this['bindTemplate'];this['listWrapperView']=new wt(_0x287d0d,_0xd2742),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':E(_0x287d0d,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x2473a8['to'](_0x5d1991=>{const _0xe0e053=_0x5d1991,_0x52930f=document['querySelector']('.ck-presence-list__list'),_0x3deb40=document['querySelector']('.ck-balloon-panel_with-arrow');_0x52930f?.['contains'](_0xe0e053['relatedTarget'])||_0x3deb40?.['contains'](_0xe0e053['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x483fc1{constructor(_0x25402e,_0x520fc3){super(_0x25402e);const _0x311781=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x520fc3?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x311781['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x311781['to']('role'),'aria-label':_0x311781['to']('ariaLabel'),'aria-labelledby':_0x311781['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x4f23f6['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1c93c9=this['element'];_0x1c93c9&&(this['_isScrollable']=Math['max'](_0x1c93c9['scrollHeight'],_0x1c93c9['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x84fd8c,_0xd0f0af,_0x506633){super(_0x84fd8c);const _0x4b414c=this['bindTemplate'];this['userView']=new ct(_0x84fd8c,_0xd0f0af);const _0x25748d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0xd0f0af['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0xd0f0af['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xd0f0af['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x506633&&(_0x25748d['tag']='button',_0x25748d['on']={'click':_0x4b414c['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x25748d);}['focus'](){this['element']['focus']();}}class A extends _0x7fb5c5{['userView'];['markerView'];constructor(_0x33b433,_0x3d6a2a,_0x58a895){super(_0x33b433);const _0x1d9eb7=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x33b433,_0x3d6a2a),this['markerView']=new lt(_0x33b433,_0x3d6a2a);const _0x8ea312=new at(_0x33b433);_0x8ea312['template']['tag']='span',_0x8ea312['text']=_0x3d6a2a['name'];const _0x47bbe4={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1d9eb7['to']('isFocusable',_0xc0f0fa=>!!_0xc0f0fa&&0x0),'aria-labelledby':_0x8ea312['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1d9eb7['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1d9eb7['to']('hasTooltip',_0x11fe2b=>!_0x11fe2b),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x8ea312]};_0x58a895&&(_0x47bbe4['tag']='button',_0x47bbe4['on']={'click':_0x1d9eb7['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x47bbe4);}}class lt extends _0x7fb5c5{constructor(_0x56de87,_0x435bbc){super(_0x56de87),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x435bbc['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x1ad809{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x356262){super(_0x356262),this['context']['config']['define']('presenceList',x);const _0x55d0dd=_0x356262['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x55d0dd)throw new _0x4480f3('presencelist-collapseat-invalid-format',this);if(_0x55d0dd<0x1)throw new _0x4480f3('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1bed69(),this['balloonPanelView']=new _0x5b56e2(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x4725e7 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x4725e7);this['listenTo'](this['_allConnectedUsers'],'add',(_0xcef5a5,_0xefcc9d)=>{this['_handleUserAdd'](_0xefcc9d);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1797e9,_0x2c6d03)=>{this['_handleUserRemove'](_0x2c6d03);});}['_createView'](){const _0x269b8c=this['context'],_0x1c1f37=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x2f6885=this['balloonPanelView'];if(!_0x487be0(_0x269b8c['config']['get']('presenceList.container')))throw new _0x4480f3('presencelist-missing-container',this);return _0x1c1f37['counterView']['bind']('usersCount')['to'](this),_0x1c1f37['bind']('isCollapsed')['to'](this,'usersCount',_0x23c5f6=>{const {collapseAt:_0x57e233}=_0x269b8c['config']['get']('presenceList'),_0x59492e=_0x23c5f6>=_0x57e233;if(_0x59492e&&!_0x1c1f37['inlineListView']['items']['find'](_0x581c06=>_0x581c06 instanceof b)){const _0x5eee61=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5eee61&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x1c1f37['inlineListView']['items']['add'](_0x1c1f37['counterView']);}return _0x59492e||this['hideDropdown'](),_0x59492e;}),_0x1c1f37['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x34e8fa=>{const _0x211639=_0x269b8c['config']['get']('presenceList'),_0x216e4d=new A(_0x269b8c['locale'],_0x34e8fa,!!_0x211639['onClick']);return _0x216e4d['bind']('hasTooltip')['to'](_0x1c1f37,'isCollapsed',_0x4ced81=>!_0x4ced81),_0x216e4d['bind']('isFocusable')['to'](_0x1c1f37,'isCollapsed',_0x498e4=>!_0x498e4),_0x211639['onClick']&&this['listenTo'](_0x216e4d,'execute',()=>{this['view']['isCollapsed']||_0x211639['onClick'](_0x34e8fa,_0x216e4d['element']);}),_0x216e4d;}),this['listenTo'](_0x1c1f37['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x1c1f37['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x1c1f37['inlineListView']['keystrokes']['set']('Enter',(_0x1bdf0a,_0x42a667)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x42a667());}),_0x1c1f37['render'](),_0x2f6885['render'](),_0x4d282b({'emitter':_0x1c1f37,'activator':()=>_0x2f6885['isVisible'],'contextElements':[_0x2f6885['element'],_0x1c1f37['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x269b8c['config']['get']('presenceList.container')['appendChild'](_0x1c1f37['element']),this['_bodyCollection']=new _0x3ebd13(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x1c1f37;}['_handleUserAdd'](_0x33839c){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x33839c['isMe'])return;const _0x1a5a26=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x1a5a26-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x55b3fb=_0x33839c['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x33839c,_0x55b3fb);}['_handleUserRemove'](_0x199bd2){this['usersCount']--;const {collapseAt:_0x22116c}=this['context']['config']['get']('presenceList'),_0x5d6b4b=this['usersCount']>=_0x22116c;if(this['currentDisplayedUsers']['get'](_0x199bd2['id']))this['currentDisplayedUsers']['remove'](_0x199bd2['id']);else{if(_0x5d6b4b&&this['currentDisplayedUsers']['length']+0x1===_0x22116c-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x5d6b4b?0x1:0x0)<this['usersCount']){for(const _0x471fa1 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x471fa1['id'])&&(this['currentDisplayedUsers']['add'](_0x471fa1,Math['min'](this['currentDisplayedUsers']['length']-(_0x5d6b4b?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x5d6b4b?0x1:0x0)===_0x22116c-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x5a98b5=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x5a98b5['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x914817}=this['presenceDropdownView'];_0x914817['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x6fc2c7=>{if(!_0x5a98b5['displayMe']&&_0x6fc2c7['isMe'])return null;const _0x4f66f5=new j(this['context']['locale'],_0x6fc2c7,!!_0x5a98b5['onClick']);return _0x5a98b5['onClick']&&this['listenTo'](_0x4f66f5,'execute',()=>{_0x5a98b5['onClick'](_0x6fc2c7,_0x4f66f5['element']);}),_0x4f66f5;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x914817['focus'](),_0x914817['checkIfScrollable']();const _0x14e938=(_0x1c6ddb,_0xaf28a3)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0xaf28a3();};_0x914817['keystrokes']['set']('Esc',_0x14e938),_0x914817['keystrokes']['set']('Shift+Tab',_0x14e938),_0x914817['keystrokes']['set']('Tab',(_0x5e64a,_0x1be5a1)=>{!function(_0x358280){const _0x46b4e8=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x52e996=>_0x52e996+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x1d2862=[...document['body']['querySelectorAll'](_0x46b4e8)]['filter'](_0x210308=>_0x210308===document['activeElement']||_0x210308['offsetWidth']+_0x210308['offsetHeight']>0x0)['sort']((_0x4c333e,_0x34d708)=>(_0x4c333e['tabIndex']||0x0)-(_0x34d708['tabIndex']||0x0)),_0x4733d6=_0x1d2862['indexOf'](_0x358280),_0x409d70=_0x1d2862[(_0x4733d6+0x1)%_0x1d2862['length']];_0x409d70&&_0x409d70['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1be5a1();}),_0x914817['focusTracker']['add'](this['view']['element']),_0x914817['focusTracker']['on']('change:isFocused',(_0x363fd3,_0xd92f1d,_0x3eaffb)=>{_0x3eaffb||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 _0x1ad809{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':_0x3227cb=>0x1!=_0x3227cb}};
|