@ckeditor/ckeditor5-real-time-collaboration 46.0.1-alpha.9 → 46.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +2 -2
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x5ad531];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x416ebf){super(_0x416ebf),this['set']('state',_0xaffe2f['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x4622cc())();}['init'](){const _0x234f50=this['context'],_0x15e40a=_0x234f50['plugins']['get']('CloudServices'),_0x1c5045=_0x234f50['plugins']['get'](_0x5ad531);if(!_0x15e40a['token'])throw new _0x5a7f9a('websocketgateway-missing-token',this);if(!_0x15e40a['webSocketUrl'])throw new _0x5a7f9a('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'](_0x15e40a['token'],_0x15e40a['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4763a6=>{if(this['connection']=_0x4763a6,this['bind']('state')['to'](_0x4763a6,'state',this,'_isBrowserOffline',(_0xe14441,_0x2a41c7)=>('connected'!==_0xe14441&&(this['_shouldPluginsReconnect']=!0x0),_0x2a41c7||_0xe14441!==_0xaffe2f['CONNECTED']?_0xaffe2f['DISCONNECTED']:this['state']==_0xaffe2f['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0xaffe2f['CONNECTING']):_0xaffe2f['CONNECTED'])),this['connection']['on']('error',(_0x321222,_0x5735f8)=>{if('limitExceeded'!==_0x5735f8['code'])throw console['error'](_0x5735f8),new _0x5a7f9a('cloudservices-init',null,{'originalError':_0x5735f8});_0x1c5045['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'});}),!_0x4763a6['me'])return new Promise(_0x277304=>_0x4763a6['on']('change:me',_0x277304));})['catch'](_0x11ec37=>{throw console['error'](_0x11ec37),new _0x5a7f9a('cloudservices-init',null,{'originalError':_0x11ec37});});}['addToReconnectionStack'](_0x48d5e3){if('function'!=typeof _0x48d5e3['reconnect'])throw new _0x5a7f9a('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x48d5e3))throw new _0x5a7f9a('websocketgateway-plugin-already-registered',this,{'name':_0x48d5e3['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x48d5e3);}['removeFromReconnectionStack'](_0xf04cbf){this['_reconnectionStack']['delete'](_0xf04cbf);}['isInReconnectionStack'](_0xf36c32){return this['_reconnectionStack']['has'](_0xf36c32);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1766d6=>_0x1766d6['reconnect']())))['then'](()=>this['state']=_0xaffe2f['CONNECTED'])['catch'](_0x2720ab=>{throw console['error'](_0x2720ab),new _0x5a7f9a('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0xaffe2f['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x54d6c2{['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,_0x44651b];}constructor(_0x55de9e){super(_0x55de9e),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2df62c(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x44651b);}['init'](){const _0x5d705f=this['context']['plugins']['get'](n);this['listenTo'](_0x5d705f,'change:state',(_0x40faf8,_0x1be3d3,_0x588396)=>{if('connected'!==_0x588396)this['channelSessions']['forEach'](_0x2f285b=>_0x2f285b['clear']()),this['channelConnectedUsers']['forEach'](_0x1c38bc=>_0x1c38bc['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x43b64d,_0x40bee5]of this['_registeredSessions'])for(const _0x53a864 of _0x40bee5)this['_handleSessionAdd'](_0x43b64d,_0x53a864);}}),this['_createUser'](_0x5d705f['connection']['me'],!0x0);}['register'](_0x2fd456,_0x35d033){if(this['_registeredSessions']['has'](_0x2fd456))throw new _0x5a7f9a('sessions-register-already-registered',null,{'channelId':_0x2fd456});this['_registeredSessions']['set'](_0x2fd456,_0x35d033),this['channelSessions']['set'](_0x2fd456,new _0x2df62c()),this['channelConnectedUsers']['set'](_0x2fd456,new _0x2df62c()),this['listenTo'](_0x35d033,'add',(_0x3c2707,_0x563cb7)=>this['_handleSessionAdd'](_0x2fd456,_0x563cb7)),this['listenTo'](_0x35d033,'remove',(_0x28ab11,_0x3e8a22)=>this['_handleSessionRemove'](_0x2fd456,_0x3e8a22));for(const _0xff58cf of _0x35d033)this['_handleSessionAdd'](_0x2fd456,_0xff58cf);}['unregister'](_0xf03df8){if(!this['_registeredSessions']['has'](_0xf03df8))throw new _0x5a7f9a('sessions-unregister-not-exist',null,{'channelId':_0xf03df8});const _0x3b3e61=this['_registeredSessions']['get'](_0xf03df8);this['stopListening'](_0x3b3e61);for(const _0x43f034 of _0x3b3e61)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0xf03df8,_0x43f034);this['_registeredSessions']['delete'](_0xf03df8),this['channelSessions']['delete'](_0xf03df8),this['channelConnectedUsers']['delete'](_0xf03df8);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x187921){for(const _0x1efc97 of this['channelSessions']['values']())for(const _0x42e6cf of _0x1efc97)if(_0x42e6cf['id']===_0x187921)return _0x42e6cf['user'];}['getUserSessions'](_0x14842d,_0xc70e05){const _0x208022=_0xc70e05?[this['channelSessions']['get'](_0xc70e05)]:this['channelSessions']['values'](),_0x56f61d=new Set();for(const _0x1468ba of _0x208022)for(const _0x9be6bb of _0x1468ba)_0x9be6bb['user']['id']===_0x14842d['id']&&_0x56f61d['add'](_0x9be6bb['id']);return _0x56f61d;}['getUserRole'](_0x45f153){for(const _0x2a37e9 of this['channelSessions']['values']())for(const _0x188a9f of _0x2a37e9)if(_0x188a9f['user']===_0x45f153)return _0x188a9f['role'];}['_handleSessionAdd'](_0xec8a73,_0x472709){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0xcf8f3b=_0x472709['user'],_0x22365b=this['_users']['getUser'](_0xcf8f3b['id'])||this['_createUser'](_0xcf8f3b),_0x3f1406=Object['assign']({},_0x472709,{'user':_0x22365b});this['channelSessions']['get'](_0xec8a73)['add'](_0x3f1406);const _0x33089e=this['channelConnectedUsers']['get'](_0xec8a73);_0x33089e['has'](_0x22365b['id'])||_0x33089e['add'](_0x22365b),this['allConnectedUsers']['has'](_0x22365b['id'])||this['allConnectedUsers']['add'](_0x22365b,_0x22365b['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0xec8a73,{'channelId':_0xec8a73,'session':_0x3f1406});}['_handleSessionRemove'](_0x4aab7,_0x24ee7b){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x57738a=this['channelConnectedUsers']['get'](_0x4aab7),_0xbc34c1=_0x24ee7b['user'];_0xbc34c1['id']&&(this['channelSessions']['get'](_0x4aab7)['remove'](_0x24ee7b['id']),_0x57738a['has'](_0xbc34c1['id'])&&!this['getUserSessions'](_0xbc34c1,_0x4aab7)['size']&&_0x57738a['remove'](_0xbc34c1['id']),this['allConnectedUsers']['get'](_0xbc34c1['id'])&&!this['getUserSessions'](_0xbc34c1)['size']&&this['allConnectedUsers']['remove'](_0xbc34c1['id']));}['_createUser'](_0x516212,_0x3427cf){const _0x18f6a4=this['_users']['addUser'](_0x516212);return _0x3427cf&&this['_users']['defineMe'](_0x516212['id']),_0x18f6a4['orderNumber']=this['_uniqueUsersCount']++,_0x18f6a4;}}class G extends _0x83d4b3{['_domEmitter']=new(_0x4622cc())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x38d33a=this['editor'],_0x1a67be=_0x38d33a['plugins']['get'](i);_0x38d33a['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x105d45,{writer:_0x54f201})=>function(_0x351f7c,_0x999b9d,_0x5064a1,_0x2e23d0){const _0x5bbe88=_0x351f7c['markerName']['split'](':')[0x2],_0x4865a5=_0x5064a1['getUserBySessionId'](_0x5bbe88);if(!_0x4865a5||_0x5bbe88===_0x5064a1['mySessionId'])return;if(!_0x2e23d0['model']['schema']['checkChild'](_0x351f7c['markerRange']['start'],'$text'))return;const _0x4788bd={'class':'ck-user__marker\x20'+_0x4865a5['color']['getMarkerClass'](),'data-name':_0x4865a5['name'],'data-session-id':_0x5bbe88},_0x1fb29c=_0x2e23d0['model']['markers']['get'](_0x351f7c['markerName']),_0x4d3374=_0x1fb29c['getStart'](),_0x17db1c=_0x4d3374['nodeAfter'],_0x5100d7=_0x2e23d0['model']['schema'];if(_0x17db1c&&_0x5100d7['isObject'](_0x17db1c)&&_0x5100d7['isInline'](_0x17db1c)&&!_0x2e23d0['model']['markers']['get']('user:range:'+_0x5bbe88)['getRange']()['isCollapsed'])return;const _0x56461c=_0x4d3374['parent'];return _0x2e23d0['model']['schema']['isLimit'](_0x56461c)&&!_0x2e23d0['model']['hasContent'](_0x56461c)&&(_0x4788bd['contenteditable']=!0x1),function(_0x5b68dc,_0x3406c3,_0xe6046c){const _0x16a823=_0x5b68dc['createUIElement']('span',_0x3406c3);return _0x5b68dc['setCustomProperty']('userPositionMarker',!0x0,_0x16a823),_0x16a823['render']=function(_0x5e547c){const _0x8d8a3=this['toDomElement'](_0x5e547c),_0x3bb00e=document['createElement']('span');return _0x3bb00e['classList']['add']('ck-user__marker-tooltip'),_0x3bb00e['setAttribute']('contenteditable','false'),_0x3bb00e['setAttribute']('spellcheck','false'),_0x3bb00e['textContent']=_0xe6046c['name'],_0x8d8a3['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3bb00e['outerHTML']+'',_0x8d8a3['addEventListener']('mouseenter',()=>{_0x8d8a3['classList']['add']('ck-user__marker_hovered');}),_0x8d8a3['addEventListener']('mouseleave',()=>{_0x8d8a3['classList']['remove']('ck-user__marker_hovered');}),_0x8d8a3;},_0x16a823['isSimilar']=function(_0x2bb743){return!(!this['getCustomProperty']('userPositionMarker')||!_0x2bb743['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x2bb743['getAttribute']('data-session-id'));},_0x16a823;}(_0x999b9d,_0x4788bd,_0x4865a5);}(_0x105d45,_0x54f201,_0x1a67be,_0x38d33a)}),_0x38d33a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1df74d=>function(_0x43692f,_0x24dc3e){const _0x35ba8f=_0x43692f['markerName']['split'](':')[0x2];if(_0x35ba8f===_0x24dc3e['mySessionId'])return null;const _0x4cbce9=_0x24dc3e['getUserBySessionId'](_0x35ba8f);if(!_0x4cbce9)return{'id':_0x35ba8f,'classes':[]};return{'id':_0x35ba8f,'classes':['ck-user__selection',_0x4cbce9['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x35ba8f},'priority':0x7d0+_0x4cbce9['orderNumber']};}(_0x1df74d,_0x1a67be)}),function(_0x487717){const _0x32838b=_0x487717['model'],_0x2c766c=new Map(),_0x53eb7e=_0x487717['plugins']['get'](i);_0x32838b['markers']['on']('update:user:range',(_0x189192,_0x401bec,_0x11cd74,_0x54e1d0)=>{if(!_0x54e1d0&&_0x2c766c['get'](_0x401bec['name']))return _0x2c766c['get'](_0x401bec['name'])['detach'](),void _0x2c766c['delete'](_0x401bec['name']);const _0x51513c=_0x401bec['name']['split'](':')[0x2];if(_0x51513c===_0x53eb7e['mySessionId'])return;const _0x56f335='user:position:'+_0x51513c;_0x32838b['markers']['has'](_0x56f335)&&_0x487717['editing']['reconvertMarker'](_0x56f335),_0x401bec['on']('change:range',(_0x5514ec,_0x22bdd6,_0x3e427c)=>{if('$graveyard'!=_0x22bdd6['root']['rootName']&&'$graveyard'==_0x401bec['getRange']()['root']['rootName']&&!_0x2c766c['has'](_0x401bec['name'])){const _0x2c147e=_0x32838b['schema']['getNearestSelectionRange'](_0x3e427c['deletionPosition']);if(_0x2c147e){const _0x8727b4=_0x5e7257['fromRange'](_0x2c147e);_0x2c766c['set'](_0x401bec['name'],_0x8727b4),_0x8727b4['on']('change:range',(_0x1b9653,_0x59bd2a,_0xf08d17)=>{if('$graveyard'==_0x8727b4['root']['rootName']){const _0x23e09a=_0x32838b['schema']['getNearestSelectionRange'](_0xf08d17['deletionPosition']);_0x23e09a?(_0x8727b4['start']=_0x23e09a['start'],_0x8727b4['end']=_0x23e09a['end']):(_0x2c766c['delete'](_0x401bec['name']),_0x8727b4['detach']());}});}}});}),_0x32838b['document']['on']('change',()=>{_0x2c766c['size']>0x0&&_0x32838b['enqueueChange']({'isUndoable':!0x1},_0x141e42=>{for(const [_0x5ad199,_0x2e725a]of _0x2c766c)'$graveyard'==_0x32838b['markers']['get'](_0x5ad199)['getRange']()['root']['rootName']&&(te(_0x5ad199['split'](':')[0x2],_0x2e725a['toRange'](),_0x32838b,_0x141e42),_0x2e725a['detach']());_0x2c766c['clear']();});});}(_0x38d33a),this['_domEmitter']['listenTo'](_0x182909['document'],'keydown',(_0x593d20,{key:_0x47457d})=>{'Escape'===_0x47457d&&function(_0x121d22){_0x121d22['editing']['view']['change'](_0x34de0f=>{for(const _0x23d6d7 of _0x121d22['model']['markers']){if(!_0x23d6d7['name']['startsWith']('user:position'))continue;const _0x5655de=_0x121d22['editing']['mapper']['markerNameToElements'](_0x23d6d7['name']);if(_0x5655de){for(const _0x5a38da of _0x5655de)_0x34de0f['removeClass']('ck-user__marker_hovered',_0x5a38da);}}});}(_0x38d33a);},{'useCapture':!0x0});}['afterInit'](){const _0x45f317=this['editor'],_0x58040b=_0x45f317['commands']['get']('undo');_0x58040b&&_0x45f317['model']['on']('applyOperation',(_0xf4b4ec,_0x11ca03)=>{const _0x3e4fec=_0x11ca03[0x0];if(!_0x3e4fec['isDocumentOperation'])return;if('marker'!=_0x3e4fec['type']||!_0x3e4fec['name']['startsWith']('user:'))return;const _0x509317=_0x3e4fec['batch'];_0x58040b['_createdBatches']['has'](_0x509317)&&(_0x3e4fec['newRange']=_0x3e4fec['oldRange']?_0x45f317['model']['createRange'](_0x3e4fec['oldRange']['start'],_0x3e4fec['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x5d97ce=this['editor'],_0x569441=_0x5d97ce['model']['document'],_0x262c73=_0x5d97ce['plugins']['get'](i);_0x5d97ce['model']['enqueueChange']({'isUndoable':!0x1},_0x63fa2=>{const _0x209ca6='user:range:'+_0x262c73['mySessionId'],_0x5a221d='user:position:'+_0x262c73['mySessionId'],_0x280f7f=_0x5d97ce['model']['markers']['has'](_0x209ca6);_0x5d97ce['editing']['view']['hasDomSelection']?te(_0x262c73['mySessionId'],_0x569441['selection']['getFirstRange'](),_0x5d97ce['model'],_0x63fa2):_0x280f7f&&(_0x63fa2['removeMarker'](_0x209ca6),_0x63fa2['removeMarker'](_0x5a221d));});}}function te(_0x5f032a,_0xd5afcc,_0x275679,_0x194f24){const _0x59972a='user:range:'+_0x5f032a,_0xfce14a='user:position:'+_0x5f032a,_0x3393c0=_0xd5afcc['getContainedElement']();let _0x4ac30d=_0xd5afcc['start'];if(_0x3393c0&&_0x3393c0['is']('element','tableCell')){const _0x28c6ff=function(_0x1c015,_0x3687e7){for(const _0x34e7b9 of _0x1c015['getPositions']())if(_0x3687e7['schema']['checkChild'](_0x34e7b9,'$text'))return _0x34e7b9;}(_0xd5afcc,_0x275679);_0x28c6ff&&(_0x4ac30d=_0x28c6ff,_0xd5afcc=_0x194f24['createRange'](_0x4ac30d));}const _0x5190b6=_0x194f24['createRange'](_0x4ac30d);_0x275679['markers']['has'](_0x59972a)?(_0x194f24['updateMarker'](_0x59972a,{'range':_0xd5afcc}),_0x194f24['updateMarker'](_0xfce14a,{'range':_0x5190b6})):(_0x194f24['addMarker'](_0x59972a,{'range':_0xd5afcc,'usingOperation':!0x0}),_0x194f24['addMarker'](_0xfce14a,{'range':_0x5190b6,'usingOperation':!0x0}));}function $(_0x2b9964,_0x571945,_0x49bff6){const _0x15d78c=_0x2b9964['t'],t=_0x2b9964['t'];switch(_0x571945){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 _0x15d78c({'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'},_0x49bff6);default:return'';}}let Q=0x1;class l extends _0x83d4b3{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x6bb664)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x1974f4,_0x44651b,_0x5ad531];}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 _0x4743ba=this['serverHistory']['getOperations']();for(let _0x32dd1b=_0x4743ba['length']-0x1;_0x32dd1b>=0x0;_0x32dd1b--){const _0x440697=_0x4743ba[_0x32dd1b];if(!this['_disconnectionOperations']['has'](_0x440697))return _0x440697['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0xac9b5b){if(super(_0xac9b5b),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x2ca8da(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x5a7f9a('collaboration-missing-channelid',this);const _0x4c3708=_0xac9b5b['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x4c3708,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x935a69(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new Z(this['_disconnectionOperations']);}['init'](){const _0x1bf4ea=this['editor'],_0x346efc=_0x1bf4ea['plugins']['get'](_0x44651b),_0xf129d=_0x1bf4ea['plugins']['get'](n);this['listenTo'](_0x346efc,'getOperationAuthor',(_0x38b762,_0x432b94)=>{const _0x340c15=_0x432b94[0x0];_0x340c15['_authorId']&&(_0x38b762['return']=_0x346efc['getUser'](_0x340c15['_authorId']),_0x38b762['stop']()),null===_0x340c15['_authorId']&&(_0x38b762['return']=null,_0x38b762['stop']());},{'priority':'high'}),this['listenTo'](_0x1bf4ea['model']['document']['selection'],'change:range',(_0x2de23d,_0x2ae869)=>{_0x2ae869['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1bf4ea['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1bf4ea['model']['on']('applyOperation',(_0x40d1f1,_0x59054c)=>{const _0x1d4ca1=_0x59054c[0x0];_0x1d4ca1['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1d4ca1),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0xf129d,'state',this,'_hasSynchronizationProblem',(_0x46d3f2,_0x22905a)=>'connected'===_0x46d3f2&&!_0x22905a),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1bf4ea['disableReadOnlyMode']('rtc-offline'):_0x1bf4ea['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1bf4ea['disableReadOnlyMode']('rtc-offline'):_0x1bf4ea['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x2e847d=this['editor']['plugins']['get'](i),_0x1d5a86=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x2e847d['unregister'](this['_channelId']);const _0xbea9c8=await this['_service']['reconnect'](_0x1d5a86['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0xbea9c8)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x32a656=await this['_service']['getConnectedSessions']();_0x2e847d['register'](this['_channelId'],_0x32a656),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x252176){if(function(_0xf83f3){return'404'===_0xf83f3['code'];}(_0x252176)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x588e86){return'409'===_0x588e86['code'];}(_0x252176)){const _0x1aaa9f=$(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'](_0x1aaa9f);}else{if(!(_0x252176 instanceof X))throw _0x252176;this['_handleReconnectionError']();}}}}['destroy'](){const _0x13bb6f=this['editor']['plugins']['get'](n),_0x532bfa=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x532bfa['channelSessions']['has'](this['_channelId'])&&_0x532bfa['unregister'](this['_channelId']),_0x13bb6f['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x4fbfbf){if(this['sessionId']!==_0x4fbfbf['sessionId']&&this['_lastSyncedOperationId']!==_0x4fbfbf['lastOperationId'])throw new X();return this['sessionId']=_0x4fbfbf['sessionId'],this['_handleServerResponse']([],{..._0x4fbfbf,'wereChangesApplied':!0x1,'data':_0x4fbfbf['data']},'reconnect');}async['_connectService'](_0x2305cb,_0x24540f=!0x1){const {connection:_0x390398}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x390398,this['_channelId'])['then'](_0x5e3d61=>this['_initSessionsHandling'](_0x5e3d61))['catch'](_0x4b9999=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x4b9999);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x52df07,_0x1b9a2c)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1b9a2c);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x81d72a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2305cb);this['_isPendingUpdate']=!0x0;const _0xd675e8=await this['_service']['connect'](_0x390398,this['_compressOperations'](_0x2305cb),_0x81d72a);if(this['sessionId']=_0xd675e8['sessionId'],_0x24540f){if(!_0xd675e8['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0xd675e8['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2305cb,_0xd675e8,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0xd675e8,_0x2305cb);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x311996=this['editor']['plugins']['get'](i),_0x1c5001=this['editor']['plugins']['get'](G),_0x1fcea7=_0x311996['channelSessions']['get'](this['_channelId']);_0x1fcea7&&_0x1fcea7['length']>0x1?_0x1c5001['createUserMarkerOperations']():this['listenTo'](_0x311996,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x311996['channelSessions']['get'](this['_channelId'])['length']&&_0x1c5001['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x232330,_0x30f19c,_0xfbf22a,_0x36b70f){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x30f19c){const _0x5bc0a3=this['_decompressOperations'](_0xfbf22a,_0x36b70f);await this['_fetchMissingUsers'](_0x5bc0a3),this['_handleExternalOperations'](_0x5bc0a3,_0x30f19c,_0xfbf22a['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x21612e}=this['editor'];let _0x565da0;try{_0x565da0=await this['_service']['getDocumentDetails']();}catch{const _0x24327a=$(_0x21612e,'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'](_0x24327a);}const _0x523838=_0x565da0['currentDocumentSession']||_0x565da0['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x523838['lastOperationId']){const _0xe1ef6=$(_0x21612e,'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'](_0xe1ef6);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x450df7){const _0x59ded7=this['editor']['plugins']['get'](i);this['listenTo'](_0x59ded7,'sessionAdd:'+this['_channelId'],(_0x3cc975,{session:_0xe6d3fa})=>{if(_0xe6d3fa['id']===_0x59ded7['mySessionId']){_0x3cc975['off']();const _0x2fd340=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x1e6231=_0xe6d3fa['permissions'];_0x2fd340&&_0x2fd340['isEnabled']&&(_0x1e6231=_0x1e6231['filter'](_0x29e21f=>'document:write'!==_0x29e21f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x1e6231,this['_channelId']);}}),_0x59ded7['register'](this['_channelId'],_0x450df7);}['_initThrowingOnDataSet'](){const _0x5ed8b4=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x173629)=>{if(!_0x173629[_0x173629['length']-0x1]['suppressErrorInCollaboration'])throw new _0x5a7f9a('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x5ed8b4['apply'](this['editor']['data'],_0x173629);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x22c43d,[_0x1d0bd5])=>{if(this['_document']['version'])throw new _0x5a7f9a('realtimecollaborationclient-init-document-already-initialized',this);_0x22c43d['stop'](),this['_setPendingAction']();const _0x3132a7=this['editor']['config']['get']('rootsAttributes'),_0x322b11=this['_getOperationsFromInitData'](_0x1d0bd5,_0x3132a7);0x0==_0x322b11['length']&&_0x322b11['push'](new _0x103c6b(0x0)),_0x22c43d['return']=this['_connectService'](_0x322b11)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x1ea63e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x1ea63e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0xa7ba70,[_0x303c4d,_0xc8fe96])=>{_0xa7ba70['stop']();const _0x50488e=this['editor']['model']['document']['getRoot'](_0x303c4d);if(!this['_knownRootNames']['has'](_0x303c4d)){const _0x472530=_0xc8fe96&&_0xc8fe96['data']?_0xc8fe96['data']:'',_0x11778b=_0xc8fe96&&_0xc8fe96['attributes']?_0xc8fe96['attributes']:{};await this['_loadRoot'](_0x303c4d,_0x472530,_0x11778b);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x50488e['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x50488e);});},{'priority':'high'});}async['_fetchMissingUsers'](_0xfebe94){const _0x38a6a6=this['editor']['plugins']['get'](_0x44651b),{connection:_0x5e2bde}=this['editor']['plugins']['get'](n),_0x4ed939=new Set();for(const _0x25fd2c of _0xfebe94){const _0x1b5552=_0x25fd2c['_authorId'];_0x1b5552&&!_0x38a6a6['getUser'](_0x1b5552)&&_0x4ed939['add'](_0x1b5552);}if(0x0===_0x4ed939['size'])return;const _0x5e9f25=await ct['getMany'](_0x5e2bde,Array['from'](_0x4ed939));for(const _0x18e948 of _0x5e9f25)_0x38a6a6['getUser'](_0x18e948['id'])||_0x38a6a6['addUser'](_0x18e948);}['_getOperationsFromInitData'](_0x51a0d1,_0xf4d8a0={}){const _0x44cc19=this['editor']['model'],_0x4abf7f=[];let _0x5dad07=0x0;const _0x23d203='string'==typeof _0x51a0d1?{'main':_0x51a0d1}:_0x51a0d1;for(const _0x3beb76 of Object['keys'](_0x23d203)){if(!this['_document']['roots']['has'](_0x3beb76))throw new _0x5a7f9a('realtimecollaborationclient-init-non-existent-root',this);const _0x59bfb0=this['editor']['data']['parse'](_0x23d203[_0x3beb76]),_0x4a517b=this['_document']['getRoot'](_0x3beb76),_0x46dab9=new _0x48c7f8(_0x44cc19['createPositionAt'](_0x4a517b,0x0),_0x59bfb0,_0x5dad07++);_0x4abf7f['push'](_0x46dab9);for(const [_0x266cec,_0x53300a]of _0x59bfb0['markers']){const _0x356c9e=_0x44cc19['createRange'](_0x44cc19['createPositionFromPath'](_0x4a517b,_0x53300a['start']['path']['slice']()),_0x44cc19['createPositionFromPath'](_0x4a517b,_0x53300a['end']['path']['slice']())),_0x53a822=new _0x508768(_0x266cec,null,_0x356c9e,_0x44cc19['markers'],!0x0,_0x5dad07++);_0x4abf7f['push'](_0x53a822);}}if(_0xf4d8a0)for(const [_0x598830,_0x4a9de6]of Object['entries'](_0xf4d8a0)){const _0x44cd83=_0x44cc19['document']['getRoot'](_0x598830);if(!_0x44cd83)throw new _0x5a7f9a('multi-root-editor-root-attributes-no-root',null);for(const [_0x2f3a97,_0x2d2bd5]of Object['entries'](_0x4a9de6))if(null!==_0x2d2bd5){const _0x1f5772=new _0x5cc0bb(_0x44cd83,_0x2f3a97,null,_0x2d2bd5,_0x5dad07++);_0x4abf7f['push'](_0x1f5772);}}return _0x4abf7f;}async['_loadRoot'](_0x59f991,_0x152e95,_0x57776a){this['_getOperationsFromInitData']({[_0x59f991]:_0x152e95},{[_0x59f991]:_0x57776a})['forEach']((_0x39c495,_0xd10b56)=>{_0x39c495['baseVersion']=this['_document']['version']+_0xd10b56,_0x39c495['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x39c495);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x316706,_0x126b5e){let _0x31c64;this['_offset']=_0x316706['offset'];const _0x54b5d6=_0x316706['wereChangesApplied']&&!_0x316706['initData'],_0x410102=_0x54b5d6?0x0:_0x316706['data']['baseVersion'];if(_0x126b5e['forEach'](_0xf1d8b0=>{_0xf1d8b0['_isInit']=!0x0,_0xf1d8b0['createdAt']=_0x316706['sessionCreatedAt'],_0xf1d8b0['_authorId']=null;}),_0x54b5d6)_0x31c64=_0x126b5e,this['_applyOperationsSet'](_0x31c64,_0x54b5d6);else{if(_0x316706['initData']){const _0x107243=this['_getOperationsFromInitData'](_0x316706['initData']);this['_document']['history']['version']=-_0x107243['length'],_0x107243['forEach'](_0x53cae4=>{_0x53cae4['baseVersion']-=_0x107243['length'],_0x53cae4['createdAt']=_0x316706['sessionCreatedAt'],_0x53cae4['_isInit']=!0x0,_0x53cae4['_authorId']=null;}),this['_applyOperationsSet'](_0x107243,!0x0),this['serverHistory']['version']=-_0x107243['length']+this['_offset'],this['_updateServerHistory'](_0x107243);}this['_document']['history']['version']=_0x410102,_0x31c64=this['_decompressOperations'](_0x316706['data'],_0x316706['metadata']),await this['_fetchMissingUsers'](_0x31c64),this['_applyOperationsSet'](_0x31c64,_0x54b5d6);}_0x316706['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x31c64,_0x316706['lastOperationId']),this['_lastSyncedOperationId']=_0x316706['lastOperationId']),this['serverHistory']['version']=_0x410102+this['_offset'],this['_updateServerHistory'](_0x31c64),_0x126b5e['filter'](_0x2b9543=>{const _0x4c9df8=this['_getAffectedRoot'](_0x2b9543);return _0x4c9df8&&!this['_knownRootNames']['has'](_0x4c9df8);})['forEach']((_0x5c31bc,_0x3646c9)=>{_0x5c31bc['baseVersion']=this['_document']['version']+_0x3646c9,this['_saveOperationInBuffer'](_0x5c31bc);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x384774,_0x353cb6){const _0xf4fa83=_0x353cb6&&_0x353cb6['message'];if(_0xf4fa83&&_0xf4fa83['startsWith']('realtimecollaborationclient'))throw _0x353cb6;const _0x476285=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x476285['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x5a7f9a(_0x384774,this['editor'],_0xf4fa83?{'originalError':_0xf4fa83}:void 0x0);}['_saveOperationInBuffer'](_0x394032){this['_knownOperations']['has'](_0x394032)||(this['_knownOperations']['add'](_0x394032),this['_bufferedOperations']['push'](_0x394032),this['_pendingAction']||'marker'==_0x394032['type']&&!_0x394032['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0xd8433a=!0x1){!_0xd8433a&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2a10e5=>{_0x2a10e5&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x496d80=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5dbffd){return _0x5dbffd['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5dbffd['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5dbffd['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x496d80)||this['_crash'](_0x496d80['message'],_0x496d80);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x5e3d5b=>{this['on']('change:_isPendingUpdate',()=>{_0x5e3d5b();});});}async['_sendBufferedOperations'](){const _0x18e01b=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x18e01b['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x98e9df=[...this['_bufferedOperations']];for(const _0x14c922 of _0x98e9df)_0x14c922['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x14c922);const _0x3db98f=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x98e9df),_0x5c903f=Q++,_0x140d6f=this['_compressOperations'](_0x98e9df),_0xd973aa=await this['_service']['sendOperations'](_0x140d6f,_0x140d6f['baseVersion'],_0x3db98f);try{return await this['_handleServerResponse'](_0x98e9df,_0xd973aa,_0x5c903f);}catch(_0xf0359f){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0xf0359f);}}async['_handleServerResponse'](_0x4dc026,_0x1cccb3,_0x2ff2a0){if('error'in _0x1cccb3)throw _0x1cccb3['error'];let _0x22c604=!0x1;if(_0x1cccb3['wereChangesApplied']){_0x1cccb3['lastOperationId']&&(this['_lastSyncedOperationId']=_0x1cccb3['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x235ccd=>!_0x4dc026['includes'](_0x235ccd));for(const _0x58c32d of _0x4dc026)_0x58c32d['createdAt']='lastOperationAcceptedAt'in _0x1cccb3&&_0x1cccb3['lastOperationAcceptedAt']||void 0x0;Y(_0x4dc026,_0x1cccb3['version']-_0x4dc026['length']),this['_updateServerHistory'](_0x4dc026);const _0x1089e0=_0x4dc026['filter'](_0x34df91=>{if(!_0x34df91['_isInit'])return!0x1;const _0x12901f=this['_getAffectedRoot'](_0x34df91);return _0x12901f&&!this['_knownRootNames']['has'](_0x12901f);});Y(_0x1089e0,this['_document']['version']),this['_applyOperationsSet'](_0x1089e0),_0x22c604=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x1b3d94=this['_decompressOperations'](_0x1cccb3['data'],_0x1cccb3['metadata'])['filter'](_0x13f5ab=>_0x13f5ab['baseVersion']>=this['_lastServerVersion']);_0x1b3d94['forEach'](_0x337ca8=>this['_addKnownRoot'](_0x337ca8)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x593ea3=>!_0x593ea3['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x593ea3))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x1b3d94),_0x22c604=this['_handleExternalOperations'](_0x1b3d94,_0x1cccb3['version'],_0x1cccb3['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x22c604?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5db13b,_0x1959a0,_0x3751ef){try{const _0x9dbdb7={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3091d1,operationsB:_0x591924,originalOperations:_0x1d1b62}=_0x11693f(_0x5db13b,this['_bufferedOperations'],_0x9dbdb7);Y(_0x3091d1,this['_document']['version']),Y(_0x591924,_0x1959a0);for(const _0xfc1ec4 of _0x3091d1){const _0x272647=_0x1d1b62['get'](_0xfc1ec4);_0xfc1ec4['_authorId']=_0x272647?_0x272647['_authorId']:null;}_0x3751ef&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5db13b,_0x3751ef),this['_lastSyncedOperationId']=_0x3751ef),this['_bufferedOperations']=[..._0x591924],this['_applyOperationsSet'](_0x3091d1),this['_updateServerHistory'](_0x5db13b);}catch(_0x5db220){return console['error'](_0x5db220),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3ca10f,_0x5c2c48=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x244094=>{for(const _0x46453b of _0x3ca10f)this['_knownOperations']['add'](_0x46453b),this['_addKnownRoot'](_0x46453b),_0x244094['batch']['addOperation'](_0x46453b),this['editor']['model']['applyOperation'](_0x46453b);});}['_addKnownRoot'](_0x1696da){const _0x47b0a8=this['_getAffectedRoot'](_0x1696da);_0x47b0a8&&this['_knownRootNames']['add'](_0x47b0a8);}['_getAffectedRoot'](_0x4b72a5){let _0x2f2c8b,_0x43bf44;switch(_0x4b72a5['type']){case'insert':_0x2f2c8b=_0x4b72a5['position']['root'];break;case'marker':if(_0x43bf44=_0x4b72a5['newRange'],!_0x43bf44)return null;_0x2f2c8b=_0x43bf44['root'];break;case'addRootAttribute':_0x2f2c8b=_0x4b72a5['root'];break;case'addRoot':_0x2f2c8b=_0x4b72a5['affectedSelectable'];break;case'move':_0x2f2c8b=_0x4b72a5['targetPosition']['root'];break;default:return null;}return _0x2f2c8b['rootName'];}['_updateServerHistory'](_0x163a30){_0x163a30['forEach'](_0x5d1185=>{const _0x5b13ec=_0x5d1185['clone']();_0x5b13ec['_authorId']=_0x5d1185['_authorId'],_0x5b13ec['_isInit']=!!_0x5d1185['_isInit'],_0x5b13ec['createdAt']=_0x5d1185['createdAt'],_0x5b13ec['baseVersion']+=this['_offset'],_0x5d1185['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5b13ec),this['serverHistory']['addOperation'](_0x5b13ec);});}['_handleReconnectionError'](_0x47d007){const _0x560c28=this['editor']['plugins']['get']('Notification'),_0x41b1b3=this['editor']['locale'];_0x47d007||(_0x47d007=$(_0x41b1b3,'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.')),_0x560c28['showWarning'](_0x47d007,{'title':$(_0x41b1b3,'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'](_0x1974f4)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1974f4)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x4451c9){const _0x52ac6c=_0x4451c9['map'](_0x254a90=>_0x254a90['toJSON']());return this['_compressor']['compress'](_0x52ac6c);}['_decompressOperations'](_0x3ad752,_0x1ac139){return this['_compressor']['decompress'](_0x3ad752)['map']((_0x4b9a83,_0x448c0f)=>{const _0x3cf184='init'==_0x1ac139[_0x448c0f]['type'];if('InsertOperation'==_0x4b9a83['__className']){const _0xa5e678=_0x4b9a83['position']['root'];!this['_document']['getRoot'](_0xa5e678)&&(this['_document']['createRoot']('$root',_0xa5e678)['_isAttached']=!0x1);}const _0x56ea8f=_0x2e1c25['fromJSON'](_0x4b9a83,this['_document']);return _0x56ea8f['wasUndone']=_0x4b9a83['wasUndone'],_0x56ea8f['_isInit']=_0x3cf184,_0x56ea8f['_authorId']=_0x3cf184?null:_0x1ac139[_0x448c0f]['userId'],_0x56ea8f['_isDisconnection']='cs:removeUser'===_0x1ac139[_0x448c0f]['type'],_0x56ea8f['createdAt']=_0x1ac139[_0x448c0f]['createdAt'],_0x56ea8f;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4feed9=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4feed9&&_0x4feed9['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x284cae,_0x539b19){for(const _0x37d58b of _0x284cae)_0x37d58b['baseVersion']=_0x539b19++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0x552a3a){this['_ignoredOperations']=_0x552a3a,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xcab168){let _0x565b64=_0xcab168['length'];for(;_0x565b64--;){const _0x455fa4=_0xcab168[_0x565b64];if(!this['_ignoredOperations']['has'](_0x455fa4)){if(!this['_operationToId']['has'](_0x455fa4)){const _0x275efa=_0x323430()['slice'](0x1,0x12);this['_operationToId']['set'](_0x455fa4,_0x275efa);}return this['_operationToId']['get'](_0x455fa4);}}}['setIdForTheLastOperation'](_0x556c8a,_0x2e7102){if(!_0x2e7102)return;let _0x5b0059=_0x556c8a['length'];for(;_0x5b0059--;){const _0xbb751=_0x556c8a[_0x5b0059];this['_ignoredOperations']['has'](_0xbb751)||this['_operationToId']['set'](_0xbb751,_0x2e7102);}}}class a extends _0x83d4b3{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x54d6c2{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x47a792)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x44651b];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x199a6a){super(_0x199a6a),this['_services']=new Map();}async['init'](){const _0x26aab6=this['context'],_0x13f32c=_0x26aab6['plugins']['get']('CommentsRepository');if(_0x26aab6['plugins']['get'](n)['addToReconnectionStack'](this),_0x13f32c['adapter']={'addCommentThread':async({channelId:_0x1fe1ee,threadId:_0x248d51,comments:_0x358d18,resolvedAt:_0x1e1b6b,resolvedBy:_0x529189,context:_0x446c5a,attributes:_0x29b25c})=>{const _0x7a9677=await this['_getService'](_0x1fe1ee)['addCommentThread']({'commentThreadId':_0x248d51,'comments':_0x358d18['map'](_0xb15ffa=>function(_0x59ed98,_0x579dfd,_0x275e84){return{'commentThreadId':_0x275e84,'commentId':_0x59ed98['commentId'],'userId':_0x59ed98['authorId'],'content':_0x59ed98['content'],'documentId':_0x579dfd,'createdAt':_0x59ed98['createdAt'],'attributes':_0x59ed98['attributes']||{}};}(_0xb15ffa,_0x1fe1ee,_0x248d51)),'resolvedAt':_0x1e1b6b,'resolvedBy':_0x529189,'context':_0x446c5a,'attributes':_0x29b25c})['catch'](at);return{'threadId':_0x7a9677['commentThreadId'],'comments':_0x7a9677['comments']};},'getCommentThread':async({channelId:_0x508358,threadId:_0x25112b})=>{const _0x23a85e=await this['_getService'](_0x508358)['getCommentThread'](_0x25112b)['catch'](at);return _0x23a85e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x23a85e]),{'threadId':_0x23a85e['commentThreadId'],'comments':_0x23a85e['comments']['map'](B),'context':_0x23a85e['context'],'resolvedAt':_0x23a85e['resolvedAt'],'resolvedBy':_0x23a85e['resolvedBy'],'attributes':_0x23a85e['attributes']||{}});},'updateCommentThread':async({channelId:_0x30f8ea,threadId:_0x4447ca,context:_0x5559e7,unlinkedAt:_0x1bfd87,attributes:_0x2045cf})=>this['_getService'](_0x30f8ea)['updateCommentThread']({'commentThreadId':_0x4447ca,'context':_0x5559e7,'attributes':_0x2045cf,'unlinkedAt':_0x1bfd87})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x1235d8,threadId:_0x42bf4d})=>{const _0x18644d=await this['_getService'](_0x1235d8)['resolveCommentThread'](_0x42bf4d)['catch'](F)['catch'](at);return{'threadId':_0x18644d['commentThreadId'],'resolvedAt':_0x18644d['resolvedAt'],'resolvedBy':_0x18644d['resolvedBy']};},'reopenCommentThread':async({channelId:_0x4f4609,threadId:_0x5a733b})=>this['_getService'](_0x4f4609)['reopenCommentThread'](_0x5a733b)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x4a0ad4,threadId:_0x57ef1c})=>this['_getService'](_0x4a0ad4)['removeCommentThread'](_0x57ef1c)['catch'](F)['catch'](at),'addComment':({channelId:_0x38eecd,threadId:_0x5ddc31,commentId:_0x59c15b,content:_0x38e7ef,attributes:_0x493cd2})=>this['_getService'](_0x38eecd)['addComment'](_0x5ddc31,_0x59c15b,_0x38e7ef,_0x493cd2)['catch'](at),'updateComment':({channelId:_0x441506,threadId:_0x50e187,commentId:_0x2517d2,content:_0x799a5f,attributes:_0x2051a2})=>this['_getService'](_0x441506)['updateComment'](_0x50e187,_0x2517d2,_0x799a5f,_0x2051a2)['catch'](F)['catch'](at),'removeComment':({channelId:_0x5c0416,threadId:_0x26e3cf,commentId:_0x45cf0a})=>this['_getService'](_0x5c0416)['removeComment'](_0x26e3cf,_0x45cf0a)['catch'](F)['catch'](at)},_0x26aab6 instanceof _0x34d227){const _0x3fd9df=_0x26aab6['config']['get']('collaboration.channelId'),_0x11a23b=_0x26aab6['plugins']['get'](i);await this['_setUpService'](_0x3fd9df);const _0x351ce7=await this['_services']['get'](_0x3fd9df)['getConnectedSessions']();this['listenTo'](_0x11a23b,'sessionAdd:'+_0x3fd9df,(_0x327222,{session:_0x1f3435})=>{_0x1f3435['id']===_0x11a23b['mySessionId']&&(_0x327222['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x1f3435['permissions'],_0x3fd9df));}),_0x11a23b['register'](_0x3fd9df,_0x351ce7);}}async['_setUpService'](_0x17e43b){if(this['_services']['has'](_0x17e43b))throw new _0x5a7f9a('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x17e43b});const _0x15e203=this['context']['plugins']['get']('CommentsRepository'),_0x107bca=new s['CommentsService'](_0x17e43b);this['_services']['set'](_0x17e43b,_0x107bca),this['listenTo'](_0x107bca,'commentThreadAdded',(_0x5917fa,_0x1b6d35)=>{const {commentThreadId:_0xb480ce,documentId:_0x4a5e5e,context:_0x260467,attributes:_0x2936b0,resolvedAt:_0x278bac,resolvedBy:_0x5d6267,comments:_0x2b0cac}=_0x1b6d35;_0x15e203['getCommentThread'](_0xb480ce)||_0x15e203['addCommentThread']({'threadId':_0xb480ce,'channelId':_0x4a5e5e,'comments':_0x2b0cac?_0x2b0cac['map'](B):[],'context':_0x260467,'attributes':_0x2936b0,'resolvedAt':_0x278bac,'resolvedBy':_0x5d6267,'isFromAdapter':!0x0});}),this['listenTo'](_0x107bca,'commentThreadUpdated',(_0x50a0c7,{commentThreadId:_0x12a22d,documentId:_0x4730cb,context:_0x224262,unlinkedAt:_0x4e7987,attributes:_0x3b4245})=>{_0x15e203['getCommentThread'](_0x12a22d)&&_0x15e203['updateCommentThread']({'threadId':_0x12a22d,'channelId':_0x4730cb,'context':_0x224262,'unlinkedAt':_0x4e7987,'attributes':_0x3b4245,'isFromAdapter':!0x0});}),this['listenTo'](_0x107bca,'commentThreadResolved',(_0x51b354,{commentThreadId:_0x137500,resolvedBy:_0x197982,resolvedAt:_0x32c50c})=>{const _0x36a341=_0x15e203['getCommentThread'](_0x137500);_0x36a341&&_0x36a341['resolve']({'resolvedBy':_0x197982,'resolvedAt':_0x32c50c,'isFromAdapter':!0x0});}),this['listenTo'](_0x107bca,'commentThreadReopened',(_0x23fc70,{commentThreadId:_0x56b504})=>{const _0x2595ad=_0x15e203['getCommentThread'](_0x56b504);_0x2595ad&&_0x2595ad['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x107bca,'commentThreadRemoved',(_0x53798d,{commentThreadId:_0x2ad263})=>{const _0x553451=_0x15e203['getCommentThread'](_0x2ad263);_0x553451&&_0x553451['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x107bca,'commentAdded',(_0xce5c46,_0x454345)=>{const _0x539c72=_0x454345['commentThreadId'],_0x49b45d=_0x15e203['getCommentThread'](_0x539c72);_0x49b45d&&_0x49b45d['addComment']({...B(_0x454345),'isFromAdapter':!0x0});}),this['listenTo'](_0x107bca,'commentUpdated',(_0x51bac9,{commentThreadId:_0x2f75f3,commentId:_0x483639,content:_0xed7649,attributes:_0x50ce35})=>{const _0x39ee67=_0x15e203['getCommentThread'](_0x2f75f3);if(_0x39ee67){const _0x351073=_0x39ee67['getComment'](_0x483639);_0x351073&&_0x351073['update']({'content':_0xed7649,'attributes':_0x50ce35,'isFromAdapter':!0x0});}}),this['listenTo'](_0x107bca,'commentRemoved',(_0x436503,{commentThreadId:_0x4d4716,commentId:_0x117773})=>{const _0x81b16b=_0x15e203['getCommentThread'](_0x4d4716);if(_0x81b16b){const _0x2cfe44=_0x81b16b['getComment'](_0x117773);_0x2cfe44&&_0x2cfe44['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x17e43b);}['destroy'](){if(this['context']instanceof _0x34d227){const _0x185118=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x185118);}}['_terminateService'](_0x3fdb10){if(!this['_services']['has'](_0x3fdb10))throw new _0x5a7f9a('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x3fdb10});this['_getService'](_0x3fdb10)['disconnect'](),this['_services']['delete'](_0x3fdb10);}async['reconnect'](){for(const _0x733697 of this['_services']['keys']())await this['_connectService'](_0x733697);if(this['context']instanceof _0x34d227){const _0x3b5589=this['context']['config']['get']('collaboration.channelId'),_0x1639e8=this['context']['plugins']['get'](i);_0x1639e8['unregister'](_0x3b5589);const _0x42b10d=await this['_services']['get'](_0x3b5589)['getConnectedSessions']();_0x1639e8['register'](_0x3b5589,_0x42b10d);}}async['_connectService'](_0x38a06a){const {connection:_0x4de8a9}=this['context']['plugins']['get'](n),_0x2a1416=this['context']['plugins']['get']('CommentsRepository'),_0x27f140=this['_services']['get'](_0x38a06a),_0x21457e=await _0x27f140['connect'](_0x4de8a9);await this['_fetchMissingUsersForThreads'](_0x21457e);const _0x240d59=new Set(Array['from'](_0x2a1416['getCommentThreads']({'channelId':_0x38a06a}),_0x4e11fe=>_0x4e11fe['id']));for(const _0x5b6178 of _0x21457e)_0x5b6178['deletedAt']||_0x240d59['delete'](_0x5b6178['commentThreadId']);for(const _0x1e3e60 of _0x240d59)_0x2a1416['getCommentThread'](_0x1e3e60)['remove']({'isFromAdapter':!0x0});for(const _0x51f1b7 of _0x21457e){let _0x57dd02=_0x2a1416['getCommentThread'](_0x51f1b7['commentThreadId']);const {commentThreadId:_0x2a4a3c,context:_0x3eb3ea,attributes:_0x3df5c8,resolvedBy:_0x32e355,resolvedAt:_0x586e61,unlinkedAt:_0x95fb90,deletedAt:_0x1506e4}=_0x51f1b7;if(_0x1506e4)continue;_0x57dd02||(_0x57dd02=_0x2a1416['addCommentThread']({'channelId':_0x38a06a,'threadId':_0x2a4a3c,'context':_0x3eb3ea,'attributes':_0x3df5c8||{},'resolvedBy':_0x32e355,'resolvedAt':_0x586e61,'unlinkedAt':_0x95fb90,'isFromAdapter':!0x0}));const _0x3533ea=new Set(Array['from'](_0x57dd02['comments'],_0x1185cf=>_0x1185cf['id']));for(const _0x44a878 of _0x51f1b7['comments'])_0x3533ea['delete'](_0x44a878['commentId']);for(const _0x457f02 of _0x3533ea)_0x57dd02['getComment'](_0x457f02)['remove']({'isFromAdapter':!0x0});for(const _0x40fd12 of _0x51f1b7['comments']){const _0x3a9254=_0x57dd02['getComment'](_0x40fd12['commentId']);_0x3a9254?_0x3a9254['content']!==_0x40fd12['content']&&_0x3a9254['update']({'content':_0x40fd12['content'],'isFromAdapter':!0x0}):_0x57dd02['addComment'](Object['assign'](B(_0x40fd12),{'isFromAdapter':!0x0}));}}}['_getService'](_0x30daad){if(!this['_services']['has'](_0x30daad))throw new _0x5a7f9a('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x30daad});return this['_services']['get'](_0x30daad);}async['_fetchMissingUsersForThreads'](_0x494655){const _0x9e99ca=this['context']['plugins']['get'](_0x44651b),{connection:_0x4655fe}=this['context']['plugins']['get'](n),_0x110a70=new Set();for(const {resolvedBy:_0x597876,comments:_0x3cbf27}of _0x494655){_0x597876&&!_0x9e99ca['getUser'](_0x597876)&&_0x110a70['add'](_0x597876);for(const {userId:_0x40e8be}of _0x3cbf27)_0x9e99ca['getUser'](_0x40e8be)||_0x110a70['add'](_0x40e8be);}if(0x0===_0x110a70['size'])return;const _0x51b74e=await ct['getMany'](_0x4655fe,Array['from'](_0x110a70));for(const _0x124f85 of _0x51b74e)_0x9e99ca['getUser'](_0x124f85['id'])||_0x9e99ca['addUser'](_0x124f85);}}async function F(_0x4f626b){if('404'!==_0x4f626b['code'])throw _0x4f626b;}function at(_0x3471a6){if((_0x144be4=_0x3471a6)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x144be4['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x144be4['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x144be4;throw _0x3471a6;}function B(_0xf45f55){return{'threadId':_0xf45f55['commentThreadId'],'commentId':_0xf45f55['commentId'],'content':_0xf45f55['content'],'createdAt':_0xf45f55['createdAt'],'authorId':_0xf45f55['userId'],'attributes':_0xf45f55['attributes']||{}};}class m extends _0x83d4b3{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0x39305b)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x44651b];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2f1700){super(_0x2f1700);const _0x127073=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x127073);}async['init'](){const _0x403db3=this['editor']['plugins']['get'](l),_0x345118=_0x403db3['serverHistory'],_0x7847a6=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x345118,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x403db3['sessionId']});const _0x57a325=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x40d0cb=await _0x1f4dc3['isBundleUploaded'](_0x7847a6['connection'],_0x57a325);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x5be2c6})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5be2c6)),'updateRevisions':async _0x319ee9=>{await this['_waitForServiceReady']();const _0xafcb84=this['_revisionTracker']['currentRevision'];if(_0x40d0cb&&0x1===_0x319ee9['length']&&_0x319ee9[0x0]['id']===_0xafcb84['id'])return _0x319ee9;for(const _0x3dd9a2 of _0x319ee9)_0x3dd9a2['id']===_0xafcb84['id']&&(_0x3dd9a2['isEmptyCurrent']=_0x3dd9a2['fromVersion']===_0x3dd9a2['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x319ee9,this['_lastRequestId'])['then'](_0x178599=>(this['_lastRequestId']=_0x178599,_0x319ee9))['catch'](_0x3ed16d=>{if(q(_0x3ed16d)||'400'===_0x3ed16d['code']&&void 0x0!==_0x3ed16d['data']['wrongRequestId']){for(const _0x41683c of _0x319ee9){!this['_revisionTracker']['repository']['getRevision'](_0x41683c['id'])||this['_revisionTracker']['_bufferUpdate'](_0x41683c['id'],_0x41683c,!0x1);}if(q(_0x3ed16d))throw _0x3ed16d;return _0x319ee9;}throw _0x3ed16d;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4ff0a6,{revisionsData:_0x461b24,requestId:_0x41e3e0})=>{Math['max'](..._0x461b24['map'](_0xec81ee=>_0xec81ee['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x461b24,_0x41e3e0);}):this['_handleRevisionsUpdate'](_0x461b24,_0x41e3e0);});const {revisions:_0x3e0d91,requestId:_0x2ff018}=await this['_revisionHistoryService']['connect'](_0x7847a6['connection']);_0x7847a6['addToReconnectionStack'](this),this['_lastRequestId']=_0x2ff018,await this['_fetchMissingUsers'](_0x3e0d91);for(const _0x13409c of _0x3e0d91)this['_revisionTracker']['addRevisionData'](_0x13409c);this['listenTo'](_0x403db3,'change:_isConnected',(_0x2634e4,_0x569ccc,_0x183815)=>{_0x183815&&(this['_oldOffset']=_0x403db3['_offset'],_0x2634e4['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x7847a6,'state',_0x47b536=>_0x47b536===_0xaffe2f['CONNECTED']);}async['reconnect'](){const _0x28e3ac=this['editor']['plugins']['get'](n),_0x4f0784=this['editor']['plugins']['get'](l),_0x433a99=async()=>{const _0x528a64=this['_revisionTracker']['currentRevision'],_0x35af41=_0x528a64['id'],_0x40d499=_0x35af41!==_0x4f0784['sessionId'];if(_0x40d499){const _0x3f6d18=_0x4f0784['_offset']-this['_oldOffset'],_0x540b7c=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x528a64['toVersion']+_0x3f6d18!==_0x540b7c){const _0x25de1a=_0x528a64['fromVersion']+_0x3f6d18,_0x4d7c23=this['editor']['plugins']['get'](_0x44651b),_0x55d011=this['_revisionTracker']['buildRevisionData']({'revision':_0x528a64,'from':_0x25de1a,'to':_0x540b7c});_0x55d011['id']=_0x528a64['id'];const _0x36dd29=_0x55d011['authorsIds']['map'](_0x3e95ae=>_0x4d7c23['getUser'](_0x3e95ae));_0x528a64['_update']({..._0x55d011,'authors':_0x36dd29},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x528a64['id'],_0x55d011,!0x0);}this['_revisionTracker']['_startingVersion']=_0x540b7c,(_0x528a64['toVersion']===_0x528a64['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x35af41)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x35af41),this['_revisionTracker']['_createCurrentRevision'](_0x540b7c));}const {revisions:_0x2ccc88,requestId:_0x4153bb}=await this['_revisionHistoryService']['reconnect'](_0x28e3ac['connection'],this['_lastRequestId']);_0x40d499&&_0x2ccc88['length']>0x0?_0x4f0784['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x2ccc88),this['_handleRevisionsUpdate'](_0x2ccc88,_0x4153bb),this['_revisionTracker']['sendBufferedUpdates']());};return _0x4f0784['_isConnected']?_0x433a99():new Promise((_0x53bb42,_0x23be76)=>{_0x4f0784['once']('change:_isConnected',()=>{_0x433a99()['then'](_0x53bb42)['catch'](_0x23be76);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x2c2b9c=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x44cd84=>{_0x44cd84['off'](),_0x2c2b9c();});});}['_getLatestVersionFromServerOperations'](){const _0x38941b=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x56c725 of _0x38941b)if('marker'!==_0x56c725['type']||_0x56c725['affectsData'])return _0x56c725['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1b475f=this['editor']['plugins']['get'](l);return new Promise(_0x14692d=>{_0x1b475f['_isPendingUpdate']?_0x1b475f['once']('change:_isPendingUpdate',()=>{_0x14692d(this['_getLatestVersionFromServerOperations']());}):_0x14692d(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x2de415,_0x1c9040){const _0x5a1a1f=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x1c9040;for(const _0x2096fb of _0x2de415){const _0x50685b=_0x5a1a1f['getRevision'](_0x2096fb['id']);if(_0x50685b){if((_0x2096fb['fromVersion']||_0x2096fb['toVersion'])&&(_0x2096fb['diffData']=null),_0x50685b===this['_revisionTracker']['currentRevision']){const _0x11d207=Math['max'](_0x50685b['toVersion'],_0x2096fb['toVersion']),_0x37181e=Math['max'](_0x50685b['fromVersion'],_0x2096fb['fromVersion']);let _0x113031;_0x50685b['toVersion']===_0x2096fb['toVersion']&&_0x50685b['fromVersion']===_0x2096fb['fromVersion']?(_0x113031=!0x0,this['_preventResendingRevisionData'](_0x2096fb)):_0x2096fb['toVersion']===_0x11d207&&_0x2096fb['fromVersion']===_0x37181e?_0x113031=!0x1:(_0x50685b['toVersion']===_0x11d207&&_0x50685b['fromVersion']===_0x37181e||this['_fixRevision']({'revision':_0x50685b,'from':_0x37181e,'to':_0x11d207}),_0x113031=!0x0),_0x113031&&(delete _0x2096fb['fromVersion'],delete _0x2096fb['toVersion'],delete _0x2096fb['diffData'],delete _0x2096fb['createdAt'],delete _0x2096fb['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2096fb),this['_preventResendingRevisionData'](_0x2096fb);}else this['_revisionTracker']['addRevisionData'](_0x2096fb);}const _0x485221=_0x5a1a1f['getRevisions']();_0x485221['reverse']();for(let _0x6965cd=0x0;_0x6965cd<_0x485221['length']-0x1;_0x6965cd++){const _0x40ab58=_0x485221[_0x6965cd],_0x102a41=_0x485221[_0x6965cd+0x1];if(_0x40ab58['fromVersion']<_0x102a41['toVersion']){const _0x3517d5=_0x102a41['toVersion'],_0x11483b=Math['max'](_0x3517d5,_0x40ab58['toVersion']);this['_fixRevision']({'revision':_0x40ab58,'from':_0x3517d5,'to':_0x11483b});}}}['_fixRevision']({revision:_0x504ae6,from:_0x1e61b4,to:_0x21709e}={}){const _0x2c0075=this['editor']['plugins']['get'](_0x44651b),_0x513508=this['_revisionTracker']['buildRevisionData']({'revision':_0x504ae6,'from':_0x1e61b4,'to':_0x21709e});_0x513508['authors']=_0x513508['authorsIds']['map'](_0x2fec45=>_0x2c0075['getUser'](_0x2fec45)),_0x504ae6['_update'](_0x513508);}['_preventResendingRevisionData'](_0x8df743){const _0x1371a9={};_0x1371a9['id']=_0x8df743['id'];for(const _0x443a09 of Object['keys'](_0x8df743))'id'!==_0x443a09&&(_0x1371a9[_0x443a09]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x1371a9['id'],_0x1371a9,!0x0);}async['_fetchMissingUsers'](_0x5a627d){const _0x476790=this['editor']['plugins']['get'](_0x44651b),{connection:_0x434dfb}=this['editor']['plugins']['get'](n),_0x3bfeac=new Set();for(const _0x1d2e2b of _0x5a627d){for(const _0x1c267b of _0x1d2e2b['authorsIds'])_0x2e54e5(_0x1c267b);_0x1d2e2b['creatorId']&&_0x2e54e5(_0x1d2e2b['creatorId']);}if(0x0===_0x3bfeac['size'])return;const _0x15f3ae=await ct['getMany'](_0x434dfb,Array['from'](_0x3bfeac));for(const _0x1c8a75 of _0x15f3ae)_0x476790['getUser'](_0x1c8a75['id'])||_0x476790['addUser'](_0x1c8a75);function _0x2e54e5(_0x15a41a){_0x476790['getUser'](_0x15a41a)||_0x3bfeac['add'](_0x15a41a);}}}function q(_0x4ec224){return _0x4ec224['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4ec224['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4ec224['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x83d4b3{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 _0x5b3aa9{['_collapseAt'];constructor(_0x379ec7,_0x18cafb=0x6){super(_0x379ec7);const _0x4feb9b=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x18cafb,this['bind']('isHidden')['to'](this,'usersCount',_0x4b72ed=>_0x4b72ed<_0x18cafb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4feb9b['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':_0x4feb9b['to']('usersCount',_0x231ee8=>'+'+(_0x231ee8-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x5b3aa9{['items'];['keystrokes'];constructor(_0x5b963b){super(_0x5b963b);const _0x329056=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x1a5299(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x329056['if']('hasPopup'),'aria-expanded':_0x329056['to']('isExpanded',_0xb60a4f=>this['hasPopup']&&String(_0xb60a4f)),'aria-label':_0x329056['to']('hasPopup',_0x157009=>$(_0x5b963b,_0x157009?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x329056['to']('hasPopup',_0x5345d8=>!!_0x5345d8&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x329056['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x329056['to'](_0x205f9e=>{const _0x14904f=_0x205f9e,_0x43dad9=document['querySelector']('.ck-presence-list__dropdown-list'),_0x4521ee=document['querySelector']('.ck-balloon-panel_with-arrow');_0x43dad9?.['contains'](_0x14904f['relatedTarget'])||_0x4521ee?.['contains'](_0x14904f['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2ca5c2,_0x1690ca,_0x707bed)=>{this['element']&&(_0x707bed?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 _0x5b3aa9{['counterView'];['inlineListView'];constructor(_0x859384,_0x531680=0x6){super(_0x859384);const _0x2cb7e0=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x531680),this['inlineListView']=new is(_0x859384),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x40508c of this['inlineListView']['items'])_0x40508c['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',_0x2cb7e0['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x5b3aa9{['listWrapperView'];constructor(_0x9f22c7,_0x4134d5){super(_0x9f22c7);const _0x4e52a7=this['bindTemplate'];this['listWrapperView']=new ut(_0x9f22c7,_0x4134d5),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x9f22c7,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x4e52a7['to'](_0x47f531=>{const _0x1dbaed=_0x47f531,_0x1fa0f5=document['querySelector']('.ck-presence-list__list'),_0x3f9650=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1fa0f5?.['contains'](_0x1dbaed['relatedTarget'])||_0x3f9650?.['contains'](_0x1dbaed['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x4eb8bd{constructor(_0x1f02f0,_0xa4b31c){super(_0x1f02f0);const _0x90eb95=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0xa4b31c?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x90eb95['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x90eb95['to']('role'),'aria-label':_0x90eb95['to']('ariaLabel'),'aria-labelledby':_0x90eb95['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x182909['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xd553a2=this['element'];_0xd553a2&&(this['_isScrollable']=Math['max'](_0xd553a2['scrollHeight'],_0xd553a2['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x504140,_0x13b61c,_0x5e1135){super(_0x504140);const _0x2c3a87=this['bindTemplate'];this['userView']=new st(_0x504140,_0x13b61c);const _0x2bdd08={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x13b61c['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x13b61c['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x13b61c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5e1135&&(_0x2bdd08['tag']='button',_0x2bdd08['on']={'click':_0x2c3a87['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2bdd08);}['focus'](){this['element']['focus']();}}class A extends _0x5b3aa9{['userView'];['markerView'];constructor(_0x5aa0d9,_0x193a87,_0x484093){super(_0x5aa0d9);const _0x2d246a=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x5aa0d9,_0x193a87),this['markerView']=new ot(_0x5aa0d9,_0x193a87);const _0x5ea8e0=new it(_0x5aa0d9);_0x5ea8e0['template']['tag']='span',_0x5ea8e0['text']=_0x193a87['name'];const _0x146378={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x2d246a['to']('isFocusable',_0x43eb05=>!!_0x43eb05&&0x0),'aria-labelledby':_0x5ea8e0['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x2d246a['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x2d246a['to']('hasTooltip',_0x3c1e6f=>!_0x3c1e6f),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x5ea8e0]};_0x484093&&(_0x146378['tag']='button',_0x146378['on']={'click':_0x2d246a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x146378);}}class ot extends _0x5b3aa9{constructor(_0x5c9791,_0x4eebe4){super(_0x5c9791),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4eebe4['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x54d6c2{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xbd76e2){super(_0xbd76e2),this['context']['config']['define']('presenceList',x);const _0x521049=_0xbd76e2['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x521049)throw new _0x5a7f9a('presencelist-collapseat-invalid-format',this);if(_0x521049<0x1)throw new _0x5a7f9a('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2df62c(),this['balloonPanelView']=new _0x472c73(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x36ac64 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x36ac64);this['listenTo'](this['_allConnectedUsers'],'add',(_0x28f3c0,_0x100bfc)=>{this['_handleUserAdd'](_0x100bfc);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x4f1d1c,_0x5344c8)=>{this['_handleUserRemove'](_0x5344c8);});}['_createView'](){const _0xc9930d=this['context'],_0x20a490=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3fa90b=this['balloonPanelView'];if(!_0x529d9c(_0xc9930d['config']['get']('presenceList.container')))throw new _0x5a7f9a('presencelist-missing-container',this);return _0x20a490['counterView']['bind']('usersCount')['to'](this),_0x20a490['bind']('isCollapsed')['to'](this,'usersCount',_0x2529cc=>{const {collapseAt:_0x470452}=_0xc9930d['config']['get']('presenceList'),_0x4d9057=_0x2529cc>=_0x470452;if(_0x4d9057&&!_0x20a490['inlineListView']['items']['find'](_0x1c70bb=>_0x1c70bb instanceof b)){const _0x5f48a7=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x5f48a7&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x20a490['inlineListView']['items']['add'](_0x20a490['counterView']);}return _0x4d9057||this['hideDropdown'](),_0x4d9057;}),_0x20a490['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x556d0b=>{const _0x367da1=_0xc9930d['config']['get']('presenceList'),_0x75a8ff=new A(_0xc9930d['locale'],_0x556d0b,!!_0x367da1['onClick']);return _0x75a8ff['bind']('hasTooltip')['to'](_0x20a490,'isCollapsed',_0x49cfcf=>!_0x49cfcf),_0x75a8ff['bind']('isFocusable')['to'](_0x20a490,'isCollapsed',_0x4f5cbb=>!_0x4f5cbb),_0x367da1['onClick']&&this['listenTo'](_0x75a8ff,'execute',()=>{this['view']['isCollapsed']||_0x367da1['onClick'](_0x556d0b,_0x75a8ff['element']);}),_0x75a8ff;}),this['listenTo'](_0x20a490['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x20a490['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x20a490['inlineListView']['keystrokes']['set']('Enter',(_0x3c3ab4,_0x5a84dd)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x5a84dd());}),_0x20a490['render'](),_0x3fa90b['render'](),_0x232f54({'emitter':_0x20a490,'activator':()=>_0x3fa90b['isVisible'],'contextElements':[_0x3fa90b['element'],_0x20a490['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0xc9930d['config']['get']('presenceList.container')['appendChild'](_0x20a490['element']),this['_bodyCollection']=new _0x3a06e8(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x20a490;}['_handleUserAdd'](_0x1daf95){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x1daf95['isMe'])return;const _0x1d089e=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x1d089e-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x591128=_0x1daf95['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x1daf95,_0x591128);}['_handleUserRemove'](_0x176cc9){this['usersCount']--;const {collapseAt:_0x4e3010}=this['context']['config']['get']('presenceList'),_0x68bac5=this['usersCount']>=_0x4e3010;if(this['currentDisplayedUsers']['get'](_0x176cc9['id']))this['currentDisplayedUsers']['remove'](_0x176cc9['id']);else{if(_0x68bac5&&this['currentDisplayedUsers']['length']+0x1===_0x4e3010-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x68bac5?0x1:0x0)<this['usersCount']){for(const _0x407809 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x407809['id'])&&(this['currentDisplayedUsers']['add'](_0x407809,Math['min'](this['currentDisplayedUsers']['length']-(_0x68bac5?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x68bac5?0x1:0x0)===_0x4e3010-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x97d6ed=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x97d6ed['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x487506}=this['presenceDropdownView'];_0x487506['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x45b985=>{if(!_0x97d6ed['displayMe']&&_0x45b985['isMe'])return null;const _0x17095c=new j(this['context']['locale'],_0x45b985,!!_0x97d6ed['onClick']);return _0x97d6ed['onClick']&&this['listenTo'](_0x17095c,'execute',()=>{_0x97d6ed['onClick'](_0x45b985,_0x17095c['element']);}),_0x17095c;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x487506['focus'](),_0x487506['checkIfScrollable']();const _0x278db2=(_0x4b0783,_0x5e9bde)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x5e9bde();};_0x487506['keystrokes']['set']('Esc',_0x278db2),_0x487506['keystrokes']['set']('Shift+Tab',_0x278db2),_0x487506['keystrokes']['set']('Tab',(_0x8454a7,_0x5d8d3e)=>{!function(_0x4d49e1){const _0x11fc76=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x167c9e=>_0x167c9e+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2932b6=[...document['body']['querySelectorAll'](_0x11fc76)]['filter'](_0x46b4d7=>_0x46b4d7===document['activeElement']||_0x46b4d7['offsetWidth']+_0x46b4d7['offsetHeight']>0x0)['sort']((_0xee2ef5,_0x21674a)=>(_0xee2ef5['tabIndex']||0x0)-(_0x21674a['tabIndex']||0x0)),_0x3f0a68=_0x2932b6['indexOf'](_0x4d49e1),_0x42dc4c=_0x2932b6[(_0x3f0a68+0x1)%_0x2932b6['length']];_0x42dc4c&&_0x42dc4c['focus']();}(this['view']['element']),this['hideDropdown'](),_0x5d8d3e();}),_0x487506['focusTracker']['add'](this['view']['element']),_0x487506['focusTracker']['on']('change:isFocused',(_0x57c55e,_0x45d277,_0x535f9a)=>{_0x535f9a||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 _0x54d6c2{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 _0x381c27,Plugin as _0x5d6859,PendingActions as _0x1b6042,Context as _0x51e0d6}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0xe335e0,CKEditorError as _0x4d1849,Collection as _0x53968d,global as _0x38b4cc,version as nt,uid as _0xa36db5,KeystrokeHandler as _0x39617f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x141545,View as _0x3ba684,ListView as _0x47010b,ListItemView as et,LabelView as it,BalloonPanelView as _0x5c13c2,clickOutsideHandler as _0x56aafe,BodyCollection as _0x4a71b4}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x2668bc,History as _0xb8e3ac,NoOperation as _0x5bebc6,InsertOperation as _0x298a31,MarkerOperation as _0x1d3670,RootAttributeOperation as _0xd1c1c,transformOperationSets as _0x2eba0d,OperationFactory as _0x3c0389}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x384c6b,CollaborativeEditingService as _0x5a5013,User as ct,CommentsService as _0x3afce2,TrackChangesService as _0x562c27,RevisionHistoryService as _0x574851,EditorService as _0x56ccf5}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x595866,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x29c866}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x504e67}from'es-toolkit/compat';class n extends _0x381c27{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x141545];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x140208){super(_0x140208),this['set']('state',_0x384c6b['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0xe335e0())();}['init'](){const _0x2d4469=this['context'],_0x1d18ce=_0x2d4469['plugins']['get']('CloudServices'),_0x41b9e5=_0x2d4469['plugins']['get'](_0x141545);if(!_0x1d18ce['token'])throw new _0x4d1849('websocketgateway-missing-token',this);if(!_0x1d18ce['webSocketUrl'])throw new _0x4d1849('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'](_0x1d18ce['token'],_0x1d18ce['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x45f3b2=>{if(this['connection']=_0x45f3b2,this['bind']('state')['to'](_0x45f3b2,'state',this,'_isBrowserOffline',(_0x5daeb1,_0x1696c6)=>('connected'!==_0x5daeb1&&(this['_shouldPluginsReconnect']=!0x0),_0x1696c6||_0x5daeb1!==_0x384c6b['CONNECTED']?_0x384c6b['DISCONNECTED']:this['state']==_0x384c6b['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x384c6b['CONNECTING']):_0x384c6b['CONNECTED'])),this['connection']['on']('error',(_0x2310c0,_0x5575e0)=>{if('limitExceeded'!==_0x5575e0['code'])throw console['error'](_0x5575e0),new _0x4d1849('cloudservices-init',null,{'originalError':_0x5575e0});_0x41b9e5['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'});}),!_0x45f3b2['me'])return new Promise(_0x1cefda=>_0x45f3b2['on']('change:me',_0x1cefda));})['catch'](_0x2fd6d1=>{throw console['error'](_0x2fd6d1),new _0x4d1849('cloudservices-init',null,{'originalError':_0x2fd6d1});});}['addToReconnectionStack'](_0x200a60){if('function'!=typeof _0x200a60['reconnect'])throw new _0x4d1849('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x200a60))throw new _0x4d1849('websocketgateway-plugin-already-registered',this,{'name':_0x200a60['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x200a60);}['removeFromReconnectionStack'](_0x141b63){this['_reconnectionStack']['delete'](_0x141b63);}['isInReconnectionStack'](_0x4e9e89){return this['_reconnectionStack']['has'](_0x4e9e89);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x4560ef=>_0x4560ef['reconnect']())))['then'](()=>this['state']=_0x384c6b['CONNECTED'])['catch'](_0x431413=>{throw console['error'](_0x431413),new _0x4d1849('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x384c6b['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x381c27{['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,_0x595866];}constructor(_0x49d81b){super(_0x49d81b),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x53968d(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x595866);}['init'](){const _0x51648d=this['context']['plugins']['get'](n);this['listenTo'](_0x51648d,'change:state',(_0x257e63,_0x33573b,_0x13227e)=>{if('connected'!==_0x13227e)this['channelSessions']['forEach'](_0x240ab2=>_0x240ab2['clear']()),this['channelConnectedUsers']['forEach'](_0x319c69=>_0x319c69['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x36424f,_0x120da6]of this['_registeredSessions'])for(const _0x5ef0c9 of _0x120da6)this['_handleSessionAdd'](_0x36424f,_0x5ef0c9);}}),this['_createUser'](_0x51648d['connection']['me'],!0x0);}['register'](_0x51983b,_0x572738){if(this['_registeredSessions']['has'](_0x51983b))throw new _0x4d1849('sessions-register-already-registered',null,{'channelId':_0x51983b});this['_registeredSessions']['set'](_0x51983b,_0x572738),this['channelSessions']['set'](_0x51983b,new _0x53968d()),this['channelConnectedUsers']['set'](_0x51983b,new _0x53968d()),this['listenTo'](_0x572738,'add',(_0x1cf0f7,_0x24c24f)=>this['_handleSessionAdd'](_0x51983b,_0x24c24f)),this['listenTo'](_0x572738,'remove',(_0x234af3,_0x3eb9c6)=>this['_handleSessionRemove'](_0x51983b,_0x3eb9c6));for(const _0x1a77e1 of _0x572738)this['_handleSessionAdd'](_0x51983b,_0x1a77e1);}['unregister'](_0x2d8546){if(!this['_registeredSessions']['has'](_0x2d8546))throw new _0x4d1849('sessions-unregister-not-exist',null,{'channelId':_0x2d8546});const _0x3d25ef=this['_registeredSessions']['get'](_0x2d8546);this['stopListening'](_0x3d25ef);for(const _0x369f32 of _0x3d25ef)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x2d8546,_0x369f32);this['_registeredSessions']['delete'](_0x2d8546),this['channelSessions']['delete'](_0x2d8546),this['channelConnectedUsers']['delete'](_0x2d8546);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x4b939e){for(const _0x572424 of this['channelSessions']['values']())for(const _0x8d75b8 of _0x572424)if(_0x8d75b8['id']===_0x4b939e)return _0x8d75b8['user'];}['getUserSessions'](_0x20d455,_0x42ef8b){const _0x561085=_0x42ef8b?[this['channelSessions']['get'](_0x42ef8b)]:this['channelSessions']['values'](),_0x746198=new Set();for(const _0x1794a4 of _0x561085)for(const _0x544405 of _0x1794a4)_0x544405['user']['id']===_0x20d455['id']&&_0x746198['add'](_0x544405['id']);return _0x746198;}['getUserRole'](_0x1f23a5){for(const _0x14aca3 of this['channelSessions']['values']())for(const _0x522e31 of _0x14aca3)if(_0x522e31['user']===_0x1f23a5)return _0x522e31['role'];}['_handleSessionAdd'](_0xb8a083,_0x4c4dfc){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x369df0=_0x4c4dfc['user'],_0x45b8cd=this['_users']['getUser'](_0x369df0['id'])||this['_createUser'](_0x369df0),_0x5279fe=Object['assign']({},_0x4c4dfc,{'user':_0x45b8cd});this['channelSessions']['get'](_0xb8a083)['add'](_0x5279fe);const _0x3eb8d7=this['channelConnectedUsers']['get'](_0xb8a083);_0x3eb8d7['has'](_0x45b8cd['id'])||_0x3eb8d7['add'](_0x45b8cd),this['allConnectedUsers']['has'](_0x45b8cd['id'])||this['allConnectedUsers']['add'](_0x45b8cd,_0x45b8cd['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0xb8a083,{'channelId':_0xb8a083,'session':_0x5279fe});}['_handleSessionRemove'](_0x236dc4,_0x8a5057){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x34872c=this['channelConnectedUsers']['get'](_0x236dc4),_0x3c44dd=_0x8a5057['user'];_0x3c44dd['id']&&(this['channelSessions']['get'](_0x236dc4)['remove'](_0x8a5057['id']),_0x34872c['has'](_0x3c44dd['id'])&&!this['getUserSessions'](_0x3c44dd,_0x236dc4)['size']&&_0x34872c['remove'](_0x3c44dd['id']),this['allConnectedUsers']['get'](_0x3c44dd['id'])&&!this['getUserSessions'](_0x3c44dd)['size']&&this['allConnectedUsers']['remove'](_0x3c44dd['id']));}['_createUser'](_0x2fa2c4,_0x233e29){const _0x29c5e9=this['_users']['addUser'](_0x2fa2c4);return _0x233e29&&this['_users']['defineMe'](_0x2fa2c4['id']),_0x29c5e9['orderNumber']=this['_uniqueUsersCount']++,_0x29c5e9;}}class $ extends _0x5d6859{['_domEmitter']=new(_0xe335e0())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5d42cb=this['editor'],_0x3d0bb0=_0x5d42cb['plugins']['get'](i);_0x5d42cb['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x42a634,{writer:_0x4f5640})=>function(_0xbf3676,_0x4776ee,_0x378e5b,_0x51d79f){const _0x30504c=_0xbf3676['markerName']['split'](':')[0x2],_0x4675fe=_0x378e5b['getUserBySessionId'](_0x30504c);if(!_0x4675fe||_0x30504c===_0x378e5b['mySessionId'])return;if(!_0x51d79f['model']['schema']['checkChild'](_0xbf3676['markerRange']['start'],'$text'))return;const _0xfde9a4={'class':'ck-user__marker\x20'+_0x4675fe['color']['getMarkerClass'](),'data-name':_0x4675fe['name'],'data-session-id':_0x30504c},_0x47349e=_0x51d79f['model']['markers']['get'](_0xbf3676['markerName']),_0x590b69=_0x47349e['getStart'](),_0x4e3be0=_0x590b69['nodeAfter'],_0x17cab1=_0x51d79f['model']['schema'];if(_0x4e3be0&&_0x17cab1['isObject'](_0x4e3be0)&&_0x17cab1['isInline'](_0x4e3be0)&&!_0x51d79f['model']['markers']['get']('user:range:'+_0x30504c)['getRange']()['isCollapsed'])return;const _0x34fe09=_0x590b69['parent'];return _0x51d79f['model']['schema']['isLimit'](_0x34fe09)&&!_0x51d79f['model']['hasContent'](_0x34fe09)&&(_0xfde9a4['contenteditable']=!0x1),function(_0x23f60b,_0x1485e2,_0x2ea188){const _0x64f60a=_0x23f60b['createUIElement']('span',_0x1485e2);return _0x23f60b['setCustomProperty']('userPositionMarker',!0x0,_0x64f60a),_0x64f60a['render']=function(_0x2e5579){const _0x8027ec=this['toDomElement'](_0x2e5579),_0x3a4924=document['createElement']('span');return _0x3a4924['classList']['add']('ck-user__marker-tooltip'),_0x3a4924['setAttribute']('contenteditable','false'),_0x3a4924['setAttribute']('spellcheck','false'),_0x3a4924['textContent']=_0x2ea188['name'],_0x8027ec['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x3a4924['outerHTML']+'',_0x8027ec['addEventListener']('mouseenter',()=>{_0x8027ec['classList']['add']('ck-user__marker_hovered');}),_0x8027ec['addEventListener']('mouseleave',()=>{_0x8027ec['classList']['remove']('ck-user__marker_hovered');}),_0x8027ec;},_0x64f60a['isSimilar']=function(_0x481827){return!(!this['getCustomProperty']('userPositionMarker')||!_0x481827['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x481827['getAttribute']('data-session-id'));},_0x64f60a;}(_0x4776ee,_0xfde9a4,_0x4675fe);}(_0x42a634,_0x4f5640,_0x3d0bb0,_0x5d42cb)}),_0x5d42cb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5b7880=>function(_0x53440c,_0x42368e){const _0x10c342=_0x53440c['markerName']['split'](':')[0x2];if(_0x10c342===_0x42368e['mySessionId'])return null;const _0x44ddf6=_0x42368e['getUserBySessionId'](_0x10c342);if(!_0x44ddf6)return{'id':_0x10c342,'classes':[]};return{'id':_0x10c342,'classes':['ck-user__selection',_0x44ddf6['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x10c342},'priority':0x7d0+_0x44ddf6['orderNumber']};}(_0x5b7880,_0x3d0bb0)}),function(_0x242124){const _0xefe81a=_0x242124['model'],_0x511519=new Map(),_0x1da65e=_0x242124['plugins']['get'](i);_0xefe81a['markers']['on']('update:user:range',(_0xc7cbe2,_0x578c59,_0x22f28d,_0x59cbb0)=>{if(!_0x59cbb0&&_0x511519['get'](_0x578c59['name']))return _0x511519['get'](_0x578c59['name'])['detach'](),void _0x511519['delete'](_0x578c59['name']);const _0x16bf12=_0x578c59['name']['split'](':')[0x2];if(_0x16bf12===_0x1da65e['mySessionId'])return;const _0x3a9f47='user:position:'+_0x16bf12;_0xefe81a['markers']['has'](_0x3a9f47)&&_0x242124['editing']['reconvertMarker'](_0x3a9f47),_0x578c59['on']('change:range',(_0x2cbde9,_0x49673b,_0x13705c)=>{if('$graveyard'!=_0x49673b['root']['rootName']&&'$graveyard'==_0x578c59['getRange']()['root']['rootName']&&!_0x511519['has'](_0x578c59['name'])){const _0x4381a7=_0xefe81a['schema']['getNearestSelectionRange'](_0x13705c['deletionPosition']);if(_0x4381a7){const _0x3d1a17=_0x2668bc['fromRange'](_0x4381a7);_0x511519['set'](_0x578c59['name'],_0x3d1a17),_0x3d1a17['on']('change:range',(_0x4b2b7c,_0x208c0b,_0x2de0cd)=>{if('$graveyard'==_0x3d1a17['root']['rootName']){const _0x2475d6=_0xefe81a['schema']['getNearestSelectionRange'](_0x2de0cd['deletionPosition']);_0x2475d6?(_0x3d1a17['start']=_0x2475d6['start'],_0x3d1a17['end']=_0x2475d6['end']):(_0x511519['delete'](_0x578c59['name']),_0x3d1a17['detach']());}});}}});}),_0xefe81a['document']['on']('change',()=>{_0x511519['size']>0x0&&_0xefe81a['enqueueChange']({'isUndoable':!0x1},_0x5a7b77=>{for(const [_0x2a53d6,_0x34d1ee]of _0x511519)'$graveyard'==_0xefe81a['markers']['get'](_0x2a53d6)['getRange']()['root']['rootName']&&(te(_0x2a53d6['split'](':')[0x2],_0x34d1ee['toRange'](),_0xefe81a,_0x5a7b77),_0x34d1ee['detach']());_0x511519['clear']();});});}(_0x5d42cb),this['_domEmitter']['listenTo'](_0x38b4cc['document'],'keydown',(_0x175968,{key:_0x2746d0})=>{'Escape'===_0x2746d0&&function(_0x548771){_0x548771['editing']['view']['change'](_0x400cb1=>{for(const _0x2f506f of _0x548771['model']['markers']){if(!_0x2f506f['name']['startsWith']('user:position'))continue;const _0xd1f1e4=_0x548771['editing']['mapper']['markerNameToElements'](_0x2f506f['name']);if(_0xd1f1e4){for(const _0x314a27 of _0xd1f1e4)_0x400cb1['removeClass']('ck-user__marker_hovered',_0x314a27);}}});}(_0x5d42cb);},{'useCapture':!0x0});}['afterInit'](){const _0x55a2ab=this['editor'],_0x58bfca=_0x55a2ab['commands']['get']('undo');_0x58bfca&&_0x55a2ab['model']['on']('applyOperation',(_0x10a2bb,_0x54d756)=>{const _0x5a254e=_0x54d756[0x0];if(!_0x5a254e['isDocumentOperation'])return;if('marker'!=_0x5a254e['type']||!_0x5a254e['name']['startsWith']('user:'))return;const _0x328d33=_0x5a254e['batch'];_0x58bfca['_createdBatches']['has'](_0x328d33)&&(_0x5a254e['newRange']=_0x5a254e['oldRange']?_0x55a2ab['model']['createRange'](_0x5a254e['oldRange']['start'],_0x5a254e['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x5df017=this['editor'],_0x2ef986=_0x5df017['model']['document'],_0x609f1c=_0x5df017['plugins']['get'](i);_0x5df017['model']['enqueueChange']({'isUndoable':!0x1},_0x5ce4a6=>{const _0x2fda9c='user:range:'+_0x609f1c['mySessionId'],_0x1628ba='user:position:'+_0x609f1c['mySessionId'],_0x332625=_0x5df017['model']['markers']['has'](_0x2fda9c);_0x5df017['editing']['view']['hasDomSelection']?te(_0x609f1c['mySessionId'],_0x2ef986['selection']['getFirstRange'](),_0x5df017['model'],_0x5ce4a6):_0x332625&&(_0x5ce4a6['removeMarker'](_0x2fda9c),_0x5ce4a6['removeMarker'](_0x1628ba));});}}function te(_0x51a41e,_0x127050,_0x5884f5,_0x1e8911){const _0x23eb3d='user:range:'+_0x51a41e,_0x30f3d7='user:position:'+_0x51a41e,_0x26bebf=_0x127050['getContainedElement']();let _0x41d9df=_0x127050['start'];if(_0x26bebf&&_0x26bebf['is']('element','tableCell')){const _0x1e4fb7=function(_0x367259,_0x2ce789){for(const _0x47b2b9 of _0x367259['getPositions']())if(_0x2ce789['schema']['checkChild'](_0x47b2b9,'$text'))return _0x47b2b9;}(_0x127050,_0x5884f5);_0x1e4fb7&&(_0x41d9df=_0x1e4fb7,_0x127050=_0x1e8911['createRange'](_0x41d9df));}const _0x318359=_0x1e8911['createRange'](_0x41d9df);_0x5884f5['markers']['has'](_0x23eb3d)?(_0x1e8911['updateMarker'](_0x23eb3d,{'range':_0x127050}),_0x1e8911['updateMarker'](_0x30f3d7,{'range':_0x318359})):(_0x1e8911['addMarker'](_0x23eb3d,{'range':_0x127050,'usingOperation':!0x0}),_0x1e8911['addMarker'](_0x30f3d7,{'range':_0x318359,'usingOperation':!0x0}));}function K(_0x55fe67,_0x34de51,_0x185d6e){const _0xa81c90=_0x55fe67['t'],t=_0x55fe67['t'];switch(_0x34de51){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 _0xa81c90({'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'},_0x185d6e);default:return'';}}let X=0x1;class l extends _0x5d6859{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x5a5013)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,$,_0x1b6042,_0x595866,_0x141545];}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 _0x2e1773=this['serverHistory']['getOperations']();for(let _0x59cbe8=_0x2e1773['length']-0x1;_0x59cbe8>=0x0;_0x59cbe8--){const _0x52d6fd=_0x2e1773[_0x59cbe8];if(!this['_disconnectionOperations']['has'](_0x52d6fd))return _0x52d6fd['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x981529){if(super(_0x981529),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0xb8e3ac(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x4d1849('collaboration-missing-channelid',this);const _0x3833f8=_0x981529['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x3833f8,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x29c866(),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 _0x2444c7=this['editor'],_0x4f7182=_0x2444c7['plugins']['get'](_0x595866),_0x73da9c=_0x2444c7['plugins']['get'](n);this['listenTo'](_0x4f7182,'getOperationAuthor',(_0x164c40,_0x3221ce)=>{const _0x812b13=_0x3221ce[0x0];_0x812b13['_authorId']&&(_0x164c40['return']=_0x4f7182['getUser'](_0x812b13['_authorId']),_0x164c40['stop']()),null===_0x812b13['_authorId']&&(_0x164c40['return']=null,_0x164c40['stop']());},{'priority':'high'}),this['listenTo'](_0x2444c7['model']['document']['selection'],'change:range',(_0x395bbb,_0x2d3ad2)=>{_0x2d3ad2['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x2444c7['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x2444c7['model']['on']('applyOperation',(_0x3577e3,_0x45b962)=>{const _0x54f52a=_0x45b962[0x0];_0x54f52a['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x54f52a),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x73da9c,'state',this,'_hasSynchronizationProblem',(_0x7326bb,_0x208e84)=>'connected'===_0x7326bb&&!_0x208e84),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x2444c7['disableReadOnlyMode']('rtc-offline'):_0x2444c7['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x2444c7['disableReadOnlyMode']('rtc-offline'):_0x2444c7['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x364d78=this['editor']['plugins']['get'](i),_0x3a6c97=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x364d78['unregister'](this['_channelId']);const _0x492b87=await this['_service']['reconnect'](_0x3a6c97['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x492b87)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x37a28f=await this['_service']['getConnectedSessions']();_0x364d78['register'](this['_channelId'],_0x37a28f),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4a6e99){if(function(_0x17dfe5){return'404'===_0x17dfe5['code'];}(_0x4a6e99)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x35c576){return'409'===_0x35c576['code'];}(_0x4a6e99)){const _0x4fcdf2=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'](_0x4fcdf2);}else{if(!(_0x4a6e99 instanceof Y))throw _0x4a6e99;this['_handleReconnectionError']();}}}}['destroy'](){const _0x30ea57=this['editor']['plugins']['get'](n),_0x1996b8=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x1996b8['channelSessions']['has'](this['_channelId'])&&_0x1996b8['unregister'](this['_channelId']),_0x30ea57['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0xec3f22){if(this['sessionId']!==_0xec3f22['sessionId']&&this['_lastSyncedOperationId']!==_0xec3f22['lastOperationId'])throw new Y();return this['sessionId']=_0xec3f22['sessionId'],this['_handleServerResponse']([],{..._0xec3f22,'wereChangesApplied':!0x1,'data':_0xec3f22['data']},'reconnect');}async['_connectService'](_0x52fb9c,_0x33d140=!0x1){const {connection:_0x329dce}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x329dce,this['_channelId'])['then'](_0x56e866=>this['_initSessionsHandling'](_0x56e866))['catch'](_0x1ca1f6=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1ca1f6);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x492a1e,_0x230e7b)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x230e7b);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x1a177b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x52fb9c);this['_isPendingUpdate']=!0x0;const _0x5f0097=await this['_service']['connect'](_0x329dce,this['_compressOperations'](_0x52fb9c),_0x1a177b);if(this['sessionId']=_0x5f0097['sessionId'],_0x33d140){if(!_0x5f0097['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x5f0097['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x52fb9c,_0x5f0097,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x5f0097,_0x52fb9c);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x12c890=this['editor']['plugins']['get'](i),_0x555e04=this['editor']['plugins']['get']($),_0x395a6e=_0x12c890['channelSessions']['get'](this['_channelId']);_0x395a6e&&_0x395a6e['length']>0x1?_0x555e04['createUserMarkerOperations']():this['listenTo'](_0x12c890,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x12c890['channelSessions']['get'](this['_channelId'])['length']&&_0x555e04['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x183890,_0x34fe4b,_0xd3912d,_0x21b4dd){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x34fe4b){const _0x4eb9c9=this['_decompressOperations'](_0xd3912d,_0x21b4dd);await this['_fetchMissingUsers'](_0x4eb9c9),this['_handleExternalOperations'](_0x4eb9c9,_0x34fe4b,_0xd3912d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x31e2c3}=this['editor'];let _0x422b21;try{_0x422b21=await this['_service']['getDocumentDetails']();}catch{const _0xc35da0=K(_0x31e2c3,'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'](_0xc35da0);}const _0x21ef29=_0x422b21['currentDocumentSession']||_0x422b21['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x21ef29['lastOperationId']){const _0x53827b=K(_0x31e2c3,'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'](_0x53827b);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x59f5c){const _0x43b208=this['editor']['plugins']['get'](i);this['listenTo'](_0x43b208,'sessionAdd:'+this['_channelId'],(_0x37a431,{session:_0x482723})=>{if(_0x482723['id']===_0x43b208['mySessionId']){_0x37a431['off']();const _0x5e3437=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x1b5f1b=_0x482723['permissions'];_0x5e3437&&_0x5e3437['isEnabled']&&(_0x1b5f1b=_0x1b5f1b['filter'](_0x4b7241=>'document:write'!==_0x4b7241)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x1b5f1b,this['_channelId']);}}),_0x43b208['register'](this['_channelId'],_0x59f5c);}['_initThrowingOnDataSet'](){const _0x2c0903=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x33d086)=>{if(!_0x33d086[_0x33d086['length']-0x1]['suppressErrorInCollaboration'])throw new _0x4d1849('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x2c0903['apply'](this['editor']['data'],_0x33d086);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x46c49c,[_0x4197f2])=>{if(this['_document']['version'])throw new _0x4d1849('realtimecollaborationclient-init-document-already-initialized',this);_0x46c49c['stop'](),this['_setPendingAction']();const _0xa6194e=this['editor']['config']['get']('rootsAttributes'),_0x364e26=this['_getOperationsFromInitData'](_0x4197f2,_0xa6194e);0x0==_0x364e26['length']&&_0x364e26['push'](new _0x5bebc6(0x0)),_0x46c49c['return']=this['_connectService'](_0x364e26)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x60e185=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x60e185))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x580866,[_0x42d630,_0x4681e4])=>{_0x580866['stop']();const _0x1834a9=this['editor']['model']['document']['getRoot'](_0x42d630);if(!this['_knownRootNames']['has'](_0x42d630)){const _0x3b9d1b=_0x4681e4&&_0x4681e4['data']?_0x4681e4['data']:'',_0x1cca70=_0x4681e4&&_0x4681e4['attributes']?_0x4681e4['attributes']:{};await this['_loadRoot'](_0x42d630,_0x3b9d1b,_0x1cca70);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x1834a9['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x1834a9);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x121e61){const _0x5bf046=this['editor']['plugins']['get'](_0x595866),{connection:_0x29f6d6}=this['editor']['plugins']['get'](n),_0x362471=new Set();for(const _0x281fa1 of _0x121e61){const _0x36a16d=_0x281fa1['_authorId'];_0x36a16d&&!_0x5bf046['getUser'](_0x36a16d)&&_0x362471['add'](_0x36a16d);}if(0x0===_0x362471['size'])return;const _0x3662c6=await ct['getMany'](_0x29f6d6,Array['from'](_0x362471));for(const _0x13c25c of _0x3662c6)_0x5bf046['getUser'](_0x13c25c['id'])||_0x5bf046['addUser'](_0x13c25c);}['_getOperationsFromInitData'](_0x1fea1d,_0x3b6927={}){const _0x329544=this['editor']['model'],_0xae9371=[];let _0x289003=0x0;const _0x1abbf0='string'==typeof _0x1fea1d?{'main':_0x1fea1d}:_0x1fea1d;for(const _0x40f54d of Object['keys'](_0x1abbf0)){if(!this['_document']['roots']['has'](_0x40f54d))throw new _0x4d1849('realtimecollaborationclient-init-non-existent-root',this);const _0x2c4278=this['editor']['data']['parse'](_0x1abbf0[_0x40f54d]),_0x40a918=this['_document']['getRoot'](_0x40f54d),_0x390352=new _0x298a31(_0x329544['createPositionAt'](_0x40a918,0x0),_0x2c4278,_0x289003++);_0xae9371['push'](_0x390352);for(const [_0x5044f0,_0x424f87]of _0x2c4278['markers']){const _0x13fe6b=_0x329544['createRange'](_0x329544['createPositionFromPath'](_0x40a918,_0x424f87['start']['path']['slice']()),_0x329544['createPositionFromPath'](_0x40a918,_0x424f87['end']['path']['slice']())),_0x3b3103=new _0x1d3670(_0x5044f0,null,_0x13fe6b,_0x329544['markers'],!0x0,_0x289003++);_0xae9371['push'](_0x3b3103);}}if(_0x3b6927)for(const [_0x33c5df,_0x52effe]of Object['entries'](_0x3b6927)){const _0x18bd7f=_0x329544['document']['getRoot'](_0x33c5df);if(!_0x18bd7f)throw new _0x4d1849('multi-root-editor-root-attributes-no-root',null);for(const [_0x41ee0e,_0x4bb06f]of Object['entries'](_0x52effe))if(null!==_0x4bb06f){const _0x9cd956=new _0xd1c1c(_0x18bd7f,_0x41ee0e,null,_0x4bb06f,_0x289003++);_0xae9371['push'](_0x9cd956);}}return _0xae9371;}async['_loadRoot'](_0x25027c,_0x376c05,_0x3003d5){this['_getOperationsFromInitData']({[_0x25027c]:_0x376c05},{[_0x25027c]:_0x3003d5})['forEach']((_0x11722f,_0x4d32b2)=>{_0x11722f['baseVersion']=this['_document']['version']+_0x4d32b2,_0x11722f['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x11722f);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x2d613e,_0x214195){let _0x1beb6c;this['_offset']=_0x2d613e['offset'];const _0x200c43=_0x2d613e['wereChangesApplied']&&!_0x2d613e['initData'],_0x205002=_0x200c43?0x0:_0x2d613e['data']['baseVersion'];if(_0x214195['forEach'](_0x516199=>{_0x516199['_isInit']=!0x0,_0x516199['createdAt']=_0x2d613e['sessionCreatedAt'],_0x516199['_authorId']=null;}),_0x200c43)_0x1beb6c=_0x214195,this['_applyOperationsSet'](_0x1beb6c,_0x200c43);else{if(_0x2d613e['initData']){const _0x26fbd4=this['_getOperationsFromInitData'](_0x2d613e['initData']);this['_document']['history']['version']=-_0x26fbd4['length'],_0x26fbd4['forEach'](_0x33ab38=>{_0x33ab38['baseVersion']-=_0x26fbd4['length'],_0x33ab38['createdAt']=_0x2d613e['sessionCreatedAt'],_0x33ab38['_isInit']=!0x0,_0x33ab38['_authorId']=null;}),this['_applyOperationsSet'](_0x26fbd4,!0x0),this['serverHistory']['version']=-_0x26fbd4['length']+this['_offset'],this['_updateServerHistory'](_0x26fbd4);}this['_document']['history']['version']=_0x205002,_0x1beb6c=this['_decompressOperations'](_0x2d613e['data'],_0x2d613e['metadata']),await this['_fetchMissingUsers'](_0x1beb6c),this['_applyOperationsSet'](_0x1beb6c,_0x200c43);}_0x2d613e['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1beb6c,_0x2d613e['lastOperationId']),this['_lastSyncedOperationId']=_0x2d613e['lastOperationId']),this['serverHistory']['version']=_0x205002+this['_offset'],this['_updateServerHistory'](_0x1beb6c),_0x214195['filter'](_0x234fa9=>{const _0x1c2730=this['_getAffectedRoot'](_0x234fa9);return _0x1c2730&&!this['_knownRootNames']['has'](_0x1c2730);})['forEach']((_0x313696,_0x299d76)=>{_0x313696['baseVersion']=this['_document']['version']+_0x299d76,this['_saveOperationInBuffer'](_0x313696);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2a85cc,_0x258855){const _0x1665a5=_0x258855&&_0x258855['message'];if(_0x1665a5&&_0x1665a5['startsWith']('realtimecollaborationclient'))throw _0x258855;const _0x33ff8e=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x33ff8e['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x4d1849(_0x2a85cc,this['editor'],_0x1665a5?{'originalError':_0x1665a5}:void 0x0);}['_saveOperationInBuffer'](_0x37f58a){this['_knownOperations']['has'](_0x37f58a)||(this['_knownOperations']['add'](_0x37f58a),this['_bufferedOperations']['push'](_0x37f58a),this['_pendingAction']||'marker'==_0x37f58a['type']&&!_0x37f58a['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x5c4b3e=!0x1){!_0x5c4b3e&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xf34805=>{_0xf34805&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x3e401b=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xf36ad7){return _0xf36ad7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xf36ad7['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xf36ad7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x3e401b)||this['_crash'](_0x3e401b['message'],_0x3e401b);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x23c8ef=>{this['on']('change:_isPendingUpdate',()=>{_0x23c8ef();});});}async['_sendBufferedOperations'](){const _0x215631=this['editor']['plugins']['get']($);if(this['_shouldSendSelectionUpdate']()&&(_0x215631['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5f4540=[...this['_bufferedOperations']];for(const _0x48ede1 of _0x5f4540)_0x48ede1['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x48ede1);const _0x12fbad=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5f4540),_0x411c05=X++,_0x4905ae=this['_compressOperations'](_0x5f4540),_0x2bd6bf=await this['_service']['sendOperations'](_0x4905ae,_0x4905ae['baseVersion'],_0x12fbad);try{return await this['_handleServerResponse'](_0x5f4540,_0x2bd6bf,_0x411c05);}catch(_0x3cf0ee){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3cf0ee);}}async['_handleServerResponse'](_0x1b0ffc,_0x4ad69f,_0x449fb8){if('error'in _0x4ad69f)throw _0x4ad69f['error'];let _0x210e60=!0x1;if(_0x4ad69f['wereChangesApplied']){_0x4ad69f['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4ad69f['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0xf5e0b8=>!_0x1b0ffc['includes'](_0xf5e0b8));for(const _0x12ef52 of _0x1b0ffc)_0x12ef52['createdAt']='lastOperationAcceptedAt'in _0x4ad69f&&_0x4ad69f['lastOperationAcceptedAt']||void 0x0;Z(_0x1b0ffc,_0x4ad69f['version']-_0x1b0ffc['length']),this['_updateServerHistory'](_0x1b0ffc);const _0x12c45a=_0x1b0ffc['filter'](_0x3c1cc1=>{if(!_0x3c1cc1['_isInit'])return!0x1;const _0x277dc2=this['_getAffectedRoot'](_0x3c1cc1);return _0x277dc2&&!this['_knownRootNames']['has'](_0x277dc2);});Z(_0x12c45a,this['_document']['version']),this['_applyOperationsSet'](_0x12c45a),_0x210e60=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x11cf99=this['_decompressOperations'](_0x4ad69f['data'],_0x4ad69f['metadata'])['filter'](_0x21f0d0=>_0x21f0d0['baseVersion']>=this['_lastServerVersion']);_0x11cf99['forEach'](_0xc2314a=>this['_addKnownRoot'](_0xc2314a)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5e912e=>!_0x5e912e['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5e912e))),this['_bufferedOperations']['length']&&Z(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x11cf99),_0x210e60=this['_handleExternalOperations'](_0x11cf99,_0x4ad69f['version'],_0x4ad69f['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x210e60?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3d9f8d,_0x2faf36,_0x42931c){try{const _0x4fca16={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x48920,operationsB:_0x1c8342,originalOperations:_0x4b124e}=_0x2eba0d(_0x3d9f8d,this['_bufferedOperations'],_0x4fca16);Z(_0x48920,this['_document']['version']),Z(_0x1c8342,_0x2faf36);for(const _0x2fe5f1 of _0x48920){const _0x3af1b5=_0x4b124e['get'](_0x2fe5f1);_0x2fe5f1['_authorId']=_0x3af1b5?_0x3af1b5['_authorId']:null;}_0x42931c&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3d9f8d,_0x42931c),this['_lastSyncedOperationId']=_0x42931c),this['_bufferedOperations']=[..._0x1c8342],this['_applyOperationsSet'](_0x48920),this['_updateServerHistory'](_0x3d9f8d);}catch(_0x5ebab3){return console['error'](_0x5ebab3),!0x1;}return!0x0;}['_applyOperationsSet'](_0x16621c,_0x5d3073=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x45afae=>{for(const _0xa78db of _0x16621c)this['_knownOperations']['add'](_0xa78db),this['_addKnownRoot'](_0xa78db),_0x45afae['batch']['addOperation'](_0xa78db),this['editor']['model']['applyOperation'](_0xa78db);});}['_addKnownRoot'](_0x5d431e){const _0x39f80b=this['_getAffectedRoot'](_0x5d431e);_0x39f80b&&this['_knownRootNames']['add'](_0x39f80b);}['_getAffectedRoot'](_0x1fe391){let _0x1d0a23,_0x5914d9;switch(_0x1fe391['type']){case'insert':_0x1d0a23=_0x1fe391['position']['root'];break;case'marker':if(_0x5914d9=_0x1fe391['newRange'],!_0x5914d9)return null;_0x1d0a23=_0x5914d9['root'];break;case'addRootAttribute':_0x1d0a23=_0x1fe391['root'];break;case'addRoot':_0x1d0a23=_0x1fe391['affectedSelectable'];break;case'move':_0x1d0a23=_0x1fe391['targetPosition']['root'];break;default:return null;}return _0x1d0a23['rootName'];}['_updateServerHistory'](_0x1f2306){_0x1f2306['forEach'](_0x254912=>{const _0x29bb65=_0x254912['clone']();_0x29bb65['_authorId']=_0x254912['_authorId'],_0x29bb65['_isInit']=!!_0x254912['_isInit'],_0x29bb65['createdAt']=_0x254912['createdAt'],_0x29bb65['baseVersion']+=this['_offset'],_0x254912['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x29bb65),this['serverHistory']['addOperation'](_0x29bb65);});}['_handleReconnectionError'](_0x4615bf){const _0x525432=this['editor']['plugins']['get']('Notification'),_0x43a83a=this['editor']['locale'];_0x4615bf||(_0x4615bf=K(_0x43a83a,'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.')),_0x525432['showWarning'](_0x4615bf,{'title':K(_0x43a83a,'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'](_0x1b6042)['add'](K(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1b6042)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x2a1a33){const _0x247bd0=_0x2a1a33['map'](_0x3a2f46=>_0x3a2f46['toJSON']());return this['_compressor']['compress'](_0x247bd0);}['_decompressOperations'](_0x1ef857,_0x2fa0c7){return this['_compressor']['decompress'](_0x1ef857)['map']((_0x3ff82c,_0x94cb74)=>{const _0x373ca8='init'==_0x2fa0c7[_0x94cb74]['type'];if('InsertOperation'==_0x3ff82c['__className']){const _0x25bee1=_0x3ff82c['position']['root'];!this['_document']['getRoot'](_0x25bee1)&&(this['_document']['createRoot']('$root',_0x25bee1)['_isAttached']=!0x1);}const _0xf1f314=_0x3c0389['fromJSON'](_0x3ff82c,this['_document']);return _0xf1f314['wasUndone']=_0x3ff82c['wasUndone'],_0xf1f314['_isInit']=_0x373ca8,_0xf1f314['_authorId']=_0x373ca8?null:_0x2fa0c7[_0x94cb74]['userId'],_0xf1f314['_isDisconnection']='cs:removeUser'===_0x2fa0c7[_0x94cb74]['type'],_0xf1f314['createdAt']=_0x2fa0c7[_0x94cb74]['createdAt'],_0xf1f314;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x41ceaa=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x41ceaa&&_0x41ceaa['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Y extends Error{}function Z(_0x1c42c5,_0x1c5c8f){for(const _0x3770d7 of _0x1c42c5)_0x3770d7['baseVersion']=_0x1c5c8f++;}class tt{['_ignoredOperations'];['_operationToId'];constructor(_0x17c9b7){this['_ignoredOperations']=_0x17c9b7,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x1999b6){let _0x25f52c=_0x1999b6['length'];for(;_0x25f52c--;){const _0x78265=_0x1999b6[_0x25f52c];if(!this['_ignoredOperations']['has'](_0x78265)){if(!this['_operationToId']['has'](_0x78265)){const _0x585ab7=_0xa36db5()['slice'](0x1,0x12);this['_operationToId']['set'](_0x78265,_0x585ab7);}return this['_operationToId']['get'](_0x78265);}}}['setIdForTheLastOperation'](_0x118f35,_0x13689e){if(!_0x13689e)return;let _0x3c87bb=_0x118f35['length'];for(;_0x3c87bb--;){const _0x246077=_0x118f35[_0x3c87bb];this['_ignoredOperations']['has'](_0x246077)||this['_operationToId']['set'](_0x246077,_0x13689e);}}}class a extends _0x5d6859{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x381c27{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x3afce2)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x595866];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x59c858){super(_0x59c858),this['_services']=new Map();}async['init'](){const _0x1ff06f=this['context'],_0x3ed5ba=_0x1ff06f['plugins']['get']('CommentsRepository');if(_0x1ff06f['plugins']['get'](n)['addToReconnectionStack'](this),_0x3ed5ba['adapter']={'addCommentThread':async({channelId:_0x4c19e1,threadId:_0x44f2fb,comments:_0x191f23,resolvedAt:_0x41dab9,resolvedBy:_0x5a571e,context:_0x1f4bc3,attributes:_0x1f8333})=>{const _0x4e21ff=await this['_getService'](_0x4c19e1)['addCommentThread']({'commentThreadId':_0x44f2fb,'comments':_0x191f23['map'](_0x3bc005=>function(_0x390c9e,_0x1e1c58,_0x455f30){return{'commentThreadId':_0x455f30,'commentId':_0x390c9e['commentId'],'userId':_0x390c9e['authorId'],'content':_0x390c9e['content'],'documentId':_0x1e1c58,'createdAt':_0x390c9e['createdAt'],'attributes':_0x390c9e['attributes']||{}};}(_0x3bc005,_0x4c19e1,_0x44f2fb)),'resolvedAt':_0x41dab9,'resolvedBy':_0x5a571e,'context':_0x1f4bc3,'attributes':_0x1f8333})['catch'](at);return{'threadId':_0x4e21ff['commentThreadId'],'comments':_0x4e21ff['comments']};},'getCommentThread':async({channelId:_0x41e4ad,threadId:_0x5cc846})=>{const _0x2133a8=await this['_getService'](_0x41e4ad)['getCommentThread'](_0x5cc846)['catch'](at);return _0x2133a8['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x2133a8]),{'threadId':_0x2133a8['commentThreadId'],'comments':_0x2133a8['comments']['map'](B),'context':_0x2133a8['context'],'resolvedAt':_0x2133a8['resolvedAt'],'resolvedBy':_0x2133a8['resolvedBy'],'attributes':_0x2133a8['attributes']||{}});},'updateCommentThread':async({channelId:_0x5220bf,threadId:_0x2eaef5,context:_0x30f592,unlinkedAt:_0x49845d,attributes:_0x3899b6})=>this['_getService'](_0x5220bf)['updateCommentThread']({'commentThreadId':_0x2eaef5,'context':_0x30f592,'attributes':_0x3899b6,'unlinkedAt':_0x49845d})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x444406,threadId:_0x243058})=>{const _0xec748c=await this['_getService'](_0x444406)['resolveCommentThread'](_0x243058)['catch'](F)['catch'](at);return{'threadId':_0xec748c['commentThreadId'],'resolvedAt':_0xec748c['resolvedAt'],'resolvedBy':_0xec748c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x299489,threadId:_0x5cef1a})=>this['_getService'](_0x299489)['reopenCommentThread'](_0x5cef1a)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x29cf7e,threadId:_0x3caace})=>this['_getService'](_0x29cf7e)['removeCommentThread'](_0x3caace)['catch'](F)['catch'](at),'addComment':({channelId:_0x4fcd82,threadId:_0x4ab0a7,commentId:_0x2637d1,content:_0x4dbfd1,attributes:_0x411455})=>this['_getService'](_0x4fcd82)['addComment'](_0x4ab0a7,_0x2637d1,_0x4dbfd1,_0x411455)['catch'](at),'updateComment':({channelId:_0x224c17,threadId:_0x5ba398,commentId:_0x122672,content:_0x96370d,attributes:_0x1e8a1e})=>this['_getService'](_0x224c17)['updateComment'](_0x5ba398,_0x122672,_0x96370d,_0x1e8a1e)['catch'](F)['catch'](at),'removeComment':({channelId:_0x341603,threadId:_0x5ad533,commentId:_0x13b1ae})=>this['_getService'](_0x341603)['removeComment'](_0x5ad533,_0x13b1ae)['catch'](F)['catch'](at)},_0x1ff06f instanceof _0x51e0d6){const _0x542717=_0x1ff06f['config']['get']('collaboration.channelId'),_0x5df6cf=_0x1ff06f['plugins']['get'](i);await this['_setUpService'](_0x542717);const _0x5bff2b=await this['_services']['get'](_0x542717)['getConnectedSessions']();this['listenTo'](_0x5df6cf,'sessionAdd:'+_0x542717,(_0x114584,{session:_0x595a32})=>{_0x595a32['id']===_0x5df6cf['mySessionId']&&(_0x114584['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x595a32['permissions'],_0x542717));}),_0x5df6cf['register'](_0x542717,_0x5bff2b);}}async['_setUpService'](_0x169a84){if(this['_services']['has'](_0x169a84))throw new _0x4d1849('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x169a84});const _0x1d2661=this['context']['plugins']['get']('CommentsRepository'),_0x5d041e=new s['CommentsService'](_0x169a84);this['_services']['set'](_0x169a84,_0x5d041e),this['listenTo'](_0x5d041e,'commentThreadAdded',(_0x5009fc,_0x1b9ffa)=>{const {commentThreadId:_0x5b0940,documentId:_0x599383,context:_0x334d10,attributes:_0x503bb6,resolvedAt:_0x5ea723,resolvedBy:_0x1b7ef8,comments:_0x3ebf2e}=_0x1b9ffa;_0x1d2661['getCommentThread'](_0x5b0940)||_0x1d2661['addCommentThread']({'threadId':_0x5b0940,'channelId':_0x599383,'comments':_0x3ebf2e?_0x3ebf2e['map'](B):[],'context':_0x334d10,'attributes':_0x503bb6,'resolvedAt':_0x5ea723,'resolvedBy':_0x1b7ef8,'isFromAdapter':!0x0});}),this['listenTo'](_0x5d041e,'commentThreadUpdated',(_0x205e6b,{commentThreadId:_0x5808ec,documentId:_0xbe16c8,context:_0x2add93,unlinkedAt:_0x2e9d63,attributes:_0x42cea5})=>{_0x1d2661['getCommentThread'](_0x5808ec)&&_0x1d2661['updateCommentThread']({'threadId':_0x5808ec,'channelId':_0xbe16c8,'context':_0x2add93,'unlinkedAt':_0x2e9d63,'attributes':_0x42cea5,'isFromAdapter':!0x0});}),this['listenTo'](_0x5d041e,'commentThreadResolved',(_0xec8062,{commentThreadId:_0x4f1511,resolvedBy:_0xabfb53,resolvedAt:_0x294178})=>{const _0x2add06=_0x1d2661['getCommentThread'](_0x4f1511);_0x2add06&&_0x2add06['resolve']({'resolvedBy':_0xabfb53,'resolvedAt':_0x294178,'isFromAdapter':!0x0});}),this['listenTo'](_0x5d041e,'commentThreadReopened',(_0x5023e6,{commentThreadId:_0x23ec7e})=>{const _0x429f43=_0x1d2661['getCommentThread'](_0x23ec7e);_0x429f43&&_0x429f43['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5d041e,'commentThreadRemoved',(_0x46815f,{commentThreadId:_0x49460f})=>{const _0xec9ff0=_0x1d2661['getCommentThread'](_0x49460f);_0xec9ff0&&_0xec9ff0['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5d041e,'commentAdded',(_0x9ef825,_0x1bb772)=>{const _0x4d7850=_0x1bb772['commentThreadId'],_0x199d48=_0x1d2661['getCommentThread'](_0x4d7850);_0x199d48&&_0x199d48['addComment']({...B(_0x1bb772),'isFromAdapter':!0x0});}),this['listenTo'](_0x5d041e,'commentUpdated',(_0x3f91ed,{commentThreadId:_0x5a935b,commentId:_0x1898cd,content:_0x3eb5f4,attributes:_0x323550})=>{const _0x21b8f8=_0x1d2661['getCommentThread'](_0x5a935b);if(_0x21b8f8){const _0x1dd95c=_0x21b8f8['getComment'](_0x1898cd);_0x1dd95c&&_0x1dd95c['update']({'content':_0x3eb5f4,'attributes':_0x323550,'isFromAdapter':!0x0});}}),this['listenTo'](_0x5d041e,'commentRemoved',(_0x258c32,{commentThreadId:_0x4140a9,commentId:_0x50ecef})=>{const _0x356cef=_0x1d2661['getCommentThread'](_0x4140a9);if(_0x356cef){const _0x267ef2=_0x356cef['getComment'](_0x50ecef);_0x267ef2&&_0x267ef2['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x169a84);}['destroy'](){if(this['context']instanceof _0x51e0d6){const _0x499b26=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x499b26);}}['_terminateService'](_0x5b3a2d){if(!this['_services']['has'](_0x5b3a2d))throw new _0x4d1849('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x5b3a2d});this['_getService'](_0x5b3a2d)['disconnect'](),this['_services']['delete'](_0x5b3a2d);}async['reconnect'](){for(const _0x348a46 of this['_services']['keys']())await this['_connectService'](_0x348a46);if(this['context']instanceof _0x51e0d6){const _0x1e288e=this['context']['config']['get']('collaboration.channelId'),_0x1b714c=this['context']['plugins']['get'](i);_0x1b714c['unregister'](_0x1e288e);const _0x442f53=await this['_services']['get'](_0x1e288e)['getConnectedSessions']();_0x1b714c['register'](_0x1e288e,_0x442f53);}}async['_connectService'](_0x21e87b){const {connection:_0x578e28}=this['context']['plugins']['get'](n),_0x3d7294=this['context']['plugins']['get']('CommentsRepository'),_0x4db778=this['_services']['get'](_0x21e87b),_0x2ce227=await _0x4db778['connect'](_0x578e28);await this['_fetchMissingUsersForThreads'](_0x2ce227);const _0x4e973e=new Set(Array['from'](_0x3d7294['getCommentThreads']({'channelId':_0x21e87b}),_0x5447a3=>_0x5447a3['id']));for(const _0x221359 of _0x2ce227)_0x221359['deletedAt']||_0x4e973e['delete'](_0x221359['commentThreadId']);for(const _0x1a8a68 of _0x4e973e)_0x3d7294['getCommentThread'](_0x1a8a68)['remove']({'isFromAdapter':!0x0});for(const _0x49405a of _0x2ce227){let _0x214313=_0x3d7294['getCommentThread'](_0x49405a['commentThreadId']);const {commentThreadId:_0x233823,context:_0x10848e,attributes:_0x48191d,resolvedBy:_0x190f5d,resolvedAt:_0x1fbf84,unlinkedAt:_0x23a20e,deletedAt:_0x593569}=_0x49405a;if(_0x593569)continue;_0x214313||(_0x214313=_0x3d7294['addCommentThread']({'channelId':_0x21e87b,'threadId':_0x233823,'context':_0x10848e,'attributes':_0x48191d||{},'resolvedBy':_0x190f5d,'resolvedAt':_0x1fbf84,'unlinkedAt':_0x23a20e,'isFromAdapter':!0x0}));const _0x1bfbd7=new Set(Array['from'](_0x214313['comments'],_0xec2c2e=>_0xec2c2e['id']));for(const _0x259a4b of _0x49405a['comments'])_0x1bfbd7['delete'](_0x259a4b['commentId']);for(const _0x1cfab6 of _0x1bfbd7)_0x214313['getComment'](_0x1cfab6)['remove']({'isFromAdapter':!0x0});for(const _0x313b04 of _0x49405a['comments']){const _0x5ecd50=_0x214313['getComment'](_0x313b04['commentId']);_0x5ecd50?_0x5ecd50['content']!==_0x313b04['content']&&_0x5ecd50['update']({'content':_0x313b04['content'],'isFromAdapter':!0x0}):_0x214313['addComment'](Object['assign'](B(_0x313b04),{'isFromAdapter':!0x0}));}}}['_getService'](_0x1c2e23){if(!this['_services']['has'](_0x1c2e23))throw new _0x4d1849('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1c2e23});return this['_services']['get'](_0x1c2e23);}async['_fetchMissingUsersForThreads'](_0x205747){const _0x391b92=this['context']['plugins']['get'](_0x595866),{connection:_0x290817}=this['context']['plugins']['get'](n),_0x359c03=new Set();for(const {resolvedBy:_0x59e503,comments:_0x344cab}of _0x205747){_0x59e503&&!_0x391b92['getUser'](_0x59e503)&&_0x359c03['add'](_0x59e503);for(const {userId:_0x3d296f}of _0x344cab)_0x391b92['getUser'](_0x3d296f)||_0x359c03['add'](_0x3d296f);}if(0x0===_0x359c03['size'])return;const _0x31d800=await ct['getMany'](_0x290817,Array['from'](_0x359c03));for(const _0x589188 of _0x31d800)_0x391b92['getUser'](_0x589188['id'])||_0x391b92['addUser'](_0x589188);}}async function F(_0x33feb7){if('404'!==_0x33feb7['code'])throw _0x33feb7;}function at(_0xf790f2){if((_0x1041d0=_0xf790f2)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1041d0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1041d0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1041d0;throw _0xf790f2;}function B(_0x2d330c){return{'threadId':_0x2d330c['commentThreadId'],'commentId':_0x2d330c['commentId'],'content':_0x2d330c['content'],'createdAt':_0x2d330c['createdAt'],'authorId':_0x2d330c['userId'],'attributes':_0x2d330c['attributes']||{}};}class m extends _0x5d6859{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>_0x562c27)());['_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(_0x5987ab){super(_0x5987ab);const _0x1b2f3a=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x1b2f3a);}['init'](){const _0x1e6a25=this['editor']['plugins']['get'](n),_0xdde9a=this['editor']['plugins']['get']('TrackChangesEditing');return _0xdde9a['adapter']={'getSuggestion':async _0x46bb46=>{await this['_waitForServiceReady']();const _0x267661=await this['_trackChangesService']['get'](_0x46bb46)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0x267661]),_0x267661;},'addSuggestion':async({id:_0x1dc9f0,type:_0x24355d,data:_0x596ffd,originalSuggestionId:_0x5c3288,attributes:_0x16e951})=>{await this['_waitForServiceReady']();const _0x3b4d5d={'id':_0x1dc9f0,'type':_0x24355d,'data':_0x596ffd,'originalSuggestionId':_0x5c3288,'attributes':_0x16e951},_0x38711e=await this['_trackChangesService']['add'](_0x1dc9f0,_0x24355d,_0x596ffd,_0x5c3288,_0x16e951)['catch'](_0x1d62e0=>{if(ht(_0x1d62e0))return new Promise(_0x28695d=>{this['_bufferedRequests']['set'](_0x1dc9f0,{'resolve':_0x28695d,'suggestionData':_0x3b4d5d});});throw _0x1d62e0;});return this['_bufferedRequests']['delete'](_0x1dc9f0),_0x38711e;},'updateSuggestion':async(_0x384897,_0x50d4ea)=>{if(await this['_waitForServiceReady'](),'open'!==_0x50d4ea['state'])return this['_trackChangesService']['update'](_0x384897,_0x50d4ea)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x35060f,_0x484b84)=>{_0xdde9a['hasSuggestion'](_0x484b84['id'])&&(_0xdde9a['getSuggestion'](_0x484b84['id'])['attributes']=_0x484b84['attributes']);}),this['_trackChangesService']['connect'](_0x1e6a25['connection'])['then'](_0x2d1618=>(_0x1e6a25['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2d1618)['then'](()=>{for(const _0x1afba2 of _0x2d1618){_0xdde9a['addSuggestionData'](_0x1afba2)['_saved']=!0x0;}})));}async['reconnect'](){const _0x316fa1=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x2f5f54}=this['editor']['plugins']['get'](n),_0x5e0904=await this['_trackChangesService']['connect'](_0x2f5f54);await this['_fetchMissingUsersForThreads'](_0x5e0904);for(const {suggestionData:_0x41f134,resolve:_0x48e026}of this['_bufferedRequests']['values']()){let _0x50da0c=_0x5e0904['find'](_0x1338fc=>_0x1338fc['id']===_0x41f134['id']);_0x50da0c||(_0x50da0c=await this['_trackChangesService']['add'](_0x41f134['id'],_0x41f134['type'],_0x41f134['data'],_0x41f134['originalSuggestionId'])),_0x48e026(_0x50da0c);}for(const _0x799e98 of _0x5e0904)_0x316fa1['hasSuggestion'](_0x799e98['id'])||_0x316fa1['addSuggestionData'](_0x799e98);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0xa54f65=>{this['listenTo'](this['_trackChangesService'],'connected',_0x2974dc=>{_0x2974dc['off'](),_0xa54f65();});});}async['_fetchMissingUsersForThreads'](_0x13a6dc){const _0x3aec4a=this['editor']['plugins']['get'](_0x595866),{connection:_0x3f463c}=this['editor']['plugins']['get'](n),_0x2b945b=new Set();for(const {authorId:_0xb0e030}of _0x13a6dc)_0x3aec4a['getUser'](_0xb0e030)||_0x2b945b['add'](_0xb0e030);if(0x0===_0x2b945b['size'])return;const _0x2ff505=await ct['getMany'](_0x3f463c,Array['from'](_0x2b945b));for(const _0x5d0221 of _0x2ff505)_0x3aec4a['getUser'](_0x5d0221['id'])||_0x3aec4a['addUser'](_0x5d0221);}}function k(_0x2980f0){if(ht(_0x2980f0))return new Promise(()=>{});throw _0x2980f0;}function ht(_0x386ddd){return _0x386ddd['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x386ddd['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x5d6859{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 _0x6404a1=this['editor']['plugins']['get'](n),_0x5bd850=this['editor']['plugins']['get']('CommentsEditing'),_0x10c2ff=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x6404a1,'change:state',(_0xfe7442,_0x1cc0c9,_0x11cd7d)=>{_0x5bd850['isThreadsLoadingPaused']='connected'!==_0x11cd7d;});}),this['listenTo'](_0x6404a1,'change:state',(_0x1f13a4,_0xbf4fb4,_0x439016)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x439016);}),_0x10c2ff['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x5d6859{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 _0x5d6859{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>_0x574851)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x595866];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2075c4){super(_0x2075c4);const _0x17014a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x17014a);}async['init'](){const _0x137a12=this['editor']['plugins']['get'](l),_0x4155dc=_0x137a12['serverHistory'],_0x24fa8e=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x4155dc,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x137a12['sessionId']});const _0x4bbd77=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x20c2f4=await _0x56ccf5['isBundleUploaded'](_0x24fa8e['connection'],_0x4bbd77);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x10c028})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x10c028)),'updateRevisions':async _0x53f647=>{await this['_waitForServiceReady']();const _0x3a81e1=this['_revisionTracker']['currentRevision'];if(_0x20c2f4&&0x1===_0x53f647['length']&&_0x53f647[0x0]['id']===_0x3a81e1['id'])return _0x53f647;for(const _0x4ca251 of _0x53f647)_0x4ca251['id']===_0x3a81e1['id']&&(_0x4ca251['isEmptyCurrent']=_0x4ca251['fromVersion']===_0x4ca251['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x53f647,this['_lastRequestId'])['then'](_0x288b57=>(this['_lastRequestId']=_0x288b57,_0x53f647))['catch'](_0x1337d2=>{if(q(_0x1337d2)||'400'===_0x1337d2['code']&&void 0x0!==_0x1337d2['data']['wrongRequestId']){for(const _0x18a4cb of _0x53f647){!this['_revisionTracker']['repository']['getRevision'](_0x18a4cb['id'])||this['_revisionTracker']['_bufferUpdate'](_0x18a4cb['id'],_0x18a4cb,!0x1);}if(q(_0x1337d2))throw _0x1337d2;return _0x53f647;}throw _0x1337d2;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x199292,{revisionsData:_0x12449f,requestId:_0x1a3021})=>{Math['max'](..._0x12449f['map'](_0x11a4ce=>_0x11a4ce['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x12449f,_0x1a3021);}):this['_handleRevisionsUpdate'](_0x12449f,_0x1a3021);});const {revisions:_0x116eb3,requestId:_0x2aa57b}=await this['_revisionHistoryService']['connect'](_0x24fa8e['connection']);_0x24fa8e['addToReconnectionStack'](this),this['_lastRequestId']=_0x2aa57b,await this['_fetchMissingUsers'](_0x116eb3);for(const _0x68903e of _0x116eb3)this['_revisionTracker']['addRevisionData'](_0x68903e);this['listenTo'](_0x137a12,'change:_isConnected',(_0x150def,_0x49c829,_0x592d98)=>{_0x592d98&&(this['_oldOffset']=_0x137a12['_offset'],_0x150def['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x24fa8e,'state',_0x31d73d=>_0x31d73d===_0x384c6b['CONNECTED']);}async['reconnect'](){const _0x82635c=this['editor']['plugins']['get'](n),_0x55470a=this['editor']['plugins']['get'](l),_0x1ab8e4=async()=>{const _0x9453de=this['_revisionTracker']['currentRevision'],_0x2f9e47=_0x9453de['id'],_0x2c458b=_0x2f9e47!==_0x55470a['sessionId'];if(_0x2c458b){const _0x1280a1=_0x55470a['_offset']-this['_oldOffset'],_0x51e4ef=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x9453de['toVersion']+_0x1280a1!==_0x51e4ef){const _0x4e97c3=_0x9453de['fromVersion']+_0x1280a1,_0x32e68c=this['editor']['plugins']['get'](_0x595866),_0x2088f9=this['_revisionTracker']['buildRevisionData']({'revision':_0x9453de,'from':_0x4e97c3,'to':_0x51e4ef});_0x2088f9['id']=_0x9453de['id'];const _0x250b62=_0x2088f9['authorsIds']['map'](_0xdfd750=>_0x32e68c['getUser'](_0xdfd750));_0x9453de['_update']({..._0x2088f9,'authors':_0x250b62},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x9453de['id'],_0x2088f9,!0x0);}this['_revisionTracker']['_startingVersion']=_0x51e4ef,(_0x9453de['toVersion']===_0x9453de['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x2f9e47)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x2f9e47),this['_revisionTracker']['_createCurrentRevision'](_0x51e4ef));}const {revisions:_0x49a7db,requestId:_0x553cf7}=await this['_revisionHistoryService']['reconnect'](_0x82635c['connection'],this['_lastRequestId']);_0x2c458b&&_0x49a7db['length']>0x0?_0x55470a['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x49a7db),this['_handleRevisionsUpdate'](_0x49a7db,_0x553cf7),this['_revisionTracker']['sendBufferedUpdates']());};return _0x55470a['_isConnected']?_0x1ab8e4():new Promise((_0x325cf9,_0x1f4d0d)=>{_0x55470a['once']('change:_isConnected',()=>{_0x1ab8e4()['then'](_0x325cf9)['catch'](_0x1f4d0d);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x4e1f98=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3bfa60=>{_0x3bfa60['off'](),_0x4e1f98();});});}['_getLatestVersionFromServerOperations'](){const _0x193de9=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x10c6be of _0x193de9)if('marker'!==_0x10c6be['type']||_0x10c6be['affectsData'])return _0x10c6be['baseVersion']+0x1;}['_getLatestVersion'](){const _0x28f92f=this['editor']['plugins']['get'](l);return new Promise(_0x23712a=>{_0x28f92f['_isPendingUpdate']?_0x28f92f['once']('change:_isPendingUpdate',()=>{_0x23712a(this['_getLatestVersionFromServerOperations']());}):_0x23712a(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x1181af,_0x2772b7){const _0x36c268=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2772b7;for(const _0x49ece5 of _0x1181af){const _0x52949c=_0x36c268['getRevision'](_0x49ece5['id']);if(_0x52949c){if((_0x49ece5['fromVersion']||_0x49ece5['toVersion'])&&(_0x49ece5['diffData']=null),_0x52949c===this['_revisionTracker']['currentRevision']){const _0x590802=Math['max'](_0x52949c['toVersion'],_0x49ece5['toVersion']),_0x3556df=Math['max'](_0x52949c['fromVersion'],_0x49ece5['fromVersion']);let _0x375e88;_0x52949c['toVersion']===_0x49ece5['toVersion']&&_0x52949c['fromVersion']===_0x49ece5['fromVersion']?(_0x375e88=!0x0,this['_preventResendingRevisionData'](_0x49ece5)):_0x49ece5['toVersion']===_0x590802&&_0x49ece5['fromVersion']===_0x3556df?_0x375e88=!0x1:(_0x52949c['toVersion']===_0x590802&&_0x52949c['fromVersion']===_0x3556df||this['_fixRevision']({'revision':_0x52949c,'from':_0x3556df,'to':_0x590802}),_0x375e88=!0x0),_0x375e88&&(delete _0x49ece5['fromVersion'],delete _0x49ece5['toVersion'],delete _0x49ece5['diffData'],delete _0x49ece5['createdAt'],delete _0x49ece5['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x49ece5),this['_preventResendingRevisionData'](_0x49ece5);}else this['_revisionTracker']['addRevisionData'](_0x49ece5);}const _0x393477=_0x36c268['getRevisions']();_0x393477['reverse']();for(let _0x112c3c=0x0;_0x112c3c<_0x393477['length']-0x1;_0x112c3c++){const _0x324bf4=_0x393477[_0x112c3c],_0xd712b8=_0x393477[_0x112c3c+0x1];if(_0x324bf4['fromVersion']<_0xd712b8['toVersion']){const _0x45b5b1=_0xd712b8['toVersion'],_0x469c9e=Math['max'](_0x45b5b1,_0x324bf4['toVersion']);this['_fixRevision']({'revision':_0x324bf4,'from':_0x45b5b1,'to':_0x469c9e});}}}['_fixRevision']({revision:_0xe678b1,from:_0x54d9ae,to:_0x47e9e4}={}){const _0x3b7f02=this['editor']['plugins']['get'](_0x595866),_0x1e455e=this['_revisionTracker']['buildRevisionData']({'revision':_0xe678b1,'from':_0x54d9ae,'to':_0x47e9e4});_0x1e455e['authors']=_0x1e455e['authorsIds']['map'](_0x41e0a0=>_0x3b7f02['getUser'](_0x41e0a0)),_0xe678b1['_update'](_0x1e455e);}['_preventResendingRevisionData'](_0x3ad0de){const _0x4e52f5={};_0x4e52f5['id']=_0x3ad0de['id'];for(const _0x27ff36 of Object['keys'](_0x3ad0de))'id'!==_0x27ff36&&(_0x4e52f5[_0x27ff36]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4e52f5['id'],_0x4e52f5,!0x0);}async['_fetchMissingUsers'](_0x29a7ef){const _0x1eba5d=this['editor']['plugins']['get'](_0x595866),{connection:_0x27b364}=this['editor']['plugins']['get'](n),_0x599878=new Set();for(const _0x32a04e of _0x29a7ef){for(const _0x5f26c7 of _0x32a04e['authorsIds'])_0x595bc6(_0x5f26c7);_0x32a04e['creatorId']&&_0x595bc6(_0x32a04e['creatorId']);}if(0x0===_0x599878['size'])return;const _0x27a667=await ct['getMany'](_0x27b364,Array['from'](_0x599878));for(const _0x137bda of _0x27a667)_0x1eba5d['getUser'](_0x137bda['id'])||_0x1eba5d['addUser'](_0x137bda);function _0x595bc6(_0x4a79cb){_0x1eba5d['getUser'](_0x4a79cb)||_0x599878['add'](_0x4a79cb);}}}function q(_0x114ccb){return _0x114ccb['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x114ccb['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x114ccb['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x5d6859{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 _0x3ba684{['_collapseAt'];constructor(_0x39a548,_0xcdbc12=0x6){super(_0x39a548);const _0x40c9ad=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0xcdbc12,this['bind']('isHidden')['to'](this,'usersCount',_0x117c66=>_0x117c66<_0xcdbc12),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x40c9ad['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':_0x40c9ad['to']('usersCount',_0x3a4c00=>'+'+(_0x3a4c00-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x3ba684{['items'];['keystrokes'];constructor(_0x281ad1){super(_0x281ad1);const _0x143245=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x39617f(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x143245['if']('hasPopup'),'aria-expanded':_0x143245['to']('isExpanded',_0x841e6=>this['hasPopup']&&String(_0x841e6)),'aria-label':_0x143245['to']('hasPopup',_0x72124e=>K(_0x281ad1,_0x72124e?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x143245['to']('hasPopup',_0x1bdaf9=>!!_0x1bdaf9&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x143245['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x143245['to'](_0x1c898f=>{const _0x935bad=_0x1c898f,_0x94214b=document['querySelector']('.ck-presence-list__dropdown-list'),_0x3d93da=document['querySelector']('.ck-balloon-panel_with-arrow');_0x94214b?.['contains'](_0x935bad['relatedTarget'])||_0x3d93da?.['contains'](_0x935bad['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x342d79,_0x57c1de,_0x498904)=>{this['element']&&(_0x498904?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 _0x3ba684{['counterView'];['inlineListView'];constructor(_0x24d615,_0x332687=0x6){super(_0x24d615);const _0x110177=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x332687),this['inlineListView']=new is(_0x24d615),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0xb8d9 of this['inlineListView']['items'])_0xb8d9['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',_0x110177['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x3ba684{['listWrapperView'];constructor(_0x471d46,_0x13cc23){super(_0x471d46);const _0x5d4291=this['bindTemplate'];this['listWrapperView']=new ut(_0x471d46,_0x13cc23),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':K(_0x471d46,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5d4291['to'](_0x28213f=>{const _0xd02f23=_0x28213f,_0x3af3c3=document['querySelector']('.ck-presence-list__list'),_0xc73087=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3af3c3?.['contains'](_0xd02f23['relatedTarget'])||_0xc73087?.['contains'](_0xd02f23['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x47010b{constructor(_0x26c2de,_0x2062ff){super(_0x26c2de);const _0x5b0244=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2062ff?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x5b0244['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x5b0244['to']('role'),'aria-label':_0x5b0244['to']('ariaLabel'),'aria-labelledby':_0x5b0244['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x38b4cc['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x46f785=this['element'];_0x46f785&&(this['_isScrollable']=Math['max'](_0x46f785['scrollHeight'],_0x46f785['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0xd961f9,_0x272c14,_0x3c3608){super(_0xd961f9);const _0x4b516f=this['bindTemplate'];this['userView']=new st(_0xd961f9,_0x272c14);const _0x57e5a={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x272c14['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x272c14['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x272c14['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x3c3608&&(_0x57e5a['tag']='button',_0x57e5a['on']={'click':_0x4b516f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x57e5a);}['focus'](){this['element']['focus']();}}class A extends _0x3ba684{['userView'];['markerView'];constructor(_0x12d247,_0x4094aa,_0x53860a){super(_0x12d247);const _0x43b676=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x12d247,_0x4094aa),this['markerView']=new ot(_0x12d247,_0x4094aa);const _0x1a1b4f=new it(_0x12d247);_0x1a1b4f['template']['tag']='span',_0x1a1b4f['text']=_0x4094aa['name'];const _0x352f61={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x43b676['to']('isFocusable',_0xe56366=>!!_0xe56366&&0x0),'aria-labelledby':_0x1a1b4f['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x43b676['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x43b676['to']('hasTooltip',_0x1948a2=>!_0x1948a2),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1a1b4f]};_0x53860a&&(_0x352f61['tag']='button',_0x352f61['on']={'click':_0x43b676['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x352f61);}}class ot extends _0x3ba684{constructor(_0x258f1d,_0x17e78f){super(_0x258f1d),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x17e78f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x381c27{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x290e4b){super(_0x290e4b),this['context']['config']['define']('presenceList',x);const _0x2bd74e=_0x290e4b['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2bd74e)throw new _0x4d1849('presencelist-collapseat-invalid-format',this);if(_0x2bd74e<0x1)throw new _0x4d1849('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x53968d(),this['balloonPanelView']=new _0x5c13c2(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x473518 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x473518);this['listenTo'](this['_allConnectedUsers'],'add',(_0x19cc6d,_0x57220d)=>{this['_handleUserAdd'](_0x57220d);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2bf594,_0x581e66)=>{this['_handleUserRemove'](_0x581e66);});}['_createView'](){const _0x4facbe=this['context'],_0x190f05=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4269e8=this['balloonPanelView'];if(!_0x504e67(_0x4facbe['config']['get']('presenceList.container')))throw new _0x4d1849('presencelist-missing-container',this);return _0x190f05['counterView']['bind']('usersCount')['to'](this),_0x190f05['bind']('isCollapsed')['to'](this,'usersCount',_0x484be1=>{const {collapseAt:_0x54a5c1}=_0x4facbe['config']['get']('presenceList'),_0x2b50b3=_0x484be1>=_0x54a5c1;if(_0x2b50b3&&!_0x190f05['inlineListView']['items']['find'](_0x2d143c=>_0x2d143c instanceof b)){const _0x512e81=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x512e81&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x190f05['inlineListView']['items']['add'](_0x190f05['counterView']);}return _0x2b50b3||this['hideDropdown'](),_0x2b50b3;}),_0x190f05['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x453384=>{const _0x89ca27=_0x4facbe['config']['get']('presenceList'),_0x51249c=new A(_0x4facbe['locale'],_0x453384,!!_0x89ca27['onClick']);return _0x51249c['bind']('hasTooltip')['to'](_0x190f05,'isCollapsed',_0x497ac0=>!_0x497ac0),_0x51249c['bind']('isFocusable')['to'](_0x190f05,'isCollapsed',_0x58c40d=>!_0x58c40d),_0x89ca27['onClick']&&this['listenTo'](_0x51249c,'execute',()=>{this['view']['isCollapsed']||_0x89ca27['onClick'](_0x453384,_0x51249c['element']);}),_0x51249c;}),this['listenTo'](_0x190f05['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x190f05['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x190f05['inlineListView']['keystrokes']['set']('Enter',(_0x33dfb8,_0x2c7d4d)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x2c7d4d());}),_0x190f05['render'](),_0x4269e8['render'](),_0x56aafe({'emitter':_0x190f05,'activator':()=>_0x4269e8['isVisible'],'contextElements':[_0x4269e8['element'],_0x190f05['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4facbe['config']['get']('presenceList.container')['appendChild'](_0x190f05['element']),this['_bodyCollection']=new _0x4a71b4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x190f05;}['_handleUserAdd'](_0x5adf41){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x5adf41['isMe'])return;const _0x193360=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x193360-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x32a6c8=_0x5adf41['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x5adf41,_0x32a6c8);}['_handleUserRemove'](_0x2e1dd9){this['usersCount']--;const {collapseAt:_0x1a8311}=this['context']['config']['get']('presenceList'),_0x137d76=this['usersCount']>=_0x1a8311;if(this['currentDisplayedUsers']['get'](_0x2e1dd9['id']))this['currentDisplayedUsers']['remove'](_0x2e1dd9['id']);else{if(_0x137d76&&this['currentDisplayedUsers']['length']+0x1===_0x1a8311-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x137d76?0x1:0x0)<this['usersCount']){for(const _0x3f11d2 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x3f11d2['id'])&&(this['currentDisplayedUsers']['add'](_0x3f11d2,Math['min'](this['currentDisplayedUsers']['length']-(_0x137d76?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x137d76?0x1:0x0)===_0x1a8311-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x376d82=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x376d82['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x20fac9}=this['presenceDropdownView'];_0x20fac9['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5334b6=>{if(!_0x376d82['displayMe']&&_0x5334b6['isMe'])return null;const _0x20a9ed=new j(this['context']['locale'],_0x5334b6,!!_0x376d82['onClick']);return _0x376d82['onClick']&&this['listenTo'](_0x20a9ed,'execute',()=>{_0x376d82['onClick'](_0x5334b6,_0x20a9ed['element']);}),_0x20a9ed;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x20fac9['focus'](),_0x20fac9['checkIfScrollable']();const _0x209997=(_0xa3a8de,_0x55639f)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x55639f();};_0x20fac9['keystrokes']['set']('Esc',_0x209997),_0x20fac9['keystrokes']['set']('Shift+Tab',_0x209997),_0x20fac9['keystrokes']['set']('Tab',(_0x2f25cd,_0x2a6df6)=>{!function(_0xe8571f){const _0x309932=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x47d0b3=>_0x47d0b3+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x1548c9=[...document['body']['querySelectorAll'](_0x309932)]['filter'](_0x311c02=>_0x311c02===document['activeElement']||_0x311c02['offsetWidth']+_0x311c02['offsetHeight']>0x0)['sort']((_0x9c8021,_0xe4b19a)=>(_0x9c8021['tabIndex']||0x0)-(_0xe4b19a['tabIndex']||0x0)),_0x1c94b5=_0x1548c9['indexOf'](_0xe8571f),_0x58548d=_0x1548c9[(_0x1c94b5+0x1)%_0x1548c9['length']];_0x58548d&&_0x58548d['focus']();}(this['view']['element']),this['hideDropdown'](),_0x2a6df6();}),_0x20fac9['focusTracker']['add'](this['view']['element']),_0x20fac9['focusTracker']['on']('change:isFocused',(_0x3137f8,_0x5f5796,_0x50b533)=>{_0x50b533||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 _0x381c27{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};
|
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':_0x5978ba=>0x1!=_0x5978ba}};
|