@ckeditor/ckeditor5-real-time-collaboration 47.5.0-alpha.7 → 47.5.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
|
-
((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4cbdd0];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9ef120){super(_0x9ef120),this['set']('state',_0x434220['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x49b100())();}['init'](){const _0x2217cb=this['context'],_0x5990f1=_0x2217cb['plugins']['get']('CloudServices'),_0x229d22=_0x2217cb['plugins']['get'](_0x4cbdd0);if(!_0x5990f1['token'])throw new _0x48cb43('websocketgateway-missing-token',this);if(!_0x5990f1['webSocketUrl'])throw new _0x48cb43('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x5990f1['token'],_0x5990f1['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4d0653=>{if(this['connection']=_0x4d0653,this['bind']('state')['to'](_0x4d0653,'state',this,'_isBrowserOffline',(_0x33cf24,_0x46fb99)=>('connected'!==_0x33cf24&&(this['_shouldPluginsReconnect']=!0x0),_0x46fb99||_0x33cf24!==_0x434220['CONNECTED']?_0x434220['DISCONNECTED']:this['state']==_0x434220['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x434220['CONNECTING']):_0x434220['CONNECTED'])),this['connection']['on']('error',(_0x584215,_0x1cd9ac)=>{if('limitExceeded'!==_0x1cd9ac['code'])throw console['error'](_0x1cd9ac),new _0x48cb43('cloudservices-init',null,{'originalError':_0x1cd9ac});_0x229d22['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'});}),!_0x4d0653['me'])return new Promise(_0x5e4822=>_0x4d0653['on']('change:me',_0x5e4822));})['catch'](_0x29947e=>{throw console['error'](_0x29947e),new _0x48cb43('cloudservices-init',null,{'originalError':_0x29947e});});}['addToReconnectionStack'](_0x554a11){if('function'!=typeof _0x554a11['reconnect'])throw new _0x48cb43('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x554a11))throw new _0x48cb43('websocketgateway-plugin-already-registered',this,{'name':_0x554a11['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x554a11);}['removeFromReconnectionStack'](_0x17d1a2){this['_reconnectionStack']['delete'](_0x17d1a2);}['isInReconnectionStack'](_0x329372){return this['_reconnectionStack']['has'](_0x329372);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x2b45c1=>_0x2b45c1['reconnect']())))['then'](()=>this['state']=_0x434220['CONNECTED'])['catch'](_0x3f3539=>{throw console['error'](_0x3f3539),new _0x48cb43('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x434220['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x304859{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x4ac0c1];}constructor(_0x5e8be7){super(_0x5e8be7),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0xae999c(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4ac0c1);}['init'](){const _0x4dd13b=this['context']['plugins']['get'](n);this['listenTo'](_0x4dd13b,'change:state',(_0x428a5e,_0x43789a,_0x4f3944)=>{if('connected'!==_0x4f3944)this['channelSessions']['forEach'](_0x30b086=>_0x30b086['clear']()),this['channelConnectedUsers']['forEach'](_0x431dc1=>_0x431dc1['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x3249e8,_0x4480a1]of this['_registeredSessions'])for(const _0x4a27dd of _0x4480a1)this['_handleSessionAdd'](_0x3249e8,_0x4a27dd);}}),this['_createUser'](_0x4dd13b['connection']['me'],!0x0);}['register'](_0x5e224a,_0x40cf9a){if(this['_registeredSessions']['has'](_0x5e224a))throw new _0x48cb43('sessions-register-already-registered',null,{'channelId':_0x5e224a});this['_registeredSessions']['set'](_0x5e224a,_0x40cf9a),this['channelSessions']['set'](_0x5e224a,new _0xae999c()),this['channelConnectedUsers']['set'](_0x5e224a,new _0xae999c()),this['listenTo'](_0x40cf9a,'add',(_0x29564e,_0x1e34c3)=>this['_handleSessionAdd'](_0x5e224a,_0x1e34c3)),this['listenTo'](_0x40cf9a,'remove',(_0x4c066f,_0x1ab357)=>this['_handleSessionRemove'](_0x5e224a,_0x1ab357));for(const _0x44f7a9 of _0x40cf9a)this['_handleSessionAdd'](_0x5e224a,_0x44f7a9);}['unregister'](_0x272a13){if(!this['_registeredSessions']['has'](_0x272a13))throw new _0x48cb43('sessions-unregister-not-exist',null,{'channelId':_0x272a13});const _0x49fc7a=this['_registeredSessions']['get'](_0x272a13);this['stopListening'](_0x49fc7a);for(const _0x51d867 of _0x49fc7a)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x272a13,_0x51d867);this['_registeredSessions']['delete'](_0x272a13),this['channelSessions']['delete'](_0x272a13),this['channelConnectedUsers']['delete'](_0x272a13);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x461833){for(const _0x2ffa8d of this['channelSessions']['values']())for(const _0x404d7c of _0x2ffa8d)if(_0x404d7c['id']===_0x461833)return _0x404d7c['user'];}['getUserSessions'](_0x1bccf1,_0x43cd8a){const _0x4854a5=_0x43cd8a?[this['channelSessions']['get'](_0x43cd8a)]:this['channelSessions']['values'](),_0x495502=new Set();for(const _0x15726d of _0x4854a5)for(const _0x2652d9 of _0x15726d)_0x2652d9['user']['id']===_0x1bccf1['id']&&_0x495502['add'](_0x2652d9['id']);return _0x495502;}['getUserRole'](_0x41863f){for(const _0x457853 of this['channelSessions']['values']())for(const _0x16e837 of _0x457853)if(_0x16e837['user']===_0x41863f)return _0x16e837['role'];}['_handleSessionAdd'](_0x30aa58,_0x3c1cb6){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x1f13d3=_0x3c1cb6['user'],_0xcdcbd6=this['_users']['getUser'](_0x1f13d3['id'])||this['_createUser'](_0x1f13d3),_0x1a8228=Object['assign']({},_0x3c1cb6,{'user':_0xcdcbd6});if(this['channelSessions']['get'](_0x30aa58)['add'](_0x1a8228),!_0x1f13d3['hiddenInPresenceList']){const _0x48d6b9=this['channelConnectedUsers']['get'](_0x30aa58);_0x48d6b9['has'](_0xcdcbd6['id'])||_0x48d6b9['add'](_0xcdcbd6),this['allConnectedUsers']['has'](_0xcdcbd6['id'])||_0x1f13d3['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xcdcbd6,_0xcdcbd6['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x30aa58,{'channelId':_0x30aa58,'session':_0x1a8228});}['_handleSessionRemove'](_0x2f3df8,_0x4ca7a6){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x6395f3=this['channelConnectedUsers']['get'](_0x2f3df8),_0x4d1131=_0x4ca7a6['user'];_0x4d1131['id']&&(this['channelSessions']['get'](_0x2f3df8)['remove'](_0x4ca7a6['id']),_0x6395f3['has'](_0x4d1131['id'])&&!this['getUserSessions'](_0x4d1131,_0x2f3df8)['size']&&_0x6395f3['remove'](_0x4d1131['id']),this['allConnectedUsers']['get'](_0x4d1131['id'])&&!this['getUserSessions'](_0x4d1131)['size']&&this['allConnectedUsers']['remove'](_0x4d1131['id']));}['_createUser'](_0x124234,_0x2a6a09){const _0x4653b8=this['_users']['addUser'](_0x124234);return _0x2a6a09&&this['_users']['defineMe'](_0x124234['id']),_0x4653b8['orderNumber']=this['_uniqueUsersCount']++,_0x4653b8;}}class $ extends _0x2ba0b9{['_domEmitter']=new(_0x49b100())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x9d6110=this['editor'],_0x487783=_0x9d6110['plugins']['get'](i);_0x9d6110['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x399f4c,{writer:_0x55722f})=>function(_0x295daf,_0x58a005,_0xe877d6,_0x527b78){const _0x47edf6=_0x295daf['markerName']['split'](':')[0x2],_0x34b614=_0xe877d6['getUserBySessionId'](_0x47edf6);if(!_0x34b614||_0x47edf6===_0xe877d6['mySessionId'])return;if(!_0x527b78['model']['schema']['checkChild'](_0x295daf['markerRange']['start'],'$text'))return;const _0x28ef25={'class':'ck-user__marker\x20'+_0x34b614['color']['getMarkerClass'](),'data-name':_0x34b614['name'],'data-session-id':_0x47edf6},_0x51f6ec=_0x527b78['model']['markers']['get'](_0x295daf['markerName']),_0x51a267=_0x51f6ec['getStart'](),_0x21dcc8=_0x51a267['nodeAfter'],_0x3d6fea=_0x527b78['model']['schema'];if(_0x21dcc8&&_0x3d6fea['isObject'](_0x21dcc8)&&_0x3d6fea['isInline'](_0x21dcc8)&&!_0x527b78['model']['markers']['get']('user:range:'+_0x47edf6)['getRange']()['isCollapsed'])return;const _0x42ef9e=_0x51a267['parent'];return _0x527b78['model']['schema']['isLimit'](_0x42ef9e)&&!_0x527b78['model']['hasContent'](_0x42ef9e)&&(_0x28ef25['contenteditable']=!0x1),function(_0x4d2052,_0x9944d9,_0x3bfe05){const _0x68d4f2=_0x4d2052['createUIElement']('span',_0x9944d9);return _0x4d2052['setCustomProperty']('userPositionMarker',!0x0,_0x68d4f2),_0x68d4f2['render']=function(_0x398a07){const _0x4ee09d=this['toDomElement'](_0x398a07),_0x3cf9b7=document['createElement']('span');return _0x3cf9b7['classList']['add']('ck-user__marker-tooltip'),_0x3cf9b7['setAttribute']('contenteditable','false'),_0x3cf9b7['setAttribute']('spellcheck','false'),_0x3cf9b7['textContent']=_0x3bfe05['name'],_0x4ee09d['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3cf9b7['outerHTML']+'',_0x4ee09d['addEventListener']('mouseenter',()=>{_0x4ee09d['classList']['add']('ck-user__marker_hovered');}),_0x4ee09d['addEventListener']('mouseleave',()=>{_0x4ee09d['classList']['remove']('ck-user__marker_hovered');}),_0x4ee09d;},_0x68d4f2['isSimilar']=function(_0x289a4c){return!(!this['getCustomProperty']('userPositionMarker')||!_0x289a4c['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x289a4c['getAttribute']('data-session-id'));},_0x68d4f2;}(_0x58a005,_0x28ef25,_0x34b614);}(_0x399f4c,_0x55722f,_0x487783,_0x9d6110)}),_0x9d6110['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4f13c3=>function(_0x4f7ee0,_0x35c0ea){const _0x3a1f55=_0x4f7ee0['markerName']['split'](':')[0x2];if(_0x3a1f55===_0x35c0ea['mySessionId'])return null;const _0x281de8=_0x35c0ea['getUserBySessionId'](_0x3a1f55);if(!_0x281de8)return{'id':_0x3a1f55,'classes':[]};return{'id':_0x3a1f55,'classes':['ck-user__selection',_0x281de8['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3a1f55},'priority':0x7d0+_0x281de8['orderNumber']};}(_0x4f13c3,_0x487783)}),function(_0x82c037){const _0x456831=_0x82c037['model'],_0x3bc946=new Map(),_0x2f82ee=_0x82c037['plugins']['get'](i);_0x456831['markers']['on']('update:user:range',(_0x43a715,_0x320cf6,_0x23fc77,_0x2fe4c2)=>{if(!_0x2fe4c2&&_0x3bc946['get'](_0x320cf6['name']))return _0x3bc946['get'](_0x320cf6['name'])['detach'](),void _0x3bc946['delete'](_0x320cf6['name']);const _0x3b69ac=_0x320cf6['name']['split'](':')[0x2];if(_0x3b69ac===_0x2f82ee['mySessionId'])return;const _0x27616e='user:position:'+_0x3b69ac;_0x456831['markers']['has'](_0x27616e)&&_0x82c037['editing']['reconvertMarker'](_0x27616e),_0x320cf6['on']('change:range',(_0x46113b,_0x37379c,_0x3be0ee)=>{if('$graveyard'!=_0x37379c['root']['rootName']&&'$graveyard'==_0x320cf6['getRange']()['root']['rootName']&&!_0x3bc946['has'](_0x320cf6['name'])){const _0x2467e6=_0x456831['schema']['getNearestSelectionRange'](_0x3be0ee['deletionPosition']);if(_0x2467e6){const _0x4f5730=_0x45da61['fromRange'](_0x2467e6);_0x3bc946['set'](_0x320cf6['name'],_0x4f5730),_0x4f5730['on']('change:range',(_0x33938c,_0x2615f1,_0x2e265d)=>{if('$graveyard'==_0x4f5730['root']['rootName']){const _0xdfd4ef=_0x456831['schema']['getNearestSelectionRange'](_0x2e265d['deletionPosition']);_0xdfd4ef?(_0x4f5730['start']=_0xdfd4ef['start'],_0x4f5730['end']=_0xdfd4ef['end']):(_0x3bc946['delete'](_0x320cf6['name']),_0x4f5730['detach']());}});}}});}),_0x456831['document']['on']('change',()=>{_0x3bc946['size']>0x0&&_0x456831['enqueueChange']({'isUndoable':!0x1},_0x1c75a7=>{for(const [_0x4d1299,_0x1153f3]of _0x3bc946)'$graveyard'==_0x456831['markers']['get'](_0x4d1299)['getRange']()['root']['rootName']&&(te(_0x4d1299['split'](':')[0x2],_0x1153f3['toRange'](),_0x456831,_0x1c75a7),_0x1153f3['detach']());_0x3bc946['clear']();});});}(_0x9d6110),this['_domEmitter']['listenTo'](_0x3ffad9['document'],'keydown',(_0x1e6dec,{key:_0x38f869})=>{'Escape'===_0x38f869&&function(_0x32f8f4){_0x32f8f4['editing']['view']['change'](_0x1492ae=>{for(const _0x2556d3 of _0x32f8f4['model']['markers']){if(!_0x2556d3['name']['startsWith']('user:position'))continue;const _0xc225b5=_0x32f8f4['editing']['mapper']['markerNameToElements'](_0x2556d3['name']);if(_0xc225b5){for(const _0x56af5e of _0xc225b5)_0x1492ae['removeClass']('ck-user__marker_hovered',_0x56af5e);}}});}(_0x9d6110);},{'useCapture':!0x0});}['afterInit'](){const _0x4968ba=this['editor'],_0x43acf6=_0x4968ba['commands']['get']('undo');_0x43acf6&&_0x4968ba['model']['on']('applyOperation',(_0x1648ea,_0x2893c9)=>{const _0x4487b4=_0x2893c9[0x0];if(!_0x4487b4['isDocumentOperation'])return;if('marker'!=_0x4487b4['type']||!_0x4487b4['name']['startsWith']('user:'))return;const _0x3520b4=_0x4487b4['batch'];_0x43acf6['_createdBatches']['has'](_0x3520b4)&&(_0x4487b4['newRange']=_0x4487b4['oldRange']?_0x4968ba['model']['createRange'](_0x4487b4['oldRange']['start'],_0x4487b4['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x123fe6=this['editor'],_0x41bbab=_0x123fe6['model']['document'],_0x3b3d6f=_0x123fe6['plugins']['get'](i);_0x123fe6['model']['enqueueChange']({'isUndoable':!0x1},_0x45b2e4=>{const _0x422e9f='user:range:'+_0x3b3d6f['mySessionId'],_0x2876e7='user:position:'+_0x3b3d6f['mySessionId'],_0x46f41a=_0x123fe6['model']['markers']['has'](_0x422e9f);_0x123fe6['editing']['view']['hasDomSelection']?te(_0x3b3d6f['mySessionId'],_0x41bbab['selection']['getFirstRange'](),_0x123fe6['model'],_0x45b2e4):_0x46f41a&&(_0x45b2e4['removeMarker'](_0x422e9f),_0x45b2e4['removeMarker'](_0x2876e7));});}}function te(_0xb4ac87,_0x486cf1,_0x13c8f5,_0x2fe951){const _0x1235a6='user:range:'+_0xb4ac87,_0xb446d5='user:position:'+_0xb4ac87,_0x1e6f43=_0x486cf1['getContainedElement']();let _0x465ed0=_0x486cf1['start'];if(_0x1e6f43&&_0x1e6f43['is']('element','tableCell')){const _0x167cdf=function(_0x254c0a,_0x39b2f4){for(const _0x145f94 of _0x254c0a['getPositions']())if(_0x39b2f4['schema']['checkChild'](_0x145f94,'$text'))return _0x145f94;}(_0x486cf1,_0x13c8f5);_0x167cdf&&(_0x465ed0=_0x167cdf,_0x486cf1=_0x2fe951['createRange'](_0x465ed0));}const _0x2bd57a=_0x2fe951['createRange'](_0x465ed0);_0x13c8f5['markers']['has'](_0x1235a6)?(_0x2fe951['updateMarker'](_0x1235a6,{'range':_0x486cf1}),_0x2fe951['updateMarker'](_0xb446d5,{'range':_0x2bd57a})):(_0x2fe951['addMarker'](_0x1235a6,{'range':_0x486cf1,'usingOperation':!0x0}),_0x2fe951['addMarker'](_0xb446d5,{'range':_0x2bd57a,'usingOperation':!0x0}));}function K(_0x47593d,_0x2baaac,_0x228b04){const _0xd43e32=_0x47593d['t'],t=_0x47593d['t'];switch(_0x2baaac){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 _0xd43e32({'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'},_0x228b04);default:return'';}}let X=0x1;class l extends _0x2ba0b9{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0xa1ab95)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,$,_0x5f3c56,_0x4ac0c1,_0x4cbdd0];}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 _0x5e88b2=this['serverHistory']['getOperations']();for(let _0x172593=_0x5e88b2['length']-0x1;_0x172593>=0x0;_0x172593--){const _0x752dc7=_0x5e88b2[_0x172593];if(!this['_disconnectionOperations']['has'](_0x752dc7))return _0x752dc7['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3c8a00){if(super(_0x3c8a00),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x321ec3(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x48cb43('collaboration-missing-channelid',this);const _0x552cad=_0x3c8a00['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x552cad,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x248d99(),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 tt(this['_disconnectionOperations']);}['init'](){const _0x56fec4=this['editor'],_0x54de2b=_0x56fec4['plugins']['get'](_0x4ac0c1),_0x3fbf3c=_0x56fec4['plugins']['get'](n);this['listenTo'](_0x54de2b,'getOperationAuthor',(_0x54440a,_0x2912f1)=>{const _0x27f00f=_0x2912f1[0x0];_0x27f00f['_authorId']&&(_0x54440a['return']=_0x54de2b['getUser'](_0x27f00f['_authorId']),_0x54440a['stop']()),null===_0x27f00f['_authorId']&&(_0x54440a['return']=null,_0x54440a['stop']());},{'priority':'high'}),this['listenTo'](_0x56fec4['model']['document']['selection'],'change:range',(_0x5ec3ca,_0x3f5401)=>{_0x3f5401['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x56fec4['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x56fec4['model']['on']('applyOperation',(_0x25d7c2,_0x4d7e0f)=>{const _0xca942a=_0x4d7e0f[0x0];_0xca942a['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0xca942a),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x3fbf3c,'state',this,'_hasSynchronizationProblem',(_0x934d67,_0x107448)=>'connected'===_0x934d67&&!_0x107448),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x56fec4['disableReadOnlyMode']('rtc-offline'):_0x56fec4['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x56fec4['disableReadOnlyMode']('rtc-offline'):_0x56fec4['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x2c0008=this['editor']['plugins']['get'](i),_0x2ce6d2=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x2c0008['unregister'](this['_channelId']);const _0x4d6f0e=await this['_service']['reconnect'](_0x2ce6d2['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4d6f0e)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x5d5652=await this['_service']['getConnectedSessions']();_0x2c0008['register'](this['_channelId'],_0x5d5652),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x552261){if(function(_0x52ed06){return'404'===_0x52ed06['code'];}(_0x552261)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5399e0){return'409'===_0x5399e0['code'];}(_0x552261)){const _0xaeee5d=K(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'](_0xaeee5d);}else{if(!(_0x552261 instanceof Y))throw _0x552261;this['_handleReconnectionError']();}}}}['destroy'](){const _0x265db4=this['editor']['plugins']['get'](n),_0xebc1f=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0xebc1f['channelSessions']['has'](this['_channelId'])&&_0xebc1f['unregister'](this['_channelId']),_0x265db4['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x20582a){if(this['sessionId']!==_0x20582a['sessionId']&&this['_lastSyncedOperationId']!==_0x20582a['lastOperationId'])throw new Y();return this['sessionId']=_0x20582a['sessionId'],this['_handleServerResponse']([],{..._0x20582a,'wereChangesApplied':!0x1,'data':_0x20582a['data']},'reconnect');}async['_connectService'](_0x6bc148,_0x2ccf27=!0x1){const {connection:_0x1daab4}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x1daab4,this['_channelId'])['then'](_0x27fe84=>this['_initSessionsHandling'](_0x27fe84))['catch'](_0x57d7a0=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x57d7a0);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x188146,_0x59d122)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x59d122);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x2394a8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x6bc148);this['_isPendingUpdate']=!0x0;const _0x2216cf=await this['_service']['connect'](_0x1daab4,this['_compressOperations'](_0x6bc148),_0x2394a8);if(this['sessionId']=_0x2216cf['sessionId'],_0x2ccf27){if(!_0x2216cf['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x2216cf['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x6bc148,_0x2216cf,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x2216cf,_0x6bc148);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3aa053=this['editor']['plugins']['get'](i),_0x1e847b=this['editor']['plugins']['get']($),_0x454840=_0x3aa053['channelSessions']['get'](this['_channelId']);_0x454840&&_0x454840['length']>0x1?_0x1e847b['createUserMarkerOperations']():this['listenTo'](_0x3aa053,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3aa053['channelSessions']['get'](this['_channelId'])['length']&&_0x1e847b['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x3c10e1,_0x193e44,_0x12eb0a,_0x2aa38a){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x193e44){const _0x222bed=this['_decompressOperations'](_0x12eb0a,_0x2aa38a);await this['_fetchMissingUsers'](_0x222bed),this['_handleExternalOperations'](_0x222bed,_0x193e44,_0x12eb0a['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x5e6bb}=this['editor'];let _0x244282;try{_0x244282=await this['_service']['getDocumentDetails']();}catch{const _0x59d0c1=K(_0x5e6bb,'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'](_0x59d0c1);}const _0x5e08fe=_0x244282['currentDocumentSession']||_0x244282['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5e08fe['lastOperationId']){const _0x11d17e=K(_0x5e6bb,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x11d17e);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x1ee768){const _0x2e3843=this['editor']['plugins']['get'](i);this['listenTo'](_0x2e3843,'sessionAdd:'+this['_channelId'],(_0x3c38d4,{session:_0x39b95b})=>{if(_0x39b95b['id']===_0x2e3843['mySessionId']){_0x3c38d4['off']();const _0x1baacf=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x5a4037=_0x39b95b['permissions'];_0x1baacf&&_0x1baacf['isEnabled']&&(_0x5a4037=_0x5a4037['filter'](_0x235e3e=>'document:write'!==_0x235e3e)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x5a4037,this['_channelId']);}}),_0x2e3843['register'](this['_channelId'],_0x1ee768);}['_initThrowingOnDataSet'](){const _0x112cb7=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x173201)=>{if(!_0x173201[_0x173201['length']-0x1]['suppressErrorInCollaboration'])throw new _0x48cb43('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x112cb7['apply'](this['editor']['data'],_0x173201);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x467dad,[_0x180690])=>{if(this['_document']['version'])throw new _0x48cb43('realtimecollaborationclient-init-document-already-initialized',this);_0x467dad['stop'](),this['_setPendingAction']();const _0x4c06d3=this['editor']['config']['get']('rootsAttributes'),_0x183009=this['_getOperationsFromInitData'](_0x180690,_0x4c06d3);0x0==_0x183009['length']&&_0x183009['push'](new _0x4e0d0b(0x0)),_0x467dad['return']=this['_connectService'](_0x183009)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x56ff64=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x56ff64))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x5405bf,[_0xe61e47,_0x2ac7f8])=>{_0x5405bf['stop']();const _0xd0b4d9=this['editor']['model']['document']['getRoot'](_0xe61e47);if(!this['_knownRootNames']['has'](_0xe61e47)){const _0x5d51d5=_0x2ac7f8&&_0x2ac7f8['data']?_0x2ac7f8['data']:'',_0x530ca8=_0x2ac7f8&&_0x2ac7f8['attributes']?_0x2ac7f8['attributes']:{};await this['_loadRoot'](_0xe61e47,_0x5d51d5,_0x530ca8);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0xd0b4d9['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0xd0b4d9);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x11c73e){const _0x22864b=this['editor']['plugins']['get'](_0x4ac0c1),{connection:_0x553a0d}=this['editor']['plugins']['get'](n),_0x5a5a18=new Set();for(const _0x1a12ff of _0x11c73e){const _0xa56c0b=_0x1a12ff['_authorId'];_0xa56c0b&&!_0x22864b['getUser'](_0xa56c0b)&&_0x5a5a18['add'](_0xa56c0b);}if(0x0===_0x5a5a18['size'])return;const _0x5f2102=await ct['getMany'](_0x553a0d,Array['from'](_0x5a5a18));for(const _0x39061f of _0x5f2102)_0x22864b['getUser'](_0x39061f['id'])||_0x22864b['addUser'](_0x39061f);}['_getOperationsFromInitData'](_0x5d9855,_0x731320={}){const _0x199c2d=this['editor']['model'],_0x2a9153=[];let _0x58424a=0x0;const _0x2279a2='string'==typeof _0x5d9855?{'main':_0x5d9855}:_0x5d9855;for(const _0x4676bc of Object['keys'](_0x2279a2)){if(!this['_document']['roots']['has'](_0x4676bc))throw new _0x48cb43('realtimecollaborationclient-init-non-existent-root',this);const _0x2c019c=this['editor']['data']['parse'](_0x2279a2[_0x4676bc]),_0x389ff4=this['_document']['getRoot'](_0x4676bc),_0x3aa996=new _0x3f0201(_0x199c2d['createPositionAt'](_0x389ff4,0x0),_0x2c019c,_0x58424a++);_0x2a9153['push'](_0x3aa996);for(const [_0x116362,_0x2e43ac]of _0x2c019c['markers']){const _0x29ad23=_0x199c2d['createRange'](_0x199c2d['createPositionFromPath'](_0x389ff4,_0x2e43ac['start']['path']['slice']()),_0x199c2d['createPositionFromPath'](_0x389ff4,_0x2e43ac['end']['path']['slice']())),_0x59238e=new _0x439f15(_0x116362,null,_0x29ad23,_0x199c2d['markers'],!0x0,_0x58424a++);_0x2a9153['push'](_0x59238e);}}if(_0x731320)for(const [_0x1f9b6c,_0x46dcd5]of Object['entries'](_0x731320)){const _0x1d8a3c=_0x199c2d['document']['getRoot'](_0x1f9b6c);if(!_0x1d8a3c)throw new _0x48cb43('multi-root-editor-root-attributes-no-root',null);for(const [_0x2bacf9,_0x57fd98]of Object['entries'](_0x46dcd5))if(null!==_0x57fd98){const _0x385eb6=new _0x150ec7(_0x1d8a3c,_0x2bacf9,null,_0x57fd98,_0x58424a++);_0x2a9153['push'](_0x385eb6);}}return _0x2a9153;}async['_loadRoot'](_0x28c091,_0x450a0f,_0x5e4624){this['_getOperationsFromInitData']({[_0x28c091]:_0x450a0f},{[_0x28c091]:_0x5e4624})['forEach']((_0x8cdd0c,_0x75e0d4)=>{_0x8cdd0c['baseVersion']=this['_document']['version']+_0x75e0d4,_0x8cdd0c['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x8cdd0c);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x41e9c2,_0x160039){let _0x4d7da0;this['_offset']=_0x41e9c2['offset'];const _0x4b5da5=_0x41e9c2['wereChangesApplied']&&!_0x41e9c2['initData'],_0x31ab25=_0x4b5da5?0x0:_0x41e9c2['data']['baseVersion'];if(_0x160039['forEach'](_0x3f03f7=>{_0x3f03f7['_isInit']=!0x0,_0x3f03f7['createdAt']=_0x41e9c2['sessionCreatedAt'],_0x3f03f7['_authorId']=null;}),_0x4b5da5)_0x4d7da0=_0x160039,this['_applyOperationsSet'](_0x4d7da0,_0x4b5da5);else{if(_0x41e9c2['initData']){const _0x42e312=this['_getOperationsFromInitData'](_0x41e9c2['initData']);this['_document']['history']['version']=-_0x42e312['length'],_0x42e312['forEach'](_0x5e87df=>{_0x5e87df['baseVersion']-=_0x42e312['length'],_0x5e87df['createdAt']=_0x41e9c2['sessionCreatedAt'],_0x5e87df['_isInit']=!0x0,_0x5e87df['_authorId']=null;}),this['_applyOperationsSet'](_0x42e312,!0x0),this['serverHistory']['version']=-_0x42e312['length']+this['_offset'],this['_updateServerHistory'](_0x42e312);}this['_document']['history']['version']=_0x31ab25,_0x4d7da0=this['_decompressOperations'](_0x41e9c2['data'],_0x41e9c2['metadata']),await this['_fetchMissingUsers'](_0x4d7da0),this['_applyOperationsSet'](_0x4d7da0,_0x4b5da5);}_0x41e9c2['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4d7da0,_0x41e9c2['lastOperationId']),this['_lastSyncedOperationId']=_0x41e9c2['lastOperationId']),this['serverHistory']['version']=_0x31ab25+this['_offset'],this['_updateServerHistory'](_0x4d7da0),_0x160039['filter'](_0x245085=>{const _0x527791=this['_getAffectedRoot'](_0x245085);return _0x527791&&!this['_knownRootNames']['has'](_0x527791);})['forEach']((_0x4a1d0e,_0x473ac1)=>{_0x4a1d0e['baseVersion']=this['_document']['version']+_0x473ac1,this['_saveOperationInBuffer'](_0x4a1d0e);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x5bc09f,_0x4f8bb7){const _0x18288e=_0x4f8bb7&&_0x4f8bb7['message'];if(_0x18288e&&_0x18288e['startsWith']('realtimecollaborationclient'))throw _0x4f8bb7;const _0x168ec4=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x168ec4['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x48cb43(_0x5bc09f,this['editor'],_0x18288e?{'originalError':_0x18288e}:void 0x0);}['_saveOperationInBuffer'](_0x4eb283){this['_knownOperations']['has'](_0x4eb283)||(this['_knownOperations']['add'](_0x4eb283),this['_bufferedOperations']['push'](_0x4eb283),this['_pendingAction']||'marker'==_0x4eb283['type']&&!_0x4eb283['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x2ff477=!0x1){!_0x2ff477&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x573d58=>{_0x573d58&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3e20a2=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x55fd73){return _0x55fd73['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x55fd73['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x55fd73['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3e20a2)||this['_crash'](_0x3e20a2['message'],_0x3e20a2);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x50289f=>{this['on']('change:_isPendingUpdate',()=>{_0x50289f();});});}async['_sendBufferedOperations'](){const _0x28cf42=this['editor']['plugins']['get']($);if(this['_shouldSendSelectionUpdate']()&&(_0x28cf42['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2bb874=[...this['_bufferedOperations']];for(const _0x45ad40 of _0x2bb874)_0x45ad40['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x45ad40);const _0x32eb68=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2bb874),_0x4e5c6b=X++,_0x5587cb=this['_compressOperations'](_0x2bb874),_0x16cdea=await this['_service']['sendOperations'](_0x5587cb,_0x5587cb['baseVersion'],_0x32eb68);try{return await this['_handleServerResponse'](_0x2bb874,_0x16cdea,_0x4e5c6b);}catch(_0x262284){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x262284);}}async['_handleServerResponse'](_0x4c844c,_0x132e65,_0x35c84b){if('error'in _0x132e65)throw _0x132e65['error'];let _0x5dab3e=!0x1;if(_0x132e65['wereChangesApplied']){_0x132e65['lastOperationId']&&(this['_lastSyncedOperationId']=_0x132e65['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x16e183=>!_0x4c844c['includes'](_0x16e183));for(const _0x52e905 of _0x4c844c)_0x52e905['createdAt']='lastOperationAcceptedAt'in _0x132e65&&_0x132e65['lastOperationAcceptedAt']||void 0x0;Z(_0x4c844c,_0x132e65['version']-_0x4c844c['length']),this['_updateServerHistory'](_0x4c844c);const _0x35badf=_0x4c844c['filter'](_0x27f5a2=>{if(!_0x27f5a2['_isInit'])return!0x1;const _0x5857a3=this['_getAffectedRoot'](_0x27f5a2);return _0x5857a3&&!this['_knownRootNames']['has'](_0x5857a3);});Z(_0x35badf,this['_document']['version']),this['_applyOperationsSet'](_0x35badf),_0x5dab3e=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xd96a4d=this['_decompressOperations'](_0x132e65['data'],_0x132e65['metadata'])['filter'](_0x612452=>_0x612452['baseVersion']>=this['_lastServerVersion']);_0xd96a4d['forEach'](_0x2e4388=>this['_addKnownRoot'](_0x2e4388)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5df15f=>!_0x5df15f['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5df15f))),this['_bufferedOperations']['length']&&Z(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xd96a4d),_0x5dab3e=this['_handleExternalOperations'](_0xd96a4d,_0x132e65['version'],_0x132e65['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x5dab3e?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x209a52,_0x4e80eb,_0x12e93d){try{const _0x1800cd={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x5e7fb8,operationsB:_0x287db8,originalOperations:_0x4afb70}=_0x333d46(_0x209a52,this['_bufferedOperations'],_0x1800cd);Z(_0x5e7fb8,this['_document']['version']),Z(_0x287db8,_0x4e80eb);for(const _0x124b99 of _0x5e7fb8){const _0x3556cd=_0x4afb70['get'](_0x124b99);_0x124b99['_authorId']=_0x3556cd?_0x3556cd['_authorId']:null;}_0x12e93d&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x209a52,_0x12e93d),this['_lastSyncedOperationId']=_0x12e93d),this['_bufferedOperations']=[..._0x287db8],this['_applyOperationsSet'](_0x5e7fb8),this['_updateServerHistory'](_0x209a52);}catch(_0xf45c46){return console['error'](_0xf45c46),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4072bf,_0x3a65f6=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3c5602=>{for(const _0x21adf1 of _0x4072bf)this['_knownOperations']['add'](_0x21adf1),this['_addKnownRoot'](_0x21adf1),_0x3c5602['batch']['addOperation'](_0x21adf1),this['editor']['model']['applyOperation'](_0x21adf1);});}['_addKnownRoot'](_0xfb9ed3){const _0x161549=this['_getAffectedRoot'](_0xfb9ed3);_0x161549&&this['_knownRootNames']['add'](_0x161549);}['_getAffectedRoot'](_0x29967a){let _0x2f8e96,_0x518b99;switch(_0x29967a['type']){case'insert':_0x2f8e96=_0x29967a['position']['root'];break;case'marker':if(_0x518b99=_0x29967a['newRange'],!_0x518b99)return null;_0x2f8e96=_0x518b99['root'];break;case'addRootAttribute':_0x2f8e96=_0x29967a['root'];break;case'addRoot':_0x2f8e96=_0x29967a['affectedSelectable'];break;case'move':_0x2f8e96=_0x29967a['targetPosition']['root'];break;default:return null;}return _0x2f8e96['rootName'];}['_updateServerHistory'](_0x54fd6){_0x54fd6['forEach'](_0x5f5c57=>{const _0x5ae278=_0x5f5c57['clone']();_0x5ae278['_authorId']=_0x5f5c57['_authorId'],_0x5ae278['_isInit']=!!_0x5f5c57['_isInit'],_0x5ae278['createdAt']=_0x5f5c57['createdAt'],_0x5ae278['baseVersion']+=this['_offset'],_0x5f5c57['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5ae278),this['serverHistory']['addOperation'](_0x5ae278);});}['_handleReconnectionError'](_0x5bde53){const _0x14d311=this['editor']['plugins']['get']('Notification'),_0xefcf69=this['editor']['locale'];_0x5bde53||(_0x5bde53=K(_0xefcf69,'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.')),_0x14d311['showWarning'](_0x5bde53,{'title':K(_0xefcf69,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x5f3c56)['add'](K(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x5f3c56)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0xc0171){const _0x28826f=_0xc0171['map'](_0x1b497f=>_0x1b497f['toJSON']());return this['_compressor']['compress'](_0x28826f);}['_decompressOperations'](_0x299df3,_0x12a935){return this['_compressor']['decompress'](_0x299df3)['map']((_0x5c6c1b,_0x41cdd9)=>{const _0x5869af='init'==_0x12a935[_0x41cdd9]['type'];if('InsertOperation'==_0x5c6c1b['__className']){const _0x27e11f=_0x5c6c1b['position']['root'];!this['_document']['getRoot'](_0x27e11f)&&(this['_document']['createRoot']('$root',_0x27e11f)['_isAttached']=!0x1);}const _0x1e2d46=_0x1e5ce3['fromJSON'](_0x5c6c1b,this['_document']);return _0x1e2d46['wasUndone']=_0x5c6c1b['wasUndone'],_0x1e2d46['_isInit']=_0x5869af,_0x1e2d46['_authorId']=_0x5869af?null:_0x12a935[_0x41cdd9]['userId'],_0x1e2d46['_isDisconnection']='cs:removeUser'===_0x12a935[_0x41cdd9]['type'],_0x1e2d46['createdAt']=_0x12a935[_0x41cdd9]['createdAt'],_0x1e2d46;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x386c3e=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x386c3e&&_0x386c3e['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Y extends Error{}function Z(_0x296eff,_0x28fb96){for(const _0x3cbc2c of _0x296eff)_0x3cbc2c['baseVersion']=_0x28fb96++;}class tt{['_ignoredOperations'];['_operationToId'];constructor(_0x27654c){this['_ignoredOperations']=_0x27654c,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x534bb6){let _0x15f096=_0x534bb6['length'];for(;_0x15f096--;){const _0x5384b8=_0x534bb6[_0x15f096];if(!this['_ignoredOperations']['has'](_0x5384b8)){if(!this['_operationToId']['has'](_0x5384b8)){const _0x297e37=_0x15de89()['slice'](0x1,0x12);this['_operationToId']['set'](_0x5384b8,_0x297e37);}return this['_operationToId']['get'](_0x5384b8);}}}['setIdForTheLastOperation'](_0x4cb6d6,_0x1b1f57){if(!_0x1b1f57)return;let _0x4a91a2=_0x4cb6d6['length'];for(;_0x4a91a2--;){const _0x556318=_0x4cb6d6[_0x4a91a2];this['_ignoredOperations']['has'](_0x556318)||this['_operationToId']['set'](_0x556318,_0x1b1f57);}}}class a extends _0x2ba0b9{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x304859{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x4aac09)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x4ac0c1];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b9221){super(_0x1b9221),this['_services']=new Map();}async['init'](){const _0x133985=this['context'],_0x204471=_0x133985['plugins']['get']('CommentsRepository');if(_0x133985['plugins']['get'](n)['addToReconnectionStack'](this),_0x204471['adapter']={'addCommentThread':async({channelId:_0x3fd4fc,threadId:_0x560193,comments:_0x3810b0,resolvedAt:_0x3ede7b,resolvedBy:_0x3a04f5,context:_0x13f9e7,attributes:_0x5db986})=>{const _0x22ef46=await this['_getService'](_0x3fd4fc)['addCommentThread']({'commentThreadId':_0x560193,'comments':_0x3810b0['map'](_0x15e8c6=>function(_0xeee31a,_0x3339ec,_0x2d8b82){return{'commentThreadId':_0x2d8b82,'commentId':_0xeee31a['commentId'],'userId':_0xeee31a['authorId'],'content':_0xeee31a['content'],'documentId':_0x3339ec,'createdAt':_0xeee31a['createdAt'],'attributes':_0xeee31a['attributes']||{}};}(_0x15e8c6,_0x3fd4fc,_0x560193)),'resolvedAt':_0x3ede7b,'resolvedBy':_0x3a04f5,'context':_0x13f9e7,'attributes':_0x5db986})['catch'](at);return{'threadId':_0x22ef46['commentThreadId'],'comments':_0x22ef46['comments']};},'getCommentThread':async({channelId:_0x3c8b21,threadId:_0xf818b2})=>{const _0x3f4f43=await this['_getService'](_0x3c8b21)['getCommentThread'](_0xf818b2)['catch'](F)['catch'](at);return _0x3f4f43?_0x3f4f43['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x3f4f43]),{'threadId':_0x3f4f43['commentThreadId'],'comments':_0x3f4f43['comments']['map'](S),'context':_0x3f4f43['context'],'resolvedAt':_0x3f4f43['resolvedAt'],'resolvedBy':_0x3f4f43['resolvedBy'],'attributes':_0x3f4f43['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3c3536,threadId:_0x26638c,context:_0x57741b,unlinkedAt:_0x50a43b,attributes:_0x41af1e})=>this['_getService'](_0x3c3536)['updateCommentThread']({'commentThreadId':_0x26638c,'context':_0x57741b,'attributes':_0x41af1e,'unlinkedAt':_0x50a43b})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x4e99af,threadId:_0x16f410})=>{const _0x3a1492=await this['_getService'](_0x4e99af)['resolveCommentThread'](_0x16f410)['catch'](F)['catch'](at);return{'threadId':_0x3a1492['commentThreadId'],'resolvedAt':_0x3a1492['resolvedAt'],'resolvedBy':_0x3a1492['resolvedBy']};},'reopenCommentThread':async({channelId:_0x23ca11,threadId:_0x49332c})=>this['_getService'](_0x23ca11)['reopenCommentThread'](_0x49332c)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x154292,threadId:_0x36b4aa})=>this['_getService'](_0x154292)['removeCommentThread'](_0x36b4aa)['catch'](F)['catch'](at),'addComment':({channelId:_0x598f6b,threadId:_0x2e641e,commentId:_0x3e121e,content:_0x24d81a,attributes:_0x5efffe})=>this['_getService'](_0x598f6b)['addComment'](_0x2e641e,_0x3e121e,_0x24d81a,_0x5efffe)['catch'](at),'updateComment':({channelId:_0x4a786c,threadId:_0x25d710,commentId:_0x3cb231,content:_0x5e16a8,attributes:_0x5aa848})=>this['_getService'](_0x4a786c)['updateComment'](_0x25d710,_0x3cb231,_0x5e16a8,_0x5aa848)['catch'](F)['catch'](at),'removeComment':({channelId:_0x46944f,threadId:_0x1c3e7f,commentId:_0x484ef7})=>this['_getService'](_0x46944f)['removeComment'](_0x1c3e7f,_0x484ef7)['catch'](F)['catch'](at)},_0x133985 instanceof _0x36a098){const _0x3f4eb7=_0x133985['config']['get']('collaboration.channelId'),_0x14d275=_0x133985['plugins']['get'](i);await this['_setUpService'](_0x3f4eb7);const _0x362dce=await this['_services']['get'](_0x3f4eb7)['getConnectedSessions']();this['listenTo'](_0x14d275,'sessionAdd:'+_0x3f4eb7,(_0x37033b,{session:_0x4b1ce6})=>{_0x4b1ce6['id']===_0x14d275['mySessionId']&&(_0x37033b['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4b1ce6['permissions'],_0x3f4eb7));}),_0x14d275['register'](_0x3f4eb7,_0x362dce);}}async['_setUpService'](_0x8e7c96){if(this['_services']['has'](_0x8e7c96))throw new _0x48cb43('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x8e7c96});const _0x50cba5=this['context']['plugins']['get']('CommentsRepository'),_0x2cfd06=new s['CommentsService'](_0x8e7c96);this['_services']['set'](_0x8e7c96,_0x2cfd06),this['listenTo'](_0x2cfd06,'commentThreadAdded',(_0x4681c5,_0x4c8629)=>{const {commentThreadId:_0x5dfecc,documentId:_0x2db812,context:_0x498182,attributes:_0x254fa2,resolvedAt:_0x415340,resolvedBy:_0x4d986a,comments:_0x449fb0}=_0x4c8629;_0x50cba5['getCommentThread'](_0x5dfecc)||_0x50cba5['addCommentThread']({'threadId':_0x5dfecc,'channelId':_0x2db812,'comments':_0x449fb0?_0x449fb0['map'](S):[],'context':_0x498182,'attributes':_0x254fa2,'resolvedAt':_0x415340,'resolvedBy':_0x4d986a,'isFromAdapter':!0x0});}),this['listenTo'](_0x2cfd06,'commentThreadUpdated',(_0x559ddf,{commentThreadId:_0x55ace3,documentId:_0x2c7560,context:_0x1f1071,unlinkedAt:_0x266c82,attributes:_0xd65e2b})=>{_0x50cba5['getCommentThread'](_0x55ace3)&&_0x50cba5['updateCommentThread']({'threadId':_0x55ace3,'channelId':_0x2c7560,'context':_0x1f1071,'unlinkedAt':_0x266c82,'attributes':_0xd65e2b,'isFromAdapter':!0x0});}),this['listenTo'](_0x2cfd06,'commentThreadResolved',(_0x58c172,{commentThreadId:_0x21ee9d,resolvedBy:_0x581ff5,resolvedAt:_0x363fbc})=>{const _0xa6778b=_0x50cba5['getCommentThread'](_0x21ee9d);_0xa6778b&&_0xa6778b['resolve']({'resolvedBy':_0x581ff5,'resolvedAt':_0x363fbc,'isFromAdapter':!0x0});}),this['listenTo'](_0x2cfd06,'commentThreadReopened',(_0x292f87,{commentThreadId:_0x3854c1})=>{const _0x51afd9=_0x50cba5['getCommentThread'](_0x3854c1);_0x51afd9&&_0x51afd9['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x2cfd06,'commentThreadRemoved',(_0x2e0c5f,{commentThreadId:_0x46c2bb})=>{const _0x1a2847=_0x50cba5['getCommentThread'](_0x46c2bb);_0x1a2847&&_0x1a2847['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x2cfd06,'commentAdded',(_0xa1539f,_0x147d54)=>{const _0x26a7b5=_0x147d54['commentThreadId'],_0x4c9671=_0x50cba5['getCommentThread'](_0x26a7b5);_0x4c9671&&_0x4c9671['addComment']({...S(_0x147d54),'isFromAdapter':!0x0});}),this['listenTo'](_0x2cfd06,'commentUpdated',(_0x3a19c1,{commentThreadId:_0x93ede9,commentId:_0x51bc5b,content:_0x43c8d2,attributes:_0x4fda3c})=>{const _0x7be6e7=_0x50cba5['getCommentThread'](_0x93ede9);if(_0x7be6e7){const _0x1ace81=_0x7be6e7['getComment'](_0x51bc5b);_0x1ace81&&_0x1ace81['update']({'content':_0x43c8d2,'attributes':_0x4fda3c,'isFromAdapter':!0x0});}}),this['listenTo'](_0x2cfd06,'commentRemoved',(_0xbd5e60,{commentThreadId:_0x6ce711,commentId:_0x258cb6})=>{const _0x1a136e=_0x50cba5['getCommentThread'](_0x6ce711);if(_0x1a136e){const _0x5db3de=_0x1a136e['getComment'](_0x258cb6);_0x5db3de&&_0x5db3de['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x8e7c96);}['destroy'](){if(this['context']instanceof _0x36a098){const _0x35329a=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x35329a);}}['_terminateService'](_0x44c81a){if(!this['_services']['has'](_0x44c81a))throw new _0x48cb43('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x44c81a});this['_getService'](_0x44c81a)['disconnect'](),this['_services']['delete'](_0x44c81a);}async['reconnect'](){for(const _0x496f62 of this['_services']['keys']())await this['_connectService'](_0x496f62);if(this['context']instanceof _0x36a098){const _0x1f8cde=this['context']['config']['get']('collaboration.channelId'),_0x24c4f1=this['context']['plugins']['get'](i);_0x24c4f1['unregister'](_0x1f8cde);const _0x352198=await this['_services']['get'](_0x1f8cde)['getConnectedSessions']();_0x24c4f1['register'](_0x1f8cde,_0x352198);}}async['_connectService'](_0x3c7377){const {connection:_0x582d90}=this['context']['plugins']['get'](n),_0x5a3478=this['context']['plugins']['get']('CommentsRepository'),_0x4a3c8c=this['_services']['get'](_0x3c7377),_0x3e8a60=await _0x4a3c8c['connect'](_0x582d90);await this['_fetchMissingUsersForThreads'](_0x3e8a60);const _0x44a5e9=new Set(Array['from'](_0x5a3478['getCommentThreads']({'channelId':_0x3c7377}),_0x252798=>_0x252798['id']));for(const _0x3c9b6b of _0x3e8a60)_0x3c9b6b['deletedAt']||_0x44a5e9['delete'](_0x3c9b6b['commentThreadId']);for(const _0x531a24 of _0x44a5e9)_0x5a3478['getCommentThread'](_0x531a24)['remove']({'isFromAdapter':!0x0});for(const _0x140eba of _0x3e8a60){let _0xa2eda5=_0x5a3478['getCommentThread'](_0x140eba['commentThreadId']);const {commentThreadId:_0x35061a,context:_0x301e70,attributes:_0x418986,resolvedBy:_0x1f1ce7,resolvedAt:_0x40ff91,unlinkedAt:_0x4be422,deletedAt:_0x588f60}=_0x140eba;if(_0x588f60)continue;_0xa2eda5||(_0xa2eda5=_0x5a3478['addCommentThread']({'channelId':_0x3c7377,'threadId':_0x35061a,'context':_0x301e70,'attributes':_0x418986||{},'resolvedBy':_0x1f1ce7,'resolvedAt':_0x40ff91,'unlinkedAt':_0x4be422,'isFromAdapter':!0x0}));const _0x204f7b=new Set(Array['from'](_0xa2eda5['comments'],_0x2d2b01=>_0x2d2b01['id']));for(const _0x1cb313 of _0x140eba['comments'])_0x204f7b['delete'](_0x1cb313['commentId']);for(const _0x774925 of _0x204f7b)_0xa2eda5['getComment'](_0x774925)['remove']({'isFromAdapter':!0x0});for(const _0x230181 of _0x140eba['comments']){const _0x36deac=_0xa2eda5['getComment'](_0x230181['commentId']);_0x36deac?_0x36deac['content']!==_0x230181['content']&&_0x36deac['update']({'content':_0x230181['content'],'isFromAdapter':!0x0}):_0xa2eda5['addComment'](Object['assign'](S(_0x230181),{'isFromAdapter':!0x0}));}}}['_getService'](_0x544bdc){if(!this['_services']['has'](_0x544bdc))throw new _0x48cb43('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x544bdc});return this['_services']['get'](_0x544bdc);}async['_fetchMissingUsersForThreads'](_0x4f1b9f){const _0xe01ad5=this['context']['plugins']['get'](_0x4ac0c1),{connection:_0x3f5e22}=this['context']['plugins']['get'](n),_0x28c450=new Set();for(const {resolvedBy:_0x27935a,comments:_0x5a5aad}of _0x4f1b9f){_0x27935a&&!_0xe01ad5['getUser'](_0x27935a)&&_0x28c450['add'](_0x27935a);for(const {userId:_0x41bc2a}of _0x5a5aad)_0xe01ad5['getUser'](_0x41bc2a)||_0x28c450['add'](_0x41bc2a);}if(0x0===_0x28c450['size'])return;const _0x292024=await ct['getMany'](_0x3f5e22,Array['from'](_0x28c450));for(const _0xaa35a7 of _0x292024)_0xe01ad5['getUser'](_0xaa35a7['id'])||_0xe01ad5['addUser'](_0xaa35a7);}}async function F(_0x416832){if('404'!==_0x416832['code'])throw _0x416832;}function at(_0x1cb356){if((_0x21b1fc=_0x1cb356)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x21b1fc['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x21b1fc['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x21b1fc;throw _0x1cb356;}function S(_0xa2edd7){return{'threadId':_0xa2edd7['commentThreadId'],'commentId':_0xa2edd7['commentId'],'content':_0xa2edd7['content'],'createdAt':_0xa2edd7['createdAt'],'authorId':_0xa2edd7['userId'],'attributes':_0xa2edd7['attributes']||{}};}class m extends _0x2ba0b9{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x448da6)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x4ac0c1];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x6e94c2){super(_0x6e94c2);const _0x2dd359=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x2dd359);}async['init'](){const _0x2718a6=this['editor']['plugins']['get'](l),_0xe0fead=_0x2718a6['serverHistory'],_0x11756f=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xe0fead,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x2718a6['sessionId']});const _0x514aef=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x5fa1a0=await _0x336f99['isBundleUploaded'](_0x11756f['connection'],_0x514aef);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x4502f5})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4502f5)),'updateRevisions':async _0x2fb3ae=>{await this['_waitForServiceReady']();const _0xfe0be7=this['_revisionTracker']['currentRevision'];if(_0x5fa1a0&&0x1===_0x2fb3ae['length']&&_0x2fb3ae[0x0]['id']===_0xfe0be7['id'])return _0x2fb3ae;for(const _0x4d2c24 of _0x2fb3ae)_0x4d2c24['id']===_0xfe0be7['id']&&(_0x4d2c24['isEmptyCurrent']=_0x4d2c24['fromVersion']===_0x4d2c24['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x2fb3ae,this['_lastRequestId'])['then'](_0x2fd269=>(this['_lastRequestId']=_0x2fd269,_0x2fb3ae))['catch'](_0x527e40=>{if(q(_0x527e40)||'400'===_0x527e40['code']&&void 0x0!==_0x527e40['data']['wrongRequestId']){for(const _0x525b8e of _0x2fb3ae){!this['_revisionTracker']['repository']['getRevision'](_0x525b8e['id'])||this['_revisionTracker']['_bufferUpdate'](_0x525b8e['id'],_0x525b8e,!0x1);}if(q(_0x527e40))throw _0x527e40;return _0x2fb3ae;}throw _0x527e40;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x26ce47,{revisionsData:_0x32e9da,requestId:_0x11d6f6})=>{Math['max'](..._0x32e9da['map'](_0x3b822e=>_0x3b822e['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x32e9da,_0x11d6f6);}):this['_handleRevisionsUpdate'](_0x32e9da,_0x11d6f6);});const {revisions:_0x305415,requestId:_0xd9678a}=await this['_revisionHistoryService']['connect'](_0x11756f['connection']);_0x11756f['addToReconnectionStack'](this),this['_lastRequestId']=_0xd9678a,await this['_fetchMissingUsers'](_0x305415);for(const _0x24289e of _0x305415)this['_revisionTracker']['addRevisionData'](_0x24289e);this['listenTo'](_0x2718a6,'change:_isConnected',(_0x536c20,_0x36e5b2,_0x84ff44)=>{_0x84ff44&&(this['_oldOffset']=_0x2718a6['_offset'],_0x536c20['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x11756f,'state',_0x38cb67=>_0x38cb67===_0x434220['CONNECTED']);}async['reconnect'](){const _0x51fcd4=this['editor']['plugins']['get'](n),_0x35c000=this['editor']['plugins']['get'](l),_0x226f6b=async()=>{const _0x291139=this['_revisionTracker']['currentRevision'],_0x41c290=_0x291139['id'],_0x45384c=_0x41c290!==_0x35c000['sessionId'];if(_0x45384c){const _0x467b47=_0x35c000['_offset']-this['_oldOffset'],_0xca484f=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x291139['toVersion']+_0x467b47!==_0xca484f){const _0x36a83d=_0x291139['fromVersion']+_0x467b47,_0x964f44=this['editor']['plugins']['get'](_0x4ac0c1),_0x44b5d7=this['_revisionTracker']['buildRevisionData']({'revision':_0x291139,'from':_0x36a83d,'to':_0xca484f});_0x44b5d7['id']=_0x291139['id'];const _0x29796b=_0x44b5d7['authorsIds']['map'](_0x3cc583=>_0x964f44['getUser'](_0x3cc583));_0x291139['_update']({..._0x44b5d7,'authors':_0x29796b},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x291139['id'],_0x44b5d7,!0x0);}this['_revisionTracker']['_startingVersion']=_0xca484f,(_0x291139['toVersion']===_0x291139['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x41c290)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x41c290),this['_revisionTracker']['_createCurrentRevision'](_0xca484f));}const {revisions:_0x5db0f5,requestId:_0x1bc0d2}=await this['_revisionHistoryService']['reconnect'](_0x51fcd4['connection'],this['_lastRequestId']);_0x45384c&&_0x5db0f5['length']>0x0?_0x35c000['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x5db0f5),this['_handleRevisionsUpdate'](_0x5db0f5,_0x1bc0d2),this['_revisionTracker']['sendBufferedUpdates']());};return _0x35c000['_isConnected']?_0x226f6b():new Promise((_0x5124a3,_0x4884ba)=>{_0x35c000['once']('change:_isConnected',()=>{_0x226f6b()['then'](_0x5124a3)['catch'](_0x4884ba);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x270de5=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0xb8903f=>{_0xb8903f['off'](),_0x270de5();});});}['_getLatestVersionFromServerOperations'](){const _0x15c6b4=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x4e6949 of _0x15c6b4)if('marker'!==_0x4e6949['type']||_0x4e6949['affectsData'])return _0x4e6949['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1c043e=this['editor']['plugins']['get'](l);return new Promise(_0xd59aa6=>{_0x1c043e['_isPendingUpdate']?_0x1c043e['once']('change:_isPendingUpdate',()=>{_0xd59aa6(this['_getLatestVersionFromServerOperations']());}):_0xd59aa6(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3302e4,_0x572125){const _0x5843fc=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x572125;for(const _0x325a36 of _0x3302e4){const _0xef7f01=_0x5843fc['getRevision'](_0x325a36['id']);if(_0xef7f01){if((_0x325a36['fromVersion']||_0x325a36['toVersion'])&&(_0x325a36['diffData']=null),_0xef7f01===this['_revisionTracker']['currentRevision']){const _0x3c1c8c=Math['max'](_0xef7f01['toVersion'],_0x325a36['toVersion']),_0x47906c=Math['max'](_0xef7f01['fromVersion'],_0x325a36['fromVersion']);let _0x4ea570;_0xef7f01['toVersion']===_0x325a36['toVersion']&&_0xef7f01['fromVersion']===_0x325a36['fromVersion']?(_0x4ea570=!0x0,this['_preventResendingRevisionData'](_0x325a36)):_0x325a36['toVersion']===_0x3c1c8c&&_0x325a36['fromVersion']===_0x47906c?_0x4ea570=!0x1:(_0xef7f01['toVersion']===_0x3c1c8c&&_0xef7f01['fromVersion']===_0x47906c||this['_fixRevision']({'revision':_0xef7f01,'from':_0x47906c,'to':_0x3c1c8c}),_0x4ea570=!0x0),_0x4ea570&&(delete _0x325a36['fromVersion'],delete _0x325a36['toVersion'],delete _0x325a36['diffData'],delete _0x325a36['createdAt'],delete _0x325a36['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x325a36),this['_preventResendingRevisionData'](_0x325a36);}else this['_revisionTracker']['addRevisionData'](_0x325a36);}const _0x41bef4=_0x5843fc['getRevisions']();_0x41bef4['reverse']();for(let _0x1c01df=0x0;_0x1c01df<_0x41bef4['length']-0x1;_0x1c01df++){const _0x396e28=_0x41bef4[_0x1c01df],_0x36b0a9=_0x41bef4[_0x1c01df+0x1];if(_0x396e28['fromVersion']<_0x36b0a9['toVersion']){const _0x135258=_0x36b0a9['toVersion'],_0x50e86d=Math['max'](_0x135258,_0x396e28['toVersion']);this['_fixRevision']({'revision':_0x396e28,'from':_0x135258,'to':_0x50e86d});}}}['_fixRevision']({revision:_0x286e31,from:_0x8d0c3a,to:_0xf65070}={}){const _0x5626f9=this['editor']['plugins']['get'](_0x4ac0c1),_0xe244d0=this['_revisionTracker']['buildRevisionData']({'revision':_0x286e31,'from':_0x8d0c3a,'to':_0xf65070});_0xe244d0['authors']=_0xe244d0['authorsIds']['map'](_0x37dadb=>_0x5626f9['getUser'](_0x37dadb)),_0x286e31['_update'](_0xe244d0);}['_preventResendingRevisionData'](_0x49e06b){const _0x30d77e={};_0x30d77e['id']=_0x49e06b['id'];for(const _0x2f82d4 of Object['keys'](_0x49e06b))'id'!==_0x2f82d4&&(_0x30d77e[_0x2f82d4]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x30d77e['id'],_0x30d77e,!0x0);}async['_fetchMissingUsers'](_0x2a7af2){const _0x709dd0=this['editor']['plugins']['get'](_0x4ac0c1),{connection:_0x5768d3}=this['editor']['plugins']['get'](n),_0x46f7ae=new Set();for(const _0x5f0daf of _0x2a7af2){for(const _0x518b52 of _0x5f0daf['authorsIds'])_0x257ecf(_0x518b52);_0x5f0daf['creatorId']&&_0x257ecf(_0x5f0daf['creatorId']);}if(0x0===_0x46f7ae['size'])return;const _0x5d2b76=await ct['getMany'](_0x5768d3,Array['from'](_0x46f7ae));for(const _0x28788d of _0x5d2b76)_0x709dd0['getUser'](_0x28788d['id'])||_0x709dd0['addUser'](_0x28788d);function _0x257ecf(_0x3976b8){_0x709dd0['getUser'](_0x3976b8)||_0x46f7ae['add'](_0x3976b8);}}}function q(_0x5bb182){return _0x5bb182['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5bb182['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5bb182['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x2ba0b9{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x16cacd{['_collapseAt'];constructor(_0x1ed019,_0x4333f1=0x6){super(_0x1ed019);const _0x191137=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x4333f1,this['bind']('isHidden')['to'](this,'usersCount',_0x28e628=>_0x28e628<_0x4333f1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x191137['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':_0x191137['to']('usersCount',_0x24fd4d=>'+'+(_0x24fd4d-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x16cacd{['items'];['keystrokes'];constructor(_0x7e13e0){super(_0x7e13e0);const _0x209ba0=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x1341d7(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x209ba0['if']('hasPopup'),'aria-expanded':_0x209ba0['to']('isExpanded',_0x4f96ae=>this['hasPopup']&&String(_0x4f96ae)),'aria-label':_0x209ba0['to']('hasPopup',_0x2e44f6=>K(_0x7e13e0,_0x2e44f6?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x209ba0['to']('hasPopup',_0x399851=>!!_0x399851&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x209ba0['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x209ba0['to'](_0x179827=>{const _0x41513b=_0x179827,_0x1b02ed=document['querySelector']('.ck-presence-list__dropdown-list'),_0x31cb87=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1b02ed?.['contains'](_0x41513b['relatedTarget'])||_0x31cb87?.['contains'](_0x41513b['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x4aa3d1,_0x2916c9,_0x4790ae)=>{this['element']&&(_0x4790ae?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x16cacd{['counterView'];['inlineListView'];constructor(_0x27c97d,_0x3bba89=0x6){super(_0x27c97d);const _0x5dd451=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x3bba89),this['inlineListView']=new is(_0x27c97d),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3e4f2e of this['inlineListView']['items'])_0x3e4f2e['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',_0x5dd451['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x16cacd{['listWrapperView'];constructor(_0x49fecf,_0x10f1f1){super(_0x49fecf);const _0x3d8d80=this['bindTemplate'];this['listWrapperView']=new ut(_0x49fecf,_0x10f1f1),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':K(_0x49fecf,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x3d8d80['to'](_0xe091f6=>{const _0x41508b=_0xe091f6,_0x5191e3=document['querySelector']('.ck-presence-list__list'),_0x1c2f3a=document['querySelector']('.ck-balloon-panel_with-arrow');_0x5191e3?.['contains'](_0x41508b['relatedTarget'])||_0x1c2f3a?.['contains'](_0x41508b['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x1f9671{constructor(_0x2d3328,_0xf1ea1a){super(_0x2d3328);const _0x1d3c71=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xf1ea1a?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1d3c71['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1d3c71['to']('role'),'aria-label':_0x1d3c71['to']('ariaLabel'),'aria-labelledby':_0x1d3c71['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3ffad9['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x24e87c=this['element'];_0x24e87c&&(this['_isScrollable']=Math['max'](_0x24e87c['scrollHeight'],_0x24e87c['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x7c3158,_0x556c10,_0x4825c3){super(_0x7c3158);const _0x516980=this['bindTemplate'];this['userView']=new st(_0x7c3158,_0x556c10);const _0x502b1a={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x556c10['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x556c10['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x556c10['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4825c3&&(_0x502b1a['tag']='button',_0x502b1a['on']={'click':_0x516980['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x502b1a);}['focus'](){this['element']['focus']();}}class A extends _0x16cacd{['userView'];['markerView'];constructor(_0x16b79b,_0x6ebd3a,_0x14432d){super(_0x16b79b);const _0x3dbd51=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x16b79b,_0x6ebd3a),this['markerView']=new ot(_0x16b79b,_0x6ebd3a);const _0x67b2b1=new it(_0x16b79b);_0x67b2b1['template']['tag']='span',_0x67b2b1['text']=_0x6ebd3a['name'];const _0x55678e={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x3dbd51['to']('isFocusable',_0x1154d8=>!!_0x1154d8&&0x0),'aria-labelledby':_0x67b2b1['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x3dbd51['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x3dbd51['to']('hasTooltip',_0x3eb478=>!_0x3eb478),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x67b2b1]};_0x14432d&&(_0x55678e['tag']='button',_0x55678e['on']={'click':_0x3dbd51['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x55678e);}}class ot extends _0x16cacd{constructor(_0x24b811,_0x46e7dc){super(_0x24b811),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x46e7dc['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x304859{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9a2ae){super(_0x9a2ae),this['context']['config']['define']('presenceList',x);const _0x57b408=_0x9a2ae['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x57b408)throw new _0x48cb43('presencelist-collapseat-invalid-format',this);if(_0x57b408<0x1)throw new _0x48cb43('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0xae999c(),this['balloonPanelView']=new _0x26bb68(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x127381 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x127381);this['listenTo'](this['_allConnectedUsers'],'add',(_0x6d497b,_0x31fa76)=>{this['_handleUserAdd'](_0x31fa76);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2ff9bf,_0x52e8c0)=>{this['_handleUserRemove'](_0x52e8c0);});}['_createView'](){const _0x187da2=this['context'],_0xe3779b=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x1b18f5=this['balloonPanelView'];if(!_0x2a834b(_0x187da2['config']['get']('presenceList.container')))throw new _0x48cb43('presencelist-missing-container',this);return _0xe3779b['counterView']['bind']('usersCount')['to'](this),_0xe3779b['bind']('isCollapsed')['to'](this,'usersCount',_0x1c83b9=>{const {collapseAt:_0x3be70e}=_0x187da2['config']['get']('presenceList'),_0xd654d8=_0x1c83b9>=_0x3be70e;if(_0xd654d8&&!_0xe3779b['inlineListView']['items']['find'](_0x39ee62=>_0x39ee62 instanceof b)){const _0x23541b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x23541b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0xe3779b['inlineListView']['items']['add'](_0xe3779b['counterView']);}return _0xd654d8||this['hideDropdown'](),_0xd654d8;}),_0xe3779b['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x36155e=>{const _0x2b82c9=_0x187da2['config']['get']('presenceList'),_0x16620c=new A(_0x187da2['locale'],_0x36155e,!!_0x2b82c9['onClick']);return _0x16620c['bind']('hasTooltip')['to'](_0xe3779b,'isCollapsed',_0x5f01b4=>!_0x5f01b4),_0x16620c['bind']('isFocusable')['to'](_0xe3779b,'isCollapsed',_0x2b6e64=>!_0x2b6e64),_0x2b82c9['onClick']&&this['listenTo'](_0x16620c,'execute',()=>{this['view']['isCollapsed']||_0x2b82c9['onClick'](_0x36155e,_0x16620c['element']);}),_0x16620c;}),this['listenTo'](_0xe3779b['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0xe3779b['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0xe3779b['inlineListView']['keystrokes']['set']('Enter',(_0x38fffd,_0xec6b26)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0xec6b26());}),_0xe3779b['render'](),_0x1b18f5['render'](),_0x1d3428({'emitter':_0xe3779b,'activator':()=>_0x1b18f5['isVisible'],'contextElements':[_0x1b18f5['element'],_0xe3779b['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x187da2['config']['get']('presenceList.container')['appendChild'](_0xe3779b['element']),this['_bodyCollection']=new _0x1f47ad(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0xe3779b;}['_handleUserAdd'](_0x27434d){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x27434d['isMe'])return;const _0x50a1e6=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x50a1e6-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x46e43d=_0x27434d['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x27434d,_0x46e43d);}['_handleUserRemove'](_0x13fdb8){this['usersCount']--;const {collapseAt:_0x562862}=this['context']['config']['get']('presenceList'),_0x5d2da6=this['usersCount']>=_0x562862;if(this['currentDisplayedUsers']['get'](_0x13fdb8['id']))this['currentDisplayedUsers']['remove'](_0x13fdb8['id']);else{if(_0x5d2da6&&this['currentDisplayedUsers']['length']+0x1===_0x562862-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x5d2da6?0x1:0x0)<this['usersCount']){for(const _0x19a0cb of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x19a0cb['id'])&&(this['currentDisplayedUsers']['add'](_0x19a0cb,Math['min'](this['currentDisplayedUsers']['length']-(_0x5d2da6?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x5d2da6?0x1:0x0)===_0x562862-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x36313a=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x36313a['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x18af22}=this['presenceDropdownView'];_0x18af22['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x3802f8=>{if(!_0x36313a['displayMe']&&_0x3802f8['isMe'])return null;const _0x4d6fdf=new j(this['context']['locale'],_0x3802f8,!!_0x36313a['onClick']);return _0x36313a['onClick']&&this['listenTo'](_0x4d6fdf,'execute',()=>{_0x36313a['onClick'](_0x3802f8,_0x4d6fdf['element']);}),_0x4d6fdf;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x18af22['focus'](),_0x18af22['checkIfScrollable']();const _0x522fa8=(_0x2f36a1,_0x13dc13)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x13dc13();};_0x18af22['keystrokes']['set']('Esc',_0x522fa8),_0x18af22['keystrokes']['set']('Shift+Tab',_0x522fa8),_0x18af22['keystrokes']['set']('Tab',(_0x47c439,_0x883a60)=>{!function(_0x43e176){const _0x1021d3=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x54606a=>_0x54606a+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x501c43=[...document['body']['querySelectorAll'](_0x1021d3)]['filter'](_0x80bc28=>_0x80bc28===document['activeElement']||_0x80bc28['offsetWidth']+_0x80bc28['offsetHeight']>0x0)['sort']((_0x46dd7a,_0x1acac8)=>(_0x46dd7a['tabIndex']||0x0)-(_0x1acac8['tabIndex']||0x0)),_0x178d49=_0x501c43['indexOf'](_0x43e176),_0x213d2b=_0x501c43[(_0x178d49+0x1)%_0x501c43['length']];_0x213d2b&&_0x213d2b['focus']();}(this['view']['element']),this['hideDropdown'](),_0x883a60();}),_0x18af22['focusTracker']['add'](this['view']['element']),_0x18af22['focusTracker']['on']('change:isFocused',(_0x1e0433,_0x42f0ab,_0x99b25d)=>{_0x99b25d||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class ft extends _0x304859{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
|
23
|
+
import{ContextPlugin as _0x77b109,Plugin as _0x4216e6,PendingActions as _0x736766,Context as _0x297d04}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x89c488,CKEditorError as _0x2c6f5e,Collection as _0x130090,global as _0x394bfc,version as nt,uid as _0x1f53b8,KeystrokeHandler as _0x2cea49}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x47f2c1,View as _0x1f794e,ListView as _0x5c2ac1,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x3b1622,clickOutsideHandler as _0x36837a,BodyCollection as _0xd9147d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x372fd9,History as _0x5d359f,NoOperation as _0x5301fb,InsertOperation as _0x4091fe,MarkerOperation as _0x24b5ac,RootAttributeOperation as _0x2e17b6,transformOperationSets as _0x568b8c,OperationFactory as _0xb3bcba}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x50807a,User as lt,CommentsService as _0x3e3b54,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x328575,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0xf671e3}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x2dfc6f}from'es-toolkit/compat';class n extends _0x77b109{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x47f2c1];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39c199){super(_0x39c199),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x89c488())();}['init'](){const _0x205b67=this['context'],_0x5f29f3=_0x205b67['plugins']['get']('CloudServices'),_0x58fab5=_0x205b67['plugins']['get'](_0x47f2c1);if(!_0x5f29f3['token'])throw new _0x2c6f5e('websocketgateway-missing-token',this);if(!_0x5f29f3['webSocketUrl'])throw new _0x2c6f5e('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x5f29f3['token'],_0x5f29f3['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2684dc=>{if(this['connection']=_0x2684dc,this['bind']('state')['to'](_0x2684dc,'state',this,'_isBrowserOffline',(_0x48ea71,_0x27f9bf)=>('connected'!==_0x48ea71&&(this['_shouldPluginsReconnect']=!0x0),_0x27f9bf||_0x48ea71!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x7215a9,_0x5bfd1e)=>{if('limitExceeded'!==_0x5bfd1e['code'])throw console['error'](_0x5bfd1e),new _0x2c6f5e('cloudservices-init',null,{'originalError':_0x5bfd1e});_0x58fab5['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'});}),!_0x2684dc['me'])return new Promise(_0x3815de=>_0x2684dc['on']('change:me',_0x3815de));})['catch'](_0x1a933f=>{throw console['error'](_0x1a933f),new _0x2c6f5e('cloudservices-init',null,{'originalError':_0x1a933f});});}['addToReconnectionStack'](_0x313900){if('function'!=typeof _0x313900['reconnect'])throw new _0x2c6f5e('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x313900))throw new _0x2c6f5e('websocketgateway-plugin-already-registered',this,{'name':_0x313900['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x313900);}['removeFromReconnectionStack'](_0x25c02d){this['_reconnectionStack']['delete'](_0x25c02d);}['isInReconnectionStack'](_0x5e31c1){return this['_reconnectionStack']['has'](_0x5e31c1);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x20caa2=>_0x20caa2['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x54dc01=>{throw console['error'](_0x54dc01),new _0x2c6f5e('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x77b109{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x328575];}constructor(_0xd2eb33){super(_0xd2eb33),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x130090(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x328575);}['init'](){const _0x40c062=this['context']['plugins']['get'](n);this['listenTo'](_0x40c062,'change:state',(_0x59ce55,_0x48f848,_0x116f49)=>{if('connected'!==_0x116f49)this['channelSessions']['forEach'](_0x508065=>_0x508065['clear']()),this['channelConnectedUsers']['forEach'](_0x428bb9=>_0x428bb9['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x48f39b,_0x39e74d]of this['_registeredSessions'])for(const _0x1c640a of _0x39e74d)this['_handleSessionAdd'](_0x48f39b,_0x1c640a);}}),this['_createUser'](_0x40c062['connection']['me'],!0x0);}['register'](_0x483620,_0x1ea33e){if(this['_registeredSessions']['has'](_0x483620))throw new _0x2c6f5e('sessions-register-already-registered',null,{'channelId':_0x483620});this['_registeredSessions']['set'](_0x483620,_0x1ea33e),this['channelSessions']['set'](_0x483620,new _0x130090()),this['channelConnectedUsers']['set'](_0x483620,new _0x130090()),this['listenTo'](_0x1ea33e,'add',(_0x2e70d8,_0x4694ee)=>this['_handleSessionAdd'](_0x483620,_0x4694ee)),this['listenTo'](_0x1ea33e,'remove',(_0x4bae58,_0x33d27e)=>this['_handleSessionRemove'](_0x483620,_0x33d27e));for(const _0x2426e5 of _0x1ea33e)this['_handleSessionAdd'](_0x483620,_0x2426e5);}['unregister'](_0x44b97e){if(!this['_registeredSessions']['has'](_0x44b97e))throw new _0x2c6f5e('sessions-unregister-not-exist',null,{'channelId':_0x44b97e});const _0x2ae140=this['_registeredSessions']['get'](_0x44b97e);this['stopListening'](_0x2ae140);for(const _0x562ed4 of _0x2ae140)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x44b97e,_0x562ed4);this['_registeredSessions']['delete'](_0x44b97e),this['channelSessions']['delete'](_0x44b97e),this['channelConnectedUsers']['delete'](_0x44b97e);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x128fe9){for(const _0xdb8f6f of this['channelSessions']['values']())for(const _0x315f3d of _0xdb8f6f)if(_0x315f3d['id']===_0x128fe9)return _0x315f3d['user'];}['getUserSessions'](_0x1fcbb2,_0x1bf517){const _0x21397b=_0x1bf517?[this['channelSessions']['get'](_0x1bf517)]:this['channelSessions']['values'](),_0x111937=new Set();for(const _0x156227 of _0x21397b)for(const _0x425826 of _0x156227)_0x425826['user']['id']===_0x1fcbb2['id']&&_0x111937['add'](_0x425826['id']);return _0x111937;}['getUserRole'](_0x4eebb1){for(const _0x425fe1 of this['channelSessions']['values']())for(const _0x1268c6 of _0x425fe1)if(_0x1268c6['user']===_0x4eebb1)return _0x1268c6['role'];}['_handleSessionAdd'](_0x5f0c38,_0x33298b){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x4a2132=_0x33298b['user'],_0x2ddfe7=this['_users']['getUser'](_0x4a2132['id'])||this['_createUser'](_0x4a2132),_0x8b3ded=Object['assign']({},_0x33298b,{'user':_0x2ddfe7});if(this['channelSessions']['get'](_0x5f0c38)['add'](_0x8b3ded),!_0x4a2132['hiddenInPresenceList']){const _0x203f87=this['channelConnectedUsers']['get'](_0x5f0c38);_0x203f87['has'](_0x2ddfe7['id'])||_0x203f87['add'](_0x2ddfe7),this['allConnectedUsers']['has'](_0x2ddfe7['id'])||_0x4a2132['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x2ddfe7,_0x2ddfe7['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x5f0c38,{'channelId':_0x5f0c38,'session':_0x8b3ded});}['_handleSessionRemove'](_0x78d7c9,_0x592cc4){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x10a399=this['channelConnectedUsers']['get'](_0x78d7c9),_0x36d70c=_0x592cc4['user'];_0x36d70c['id']&&(this['channelSessions']['get'](_0x78d7c9)['remove'](_0x592cc4['id']),_0x10a399['has'](_0x36d70c['id'])&&!this['getUserSessions'](_0x36d70c,_0x78d7c9)['size']&&_0x10a399['remove'](_0x36d70c['id']),this['allConnectedUsers']['get'](_0x36d70c['id'])&&!this['getUserSessions'](_0x36d70c)['size']&&this['allConnectedUsers']['remove'](_0x36d70c['id']));}['_createUser'](_0x323171,_0x5be5c6){const _0x5d3bbc=this['_users']['addUser'](_0x323171);return _0x5be5c6&&this['_users']['defineMe'](_0x323171['id']),_0x5d3bbc['orderNumber']=this['_uniqueUsersCount']++,_0x5d3bbc;}}class V extends _0x4216e6{['_domEmitter']=new(_0x89c488())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1b1a62=this['editor'],_0x5334fe=_0x1b1a62['plugins']['get'](i);_0x1b1a62['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x155158,{writer:_0x1122be})=>function(_0x2ffed4,_0x4f346f,_0x287a1f,_0x206b66){const _0x35677a=_0x2ffed4['markerName']['split'](':')[0x2],_0x552d4a=_0x287a1f['getUserBySessionId'](_0x35677a);if(!_0x552d4a||_0x35677a===_0x287a1f['mySessionId'])return;if(!_0x206b66['model']['schema']['checkChild'](_0x2ffed4['markerRange']['start'],'$text'))return;const _0x52cb19={'class':'ck-user__marker\x20'+_0x552d4a['color']['getMarkerClass'](),'data-name':_0x552d4a['name'],'data-session-id':_0x35677a},_0x33d445=_0x206b66['model']['markers']['get'](_0x2ffed4['markerName']),_0x20c87e=_0x33d445['getStart'](),_0x191aae=_0x20c87e['nodeAfter'],_0x34eb19=_0x206b66['model']['schema'];if(_0x191aae&&_0x34eb19['isObject'](_0x191aae)&&_0x34eb19['isInline'](_0x191aae)&&!_0x206b66['model']['markers']['get']('user:range:'+_0x35677a)['getRange']()['isCollapsed'])return;const _0x251650=_0x20c87e['parent'];return _0x206b66['model']['schema']['isLimit'](_0x251650)&&!_0x206b66['model']['hasContent'](_0x251650)&&(_0x52cb19['contenteditable']=!0x1),function(_0x59642f,_0xbba189,_0x57231c){const _0x1d54ca=_0x59642f['createUIElement']('span',_0xbba189);return _0x59642f['setCustomProperty']('userPositionMarker',!0x0,_0x1d54ca),_0x1d54ca['render']=function(_0x10a19d){const _0x458412=this['toDomElement'](_0x10a19d),_0x386c92=document['createElement']('span');return _0x386c92['classList']['add']('ck-user__marker-tooltip'),_0x386c92['setAttribute']('contenteditable','false'),_0x386c92['setAttribute']('spellcheck','false'),_0x386c92['textContent']=_0x57231c['name'],_0x458412['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x386c92['outerHTML']+'',_0x458412['addEventListener']('mouseenter',()=>{_0x458412['classList']['add']('ck-user__marker_hovered');}),_0x458412['addEventListener']('mouseleave',()=>{_0x458412['classList']['remove']('ck-user__marker_hovered');}),_0x458412;},_0x1d54ca['isSimilar']=function(_0x3f9c48){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3f9c48['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3f9c48['getAttribute']('data-session-id'));},_0x1d54ca;}(_0x4f346f,_0x52cb19,_0x552d4a);}(_0x155158,_0x1122be,_0x5334fe,_0x1b1a62)}),_0x1b1a62['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4f8561=>function(_0x3f4c71,_0x2520a8){const _0x3e9c91=_0x3f4c71['markerName']['split'](':')[0x2];if(_0x3e9c91===_0x2520a8['mySessionId'])return null;const _0x36e84a=_0x2520a8['getUserBySessionId'](_0x3e9c91);if(!_0x36e84a)return{'id':_0x3e9c91,'classes':[]};return{'id':_0x3e9c91,'classes':['ck-user__selection',_0x36e84a['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3e9c91},'priority':0x7d0+_0x36e84a['orderNumber']};}(_0x4f8561,_0x5334fe)}),function(_0x563863){const _0x45ba46=_0x563863['model'],_0x243f8a=new Map(),_0x2fa2c3=_0x563863['plugins']['get'](i);_0x45ba46['markers']['on']('update:user:range',(_0x5c9f2b,_0x2f26ab,_0x4f9b11,_0x1263c6)=>{if(!_0x1263c6&&_0x243f8a['get'](_0x2f26ab['name']))return _0x243f8a['get'](_0x2f26ab['name'])['detach'](),void _0x243f8a['delete'](_0x2f26ab['name']);const _0x4980f9=_0x2f26ab['name']['split'](':')[0x2];if(_0x4980f9===_0x2fa2c3['mySessionId'])return;const _0x4dc6c1='user:position:'+_0x4980f9;_0x45ba46['markers']['has'](_0x4dc6c1)&&_0x563863['editing']['reconvertMarker'](_0x4dc6c1),_0x2f26ab['on']('change:range',(_0x2d39dd,_0x180b0e,_0x4a21ff)=>{if('$graveyard'!=_0x180b0e['root']['rootName']&&'$graveyard'==_0x2f26ab['getRange']()['root']['rootName']&&!_0x243f8a['has'](_0x2f26ab['name'])){const _0x33ed74=_0x45ba46['schema']['getNearestSelectionRange'](_0x4a21ff['deletionPosition']);if(_0x33ed74){const _0x491b51=_0x372fd9['fromRange'](_0x33ed74);_0x243f8a['set'](_0x2f26ab['name'],_0x491b51),_0x491b51['on']('change:range',(_0x3f6eb3,_0x48a5a6,_0x1f7ed2)=>{if('$graveyard'==_0x491b51['root']['rootName']){const _0xa75379=_0x45ba46['schema']['getNearestSelectionRange'](_0x1f7ed2['deletionPosition']);_0xa75379?(_0x491b51['start']=_0xa75379['start'],_0x491b51['end']=_0xa75379['end']):(_0x243f8a['delete'](_0x2f26ab['name']),_0x491b51['detach']());}});}}});}),_0x45ba46['document']['on']('change',()=>{_0x243f8a['size']>0x0&&_0x45ba46['enqueueChange']({'isUndoable':!0x1},_0x1ad3bc=>{for(const [_0x49c7d0,_0x33c89d]of _0x243f8a)'$graveyard'==_0x45ba46['markers']['get'](_0x49c7d0)['getRange']()['root']['rootName']&&(Z(_0x49c7d0['split'](':')[0x2],_0x33c89d['toRange'](),_0x45ba46,_0x1ad3bc),_0x33c89d['detach']());_0x243f8a['clear']();});});}(_0x1b1a62),this['_domEmitter']['listenTo'](_0x394bfc['document'],'keydown',(_0x3874f5,{key:_0x27f3c5})=>{'Escape'===_0x27f3c5&&function(_0x47ee66){_0x47ee66['editing']['view']['change'](_0x24ea89=>{for(const _0x474646 of _0x47ee66['model']['markers']){if(!_0x474646['name']['startsWith']('user:position'))continue;const _0x15d84a=_0x47ee66['editing']['mapper']['markerNameToElements'](_0x474646['name']);if(_0x15d84a){for(const _0x5964e9 of _0x15d84a)_0x24ea89['removeClass']('ck-user__marker_hovered',_0x5964e9);}}});}(_0x1b1a62);},{'useCapture':!0x0});}['afterInit'](){const _0x37f901=this['editor'],_0x3d7b05=_0x37f901['commands']['get']('undo');_0x3d7b05&&_0x37f901['model']['on']('applyOperation',(_0xc182e3,_0x168acb)=>{const _0xc7cd4b=_0x168acb[0x0];if(!_0xc7cd4b['isDocumentOperation'])return;if('marker'!=_0xc7cd4b['type']||!_0xc7cd4b['name']['startsWith']('user:'))return;const _0x3a93ea=_0xc7cd4b['batch'];_0x3d7b05['_createdBatches']['has'](_0x3a93ea)&&(_0xc7cd4b['newRange']=_0xc7cd4b['oldRange']?_0x37f901['model']['createRange'](_0xc7cd4b['oldRange']['start'],_0xc7cd4b['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x4ea9d2=this['editor'],_0x2bc507=_0x4ea9d2['model']['document'],_0x40bbeb=_0x4ea9d2['plugins']['get'](i);_0x4ea9d2['model']['enqueueChange']({'isUndoable':!0x1},_0x3928c7=>{const _0x28a081='user:range:'+_0x40bbeb['mySessionId'],_0x40036e='user:position:'+_0x40bbeb['mySessionId'],_0x5cc305=_0x4ea9d2['model']['markers']['has'](_0x28a081);_0x4ea9d2['editing']['view']['hasDomSelection']?Z(_0x40bbeb['mySessionId'],_0x2bc507['selection']['getFirstRange'](),_0x4ea9d2['model'],_0x3928c7):_0x5cc305&&(_0x3928c7['removeMarker'](_0x28a081),_0x3928c7['removeMarker'](_0x40036e));});}}function Z(_0x160303,_0xe0b8b2,_0x2325d1,_0x2369c2){const _0x136354='user:range:'+_0x160303,_0x2d8e92='user:position:'+_0x160303,_0x453b91=_0xe0b8b2['getContainedElement']();let _0x2e2ed3=_0xe0b8b2['start'];if(_0x453b91&&_0x453b91['is']('element','tableCell')){const _0x4475e9=function(_0x1790ca,_0x529783){for(const _0x33a715 of _0x1790ca['getPositions']())if(_0x529783['schema']['checkChild'](_0x33a715,'$text'))return _0x33a715;}(_0xe0b8b2,_0x2325d1);_0x4475e9&&(_0x2e2ed3=_0x4475e9,_0xe0b8b2=_0x2369c2['createRange'](_0x2e2ed3));}const _0x32bfa6=_0x2369c2['createRange'](_0x2e2ed3);_0x2325d1['markers']['has'](_0x136354)?(_0x2369c2['updateMarker'](_0x136354,{'range':_0xe0b8b2}),_0x2369c2['updateMarker'](_0x2d8e92,{'range':_0x32bfa6})):(_0x2369c2['addMarker'](_0x136354,{'range':_0xe0b8b2,'usingOperation':!0x0}),_0x2369c2['addMarker'](_0x2d8e92,{'range':_0x32bfa6,'usingOperation':!0x0}));}function W(_0x195e07,_0x2bd653,_0x1221f8){const _0x289133=_0x195e07['t'],t=_0x195e07['t'];switch(_0x2bd653){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 _0x289133({'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'},_0x1221f8);default:return'';}}let G=0x1;class l extends _0x4216e6{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x50807a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,V,_0x736766,_0x328575,_0x47f2c1];}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 _0x31b4c6=this['serverHistory']['getOperations']();for(let _0x4f4124=_0x31b4c6['length']-0x1;_0x4f4124>=0x0;_0x4f4124--){const _0x5da909=_0x31b4c6[_0x4f4124];if(!this['_disconnectionOperations']['has'](_0x5da909))return _0x5da909['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x36cc2c){if(super(_0x36cc2c),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5d359f(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x2c6f5e('collaboration-missing-channelid',this);const _0xb2ab2a=_0x36cc2c['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0xb2ab2a,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0xf671e3(),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 J(this['_disconnectionOperations']);}['init'](){const _0x5da708=this['editor'],_0xb9a8e0=_0x5da708['plugins']['get'](_0x328575),_0x8cc077=_0x5da708['plugins']['get'](n);this['listenTo'](_0xb9a8e0,'getOperationAuthor',(_0x109c8b,_0x2e0e10)=>{const _0x539cb4=_0x2e0e10[0x0];_0x539cb4['_authorId']&&(_0x109c8b['return']=_0xb9a8e0['getUser'](_0x539cb4['_authorId']),_0x109c8b['stop']()),null===_0x539cb4['_authorId']&&(_0x109c8b['return']=null,_0x109c8b['stop']());},{'priority':'high'}),this['listenTo'](_0x5da708['model']['document']['selection'],'change:range',(_0x4a2b85,_0x1d0ecc)=>{_0x1d0ecc['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x5da708['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x5da708['model']['on']('applyOperation',(_0x2703f4,_0x397630)=>{const _0x9368b3=_0x397630[0x0];_0x9368b3['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x9368b3),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x8cc077,'state',this,'_hasSynchronizationProblem',(_0x174324,_0xf8c5b1)=>'connected'===_0x174324&&!_0xf8c5b1),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x5da708['disableReadOnlyMode']('rtc-offline'):_0x5da708['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x5da708['disableReadOnlyMode']('rtc-offline'):_0x5da708['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4c2a57=this['editor']['plugins']['get'](i),_0x5be7a0=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x4c2a57['unregister'](this['_channelId']);const _0x3cda45=await this['_service']['reconnect'](_0x5be7a0['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x3cda45)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1bb71a=await this['_service']['getConnectedSessions']();_0x4c2a57['register'](this['_channelId'],_0x1bb71a),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2d21f6){if(function(_0x4cd7cf){return'404'===_0x4cd7cf['code'];}(_0x2d21f6)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x74ff8e){return'409'===_0x74ff8e['code'];}(_0x2d21f6)){const _0x2dfeed=W(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'](_0x2dfeed);}else{if(!(_0x2d21f6 instanceof $))throw _0x2d21f6;this['_handleReconnectionError']();}}}}['destroy'](){const _0x476fc3=this['editor']['plugins']['get'](n),_0x19f1b8=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x19f1b8['channelSessions']['has'](this['_channelId'])&&_0x19f1b8['unregister'](this['_channelId']),_0x476fc3['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x481c6e){if(this['sessionId']!==_0x481c6e['sessionId']&&this['_lastSyncedOperationId']!==_0x481c6e['lastOperationId'])throw new $();return this['sessionId']=_0x481c6e['sessionId'],this['_handleServerResponse']([],{..._0x481c6e,'wereChangesApplied':!0x1,'data':_0x481c6e['data']},'reconnect');}async['_connectService'](_0x570a2a,_0x22d8ca=!0x1){const {connection:_0x1cd116}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x1cd116,this['_channelId'])['then'](_0x49c5a9=>this['_initSessionsHandling'](_0x49c5a9))['catch'](_0x18b109=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x18b109);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x27eca4,_0xc8a016)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0xc8a016);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x563d09=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x570a2a);this['_isPendingUpdate']=!0x0;const _0x3ed37f=await this['_service']['connect'](_0x1cd116,this['_compressOperations'](_0x570a2a),_0x563d09);if(this['sessionId']=_0x3ed37f['sessionId'],_0x22d8ca){if(!_0x3ed37f['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3ed37f['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x570a2a,_0x3ed37f,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3ed37f,_0x570a2a);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x25e0fd=this['editor']['plugins']['get'](i),_0x5b2f7f=this['editor']['plugins']['get'](V),_0x280d3e=_0x25e0fd['channelSessions']['get'](this['_channelId']);_0x280d3e&&_0x280d3e['length']>0x1?_0x5b2f7f['createUserMarkerOperations']():this['listenTo'](_0x25e0fd,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x25e0fd['channelSessions']['get'](this['_channelId'])['length']&&_0x5b2f7f['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x234f89,_0x42cbb5,_0x286313,_0x370a10){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x42cbb5){const _0x55c82c=this['_decompressOperations'](_0x286313,_0x370a10);await this['_fetchMissingUsers'](_0x55c82c),this['_handleExternalOperations'](_0x55c82c,_0x42cbb5,_0x286313['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x37de68}=this['editor'];let _0x9ed4f;try{_0x9ed4f=await this['_service']['getDocumentDetails']();}catch{const _0x2d6f1d=W(_0x37de68,'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'](_0x2d6f1d);}const _0x40d152=_0x9ed4f['currentDocumentSession']||_0x9ed4f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x40d152['lastOperationId']){const _0x5e8760=W(_0x37de68,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x5e8760);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x15d7ad){const _0x37f848=this['editor']['plugins']['get'](i);this['listenTo'](_0x37f848,'sessionAdd:'+this['_channelId'],(_0x2fbf42,{session:_0x540629})=>{if(_0x540629['id']===_0x37f848['mySessionId']){_0x2fbf42['off']();const _0x183fec=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2bccf0=_0x540629['permissions'];_0x183fec&&_0x183fec['isEnabled']&&(_0x2bccf0=_0x2bccf0['filter'](_0x341df9=>'document:write'!==_0x341df9)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2bccf0,this['_channelId']);}}),_0x37f848['register'](this['_channelId'],_0x15d7ad);}['_initThrowingOnDataSet'](){const _0x5aaa66=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5c2ef6)=>{if(!_0x5c2ef6[_0x5c2ef6['length']-0x1]['suppressErrorInCollaboration'])throw new _0x2c6f5e('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5aaa66['apply'](this['editor']['data'],_0x5c2ef6);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x7a8cc,[_0x2ec739])=>{if(this['_document']['version'])throw new _0x2c6f5e('realtimecollaborationclient-init-document-already-initialized',this);_0x7a8cc['stop'](),this['_setPendingAction']();const _0x357bf3=this['editor']['config']['get']('rootsAttributes'),_0x208337=this['_getOperationsFromInitData'](_0x2ec739,_0x357bf3);0x0==_0x208337['length']&&_0x208337['push'](new _0x5301fb(0x0)),_0x7a8cc['return']=this['_connectService'](_0x208337)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x329b08=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x329b08))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3e3b71,[_0x1099f1,_0x46e89d])=>{_0x3e3b71['stop']();const _0xdb6fdb=this['editor']['model']['document']['getRoot'](_0x1099f1);if(!this['_knownRootNames']['has'](_0x1099f1)){const _0x52440a=_0x46e89d&&_0x46e89d['data']?_0x46e89d['data']:'',_0x54b114=_0x46e89d&&_0x46e89d['attributes']?_0x46e89d['attributes']:{};await this['_loadRoot'](_0x1099f1,_0x52440a,_0x54b114);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0xdb6fdb['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0xdb6fdb);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x54eab1){const _0x4418ff=this['editor']['plugins']['get'](_0x328575),{connection:_0x6520d8}=this['editor']['plugins']['get'](n),_0x2463d8=new Set();for(const _0x19dd14 of _0x54eab1){const _0x9733f3=_0x19dd14['_authorId'];_0x9733f3&&!_0x4418ff['getUser'](_0x9733f3)&&_0x2463d8['add'](_0x9733f3);}if(0x0===_0x2463d8['size'])return;const _0x416d21=await lt['getMany'](_0x6520d8,Array['from'](_0x2463d8));for(const _0x6071fc of _0x416d21)_0x4418ff['getUser'](_0x6071fc['id'])||_0x4418ff['addUser'](_0x6071fc);}['_getOperationsFromInitData'](_0x2fe0e3,_0x166656={}){const _0x941754=this['editor']['model'],_0x2e5cdc=[];let _0x2c1751=0x0;const _0x3c2095='string'==typeof _0x2fe0e3?{'main':_0x2fe0e3}:_0x2fe0e3;for(const _0x522dbd of Object['keys'](_0x3c2095)){if(!this['_document']['roots']['has'](_0x522dbd))throw new _0x2c6f5e('realtimecollaborationclient-init-non-existent-root',this);const _0x104933=this['editor']['data']['parse'](_0x3c2095[_0x522dbd]),_0xfa22f4=this['_document']['getRoot'](_0x522dbd),_0x12f23a=new _0x4091fe(_0x941754['createPositionAt'](_0xfa22f4,0x0),_0x104933,_0x2c1751++);_0x2e5cdc['push'](_0x12f23a);for(const [_0x1cac91,_0x2f469c]of _0x104933['markers']){const _0x2615d2=_0x941754['createRange'](_0x941754['createPositionFromPath'](_0xfa22f4,_0x2f469c['start']['path']['slice']()),_0x941754['createPositionFromPath'](_0xfa22f4,_0x2f469c['end']['path']['slice']())),_0x120d0e=new _0x24b5ac(_0x1cac91,null,_0x2615d2,_0x941754['markers'],!0x0,_0x2c1751++);_0x2e5cdc['push'](_0x120d0e);}}if(_0x166656)for(const [_0x33d97c,_0x53764d]of Object['entries'](_0x166656)){const _0x2a30d7=_0x941754['document']['getRoot'](_0x33d97c);if(!_0x2a30d7)throw new _0x2c6f5e('multi-root-editor-root-attributes-no-root',null);for(const [_0x3f07d9,_0x15c7aa]of Object['entries'](_0x53764d))if(null!==_0x15c7aa){const _0x2acee7=new _0x2e17b6(_0x2a30d7,_0x3f07d9,null,_0x15c7aa,_0x2c1751++);_0x2e5cdc['push'](_0x2acee7);}}return _0x2e5cdc;}async['_loadRoot'](_0x3b14ea,_0xbc882d,_0x4126c9){this['_getOperationsFromInitData']({[_0x3b14ea]:_0xbc882d},{[_0x3b14ea]:_0x4126c9})['forEach']((_0x326bb0,_0x56be5b)=>{_0x326bb0['baseVersion']=this['_document']['version']+_0x56be5b,_0x326bb0['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x326bb0);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x2831c2,_0x454746){let _0x222a75;this['_offset']=_0x2831c2['offset'];const _0x16088b=_0x2831c2['wereChangesApplied']&&!_0x2831c2['initData'],_0x3924cb=_0x16088b?0x0:_0x2831c2['data']['baseVersion'];if(_0x454746['forEach'](_0x1c7577=>{_0x1c7577['_isInit']=!0x0,_0x1c7577['createdAt']=_0x2831c2['sessionCreatedAt'],_0x1c7577['_authorId']=null;}),_0x16088b)_0x222a75=_0x454746,this['_applyOperationsSet'](_0x222a75,_0x16088b);else{if(_0x2831c2['initData']){const _0x470ae2=this['_getOperationsFromInitData'](_0x2831c2['initData']);this['_document']['history']['version']=-_0x470ae2['length'],_0x470ae2['forEach'](_0x1ac91f=>{_0x1ac91f['baseVersion']-=_0x470ae2['length'],_0x1ac91f['createdAt']=_0x2831c2['sessionCreatedAt'],_0x1ac91f['_isInit']=!0x0,_0x1ac91f['_authorId']=null;}),this['_applyOperationsSet'](_0x470ae2,!0x0),this['serverHistory']['version']=-_0x470ae2['length']+this['_offset'],this['_updateServerHistory'](_0x470ae2);}this['_document']['history']['version']=_0x3924cb,_0x222a75=this['_decompressOperations'](_0x2831c2['data'],_0x2831c2['metadata']),await this['_fetchMissingUsers'](_0x222a75),this['_applyOperationsSet'](_0x222a75,_0x16088b);}_0x2831c2['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x222a75,_0x2831c2['lastOperationId']),this['_lastSyncedOperationId']=_0x2831c2['lastOperationId']),this['serverHistory']['version']=_0x3924cb+this['_offset'],this['_updateServerHistory'](_0x222a75),_0x454746['filter'](_0x1fe59f=>{const _0x46202f=this['_getAffectedRoot'](_0x1fe59f);return _0x46202f&&!this['_knownRootNames']['has'](_0x46202f);})['forEach']((_0x4f19d6,_0x532cf0)=>{_0x4f19d6['baseVersion']=this['_document']['version']+_0x532cf0,this['_saveOperationInBuffer'](_0x4f19d6);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x5b076f,_0x579d62){const _0x24f740=_0x579d62&&_0x579d62['message'];if(_0x24f740&&_0x24f740['startsWith']('realtimecollaborationclient'))throw _0x579d62;const _0x3ee7eb=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x3ee7eb['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x2c6f5e(_0x5b076f,this['editor'],_0x24f740?{'originalError':_0x24f740}:void 0x0);}['_saveOperationInBuffer'](_0x328cee){this['_knownOperations']['has'](_0x328cee)||(this['_knownOperations']['add'](_0x328cee),this['_bufferedOperations']['push'](_0x328cee),this['_pendingAction']||'marker'==_0x328cee['type']&&!_0x328cee['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x4f4928=!0x1){!_0x4f4928&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xd93584=>{_0xd93584&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x4db233=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x2dcf82){return _0x2dcf82['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2dcf82['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2dcf82['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x4db233)||this['_crash'](_0x4db233['message'],_0x4db233);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x516236=>{this['on']('change:_isPendingUpdate',()=>{_0x516236();});});}async['_sendBufferedOperations'](){const _0x5a1f23=this['editor']['plugins']['get'](V);if(this['_shouldSendSelectionUpdate']()&&(_0x5a1f23['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2cc1d9=[...this['_bufferedOperations']];for(const _0x34e428 of _0x2cc1d9)_0x34e428['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x34e428);const _0xa47b5=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2cc1d9),_0x4f550b=G++,_0x14093d=this['_compressOperations'](_0x2cc1d9),_0x2e6208=await this['_service']['sendOperations'](_0x14093d,_0x14093d['baseVersion'],_0xa47b5);try{return await this['_handleServerResponse'](_0x2cc1d9,_0x2e6208,_0x4f550b);}catch(_0x12bf55){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x12bf55);}}async['_handleServerResponse'](_0xf8d8b3,_0x5ac57c,_0x5b0e1e){if('error'in _0x5ac57c)throw _0x5ac57c['error'];let _0x53b59f=!0x1;if(_0x5ac57c['wereChangesApplied']){_0x5ac57c['lastOperationId']&&(this['_lastSyncedOperationId']=_0x5ac57c['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x12514b=>!_0xf8d8b3['includes'](_0x12514b));for(const _0x39d10c of _0xf8d8b3)_0x39d10c['createdAt']='lastOperationAcceptedAt'in _0x5ac57c&&_0x5ac57c['lastOperationAcceptedAt']||void 0x0;K(_0xf8d8b3,_0x5ac57c['version']-_0xf8d8b3['length']),this['_updateServerHistory'](_0xf8d8b3);const _0x327abe=_0xf8d8b3['filter'](_0x361d0b=>{if(!_0x361d0b['_isInit'])return!0x1;const _0x3ea1f1=this['_getAffectedRoot'](_0x361d0b);return _0x3ea1f1&&!this['_knownRootNames']['has'](_0x3ea1f1);});K(_0x327abe,this['_document']['version']),this['_applyOperationsSet'](_0x327abe),_0x53b59f=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x6dfe3e=this['_decompressOperations'](_0x5ac57c['data'],_0x5ac57c['metadata'])['filter'](_0x24778d=>_0x24778d['baseVersion']>=this['_lastServerVersion']);_0x6dfe3e['forEach'](_0x68dd70=>this['_addKnownRoot'](_0x68dd70)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1a9e91=>!_0x1a9e91['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1a9e91))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x6dfe3e),_0x53b59f=this['_handleExternalOperations'](_0x6dfe3e,_0x5ac57c['version'],_0x5ac57c['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x53b59f?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2d0057,_0x1a2a84,_0x33ccca){try{const _0x7241bf={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4e2b62,operationsB:_0x1bf4ec,originalOperations:_0x527992}=_0x568b8c(_0x2d0057,this['_bufferedOperations'],_0x7241bf);K(_0x4e2b62,this['_document']['version']),K(_0x1bf4ec,_0x1a2a84);for(const _0x1bdb92 of _0x4e2b62){const _0x17e93a=_0x527992['get'](_0x1bdb92);_0x1bdb92['_authorId']=_0x17e93a?_0x17e93a['_authorId']:null;}_0x33ccca&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2d0057,_0x33ccca),this['_lastSyncedOperationId']=_0x33ccca),this['_bufferedOperations']=[..._0x1bf4ec],this['_applyOperationsSet'](_0x4e2b62),this['_updateServerHistory'](_0x2d0057);}catch(_0xaf4849){return console['error'](_0xaf4849),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2856d7,_0x364823=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x18b362=>{for(const _0x34c6c5 of _0x2856d7)this['_knownOperations']['add'](_0x34c6c5),this['_addKnownRoot'](_0x34c6c5),_0x18b362['batch']['addOperation'](_0x34c6c5),this['editor']['model']['applyOperation'](_0x34c6c5);});}['_addKnownRoot'](_0x44e1f6){const _0x54239c=this['_getAffectedRoot'](_0x44e1f6);_0x54239c&&this['_knownRootNames']['add'](_0x54239c);}['_getAffectedRoot'](_0x10ea09){let _0x3b18ec,_0x1310ad;switch(_0x10ea09['type']){case'insert':_0x3b18ec=_0x10ea09['position']['root'];break;case'marker':if(_0x1310ad=_0x10ea09['newRange'],!_0x1310ad)return null;_0x3b18ec=_0x1310ad['root'];break;case'addRootAttribute':_0x3b18ec=_0x10ea09['root'];break;case'addRoot':_0x3b18ec=_0x10ea09['affectedSelectable'];break;case'move':_0x3b18ec=_0x10ea09['targetPosition']['root'];break;default:return null;}return _0x3b18ec['rootName'];}['_updateServerHistory'](_0x3c480){_0x3c480['forEach'](_0x2548ec=>{const _0x5203f6=_0x2548ec['clone']();_0x5203f6['_authorId']=_0x2548ec['_authorId'],_0x5203f6['_isInit']=!!_0x2548ec['_isInit'],_0x5203f6['createdAt']=_0x2548ec['createdAt'],_0x5203f6['baseVersion']+=this['_offset'],_0x2548ec['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5203f6),this['serverHistory']['addOperation'](_0x5203f6);});}['_handleReconnectionError'](_0x24aef4){const _0x18e5d8=this['editor']['plugins']['get']('Notification'),_0x280204=this['editor']['locale'];_0x24aef4||(_0x24aef4=W(_0x280204,'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.')),_0x18e5d8['showWarning'](_0x24aef4,{'title':W(_0x280204,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x736766)['add'](W(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x736766)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x236f21){const _0x57b7de=_0x236f21['map'](_0xb5c14d=>_0xb5c14d['toJSON']());return this['_compressor']['compress'](_0x57b7de);}['_decompressOperations'](_0x276daf,_0x1c872e){return this['_compressor']['decompress'](_0x276daf)['map']((_0x5e68a3,_0x4f1259)=>{const _0x30f2ce='init'==_0x1c872e[_0x4f1259]['type'];if('InsertOperation'==_0x5e68a3['__className']){const _0x19e6d5=_0x5e68a3['position']['root'];!this['_document']['getRoot'](_0x19e6d5)&&(this['_document']['createRoot']('$root',_0x19e6d5)['_isAttached']=!0x1);}const _0x5c2255=_0xb3bcba['fromJSON'](_0x5e68a3,this['_document']);return _0x5c2255['wasUndone']=_0x5e68a3['wasUndone'],_0x5c2255['_isInit']=_0x30f2ce,_0x5c2255['_authorId']=_0x30f2ce?null:_0x1c872e[_0x4f1259]['userId'],_0x5c2255['_isDisconnection']='cs:removeUser'===_0x1c872e[_0x4f1259]['type'],_0x5c2255['createdAt']=_0x1c872e[_0x4f1259]['createdAt'],_0x5c2255;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4e3c1b=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4e3c1b&&_0x4e3c1b['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x2297dd,_0x31adce){for(const _0x2d1690 of _0x2297dd)_0x2d1690['baseVersion']=_0x31adce++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x1f1c3c){this['_ignoredOperations']=_0x1f1c3c,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x251bdc){let _0x6d5a26=_0x251bdc['length'];for(;_0x6d5a26--;){const _0xdd48f1=_0x251bdc[_0x6d5a26];if(!this['_ignoredOperations']['has'](_0xdd48f1)){if(!this['_operationToId']['has'](_0xdd48f1)){const _0x365cb7=_0x1f53b8()['slice'](0x1,0x12);this['_operationToId']['set'](_0xdd48f1,_0x365cb7);}return this['_operationToId']['get'](_0xdd48f1);}}}['setIdForTheLastOperation'](_0x1a4d45,_0x1dbf02){if(!_0x1dbf02)return;let _0x3a626c=_0x1a4d45['length'];for(;_0x3a626c--;){const _0x3f1674=_0x1a4d45[_0x3a626c];this['_ignoredOperations']['has'](_0x3f1674)||this['_operationToId']['set'](_0x3f1674,_0x1dbf02);}}}class a extends _0x4216e6{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x77b109{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x3e3b54)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x328575];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x421314){super(_0x421314),this['_services']=new Map();}async['init'](){const _0x1ddefd=this['context'],_0x358fcc=_0x1ddefd['plugins']['get']('CommentsRepository');if(_0x1ddefd['plugins']['get'](n)['addToReconnectionStack'](this),_0x358fcc['adapter']={'addCommentThread':async({channelId:_0x504669,threadId:_0x416c3d,comments:_0x556cf1,resolvedAt:_0x5ba5a0,resolvedBy:_0x274066,context:_0x4804aa,attributes:_0x3da877})=>{const _0x175a04=await this['_getService'](_0x504669)['addCommentThread']({'commentThreadId':_0x416c3d,'comments':_0x556cf1['map'](_0x9cbf1c=>function(_0x29eec5,_0x368c8,_0x1531cd){return{'commentThreadId':_0x1531cd,'commentId':_0x29eec5['commentId'],'userId':_0x29eec5['authorId'],'content':_0x29eec5['content'],'documentId':_0x368c8,'createdAt':_0x29eec5['createdAt'],'attributes':_0x29eec5['attributes']||{}};}(_0x9cbf1c,_0x504669,_0x416c3d)),'resolvedAt':_0x5ba5a0,'resolvedBy':_0x274066,'context':_0x4804aa,'attributes':_0x3da877})['catch'](dt);return{'threadId':_0x175a04['commentThreadId'],'comments':_0x175a04['comments']};},'getCommentThread':async({channelId:_0xf22eb1,threadId:_0x57c248})=>{const _0x54e480=await this['_getService'](_0xf22eb1)['getCommentThread'](_0x57c248)['catch'](f)['catch'](dt);return _0x54e480?_0x54e480['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x54e480]),{'threadId':_0x54e480['commentThreadId'],'comments':_0x54e480['comments']['map'](p),'context':_0x54e480['context'],'resolvedAt':_0x54e480['resolvedAt'],'resolvedBy':_0x54e480['resolvedBy'],'attributes':_0x54e480['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x54ef43,threadId:_0x3f4c1c,context:_0x48d131,unlinkedAt:_0x437942,attributes:_0xc7b237})=>this['_getService'](_0x54ef43)['updateCommentThread']({'commentThreadId':_0x3f4c1c,'context':_0x48d131,'attributes':_0xc7b237,'unlinkedAt':_0x437942})['catch'](f)['catch'](dt),'resolveCommentThread':async({channelId:_0x4d0815,threadId:_0x2b5e58})=>{const _0x2cc049=await this['_getService'](_0x4d0815)['resolveCommentThread'](_0x2b5e58)['catch'](f)['catch'](dt);return{'threadId':_0x2cc049['commentThreadId'],'resolvedAt':_0x2cc049['resolvedAt'],'resolvedBy':_0x2cc049['resolvedBy']};},'reopenCommentThread':async({channelId:_0x171b39,threadId:_0x416498})=>this['_getService'](_0x171b39)['reopenCommentThread'](_0x416498)['catch'](f)['catch'](dt),'removeCommentThread':({channelId:_0x53bc9a,threadId:_0x25809e})=>this['_getService'](_0x53bc9a)['removeCommentThread'](_0x25809e)['catch'](f)['catch'](dt),'addComment':({channelId:_0xedaa25,threadId:_0x55b906,commentId:_0x54e790,content:_0x468024,attributes:_0x503b87})=>this['_getService'](_0xedaa25)['addComment'](_0x55b906,_0x54e790,_0x468024,_0x503b87)['catch'](dt),'updateComment':({channelId:_0x5c1bf3,threadId:_0x240f3b,commentId:_0x45a333,content:_0x23ddee,attributes:_0x4a514a})=>this['_getService'](_0x5c1bf3)['updateComment'](_0x240f3b,_0x45a333,_0x23ddee,_0x4a514a)['catch'](f)['catch'](dt),'removeComment':({channelId:_0x5cb632,threadId:_0x29d0cb,commentId:_0x2492a8})=>this['_getService'](_0x5cb632)['removeComment'](_0x29d0cb,_0x2492a8)['catch'](f)['catch'](dt)},_0x1ddefd instanceof _0x297d04){const _0x573568=_0x1ddefd['config']['get']('collaboration.channelId'),_0x1b8764=_0x1ddefd['plugins']['get'](i);await this['_setUpService'](_0x573568);const _0x43568d=await this['_services']['get'](_0x573568)['getConnectedSessions']();this['listenTo'](_0x1b8764,'sessionAdd:'+_0x573568,(_0x2b3c3e,{session:_0x50653a})=>{_0x50653a['id']===_0x1b8764['mySessionId']&&(_0x2b3c3e['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x50653a['permissions'],_0x573568));}),_0x1b8764['register'](_0x573568,_0x43568d);}}async['_setUpService'](_0x408b66){if(this['_services']['has'](_0x408b66))throw new _0x2c6f5e('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x408b66});const _0x452e45=this['context']['plugins']['get']('CommentsRepository'),_0x1611dc=new s['CommentsService'](_0x408b66);this['_services']['set'](_0x408b66,_0x1611dc),this['listenTo'](_0x1611dc,'commentThreadAdded',(_0x1d9db7,_0x299e41)=>{const {commentThreadId:_0x19fc92,documentId:_0x2bc86c,context:_0x3ab8c3,attributes:_0xc257db,resolvedAt:_0x3cda4f,resolvedBy:_0x13e91d,comments:_0x4017fb}=_0x299e41;_0x452e45['getCommentThread'](_0x19fc92)||_0x452e45['addCommentThread']({'threadId':_0x19fc92,'channelId':_0x2bc86c,'comments':_0x4017fb?_0x4017fb['map'](p):[],'context':_0x3ab8c3,'attributes':_0xc257db,'resolvedAt':_0x3cda4f,'resolvedBy':_0x13e91d,'isFromAdapter':!0x0});}),this['listenTo'](_0x1611dc,'commentThreadUpdated',(_0x4957f2,{commentThreadId:_0x30a03a,documentId:_0x390555,context:_0x407e1f,unlinkedAt:_0x5bfc7a,attributes:_0x1d5600})=>{_0x452e45['getCommentThread'](_0x30a03a)&&_0x452e45['updateCommentThread']({'threadId':_0x30a03a,'channelId':_0x390555,'context':_0x407e1f,'unlinkedAt':_0x5bfc7a,'attributes':_0x1d5600,'isFromAdapter':!0x0});}),this['listenTo'](_0x1611dc,'commentThreadResolved',(_0x279b74,{commentThreadId:_0x15ff1a,resolvedBy:_0x9ede3f,resolvedAt:_0x3cb38b})=>{const _0x47c88a=_0x452e45['getCommentThread'](_0x15ff1a);_0x47c88a&&_0x47c88a['resolve']({'resolvedBy':_0x9ede3f,'resolvedAt':_0x3cb38b,'isFromAdapter':!0x0});}),this['listenTo'](_0x1611dc,'commentThreadReopened',(_0x1a4648,{commentThreadId:_0x43519e})=>{const _0x3c8c40=_0x452e45['getCommentThread'](_0x43519e);_0x3c8c40&&_0x3c8c40['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1611dc,'commentThreadRemoved',(_0x38b28a,{commentThreadId:_0x28b468})=>{const _0x548f61=_0x452e45['getCommentThread'](_0x28b468);_0x548f61&&_0x548f61['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1611dc,'commentAdded',(_0x3596fe,_0x33abda)=>{const _0x3ec34f=_0x33abda['commentThreadId'],_0x2db3ec=_0x452e45['getCommentThread'](_0x3ec34f);_0x2db3ec&&_0x2db3ec['addComment']({...p(_0x33abda),'isFromAdapter':!0x0});}),this['listenTo'](_0x1611dc,'commentUpdated',(_0x538dc6,{commentThreadId:_0x2414ce,commentId:_0x24f066,content:_0x3d6bdd,attributes:_0x41e5bb})=>{const _0x433b59=_0x452e45['getCommentThread'](_0x2414ce);if(_0x433b59){const _0x2ef238=_0x433b59['getComment'](_0x24f066);_0x2ef238&&_0x2ef238['update']({'content':_0x3d6bdd,'attributes':_0x41e5bb,'isFromAdapter':!0x0});}}),this['listenTo'](_0x1611dc,'commentRemoved',(_0x356032,{commentThreadId:_0x46ed14,commentId:_0x14bf7c})=>{const _0x35d25a=_0x452e45['getCommentThread'](_0x46ed14);if(_0x35d25a){const _0x47013e=_0x35d25a['getComment'](_0x14bf7c);_0x47013e&&_0x47013e['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x408b66);}['destroy'](){if(this['context']instanceof _0x297d04){const _0xab6438=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0xab6438);}}['_terminateService'](_0x2741d0){if(!this['_services']['has'](_0x2741d0))throw new _0x2c6f5e('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x2741d0});this['_getService'](_0x2741d0)['disconnect'](),this['_services']['delete'](_0x2741d0);}async['reconnect'](){for(const _0x2be00a of this['_services']['keys']())await this['_connectService'](_0x2be00a);if(this['context']instanceof _0x297d04){const _0x2603c8=this['context']['config']['get']('collaboration.channelId'),_0x2e1f56=this['context']['plugins']['get'](i);_0x2e1f56['unregister'](_0x2603c8);const _0x2f6069=await this['_services']['get'](_0x2603c8)['getConnectedSessions']();_0x2e1f56['register'](_0x2603c8,_0x2f6069);}}async['_connectService'](_0x4c22d0){const {connection:_0x52e65c}=this['context']['plugins']['get'](n),_0x49b64d=this['context']['plugins']['get']('CommentsRepository'),_0x49ff6f=this['_services']['get'](_0x4c22d0),_0x1bac74=await _0x49ff6f['connect'](_0x52e65c);await this['_fetchMissingUsersForThreads'](_0x1bac74);const _0x304e1f=new Set(Array['from'](_0x49b64d['getCommentThreads']({'channelId':_0x4c22d0}),_0x31cc0f=>_0x31cc0f['id']));for(const _0x1368c9 of _0x1bac74)_0x1368c9['deletedAt']||_0x304e1f['delete'](_0x1368c9['commentThreadId']);for(const _0x3d75f8 of _0x304e1f)_0x49b64d['getCommentThread'](_0x3d75f8)['remove']({'isFromAdapter':!0x0});for(const _0x2c425c of _0x1bac74){let _0x302240=_0x49b64d['getCommentThread'](_0x2c425c['commentThreadId']);const {commentThreadId:_0x12746d,context:_0x37141f,attributes:_0x2d7f6b,resolvedBy:_0x2abeaa,resolvedAt:_0x2157d0,unlinkedAt:_0x3bcc8f,deletedAt:_0x3f7448}=_0x2c425c;if(_0x3f7448)continue;_0x302240||(_0x302240=_0x49b64d['addCommentThread']({'channelId':_0x4c22d0,'threadId':_0x12746d,'context':_0x37141f,'attributes':_0x2d7f6b||{},'resolvedBy':_0x2abeaa,'resolvedAt':_0x2157d0,'unlinkedAt':_0x3bcc8f,'isFromAdapter':!0x0}));const _0x582cc4=new Set(Array['from'](_0x302240['comments'],_0x1327b3=>_0x1327b3['id']));for(const _0x46a1f of _0x2c425c['comments'])_0x582cc4['delete'](_0x46a1f['commentId']);for(const _0x19488b of _0x582cc4)_0x302240['getComment'](_0x19488b)['remove']({'isFromAdapter':!0x0});for(const _0x63472d of _0x2c425c['comments']){const _0x2fefc0=_0x302240['getComment'](_0x63472d['commentId']);_0x2fefc0?_0x2fefc0['content']!==_0x63472d['content']&&_0x2fefc0['update']({'content':_0x63472d['content'],'isFromAdapter':!0x0}):_0x302240['addComment'](Object['assign'](p(_0x63472d),{'isFromAdapter':!0x0}));}}}['_getService'](_0x51378){if(!this['_services']['has'](_0x51378))throw new _0x2c6f5e('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x51378});return this['_services']['get'](_0x51378);}async['_fetchMissingUsersForThreads'](_0x1a7b5b){const _0x4c0cf0=this['context']['plugins']['get'](_0x328575),{connection:_0x44f83d}=this['context']['plugins']['get'](n),_0x276b97=new Set();for(const {resolvedBy:_0xb8ab68,comments:_0x35955e}of _0x1a7b5b){_0xb8ab68&&!_0x4c0cf0['getUser'](_0xb8ab68)&&_0x276b97['add'](_0xb8ab68);for(const {userId:_0x429cb0}of _0x35955e)_0x4c0cf0['getUser'](_0x429cb0)||_0x276b97['add'](_0x429cb0);}if(0x0===_0x276b97['size'])return;const _0x33d420=await lt['getMany'](_0x44f83d,Array['from'](_0x276b97));for(const _0x5d2e9c of _0x33d420)_0x4c0cf0['getUser'](_0x5d2e9c['id'])||_0x4c0cf0['addUser'](_0x5d2e9c);}}async function f(_0x5040a5){if('404'!==_0x5040a5['code'])throw _0x5040a5;}function dt(_0x5a15bc){if((_0x13f46f=_0x5a15bc)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x13f46f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x13f46f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x13f46f;throw _0x5a15bc;}function p(_0x41a729){return{'threadId':_0x41a729['commentThreadId'],'commentId':_0x41a729['commentId'],'content':_0x41a729['content'],'createdAt':_0x41a729['createdAt'],'authorId':_0x41a729['userId'],'attributes':_0x41a729['attributes']||{}};}class m extends _0x4216e6{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x533f8c){super(_0x533f8c);const _0x2aa559=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x2aa559);}['init'](){const _0x48519f=this['editor']['plugins']['get'](n),_0x26a3d3=this['editor']['plugins']['get']('TrackChangesEditing');return _0x26a3d3['adapter']={'getSuggestion':async _0x35adb7=>{await this['_waitForServiceReady']();const _0x1978c8=await this['_trackChangesService']['get'](_0x35adb7)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x1978c8]),_0x1978c8;},'addSuggestion':async({id:_0x171684,type:_0x3c1067,data:_0x127ab1,originalSuggestionId:_0x2a8cd1,attributes:_0x396add})=>{await this['_waitForServiceReady']();const _0x58c1bd={'id':_0x171684,'type':_0x3c1067,'data':_0x127ab1,'originalSuggestionId':_0x2a8cd1,'attributes':_0x396add},_0x15ebe4=await this['_trackChangesService']['add'](_0x171684,_0x3c1067,_0x127ab1,_0x2a8cd1,_0x396add)['catch'](_0x1bac32=>{if(ut(_0x1bac32))return new Promise(_0x2e01a4=>{this['_bufferedRequests']['set'](_0x171684,{'resolve':_0x2e01a4,'suggestionData':_0x58c1bd});});throw _0x1bac32;});return this['_bufferedRequests']['delete'](_0x171684),_0x15ebe4;},'updateSuggestion':async(_0x36323d,_0x284ed2)=>{if(await this['_waitForServiceReady'](),'open'!==_0x284ed2['state'])return this['_trackChangesService']['update'](_0x36323d,_0x284ed2)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x10f382,_0x2d8818)=>{_0x26a3d3['hasSuggestion'](_0x2d8818['id'])&&(_0x26a3d3['getSuggestion'](_0x2d8818['id'])['attributes']=_0x2d8818['attributes']);}),this['_trackChangesService']['connect'](_0x48519f['connection'])['then'](_0x1b3a0e=>(_0x48519f['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1b3a0e)['then'](()=>{for(const _0x1db2d4 of _0x1b3a0e){_0x26a3d3['addSuggestionData'](_0x1db2d4)['_saved']=!0x0;}})));}async['reconnect'](){const _0xb4509e=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x24c7c0}=this['editor']['plugins']['get'](n),_0x2fee84=await this['_trackChangesService']['connect'](_0x24c7c0);await this['_fetchMissingUsersForThreads'](_0x2fee84);for(const {suggestionData:_0x50b6a3,resolve:_0x3ff242}of this['_bufferedRequests']['values']()){let _0x515baa=_0x2fee84['find'](_0x2c514a=>_0x2c514a['id']===_0x50b6a3['id']);_0x515baa||(_0x515baa=await this['_trackChangesService']['add'](_0x50b6a3['id'],_0x50b6a3['type'],_0x50b6a3['data'],_0x50b6a3['originalSuggestionId'])),_0x3ff242(_0x515baa);}for(const _0x422dbe of _0x2fee84)_0xb4509e['hasSuggestion'](_0x422dbe['id'])||_0xb4509e['addSuggestionData'](_0x422dbe);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x527499=>{this['listenTo'](this['_trackChangesService'],'connected',_0x10d583=>{_0x10d583['off'](),_0x527499();});});}async['_fetchMissingUsersForThreads'](_0x4ed9f9){const _0x21540e=this['editor']['plugins']['get'](_0x328575),{connection:_0x33bdfe}=this['editor']['plugins']['get'](n),_0x3cc6f2=new Set();for(const {authorId:_0x1ccf67}of _0x4ed9f9)_0x21540e['getUser'](_0x1ccf67)||_0x3cc6f2['add'](_0x1ccf67);if(0x0===_0x3cc6f2['size'])return;const _0x1ab671=await lt['getMany'](_0x33bdfe,Array['from'](_0x3cc6f2));for(const _0x1a97ef of _0x1ab671)_0x21540e['getUser'](_0x1a97ef['id'])||_0x21540e['addUser'](_0x1a97ef);}}function A(_0x47a0b9){if(ut(_0x47a0b9))return new Promise(()=>{});throw _0x47a0b9;}function ut(_0x3f589a){return _0x3f589a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3f589a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x4216e6{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3f9c6f=this['editor']['plugins']['get'](n),_0x3a0e0d=this['editor']['plugins']['get']('CommentsEditing'),_0x442c9c=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3f9c6f,'change:state',(_0x178624,_0x19b1cc,_0x1dd45a)=>{_0x3a0e0d['isThreadsLoadingPaused']='connected'!==_0x1dd45a;});}),this['listenTo'](_0x3f9c6f,'change:state',(_0x1935ae,_0x40762e,_0x1e33a0)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x1e33a0);}),_0x442c9c['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0x4216e6{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x4216e6{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x328575];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4eca1d){super(_0x4eca1d);const _0x5a8b8e=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x5a8b8e);}async['init'](){const _0x16c545=this['editor']['plugins']['get'](l),_0xccd42e=_0x16c545['serverHistory'],_0x2ba8cd=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xccd42e,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x16c545['sessionId']});const _0x4c2458=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x2bb166=await tt['isBundleUploaded'](_0x2ba8cd['connection'],_0x4c2458);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1b7619})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1b7619)),'updateRevisions':async _0x4314df=>{await this['_waitForServiceReady']();const _0x30db55=this['_revisionTracker']['currentRevision'];if(_0x2bb166&&0x1===_0x4314df['length']&&_0x4314df[0x0]['id']===_0x30db55['id'])return _0x4314df;for(const _0x5ab3b4 of _0x4314df)_0x5ab3b4['id']===_0x30db55['id']&&(_0x5ab3b4['isEmptyCurrent']=_0x5ab3b4['fromVersion']===_0x5ab3b4['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x4314df,this['_lastRequestId'])['then'](_0x854445=>(this['_lastRequestId']=_0x854445,_0x4314df))['catch'](_0xf20730=>{if(st(_0xf20730)||'400'===_0xf20730['code']&&void 0x0!==_0xf20730['data']['wrongRequestId']){for(const _0x384f97 of _0x4314df){!this['_revisionTracker']['repository']['getRevision'](_0x384f97['id'])||this['_revisionTracker']['_bufferUpdate'](_0x384f97['id'],_0x384f97,!0x1);}if(st(_0xf20730))throw _0xf20730;return _0x4314df;}throw _0xf20730;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x5356b9,{revisionsData:_0x5a56b1,requestId:_0x148a01})=>{Math['max'](..._0x5a56b1['map'](_0x1a344a=>_0x1a344a['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5a56b1,_0x148a01);}):this['_handleRevisionsUpdate'](_0x5a56b1,_0x148a01);});const {revisions:_0x1df96c,requestId:_0x9074e9}=await this['_revisionHistoryService']['connect'](_0x2ba8cd['connection']);_0x2ba8cd['addToReconnectionStack'](this),this['_lastRequestId']=_0x9074e9,await this['_fetchMissingUsers'](_0x1df96c);for(const _0x57ab3c of _0x1df96c)this['_revisionTracker']['addRevisionData'](_0x57ab3c);this['listenTo'](_0x16c545,'change:_isConnected',(_0x521c8d,_0x217bd7,_0x1b0744)=>{_0x1b0744&&(this['_oldOffset']=_0x16c545['_offset'],_0x521c8d['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x2ba8cd,'state',_0x32889c=>_0x32889c===te['CONNECTED']);}async['reconnect'](){const _0x4c30da=this['editor']['plugins']['get'](n),_0x5b30c4=this['editor']['plugins']['get'](l),_0x3b1075=async()=>{const _0x464fa7=this['_revisionTracker']['currentRevision'],_0x24e6f4=_0x464fa7['id'],_0x13b033=_0x24e6f4!==_0x5b30c4['sessionId'];if(_0x13b033){const _0x7ef64c=_0x5b30c4['_offset']-this['_oldOffset'],_0x3b4fe8=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x464fa7['toVersion']+_0x7ef64c!==_0x3b4fe8){const _0x37950a=_0x464fa7['fromVersion']+_0x7ef64c,_0x10ba3c=this['editor']['plugins']['get'](_0x328575),_0x13e0f6=this['_revisionTracker']['buildRevisionData']({'revision':_0x464fa7,'from':_0x37950a,'to':_0x3b4fe8});_0x13e0f6['id']=_0x464fa7['id'];const _0x365d0d=_0x13e0f6['authorsIds']['map'](_0x5d7402=>_0x10ba3c['getUser'](_0x5d7402));_0x464fa7['_update']({..._0x13e0f6,'authors':_0x365d0d},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x464fa7['id'],_0x13e0f6,!0x0);}this['_revisionTracker']['_startingVersion']=_0x3b4fe8,(_0x464fa7['toVersion']===_0x464fa7['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x24e6f4)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x24e6f4),this['_revisionTracker']['_createCurrentRevision'](_0x3b4fe8));}const {revisions:_0x330ccc,requestId:_0x1fbfbd}=await this['_revisionHistoryService']['reconnect'](_0x4c30da['connection'],this['_lastRequestId']);_0x13b033&&_0x330ccc['length']>0x0?_0x5b30c4['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x330ccc),this['_handleRevisionsUpdate'](_0x330ccc,_0x1fbfbd),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5b30c4['_isConnected']?_0x3b1075():new Promise((_0x3dbe1a,_0x3c6c6d)=>{_0x5b30c4['once']('change:_isConnected',()=>{_0x3b1075()['then'](_0x3dbe1a)['catch'](_0x3c6c6d);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0xeb1862=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x18e856=>{_0x18e856['off'](),_0xeb1862();});});}['_getLatestVersionFromServerOperations'](){const _0x5ae3e2=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x4ee259 of _0x5ae3e2)if('marker'!==_0x4ee259['type']||_0x4ee259['affectsData'])return _0x4ee259['baseVersion']+0x1;}['_getLatestVersion'](){const _0x365dce=this['editor']['plugins']['get'](l);return new Promise(_0x21358a=>{_0x365dce['_isPendingUpdate']?_0x365dce['once']('change:_isPendingUpdate',()=>{_0x21358a(this['_getLatestVersionFromServerOperations']());}):_0x21358a(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x4d47fc,_0xe86a4c){const _0x3bb59c=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xe86a4c;for(const _0x2f1ec2 of _0x4d47fc){const _0x57fb9d=_0x3bb59c['getRevision'](_0x2f1ec2['id']);if(_0x57fb9d){if((_0x2f1ec2['fromVersion']||_0x2f1ec2['toVersion'])&&(_0x2f1ec2['diffData']=null),_0x57fb9d===this['_revisionTracker']['currentRevision']){const _0x2d70fe=Math['max'](_0x57fb9d['toVersion'],_0x2f1ec2['toVersion']),_0x1d8fa7=Math['max'](_0x57fb9d['fromVersion'],_0x2f1ec2['fromVersion']);let _0x57c9d;_0x57fb9d['toVersion']===_0x2f1ec2['toVersion']&&_0x57fb9d['fromVersion']===_0x2f1ec2['fromVersion']?(_0x57c9d=!0x0,this['_preventResendingRevisionData'](_0x2f1ec2)):_0x2f1ec2['toVersion']===_0x2d70fe&&_0x2f1ec2['fromVersion']===_0x1d8fa7?_0x57c9d=!0x1:(_0x57fb9d['toVersion']===_0x2d70fe&&_0x57fb9d['fromVersion']===_0x1d8fa7||this['_fixRevision']({'revision':_0x57fb9d,'from':_0x1d8fa7,'to':_0x2d70fe}),_0x57c9d=!0x0),_0x57c9d&&(delete _0x2f1ec2['fromVersion'],delete _0x2f1ec2['toVersion'],delete _0x2f1ec2['diffData'],delete _0x2f1ec2['createdAt'],delete _0x2f1ec2['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2f1ec2),this['_preventResendingRevisionData'](_0x2f1ec2);}else this['_revisionTracker']['addRevisionData'](_0x2f1ec2);}const _0x2f6863=_0x3bb59c['getRevisions']();_0x2f6863['reverse']();for(let _0x23d264=0x0;_0x23d264<_0x2f6863['length']-0x1;_0x23d264++){const _0x211e23=_0x2f6863[_0x23d264],_0x283638=_0x2f6863[_0x23d264+0x1];if(_0x211e23['fromVersion']<_0x283638['toVersion']){const _0x4038b0=_0x283638['toVersion'],_0x2ac8f6=Math['max'](_0x4038b0,_0x211e23['toVersion']);this['_fixRevision']({'revision':_0x211e23,'from':_0x4038b0,'to':_0x2ac8f6});}}}['_fixRevision']({revision:_0x4eacdc,from:_0x310d17,to:_0xfbf19d}={}){const _0xb9fd8d=this['editor']['plugins']['get'](_0x328575),_0x142e61=this['_revisionTracker']['buildRevisionData']({'revision':_0x4eacdc,'from':_0x310d17,'to':_0xfbf19d});_0x142e61['authors']=_0x142e61['authorsIds']['map'](_0x1e55dc=>_0xb9fd8d['getUser'](_0x1e55dc)),_0x4eacdc['_update'](_0x142e61);}['_preventResendingRevisionData'](_0x412574){const _0xa75e5b={};_0xa75e5b['id']=_0x412574['id'];for(const _0x2b326e of Object['keys'](_0x412574))'id'!==_0x2b326e&&(_0xa75e5b[_0x2b326e]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xa75e5b['id'],_0xa75e5b,!0x0);}async['_fetchMissingUsers'](_0x59a0d7){const _0x5304be=this['editor']['plugins']['get'](_0x328575),{connection:_0x5bb678}=this['editor']['plugins']['get'](n),_0x877e6=new Set();for(const _0x1704c4 of _0x59a0d7){for(const _0x2f0f8b of _0x1704c4['authorsIds'])_0x29cb04(_0x2f0f8b);_0x1704c4['creatorId']&&_0x29cb04(_0x1704c4['creatorId']);}if(0x0===_0x877e6['size'])return;const _0x31464d=await lt['getMany'](_0x5bb678,Array['from'](_0x877e6));for(const _0x31d506 of _0x31464d)_0x5304be['getUser'](_0x31d506['id'])||_0x5304be['addUser'](_0x31d506);function _0x29cb04(_0xa24c){_0x5304be['getUser'](_0xa24c)||_0x877e6['add'](_0xa24c);}}}function st(_0x8d747f){return _0x8d747f['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x8d747f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x8d747f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x4216e6{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0x1f794e{['_collapseAt'];constructor(_0x1fc95e,_0x190104=0x6){super(_0x1fc95e);const _0x52b7ca=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x190104,this['bind']('isHidden')['to'](this,'usersCount',_0x442978=>_0x442978<_0x190104),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x52b7ca['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':_0x52b7ca['to']('usersCount',_0x5ab311=>'+'+(_0x5ab311-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x1f794e{['items'];['keystrokes'];constructor(_0x3478dd){super(_0x3478dd);const _0x4be742=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2cea49(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x4be742['if']('hasPopup'),'aria-expanded':_0x4be742['to']('isExpanded',_0x1db8a9=>this['hasPopup']&&String(_0x1db8a9)),'aria-label':_0x4be742['to']('hasPopup',_0x1c75ed=>W(_0x3478dd,_0x1c75ed?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x4be742['to']('hasPopup',_0x7303ba=>!!_0x7303ba&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x4be742['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x4be742['to'](_0xf335ad=>{const _0x4ca5ed=_0xf335ad,_0x3f5f34=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4ece85=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3f5f34?.['contains'](_0x4ca5ed['relatedTarget'])||_0x4ece85?.['contains'](_0x4ca5ed['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x3e5967,_0x2ceaaa,_0x2d8fce)=>{this['element']&&(_0x2d8fce?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class k extends _0x1f794e{['counterView'];['inlineListView'];constructor(_0x3bd03b,_0x598a90=0x6){super(_0x3bd03b);const _0x28434b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0x598a90),this['inlineListView']=new is(_0x3bd03b),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x60f3f8 of this['inlineListView']['items'])_0x60f3f8['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',_0x28434b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0x1f794e{['listWrapperView'];constructor(_0x101354,_0x4fb3d5){super(_0x101354);const _0x438606=this['bindTemplate'];this['listWrapperView']=new pt(_0x101354,_0x4fb3d5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':W(_0x101354,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x438606['to'](_0x3a9bcb=>{const _0xae621b=_0x3a9bcb,_0x457e4e=document['querySelector']('.ck-presence-list__list'),_0x31a2fe=document['querySelector']('.ck-balloon-panel_with-arrow');_0x457e4e?.['contains'](_0xae621b['relatedTarget'])||_0x31a2fe?.['contains'](_0xae621b['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x5c2ac1{constructor(_0x1deaf0,_0x104856){super(_0x1deaf0);const _0x2a94d4=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x104856?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x2a94d4['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x2a94d4['to']('role'),'aria-label':_0x2a94d4['to']('ariaLabel'),'aria-labelledby':_0x2a94d4['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x394bfc['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x38b6b3=this['element'];_0x38b6b3&&(this['_isScrollable']=Math['max'](_0x38b6b3['scrollHeight'],_0x38b6b3['clientHeight'])>0.8*window['innerHeight']);}}class P extends rt{['userView'];constructor(_0x2161e6,_0x36d527,_0x1f30de){super(_0x2161e6);const _0x400f33=this['bindTemplate'];this['userView']=new ct(_0x2161e6,_0x36d527);const _0x5aa4c0={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x36d527['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x36d527['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x36d527['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x1f30de&&(_0x5aa4c0['tag']='button',_0x5aa4c0['on']={'click':_0x400f33['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5aa4c0);}['focus'](){this['element']['focus']();}}class _ extends _0x1f794e{['userView'];['markerView'];constructor(_0x4d7b09,_0x5bdd1a,_0x5147fd){super(_0x4d7b09);const _0x49785f=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x4d7b09,_0x5bdd1a),this['markerView']=new at(_0x4d7b09,_0x5bdd1a);const _0x50b22a=new ot(_0x4d7b09);_0x50b22a['template']['tag']='span',_0x50b22a['text']=_0x5bdd1a['name'];const _0x500470={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x49785f['to']('isFocusable',_0x21c94e=>!!_0x21c94e&&0x0),'aria-labelledby':_0x50b22a['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x49785f['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x49785f['to']('hasTooltip',_0x450756=>!_0x450756),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x50b22a]};_0x5147fd&&(_0x500470['tag']='button',_0x500470['on']={'click':_0x49785f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x500470);}}class at extends _0x1f794e{constructor(_0x48205c,_0x187b96){super(_0x48205c),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x187b96['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x77b109{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x33ece6){super(_0x33ece6),this['context']['config']['define']('presenceList',U);const _0xf887ee=_0x33ece6['config']['get']('presenceList.collapseAt');if('number'!=typeof _0xf887ee)throw new _0x2c6f5e('presencelist-collapseat-invalid-format',this);if(_0xf887ee<0x1)throw new _0x2c6f5e('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x130090(),this['balloonPanelView']=new _0x3b1622(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x181386 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x181386);this['listenTo'](this['_allConnectedUsers'],'add',(_0x11ddda,_0x573c5e)=>{this['_handleUserAdd'](_0x573c5e);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x13fa71,_0x271024)=>{this['_handleUserRemove'](_0x271024);});}['_createView'](){const _0x3c1260=this['context'],_0x5416be=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x40149a=this['balloonPanelView'];if(!_0x2dfc6f(_0x3c1260['config']['get']('presenceList.container')))throw new _0x2c6f5e('presencelist-missing-container',this);return _0x5416be['counterView']['bind']('usersCount')['to'](this),_0x5416be['bind']('isCollapsed')['to'](this,'usersCount',_0x157831=>{const {collapseAt:_0x5ada46}=_0x3c1260['config']['get']('presenceList'),_0x50555f=_0x157831>=_0x5ada46;if(_0x50555f&&!_0x5416be['inlineListView']['items']['find'](_0x4712ee=>_0x4712ee instanceof y)){const _0x4c53ac=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x4c53ac&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x5416be['inlineListView']['items']['add'](_0x5416be['counterView']);}return _0x50555f||this['hideDropdown'](),_0x50555f;}),_0x5416be['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x4fdd14=>{const _0x18a7d6=_0x3c1260['config']['get']('presenceList'),_0x581f20=new _(_0x3c1260['locale'],_0x4fdd14,!!_0x18a7d6['onClick']);return _0x581f20['bind']('hasTooltip')['to'](_0x5416be,'isCollapsed',_0x3d2859=>!_0x3d2859),_0x581f20['bind']('isFocusable')['to'](_0x5416be,'isCollapsed',_0x3e0ec9=>!_0x3e0ec9),_0x18a7d6['onClick']&&this['listenTo'](_0x581f20,'execute',()=>{this['view']['isCollapsed']||_0x18a7d6['onClick'](_0x4fdd14,_0x581f20['element']);}),_0x581f20;}),this['listenTo'](_0x5416be['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x5416be['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x5416be['inlineListView']['keystrokes']['set']('Enter',(_0x10977d,_0x4eefd7)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x4eefd7());}),_0x5416be['render'](),_0x40149a['render'](),_0x36837a({'emitter':_0x5416be,'activator':()=>_0x40149a['isVisible'],'contextElements':[_0x40149a['element'],_0x5416be['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x3c1260['config']['get']('presenceList.container')['appendChild'](_0x5416be['element']),this['_bodyCollection']=new _0xd9147d(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x5416be;}['_handleUserAdd'](_0x6fe0b3){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x6fe0b3['isMe'])return;const _0x244feb=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x244feb-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x58d1c1=_0x6fe0b3['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x6fe0b3,_0x58d1c1);}['_handleUserRemove'](_0x22dfd8){this['usersCount']--;const {collapseAt:_0x4c794c}=this['context']['config']['get']('presenceList'),_0x576aab=this['usersCount']>=_0x4c794c;if(this['currentDisplayedUsers']['get'](_0x22dfd8['id']))this['currentDisplayedUsers']['remove'](_0x22dfd8['id']);else{if(_0x576aab&&this['currentDisplayedUsers']['length']+0x1===_0x4c794c-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x576aab?0x1:0x0)<this['usersCount']){for(const _0x1dd3ab of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x1dd3ab['id'])&&(this['currentDisplayedUsers']['add'](_0x1dd3ab,Math['min'](this['currentDisplayedUsers']['length']-(_0x576aab?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x576aab?0x1:0x0)===_0x4c794c-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x244f9e=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0x244f9e['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1ad8b5}=this['presenceDropdownView'];_0x1ad8b5['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x12054b=>{if(!_0x244f9e['displayMe']&&_0x12054b['isMe'])return null;const _0x446662=new P(this['context']['locale'],_0x12054b,!!_0x244f9e['onClick']);return _0x244f9e['onClick']&&this['listenTo'](_0x446662,'execute',()=>{_0x244f9e['onClick'](_0x12054b,_0x446662['element']);}),_0x446662;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1ad8b5['focus'](),_0x1ad8b5['checkIfScrollable']();const _0x3a090a=(_0x1c2df7,_0x1ecb75)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x1ecb75();};_0x1ad8b5['keystrokes']['set']('Esc',_0x3a090a),_0x1ad8b5['keystrokes']['set']('Shift+Tab',_0x3a090a),_0x1ad8b5['keystrokes']['set']('Tab',(_0xd48395,_0x2796c9)=>{!function(_0x3d0531){const _0x1a2450=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xfd5156=>_0xfd5156+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x1d2cf2=[...document['body']['querySelectorAll'](_0x1a2450)]['filter'](_0x3fe471=>_0x3fe471===document['activeElement']||_0x3fe471['offsetWidth']+_0x3fe471['offsetHeight']>0x0)['sort']((_0x51f6d0,_0x1906ac)=>(_0x51f6d0['tabIndex']||0x0)-(_0x1906ac['tabIndex']||0x0)),_0x4dd541=_0x1d2cf2['indexOf'](_0x3d0531),_0x406a5e=_0x1d2cf2[(_0x4dd541+0x1)%_0x1d2cf2['length']];_0x406a5e&&_0x406a5e['focus']();}(this['view']['element']),this['hideDropdown'](),_0x2796c9();}),_0x1ad8b5['focusTracker']['add'](this['view']['element']),_0x1ad8b5['focusTracker']['on']('change:isFocused',(_0x651882,_0x54b749,_0x22d84e)=>{_0x22d84e||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 gt extends _0x77b109{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x5cd6a6=>0x1!=_0x5cd6a6}};
|