@ckeditor/ckeditor5-real-time-collaboration 45.1.0 → 45.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +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
|
-
((()=>mt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0xc35461];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x35ed03){super(_0x35ed03),this['set']('state',_0x3b67d1['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x412fe3);}['init'](){const _0x108cf6=this['context'],_0x3254aa=_0x108cf6['plugins']['get']('CloudServices'),_0x11ecfd=_0x108cf6['plugins']['get'](_0xc35461);if(!_0x3254aa['token'])throw new _0x26a8d4('websocketgateway-missing-token',this);if(!_0x3254aa['webSocketUrl'])throw new _0x26a8d4('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x3254aa['token'],_0x3254aa['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x57acc6=>{if(this['connection']=_0x57acc6,this['bind']('state')['to'](_0x57acc6,'state',this,'_isBrowserOffline',(_0x2c3ee4,_0x18eaf1)=>('connected'!==_0x2c3ee4&&(this['_shouldPluginsReconnect']=!0x0),_0x18eaf1||_0x2c3ee4!==_0x3b67d1['CONNECTED']?_0x3b67d1['DISCONNECTED']:this['state']==_0x3b67d1['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3b67d1['CONNECTING']):_0x3b67d1['CONNECTED'])),this['connection']['on']('error',(_0x269c85,_0x2f0081)=>{if('limitExceeded'!==_0x2f0081['code'])throw console['error'](_0x2f0081),new _0x26a8d4('cloudservices-init',null,{'originalError':_0x2f0081});_0x11ecfd['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'});}),!_0x57acc6['me'])return new Promise(_0x402ebe=>_0x57acc6['on']('change:me',_0x402ebe));})['catch'](_0x8cb6e4=>{throw console['error'](_0x8cb6e4),new _0x26a8d4('cloudservices-init',null,{'originalError':_0x8cb6e4});});}['addToReconnectionStack'](_0x1d58b7){if('function'!=typeof _0x1d58b7['reconnect'])throw new _0x26a8d4('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x1d58b7))throw new _0x26a8d4('websocketgateway-plugin-already-registered',this,{'name':_0x1d58b7['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x1d58b7);}['removeFromReconnectionStack'](_0x36c873){this['_reconnectionStack']['delete'](_0x36c873);}['isInReconnectionStack'](_0xde5862){return this['_reconnectionStack']['has'](_0xde5862);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x4134f4=>_0x4134f4['reconnect']())))['then'](()=>this['state']=_0x3b67d1['CONNECTED'])['catch'](_0x114c38=>{throw console['error'](_0x114c38),new _0x26a8d4('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3b67d1['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x5608fb{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x5f01ed];}constructor(_0x436626){super(_0x436626),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x19740c(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5f01ed);}['init'](){const _0x4a8758=this['context']['plugins']['get'](c);this['listenTo'](_0x4a8758,'change:state',(_0x741293,_0x55485d,_0x4c9d35)=>{if('connected'!==_0x4c9d35)this['channelSessions']['forEach'](_0x1d3c6c=>_0x1d3c6c['clear']()),this['channelConnectedUsers']['forEach'](_0xf30dbe=>_0xf30dbe['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x1ef3fb,_0x44146c]of this['_registeredSessions'])for(const _0x5574fc of _0x44146c)this['_handleSessionAdd'](_0x1ef3fb,_0x5574fc);}}),this['_createUser'](_0x4a8758['connection']['me'],!0x0);}['register'](_0x1402d5,_0x51c409){if(this['_registeredSessions']['has'](_0x1402d5))throw new _0x26a8d4('sessions-register-already-registered',null,{'channelId':_0x1402d5});this['_registeredSessions']['set'](_0x1402d5,_0x51c409),this['channelSessions']['set'](_0x1402d5,new _0x19740c()),this['channelConnectedUsers']['set'](_0x1402d5,new _0x19740c()),this['listenTo'](_0x51c409,'add',(_0x49a9f4,_0x2bc95a)=>this['_handleSessionAdd'](_0x1402d5,_0x2bc95a)),this['listenTo'](_0x51c409,'remove',(_0x535b02,_0xa6e05d)=>this['_handleSessionRemove'](_0x1402d5,_0xa6e05d));for(const _0x4bde16 of _0x51c409)this['_handleSessionAdd'](_0x1402d5,_0x4bde16);}['unregister'](_0x43c7a1){if(!this['_registeredSessions']['has'](_0x43c7a1))throw new _0x26a8d4('sessions-unregister-not-exist',null,{'channelId':_0x43c7a1});const _0x48dade=this['_registeredSessions']['get'](_0x43c7a1);this['stopListening'](_0x48dade);for(const _0x179d97 of _0x48dade)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x43c7a1,_0x179d97);this['_registeredSessions']['delete'](_0x43c7a1),this['channelSessions']['delete'](_0x43c7a1),this['channelConnectedUsers']['delete'](_0x43c7a1);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x3b63b9){for(const _0x507d07 of this['channelSessions']['values']())for(const _0x404b84 of _0x507d07)if(_0x404b84['id']===_0x3b63b9)return _0x404b84['user'];}['getUserSessions'](_0x1658f7,_0x545e2e){const _0x512a6a=_0x545e2e?[this['channelSessions']['get'](_0x545e2e)]:this['channelSessions']['values'](),_0x2348b7=new Set();for(const _0x265001 of _0x512a6a)for(const _0x2de893 of _0x265001)_0x2de893['user']['id']===_0x1658f7['id']&&_0x2348b7['add'](_0x2de893['id']);return _0x2348b7;}['getUserRole'](_0x5c8b10){for(const _0x598368 of this['channelSessions']['values']())for(const _0x1e3715 of _0x598368)if(_0x1e3715['user']===_0x5c8b10)return _0x1e3715['role'];}['_handleSessionAdd'](_0x9005bf,_0x50b442){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x252f9e=_0x50b442['user'],_0x3cffda=this['_users']['getUser'](_0x252f9e['id'])||this['_createUser'](_0x252f9e),_0x4af34a=Object['assign']({},_0x50b442,{'user':_0x3cffda});this['channelSessions']['get'](_0x9005bf)['add'](_0x4af34a);const _0x25602f=this['channelConnectedUsers']['get'](_0x9005bf);_0x25602f['has'](_0x3cffda['id'])||_0x25602f['add'](_0x3cffda),this['allConnectedUsers']['has'](_0x3cffda['id'])||this['allConnectedUsers']['add'](_0x3cffda,_0x3cffda['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x9005bf,{'channelId':_0x9005bf,'session':_0x4af34a});}['_handleSessionRemove'](_0x4e5602,_0x4b5dd1){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x3d19bd=this['channelConnectedUsers']['get'](_0x4e5602),_0x18e169=_0x4b5dd1['user'];_0x18e169['id']&&(this['channelSessions']['get'](_0x4e5602)['remove'](_0x4b5dd1['id']),_0x3d19bd['has'](_0x18e169['id'])&&!this['getUserSessions'](_0x18e169,_0x4e5602)['size']&&_0x3d19bd['remove'](_0x18e169['id']),this['allConnectedUsers']['get'](_0x18e169['id'])&&!this['getUserSessions'](_0x18e169)['size']&&this['allConnectedUsers']['remove'](_0x18e169['id']));}['_createUser'](_0x1b6070,_0x4f58a6){const _0x2842f4=this['_users']['addUser'](_0x1b6070);return _0x4f58a6&&this['_users']['defineMe'](_0x1b6070['id']),_0x2842f4['orderNumber']=this['_uniqueUsersCount']++,_0x2842f4;}}class B extends _0x46e1aa{['_domEmitter']=new(_0x412fe3())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xfe8c51=this['editor'],_0x3316ed=_0xfe8c51['plugins']['get'](i);_0xfe8c51['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x26e653,{writer:_0x268ff5})=>function(_0x8ebd2f,_0x415bb9,_0x596145,_0x16512a){const _0x19b932=_0x8ebd2f['markerName']['split'](':')[0x2],_0x26cd3c=_0x596145['getUserBySessionId'](_0x19b932);if(!_0x26cd3c||_0x19b932===_0x596145['mySessionId'])return;if(!_0x16512a['model']['schema']['checkChild'](_0x8ebd2f['markerRange']['start'],'$text'))return;const _0x13b8f3={'class':'ck-user__marker\x20'+_0x26cd3c['color']['getMarkerClass'](),'data-name':_0x26cd3c['name'],'data-session-id':_0x19b932},_0x5c1a49=_0x16512a['model']['markers']['get'](_0x8ebd2f['markerName']),_0x31ff76=_0x5c1a49['getStart'](),_0x21877c=_0x31ff76['nodeAfter'],_0x2348ee=_0x16512a['model']['schema'];if(_0x21877c&&_0x2348ee['isObject'](_0x21877c)&&_0x2348ee['isInline'](_0x21877c)&&!_0x16512a['model']['markers']['get']('user:range:'+_0x19b932)['getRange']()['isCollapsed'])return;const _0x194291=_0x31ff76['parent'];return _0x16512a['model']['schema']['isLimit'](_0x194291)&&!_0x16512a['model']['hasContent'](_0x194291)&&(_0x13b8f3['contenteditable']=!0x1),function(_0x280a46,_0x1e76f5,_0x122057){const _0x1424f4=_0x280a46['createUIElement']('span',_0x1e76f5);return _0x280a46['setCustomProperty']('userPositionMarker',!0x0,_0x1424f4),_0x1424f4['render']=function(_0x3fa57d){const _0x120d17=this['toDomElement'](_0x3fa57d),_0x185bb5=document['createElement']('span');return _0x185bb5['classList']['add']('ck-user__marker-tooltip'),_0x185bb5['setAttribute']('contenteditable','false'),_0x185bb5['setAttribute']('spellcheck','false'),_0x185bb5['textContent']=_0x122057['name'],_0x120d17['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x185bb5['outerHTML']+'',_0x120d17['addEventListener']('mouseenter',()=>{_0x120d17['classList']['add']('ck-user__marker_hovered');}),_0x120d17['addEventListener']('mouseleave',()=>{_0x120d17['classList']['remove']('ck-user__marker_hovered');}),_0x120d17;},_0x1424f4['isSimilar']=function(_0x4aed76){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4aed76['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4aed76['getAttribute']('data-session-id'));},_0x1424f4;}(_0x415bb9,_0x13b8f3,_0x26cd3c);}(_0x26e653,_0x268ff5,_0x3316ed,_0xfe8c51)}),_0xfe8c51['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3776fd=>function(_0x3d36f6,_0x2347ac){const _0x488d2b=_0x3d36f6['markerName']['split'](':')[0x2];if(_0x488d2b===_0x2347ac['mySessionId'])return null;const _0x5466c8=_0x2347ac['getUserBySessionId'](_0x488d2b);if(!_0x5466c8)return{'id':_0x488d2b,'classes':[]};return{'id':_0x488d2b,'classes':['ck-user__selection',_0x5466c8['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x488d2b},'priority':0x7d0+_0x5466c8['orderNumber']};}(_0x3776fd,_0x3316ed)}),function(_0x3854c){const _0x31a470=_0x3854c['model'],_0x27b360=new Map(),_0xae4a19=_0x3854c['plugins']['get'](i);_0x31a470['markers']['on']('update:user:range',(_0x23a543,_0x13b15e,_0x5e6309,_0x1e54c9)=>{if(!_0x1e54c9&&_0x27b360['get'](_0x13b15e['name']))return _0x27b360['get'](_0x13b15e['name'])['detach'](),void _0x27b360['delete'](_0x13b15e['name']);const _0x41a668=_0x13b15e['name']['split'](':')[0x2];if(_0x41a668===_0xae4a19['mySessionId'])return;const _0x390cad='user:position:'+_0x41a668;_0x31a470['markers']['has'](_0x390cad)&&_0x3854c['editing']['reconvertMarker'](_0x390cad),_0x13b15e['on']('change:range',(_0x133083,_0x47bef9,_0x53b824)=>{if('$graveyard'!=_0x47bef9['root']['rootName']&&'$graveyard'==_0x13b15e['getRange']()['root']['rootName']&&!_0x27b360['has'](_0x13b15e['name'])){const _0x5ef387=_0x31a470['schema']['getNearestSelectionRange'](_0x53b824['deletionPosition']);if(_0x5ef387){const _0x5c0eb1=ft['fromRange'](_0x5ef387);_0x27b360['set'](_0x13b15e['name'],_0x5c0eb1),_0x5c0eb1['on']('change:range',(_0x15210a,_0x46ea84,_0x5db874)=>{if('$graveyard'==_0x5c0eb1['root']['rootName']){const _0x2d642a=_0x31a470['schema']['getNearestSelectionRange'](_0x5db874['deletionPosition']);_0x2d642a?(_0x5c0eb1['start']=_0x2d642a['start'],_0x5c0eb1['end']=_0x2d642a['end']):(_0x27b360['delete'](_0x13b15e['name']),_0x5c0eb1['detach']());}});}}});}),_0x31a470['document']['on']('change',()=>{_0x27b360['size']>0x0&&_0x31a470['enqueueChange']({'isUndoable':!0x1},_0xa45e1e=>{for(const [_0x2f22d6,_0x5473ff]of _0x27b360)'$graveyard'==_0x31a470['markers']['get'](_0x2f22d6)['getRange']()['root']['rootName']&&(X(_0x2f22d6['split'](':')[0x2],_0x5473ff['toRange'](),_0x31a470,_0xa45e1e),_0x5473ff['detach']());_0x27b360['clear']();});});}(_0xfe8c51),this['_domEmitter']['listenTo'](_0x4aa1a9['document'],'keydown',(_0x40c5af,{key:_0x248aec})=>{'Escape'===_0x248aec&&function(_0x29214c){_0x29214c['editing']['view']['change'](_0x5b1e57=>{for(const _0x11bd36 of _0x29214c['model']['markers']){if(!_0x11bd36['name']['startsWith']('user:position'))continue;const _0x1f46c2=_0x29214c['editing']['mapper']['markerNameToElements'](_0x11bd36['name']);if(_0x1f46c2){for(const _0x5c9acc of _0x1f46c2)_0x5b1e57['removeClass']('ck-user__marker_hovered',_0x5c9acc);}}});}(_0xfe8c51);},{'useCapture':!0x0});}['afterInit'](){const _0x19a14f=this['editor'],_0x4502f7=_0x19a14f['commands']['get']('undo');_0x4502f7&&_0x19a14f['model']['on']('applyOperation',(_0x351113,_0x3e72e7)=>{const _0x95b7b6=_0x3e72e7[0x0];if(!_0x95b7b6['isDocumentOperation'])return;if('marker'!=_0x95b7b6['type']||!_0x95b7b6['name']['startsWith']('user:'))return;const _0x300e26=_0x95b7b6['batch'];_0x4502f7['_createdBatches']['has'](_0x300e26)&&(_0x95b7b6['newRange']=_0x95b7b6['oldRange']?_0x19a14f['model']['createRange'](_0x95b7b6['oldRange']['start'],_0x95b7b6['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x596de=this['editor'],_0x5a1dd9=_0x596de['model']['document'],_0x5bbb55=_0x596de['plugins']['get'](i);_0x596de['model']['enqueueChange']({'isUndoable':!0x1},_0x911509=>{const _0x427cc0='user:range:'+_0x5bbb55['mySessionId'],_0x215a66='user:position:'+_0x5bbb55['mySessionId'],_0x306f9d=_0x596de['model']['markers']['has'](_0x427cc0);_0x596de['editing']['view']['hasDomSelection']?X(_0x5bbb55['mySessionId'],_0x5a1dd9['selection']['getFirstRange'](),_0x596de['model'],_0x911509):_0x306f9d&&(_0x911509['removeMarker'](_0x427cc0),_0x911509['removeMarker'](_0x215a66));});}}function X(_0x2c1304,_0x3e2e79,_0x595ccb,_0x2914ab){const _0x2b78d3='user:range:'+_0x2c1304,_0x1dd3f7='user:position:'+_0x2c1304,_0x7eefc1=_0x3e2e79['getContainedElement']();let _0x3a0db1=_0x3e2e79['start'];_0x7eefc1&&_0x7eefc1['is']('element','tableCell')&&(_0x3a0db1=function(_0x28f6e2,_0x5062ef){for(const _0x59e103 of _0x28f6e2['getPositions']())if(_0x5062ef['schema']['checkChild'](_0x59e103,'$text'))return _0x59e103;}(_0x3e2e79,_0x595ccb),_0x3e2e79=_0x2914ab['createRange'](_0x3a0db1));const _0x3665b0=_0x2914ab['createRange'](_0x3a0db1);_0x595ccb['markers']['has'](_0x2b78d3)?(_0x2914ab['updateMarker'](_0x2b78d3,{'range':_0x3e2e79}),_0x2914ab['updateMarker'](_0x1dd3f7,{'range':_0x3665b0})):(_0x2914ab['addMarker'](_0x2b78d3,{'range':_0x3e2e79,'usingOperation':!0x0}),_0x2914ab['addMarker'](_0x1dd3f7,{'range':_0x3665b0,'usingOperation':!0x0}));}function M(_0x15246b,_0x267446,_0x3b650e){const _0x149b75=_0x15246b['t'],t=_0x15246b['t'];switch(_0x267446){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 _0x149b75({'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'},_0x3b650e);default:return'';}}let F=0x1;class l extends _0x46e1aa{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0xea07ee)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,B,_0x1bc531,_0x5f01ed,_0xc35461];}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 _0x1152a4=this['serverHistory']['getOperations']();for(let _0x1964d6=_0x1152a4['length']-0x1;_0x1964d6>=0x0;_0x1964d6--){const _0x5835a1=_0x1152a4[_0x1964d6];if(!this['_disconnectionOperations']['has'](_0x5835a1))return _0x5835a1['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x8fc891){if(super(_0x8fc891),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x6e5002(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x26a8d4('collaboration-missing-channelid',this);const _0x3e26e0=_0x8fc891['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x3e26e0,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xe1342b(),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 $(this['_disconnectionOperations']);}['init'](){const _0x316181=this['editor'],_0x43a26e=_0x316181['plugins']['get'](_0x5f01ed),_0x1612ea=_0x316181['plugins']['get'](c);this['listenTo'](_0x43a26e,'getOperationAuthor',(_0x3a1bb0,_0x125ec2)=>{const _0x1b2d4f=_0x125ec2[0x0];_0x1b2d4f['_authorId']&&(_0x3a1bb0['return']=_0x43a26e['getUser'](_0x1b2d4f['_authorId']),_0x3a1bb0['stop']()),null===_0x1b2d4f['_authorId']&&(_0x3a1bb0['return']=null,_0x3a1bb0['stop']());},{'priority':'high'}),this['listenTo'](_0x316181['model']['document']['selection'],'change:range',(_0x5114f4,_0x92e1bf)=>{_0x92e1bf['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x316181['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x316181['model']['on']('applyOperation',(_0x5e1f35,_0x3009fb)=>{const _0x4f70f9=_0x3009fb[0x0];_0x4f70f9['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x4f70f9),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x1612ea,'state',this,'_hasSynchronizationProblem',(_0x525aa6,_0x1ac83d)=>'connected'===_0x525aa6&&!_0x1ac83d),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x316181['disableReadOnlyMode']('rtc-offline'):_0x316181['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x316181['disableReadOnlyMode']('rtc-offline'):_0x316181['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x6ee826=this['editor']['plugins']['get'](i),_0x62dd75=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x6ee826['unregister'](this['_channelId']);const _0x19a3df=await this['_service']['reconnect'](_0x62dd75['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x19a3df)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2d1303=await this['_service']['getConnectedSessions']();_0x6ee826['register'](this['_channelId'],_0x2d1303),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x128986){if(function(_0x5a9b2f){return'404'===_0x5a9b2f['code'];}(_0x128986)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3e69e5){return'409'===_0x3e69e5['code'];}(_0x128986)){const _0x26dd9e=M(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'](_0x26dd9e);}else{if(!(_0x128986 instanceof q))throw _0x128986;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1438d9=this['editor']['plugins']['get'](c),_0x58b522=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x58b522['channelSessions']['has'](this['_channelId'])&&_0x58b522['unregister'](this['_channelId']),_0x1438d9['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x5514f7){if(this['sessionId']!==_0x5514f7['sessionId']&&this['_lastSyncedOperationId']!==_0x5514f7['lastOperationId'])throw new q();return this['sessionId']=_0x5514f7['sessionId'],this['_handleServerResponse']([],{..._0x5514f7,'wereChangesApplied':!0x1,'data':_0x5514f7['data']},'reconnect');}async['_connectService'](_0x5dfab6,_0x39a19e=!0x1){const {connection:_0x3931f5}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x3931f5,this['_channelId'])['then'](_0x5e0220=>this['_initSessionsHandling'](_0x5e0220))['catch'](_0x44f5df=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x44f5df);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x1222ce,_0x167a00)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x167a00);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x43f9ef=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5dfab6);this['_isPendingUpdate']=!0x0;const _0x387e4f=await this['_service']['connect'](_0x3931f5,this['_compressOperations'](_0x5dfab6),_0x43f9ef);if(this['sessionId']=_0x387e4f['sessionId'],_0x39a19e){if(!_0x387e4f['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x387e4f['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x5dfab6,_0x387e4f,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x387e4f,_0x5dfab6);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1749bf=this['editor']['plugins']['get'](i),_0x107f84=this['editor']['plugins']['get'](B),_0x273f71=_0x1749bf['channelSessions']['get'](this['_channelId']);_0x273f71&&_0x273f71['length']>0x1?_0x107f84['createUserMarkerOperations']():this['listenTo'](_0x1749bf,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1749bf['channelSessions']['get'](this['_channelId'])['length']&&_0x107f84['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3a0c72,_0x7b65d7,_0x8598d0,_0x115338){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x7b65d7){const _0xd5405a=this['_decompressOperations'](_0x8598d0,_0x115338);await this['_fetchMissingUsers'](_0xd5405a),this['_handleExternalOperations'](_0xd5405a,_0x7b65d7,_0x8598d0['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3f82cd}=this['editor'];let _0x4de292;try{_0x4de292=await this['_service']['getDocumentDetails']();}catch(_0x57db8d){const _0x28c5ea=M(_0x3f82cd,'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'](_0x28c5ea);}const _0x1f922b=_0x4de292['currentDocumentSession']||_0x4de292['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x1f922b['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0xc5ee64=M(_0x3f82cd,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0xc5ee64);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x2d9e40){const _0x1cf05a=this['editor']['plugins']['get'](i);this['listenTo'](_0x1cf05a,'sessionAdd:'+this['_channelId'],(_0x496cfe,{session:_0x611ac4})=>{if(_0x611ac4['id']===_0x1cf05a['mySessionId']){_0x496cfe['off']();const _0x2ac761=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x13c101=_0x611ac4['permissions'];_0x2ac761&&_0x2ac761['isEnabled']&&(_0x13c101=_0x13c101['filter'](_0x1eb4e0=>'document:write'!==_0x1eb4e0)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x13c101,this['_channelId']);}}),_0x1cf05a['register'](this['_channelId'],_0x2d9e40);}['_initThrowingOnDataSet'](){const _0x23d7a5=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x2aa52e)=>{if(!_0x2aa52e[_0x2aa52e['length']-0x1]['suppressErrorInCollaboration'])throw new _0x26a8d4('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x23d7a5['apply'](this['editor']['data'],_0x2aa52e);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2c1480,[_0x3a9ce8])=>{if(this['_document']['version'])throw new _0x26a8d4('realtimecollaborationclient-init-document-already-initialized',this);_0x2c1480['stop'](),this['_setPendingAction']();const _0x5c053b=this['editor']['config']['get']('rootsAttributes'),_0x2d35bb=this['_getOperationsFromInitData'](_0x3a9ce8,_0x5c053b);0x0==_0x2d35bb['length']&&_0x2d35bb['push'](new _0x1727e1(0x0)),_0x2c1480['return']=this['_connectService'](_0x2d35bb)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4fe65b=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4fe65b))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3a5da7,[_0xc89e0b,_0x7150ec])=>{_0x3a5da7['stop']();const _0x17c420=this['editor']['model']['document']['getRoot'](_0xc89e0b);if(!this['_knownRootNames']['has'](_0xc89e0b)){const _0x1ee50f=_0x7150ec&&_0x7150ec['data']?_0x7150ec['data']:'',_0x5d53ee=_0x7150ec&&_0x7150ec['attributes']?_0x7150ec['attributes']:{};await this['_loadRoot'](_0xc89e0b,_0x1ee50f,_0x5d53ee);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x17c420['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x17c420);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x2e0def){const _0x35df8c=this['editor']['plugins']['get'](_0x5f01ed),{connection:_0xc65651}=this['editor']['plugins']['get'](c),_0x3e9f84=new Set();for(const _0x1fddfa of _0x2e0def){const _0x4592f5=_0x1fddfa['_authorId'];_0x4592f5&&!_0x35df8c['getUser'](_0x4592f5)&&_0x3e9f84['add'](_0x4592f5);}if(0x0===_0x3e9f84['size'])return;const _0x1cf977=await gt['getMany'](_0xc65651,Array['from'](_0x3e9f84));for(const _0x3858f8 of _0x1cf977)_0x35df8c['getUser'](_0x3858f8['id'])||_0x35df8c['addUser'](_0x3858f8);}['_getOperationsFromInitData'](_0x90bcb2,_0x29de48={}){const _0x513816=this['editor']['model'],_0x1eb680=[];let _0x5029aa=0x0;const _0x3debef='string'==typeof _0x90bcb2?{'main':_0x90bcb2}:_0x90bcb2;for(const _0x2b1f01 of Object['keys'](_0x3debef)){if(!this['_document']['roots']['has'](_0x2b1f01))throw new _0x26a8d4('realtimecollaborationclient-init-non-existent-root',this);const _0x116793=this['editor']['data']['parse'](_0x3debef[_0x2b1f01]),_0xfbcf76=this['_document']['getRoot'](_0x2b1f01),_0x50bc57=new _0x56a10f(_0x513816['createPositionAt'](_0xfbcf76,0x0),_0x116793,_0x5029aa++);_0x1eb680['push'](_0x50bc57);for(const [_0x3d3e92,_0x509563]of _0x116793['markers']){const _0x4894ea=_0x513816['createRange'](_0x513816['createPositionFromPath'](_0xfbcf76,_0x509563['start']['path']['slice']()),_0x513816['createPositionFromPath'](_0xfbcf76,_0x509563['end']['path']['slice']())),_0xf4ac1c=new _0x22c45c(_0x3d3e92,null,_0x4894ea,_0x513816['markers'],!0x0,_0x5029aa++);_0x1eb680['push'](_0xf4ac1c);}}if(_0x29de48)for(const [_0xf3b57,_0x49c364]of Object['entries'](_0x29de48)){const _0x31ff3b=_0x513816['document']['getRoot'](_0xf3b57);if(!_0x31ff3b)throw new _0x26a8d4('multi-root-editor-root-attributes-no-root',null);for(const [_0x53d512,_0x500101]of Object['entries'](_0x49c364))if(null!==_0x500101){const _0x155a43=new _0x8dd679(_0x31ff3b,_0x53d512,null,_0x500101,_0x5029aa++);_0x1eb680['push'](_0x155a43);}}return _0x1eb680;}async['_loadRoot'](_0x537664,_0x14a010,_0xb7f39e){this['_getOperationsFromInitData']({[_0x537664]:_0x14a010},{[_0x537664]:_0xb7f39e})['forEach']((_0x75946a,_0x276755)=>{_0x75946a['baseVersion']=this['_document']['version']+_0x276755,_0x75946a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x75946a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x244ee1,_0x328c2f){let _0x2249df;this['_offset']=_0x244ee1['offset'];const _0x25cc0c=_0x244ee1['wereChangesApplied']&&!_0x244ee1['initData'],_0x147f2d=_0x25cc0c?0x0:_0x244ee1['data']['baseVersion'];if(_0x328c2f['forEach'](_0x7cd513=>{_0x7cd513['_isInit']=!0x0,_0x7cd513['createdAt']=_0x244ee1['sessionCreatedAt'],_0x7cd513['_authorId']=null;}),_0x25cc0c)_0x2249df=_0x328c2f,this['_applyOperationsSet'](_0x2249df,_0x25cc0c);else{if(_0x244ee1['initData']){const _0x1961e4=this['_getOperationsFromInitData'](_0x244ee1['initData']);this['_document']['history']['version']=-_0x1961e4['length'],_0x1961e4['forEach'](_0x321a1c=>{_0x321a1c['baseVersion']-=_0x1961e4['length'],_0x321a1c['createdAt']=_0x244ee1['sessionCreatedAt'],_0x321a1c['_isInit']=!0x0,_0x321a1c['_authorId']=null;}),this['_applyOperationsSet'](_0x1961e4,!0x0),this['serverHistory']['version']=-_0x1961e4['length']+this['_offset'],this['_updateServerHistory'](_0x1961e4);}this['_document']['history']['version']=_0x147f2d,_0x2249df=this['_decompressOperations'](_0x244ee1['data'],_0x244ee1['metadata']),await this['_fetchMissingUsers'](_0x2249df),this['_applyOperationsSet'](_0x2249df,_0x25cc0c);}_0x244ee1['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2249df,_0x244ee1['lastOperationId']),this['_lastSyncedOperationId']=_0x244ee1['lastOperationId']),this['serverHistory']['version']=_0x147f2d+this['_offset'],this['_updateServerHistory'](_0x2249df),_0x328c2f['filter'](_0x339fce=>{const _0x5a1bbc=this['_getAffectedRoot'](_0x339fce);return _0x5a1bbc&&!this['_knownRootNames']['has'](_0x5a1bbc);})['forEach']((_0x5414b0,_0x27d7f8)=>{_0x5414b0['baseVersion']=this['_document']['version']+_0x27d7f8,this['_saveOperationInBuffer'](_0x5414b0);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4c075b,_0x3fed94){const _0x554590=_0x3fed94&&_0x3fed94['message'];if(_0x554590&&_0x554590['startsWith']('realtimecollaborationclient'))throw _0x3fed94;const _0x13cf97=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x13cf97['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x26a8d4(_0x4c075b,this['editor'],_0x554590?{'originalError':_0x554590}:void 0x0);}['_saveOperationInBuffer'](_0x5a94ec){this['_knownOperations']['has'](_0x5a94ec)||(this['_knownOperations']['add'](_0x5a94ec),this['_bufferedOperations']['push'](_0x5a94ec),this['_pendingAction']||'marker'==_0x5a94ec['type']&&!_0x5a94ec['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x164643=!0x1){!_0x164643&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2fe9ba=>{_0x2fe9ba&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2712cf=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x387651){return _0x387651['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x387651['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x387651['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2712cf)||this['_crash'](_0x2712cf['message'],_0x2712cf);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x8a17b8=>{this['on']('change:_isPendingUpdate',()=>{_0x8a17b8();});});}async['_sendBufferedOperations'](){const _0x3461b7=this['editor']['plugins']['get'](B);if(this['_shouldSendSelectionUpdate']()&&(_0x3461b7['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x59104a=[...this['_bufferedOperations']];for(const _0x709520 of _0x59104a)_0x709520['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x709520);const _0x3f59bf=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x59104a),_0x43cb94=F++,_0x180df7=this['_compressOperations'](_0x59104a),_0x1f331d=await this['_service']['sendOperations'](_0x180df7,_0x180df7['baseVersion'],_0x3f59bf);try{return await this['_handleServerResponse'](_0x59104a,_0x1f331d,_0x43cb94);}catch(_0x1036c7){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x1036c7);}}async['_handleServerResponse'](_0xf79d46,_0x23e2d4,_0x3ff847){if('error'in _0x23e2d4)throw _0x23e2d4['error'];let _0x497c13=!0x1;if(_0x23e2d4['wereChangesApplied']){_0x23e2d4['lastOperationId']&&(this['_lastSyncedOperationId']=_0x23e2d4['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1050b6=>!_0xf79d46['includes'](_0x1050b6));for(const _0x44d649 of _0xf79d46)_0x44d649['createdAt']='lastOperationAcceptedAt'in _0x23e2d4&&_0x23e2d4['lastOperationAcceptedAt']||void 0x0;G(_0xf79d46,_0x23e2d4['version']-_0xf79d46['length']),this['_updateServerHistory'](_0xf79d46);const _0x30d68c=_0xf79d46['filter'](_0x5a4ab5=>{if(!_0x5a4ab5['_isInit'])return!0x1;const _0x215fba=this['_getAffectedRoot'](_0x5a4ab5);return _0x215fba&&!this['_knownRootNames']['has'](_0x215fba);});G(_0x30d68c,this['_document']['version']),this['_applyOperationsSet'](_0x30d68c),_0x497c13=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x57b8c2=this['_decompressOperations'](_0x23e2d4['data'],_0x23e2d4['metadata'])['filter'](_0x2bc226=>_0x2bc226['baseVersion']>=this['_lastServerVersion']);_0x57b8c2['forEach'](_0x394bd7=>this['_addKnownRoot'](_0x394bd7)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x245417=>!_0x245417['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x245417))),this['_bufferedOperations']['length']&&G(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x57b8c2),_0x497c13=this['_handleExternalOperations'](_0x57b8c2,_0x23e2d4['version'],_0x23e2d4['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x497c13?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x1af8fa,_0x1d264c,_0x2a0bb0){try{const _0x390312={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4d3cdd,operationsB:_0x383eea,originalOperations:_0x2b4bf1}=_0x4779c9(_0x1af8fa,this['_bufferedOperations'],_0x390312);G(_0x4d3cdd,this['_document']['version']),G(_0x383eea,_0x1d264c);for(const _0x2e556f of _0x4d3cdd){const _0x49d1e0=_0x2b4bf1['get'](_0x2e556f);_0x2e556f['_authorId']=_0x49d1e0?_0x49d1e0['_authorId']:null;}_0x2a0bb0&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1af8fa,_0x2a0bb0),this['_lastSyncedOperationId']=_0x2a0bb0),this['_bufferedOperations']=[..._0x383eea],this['_applyOperationsSet'](_0x4d3cdd),this['_updateServerHistory'](_0x1af8fa);}catch(_0x2043b8){return console['error'](_0x2043b8),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2e2ebf,_0x536fae=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x12cfd0=>{for(const _0x1f61b1 of _0x2e2ebf)this['_knownOperations']['add'](_0x1f61b1),this['_addKnownRoot'](_0x1f61b1),_0x12cfd0['batch']['addOperation'](_0x1f61b1),this['editor']['model']['applyOperation'](_0x1f61b1);});}['_addKnownRoot'](_0x2f52e4){const _0x311c9f=this['_getAffectedRoot'](_0x2f52e4);_0x311c9f&&this['_knownRootNames']['add'](_0x311c9f);}['_getAffectedRoot'](_0x40b0ca){let _0x295ed8,_0xe428a;switch(_0x40b0ca['type']){case'insert':_0x295ed8=_0x40b0ca['position']['root'];break;case'marker':if(_0xe428a=_0x40b0ca['newRange'],!_0xe428a)return null;_0x295ed8=_0xe428a['root'];break;case'addRootAttribute':_0x295ed8=_0x40b0ca['root'];break;case'addRoot':_0x295ed8=_0x40b0ca['affectedSelectable'];break;case'move':_0x295ed8=_0x40b0ca['targetPosition']['root'];break;default:return null;}return _0x295ed8['rootName'];}['_updateServerHistory'](_0x245af0){_0x245af0['forEach'](_0x1026f9=>{const _0x58ab86=_0x1026f9['clone']();_0x58ab86['_authorId']=_0x1026f9['_authorId'],_0x58ab86['_isInit']=!!_0x1026f9['_isInit'],_0x58ab86['createdAt']=_0x1026f9['createdAt'],_0x58ab86['baseVersion']+=this['_offset'],_0x1026f9['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x58ab86),this['serverHistory']['addOperation'](_0x58ab86);});}['_handleReconnectionError'](_0x3c61bb){const _0x406f26=this['editor']['plugins']['get']('Notification'),_0x42c422=this['editor']['locale'];_0x3c61bb||(_0x3c61bb=M(_0x42c422,'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.')),_0x406f26['showWarning'](_0x3c61bb,{'title':M(_0x42c422,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x1bc531)['add'](M(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1bc531)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x423865){const _0x567b93=_0x423865['map'](_0x46bdfc=>_0x46bdfc['toJSON']());return this['_compressor']['compress'](_0x567b93);}['_decompressOperations'](_0x41fd8c,_0x392960){return this['_compressor']['decompress'](_0x41fd8c)['map']((_0x48d06d,_0x1c59ce)=>{const _0x487467='init'==_0x392960[_0x1c59ce]['type'];if('InsertOperation'==_0x48d06d['__className']){const _0x69e601=_0x48d06d['position']['root'];!this['_document']['getRoot'](_0x69e601)&&(this['_document']['createRoot']('$root',_0x69e601)['_isAttached']=!0x1);}const _0x33bbd6=_0x44316c['fromJSON'](_0x48d06d,this['_document']);return _0x33bbd6['wasUndone']=_0x48d06d['wasUndone'],_0x33bbd6['_isInit']=_0x487467,_0x33bbd6['_authorId']=_0x487467?null:_0x392960[_0x1c59ce]['userId'],_0x33bbd6['_isDisconnection']='cs:removeUser'===_0x392960[_0x1c59ce]['type'],_0x33bbd6['createdAt']=_0x392960[_0x1c59ce]['createdAt'],_0x33bbd6;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5d5876=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5d5876&&_0x5d5876['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class q extends Error{}function G(_0xba6f69,_0x54e23e){for(const _0x45a397 of _0xba6f69)_0x45a397['baseVersion']=_0x54e23e++;}class ${['_ignoredOperations'];['_operationToId'];constructor(_0x5da44c){this['_ignoredOperations']=_0x5da44c,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x46a21d){let _0x22060a=_0x46a21d['length'];for(;_0x22060a--;){const _0x1ff2d4=_0x46a21d[_0x22060a];if(!this['_ignoredOperations']['has'](_0x1ff2d4)){if(!this['_operationToId']['has'](_0x1ff2d4)){const _0x339c9f=_0x4fd132()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1ff2d4,_0x339c9f);}return this['_operationToId']['get'](_0x1ff2d4);}}}['setIdForTheLastOperation'](_0x266192,_0x22d35d){if(!_0x22d35d)return;let _0x3bb098=_0x266192['length'];for(;_0x3bb098--;){const _0x5d1245=_0x266192[_0x3bb098];this['_ignoredOperations']['has'](_0x5d1245)||this['_operationToId']['set'](_0x5d1245,_0x22d35d);}}}class n extends _0x46e1aa{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x5608fb{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>et)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x5f01ed];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x221f57){super(_0x221f57),this['_services']=new Map();}async['init'](){const _0x3a34d8=this['context'],_0x16bbbc=_0x3a34d8['plugins']['get']('CommentsRepository');if(_0x3a34d8['plugins']['get'](c)['addToReconnectionStack'](this),_0x16bbbc['adapter']={'addCommentThread':async({channelId:_0x6cc8f0,threadId:_0x5a11fa,comments:_0x43c7b2,resolvedAt:_0x3dd33e,resolvedBy:_0x4e4053,context:_0x3da9e0,attributes:_0x54208d})=>{const _0x258202=await this['_getService'](_0x6cc8f0)['addCommentThread']({'commentThreadId':_0x5a11fa,'comments':_0x43c7b2['map'](_0x5187a8=>function(_0x11560a,_0x56bd5c,_0x54cb27){return{'commentThreadId':_0x54cb27,'commentId':_0x11560a['commentId'],'userId':_0x11560a['authorId'],'content':_0x11560a['content'],'documentId':_0x56bd5c,'createdAt':_0x11560a['createdAt'],'attributes':_0x11560a['attributes']||{}};}(_0x5187a8,_0x6cc8f0,_0x5a11fa)),'resolvedAt':_0x3dd33e,'resolvedBy':_0x4e4053,'context':_0x3da9e0,'attributes':_0x54208d})['catch'](wt);return{'threadId':_0x258202['commentThreadId'],'comments':_0x258202['comments']};},'getCommentThread':async({channelId:_0x549605,threadId:_0x31db05})=>{const _0x13389a=await this['_getService'](_0x549605)['getCommentThread'](_0x31db05)['catch'](wt);return _0x13389a['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x13389a]),{'threadId':_0x13389a['commentThreadId'],'comments':_0x13389a['comments']['map'](st),'context':_0x13389a['context'],'resolvedAt':_0x13389a['resolvedAt'],'resolvedBy':_0x13389a['resolvedBy'],'attributes':_0x13389a['attributes']||{}});},'updateCommentThread':async({channelId:_0x58c8ed,threadId:_0x105409,context:_0x41776e,unlinkedAt:_0x4d8dcc,attributes:_0x16ab16})=>this['_getService'](_0x58c8ed)['updateCommentThread']({'commentThreadId':_0x105409,'context':_0x41776e,'attributes':_0x16ab16,'unlinkedAt':_0x4d8dcc})['catch'](ot)['catch'](wt),'resolveCommentThread':async({channelId:_0x3b8827,threadId:_0x48c9fe})=>{const _0x4e4195=await this['_getService'](_0x3b8827)['resolveCommentThread'](_0x48c9fe)['catch'](ot)['catch'](wt);return{'threadId':_0x4e4195['commentThreadId'],'resolvedAt':_0x4e4195['resolvedAt'],'resolvedBy':_0x4e4195['resolvedBy']};},'reopenCommentThread':async({channelId:_0x468c47,threadId:_0x9cda5b})=>this['_getService'](_0x468c47)['reopenCommentThread'](_0x9cda5b)['catch'](ot)['catch'](wt),'removeCommentThread':({channelId:_0xa78843,threadId:_0x35eec2})=>this['_getService'](_0xa78843)['removeCommentThread'](_0x35eec2)['catch'](ot)['catch'](wt),'addComment':({channelId:_0x21e816,threadId:_0x4ed3da,commentId:_0x162259,content:_0x4fd643,attributes:_0x5a92d4})=>this['_getService'](_0x21e816)['addComment'](_0x4ed3da,_0x162259,_0x4fd643,_0x5a92d4)['catch'](wt),'updateComment':({channelId:_0x2e05c7,threadId:_0x24bc9e,commentId:_0x2cb33c,content:_0x5889ef,attributes:_0x19d648})=>this['_getService'](_0x2e05c7)['updateComment'](_0x24bc9e,_0x2cb33c,_0x5889ef,_0x19d648)['catch'](ot)['catch'](wt),'removeComment':({channelId:_0x3b5f14,threadId:_0x334294,commentId:_0x36ecae})=>this['_getService'](_0x3b5f14)['removeComment'](_0x334294,_0x36ecae)['catch'](ot)['catch'](wt)},_0x3a34d8 instanceof tt){const _0x1e1467=_0x3a34d8['config']['get']('collaboration.channelId'),_0x6891c6=_0x3a34d8['plugins']['get'](i);await this['_setUpService'](_0x1e1467);const _0x3ae6ce=await this['_services']['get'](_0x1e1467)['getConnectedSessions']();this['listenTo'](_0x6891c6,'sessionAdd:'+_0x1e1467,(_0x563d31,{session:_0x315864})=>{_0x315864['id']===_0x6891c6['mySessionId']&&(_0x563d31['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x315864['permissions'],_0x1e1467));}),_0x6891c6['register'](_0x1e1467,_0x3ae6ce);}}async['_setUpService'](_0x19d0d2){if(this['_services']['has'](_0x19d0d2))throw new _0x26a8d4('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x19d0d2});const _0x55d099=this['context']['plugins']['get']('CommentsRepository'),_0x29708f=new a['CommentsService'](_0x19d0d2);this['_services']['set'](_0x19d0d2,_0x29708f),this['listenTo'](_0x29708f,'commentThreadAdded',(_0x16fc68,_0x300099)=>{const {commentThreadId:_0x562381,documentId:_0x40d5b5,context:_0x33f7d7,attributes:_0x4750d7,resolvedAt:_0xef792,resolvedBy:_0x130582,comments:_0x10c9d4}=_0x300099;_0x55d099['getCommentThread'](_0x562381)||_0x55d099['addCommentThread']({'threadId':_0x562381,'channelId':_0x40d5b5,'comments':_0x10c9d4?_0x10c9d4['map'](st):[],'context':_0x33f7d7,'attributes':_0x4750d7,'resolvedAt':_0xef792,'resolvedBy':_0x130582,'isFromAdapter':!0x0});}),this['listenTo'](_0x29708f,'commentThreadUpdated',(_0x42d9d1,{commentThreadId:_0x5ecd61,documentId:_0x2ae53d,context:_0xae6dbf,unlinkedAt:_0x1ad787,attributes:_0x66099d})=>{_0x55d099['getCommentThread'](_0x5ecd61)&&_0x55d099['updateCommentThread']({'threadId':_0x5ecd61,'channelId':_0x2ae53d,'context':_0xae6dbf,'unlinkedAt':_0x1ad787,'attributes':_0x66099d,'isFromAdapter':!0x0});}),this['listenTo'](_0x29708f,'commentThreadResolved',(_0x25a62d,{commentThreadId:_0x476e2d,resolvedBy:_0x40c4ba,resolvedAt:_0x322868})=>{const _0x210ad6=_0x55d099['getCommentThread'](_0x476e2d);_0x210ad6&&_0x210ad6['resolve']({'resolvedBy':_0x40c4ba,'resolvedAt':_0x322868,'isFromAdapter':!0x0});}),this['listenTo'](_0x29708f,'commentThreadReopened',(_0x5bc693,{commentThreadId:_0x523926})=>{const _0x12af55=_0x55d099['getCommentThread'](_0x523926);_0x12af55&&_0x12af55['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x29708f,'commentThreadRemoved',(_0x5329b5,{commentThreadId:_0xc53b97})=>{const _0x555a88=_0x55d099['getCommentThread'](_0xc53b97);_0x555a88&&_0x555a88['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x29708f,'commentAdded',(_0x32638d,_0x7bb4c1)=>{const _0x5d11bc=_0x7bb4c1['commentThreadId'],_0x5ebb51=_0x55d099['getCommentThread'](_0x5d11bc);_0x5ebb51&&_0x5ebb51['addComment']({...st(_0x7bb4c1),'isFromAdapter':!0x0});}),this['listenTo'](_0x29708f,'commentUpdated',(_0x22fdcc,{commentThreadId:_0x395508,commentId:_0x381c42,content:_0x2b9d5a,attributes:_0x204ff7})=>{const _0x3ee0f8=_0x55d099['getCommentThread'](_0x395508);if(_0x3ee0f8){const _0x218fed=_0x3ee0f8['getComment'](_0x381c42);_0x218fed&&_0x218fed['update']({'content':_0x2b9d5a,'attributes':_0x204ff7,'isFromAdapter':!0x0});}}),this['listenTo'](_0x29708f,'commentRemoved',(_0x5710d4,{commentThreadId:_0x78479,commentId:_0x1287fb})=>{const _0x5aa9aa=_0x55d099['getCommentThread'](_0x78479);if(_0x5aa9aa){const _0x484143=_0x5aa9aa['getComment'](_0x1287fb);_0x484143&&_0x484143['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x19d0d2);}['destroy'](){if(this['context']instanceof tt){const _0x2378fd=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x2378fd);}}['_terminateService'](_0x40a848){if(!this['_services']['has'](_0x40a848))throw new _0x26a8d4('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x40a848});this['_getService'](_0x40a848)['disconnect'](),this['_services']['delete'](_0x40a848);}async['reconnect'](){for(const _0x14132e of this['_services']['keys']())await this['_connectService'](_0x14132e);if(this['context']instanceof tt){const _0x515f35=this['context']['config']['get']('collaboration.channelId'),_0x168d99=this['context']['plugins']['get'](i);_0x168d99['unregister'](_0x515f35);const _0x29f23e=await this['_services']['get'](_0x515f35)['getConnectedSessions']();_0x168d99['register'](_0x515f35,_0x29f23e);}}async['_connectService'](_0x4fada3){const {connection:_0x43bfdd}=this['context']['plugins']['get'](c),_0x1bcda2=this['context']['plugins']['get']('CommentsRepository'),_0x533fa6=this['_services']['get'](_0x4fada3),_0x16ae1d=await _0x533fa6['connect'](_0x43bfdd);await this['_fetchMissingUsersForThreads'](_0x16ae1d);const _0xd9eb1b=new Set(Array['from'](_0x1bcda2['getCommentThreads']({'channelId':_0x4fada3}),_0x2a3fdb=>_0x2a3fdb['id']));for(const _0x3cd07f of _0x16ae1d)_0x3cd07f['deletedAt']||_0xd9eb1b['delete'](_0x3cd07f['commentThreadId']);for(const _0x2d8e74 of _0xd9eb1b)_0x1bcda2['getCommentThread'](_0x2d8e74)['remove']({'isFromAdapter':!0x0});for(const _0x34595f of _0x16ae1d){let _0x3675b7=_0x1bcda2['getCommentThread'](_0x34595f['commentThreadId']);const {commentThreadId:_0x544da3,context:_0x359730,attributes:_0x6376b3,resolvedBy:_0x2370e9,resolvedAt:_0x4f2bc2,unlinkedAt:_0x1c14bf,deletedAt:_0x3fa825}=_0x34595f;if(_0x3fa825)continue;_0x3675b7||(_0x3675b7=_0x1bcda2['addCommentThread']({'channelId':_0x4fada3,'threadId':_0x544da3,'context':_0x359730,'attributes':_0x6376b3||{},'resolvedBy':_0x2370e9,'resolvedAt':_0x4f2bc2,'unlinkedAt':_0x1c14bf,'isFromAdapter':!0x0}));const _0x32fa9f=new Set(Array['from'](_0x3675b7['comments'],_0x2d0d67=>_0x2d0d67['id']));for(const _0x6a3a49 of _0x34595f['comments'])_0x32fa9f['delete'](_0x6a3a49['commentId']);for(const _0x2db130 of _0x32fa9f)_0x3675b7['getComment'](_0x2db130)['remove']({'isFromAdapter':!0x0});for(const _0x4e93e9 of _0x34595f['comments']){const _0x33631a=_0x3675b7['getComment'](_0x4e93e9['commentId']);_0x33631a?_0x33631a['content']!==_0x4e93e9['content']&&_0x33631a['update']({'content':_0x4e93e9['content'],'isFromAdapter':!0x0}):_0x3675b7['addComment'](Object['assign'](st(_0x4e93e9),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1f9e5e){if(!this['_services']['has'](_0x1f9e5e))throw new _0x26a8d4('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1f9e5e});return this['_services']['get'](_0x1f9e5e);}async['_fetchMissingUsersForThreads'](_0x52d884){const _0x57df41=this['context']['plugins']['get'](_0x5f01ed),{connection:_0x3b4110}=this['context']['plugins']['get'](c),_0x27b174=new Set();for(const {resolvedBy:_0x3afe2c,comments:_0x299d1d}of _0x52d884){_0x3afe2c&&!_0x57df41['getUser'](_0x3afe2c)&&_0x27b174['add'](_0x3afe2c);for(const {userId:_0x296a90}of _0x299d1d)_0x57df41['getUser'](_0x296a90)||_0x27b174['add'](_0x296a90);}if(0x0===_0x27b174['size'])return;const _0x5db73f=await gt['getMany'](_0x3b4110,Array['from'](_0x27b174));for(const _0x3867e4 of _0x5db73f)_0x57df41['getUser'](_0x3867e4['id'])||_0x57df41['addUser'](_0x3867e4);}}async function ot(_0x33aed2){if('404'!==_0x33aed2['code'])throw _0x33aed2;}function wt(_0x358efa){if((_0x22265f=_0x358efa)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x22265f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x22265f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x22265f;throw _0x358efa;}function st(_0xc34dd3){return{'threadId':_0xc34dd3['commentThreadId'],'commentId':_0xc34dd3['commentId'],'content':_0xc34dd3['content'],'createdAt':_0xc34dd3['createdAt'],'authorId':_0xc34dd3['userId'],'attributes':_0xc34dd3['attributes']||{}};}class f extends _0x46e1aa{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(
|
|
28
|
-
((()=>rt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x5f01ed];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x17f49f){super(_0x17f49f);const _0x335698=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x335698);}async['init'](){const _0x307dda=this['editor']['plugins']['get'](l),_0x302daf=_0x307dda['serverHistory'],_0x3ec80e=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x302daf,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x307dda['sessionId']});const _0x269cb7=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x30671e=await it['isBundleUploaded'](_0x3ec80e['connection'],_0x269cb7);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x48c4e3})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x48c4e3)),'updateRevisions':async _0x7a7c6=>{await this['_waitForServiceReady']();const _0x5ab65c=this['_revisionTracker']['currentRevision'];if(_0x30671e&&0x1===_0x7a7c6['length']&&_0x7a7c6[0x0]['id']===_0x5ab65c['id'])return _0x7a7c6;for(const _0x46db6e of _0x7a7c6)_0x46db6e['id']===_0x5ab65c['id']&&(_0x46db6e['isEmptyCurrent']=_0x46db6e['fromVersion']===_0x46db6e['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x7a7c6,this['_lastRequestId'])['then'](_0x55c42b=>(this['_lastRequestId']=_0x55c42b,_0x7a7c6))['catch'](_0x294261=>{if(ct(_0x294261)||'400'===_0x294261['code']&&void 0x0!==_0x294261['data']['wrongRequestId']){for(const _0x4d4cc6 of _0x7a7c6){!this['_revisionTracker']['repository']['getRevision'](_0x4d4cc6['id'])||this['_revisionTracker']['_bufferUpdate'](_0x4d4cc6['id'],_0x4d4cc6,!0x1);}if(ct(_0x294261))throw _0x294261;return _0x7a7c6;}throw _0x294261;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x17edb2,{revisionsData:_0x1e3201,requestId:_0x38286a})=>{Math['max'](..._0x1e3201['map'](_0x20e882=>_0x20e882['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1e3201,_0x38286a);}):this['_handleRevisionsUpdate'](_0x1e3201,_0x38286a);});const {revisions:_0x1232fe,requestId:_0x15b16e}=await this['_revisionHistoryService']['connect'](_0x3ec80e['connection']);_0x3ec80e['addToReconnectionStack'](this),this['_lastRequestId']=_0x15b16e,await this['_fetchMissingUsers'](_0x1232fe);for(const _0x292ae1 of _0x1232fe)this['_revisionTracker']['addRevisionData'](_0x292ae1);this['listenTo'](_0x307dda,'change:_isConnected',(_0x9c72bc,_0x6d156e,_0x122582)=>{_0x122582&&(this['_oldOffset']=_0x307dda['_offset'],_0x9c72bc['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3ec80e,'state',_0x3bf06f=>_0x3bf06f===_0x3b67d1['CONNECTED']);}async['reconnect'](){const _0x20ef5b=this['editor']['plugins']['get'](c),_0x207c3f=this['editor']['plugins']['get'](l),_0x43d0e1=async()=>{const _0x2d3083=this['_revisionTracker']['currentRevision'],_0x1ce002=_0x2d3083['id'],_0xfac4f=_0x1ce002!==_0x207c3f['sessionId'];if(_0xfac4f){const _0x35aa4f=_0x207c3f['_offset']-this['_oldOffset'],_0x24e302=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2d3083['toVersion']+_0x35aa4f!==_0x24e302){const _0x5ab289=_0x2d3083['fromVersion']+_0x35aa4f,_0x1851ce=this['editor']['plugins']['get'](_0x5f01ed),_0x1a9109=this['_revisionTracker']['buildRevisionData']({'revision':_0x2d3083,'from':_0x5ab289,'to':_0x24e302});_0x1a9109['id']=_0x2d3083['id'];const _0x469c5b=_0x1a9109['authorsIds']['map'](_0x5c25b2=>_0x1851ce['getUser'](_0x5c25b2));_0x2d3083['_update']({..._0x1a9109,'authors':_0x469c5b},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2d3083['id'],_0x1a9109,!0x0);}this['_revisionTracker']['_startingVersion']=_0x24e302,(_0x2d3083['toVersion']===_0x2d3083['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x1ce002)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x1ce002),this['_revisionTracker']['_createCurrentRevision'](_0x24e302));}const {revisions:_0x592087,requestId:_0x3c9d0b}=await this['_revisionHistoryService']['reconnect'](_0x20ef5b['connection'],this['_lastRequestId']);_0xfac4f&&_0x592087['length']>0x0?_0x207c3f['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x592087),this['_handleRevisionsUpdate'](_0x592087,_0x3c9d0b),this['_revisionTracker']['sendBufferedUpdates']());};return _0x207c3f['_isConnected']?_0x43d0e1():new Promise((_0x3eb775,_0x2031c1)=>{_0x207c3f['once']('change:_isConnected',()=>{_0x43d0e1()['then'](_0x3eb775)['catch'](_0x2031c1);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4ef851=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x8243d4=>{_0x8243d4['off'](),_0x4ef851();});});}['_getLatestVersionFromServerOperations'](){const _0x536381=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x274cc0 of _0x536381)if('marker'!==_0x274cc0['type']||_0x274cc0['affectsData'])return _0x274cc0['baseVersion']+0x1;}['_getLatestVersion'](){const _0x554145=this['editor']['plugins']['get'](l);return new Promise(_0x2ab6ca=>{_0x554145['_isPendingUpdate']?_0x554145['once']('change:_isPendingUpdate',()=>{_0x2ab6ca(this['_getLatestVersionFromServerOperations']());}):_0x2ab6ca(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x487133,_0x2d31ab){const _0x33aa32=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2d31ab;for(const _0x537616 of _0x487133){const _0x2a3a6e=_0x33aa32['getRevision'](_0x537616['id']);if(_0x2a3a6e){if((_0x537616['fromVersion']||_0x537616['toVersion'])&&(_0x537616['diffData']=null),_0x2a3a6e===this['_revisionTracker']['currentRevision']){const _0x4b0e28=Math['max'](_0x2a3a6e['toVersion'],_0x537616['toVersion']),_0x1178c0=Math['max'](_0x2a3a6e['fromVersion'],_0x537616['fromVersion']);let _0x338ced;_0x2a3a6e['toVersion']===_0x537616['toVersion']&&_0x2a3a6e['fromVersion']===_0x537616['fromVersion']?(_0x338ced=!0x0,this['_preventResendingRevisionData'](_0x537616)):_0x537616['toVersion']===_0x4b0e28&&_0x537616['fromVersion']===_0x1178c0?_0x338ced=!0x1:(_0x2a3a6e['toVersion']===_0x4b0e28&&_0x2a3a6e['fromVersion']===_0x1178c0||this['_fixRevision']({'revision':_0x2a3a6e,'from':_0x1178c0,'to':_0x4b0e28}),_0x338ced=!0x0),_0x338ced&&(delete _0x537616['fromVersion'],delete _0x537616['toVersion'],delete _0x537616['diffData'],delete _0x537616['createdAt'],delete _0x537616['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x537616),this['_preventResendingRevisionData'](_0x537616);}else this['_revisionTracker']['addRevisionData'](_0x537616);}const _0x1bc47f=_0x33aa32['getRevisions']();_0x1bc47f['reverse']();for(let _0x1c30b2=0x0;_0x1c30b2<_0x1bc47f['length']-0x1;_0x1c30b2++){const _0x10a395=_0x1bc47f[_0x1c30b2],_0x56fbbf=_0x1bc47f[_0x1c30b2+0x1];if(_0x10a395['fromVersion']<_0x56fbbf['toVersion']){const _0x5b91be=_0x56fbbf['toVersion'],_0x2782e3=Math['max'](_0x5b91be,_0x10a395['toVersion']);this['_fixRevision']({'revision':_0x10a395,'from':_0x5b91be,'to':_0x2782e3});}}}['_fixRevision']({revision:_0x3278b9,from:_0x5e260e,to:_0x56bc00}={}){const _0x362488=this['editor']['plugins']['get'](_0x5f01ed),_0x3dbdae=this['_revisionTracker']['buildRevisionData']({'revision':_0x3278b9,'from':_0x5e260e,'to':_0x56bc00});_0x3dbdae['authors']=_0x3dbdae['authorsIds']['map'](_0x167371=>_0x362488['getUser'](_0x167371)),_0x3278b9['_update'](_0x3dbdae);}['_preventResendingRevisionData'](_0x140185){const _0xd62c72={};_0xd62c72['id']=_0x140185['id'];for(const _0xe9d80b of Object['keys'](_0x140185))'id'!==_0xe9d80b&&(_0xd62c72[_0xe9d80b]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xd62c72['id'],_0xd62c72,!0x0);}async['_fetchMissingUsers'](_0x32193b){const _0x3917b9=this['editor']['plugins']['get'](_0x5f01ed),{connection:_0x451248}=this['editor']['plugins']['get'](c),_0x4a2fd2=new Set();for(const _0x5e2734 of _0x32193b){for(const _0x87cb72 of _0x5e2734['authorsIds'])_0x211ebf(_0x87cb72);_0x5e2734['creatorId']&&_0x211ebf(_0x5e2734['creatorId']);}if(0x0===_0x4a2fd2['size'])return;const _0x125f2b=await gt['getMany'](_0x451248,Array['from'](_0x4a2fd2));for(const _0x338062 of _0x125f2b)_0x3917b9['getUser'](_0x338062['id'])||_0x3917b9['addUser'](_0x338062);function _0x211ebf(_0x1e07a7){_0x3917b9['getUser'](_0x1e07a7)||_0x4a2fd2['add'](_0x1e07a7);}}}function ct(_0x42e620){return _0x42e620['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x42e620['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x42e620['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x46e1aa{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x52ca26{['_collapseAt'];constructor(_0x2c1754,_0x6ac1c=0x6){super(_0x2c1754);const _0x5be003=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x6ac1c,this['bind']('isHidden')['to'](this,'usersCount',_0x54b564=>_0x54b564<_0x6ac1c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x5be003['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':_0x5be003['to']('usersCount',_0x3fec53=>'+'+(_0x3fec53-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x52ca26{['items'];['keystrokes'];constructor(_0x143eb8){super(_0x143eb8);const _0x47946d=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x289bea(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x47946d['if']('hasPopup'),'aria-expanded':_0x47946d['to']('isExpanded',_0x36a3eb=>this['hasPopup']&&String(_0x36a3eb)),'aria-label':_0x47946d['to']('hasPopup',_0x51e0fd=>M(_0x143eb8,_0x51e0fd?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x47946d['to']('hasPopup',_0x5b27b2=>!!_0x5b27b2&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x47946d['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x47946d['to'](_0x518dba=>{const _0x1b2d91=_0x518dba,_0x567126=document['querySelector']('.ck-presence-list__dropdown-list'),_0x3441b4=document['querySelector']('.ck-balloon-panel_with-arrow');_0x567126?.['contains'](_0x1b2d91['relatedTarget'])||_0x3441b4?.['contains'](_0x1b2d91['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x51070b,_0x399df7,_0x23f15e)=>{this['element']&&(_0x23f15e?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 j extends _0x52ca26{['counterView'];['inlineListView'];constructor(_0x4edcf3,_0x42100c=0x6){super(_0x4edcf3);const _0x2b2815=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x42100c),this['inlineListView']=new ts(_0x4edcf3),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x15ab34 of this['inlineListView']['items'])_0x15ab34['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',_0x2b2815['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x52ca26{['listWrapperView'];constructor(_0xa832d2,_0x2831dc){super(_0xa832d2);const _0x1b5bbc=this['bindTemplate'];this['listWrapperView']=new _t(_0xa832d2,_0x2831dc),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':M(_0xa832d2,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x1b5bbc['to'](_0x3df10f=>{const _0x1defcd=_0x3df10f,_0x307998=document['querySelector']('.ck-presence-list__list'),_0x233733=document['querySelector']('.ck-balloon-panel_with-arrow');_0x307998?.['contains'](_0x1defcd['relatedTarget'])||_0x233733?.['contains'](_0x1defcd['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class _t extends _0x5c2b3f{constructor(_0x4c51fa,_0x585065){super(_0x4c51fa);const _0x28f1fb=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x585065?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x28f1fb['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x28f1fb['to']('role'),'aria-label':_0x28f1fb['to']('ariaLabel'),'aria-labelledby':_0x28f1fb['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x4aa1a9['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5a4cb4=this['element'];_0x5a4cb4&&(this['_isScrollable']=Math['max'](_0x5a4cb4['scrollHeight'],_0x5a4cb4['clientHeight'])>0.8*window['innerHeight']);}}class k extends lt{['userView'];constructor(_0x15161f,_0x5efd7a,_0x20bccd){super(_0x15161f);const _0x3f7ea8=this['bindTemplate'];this['userView']=new ut(_0x15161f,_0x5efd7a);const _0x245572={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x5efd7a['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x5efd7a['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5efd7a['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x20bccd&&(_0x245572['tag']='button',_0x245572['on']={'click':_0x3f7ea8['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x245572);}['focus'](){this['element']['focus']();}}class y extends _0x52ca26{['userView'];['markerView'];constructor(_0xad89da,_0x1cd5cf,_0x46a504){super(_0xad89da);const _0x1a057f=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ut(_0xad89da,_0x1cd5cf),this['markerView']=new dt(_0xad89da,_0x1cd5cf);const _0x23c58a=new pt(_0xad89da);_0x23c58a['template']['tag']='span',_0x23c58a['text']=_0x1cd5cf['name'];const _0x178911={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1a057f['to']('isFocusable',_0x9f8e62=>!!_0x9f8e62&&0x0),'aria-labelledby':_0x23c58a['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1a057f['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1a057f['to']('hasTooltip',_0x2b90a6=>!_0x2b90a6),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x23c58a]};_0x46a504&&(_0x178911['tag']='button',_0x178911['on']={'click':_0x1a057f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x178911);}}class dt extends _0x52ca26{constructor(_0xfe0b7e,_0x3c9ca9){super(_0xfe0b7e),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3c9ca9['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x5608fb{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4fed95){super(_0x4fed95),this['context']['config']['define']('presenceList',C);const _0x4a409b=_0x4fed95['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4a409b)throw new _0x26a8d4('presencelist-collapseat-invalid-format',this);if(_0x4a409b<0x1)throw new _0x26a8d4('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x19740c(),this['balloonPanelView']=new _0x5b0ca7(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0xe5cf0 of this['_allConnectedUsers'])this['_handleUserAdd'](_0xe5cf0);this['listenTo'](this['_allConnectedUsers'],'add',(_0x3266b6,_0x378734)=>{this['_handleUserAdd'](_0x378734);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0xdd374,_0x2cb7fd)=>{this['_handleUserRemove'](_0x2cb7fd);});}['_createView'](){const _0x3000e1=this['context'],_0x7ab9a3=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x1392d9=this['balloonPanelView'];if(!_0x107f30(_0x3000e1['config']['get']('presenceList.container')))throw new _0x26a8d4('presencelist-missing-container',this);return _0x7ab9a3['counterView']['bind']('usersCount')['to'](this),_0x7ab9a3['bind']('isCollapsed')['to'](this,'usersCount',_0x1cebb8=>{const {collapseAt:_0x70d017}=_0x3000e1['config']['get']('presenceList'),_0x5fe789=_0x1cebb8>=_0x70d017;if(_0x5fe789&&!_0x7ab9a3['inlineListView']['items']['find'](_0x33fe68=>_0x33fe68 instanceof A)){const _0x3dd2ab=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x3dd2ab&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x7ab9a3['inlineListView']['items']['add'](_0x7ab9a3['counterView']);}return _0x5fe789||this['hideDropdown'](),_0x5fe789;}),_0x7ab9a3['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x5cb29=>{const _0x29ca10=_0x3000e1['config']['get']('presenceList'),_0x4e6e7a=new y(_0x3000e1['locale'],_0x5cb29,!!_0x29ca10['onClick']);return _0x4e6e7a['bind']('hasTooltip')['to'](_0x7ab9a3,'isCollapsed',_0xb07867=>!_0xb07867),_0x4e6e7a['bind']('isFocusable')['to'](_0x7ab9a3,'isCollapsed',_0x31991e=>!_0x31991e),_0x29ca10['onClick']&&this['listenTo'](_0x4e6e7a,'execute',()=>{this['view']['isCollapsed']||_0x29ca10['onClick'](_0x5cb29,_0x4e6e7a['element']);}),_0x4e6e7a;}),this['listenTo'](_0x7ab9a3['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x7ab9a3['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x7ab9a3['inlineListView']['keystrokes']['set']('Enter',(_0x490abc,_0x1d7823)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x1d7823());}),_0x7ab9a3['render'](),_0x1392d9['render'](),_0x4155b7({'emitter':_0x7ab9a3,'activator':()=>_0x1392d9['isVisible'],'contextElements':[_0x1392d9['element'],_0x7ab9a3['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x3000e1['config']['get']('presenceList.container')['appendChild'](_0x7ab9a3['element']),this['_bodyCollection']=new _0x5583ac(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x7ab9a3;}['_handleUserAdd'](_0x5276a8){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x5276a8['isMe'])return;const _0x3c00b2=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x3c00b2-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x2a8d93=_0x5276a8['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x5276a8,_0x2a8d93);}['_handleUserRemove'](_0x17b476){this['usersCount']--;const {collapseAt:_0x260628}=this['context']['config']['get']('presenceList'),_0x12b105=this['usersCount']>=_0x260628;if(this['currentDisplayedUsers']['get'](_0x17b476['id']))this['currentDisplayedUsers']['remove'](_0x17b476['id']);else{if(_0x12b105&&this['currentDisplayedUsers']['length']+0x1===_0x260628-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x12b105?0x1:0x0)<this['usersCount']){for(const _0x186518 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x186518['id'])&&(this['currentDisplayedUsers']['add'](_0x186518,Math['min'](this['currentDisplayedUsers']['length']-(_0x12b105?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x12b105?0x1:0x0)===_0x260628-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x2c1d14=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x2c1d14['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x3c9aa7}=this['presenceDropdownView'];_0x3c9aa7['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x419eda=>{if(!_0x2c1d14['displayMe']&&_0x419eda['isMe'])return null;const _0x1e8097=new k(this['context']['locale'],_0x419eda,!!_0x2c1d14['onClick']);return _0x2c1d14['onClick']&&this['listenTo'](_0x1e8097,'execute',()=>{_0x2c1d14['onClick'](_0x419eda,_0x1e8097['element']);}),_0x1e8097;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x3c9aa7['focus'](),_0x3c9aa7['checkIfScrollable']();const _0x4ed57b=(_0x58fdbb,_0x487f48)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x487f48();};_0x3c9aa7['keystrokes']['set']('Esc',_0x4ed57b),_0x3c9aa7['keystrokes']['set']('Shift+Tab',_0x4ed57b),_0x3c9aa7['keystrokes']['set']('Tab',(_0x3a15ac,_0x289437)=>{!function(_0x315511){const _0x3b4f0f=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xa7b944=>_0xa7b944+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3d3d2f=[...document['body']['querySelectorAll'](_0x3b4f0f)]['filter'](_0x33d851=>_0x33d851===document['activeElement']||_0x33d851['offsetWidth']+_0x33d851['offsetHeight']>0x0)['sort']((_0x4b34ec,_0x34e5e6)=>(_0x4b34ec['tabIndex']||0x0)-(_0x34e5e6['tabIndex']||0x0)),_0x5c6435=_0x3d3d2f['indexOf'](_0x315511),_0x1698ff=_0x3d3d2f[(_0x5c6435+0x1)%_0x3d3d2f['length']];_0x1698ff&&_0x1698ff['focus']();}(this['view']['element']),this['hideDropdown'](),_0x289437();}),_0x3c9aa7['focusTracker']['add'](this['view']['element']),_0x3c9aa7['focusTracker']['on']('change:isFocused',(_0x3c6644,_0x454e59,_0xfc4e56)=>{_0xfc4e56||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x5608fb{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
|
23
|
+
import{ContextPlugin as _0x1390d5,Plugin as _0x228e35,PendingActions as _0x54c310,Context as _0x3485da}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x5c5569,CKEditorError as _0x404cce,Collection as _0x210266,global as _0xf146c8,version as ht,uid as _0x482ed0,KeystrokeHandler as _0x3351df}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x35081a,View as _0x405b4a,ListView as _0x2d3481,ListItemView as lt,LabelView as pt,BalloonPanelView as _0x500144,clickOutsideHandler as _0x1f5fe9,BodyCollection as _0xc6f326}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ft,History as _0x5839cf,NoOperation as _0x21e77f,InsertOperation as _0xfd37f2,MarkerOperation as _0x3cdadb,RootAttributeOperation as _0x431b67,transformSets as _0x8c424a,OperationFactory as _0x5bc9bc}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as mt,WEB_SOCKET_GATEWAY_STATES as _0x1605b2,CollaborativeEditingService as _0x669c44,User as gt,CommentsService as _0x3a643b,TrackChangesService as at,RevisionHistoryService as nt,EditorService as ot}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x1d491e,UserView as ut}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x68aa40}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x391704}from'es-toolkit/compat';class c extends _0x1390d5{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>mt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x35081a];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d567d){super(_0x3d567d),this['set']('state',_0x1605b2['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x5c5569);}['init'](){const _0x3c113f=this['context'],_0x1705d4=_0x3c113f['plugins']['get']('CloudServices'),_0x380bdd=_0x3c113f['plugins']['get'](_0x35081a);if(!_0x1705d4['token'])throw new _0x404cce('websocketgateway-missing-token',this);if(!_0x1705d4['webSocketUrl'])throw new _0x404cce('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x1705d4['token'],_0x1705d4['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x20e898=>{if(this['connection']=_0x20e898,this['bind']('state')['to'](_0x20e898,'state',this,'_isBrowserOffline',(_0x23256e,_0x3176ac)=>('connected'!==_0x23256e&&(this['_shouldPluginsReconnect']=!0x0),_0x3176ac||_0x23256e!==_0x1605b2['CONNECTED']?_0x1605b2['DISCONNECTED']:this['state']==_0x1605b2['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x1605b2['CONNECTING']):_0x1605b2['CONNECTED'])),this['connection']['on']('error',(_0x3a5a5e,_0x3e0f70)=>{if('limitExceeded'!==_0x3e0f70['code'])throw console['error'](_0x3e0f70),new _0x404cce('cloudservices-init',null,{'originalError':_0x3e0f70});_0x380bdd['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'});}),!_0x20e898['me'])return new Promise(_0x2d2af7=>_0x20e898['on']('change:me',_0x2d2af7));})['catch'](_0x22d4cd=>{throw console['error'](_0x22d4cd),new _0x404cce('cloudservices-init',null,{'originalError':_0x22d4cd});});}['addToReconnectionStack'](_0x4cda33){if('function'!=typeof _0x4cda33['reconnect'])throw new _0x404cce('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4cda33))throw new _0x404cce('websocketgateway-plugin-already-registered',this,{'name':_0x4cda33['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4cda33);}['removeFromReconnectionStack'](_0xe05957){this['_reconnectionStack']['delete'](_0xe05957);}['isInReconnectionStack'](_0x1ae821){return this['_reconnectionStack']['has'](_0x1ae821);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x2cb058=>_0x2cb058['reconnect']())))['then'](()=>this['state']=_0x1605b2['CONNECTED'])['catch'](_0x2847fc=>{throw console['error'](_0x2847fc),new _0x404cce('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x1605b2['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x1390d5{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x1d491e];}constructor(_0x3b4922){super(_0x3b4922),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x210266(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x1d491e);}['init'](){const _0x2e6027=this['context']['plugins']['get'](c);this['listenTo'](_0x2e6027,'change:state',(_0x36b638,_0x57e2f1,_0x23d8ed)=>{if('connected'!==_0x23d8ed)this['channelSessions']['forEach'](_0x517157=>_0x517157['clear']()),this['channelConnectedUsers']['forEach'](_0x297652=>_0x297652['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x28d07d,_0x31b854]of this['_registeredSessions'])for(const _0x3063b3 of _0x31b854)this['_handleSessionAdd'](_0x28d07d,_0x3063b3);}}),this['_createUser'](_0x2e6027['connection']['me'],!0x0);}['register'](_0x23ebc8,_0x397452){if(this['_registeredSessions']['has'](_0x23ebc8))throw new _0x404cce('sessions-register-already-registered',null,{'channelId':_0x23ebc8});this['_registeredSessions']['set'](_0x23ebc8,_0x397452),this['channelSessions']['set'](_0x23ebc8,new _0x210266()),this['channelConnectedUsers']['set'](_0x23ebc8,new _0x210266()),this['listenTo'](_0x397452,'add',(_0x1ef108,_0x47f8e6)=>this['_handleSessionAdd'](_0x23ebc8,_0x47f8e6)),this['listenTo'](_0x397452,'remove',(_0x39ad43,_0x5b4504)=>this['_handleSessionRemove'](_0x23ebc8,_0x5b4504));for(const _0x57c9e0 of _0x397452)this['_handleSessionAdd'](_0x23ebc8,_0x57c9e0);}['unregister'](_0x4c1ac0){if(!this['_registeredSessions']['has'](_0x4c1ac0))throw new _0x404cce('sessions-unregister-not-exist',null,{'channelId':_0x4c1ac0});const _0x398326=this['_registeredSessions']['get'](_0x4c1ac0);this['stopListening'](_0x398326);for(const _0x3664ba of _0x398326)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x4c1ac0,_0x3664ba);this['_registeredSessions']['delete'](_0x4c1ac0),this['channelSessions']['delete'](_0x4c1ac0),this['channelConnectedUsers']['delete'](_0x4c1ac0);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0xc18eba){for(const _0x4ef2c5 of this['channelSessions']['values']())for(const _0xa76ec3 of _0x4ef2c5)if(_0xa76ec3['id']===_0xc18eba)return _0xa76ec3['user'];}['getUserSessions'](_0x37a199,_0x308d05){const _0x3ea92a=_0x308d05?[this['channelSessions']['get'](_0x308d05)]:this['channelSessions']['values'](),_0x95529c=new Set();for(const _0x201a51 of _0x3ea92a)for(const _0x331172 of _0x201a51)_0x331172['user']['id']===_0x37a199['id']&&_0x95529c['add'](_0x331172['id']);return _0x95529c;}['getUserRole'](_0x50bc17){for(const _0x2b8622 of this['channelSessions']['values']())for(const _0x24f1c1 of _0x2b8622)if(_0x24f1c1['user']===_0x50bc17)return _0x24f1c1['role'];}['_handleSessionAdd'](_0x3c4c06,_0x3d6875){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x386a57=_0x3d6875['user'],_0x174339=this['_users']['getUser'](_0x386a57['id'])||this['_createUser'](_0x386a57),_0xe6c278=Object['assign']({},_0x3d6875,{'user':_0x174339});this['channelSessions']['get'](_0x3c4c06)['add'](_0xe6c278);const _0x1d4832=this['channelConnectedUsers']['get'](_0x3c4c06);_0x1d4832['has'](_0x174339['id'])||_0x1d4832['add'](_0x174339),this['allConnectedUsers']['has'](_0x174339['id'])||this['allConnectedUsers']['add'](_0x174339,_0x174339['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3c4c06,{'channelId':_0x3c4c06,'session':_0xe6c278});}['_handleSessionRemove'](_0x467d87,_0x5baf74){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x4a14b7=this['channelConnectedUsers']['get'](_0x467d87),_0x44f38a=_0x5baf74['user'];_0x44f38a['id']&&(this['channelSessions']['get'](_0x467d87)['remove'](_0x5baf74['id']),_0x4a14b7['has'](_0x44f38a['id'])&&!this['getUserSessions'](_0x44f38a,_0x467d87)['size']&&_0x4a14b7['remove'](_0x44f38a['id']),this['allConnectedUsers']['get'](_0x44f38a['id'])&&!this['getUserSessions'](_0x44f38a)['size']&&this['allConnectedUsers']['remove'](_0x44f38a['id']));}['_createUser'](_0x5b9465,_0x11f9cf){const _0x3a03b9=this['_users']['addUser'](_0x5b9465);return _0x11f9cf&&this['_users']['defineMe'](_0x5b9465['id']),_0x3a03b9['orderNumber']=this['_uniqueUsersCount']++,_0x3a03b9;}}class E extends _0x228e35{['_domEmitter']=new(_0x5c5569())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3c9c9a=this['editor'],_0x42aafe=_0x3c9c9a['plugins']['get'](i);_0x3c9c9a['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x28008f,{writer:_0xfd9d10})=>function(_0x5b02a0,_0xaeba70,_0x5a814c,_0x5aba6b){const _0x44084f=_0x5b02a0['markerName']['split'](':')[0x2],_0x1c3d56=_0x5a814c['getUserBySessionId'](_0x44084f);if(!_0x1c3d56||_0x44084f===_0x5a814c['mySessionId'])return;if(!_0x5aba6b['model']['schema']['checkChild'](_0x5b02a0['markerRange']['start'],'$text'))return;const _0x1937f6={'class':'ck-user__marker\x20'+_0x1c3d56['color']['getMarkerClass'](),'data-name':_0x1c3d56['name'],'data-session-id':_0x44084f},_0x5422c7=_0x5aba6b['model']['markers']['get'](_0x5b02a0['markerName']),_0x3ef22b=_0x5422c7['getStart'](),_0x29d007=_0x3ef22b['nodeAfter'],_0xaaeae3=_0x5aba6b['model']['schema'];if(_0x29d007&&_0xaaeae3['isObject'](_0x29d007)&&_0xaaeae3['isInline'](_0x29d007)&&!_0x5aba6b['model']['markers']['get']('user:range:'+_0x44084f)['getRange']()['isCollapsed'])return;const _0x3da3f6=_0x3ef22b['parent'];return _0x5aba6b['model']['schema']['isLimit'](_0x3da3f6)&&!_0x5aba6b['model']['hasContent'](_0x3da3f6)&&(_0x1937f6['contenteditable']=!0x1),function(_0x58bd79,_0x5527e8,_0x4da32d){const _0x16ef88=_0x58bd79['createUIElement']('span',_0x5527e8);return _0x58bd79['setCustomProperty']('userPositionMarker',!0x0,_0x16ef88),_0x16ef88['render']=function(_0xcc5256){const _0x302ab6=this['toDomElement'](_0xcc5256),_0x832415=document['createElement']('span');return _0x832415['classList']['add']('ck-user__marker-tooltip'),_0x832415['setAttribute']('contenteditable','false'),_0x832415['setAttribute']('spellcheck','false'),_0x832415['textContent']=_0x4da32d['name'],_0x302ab6['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x832415['outerHTML']+'',_0x302ab6['addEventListener']('mouseenter',()=>{_0x302ab6['classList']['add']('ck-user__marker_hovered');}),_0x302ab6['addEventListener']('mouseleave',()=>{_0x302ab6['classList']['remove']('ck-user__marker_hovered');}),_0x302ab6;},_0x16ef88['isSimilar']=function(_0x42519c){return!(!this['getCustomProperty']('userPositionMarker')||!_0x42519c['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x42519c['getAttribute']('data-session-id'));},_0x16ef88;}(_0xaeba70,_0x1937f6,_0x1c3d56);}(_0x28008f,_0xfd9d10,_0x42aafe,_0x3c9c9a)}),_0x3c9c9a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3ec0b2=>function(_0x5450eb,_0x28247b){const _0x2b66ad=_0x5450eb['markerName']['split'](':')[0x2];if(_0x2b66ad===_0x28247b['mySessionId'])return null;const _0x30b1b6=_0x28247b['getUserBySessionId'](_0x2b66ad);if(!_0x30b1b6)return{'id':_0x2b66ad,'classes':[]};return{'id':_0x2b66ad,'classes':['ck-user__selection',_0x30b1b6['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x2b66ad},'priority':0x7d0+_0x30b1b6['orderNumber']};}(_0x3ec0b2,_0x42aafe)}),function(_0x1c428d){const _0x171e12=_0x1c428d['model'],_0x1085e1=new Map(),_0x3daa99=_0x1c428d['plugins']['get'](i);_0x171e12['markers']['on']('update:user:range',(_0x263c6f,_0x537c2b,_0x2eabe8,_0x3314ae)=>{if(!_0x3314ae&&_0x1085e1['get'](_0x537c2b['name']))return _0x1085e1['get'](_0x537c2b['name'])['detach'](),void _0x1085e1['delete'](_0x537c2b['name']);const _0x13cf84=_0x537c2b['name']['split'](':')[0x2];if(_0x13cf84===_0x3daa99['mySessionId'])return;const _0x354055='user:position:'+_0x13cf84;_0x171e12['markers']['has'](_0x354055)&&_0x1c428d['editing']['reconvertMarker'](_0x354055),_0x537c2b['on']('change:range',(_0x38c2f1,_0x4443d4,_0x371c29)=>{if('$graveyard'!=_0x4443d4['root']['rootName']&&'$graveyard'==_0x537c2b['getRange']()['root']['rootName']&&!_0x1085e1['has'](_0x537c2b['name'])){const _0x1d2bbc=_0x171e12['schema']['getNearestSelectionRange'](_0x371c29['deletionPosition']);if(_0x1d2bbc){const _0x363ef9=ft['fromRange'](_0x1d2bbc);_0x1085e1['set'](_0x537c2b['name'],_0x363ef9),_0x363ef9['on']('change:range',(_0x403f96,_0x4be16f,_0x1cd40e)=>{if('$graveyard'==_0x363ef9['root']['rootName']){const _0x38fb4b=_0x171e12['schema']['getNearestSelectionRange'](_0x1cd40e['deletionPosition']);_0x38fb4b?(_0x363ef9['start']=_0x38fb4b['start'],_0x363ef9['end']=_0x38fb4b['end']):(_0x1085e1['delete'](_0x537c2b['name']),_0x363ef9['detach']());}});}}});}),_0x171e12['document']['on']('change',()=>{_0x1085e1['size']>0x0&&_0x171e12['enqueueChange']({'isUndoable':!0x1},_0x218edf=>{for(const [_0x547bfe,_0x5d7640]of _0x1085e1)'$graveyard'==_0x171e12['markers']['get'](_0x547bfe)['getRange']()['root']['rootName']&&(G(_0x547bfe['split'](':')[0x2],_0x5d7640['toRange'](),_0x171e12,_0x218edf),_0x5d7640['detach']());_0x1085e1['clear']();});});}(_0x3c9c9a),this['_domEmitter']['listenTo'](_0xf146c8['document'],'keydown',(_0x177978,{key:_0x96aaaa})=>{'Escape'===_0x96aaaa&&function(_0x2bf501){_0x2bf501['editing']['view']['change'](_0x2af6f0=>{for(const _0x262586 of _0x2bf501['model']['markers']){if(!_0x262586['name']['startsWith']('user:position'))continue;const _0x4faf9b=_0x2bf501['editing']['mapper']['markerNameToElements'](_0x262586['name']);if(_0x4faf9b){for(const _0x440875 of _0x4faf9b)_0x2af6f0['removeClass']('ck-user__marker_hovered',_0x440875);}}});}(_0x3c9c9a);},{'useCapture':!0x0});}['afterInit'](){const _0x226b4e=this['editor'],_0x32990=_0x226b4e['commands']['get']('undo');_0x32990&&_0x226b4e['model']['on']('applyOperation',(_0x2b8b10,_0x315185)=>{const _0x1db59b=_0x315185[0x0];if(!_0x1db59b['isDocumentOperation'])return;if('marker'!=_0x1db59b['type']||!_0x1db59b['name']['startsWith']('user:'))return;const _0x1dcbc2=_0x1db59b['batch'];_0x32990['_createdBatches']['has'](_0x1dcbc2)&&(_0x1db59b['newRange']=_0x1db59b['oldRange']?_0x226b4e['model']['createRange'](_0x1db59b['oldRange']['start'],_0x1db59b['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3b8ffc=this['editor'],_0xb301bc=_0x3b8ffc['model']['document'],_0xc3c307=_0x3b8ffc['plugins']['get'](i);_0x3b8ffc['model']['enqueueChange']({'isUndoable':!0x1},_0x5f1564=>{const _0x481d0f='user:range:'+_0xc3c307['mySessionId'],_0x5017f7='user:position:'+_0xc3c307['mySessionId'],_0x3ea13c=_0x3b8ffc['model']['markers']['has'](_0x481d0f);_0x3b8ffc['editing']['view']['hasDomSelection']?G(_0xc3c307['mySessionId'],_0xb301bc['selection']['getFirstRange'](),_0x3b8ffc['model'],_0x5f1564):_0x3ea13c&&(_0x5f1564['removeMarker'](_0x481d0f),_0x5f1564['removeMarker'](_0x5017f7));});}}function G(_0x182804,_0x49f3af,_0x12d17c,_0x127d3a){const _0x2167da='user:range:'+_0x182804,_0x3dbbff='user:position:'+_0x182804,_0x14094e=_0x49f3af['getContainedElement']();let _0x169963=_0x49f3af['start'];if(_0x14094e&&_0x14094e['is']('element','tableCell')){const _0x444949=function(_0x705b4,_0x1bb02e){for(const _0x1c2d39 of _0x705b4['getPositions']())if(_0x1bb02e['schema']['checkChild'](_0x1c2d39,'$text'))return _0x1c2d39;}(_0x49f3af,_0x12d17c);_0x444949&&(_0x169963=_0x444949,_0x49f3af=_0x127d3a['createRange'](_0x169963));}const _0x184425=_0x127d3a['createRange'](_0x169963);_0x12d17c['markers']['has'](_0x2167da)?(_0x127d3a['updateMarker'](_0x2167da,{'range':_0x49f3af}),_0x127d3a['updateMarker'](_0x3dbbff,{'range':_0x184425})):(_0x127d3a['addMarker'](_0x2167da,{'range':_0x49f3af,'usingOperation':!0x0}),_0x127d3a['addMarker'](_0x3dbbff,{'range':_0x184425,'usingOperation':!0x0}));}function N(_0x393228,_0xcd068,_0x34b81f){const _0x31a231=_0x393228['t'],t=_0x393228['t'];switch(_0xcd068){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 _0x31a231({'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'},_0x34b81f);default:return'';}}let M=0x1;class l extends _0x228e35{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x669c44)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,E,_0x54c310,_0x1d491e,_0x35081a];}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 _0x1a6f8f=this['serverHistory']['getOperations']();for(let _0xbffcea=_0x1a6f8f['length']-0x1;_0xbffcea>=0x0;_0xbffcea--){const _0x39992c=_0x1a6f8f[_0xbffcea];if(!this['_disconnectionOperations']['has'](_0x39992c))return _0x39992c['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x137992){if(super(_0x137992),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5839cf(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x404cce('collaboration-missing-channelid',this);const _0x4eaa09=_0x137992['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x4eaa09,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x68aa40(),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 V(this['_disconnectionOperations']);}['init'](){const _0x30ef9b=this['editor'],_0x4b2c55=_0x30ef9b['plugins']['get'](_0x1d491e),_0x414cf4=_0x30ef9b['plugins']['get'](c);this['listenTo'](_0x4b2c55,'getOperationAuthor',(_0xfbcb81,_0x21f783)=>{const _0x34eaee=_0x21f783[0x0];_0x34eaee['_authorId']&&(_0xfbcb81['return']=_0x4b2c55['getUser'](_0x34eaee['_authorId']),_0xfbcb81['stop']()),null===_0x34eaee['_authorId']&&(_0xfbcb81['return']=null,_0xfbcb81['stop']());},{'priority':'high'}),this['listenTo'](_0x30ef9b['model']['document']['selection'],'change:range',(_0x27cde1,_0x812d30)=>{_0x812d30['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x30ef9b['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x30ef9b['model']['on']('applyOperation',(_0x832dcb,_0x2d105c)=>{const _0x2c7e5d=_0x2d105c[0x0];_0x2c7e5d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2c7e5d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x414cf4,'state',this,'_hasSynchronizationProblem',(_0x25e3eb,_0xa3f17)=>'connected'===_0x25e3eb&&!_0xa3f17),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x30ef9b['disableReadOnlyMode']('rtc-offline'):_0x30ef9b['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x30ef9b['disableReadOnlyMode']('rtc-offline'):_0x30ef9b['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0xf0b91a=this['editor']['plugins']['get'](i),_0x3c1976=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0xf0b91a['unregister'](this['_channelId']);const _0x86468a=await this['_service']['reconnect'](_0x3c1976['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x86468a)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4580d5=await this['_service']['getConnectedSessions']();_0xf0b91a['register'](this['_channelId'],_0x4580d5),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4465ce){if(function(_0x2a9eb0){return'404'===_0x2a9eb0['code'];}(_0x4465ce)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5d177b){return'409'===_0x5d177b['code'];}(_0x4465ce)){const _0x361359=N(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'](_0x361359);}else{if(!(_0x4465ce instanceof z))throw _0x4465ce;this['_handleReconnectionError']();}}}}['destroy'](){const _0x182ce8=this['editor']['plugins']['get'](c),_0x370845=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x370845['channelSessions']['has'](this['_channelId'])&&_0x370845['unregister'](this['_channelId']),_0x182ce8['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4b1d55){if(this['sessionId']!==_0x4b1d55['sessionId']&&this['_lastSyncedOperationId']!==_0x4b1d55['lastOperationId'])throw new z();return this['sessionId']=_0x4b1d55['sessionId'],this['_handleServerResponse']([],{..._0x4b1d55,'wereChangesApplied':!0x1,'data':_0x4b1d55['data']},'reconnect');}async['_connectService'](_0x3b7e5f,_0x19ccbb=!0x1){const {connection:_0x2343f7}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x2343f7,this['_channelId'])['then'](_0x41caa5=>this['_initSessionsHandling'](_0x41caa5))['catch'](_0x33952f=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x33952f);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xdaaaba,_0x4b27d4)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x4b27d4);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x8dea57=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3b7e5f);this['_isPendingUpdate']=!0x0;const _0x16bd2e=await this['_service']['connect'](_0x2343f7,this['_compressOperations'](_0x3b7e5f),_0x8dea57);if(this['sessionId']=_0x16bd2e['sessionId'],_0x19ccbb){if(!_0x16bd2e['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x16bd2e['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3b7e5f,_0x16bd2e,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x16bd2e,_0x3b7e5f);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x746004=this['editor']['plugins']['get'](i),_0x239a18=this['editor']['plugins']['get'](E),_0x5d0de6=_0x746004['channelSessions']['get'](this['_channelId']);_0x5d0de6&&_0x5d0de6['length']>0x1?_0x239a18['createUserMarkerOperations']():this['listenTo'](_0x746004,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x746004['channelSessions']['get'](this['_channelId'])['length']&&_0x239a18['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2c61ac,_0x1d202c,_0x24ab99,_0x58dffd){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1d202c){const _0x4fa1de=this['_decompressOperations'](_0x24ab99,_0x58dffd);await this['_fetchMissingUsers'](_0x4fa1de),this['_handleExternalOperations'](_0x4fa1de,_0x1d202c,_0x24ab99['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1ad5ac}=this['editor'];let _0x28efab;try{_0x28efab=await this['_service']['getDocumentDetails']();}catch{const _0x4daeee=N(_0x1ad5ac,'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'](_0x4daeee);}const _0x13e1fc=_0x28efab['currentDocumentSession']||_0x28efab['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x13e1fc['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x55de3f=N(_0x1ad5ac,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x55de3f);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xd27a34){const _0x687603=this['editor']['plugins']['get'](i);this['listenTo'](_0x687603,'sessionAdd:'+this['_channelId'],(_0x363b9a,{session:_0x5c66ba})=>{if(_0x5c66ba['id']===_0x687603['mySessionId']){_0x363b9a['off']();const _0x21a5b1=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3a0447=_0x5c66ba['permissions'];_0x21a5b1&&_0x21a5b1['isEnabled']&&(_0x3a0447=_0x3a0447['filter'](_0x54a454=>'document:write'!==_0x54a454)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3a0447,this['_channelId']);}}),_0x687603['register'](this['_channelId'],_0xd27a34);}['_initThrowingOnDataSet'](){const _0x5193de=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x24f4d6)=>{if(!_0x24f4d6[_0x24f4d6['length']-0x1]['suppressErrorInCollaboration'])throw new _0x404cce('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5193de['apply'](this['editor']['data'],_0x24f4d6);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4d701a,[_0x27989c])=>{if(this['_document']['version'])throw new _0x404cce('realtimecollaborationclient-init-document-already-initialized',this);_0x4d701a['stop'](),this['_setPendingAction']();const _0x850f8d=this['editor']['config']['get']('rootsAttributes'),_0x78ac2e=this['_getOperationsFromInitData'](_0x27989c,_0x850f8d);0x0==_0x78ac2e['length']&&_0x78ac2e['push'](new _0x21e77f(0x0)),_0x4d701a['return']=this['_connectService'](_0x78ac2e)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1cbbf2=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1cbbf2))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x5d73a1,[_0x3b7822,_0x27dfd7])=>{_0x5d73a1['stop']();const _0x22af91=this['editor']['model']['document']['getRoot'](_0x3b7822);if(!this['_knownRootNames']['has'](_0x3b7822)){const _0xaae2f7=_0x27dfd7&&_0x27dfd7['data']?_0x27dfd7['data']:'',_0x4af59d=_0x27dfd7&&_0x27dfd7['attributes']?_0x27dfd7['attributes']:{};await this['_loadRoot'](_0x3b7822,_0xaae2f7,_0x4af59d);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x22af91['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x22af91);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x13be73){const _0x15d705=this['editor']['plugins']['get'](_0x1d491e),{connection:_0x357f93}=this['editor']['plugins']['get'](c),_0x3ef8a8=new Set();for(const _0x2c1a6f of _0x13be73){const _0x35b900=_0x2c1a6f['_authorId'];_0x35b900&&!_0x15d705['getUser'](_0x35b900)&&_0x3ef8a8['add'](_0x35b900);}if(0x0===_0x3ef8a8['size'])return;const _0x2f5e1f=await gt['getMany'](_0x357f93,Array['from'](_0x3ef8a8));for(const _0x3bfe87 of _0x2f5e1f)_0x15d705['getUser'](_0x3bfe87['id'])||_0x15d705['addUser'](_0x3bfe87);}['_getOperationsFromInitData'](_0x589cc0,_0x451c4c={}){const _0x176d2f=this['editor']['model'],_0x213fe4=[];let _0x408aa0=0x0;const _0x1ec11a='string'==typeof _0x589cc0?{'main':_0x589cc0}:_0x589cc0;for(const _0x55847b of Object['keys'](_0x1ec11a)){if(!this['_document']['roots']['has'](_0x55847b))throw new _0x404cce('realtimecollaborationclient-init-non-existent-root',this);const _0x5ea641=this['editor']['data']['parse'](_0x1ec11a[_0x55847b]),_0x110352=this['_document']['getRoot'](_0x55847b),_0x310165=new _0xfd37f2(_0x176d2f['createPositionAt'](_0x110352,0x0),_0x5ea641,_0x408aa0++);_0x213fe4['push'](_0x310165);for(const [_0x497aad,_0x1bc6c8]of _0x5ea641['markers']){const _0x4cc947=_0x176d2f['createRange'](_0x176d2f['createPositionFromPath'](_0x110352,_0x1bc6c8['start']['path']['slice']()),_0x176d2f['createPositionFromPath'](_0x110352,_0x1bc6c8['end']['path']['slice']())),_0x42cd3b=new _0x3cdadb(_0x497aad,null,_0x4cc947,_0x176d2f['markers'],!0x0,_0x408aa0++);_0x213fe4['push'](_0x42cd3b);}}if(_0x451c4c)for(const [_0x5176bc,_0x4a9716]of Object['entries'](_0x451c4c)){const _0x36c15f=_0x176d2f['document']['getRoot'](_0x5176bc);if(!_0x36c15f)throw new _0x404cce('multi-root-editor-root-attributes-no-root',null);for(const [_0x4f595c,_0xf11916]of Object['entries'](_0x4a9716))if(null!==_0xf11916){const _0x3fc1b7=new _0x431b67(_0x36c15f,_0x4f595c,null,_0xf11916,_0x408aa0++);_0x213fe4['push'](_0x3fc1b7);}}return _0x213fe4;}async['_loadRoot'](_0x281581,_0x1a52ed,_0x52213c){this['_getOperationsFromInitData']({[_0x281581]:_0x1a52ed},{[_0x281581]:_0x52213c})['forEach']((_0x33118b,_0x3de3ae)=>{_0x33118b['baseVersion']=this['_document']['version']+_0x3de3ae,_0x33118b['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x33118b);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x295869,_0x1fb3c9){let _0x2d74c2;this['_offset']=_0x295869['offset'];const _0xbda57b=_0x295869['wereChangesApplied']&&!_0x295869['initData'],_0x16d3a9=_0xbda57b?0x0:_0x295869['data']['baseVersion'];if(_0x1fb3c9['forEach'](_0x2e0ab8=>{_0x2e0ab8['_isInit']=!0x0,_0x2e0ab8['createdAt']=_0x295869['sessionCreatedAt'],_0x2e0ab8['_authorId']=null;}),_0xbda57b)_0x2d74c2=_0x1fb3c9,this['_applyOperationsSet'](_0x2d74c2,_0xbda57b);else{if(_0x295869['initData']){const _0x37949b=this['_getOperationsFromInitData'](_0x295869['initData']);this['_document']['history']['version']=-_0x37949b['length'],_0x37949b['forEach'](_0x1f6fc6=>{_0x1f6fc6['baseVersion']-=_0x37949b['length'],_0x1f6fc6['createdAt']=_0x295869['sessionCreatedAt'],_0x1f6fc6['_isInit']=!0x0,_0x1f6fc6['_authorId']=null;}),this['_applyOperationsSet'](_0x37949b,!0x0),this['serverHistory']['version']=-_0x37949b['length']+this['_offset'],this['_updateServerHistory'](_0x37949b);}this['_document']['history']['version']=_0x16d3a9,_0x2d74c2=this['_decompressOperations'](_0x295869['data'],_0x295869['metadata']),await this['_fetchMissingUsers'](_0x2d74c2),this['_applyOperationsSet'](_0x2d74c2,_0xbda57b);}_0x295869['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2d74c2,_0x295869['lastOperationId']),this['_lastSyncedOperationId']=_0x295869['lastOperationId']),this['serverHistory']['version']=_0x16d3a9+this['_offset'],this['_updateServerHistory'](_0x2d74c2),_0x1fb3c9['filter'](_0x291dee=>{const _0x209ec1=this['_getAffectedRoot'](_0x291dee);return _0x209ec1&&!this['_knownRootNames']['has'](_0x209ec1);})['forEach']((_0x1481d1,_0x192891)=>{_0x1481d1['baseVersion']=this['_document']['version']+_0x192891,this['_saveOperationInBuffer'](_0x1481d1);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2a35b9,_0x3641ae){const _0x32e5ee=_0x3641ae&&_0x3641ae['message'];if(_0x32e5ee&&_0x32e5ee['startsWith']('realtimecollaborationclient'))throw _0x3641ae;const _0x4a9ed4=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x4a9ed4['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x404cce(_0x2a35b9,this['editor'],_0x32e5ee?{'originalError':_0x32e5ee}:void 0x0);}['_saveOperationInBuffer'](_0x4d64f2){this['_knownOperations']['has'](_0x4d64f2)||(this['_knownOperations']['add'](_0x4d64f2),this['_bufferedOperations']['push'](_0x4d64f2),this['_pendingAction']||'marker'==_0x4d64f2['type']&&!_0x4d64f2['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x4f25ce=!0x1){!_0x4f25ce&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4c9cbf=>{_0x4c9cbf&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0xcbe330=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xe1eece){return _0xe1eece['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xe1eece['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xe1eece['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0xcbe330)||this['_crash'](_0xcbe330['message'],_0xcbe330);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0xcd1636=>{this['on']('change:_isPendingUpdate',()=>{_0xcd1636();});});}async['_sendBufferedOperations'](){const _0x423375=this['editor']['plugins']['get'](E);if(this['_shouldSendSelectionUpdate']()&&(_0x423375['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xf947b8=[...this['_bufferedOperations']];for(const _0x10d208 of _0xf947b8)_0x10d208['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x10d208);const _0x4af9e3=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xf947b8),_0x4c3b3b=M++,_0x5b67ac=this['_compressOperations'](_0xf947b8),_0x4197e1=await this['_service']['sendOperations'](_0x5b67ac,_0x5b67ac['baseVersion'],_0x4af9e3);try{return await this['_handleServerResponse'](_0xf947b8,_0x4197e1,_0x4c3b3b);}catch(_0x3e6ecb){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3e6ecb);}}async['_handleServerResponse'](_0x15cc5f,_0x4f519a,_0x4906f4){if('error'in _0x4f519a)throw _0x4f519a['error'];let _0x4753ba=!0x1;if(_0x4f519a['wereChangesApplied']){_0x4f519a['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4f519a['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x14a338=>!_0x15cc5f['includes'](_0x14a338));for(const _0x560296 of _0x15cc5f)_0x560296['createdAt']='lastOperationAcceptedAt'in _0x4f519a&&_0x4f519a['lastOperationAcceptedAt']||void 0x0;H(_0x15cc5f,_0x4f519a['version']-_0x15cc5f['length']),this['_updateServerHistory'](_0x15cc5f);const _0x27ce87=_0x15cc5f['filter'](_0x4dbba2=>{if(!_0x4dbba2['_isInit'])return!0x1;const _0x52bca2=this['_getAffectedRoot'](_0x4dbba2);return _0x52bca2&&!this['_knownRootNames']['has'](_0x52bca2);});H(_0x27ce87,this['_document']['version']),this['_applyOperationsSet'](_0x27ce87),_0x4753ba=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xa64f5c=this['_decompressOperations'](_0x4f519a['data'],_0x4f519a['metadata'])['filter'](_0x37417e=>_0x37417e['baseVersion']>=this['_lastServerVersion']);_0xa64f5c['forEach'](_0x4c8f5d=>this['_addKnownRoot'](_0x4c8f5d)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4b4416=>!_0x4b4416['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4b4416))),this['_bufferedOperations']['length']&&H(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xa64f5c),_0x4753ba=this['_handleExternalOperations'](_0xa64f5c,_0x4f519a['version'],_0x4f519a['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4753ba?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x30c082,_0x46d3d3,_0x74e928){try{const _0x5604c9={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x16e38e,operationsB:_0x412cf4,originalOperations:_0x425924}=_0x8c424a(_0x30c082,this['_bufferedOperations'],_0x5604c9);H(_0x16e38e,this['_document']['version']),H(_0x412cf4,_0x46d3d3);for(const _0x59a301 of _0x16e38e){const _0x4f2fb0=_0x425924['get'](_0x59a301);_0x59a301['_authorId']=_0x4f2fb0?_0x4f2fb0['_authorId']:null;}_0x74e928&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x30c082,_0x74e928),this['_lastSyncedOperationId']=_0x74e928),this['_bufferedOperations']=[..._0x412cf4],this['_applyOperationsSet'](_0x16e38e),this['_updateServerHistory'](_0x30c082);}catch(_0x222613){return console['error'](_0x222613),!0x1;}return!0x0;}['_applyOperationsSet'](_0xda0ef8,_0x14557a=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4f4c2e=>{for(const _0x10b849 of _0xda0ef8)this['_knownOperations']['add'](_0x10b849),this['_addKnownRoot'](_0x10b849),_0x4f4c2e['batch']['addOperation'](_0x10b849),this['editor']['model']['applyOperation'](_0x10b849);});}['_addKnownRoot'](_0x3ea3be){const _0x2239ee=this['_getAffectedRoot'](_0x3ea3be);_0x2239ee&&this['_knownRootNames']['add'](_0x2239ee);}['_getAffectedRoot'](_0x28b9b7){let _0x1e3259,_0x33ad2f;switch(_0x28b9b7['type']){case'insert':_0x1e3259=_0x28b9b7['position']['root'];break;case'marker':if(_0x33ad2f=_0x28b9b7['newRange'],!_0x33ad2f)return null;_0x1e3259=_0x33ad2f['root'];break;case'addRootAttribute':_0x1e3259=_0x28b9b7['root'];break;case'addRoot':_0x1e3259=_0x28b9b7['affectedSelectable'];break;case'move':_0x1e3259=_0x28b9b7['targetPosition']['root'];break;default:return null;}return _0x1e3259['rootName'];}['_updateServerHistory'](_0x2f6ff4){_0x2f6ff4['forEach'](_0x53bbee=>{const _0xc78be=_0x53bbee['clone']();_0xc78be['_authorId']=_0x53bbee['_authorId'],_0xc78be['_isInit']=!!_0x53bbee['_isInit'],_0xc78be['createdAt']=_0x53bbee['createdAt'],_0xc78be['baseVersion']+=this['_offset'],_0x53bbee['_isDisconnection']&&this['_disconnectionOperations']['add'](_0xc78be),this['serverHistory']['addOperation'](_0xc78be);});}['_handleReconnectionError'](_0x4896dc){const _0xd8587a=this['editor']['plugins']['get']('Notification'),_0x167695=this['editor']['locale'];_0x4896dc||(_0x4896dc=N(_0x167695,'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.')),_0xd8587a['showWarning'](_0x4896dc,{'title':N(_0x167695,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x54c310)['add'](N(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x54c310)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2a9671){const _0x2a37d1=_0x2a9671['map'](_0x5326bb=>_0x5326bb['toJSON']());return this['_compressor']['compress'](_0x2a37d1);}['_decompressOperations'](_0x327075,_0x43db32){return this['_compressor']['decompress'](_0x327075)['map']((_0x690ca3,_0x56e2ee)=>{const _0x4c6cec='init'==_0x43db32[_0x56e2ee]['type'];if('InsertOperation'==_0x690ca3['__className']){const _0x30b736=_0x690ca3['position']['root'];!this['_document']['getRoot'](_0x30b736)&&(this['_document']['createRoot']('$root',_0x30b736)['_isAttached']=!0x1);}const _0x4d99bc=_0x5bc9bc['fromJSON'](_0x690ca3,this['_document']);return _0x4d99bc['wasUndone']=_0x690ca3['wasUndone'],_0x4d99bc['_isInit']=_0x4c6cec,_0x4d99bc['_authorId']=_0x4c6cec?null:_0x43db32[_0x56e2ee]['userId'],_0x4d99bc['_isDisconnection']='cs:removeUser'===_0x43db32[_0x56e2ee]['type'],_0x4d99bc['createdAt']=_0x43db32[_0x56e2ee]['createdAt'],_0x4d99bc;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x2c8452=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x2c8452&&_0x2c8452['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class z extends Error{}function H(_0x40d836,_0xdfc0db){for(const _0x58a1fb of _0x40d836)_0x58a1fb['baseVersion']=_0xdfc0db++;}class V{['_ignoredOperations'];['_operationToId'];constructor(_0xab132){this['_ignoredOperations']=_0xab132,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x170363){let _0x4b16be=_0x170363['length'];for(;_0x4b16be--;){const _0x1a7894=_0x170363[_0x4b16be];if(!this['_ignoredOperations']['has'](_0x1a7894)){if(!this['_operationToId']['has'](_0x1a7894)){const _0x1b8783=_0x482ed0()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1a7894,_0x1b8783);}return this['_operationToId']['get'](_0x1a7894);}}}['setIdForTheLastOperation'](_0x1e53f7,_0x3b8cc3){if(!_0x3b8cc3)return;let _0x46da6a=_0x1e53f7['length'];for(;_0x46da6a--;){const _0x4b6624=_0x1e53f7[_0x46da6a];this['_ignoredOperations']['has'](_0x4b6624)||this['_operationToId']['set'](_0x4b6624,_0x3b8cc3);}}}class n extends _0x228e35{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x1390d5{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x3a643b)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x1d491e];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x28e717){super(_0x28e717),this['_services']=new Map();}async['init'](){const _0x4bba28=this['context'],_0x34e12e=_0x4bba28['plugins']['get']('CommentsRepository');if(_0x4bba28['plugins']['get'](c)['addToReconnectionStack'](this),_0x34e12e['adapter']={'addCommentThread':async({channelId:_0x564264,threadId:_0x3dea55,comments:_0x56a4d6,resolvedAt:_0x24ee57,resolvedBy:_0x2ddafe,context:_0x2a3994,attributes:_0x3ab4fe})=>{const _0xe014ab=await this['_getService'](_0x564264)['addCommentThread']({'commentThreadId':_0x3dea55,'comments':_0x56a4d6['map'](_0x2f83bb=>function(_0x28b434,_0x3d4cca,_0x18674a){return{'commentThreadId':_0x18674a,'commentId':_0x28b434['commentId'],'userId':_0x28b434['authorId'],'content':_0x28b434['content'],'documentId':_0x3d4cca,'createdAt':_0x28b434['createdAt'],'attributes':_0x28b434['attributes']||{}};}(_0x2f83bb,_0x564264,_0x3dea55)),'resolvedAt':_0x24ee57,'resolvedBy':_0x2ddafe,'context':_0x2a3994,'attributes':_0x3ab4fe})['catch'](wt);return{'threadId':_0xe014ab['commentThreadId'],'comments':_0xe014ab['comments']};},'getCommentThread':async({channelId:_0x39276e,threadId:_0x5968f6})=>{const _0x28f30a=await this['_getService'](_0x39276e)['getCommentThread'](_0x5968f6)['catch'](wt);return _0x28f30a['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x28f30a]),{'threadId':_0x28f30a['commentThreadId'],'comments':_0x28f30a['comments']['map'](b),'context':_0x28f30a['context'],'resolvedAt':_0x28f30a['resolvedAt'],'resolvedBy':_0x28f30a['resolvedBy'],'attributes':_0x28f30a['attributes']||{}});},'updateCommentThread':async({channelId:_0x1e9030,threadId:_0x5ab45d,context:_0x118ed8,unlinkedAt:_0x9dfefa,attributes:_0x259436})=>this['_getService'](_0x1e9030)['updateCommentThread']({'commentThreadId':_0x5ab45d,'context':_0x118ed8,'attributes':_0x259436,'unlinkedAt':_0x9dfefa})['catch'](y)['catch'](wt),'resolveCommentThread':async({channelId:_0x3f244e,threadId:_0x2a8fa3})=>{const _0x30b428=await this['_getService'](_0x3f244e)['resolveCommentThread'](_0x2a8fa3)['catch'](y)['catch'](wt);return{'threadId':_0x30b428['commentThreadId'],'resolvedAt':_0x30b428['resolvedAt'],'resolvedBy':_0x30b428['resolvedBy']};},'reopenCommentThread':async({channelId:_0x297adb,threadId:_0x44574b})=>this['_getService'](_0x297adb)['reopenCommentThread'](_0x44574b)['catch'](y)['catch'](wt),'removeCommentThread':({channelId:_0xe9b566,threadId:_0x1c934c})=>this['_getService'](_0xe9b566)['removeCommentThread'](_0x1c934c)['catch'](y)['catch'](wt),'addComment':({channelId:_0x522f50,threadId:_0x158b18,commentId:_0x3a7942,content:_0x348a24,attributes:_0x5c8dd1})=>this['_getService'](_0x522f50)['addComment'](_0x158b18,_0x3a7942,_0x348a24,_0x5c8dd1)['catch'](wt),'updateComment':({channelId:_0x10f626,threadId:_0x36f36f,commentId:_0x1d101f,content:_0x400a90,attributes:_0x441e35})=>this['_getService'](_0x10f626)['updateComment'](_0x36f36f,_0x1d101f,_0x400a90,_0x441e35)['catch'](y)['catch'](wt),'removeComment':({channelId:_0x13d644,threadId:_0x357387,commentId:_0x2563c8})=>this['_getService'](_0x13d644)['removeComment'](_0x357387,_0x2563c8)['catch'](y)['catch'](wt)},_0x4bba28 instanceof _0x3485da){const _0x25dc46=_0x4bba28['config']['get']('collaboration.channelId'),_0xcee7fd=_0x4bba28['plugins']['get'](i);await this['_setUpService'](_0x25dc46);const _0x32eba5=await this['_services']['get'](_0x25dc46)['getConnectedSessions']();this['listenTo'](_0xcee7fd,'sessionAdd:'+_0x25dc46,(_0x41643d,{session:_0x586439})=>{_0x586439['id']===_0xcee7fd['mySessionId']&&(_0x41643d['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x586439['permissions'],_0x25dc46));}),_0xcee7fd['register'](_0x25dc46,_0x32eba5);}}async['_setUpService'](_0x38616c){if(this['_services']['has'](_0x38616c))throw new _0x404cce('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x38616c});const _0x545486=this['context']['plugins']['get']('CommentsRepository'),_0x53354b=new a['CommentsService'](_0x38616c);this['_services']['set'](_0x38616c,_0x53354b),this['listenTo'](_0x53354b,'commentThreadAdded',(_0x3aadfd,_0x3d40fa)=>{const {commentThreadId:_0x217c0e,documentId:_0x22a2bf,context:_0x5dda8f,attributes:_0x172b4d,resolvedAt:_0x5b7b51,resolvedBy:_0x155839,comments:_0x441bc1}=_0x3d40fa;_0x545486['getCommentThread'](_0x217c0e)||_0x545486['addCommentThread']({'threadId':_0x217c0e,'channelId':_0x22a2bf,'comments':_0x441bc1?_0x441bc1['map'](b):[],'context':_0x5dda8f,'attributes':_0x172b4d,'resolvedAt':_0x5b7b51,'resolvedBy':_0x155839,'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadUpdated',(_0x13090e,{commentThreadId:_0x3bc856,documentId:_0x175c41,context:_0x45e274,unlinkedAt:_0x53590b,attributes:_0x14f7e3})=>{_0x545486['getCommentThread'](_0x3bc856)&&_0x545486['updateCommentThread']({'threadId':_0x3bc856,'channelId':_0x175c41,'context':_0x45e274,'unlinkedAt':_0x53590b,'attributes':_0x14f7e3,'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadResolved',(_0x958179,{commentThreadId:_0x594bb9,resolvedBy:_0x95036,resolvedAt:_0x1edf88})=>{const _0x27c656=_0x545486['getCommentThread'](_0x594bb9);_0x27c656&&_0x27c656['resolve']({'resolvedBy':_0x95036,'resolvedAt':_0x1edf88,'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadReopened',(_0x19168f,{commentThreadId:_0x32d0eb})=>{const _0x5b5ed4=_0x545486['getCommentThread'](_0x32d0eb);_0x5b5ed4&&_0x5b5ed4['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentThreadRemoved',(_0xef1b53,{commentThreadId:_0x5eca3b})=>{const _0x23d941=_0x545486['getCommentThread'](_0x5eca3b);_0x23d941&&_0x23d941['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentAdded',(_0xdc381f,_0x5c40cf)=>{const _0x20a0ae=_0x5c40cf['commentThreadId'],_0x1bce81=_0x545486['getCommentThread'](_0x20a0ae);_0x1bce81&&_0x1bce81['addComment']({...b(_0x5c40cf),'isFromAdapter':!0x0});}),this['listenTo'](_0x53354b,'commentUpdated',(_0x4eebdc,{commentThreadId:_0x322eed,commentId:_0x35ea12,content:_0x352d25,attributes:_0x13e8fd})=>{const _0x4439a0=_0x545486['getCommentThread'](_0x322eed);if(_0x4439a0){const _0x474999=_0x4439a0['getComment'](_0x35ea12);_0x474999&&_0x474999['update']({'content':_0x352d25,'attributes':_0x13e8fd,'isFromAdapter':!0x0});}}),this['listenTo'](_0x53354b,'commentRemoved',(_0x298977,{commentThreadId:_0x2d63e6,commentId:_0x1f1eb0})=>{const _0x1086bd=_0x545486['getCommentThread'](_0x2d63e6);if(_0x1086bd){const _0x1a0e46=_0x1086bd['getComment'](_0x1f1eb0);_0x1a0e46&&_0x1a0e46['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x38616c);}['destroy'](){if(this['context']instanceof _0x3485da){const _0x4c6644=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x4c6644);}}['_terminateService'](_0x1a9cf7){if(!this['_services']['has'](_0x1a9cf7))throw new _0x404cce('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x1a9cf7});this['_getService'](_0x1a9cf7)['disconnect'](),this['_services']['delete'](_0x1a9cf7);}async['reconnect'](){for(const _0x1f8e7e of this['_services']['keys']())await this['_connectService'](_0x1f8e7e);if(this['context']instanceof _0x3485da){const _0xe11307=this['context']['config']['get']('collaboration.channelId'),_0x49b29c=this['context']['plugins']['get'](i);_0x49b29c['unregister'](_0xe11307);const _0x580f3d=await this['_services']['get'](_0xe11307)['getConnectedSessions']();_0x49b29c['register'](_0xe11307,_0x580f3d);}}async['_connectService'](_0x31c73a){const {connection:_0xdc7618}=this['context']['plugins']['get'](c),_0x5efccd=this['context']['plugins']['get']('CommentsRepository'),_0xf4e349=this['_services']['get'](_0x31c73a),_0x5c164f=await _0xf4e349['connect'](_0xdc7618);await this['_fetchMissingUsersForThreads'](_0x5c164f);const _0x10a374=new Set(Array['from'](_0x5efccd['getCommentThreads']({'channelId':_0x31c73a}),_0x5bf40c=>_0x5bf40c['id']));for(const _0x232731 of _0x5c164f)_0x232731['deletedAt']||_0x10a374['delete'](_0x232731['commentThreadId']);for(const _0x2f0f44 of _0x10a374)_0x5efccd['getCommentThread'](_0x2f0f44)['remove']({'isFromAdapter':!0x0});for(const _0x4c61cd of _0x5c164f){let _0x28fef4=_0x5efccd['getCommentThread'](_0x4c61cd['commentThreadId']);const {commentThreadId:_0x35500d,context:_0x72f117,attributes:_0x10f906,resolvedBy:_0x57cbf6,resolvedAt:_0x227499,unlinkedAt:_0x332078,deletedAt:_0x1dd603}=_0x4c61cd;if(_0x1dd603)continue;_0x28fef4||(_0x28fef4=_0x5efccd['addCommentThread']({'channelId':_0x31c73a,'threadId':_0x35500d,'context':_0x72f117,'attributes':_0x10f906||{},'resolvedBy':_0x57cbf6,'resolvedAt':_0x227499,'unlinkedAt':_0x332078,'isFromAdapter':!0x0}));const _0xaedc6f=new Set(Array['from'](_0x28fef4['comments'],_0x45d113=>_0x45d113['id']));for(const _0x5d3eae of _0x4c61cd['comments'])_0xaedc6f['delete'](_0x5d3eae['commentId']);for(const _0x4f00b0 of _0xaedc6f)_0x28fef4['getComment'](_0x4f00b0)['remove']({'isFromAdapter':!0x0});for(const _0x931529 of _0x4c61cd['comments']){const _0x23f2cc=_0x28fef4['getComment'](_0x931529['commentId']);_0x23f2cc?_0x23f2cc['content']!==_0x931529['content']&&_0x23f2cc['update']({'content':_0x931529['content'],'isFromAdapter':!0x0}):_0x28fef4['addComment'](Object['assign'](b(_0x931529),{'isFromAdapter':!0x0}));}}}['_getService'](_0x566258){if(!this['_services']['has'](_0x566258))throw new _0x404cce('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x566258});return this['_services']['get'](_0x566258);}async['_fetchMissingUsersForThreads'](_0x393b6c){const _0x81f9eb=this['context']['plugins']['get'](_0x1d491e),{connection:_0x58bfeb}=this['context']['plugins']['get'](c),_0x5af9aa=new Set();for(const {resolvedBy:_0x5e2fc2,comments:_0x55430e}of _0x393b6c){_0x5e2fc2&&!_0x81f9eb['getUser'](_0x5e2fc2)&&_0x5af9aa['add'](_0x5e2fc2);for(const {userId:_0x3ce35d}of _0x55430e)_0x81f9eb['getUser'](_0x3ce35d)||_0x5af9aa['add'](_0x3ce35d);}if(0x0===_0x5af9aa['size'])return;const _0x3f839c=await gt['getMany'](_0x58bfeb,Array['from'](_0x5af9aa));for(const _0x4e036b of _0x3f839c)_0x81f9eb['getUser'](_0x4e036b['id'])||_0x81f9eb['addUser'](_0x4e036b);}}async function y(_0x3d0b23){if('404'!==_0x3d0b23['code'])throw _0x3d0b23;}function wt(_0x46a169){if((_0x2283fb=_0x46a169)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2283fb['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2283fb['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2283fb;throw _0x46a169;}function b(_0x7d2c3d){return{'threadId':_0x7d2c3d['commentThreadId'],'commentId':_0x7d2c3d['commentId'],'content':_0x7d2c3d['content'],'createdAt':_0x7d2c3d['createdAt'],'authorId':_0x7d2c3d['userId'],'attributes':_0x7d2c3d['attributes']||{}};}class f extends _0x228e35{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>at)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5105d3){super(_0x5105d3);const _0x3de0af=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x3de0af);}['init'](){const _0x2028b1=this['editor']['plugins']['get'](c),_0x48cafe=this['editor']['plugins']['get']('TrackChangesEditing');return _0x48cafe['adapter']={'getSuggestion':async _0x799427=>{await this['_waitForServiceReady']();const _0x1c1178=await this['_trackChangesService']['get'](_0x799427)['catch'](w);return await this['_fetchMissingUsersForThreads']([_0x1c1178]),_0x1c1178;},'addSuggestion':async({id:_0x13d460,type:_0x185512,data:_0x2c03c2,originalSuggestionId:_0x42925c,attributes:_0x54fa72})=>{await this['_waitForServiceReady']();const _0x2f7d5f={'id':_0x13d460,'type':_0x185512,'data':_0x2c03c2,'originalSuggestionId':_0x42925c,'attributes':_0x54fa72},_0x511ef4=await this['_trackChangesService']['add'](_0x13d460,_0x185512,_0x2c03c2,_0x42925c,_0x54fa72)['catch'](_0x180d97=>{if(vt(_0x180d97))return new Promise(_0x3a1631=>{this['_bufferedRequests']['set'](_0x13d460,{'resolve':_0x3a1631,'suggestionData':_0x2f7d5f});});throw _0x180d97;});return this['_bufferedRequests']['delete'](_0x13d460),_0x511ef4;},'updateSuggestion':async(_0x527e7f,_0x410253)=>{if(await this['_waitForServiceReady'](),'open'!==_0x410253['state'])return this['_trackChangesService']['update'](_0x527e7f,_0x410253)['catch'](w);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x65274c,_0x466f0b)=>{_0x48cafe['hasSuggestion'](_0x466f0b['id'])&&(_0x48cafe['getSuggestion'](_0x466f0b['id'])['attributes']=_0x466f0b['attributes']);}),this['_trackChangesService']['connect'](_0x2028b1['connection'])['then'](_0x2d9202=>(_0x2028b1['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2d9202)['then'](()=>{for(const _0x31799c of _0x2d9202){_0x48cafe['addSuggestionData'](_0x31799c)['_saved']=!0x0;}})));}async['reconnect'](){const _0xa59734=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1fc6b0}=this['editor']['plugins']['get'](c),_0x130837=await this['_trackChangesService']['connect'](_0x1fc6b0);await this['_fetchMissingUsersForThreads'](_0x130837);for(const {suggestionData:_0x4f763c,resolve:_0x164315}of this['_bufferedRequests']['values']()){let _0x51202a=_0x130837['find'](_0x11aeeb=>_0x11aeeb['id']===_0x4f763c['id']);_0x51202a||(_0x51202a=await this['_trackChangesService']['add'](_0x4f763c['id'],_0x4f763c['type'],_0x4f763c['data'],_0x4f763c['originalSuggestionId'])),_0x164315(_0x51202a);}for(const _0x874ada of _0x130837)_0xa59734['hasSuggestion'](_0x874ada['id'])||_0xa59734['addSuggestionData'](_0x874ada);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1dfbcb=>{this['listenTo'](this['_trackChangesService'],'connected',_0x35a8e9=>{_0x35a8e9['off'](),_0x1dfbcb();});});}async['_fetchMissingUsersForThreads'](_0x3ec9ed){const _0xfb1801=this['editor']['plugins']['get'](_0x1d491e),{connection:_0x2bb59b}=this['editor']['plugins']['get'](c),_0x49f663=new Set();for(const {authorId:_0x239b8a}of _0x3ec9ed)_0xfb1801['getUser'](_0x239b8a)||_0x49f663['add'](_0x239b8a);if(0x0===_0x49f663['size'])return;const _0x25aeb8=await gt['getMany'](_0x2bb59b,Array['from'](_0x49f663));for(const _0x12a738 of _0x25aeb8)_0xfb1801['getUser'](_0x12a738['id'])||_0xfb1801['addUser'](_0x12a738);}}function w(_0x34f514){if(vt(_0x34f514))return new Promise(()=>{});throw _0x34f514;}function vt(_0x42a3be){return _0x42a3be['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x42a3be['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x228e35{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x32a30a=this['editor']['plugins']['get'](c),_0x5a8a73=this['editor']['plugins']['get']('CommentsEditing'),_0x25d41b=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x32a30a,'change:state',(_0x52cbc0,_0x455174,_0x160076)=>{_0x5a8a73['isThreadsLoadingPaused']='connected'!==_0x160076;});}),this['listenTo'](_0x32a30a,'change:state',(_0x483c02,_0x3c3d17,_0x134c62)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x134c62);}),_0x25d41b['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x228e35{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x228e35{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>nt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x1d491e];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3769a6){super(_0x3769a6);const _0x29dc43=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x29dc43);}async['init'](){const _0x4e0b26=this['editor']['plugins']['get'](l),_0x9c9c20=_0x4e0b26['serverHistory'],_0x4ca6a2=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x9c9c20,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x4e0b26['sessionId']});const _0x1845a9=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0xfd369f=await ot['isBundleUploaded'](_0x4ca6a2['connection'],_0x1845a9);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x34861f})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x34861f)),'updateRevisions':async _0x18f4c3=>{await this['_waitForServiceReady']();const _0x3ab474=this['_revisionTracker']['currentRevision'];if(_0xfd369f&&0x1===_0x18f4c3['length']&&_0x18f4c3[0x0]['id']===_0x3ab474['id'])return _0x18f4c3;for(const _0x5b385c of _0x18f4c3)_0x5b385c['id']===_0x3ab474['id']&&(_0x5b385c['isEmptyCurrent']=_0x5b385c['fromVersion']===_0x5b385c['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x18f4c3,this['_lastRequestId'])['then'](_0x3fae21=>(this['_lastRequestId']=_0x3fae21,_0x18f4c3))['catch'](_0x5838c2=>{if(ct(_0x5838c2)||'400'===_0x5838c2['code']&&void 0x0!==_0x5838c2['data']['wrongRequestId']){for(const _0x4c7477 of _0x18f4c3){!this['_revisionTracker']['repository']['getRevision'](_0x4c7477['id'])||this['_revisionTracker']['_bufferUpdate'](_0x4c7477['id'],_0x4c7477,!0x1);}if(ct(_0x5838c2))throw _0x5838c2;return _0x18f4c3;}throw _0x5838c2;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3f31ef,{revisionsData:_0x1a97d1,requestId:_0x4f9a3c})=>{Math['max'](..._0x1a97d1['map'](_0x41a91a=>_0x41a91a['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1a97d1,_0x4f9a3c);}):this['_handleRevisionsUpdate'](_0x1a97d1,_0x4f9a3c);});const {revisions:_0x16d6a3,requestId:_0x438b00}=await this['_revisionHistoryService']['connect'](_0x4ca6a2['connection']);_0x4ca6a2['addToReconnectionStack'](this),this['_lastRequestId']=_0x438b00,await this['_fetchMissingUsers'](_0x16d6a3);for(const _0x2de84b of _0x16d6a3)this['_revisionTracker']['addRevisionData'](_0x2de84b);this['listenTo'](_0x4e0b26,'change:_isConnected',(_0x5ca09e,_0xe659a1,_0xbad84f)=>{_0xbad84f&&(this['_oldOffset']=_0x4e0b26['_offset'],_0x5ca09e['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4ca6a2,'state',_0x5a528a=>_0x5a528a===_0x1605b2['CONNECTED']);}async['reconnect'](){const _0xc3ec4c=this['editor']['plugins']['get'](c),_0x2d4cee=this['editor']['plugins']['get'](l),_0x2a2643=async()=>{const _0x23d74a=this['_revisionTracker']['currentRevision'],_0x3e8256=_0x23d74a['id'],_0x3dec0d=_0x3e8256!==_0x2d4cee['sessionId'];if(_0x3dec0d){const _0x490f48=_0x2d4cee['_offset']-this['_oldOffset'],_0x464733=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x23d74a['toVersion']+_0x490f48!==_0x464733){const _0x16e664=_0x23d74a['fromVersion']+_0x490f48,_0x314131=this['editor']['plugins']['get'](_0x1d491e),_0x553389=this['_revisionTracker']['buildRevisionData']({'revision':_0x23d74a,'from':_0x16e664,'to':_0x464733});_0x553389['id']=_0x23d74a['id'];const _0x396264=_0x553389['authorsIds']['map'](_0x577524=>_0x314131['getUser'](_0x577524));_0x23d74a['_update']({..._0x553389,'authors':_0x396264},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x23d74a['id'],_0x553389,!0x0);}this['_revisionTracker']['_startingVersion']=_0x464733,(_0x23d74a['toVersion']===_0x23d74a['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x3e8256)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x3e8256),this['_revisionTracker']['_createCurrentRevision'](_0x464733));}const {revisions:_0x224ba0,requestId:_0x15113d}=await this['_revisionHistoryService']['reconnect'](_0xc3ec4c['connection'],this['_lastRequestId']);_0x3dec0d&&_0x224ba0['length']>0x0?_0x2d4cee['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x224ba0),this['_handleRevisionsUpdate'](_0x224ba0,_0x15113d),this['_revisionTracker']['sendBufferedUpdates']());};return _0x2d4cee['_isConnected']?_0x2a2643():new Promise((_0x51d8c5,_0x2198a1)=>{_0x2d4cee['once']('change:_isConnected',()=>{_0x2a2643()['then'](_0x51d8c5)['catch'](_0x2198a1);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x1db597=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x643fdc=>{_0x643fdc['off'](),_0x1db597();});});}['_getLatestVersionFromServerOperations'](){const _0x34fca0=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x4cecb6 of _0x34fca0)if('marker'!==_0x4cecb6['type']||_0x4cecb6['affectsData'])return _0x4cecb6['baseVersion']+0x1;}['_getLatestVersion'](){const _0xab78fe=this['editor']['plugins']['get'](l);return new Promise(_0x2a04be=>{_0xab78fe['_isPendingUpdate']?_0xab78fe['once']('change:_isPendingUpdate',()=>{_0x2a04be(this['_getLatestVersionFromServerOperations']());}):_0x2a04be(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x16bbb0,_0x43b54c){const _0x2882f=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x43b54c;for(const _0x335d86 of _0x16bbb0){const _0x3f7d65=_0x2882f['getRevision'](_0x335d86['id']);if(_0x3f7d65){if((_0x335d86['fromVersion']||_0x335d86['toVersion'])&&(_0x335d86['diffData']=null),_0x3f7d65===this['_revisionTracker']['currentRevision']){const _0x5ae749=Math['max'](_0x3f7d65['toVersion'],_0x335d86['toVersion']),_0x1d594c=Math['max'](_0x3f7d65['fromVersion'],_0x335d86['fromVersion']);let _0x3db709;_0x3f7d65['toVersion']===_0x335d86['toVersion']&&_0x3f7d65['fromVersion']===_0x335d86['fromVersion']?(_0x3db709=!0x0,this['_preventResendingRevisionData'](_0x335d86)):_0x335d86['toVersion']===_0x5ae749&&_0x335d86['fromVersion']===_0x1d594c?_0x3db709=!0x1:(_0x3f7d65['toVersion']===_0x5ae749&&_0x3f7d65['fromVersion']===_0x1d594c||this['_fixRevision']({'revision':_0x3f7d65,'from':_0x1d594c,'to':_0x5ae749}),_0x3db709=!0x0),_0x3db709&&(delete _0x335d86['fromVersion'],delete _0x335d86['toVersion'],delete _0x335d86['diffData'],delete _0x335d86['createdAt'],delete _0x335d86['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x335d86),this['_preventResendingRevisionData'](_0x335d86);}else this['_revisionTracker']['addRevisionData'](_0x335d86);}const _0xd7be00=_0x2882f['getRevisions']();_0xd7be00['reverse']();for(let _0x5e6642=0x0;_0x5e6642<_0xd7be00['length']-0x1;_0x5e6642++){const _0x2860aa=_0xd7be00[_0x5e6642],_0x5ca39a=_0xd7be00[_0x5e6642+0x1];if(_0x2860aa['fromVersion']<_0x5ca39a['toVersion']){const _0x4f7ca5=_0x5ca39a['toVersion'],_0x48605a=Math['max'](_0x4f7ca5,_0x2860aa['toVersion']);this['_fixRevision']({'revision':_0x2860aa,'from':_0x4f7ca5,'to':_0x48605a});}}}['_fixRevision']({revision:_0x2f2ae5,from:_0x530c2f,to:_0x1c29e6}={}){const _0x33a2e8=this['editor']['plugins']['get'](_0x1d491e),_0x41cb9d=this['_revisionTracker']['buildRevisionData']({'revision':_0x2f2ae5,'from':_0x530c2f,'to':_0x1c29e6});_0x41cb9d['authors']=_0x41cb9d['authorsIds']['map'](_0x5d708b=>_0x33a2e8['getUser'](_0x5d708b)),_0x2f2ae5['_update'](_0x41cb9d);}['_preventResendingRevisionData'](_0x404aca){const _0x14f734={};_0x14f734['id']=_0x404aca['id'];for(const _0x5bdefa of Object['keys'](_0x404aca))'id'!==_0x5bdefa&&(_0x14f734[_0x5bdefa]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x14f734['id'],_0x14f734,!0x0);}async['_fetchMissingUsers'](_0x2d7c18){const _0x128509=this['editor']['plugins']['get'](_0x1d491e),{connection:_0x429fd8}=this['editor']['plugins']['get'](c),_0x3bfe8c=new Set();for(const _0x1dbfcc of _0x2d7c18){for(const _0x12cf64 of _0x1dbfcc['authorsIds'])_0x37757e(_0x12cf64);_0x1dbfcc['creatorId']&&_0x37757e(_0x1dbfcc['creatorId']);}if(0x0===_0x3bfe8c['size'])return;const _0x2b52f1=await gt['getMany'](_0x429fd8,Array['from'](_0x3bfe8c));for(const _0x3ee9e1 of _0x2b52f1)_0x128509['getUser'](_0x3ee9e1['id'])||_0x128509['addUser'](_0x3ee9e1);function _0x37757e(_0x193601){_0x128509['getUser'](_0x193601)||_0x3bfe8c['add'](_0x193601);}}}function ct(_0x4385b8){return _0x4385b8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4385b8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4385b8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x228e35{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class tt extends _0x405b4a{['_collapseAt'];constructor(_0x577c43,_0x14f3b3=0x6){super(_0x577c43);const _0x231461=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x14f3b3,this['bind']('isHidden')['to'](this,'usersCount',_0x2371ce=>_0x2371ce<_0x14f3b3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x231461['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':_0x231461['to']('usersCount',_0x44e79f=>'+'+(_0x44e79f-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x405b4a{['items'];['keystrokes'];constructor(_0x3bff22){super(_0x3bff22);const _0x2c8199=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x3351df(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x2c8199['if']('hasPopup'),'aria-expanded':_0x2c8199['to']('isExpanded',_0x195458=>this['hasPopup']&&String(_0x195458)),'aria-label':_0x2c8199['to']('hasPopup',_0x331c19=>N(_0x3bff22,_0x331c19?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x2c8199['to']('hasPopup',_0x24dc08=>!!_0x24dc08&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x2c8199['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x2c8199['to'](_0x746a7e=>{const _0x11fc7b=_0x746a7e,_0x45d835=document['querySelector']('.ck-presence-list__dropdown-list'),_0x18e21f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x45d835?.['contains'](_0x11fc7b['relatedTarget'])||_0x18e21f?.['contains'](_0x11fc7b['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2412e0,_0x1fdf37,_0x5b7e2a)=>{this['element']&&(_0x5b7e2a?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class Z extends _0x405b4a{['counterView'];['inlineListView'];constructor(_0x2c07b2,_0x416fbb=0x6){super(_0x2c07b2);const _0xb4175c=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new tt(this['locale'],_0x416fbb),this['inlineListView']=new ts(_0x2c07b2),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x50f131 of this['inlineListView']['items'])_0x50f131['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',_0xb4175c['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class st extends _0x405b4a{['listWrapperView'];constructor(_0x397726,_0x25841c){super(_0x397726);const _0x722851=this['bindTemplate'];this['listWrapperView']=new _t(_0x397726,_0x25841c),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':N(_0x397726,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x722851['to'](_0x57ce5c=>{const _0x4ae5d5=_0x57ce5c,_0x380229=document['querySelector']('.ck-presence-list__list'),_0x380bc2=document['querySelector']('.ck-balloon-panel_with-arrow');_0x380229?.['contains'](_0x4ae5d5['relatedTarget'])||_0x380bc2?.['contains'](_0x4ae5d5['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class _t extends _0x2d3481{constructor(_0x174f08,_0xc314e6){super(_0x174f08);const _0x4ae9c5=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xc314e6?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x4ae9c5['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x4ae9c5['to']('role'),'aria-label':_0x4ae9c5['to']('ariaLabel'),'aria-labelledby':_0x4ae9c5['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xf146c8['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xa79aab=this['element'];_0xa79aab&&(this['_isScrollable']=Math['max'](_0xa79aab['scrollHeight'],_0xa79aab['clientHeight'])>0.8*window['innerHeight']);}}class it extends lt{['userView'];constructor(_0x3a8096,_0xab8de4,_0x13e4c6){super(_0x3a8096);const _0x4b4bf0=this['bindTemplate'];this['userView']=new ut(_0x3a8096,_0xab8de4);const _0x16dab7={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0xab8de4['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0xab8de4['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xab8de4['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x13e4c6&&(_0x16dab7['tag']='button',_0x16dab7['on']={'click':_0x4b4bf0['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x16dab7);}['focus'](){this['element']['focus']();}}class et extends _0x405b4a{['userView'];['markerView'];constructor(_0x32f40c,_0x3b51eb,_0x40de70){super(_0x32f40c);const _0x261e97=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ut(_0x32f40c,_0x3b51eb),this['markerView']=new dt(_0x32f40c,_0x3b51eb);const _0x6d589c=new pt(_0x32f40c);_0x6d589c['template']['tag']='span',_0x6d589c['text']=_0x3b51eb['name'];const _0x39d02a={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x261e97['to']('isFocusable',_0x4f204e=>!!_0x4f204e&&0x0),'aria-labelledby':_0x6d589c['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x261e97['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x261e97['to']('hasTooltip',_0x5a09d1=>!_0x5a09d1),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x6d589c]};_0x40de70&&(_0x39d02a['tag']='button',_0x39d02a['on']={'click':_0x261e97['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x39d02a);}}class dt extends _0x405b4a{constructor(_0x3f8a3d,_0x2bb440){super(_0x3f8a3d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x2bb440['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const rt={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x1390d5{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x19d11e){super(_0x19d11e),this['context']['config']['define']('presenceList',rt);const _0x1ce20d=_0x19d11e['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1ce20d)throw new _0x404cce('presencelist-collapseat-invalid-format',this);if(_0x1ce20d<0x1)throw new _0x404cce('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x210266(),this['balloonPanelView']=new _0x500144(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x113943 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x113943);this['listenTo'](this['_allConnectedUsers'],'add',(_0x20a561,_0x19c22a)=>{this['_handleUserAdd'](_0x19c22a);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x515677,_0x348fc7)=>{this['_handleUserRemove'](_0x348fc7);});}['_createView'](){const _0xef3e94=this['context'],_0x2b763e=new Z(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x31be4f=this['balloonPanelView'];if(!_0x391704(_0xef3e94['config']['get']('presenceList.container')))throw new _0x404cce('presencelist-missing-container',this);return _0x2b763e['counterView']['bind']('usersCount')['to'](this),_0x2b763e['bind']('isCollapsed')['to'](this,'usersCount',_0x5c9443=>{const {collapseAt:_0x2cdd0a}=_0xef3e94['config']['get']('presenceList'),_0x52187b=_0x5c9443>=_0x2cdd0a;if(_0x52187b&&!_0x2b763e['inlineListView']['items']['find'](_0x1aef83=>_0x1aef83 instanceof tt)){const _0x5dd194=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5dd194&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x2b763e['inlineListView']['items']['add'](_0x2b763e['counterView']);}return _0x52187b||this['hideDropdown'](),_0x52187b;}),_0x2b763e['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x30a393=>{const _0x223e9e=_0xef3e94['config']['get']('presenceList'),_0x2ab251=new et(_0xef3e94['locale'],_0x30a393,!!_0x223e9e['onClick']);return _0x2ab251['bind']('hasTooltip')['to'](_0x2b763e,'isCollapsed',_0x3535e9=>!_0x3535e9),_0x2ab251['bind']('isFocusable')['to'](_0x2b763e,'isCollapsed',_0x5d192e=>!_0x5d192e),_0x223e9e['onClick']&&this['listenTo'](_0x2ab251,'execute',()=>{this['view']['isCollapsed']||_0x223e9e['onClick'](_0x30a393,_0x2ab251['element']);}),_0x2ab251;}),this['listenTo'](_0x2b763e['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x2b763e['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x2b763e['inlineListView']['keystrokes']['set']('Enter',(_0x12ee19,_0x2a63fc)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2a63fc());}),_0x2b763e['render'](),_0x31be4f['render'](),_0x1f5fe9({'emitter':_0x2b763e,'activator':()=>_0x31be4f['isVisible'],'contextElements':[_0x31be4f['element'],_0x2b763e['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0xef3e94['config']['get']('presenceList.container')['appendChild'](_0x2b763e['element']),this['_bodyCollection']=new _0xc6f326(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x2b763e;}['_handleUserAdd'](_0x2e8122){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2e8122['isMe'])return;const _0x32514b=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x32514b-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x2c92b9=_0x2e8122['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2e8122,_0x2c92b9);}['_handleUserRemove'](_0xa8510){this['usersCount']--;const {collapseAt:_0x3a8084}=this['context']['config']['get']('presenceList'),_0x578929=this['usersCount']>=_0x3a8084;if(this['currentDisplayedUsers']['get'](_0xa8510['id']))this['currentDisplayedUsers']['remove'](_0xa8510['id']);else{if(_0x578929&&this['currentDisplayedUsers']['length']+0x1===_0x3a8084-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x578929?0x1:0x0)<this['usersCount']){for(const _0x180052 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x180052['id'])&&(this['currentDisplayedUsers']['add'](_0x180052,Math['min'](this['currentDisplayedUsers']['length']-(_0x578929?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x578929?0x1:0x0)===_0x3a8084-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x9f82e8=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new st(this['context']['locale'],!!_0x9f82e8['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x5d8b89}=this['presenceDropdownView'];_0x5d8b89['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4432e0=>{if(!_0x9f82e8['displayMe']&&_0x4432e0['isMe'])return null;const _0x3ffcbd=new it(this['context']['locale'],_0x4432e0,!!_0x9f82e8['onClick']);return _0x9f82e8['onClick']&&this['listenTo'](_0x3ffcbd,'execute',()=>{_0x9f82e8['onClick'](_0x4432e0,_0x3ffcbd['element']);}),_0x3ffcbd;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x5d8b89['focus'](),_0x5d8b89['checkIfScrollable']();const _0x5af20d=(_0x58586b,_0x439250)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x439250();};_0x5d8b89['keystrokes']['set']('Esc',_0x5af20d),_0x5d8b89['keystrokes']['set']('Shift+Tab',_0x5af20d),_0x5d8b89['keystrokes']['set']('Tab',(_0x3670e8,_0x34b20d)=>{!function(_0x132169){const _0x366368=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x322aeb=>_0x322aeb+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x4b7dfe=[...document['body']['querySelectorAll'](_0x366368)]['filter'](_0x5de05e=>_0x5de05e===document['activeElement']||_0x5de05e['offsetWidth']+_0x5de05e['offsetHeight']>0x0)['sort']((_0x104bfc,_0x298737)=>(_0x104bfc['tabIndex']||0x0)-(_0x298737['tabIndex']||0x0)),_0x3d3a5a=_0x4b7dfe['indexOf'](_0x132169),_0x527abb=_0x4b7dfe[(_0x3d3a5a+0x1)%_0x4b7dfe['length']];_0x527abb&&_0x527abb['focus']();}(this['view']['element']),this['hideDropdown'](),_0x34b20d();}),_0x5d8b89['focusTracker']['add'](this['view']['element']),_0x5d8b89['focusTracker']['on']('change:isFocused',(_0x5c9632,_0xe9b25c,_0x11d403)=>{_0x11d403||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x1390d5{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
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':_0x355bc5=>0x1!=_0x355bc5}};
|