@ckeditor/ckeditor5-real-time-collaboration 45.2.1-alpha.8 → 45.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +1 -1
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x47532e];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x447433){super(_0x447433),this['set']('state',_0x202917['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x392d91);}['init'](){const _0x2dc693=this['context'],_0x21aa94=_0x2dc693['plugins']['get']('CloudServices'),_0x15ef99=_0x2dc693['plugins']['get'](_0x47532e);if(!_0x21aa94['token'])throw new _0x680b76('websocketgateway-missing-token',this);if(!_0x21aa94['webSocketUrl'])throw new _0x680b76('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x21aa94['token'],_0x21aa94['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2d544f=>{if(this['connection']=_0x2d544f,this['bind']('state')['to'](_0x2d544f,'state',this,'_isBrowserOffline',(_0x4932cc,_0x525fd6)=>('connected'!==_0x4932cc&&(this['_shouldPluginsReconnect']=!0x0),_0x525fd6||_0x4932cc!==_0x202917['CONNECTED']?_0x202917['DISCONNECTED']:this['state']==_0x202917['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x202917['CONNECTING']):_0x202917['CONNECTED'])),this['connection']['on']('error',(_0x44345f,_0x5bd2de)=>{if('limitExceeded'!==_0x5bd2de['code'])throw console['error'](_0x5bd2de),new _0x680b76('cloudservices-init',null,{'originalError':_0x5bd2de});_0x15ef99['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'});}),!_0x2d544f['me'])return new Promise(_0x1ebda9=>_0x2d544f['on']('change:me',_0x1ebda9));})['catch'](_0x4ed122=>{throw console['error'](_0x4ed122),new _0x680b76('cloudservices-init',null,{'originalError':_0x4ed122});});}['addToReconnectionStack'](_0x279b43){if('function'!=typeof _0x279b43['reconnect'])throw new _0x680b76('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x279b43))throw new _0x680b76('websocketgateway-plugin-already-registered',this,{'name':_0x279b43['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x279b43);}['removeFromReconnectionStack'](_0x20d52d){this['_reconnectionStack']['delete'](_0x20d52d);}['isInReconnectionStack'](_0x4a3291){return this['_reconnectionStack']['has'](_0x4a3291);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x49538b=>_0x49538b['reconnect']())))['then'](()=>this['state']=_0x202917['CONNECTED'])['catch'](_0x32e786=>{throw console['error'](_0x32e786),new _0x680b76('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x202917['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x2da3ca{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x209d74];}constructor(_0x5f27ad){super(_0x5f27ad),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x49727e(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x209d74);}['init'](){const _0x4d8113=this['context']['plugins']['get'](c);this['listenTo'](_0x4d8113,'change:state',(_0x47b254,_0x520d65,_0x3dc94b)=>{if('connected'!==_0x3dc94b)this['channelSessions']['forEach'](_0x21af91=>_0x21af91['clear']()),this['channelConnectedUsers']['forEach'](_0x338f9e=>_0x338f9e['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2902cc,_0x445d4b]of this['_registeredSessions'])for(const _0x35433f of _0x445d4b)this['_handleSessionAdd'](_0x2902cc,_0x35433f);}}),this['_createUser'](_0x4d8113['connection']['me'],!0x0);}['register'](_0x36a7c0,_0x30e906){if(this['_registeredSessions']['has'](_0x36a7c0))throw new _0x680b76('sessions-register-already-registered',null,{'channelId':_0x36a7c0});this['_registeredSessions']['set'](_0x36a7c0,_0x30e906),this['channelSessions']['set'](_0x36a7c0,new _0x49727e()),this['channelConnectedUsers']['set'](_0x36a7c0,new _0x49727e()),this['listenTo'](_0x30e906,'add',(_0x288f11,_0x106585)=>this['_handleSessionAdd'](_0x36a7c0,_0x106585)),this['listenTo'](_0x30e906,'remove',(_0x4b3269,_0x20d661)=>this['_handleSessionRemove'](_0x36a7c0,_0x20d661));for(const _0x15c5d9 of _0x30e906)this['_handleSessionAdd'](_0x36a7c0,_0x15c5d9);}['unregister'](_0x45f00c){if(!this['_registeredSessions']['has'](_0x45f00c))throw new _0x680b76('sessions-unregister-not-exist',null,{'channelId':_0x45f00c});const _0x2c5ac6=this['_registeredSessions']['get'](_0x45f00c);this['stopListening'](_0x2c5ac6);for(const _0xf16095 of _0x2c5ac6)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x45f00c,_0xf16095);this['_registeredSessions']['delete'](_0x45f00c),this['channelSessions']['delete'](_0x45f00c),this['channelConnectedUsers']['delete'](_0x45f00c);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x32568a){for(const _0xe3f0fa of this['channelSessions']['values']())for(const _0x450757 of _0xe3f0fa)if(_0x450757['id']===_0x32568a)return _0x450757['user'];}['getUserSessions'](_0x356b04,_0x4e1218){const _0x1d07cb=_0x4e1218?[this['channelSessions']['get'](_0x4e1218)]:this['channelSessions']['values'](),_0x15700b=new Set();for(const _0x571ff4 of _0x1d07cb)for(const _0x405b0f of _0x571ff4)_0x405b0f['user']['id']===_0x356b04['id']&&_0x15700b['add'](_0x405b0f['id']);return _0x15700b;}['getUserRole'](_0x2a1bdb){for(const _0xcb3bd6 of this['channelSessions']['values']())for(const _0x1aab1a of _0xcb3bd6)if(_0x1aab1a['user']===_0x2a1bdb)return _0x1aab1a['role'];}['_handleSessionAdd'](_0x3a799c,_0x285986){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x4c4dbd=_0x285986['user'],_0x38b441=this['_users']['getUser'](_0x4c4dbd['id'])||this['_createUser'](_0x4c4dbd),_0x458292=Object['assign']({},_0x285986,{'user':_0x38b441});this['channelSessions']['get'](_0x3a799c)['add'](_0x458292);const _0x117fd3=this['channelConnectedUsers']['get'](_0x3a799c);_0x117fd3['has'](_0x38b441['id'])||_0x117fd3['add'](_0x38b441),this['allConnectedUsers']['has'](_0x38b441['id'])||this['allConnectedUsers']['add'](_0x38b441,_0x38b441['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x3a799c,{'channelId':_0x3a799c,'session':_0x458292});}['_handleSessionRemove'](_0x31728b,_0x57d304){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x27bd9a=this['channelConnectedUsers']['get'](_0x31728b),_0x4ea75f=_0x57d304['user'];_0x4ea75f['id']&&(this['channelSessions']['get'](_0x31728b)['remove'](_0x57d304['id']),_0x27bd9a['has'](_0x4ea75f['id'])&&!this['getUserSessions'](_0x4ea75f,_0x31728b)['size']&&_0x27bd9a['remove'](_0x4ea75f['id']),this['allConnectedUsers']['get'](_0x4ea75f['id'])&&!this['getUserSessions'](_0x4ea75f)['size']&&this['allConnectedUsers']['remove'](_0x4ea75f['id']));}['_createUser'](_0x9e06db,_0x4699ba){const _0x60b952=this['_users']['addUser'](_0x9e06db);return _0x4699ba&&this['_users']['defineMe'](_0x9e06db['id']),_0x60b952['orderNumber']=this['_uniqueUsersCount']++,_0x60b952;}}class J extends _0x1b15fd{['_domEmitter']=new(_0x392d91())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xfb6231=this['editor'],_0x932aaf=_0xfb6231['plugins']['get'](i);_0xfb6231['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x280145,{writer:_0x561c7e})=>function(_0x5ad390,_0xe1b261,_0x1a102a,_0x1381f0){const _0x5eabd1=_0x5ad390['markerName']['split'](':')[0x2],_0x5c232c=_0x1a102a['getUserBySessionId'](_0x5eabd1);if(!_0x5c232c||_0x5eabd1===_0x1a102a['mySessionId'])return;if(!_0x1381f0['model']['schema']['checkChild'](_0x5ad390['markerRange']['start'],'$text'))return;const _0x9a972a={'class':'ck-user__marker\x20'+_0x5c232c['color']['getMarkerClass'](),'data-name':_0x5c232c['name'],'data-session-id':_0x5eabd1},_0x847087=_0x1381f0['model']['markers']['get'](_0x5ad390['markerName']),_0x11c4f2=_0x847087['getStart'](),_0x117342=_0x11c4f2['nodeAfter'],_0x270c96=_0x1381f0['model']['schema'];if(_0x117342&&_0x270c96['isObject'](_0x117342)&&_0x270c96['isInline'](_0x117342)&&!_0x1381f0['model']['markers']['get']('user:range:'+_0x5eabd1)['getRange']()['isCollapsed'])return;const _0x29d53b=_0x11c4f2['parent'];return _0x1381f0['model']['schema']['isLimit'](_0x29d53b)&&!_0x1381f0['model']['hasContent'](_0x29d53b)&&(_0x9a972a['contenteditable']=!0x1),function(_0x1093a7,_0x78afa8,_0x290463){const _0x161c6=_0x1093a7['createUIElement']('span',_0x78afa8);return _0x1093a7['setCustomProperty']('userPositionMarker',!0x0,_0x161c6),_0x161c6['render']=function(_0x4f4424){const _0x27c746=this['toDomElement'](_0x4f4424),_0x372676=document['createElement']('span');return _0x372676['classList']['add']('ck-user__marker-tooltip'),_0x372676['setAttribute']('contenteditable','false'),_0x372676['setAttribute']('spellcheck','false'),_0x372676['textContent']=_0x290463['name'],_0x27c746['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x372676['outerHTML']+'',_0x27c746['addEventListener']('mouseenter',()=>{_0x27c746['classList']['add']('ck-user__marker_hovered');}),_0x27c746['addEventListener']('mouseleave',()=>{_0x27c746['classList']['remove']('ck-user__marker_hovered');}),_0x27c746;},_0x161c6['isSimilar']=function(_0x28a5b7){return!(!this['getCustomProperty']('userPositionMarker')||!_0x28a5b7['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x28a5b7['getAttribute']('data-session-id'));},_0x161c6;}(_0xe1b261,_0x9a972a,_0x5c232c);}(_0x280145,_0x561c7e,_0x932aaf,_0xfb6231)}),_0xfb6231['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4537f3=>function(_0x3326da,_0x2ea5a5){const _0x3fb5cf=_0x3326da['markerName']['split'](':')[0x2];if(_0x3fb5cf===_0x2ea5a5['mySessionId'])return null;const _0x502466=_0x2ea5a5['getUserBySessionId'](_0x3fb5cf);if(!_0x502466)return{'id':_0x3fb5cf,'classes':[]};return{'id':_0x3fb5cf,'classes':['ck-user__selection',_0x502466['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x3fb5cf},'priority':0x7d0+_0x502466['orderNumber']};}(_0x4537f3,_0x932aaf)}),function(_0x319736){const _0x327c1c=_0x319736['model'],_0xc47846=new Map(),_0x4d072d=_0x319736['plugins']['get'](i);_0x327c1c['markers']['on']('update:user:range',(_0x28dcb7,_0x6388bb,_0x5bdfae,_0x3142c6)=>{if(!_0x3142c6&&_0xc47846['get'](_0x6388bb['name']))return _0xc47846['get'](_0x6388bb['name'])['detach'](),void _0xc47846['delete'](_0x6388bb['name']);const _0x5478cd=_0x6388bb['name']['split'](':')[0x2];if(_0x5478cd===_0x4d072d['mySessionId'])return;const _0x157881='user:position:'+_0x5478cd;_0x327c1c['markers']['has'](_0x157881)&&_0x319736['editing']['reconvertMarker'](_0x157881),_0x6388bb['on']('change:range',(_0x1e160c,_0xf78f46,_0x1e5136)=>{if('$graveyard'!=_0xf78f46['root']['rootName']&&'$graveyard'==_0x6388bb['getRange']()['root']['rootName']&&!_0xc47846['has'](_0x6388bb['name'])){const _0x58ae5d=_0x327c1c['schema']['getNearestSelectionRange'](_0x1e5136['deletionPosition']);if(_0x58ae5d){const _0x45f374=ht['fromRange'](_0x58ae5d);_0xc47846['set'](_0x6388bb['name'],_0x45f374),_0x45f374['on']('change:range',(_0x3e0019,_0x5e5faa,_0xd826ba)=>{if('$graveyard'==_0x45f374['root']['rootName']){const _0x42d626=_0x327c1c['schema']['getNearestSelectionRange'](_0xd826ba['deletionPosition']);_0x42d626?(_0x45f374['start']=_0x42d626['start'],_0x45f374['end']=_0x42d626['end']):(_0xc47846['delete'](_0x6388bb['name']),_0x45f374['detach']());}});}}});}),_0x327c1c['document']['on']('change',()=>{_0xc47846['size']>0x0&&_0x327c1c['enqueueChange']({'isUndoable':!0x1},_0xb25f9b=>{for(const [_0x160ff5,_0x508e8c]of _0xc47846)'$graveyard'==_0x327c1c['markers']['get'](_0x160ff5)['getRange']()['root']['rootName']&&(se(_0x160ff5['split'](':')[0x2],_0x508e8c['toRange'](),_0x327c1c,_0xb25f9b),_0x508e8c['detach']());_0xc47846['clear']();});});}(_0xfb6231),this['_domEmitter']['listenTo'](_0x2ac657['document'],'keydown',(_0x2c4af2,{key:_0x5e3b5a})=>{'Escape'===_0x5e3b5a&&function(_0xea9503){_0xea9503['editing']['view']['change'](_0x467150=>{for(const _0x484a21 of _0xea9503['model']['markers']){if(!_0x484a21['name']['startsWith']('user:position'))continue;const _0x87570d=_0xea9503['editing']['mapper']['markerNameToElements'](_0x484a21['name']);if(_0x87570d){for(const _0x58356d of _0x87570d)_0x467150['removeClass']('ck-user__marker_hovered',_0x58356d);}}});}(_0xfb6231);},{'useCapture':!0x0});}['afterInit'](){const _0x74d15e=this['editor'],_0x497a5b=_0x74d15e['commands']['get']('undo');_0x497a5b&&_0x74d15e['model']['on']('applyOperation',(_0x23ef00,_0x5bedb1)=>{const _0x3992e0=_0x5bedb1[0x0];if(!_0x3992e0['isDocumentOperation'])return;if('marker'!=_0x3992e0['type']||!_0x3992e0['name']['startsWith']('user:'))return;const _0x4c92b4=_0x3992e0['batch'];_0x497a5b['_createdBatches']['has'](_0x4c92b4)&&(_0x3992e0['newRange']=_0x3992e0['oldRange']?_0x74d15e['model']['createRange'](_0x3992e0['oldRange']['start'],_0x3992e0['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0xfde81b=this['editor'],_0x861bb7=_0xfde81b['model']['document'],_0x54b9ef=_0xfde81b['plugins']['get'](i);_0xfde81b['model']['enqueueChange']({'isUndoable':!0x1},_0x37dc7a=>{const _0x18a2e3='user:range:'+_0x54b9ef['mySessionId'],_0x5906b2='user:position:'+_0x54b9ef['mySessionId'],_0x1b304d=_0xfde81b['model']['markers']['has'](_0x18a2e3);_0xfde81b['editing']['view']['hasDomSelection']?se(_0x54b9ef['mySessionId'],_0x861bb7['selection']['getFirstRange'](),_0xfde81b['model'],_0x37dc7a):_0x1b304d&&(_0x37dc7a['removeMarker'](_0x18a2e3),_0x37dc7a['removeMarker'](_0x5906b2));});}}function se(_0x4d1151,_0x132602,_0x50d0f9,_0x49911c){const _0x37f220='user:range:'+_0x4d1151,_0x317184='user:position:'+_0x4d1151,_0x2db88e=_0x132602['getContainedElement']();let _0x42f9e8=_0x132602['start'];if(_0x2db88e&&_0x2db88e['is']('element','tableCell')){const _0x6ce9c0=function(_0x472382,_0x5d400a){for(const _0x3c4419 of _0x472382['getPositions']())if(_0x5d400a['schema']['checkChild'](_0x3c4419,'$text'))return _0x3c4419;}(_0x132602,_0x50d0f9);_0x6ce9c0&&(_0x42f9e8=_0x6ce9c0,_0x132602=_0x49911c['createRange'](_0x42f9e8));}const _0x41ec44=_0x49911c['createRange'](_0x42f9e8);_0x50d0f9['markers']['has'](_0x37f220)?(_0x49911c['updateMarker'](_0x37f220,{'range':_0x132602}),_0x49911c['updateMarker'](_0x317184,{'range':_0x41ec44})):(_0x49911c['addMarker'](_0x37f220,{'range':_0x132602,'usingOperation':!0x0}),_0x49911c['addMarker'](_0x317184,{'range':_0x41ec44,'usingOperation':!0x0}));}function Q(_0x4b8076,_0x59c53b,_0x2caf32){const _0x5c52ff=_0x4b8076['t'],t=_0x4b8076['t'];switch(_0x59c53b){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 _0x5c52ff({'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'},_0x2caf32);default:return'';}}let Z=0x1;class l extends _0x1b15fd{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x7eb39a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,J,_0x1c0e1d,_0x209d74,_0x47532e];}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 _0x5c04d1=this['serverHistory']['getOperations']();for(let _0x5e1258=_0x5c04d1['length']-0x1;_0x5e1258>=0x0;_0x5e1258--){const _0x69ef6b=_0x5c04d1[_0x5e1258];if(!this['_disconnectionOperations']['has'](_0x69ef6b))return _0x69ef6b['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x336c70){if(super(_0x336c70),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x425790(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x680b76('collaboration-missing-channelid',this);const _0x40d024=_0x336c70['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x40d024,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x5b0779(),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 st(this['_disconnectionOperations']);}['init'](){const _0x503aaa=this['editor'],_0x314102=_0x503aaa['plugins']['get'](_0x209d74),_0x30898a=_0x503aaa['plugins']['get'](c);this['listenTo'](_0x314102,'getOperationAuthor',(_0x5226a8,_0x22a719)=>{const _0x1cb25f=_0x22a719[0x0];_0x1cb25f['_authorId']&&(_0x5226a8['return']=_0x314102['getUser'](_0x1cb25f['_authorId']),_0x5226a8['stop']()),null===_0x1cb25f['_authorId']&&(_0x5226a8['return']=null,_0x5226a8['stop']());},{'priority':'high'}),this['listenTo'](_0x503aaa['model']['document']['selection'],'change:range',(_0x9e770d,_0x3b7fc5)=>{_0x3b7fc5['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x503aaa['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x503aaa['model']['on']('applyOperation',(_0x295eaf,_0x177ff6)=>{const _0x27ff64=_0x177ff6[0x0];_0x27ff64['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x27ff64),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x30898a,'state',this,'_hasSynchronizationProblem',(_0x42ac2c,_0x5b5595)=>'connected'===_0x42ac2c&&!_0x5b5595),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x503aaa['disableReadOnlyMode']('rtc-offline'):_0x503aaa['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x503aaa['disableReadOnlyMode']('rtc-offline'):_0x503aaa['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1aae5d=this['editor']['plugins']['get'](i),_0x363493=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x1aae5d['unregister'](this['_channelId']);const _0x59be61=await this['_service']['reconnect'](_0x363493['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x59be61)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x4c3479=await this['_service']['getConnectedSessions']();_0x1aae5d['register'](this['_channelId'],_0x4c3479),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x17bf98){if(function(_0x1c0f8c){return'404'===_0x1c0f8c['code'];}(_0x17bf98)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3fdd96){return'409'===_0x3fdd96['code'];}(_0x17bf98)){const _0x15224a=Q(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'](_0x15224a);}else{if(!(_0x17bf98 instanceof tt))throw _0x17bf98;this['_handleReconnectionError']();}}}}['destroy'](){const _0x4836d8=this['editor']['plugins']['get'](c),_0x2c4c6f=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2c4c6f['channelSessions']['has'](this['_channelId'])&&_0x2c4c6f['unregister'](this['_channelId']),_0x4836d8['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x168587){if(this['sessionId']!==_0x168587['sessionId']&&this['_lastSyncedOperationId']!==_0x168587['lastOperationId'])throw new tt();return this['sessionId']=_0x168587['sessionId'],this['_handleServerResponse']([],{..._0x168587,'wereChangesApplied':!0x1,'data':_0x168587['data']},'reconnect');}async['_connectService'](_0x48890a,_0x57eb1b=!0x1){const {connection:_0x522daf}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x522daf,this['_channelId'])['then'](_0x4c6e7e=>this['_initSessionsHandling'](_0x4c6e7e))['catch'](_0x1fec2c=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1fec2c);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x1ed0fd,_0x1cc8c3)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x1cc8c3);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x38d618=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x48890a);this['_isPendingUpdate']=!0x0;const _0x382870=await this['_service']['connect'](_0x522daf,this['_compressOperations'](_0x48890a),_0x38d618);if(this['sessionId']=_0x382870['sessionId'],_0x57eb1b){if(!_0x382870['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x382870['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x48890a,_0x382870,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x382870,_0x48890a);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x404f9e=this['editor']['plugins']['get'](i),_0x5cfb3e=this['editor']['plugins']['get'](J),_0x37eec7=_0x404f9e['channelSessions']['get'](this['_channelId']);_0x37eec7&&_0x37eec7['length']>0x1?_0x5cfb3e['createUserMarkerOperations']():this['listenTo'](_0x404f9e,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x404f9e['channelSessions']['get'](this['_channelId'])['length']&&_0x5cfb3e['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4e695a,_0x201148,_0x4bb72d,_0x3acea4){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x201148){const _0x3a0fb5=this['_decompressOperations'](_0x4bb72d,_0x3acea4);await this['_fetchMissingUsers'](_0x3a0fb5),this['_handleExternalOperations'](_0x3a0fb5,_0x201148,_0x4bb72d['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x54227d}=this['editor'];let _0x1e4f1e;try{_0x1e4f1e=await this['_service']['getDocumentDetails']();}catch{const _0x3fa263=Q(_0x54227d,'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'](_0x3fa263);}const _0x2ea6d3=_0x1e4f1e['currentDocumentSession']||_0x1e4f1e['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x2ea6d3['lastOperationId']){const _0x5854c2=Q(_0x54227d,'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'](_0x5854c2);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4bd20e){const _0xbb7e5c=this['editor']['plugins']['get'](i);this['listenTo'](_0xbb7e5c,'sessionAdd:'+this['_channelId'],(_0x246354,{session:_0x2853b7})=>{if(_0x2853b7['id']===_0xbb7e5c['mySessionId']){_0x246354['off']();const _0x184fe5=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4b36e3=_0x2853b7['permissions'];_0x184fe5&&_0x184fe5['isEnabled']&&(_0x4b36e3=_0x4b36e3['filter'](_0x56b78c=>'document:write'!==_0x56b78c)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4b36e3,this['_channelId']);}}),_0xbb7e5c['register'](this['_channelId'],_0x4bd20e);}['_initThrowingOnDataSet'](){const _0xa5cdd9=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x203c37)=>{if(!_0x203c37[_0x203c37['length']-0x1]['suppressErrorInCollaboration'])throw new _0x680b76('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0xa5cdd9['apply'](this['editor']['data'],_0x203c37);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x57e533,[_0x5be5eb])=>{if(this['_document']['version'])throw new _0x680b76('realtimecollaborationclient-init-document-already-initialized',this);_0x57e533['stop'](),this['_setPendingAction']();const _0x35b1d0=this['editor']['config']['get']('rootsAttributes'),_0x570d35=this['_getOperationsFromInitData'](_0x5be5eb,_0x35b1d0);0x0==_0x570d35['length']&&_0x570d35['push'](new _0x1b4ff2(0x0)),_0x57e533['return']=this['_connectService'](_0x570d35)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2f0994=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2f0994))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x49d9de,[_0x47b3d2,_0x1be01f])=>{_0x49d9de['stop']();const _0x2d05e6=this['editor']['model']['document']['getRoot'](_0x47b3d2);if(!this['_knownRootNames']['has'](_0x47b3d2)){const _0x48fa69=_0x1be01f&&_0x1be01f['data']?_0x1be01f['data']:'',_0x3e4fc5=_0x1be01f&&_0x1be01f['attributes']?_0x1be01f['attributes']:{};await this['_loadRoot'](_0x47b3d2,_0x48fa69,_0x3e4fc5);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x2d05e6['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x2d05e6);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x354e95){const _0x6a33c5=this['editor']['plugins']['get'](_0x209d74),{connection:_0x812893}=this['editor']['plugins']['get'](c),_0x4bab1f=new Set();for(const _0x537c8b of _0x354e95){const _0x39b9f8=_0x537c8b['_authorId'];_0x39b9f8&&!_0x6a33c5['getUser'](_0x39b9f8)&&_0x4bab1f['add'](_0x39b9f8);}if(0x0===_0x4bab1f['size'])return;const _0x2cd163=await dt['getMany'](_0x812893,Array['from'](_0x4bab1f));for(const _0x26d92a of _0x2cd163)_0x6a33c5['getUser'](_0x26d92a['id'])||_0x6a33c5['addUser'](_0x26d92a);}['_getOperationsFromInitData'](_0x201e89,_0x3b5cbf={}){const _0x18eca5=this['editor']['model'],_0x1c0a63=[];let _0x3b2e0a=0x0;const _0x1cc824='string'==typeof _0x201e89?{'main':_0x201e89}:_0x201e89;for(const _0x164904 of Object['keys'](_0x1cc824)){if(!this['_document']['roots']['has'](_0x164904))throw new _0x680b76('realtimecollaborationclient-init-non-existent-root',this);const _0x30ab60=this['editor']['data']['parse'](_0x1cc824[_0x164904]),_0x3a5d7d=this['_document']['getRoot'](_0x164904),_0x29e54b=new _0x2e9fe7(_0x18eca5['createPositionAt'](_0x3a5d7d,0x0),_0x30ab60,_0x3b2e0a++);_0x1c0a63['push'](_0x29e54b);for(const [_0xa197e,_0x214f6f]of _0x30ab60['markers']){const _0x33cca3=_0x18eca5['createRange'](_0x18eca5['createPositionFromPath'](_0x3a5d7d,_0x214f6f['start']['path']['slice']()),_0x18eca5['createPositionFromPath'](_0x3a5d7d,_0x214f6f['end']['path']['slice']())),_0x333dae=new _0x4753c6(_0xa197e,null,_0x33cca3,_0x18eca5['markers'],!0x0,_0x3b2e0a++);_0x1c0a63['push'](_0x333dae);}}if(_0x3b5cbf)for(const [_0x405f1a,_0xda4120]of Object['entries'](_0x3b5cbf)){const _0x8bfd33=_0x18eca5['document']['getRoot'](_0x405f1a);if(!_0x8bfd33)throw new _0x680b76('multi-root-editor-root-attributes-no-root',null);for(const [_0x51d634,_0x174a6d]of Object['entries'](_0xda4120))if(null!==_0x174a6d){const _0x23ddea=new _0x22f281(_0x8bfd33,_0x51d634,null,_0x174a6d,_0x3b2e0a++);_0x1c0a63['push'](_0x23ddea);}}return _0x1c0a63;}async['_loadRoot'](_0x433050,_0x3109e4,_0x341003){this['_getOperationsFromInitData']({[_0x433050]:_0x3109e4},{[_0x433050]:_0x341003})['forEach']((_0x145b70,_0x212822)=>{_0x145b70['baseVersion']=this['_document']['version']+_0x212822,_0x145b70['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x145b70);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x3d59cd,_0x5c90cc){let _0x42de0a;this['_offset']=_0x3d59cd['offset'];const _0x2771da=_0x3d59cd['wereChangesApplied']&&!_0x3d59cd['initData'],_0x51544e=_0x2771da?0x0:_0x3d59cd['data']['baseVersion'];if(_0x5c90cc['forEach'](_0x5af105=>{_0x5af105['_isInit']=!0x0,_0x5af105['createdAt']=_0x3d59cd['sessionCreatedAt'],_0x5af105['_authorId']=null;}),_0x2771da)_0x42de0a=_0x5c90cc,this['_applyOperationsSet'](_0x42de0a,_0x2771da);else{if(_0x3d59cd['initData']){const _0x4baf33=this['_getOperationsFromInitData'](_0x3d59cd['initData']);this['_document']['history']['version']=-_0x4baf33['length'],_0x4baf33['forEach'](_0x1844f4=>{_0x1844f4['baseVersion']-=_0x4baf33['length'],_0x1844f4['createdAt']=_0x3d59cd['sessionCreatedAt'],_0x1844f4['_isInit']=!0x0,_0x1844f4['_authorId']=null;}),this['_applyOperationsSet'](_0x4baf33,!0x0),this['serverHistory']['version']=-_0x4baf33['length']+this['_offset'],this['_updateServerHistory'](_0x4baf33);}this['_document']['history']['version']=_0x51544e,_0x42de0a=this['_decompressOperations'](_0x3d59cd['data'],_0x3d59cd['metadata']),await this['_fetchMissingUsers'](_0x42de0a),this['_applyOperationsSet'](_0x42de0a,_0x2771da);}_0x3d59cd['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x42de0a,_0x3d59cd['lastOperationId']),this['_lastSyncedOperationId']=_0x3d59cd['lastOperationId']),this['serverHistory']['version']=_0x51544e+this['_offset'],this['_updateServerHistory'](_0x42de0a),_0x5c90cc['filter'](_0x2deccf=>{const _0x47d064=this['_getAffectedRoot'](_0x2deccf);return _0x47d064&&!this['_knownRootNames']['has'](_0x47d064);})['forEach']((_0x3eb22a,_0x22dc88)=>{_0x3eb22a['baseVersion']=this['_document']['version']+_0x22dc88,this['_saveOperationInBuffer'](_0x3eb22a);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x228c5b,_0x3efcc3){const _0x43c665=_0x3efcc3&&_0x3efcc3['message'];if(_0x43c665&&_0x43c665['startsWith']('realtimecollaborationclient'))throw _0x3efcc3;const _0x4d9af6=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x4d9af6['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x680b76(_0x228c5b,this['editor'],_0x43c665?{'originalError':_0x43c665}:void 0x0);}['_saveOperationInBuffer'](_0x57af2c){this['_knownOperations']['has'](_0x57af2c)||(this['_knownOperations']['add'](_0x57af2c),this['_bufferedOperations']['push'](_0x57af2c),this['_pendingAction']||'marker'==_0x57af2c['type']&&!_0x57af2c['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3fffbf=!0x1){!_0x3fffbf&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x321bfa=>{_0x321bfa&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x28ee64=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3b3a92){return _0x3b3a92['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3b3a92['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3b3a92['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x28ee64)||this['_crash'](_0x28ee64['message'],_0x28ee64);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x476d3c=>{this['on']('change:_isPendingUpdate',()=>{_0x476d3c();});});}async['_sendBufferedOperations'](){const _0x151206=this['editor']['plugins']['get'](J);if(this['_shouldSendSelectionUpdate']()&&(_0x151206['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x36b6d8=[...this['_bufferedOperations']];for(const _0x39ea45 of _0x36b6d8)_0x39ea45['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x39ea45);const _0x16d728=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x36b6d8),_0x4a63c8=Z++,_0x19b8f2=this['_compressOperations'](_0x36b6d8),_0x3cd1d8=await this['_service']['sendOperations'](_0x19b8f2,_0x19b8f2['baseVersion'],_0x16d728);try{return await this['_handleServerResponse'](_0x36b6d8,_0x3cd1d8,_0x4a63c8);}catch(_0x246584){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x246584);}}async['_handleServerResponse'](_0x34f225,_0x40900f,_0x83e0a7){if('error'in _0x40900f)throw _0x40900f['error'];let _0xc5ddb1=!0x1;if(_0x40900f['wereChangesApplied']){_0x40900f['lastOperationId']&&(this['_lastSyncedOperationId']=_0x40900f['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x134709=>!_0x34f225['includes'](_0x134709));for(const _0x1f9fae of _0x34f225)_0x1f9fae['createdAt']='lastOperationAcceptedAt'in _0x40900f&&_0x40900f['lastOperationAcceptedAt']||void 0x0;it(_0x34f225,_0x40900f['version']-_0x34f225['length']),this['_updateServerHistory'](_0x34f225);const _0x8e1b03=_0x34f225['filter'](_0x3504dd=>{if(!_0x3504dd['_isInit'])return!0x1;const _0x35fe89=this['_getAffectedRoot'](_0x3504dd);return _0x35fe89&&!this['_knownRootNames']['has'](_0x35fe89);});it(_0x8e1b03,this['_document']['version']),this['_applyOperationsSet'](_0x8e1b03),_0xc5ddb1=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x350052=this['_decompressOperations'](_0x40900f['data'],_0x40900f['metadata'])['filter'](_0x403441=>_0x403441['baseVersion']>=this['_lastServerVersion']);_0x350052['forEach'](_0x52b697=>this['_addKnownRoot'](_0x52b697)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x204afd=>!_0x204afd['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x204afd))),this['_bufferedOperations']['length']&&it(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x350052),_0xc5ddb1=this['_handleExternalOperations'](_0x350052,_0x40900f['version'],_0x40900f['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0xc5ddb1?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x15a831,_0x16e844,_0x363245){try{const _0x445c2f={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x54ad64,operationsB:_0x120d50,originalOperations:_0x4d2cfb}=_0x4ba814(_0x15a831,this['_bufferedOperations'],_0x445c2f);it(_0x54ad64,this['_document']['version']),it(_0x120d50,_0x16e844);for(const _0x2b97dd of _0x54ad64){const _0x502988=_0x4d2cfb['get'](_0x2b97dd);_0x2b97dd['_authorId']=_0x502988?_0x502988['_authorId']:null;}_0x363245&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x15a831,_0x363245),this['_lastSyncedOperationId']=_0x363245),this['_bufferedOperations']=[..._0x120d50],this['_applyOperationsSet'](_0x54ad64),this['_updateServerHistory'](_0x15a831);}catch(_0x124c74){return console['error'](_0x124c74),!0x1;}return!0x0;}['_applyOperationsSet'](_0x5adbfc,_0x16ceed=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x154bc9=>{for(const _0x12d1e1 of _0x5adbfc)this['_knownOperations']['add'](_0x12d1e1),this['_addKnownRoot'](_0x12d1e1),_0x154bc9['batch']['addOperation'](_0x12d1e1),this['editor']['model']['applyOperation'](_0x12d1e1);});}['_addKnownRoot'](_0x7719a1){const _0x171cab=this['_getAffectedRoot'](_0x7719a1);_0x171cab&&this['_knownRootNames']['add'](_0x171cab);}['_getAffectedRoot'](_0x4c0b99){let _0x5bda59,_0x37bf6d;switch(_0x4c0b99['type']){case'insert':_0x5bda59=_0x4c0b99['position']['root'];break;case'marker':if(_0x37bf6d=_0x4c0b99['newRange'],!_0x37bf6d)return null;_0x5bda59=_0x37bf6d['root'];break;case'addRootAttribute':_0x5bda59=_0x4c0b99['root'];break;case'addRoot':_0x5bda59=_0x4c0b99['affectedSelectable'];break;case'move':_0x5bda59=_0x4c0b99['targetPosition']['root'];break;default:return null;}return _0x5bda59['rootName'];}['_updateServerHistory'](_0x4d9d52){_0x4d9d52['forEach'](_0xcf0d67=>{const _0x49882b=_0xcf0d67['clone']();_0x49882b['_authorId']=_0xcf0d67['_authorId'],_0x49882b['_isInit']=!!_0xcf0d67['_isInit'],_0x49882b['createdAt']=_0xcf0d67['createdAt'],_0x49882b['baseVersion']+=this['_offset'],_0xcf0d67['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x49882b),this['serverHistory']['addOperation'](_0x49882b);});}['_handleReconnectionError'](_0x491b58){const _0x2a9394=this['editor']['plugins']['get']('Notification'),_0x3d22ab=this['editor']['locale'];_0x491b58||(_0x491b58=Q(_0x3d22ab,'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.')),_0x2a9394['showWarning'](_0x491b58,{'title':Q(_0x3d22ab,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x1c0e1d)['add'](Q(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1c0e1d)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x561828){const _0x3c55f2=_0x561828['map'](_0x54250d=>_0x54250d['toJSON']());return this['_compressor']['compress'](_0x3c55f2);}['_decompressOperations'](_0x1c8d35,_0x1eb088){return this['_compressor']['decompress'](_0x1c8d35)['map']((_0x3d5f12,_0x3cc837)=>{const _0x471ec2='init'==_0x1eb088[_0x3cc837]['type'];if('InsertOperation'==_0x3d5f12['__className']){const _0x8f48b2=_0x3d5f12['position']['root'];!this['_document']['getRoot'](_0x8f48b2)&&(this['_document']['createRoot']('$root',_0x8f48b2)['_isAttached']=!0x1);}const _0x21f508=_0x1f0bb1['fromJSON'](_0x3d5f12,this['_document']);return _0x21f508['wasUndone']=_0x3d5f12['wasUndone'],_0x21f508['_isInit']=_0x471ec2,_0x21f508['_authorId']=_0x471ec2?null:_0x1eb088[_0x3cc837]['userId'],_0x21f508['_isDisconnection']='cs:removeUser'===_0x1eb088[_0x3cc837]['type'],_0x21f508['createdAt']=_0x1eb088[_0x3cc837]['createdAt'],_0x21f508;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x525c98=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x525c98&&_0x525c98['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class tt extends Error{}function it(_0x3734ea,_0x240333){for(const _0xa13d98 of _0x3734ea)_0xa13d98['baseVersion']=_0x240333++;}class st{['_ignoredOperations'];['_operationToId'];constructor(_0x43ae7d){this['_ignoredOperations']=_0x43ae7d,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x48dd4e){let _0x192bb8=_0x48dd4e['length'];for(;_0x192bb8--;){const _0x4374d3=_0x48dd4e[_0x192bb8];if(!this['_ignoredOperations']['has'](_0x4374d3)){if(!this['_operationToId']['has'](_0x4374d3)){const _0x28de99=_0x4f3ae8()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4374d3,_0x28de99);}return this['_operationToId']['get'](_0x4374d3);}}}['setIdForTheLastOperation'](_0x58706d,_0x2c502a){if(!_0x2c502a)return;let _0x12b704=_0x58706d['length'];for(;_0x12b704--;){const _0x50794f=_0x58706d[_0x12b704];this['_ignoredOperations']['has'](_0x50794f)||this['_operationToId']['set'](_0x50794f,_0x2c502a);}}}class n extends _0x1b15fd{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x2da3ca{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>_0x29043d)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x209d74];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1ae1d1){super(_0x1ae1d1),this['_services']=new Map();}async['init'](){const _0x30d9be=this['context'],_0x2e2a84=_0x30d9be['plugins']['get']('CommentsRepository');if(_0x30d9be['plugins']['get'](c)['addToReconnectionStack'](this),_0x2e2a84['adapter']={'addCommentThread':async({channelId:_0x333c17,threadId:_0x4d83ca,comments:_0x305864,resolvedAt:_0x408e87,resolvedBy:_0x5287d1,context:_0x1a0395,attributes:_0x35990f})=>{const _0x5ab790=await this['_getService'](_0x333c17)['addCommentThread']({'commentThreadId':_0x4d83ca,'comments':_0x305864['map'](_0x52390a=>function(_0x46d1e5,_0xa155f8,_0x3e765c){return{'commentThreadId':_0x3e765c,'commentId':_0x46d1e5['commentId'],'userId':_0x46d1e5['authorId'],'content':_0x46d1e5['content'],'documentId':_0xa155f8,'createdAt':_0x46d1e5['createdAt'],'attributes':_0x46d1e5['attributes']||{}};}(_0x52390a,_0x333c17,_0x4d83ca)),'resolvedAt':_0x408e87,'resolvedBy':_0x5287d1,'context':_0x1a0395,'attributes':_0x35990f})['catch'](ut);return{'threadId':_0x5ab790['commentThreadId'],'comments':_0x5ab790['comments']};},'getCommentThread':async({channelId:_0x237ae2,threadId:_0x513492})=>{const _0x3107=await this['_getService'](_0x237ae2)['getCommentThread'](_0x513492)['catch'](ut);return _0x3107['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x3107]),{'threadId':_0x3107['commentThreadId'],'comments':_0x3107['comments']['map'](_),'context':_0x3107['context'],'resolvedAt':_0x3107['resolvedAt'],'resolvedBy':_0x3107['resolvedBy'],'attributes':_0x3107['attributes']||{}});},'updateCommentThread':async({channelId:_0x479b46,threadId:_0x4437d5,context:_0x248f34,unlinkedAt:_0x209b0d,attributes:_0x9bc87e})=>this['_getService'](_0x479b46)['updateCommentThread']({'commentThreadId':_0x4437d5,'context':_0x248f34,'attributes':_0x9bc87e,'unlinkedAt':_0x209b0d})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x5afa9b,threadId:_0x5ca6a5})=>{const _0x1c8ba7=await this['_getService'](_0x5afa9b)['resolveCommentThread'](_0x5ca6a5)['catch'](S)['catch'](ut);return{'threadId':_0x1c8ba7['commentThreadId'],'resolvedAt':_0x1c8ba7['resolvedAt'],'resolvedBy':_0x1c8ba7['resolvedBy']};},'reopenCommentThread':async({channelId:_0x2bfd83,threadId:_0x579b0d})=>this['_getService'](_0x2bfd83)['reopenCommentThread'](_0x579b0d)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x16c7cc,threadId:_0x450128})=>this['_getService'](_0x16c7cc)['removeCommentThread'](_0x450128)['catch'](S)['catch'](ut),'addComment':({channelId:_0x57bfce,threadId:_0x2ad3b5,commentId:_0x59f9eb,content:_0x5e89a8,attributes:_0x5eab04})=>this['_getService'](_0x57bfce)['addComment'](_0x2ad3b5,_0x59f9eb,_0x5e89a8,_0x5eab04)['catch'](ut),'updateComment':({channelId:_0x281f30,threadId:_0x276c53,commentId:_0xf9b0a0,content:_0x25551e,attributes:_0x18192b})=>this['_getService'](_0x281f30)['updateComment'](_0x276c53,_0xf9b0a0,_0x25551e,_0x18192b)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x452419,threadId:_0x570f2e,commentId:_0x3604ce})=>this['_getService'](_0x452419)['removeComment'](_0x570f2e,_0x3604ce)['catch'](S)['catch'](ut)},_0x30d9be instanceof _0x5dc29c){const _0x3ff434=_0x30d9be['config']['get']('collaboration.channelId'),_0x53abb9=_0x30d9be['plugins']['get'](i);await this['_setUpService'](_0x3ff434);const _0x2cdd06=await this['_services']['get'](_0x3ff434)['getConnectedSessions']();this['listenTo'](_0x53abb9,'sessionAdd:'+_0x3ff434,(_0x53c35b,{session:_0x58da89})=>{_0x58da89['id']===_0x53abb9['mySessionId']&&(_0x53c35b['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x58da89['permissions'],_0x3ff434));}),_0x53abb9['register'](_0x3ff434,_0x2cdd06);}}async['_setUpService'](_0x5be6ce){if(this['_services']['has'](_0x5be6ce))throw new _0x680b76('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x5be6ce});const _0x52a054=this['context']['plugins']['get']('CommentsRepository'),_0x42a958=new a['CommentsService'](_0x5be6ce);this['_services']['set'](_0x5be6ce,_0x42a958),this['listenTo'](_0x42a958,'commentThreadAdded',(_0xea1519,_0x49daf3)=>{const {commentThreadId:_0x521c91,documentId:_0x57bb58,context:_0x516069,attributes:_0x50cf5e,resolvedAt:_0x4769ce,resolvedBy:_0x39bc0e,comments:_0x5e6f93}=_0x49daf3;_0x52a054['getCommentThread'](_0x521c91)||_0x52a054['addCommentThread']({'threadId':_0x521c91,'channelId':_0x57bb58,'comments':_0x5e6f93?_0x5e6f93['map'](_):[],'context':_0x516069,'attributes':_0x50cf5e,'resolvedAt':_0x4769ce,'resolvedBy':_0x39bc0e,'isFromAdapter':!0x0});}),this['listenTo'](_0x42a958,'commentThreadUpdated',(_0x44bd6a,{commentThreadId:_0xc54af8,documentId:_0x207516,context:_0x3295e0,unlinkedAt:_0xca3d4b,attributes:_0x5d0e11})=>{_0x52a054['getCommentThread'](_0xc54af8)&&_0x52a054['updateCommentThread']({'threadId':_0xc54af8,'channelId':_0x207516,'context':_0x3295e0,'unlinkedAt':_0xca3d4b,'attributes':_0x5d0e11,'isFromAdapter':!0x0});}),this['listenTo'](_0x42a958,'commentThreadResolved',(_0x3a52c4,{commentThreadId:_0x15c655,resolvedBy:_0xfedc88,resolvedAt:_0x57a58e})=>{const _0x222309=_0x52a054['getCommentThread'](_0x15c655);_0x222309&&_0x222309['resolve']({'resolvedBy':_0xfedc88,'resolvedAt':_0x57a58e,'isFromAdapter':!0x0});}),this['listenTo'](_0x42a958,'commentThreadReopened',(_0x4bd394,{commentThreadId:_0x462b44})=>{const _0x1b2c51=_0x52a054['getCommentThread'](_0x462b44);_0x1b2c51&&_0x1b2c51['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x42a958,'commentThreadRemoved',(_0x5d4552,{commentThreadId:_0x27ceca})=>{const _0x34a8cb=_0x52a054['getCommentThread'](_0x27ceca);_0x34a8cb&&_0x34a8cb['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x42a958,'commentAdded',(_0x197442,_0x3887fc)=>{const _0xd5b078=_0x3887fc['commentThreadId'],_0x49d70a=_0x52a054['getCommentThread'](_0xd5b078);_0x49d70a&&_0x49d70a['addComment']({..._(_0x3887fc),'isFromAdapter':!0x0});}),this['listenTo'](_0x42a958,'commentUpdated',(_0x203fb8,{commentThreadId:_0x493823,commentId:_0x1afe80,content:_0x2f6504,attributes:_0x44a6fc})=>{const _0x242fa7=_0x52a054['getCommentThread'](_0x493823);if(_0x242fa7){const _0x5c188c=_0x242fa7['getComment'](_0x1afe80);_0x5c188c&&_0x5c188c['update']({'content':_0x2f6504,'attributes':_0x44a6fc,'isFromAdapter':!0x0});}}),this['listenTo'](_0x42a958,'commentRemoved',(_0x24d6ec,{commentThreadId:_0x517815,commentId:_0x52ca08})=>{const _0x266a20=_0x52a054['getCommentThread'](_0x517815);if(_0x266a20){const _0x100e22=_0x266a20['getComment'](_0x52ca08);_0x100e22&&_0x100e22['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x5be6ce);}['destroy'](){if(this['context']instanceof _0x5dc29c){const _0x28fc02=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x28fc02);}}['_terminateService'](_0x3e68fc){if(!this['_services']['has'](_0x3e68fc))throw new _0x680b76('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x3e68fc});this['_getService'](_0x3e68fc)['disconnect'](),this['_services']['delete'](_0x3e68fc);}async['reconnect'](){for(const _0x5c45f3 of this['_services']['keys']())await this['_connectService'](_0x5c45f3);if(this['context']instanceof _0x5dc29c){const _0x2eb870=this['context']['config']['get']('collaboration.channelId'),_0x14a223=this['context']['plugins']['get'](i);_0x14a223['unregister'](_0x2eb870);const _0x2681ea=await this['_services']['get'](_0x2eb870)['getConnectedSessions']();_0x14a223['register'](_0x2eb870,_0x2681ea);}}async['_connectService'](_0xd10859){const {connection:_0x4b4741}=this['context']['plugins']['get'](c),_0x1a0ee6=this['context']['plugins']['get']('CommentsRepository'),_0x2932f1=this['_services']['get'](_0xd10859),_0x95d07f=await _0x2932f1['connect'](_0x4b4741);await this['_fetchMissingUsersForThreads'](_0x95d07f);const _0x328cfb=new Set(Array['from'](_0x1a0ee6['getCommentThreads']({'channelId':_0xd10859}),_0x374bcf=>_0x374bcf['id']));for(const _0x382abb of _0x95d07f)_0x382abb['deletedAt']||_0x328cfb['delete'](_0x382abb['commentThreadId']);for(const _0x54d172 of _0x328cfb)_0x1a0ee6['getCommentThread'](_0x54d172)['remove']({'isFromAdapter':!0x0});for(const _0x5db671 of _0x95d07f){let _0x3c8500=_0x1a0ee6['getCommentThread'](_0x5db671['commentThreadId']);const {commentThreadId:_0x326ff1,context:_0x135637,attributes:_0x4172f0,resolvedBy:_0x4bdd28,resolvedAt:_0x2c16e8,unlinkedAt:_0xa0bac3,deletedAt:_0x4e23dc}=_0x5db671;if(_0x4e23dc)continue;_0x3c8500||(_0x3c8500=_0x1a0ee6['addCommentThread']({'channelId':_0xd10859,'threadId':_0x326ff1,'context':_0x135637,'attributes':_0x4172f0||{},'resolvedBy':_0x4bdd28,'resolvedAt':_0x2c16e8,'unlinkedAt':_0xa0bac3,'isFromAdapter':!0x0}));const _0x1080c6=new Set(Array['from'](_0x3c8500['comments'],_0x275e74=>_0x275e74['id']));for(const _0x467723 of _0x5db671['comments'])_0x1080c6['delete'](_0x467723['commentId']);for(const _0x88cd34 of _0x1080c6)_0x3c8500['getComment'](_0x88cd34)['remove']({'isFromAdapter':!0x0});for(const _0x336836 of _0x5db671['comments']){const _0x5cd4f9=_0x3c8500['getComment'](_0x336836['commentId']);_0x5cd4f9?_0x5cd4f9['content']!==_0x336836['content']&&_0x5cd4f9['update']({'content':_0x336836['content'],'isFromAdapter':!0x0}):_0x3c8500['addComment'](Object['assign'](_(_0x336836),{'isFromAdapter':!0x0}));}}}['_getService'](_0x384fae){if(!this['_services']['has'](_0x384fae))throw new _0x680b76('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x384fae});return this['_services']['get'](_0x384fae);}async['_fetchMissingUsersForThreads'](_0x115f78){const _0x2d1bc8=this['context']['plugins']['get'](_0x209d74),{connection:_0x5a2fd8}=this['context']['plugins']['get'](c),_0x28b8e9=new Set();for(const {resolvedBy:_0x274047,comments:_0x538f40}of _0x115f78){_0x274047&&!_0x2d1bc8['getUser'](_0x274047)&&_0x28b8e9['add'](_0x274047);for(const {userId:_0x5f43e8}of _0x538f40)_0x2d1bc8['getUser'](_0x5f43e8)||_0x28b8e9['add'](_0x5f43e8);}if(0x0===_0x28b8e9['size'])return;const _0x53dd99=await dt['getMany'](_0x5a2fd8,Array['from'](_0x28b8e9));for(const _0x31be64 of _0x53dd99)_0x2d1bc8['getUser'](_0x31be64['id'])||_0x2d1bc8['addUser'](_0x31be64);}}async function S(_0x3ae94a){if('404'!==_0x3ae94a['code'])throw _0x3ae94a;}function ut(_0x30a15b){if((_0x1278ec=_0x30a15b)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1278ec['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1278ec['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1278ec;throw _0x30a15b;}function _(_0x4a11f8){return{'threadId':_0x4a11f8['commentThreadId'],'commentId':_0x4a11f8['commentId'],'content':_0x4a11f8['content'],'createdAt':_0x4a11f8['createdAt'],'authorId':_0x4a11f8['userId'],'attributes':_0x4a11f8['attributes']||{}};}class f extends _0x1b15fd{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(
|
|
28
|
-
((()=>_0x32768c)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x209d74];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1bb019){super(_0x1bb019);const _0x1133d2=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x1133d2);}async['init'](){const _0x48513d=this['editor']['plugins']['get'](l),_0x3fe96c=_0x48513d['serverHistory'],_0x4828f2=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x3fe96c,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x48513d['sessionId']});const _0x14b0c4=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x5d04f8=await _0x429c32['isBundleUploaded'](_0x4828f2['connection'],_0x14b0c4);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x4b540c})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4b540c)),'updateRevisions':async _0xf7ec4c=>{await this['_waitForServiceReady']();const _0x5949d8=this['_revisionTracker']['currentRevision'];if(_0x5d04f8&&0x1===_0xf7ec4c['length']&&_0xf7ec4c[0x0]['id']===_0x5949d8['id'])return _0xf7ec4c;for(const _0x3093f5 of _0xf7ec4c)_0x3093f5['id']===_0x5949d8['id']&&(_0x3093f5['isEmptyCurrent']=_0x3093f5['fromVersion']===_0x3093f5['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0xf7ec4c,this['_lastRequestId'])['then'](_0x30487d=>(this['_lastRequestId']=_0x30487d,_0xf7ec4c))['catch'](_0xf8666e=>{if(U(_0xf8666e)||'400'===_0xf8666e['code']&&void 0x0!==_0xf8666e['data']['wrongRequestId']){for(const _0x20de68 of _0xf7ec4c){!this['_revisionTracker']['repository']['getRevision'](_0x20de68['id'])||this['_revisionTracker']['_bufferUpdate'](_0x20de68['id'],_0x20de68,!0x1);}if(U(_0xf8666e))throw _0xf8666e;return _0xf7ec4c;}throw _0xf8666e;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x57f7fc,{revisionsData:_0xdb41df,requestId:_0x12ed0d})=>{Math['max'](..._0xdb41df['map'](_0x465ca7=>_0x465ca7['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0xdb41df,_0x12ed0d);}):this['_handleRevisionsUpdate'](_0xdb41df,_0x12ed0d);});const {revisions:_0x72dc48,requestId:_0x457a3c}=await this['_revisionHistoryService']['connect'](_0x4828f2['connection']);_0x4828f2['addToReconnectionStack'](this),this['_lastRequestId']=_0x457a3c,await this['_fetchMissingUsers'](_0x72dc48);for(const _0x45e0e5 of _0x72dc48)this['_revisionTracker']['addRevisionData'](_0x45e0e5);this['listenTo'](_0x48513d,'change:_isConnected',(_0x4c0acb,_0x5c10bd,_0x2badf6)=>{_0x2badf6&&(this['_oldOffset']=_0x48513d['_offset'],_0x4c0acb['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4828f2,'state',_0x5bf17d=>_0x5bf17d===_0x202917['CONNECTED']);}async['reconnect'](){const _0x459224=this['editor']['plugins']['get'](c),_0x5f531d=this['editor']['plugins']['get'](l),_0x27cfee=async()=>{const _0x356f6b=this['_revisionTracker']['currentRevision'],_0x305fa4=_0x356f6b['id'],_0x5b2e8d=_0x305fa4!==_0x5f531d['sessionId'];if(_0x5b2e8d){const _0x409a20=_0x5f531d['_offset']-this['_oldOffset'],_0xb34a77=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x356f6b['toVersion']+_0x409a20!==_0xb34a77){const _0x4fd06d=_0x356f6b['fromVersion']+_0x409a20,_0x489735=this['editor']['plugins']['get'](_0x209d74),_0x3ff95f=this['_revisionTracker']['buildRevisionData']({'revision':_0x356f6b,'from':_0x4fd06d,'to':_0xb34a77});_0x3ff95f['id']=_0x356f6b['id'];const _0x3efd9e=_0x3ff95f['authorsIds']['map'](_0x40fe36=>_0x489735['getUser'](_0x40fe36));_0x356f6b['_update']({..._0x3ff95f,'authors':_0x3efd9e},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x356f6b['id'],_0x3ff95f,!0x0);}this['_revisionTracker']['_startingVersion']=_0xb34a77,(_0x356f6b['toVersion']===_0x356f6b['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x305fa4)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x305fa4),this['_revisionTracker']['_createCurrentRevision'](_0xb34a77));}const {revisions:_0x38af9c,requestId:_0x5f2282}=await this['_revisionHistoryService']['reconnect'](_0x459224['connection'],this['_lastRequestId']);_0x5b2e8d&&_0x38af9c['length']>0x0?_0x5f531d['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x38af9c),this['_handleRevisionsUpdate'](_0x38af9c,_0x5f2282),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5f531d['_isConnected']?_0x27cfee():new Promise((_0x411a4c,_0x33449a)=>{_0x5f531d['once']('change:_isConnected',()=>{_0x27cfee()['then'](_0x411a4c)['catch'](_0x33449a);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x396599=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x13f38c=>{_0x13f38c['off'](),_0x396599();});});}['_getLatestVersionFromServerOperations'](){const _0x401d40=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x45358b of _0x401d40)if('marker'!==_0x45358b['type']||_0x45358b['affectsData'])return _0x45358b['baseVersion']+0x1;}['_getLatestVersion'](){const _0xdafde4=this['editor']['plugins']['get'](l);return new Promise(_0x45da88=>{_0xdafde4['_isPendingUpdate']?_0xdafde4['once']('change:_isPendingUpdate',()=>{_0x45da88(this['_getLatestVersionFromServerOperations']());}):_0x45da88(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3fde70,_0x398ac1){const _0x317a50=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x398ac1;for(const _0x1b8855 of _0x3fde70){const _0x462991=_0x317a50['getRevision'](_0x1b8855['id']);if(_0x462991){if((_0x1b8855['fromVersion']||_0x1b8855['toVersion'])&&(_0x1b8855['diffData']=null),_0x462991===this['_revisionTracker']['currentRevision']){const _0x32225a=Math['max'](_0x462991['toVersion'],_0x1b8855['toVersion']),_0x15437e=Math['max'](_0x462991['fromVersion'],_0x1b8855['fromVersion']);let _0x1a3764;_0x462991['toVersion']===_0x1b8855['toVersion']&&_0x462991['fromVersion']===_0x1b8855['fromVersion']?(_0x1a3764=!0x0,this['_preventResendingRevisionData'](_0x1b8855)):_0x1b8855['toVersion']===_0x32225a&&_0x1b8855['fromVersion']===_0x15437e?_0x1a3764=!0x1:(_0x462991['toVersion']===_0x32225a&&_0x462991['fromVersion']===_0x15437e||this['_fixRevision']({'revision':_0x462991,'from':_0x15437e,'to':_0x32225a}),_0x1a3764=!0x0),_0x1a3764&&(delete _0x1b8855['fromVersion'],delete _0x1b8855['toVersion'],delete _0x1b8855['diffData'],delete _0x1b8855['createdAt'],delete _0x1b8855['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1b8855),this['_preventResendingRevisionData'](_0x1b8855);}else this['_revisionTracker']['addRevisionData'](_0x1b8855);}const _0x3fe593=_0x317a50['getRevisions']();_0x3fe593['reverse']();for(let _0x3f649f=0x0;_0x3f649f<_0x3fe593['length']-0x1;_0x3f649f++){const _0x504c4e=_0x3fe593[_0x3f649f],_0x5b5d54=_0x3fe593[_0x3f649f+0x1];if(_0x504c4e['fromVersion']<_0x5b5d54['toVersion']){const _0xc0768=_0x5b5d54['toVersion'],_0x32d80f=Math['max'](_0xc0768,_0x504c4e['toVersion']);this['_fixRevision']({'revision':_0x504c4e,'from':_0xc0768,'to':_0x32d80f});}}}['_fixRevision']({revision:_0x3d2bf3,from:_0x6dfd06,to:_0x55f851}={}){const _0x2f0f7a=this['editor']['plugins']['get'](_0x209d74),_0x3c1ac8=this['_revisionTracker']['buildRevisionData']({'revision':_0x3d2bf3,'from':_0x6dfd06,'to':_0x55f851});_0x3c1ac8['authors']=_0x3c1ac8['authorsIds']['map'](_0x18603f=>_0x2f0f7a['getUser'](_0x18603f)),_0x3d2bf3['_update'](_0x3c1ac8);}['_preventResendingRevisionData'](_0x278f49){const _0x4b8ecc={};_0x4b8ecc['id']=_0x278f49['id'];for(const _0x3088bd of Object['keys'](_0x278f49))'id'!==_0x3088bd&&(_0x4b8ecc[_0x3088bd]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4b8ecc['id'],_0x4b8ecc,!0x0);}async['_fetchMissingUsers'](_0xa1efd7){const _0x541341=this['editor']['plugins']['get'](_0x209d74),{connection:_0x38ba85}=this['editor']['plugins']['get'](c),_0x4ef08f=new Set();for(const _0x5e9a19 of _0xa1efd7){for(const _0x486f3d of _0x5e9a19['authorsIds'])_0x36e5a6(_0x486f3d);_0x5e9a19['creatorId']&&_0x36e5a6(_0x5e9a19['creatorId']);}if(0x0===_0x4ef08f['size'])return;const _0x5072ff=await dt['getMany'](_0x38ba85,Array['from'](_0x4ef08f));for(const _0x348117 of _0x5072ff)_0x541341['getUser'](_0x348117['id'])||_0x541341['addUser'](_0x348117);function _0x36e5a6(_0x5d5477){_0x541341['getUser'](_0x5d5477)||_0x4ef08f['add'](_0x5d5477);}}}function U(_0x498c46){return _0x498c46['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x498c46['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x498c46['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1b15fd{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x5864bc{['_collapseAt'];constructor(_0x2d7230,_0x39c0f0=0x6){super(_0x2d7230);const _0x54ce5f=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x39c0f0,this['bind']('isHidden')['to'](this,'usersCount',_0x4c919d=>_0x4c919d<_0x39c0f0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x54ce5f['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':_0x54ce5f['to']('usersCount',_0x33bf3e=>'+'+(_0x33bf3e-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x5864bc{['items'];['keystrokes'];constructor(_0x13e5fa){super(_0x13e5fa);const _0x431990=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x45631a(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x431990['if']('hasPopup'),'aria-expanded':_0x431990['to']('isExpanded',_0x45d38f=>this['hasPopup']&&String(_0x45d38f)),'aria-label':_0x431990['to']('hasPopup',_0x901b0f=>Q(_0x13e5fa,_0x901b0f?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x431990['to']('hasPopup',_0x4f92a1=>!!_0x4f92a1&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x431990['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x431990['to'](_0x2024a2=>{const _0x71a485=_0x2024a2,_0xc0c1d4=document['querySelector']('.ck-presence-list__dropdown-list'),_0x549bc1=document['querySelector']('.ck-balloon-panel_with-arrow');_0xc0c1d4?.['contains'](_0x71a485['relatedTarget'])||_0x549bc1?.['contains'](_0x71a485['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x45a760,_0x3e45a7,_0x9652f)=>{this['element']&&(_0x9652f?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x5864bc{['counterView'];['inlineListView'];constructor(_0x3e3a7e,_0x12de37=0x6){super(_0x3e3a7e);const _0x3af1e2=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x12de37),this['inlineListView']=new ts(_0x3e3a7e),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x3fdfcd of this['inlineListView']['items'])_0x3fdfcd['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',_0x3af1e2['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x5864bc{['listWrapperView'];constructor(_0x29d32c,_0x5e450a){super(_0x29d32c);const _0x42f3e6=this['bindTemplate'];this['listWrapperView']=new mt(_0x29d32c,_0x5e450a),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':Q(_0x29d32c,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x42f3e6['to'](_0x26f641=>{const _0xbfa36d=_0x26f641,_0xe1430a=document['querySelector']('.ck-presence-list__list'),_0x18ef1f=document['querySelector']('.ck-balloon-panel_with-arrow');_0xe1430a?.['contains'](_0xbfa36d['relatedTarget'])||_0x18ef1f?.['contains'](_0xbfa36d['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x22ebb3{constructor(_0x50ad8a,_0x581c24){super(_0x50ad8a);const _0x3167b5=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x581c24?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3167b5['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3167b5['to']('role'),'aria-label':_0x3167b5['to']('ariaLabel'),'aria-labelledby':_0x3167b5['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x2ac657['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xfd1dc0=this['element'];_0xfd1dc0&&(this['_isScrollable']=Math['max'](_0xfd1dc0['scrollHeight'],_0xfd1dc0['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x23d236,_0x555414,_0x2578bf){super(_0x23d236);const _0x2e0ea7=this['bindTemplate'];this['userView']=new ct(_0x23d236,_0x555414);const _0x383d80={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x555414['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x555414['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x555414['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x2578bf&&(_0x383d80['tag']='button',_0x383d80['on']={'click':_0x2e0ea7['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x383d80);}['focus'](){this['element']['focus']();}}class y extends _0x5864bc{['userView'];['markerView'];constructor(_0x26f08d,_0x1ad30b,_0x3c1935){super(_0x26f08d);const _0x370e99=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x26f08d,_0x1ad30b),this['markerView']=new at(_0x26f08d,_0x1ad30b);const _0x815f47=new ot(_0x26f08d);_0x815f47['template']['tag']='span',_0x815f47['text']=_0x1ad30b['name'];const _0x429b3e={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x370e99['to']('isFocusable',_0x471c43=>!!_0x471c43&&0x0),'aria-labelledby':_0x815f47['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x370e99['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x370e99['to']('hasTooltip',_0x394da8=>!_0x394da8),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x815f47]};_0x3c1935&&(_0x429b3e['tag']='button',_0x429b3e['on']={'click':_0x370e99['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x429b3e);}}class at extends _0x5864bc{constructor(_0x6c0e8c,_0x4eea26){super(_0x6c0e8c),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4eea26['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x2da3ca{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4e2ec3){super(_0x4e2ec3),this['context']['config']['define']('presenceList',C);const _0xc405ff=_0x4e2ec3['config']['get']('presenceList.collapseAt');if('number'!=typeof _0xc405ff)throw new _0x680b76('presencelist-collapseat-invalid-format',this);if(_0xc405ff<0x1)throw new _0x680b76('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x49727e(),this['balloonPanelView']=new _0x2b47f8(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0xb62e1d of this['_allConnectedUsers'])this['_handleUserAdd'](_0xb62e1d);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1d0e74,_0x15d1b4)=>{this['_handleUserAdd'](_0x15d1b4);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x2b1939,_0x116504)=>{this['_handleUserRemove'](_0x116504);});}['_createView'](){const _0x30b074=this['context'],_0x1a5869=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xbee852=this['balloonPanelView'];if(!_0xb76a19(_0x30b074['config']['get']('presenceList.container')))throw new _0x680b76('presencelist-missing-container',this);return _0x1a5869['counterView']['bind']('usersCount')['to'](this),_0x1a5869['bind']('isCollapsed')['to'](this,'usersCount',_0x3911d3=>{const {collapseAt:_0x53eafa}=_0x30b074['config']['get']('presenceList'),_0x5f5157=_0x3911d3>=_0x53eafa;if(_0x5f5157&&!_0x1a5869['inlineListView']['items']['find'](_0x450257=>_0x450257 instanceof A)){const _0x4c6a6a=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x4c6a6a&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x1a5869['inlineListView']['items']['add'](_0x1a5869['counterView']);}return _0x5f5157||this['hideDropdown'](),_0x5f5157;}),_0x1a5869['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xc7bcdc=>{const _0x48eed5=_0x30b074['config']['get']('presenceList'),_0xa2f643=new y(_0x30b074['locale'],_0xc7bcdc,!!_0x48eed5['onClick']);return _0xa2f643['bind']('hasTooltip')['to'](_0x1a5869,'isCollapsed',_0x5ab5d6=>!_0x5ab5d6),_0xa2f643['bind']('isFocusable')['to'](_0x1a5869,'isCollapsed',_0x2cf1d6=>!_0x2cf1d6),_0x48eed5['onClick']&&this['listenTo'](_0xa2f643,'execute',()=>{this['view']['isCollapsed']||_0x48eed5['onClick'](_0xc7bcdc,_0xa2f643['element']);}),_0xa2f643;}),this['listenTo'](_0x1a5869['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x1a5869['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x1a5869['inlineListView']['keystrokes']['set']('Enter',(_0x496d8b,_0x1c6408)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x1c6408());}),_0x1a5869['render'](),_0xbee852['render'](),_0x323cda({'emitter':_0x1a5869,'activator':()=>_0xbee852['isVisible'],'contextElements':[_0xbee852['element'],_0x1a5869['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x30b074['config']['get']('presenceList.container')['appendChild'](_0x1a5869['element']),this['_bodyCollection']=new _0x55c398(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x1a5869;}['_handleUserAdd'](_0x18bb49){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x18bb49['isMe'])return;const _0xbce927=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0xbce927-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x324529=_0x18bb49['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x18bb49,_0x324529);}['_handleUserRemove'](_0xc1e875){this['usersCount']--;const {collapseAt:_0x5fce8}=this['context']['config']['get']('presenceList'),_0x1195eb=this['usersCount']>=_0x5fce8;if(this['currentDisplayedUsers']['get'](_0xc1e875['id']))this['currentDisplayedUsers']['remove'](_0xc1e875['id']);else{if(_0x1195eb&&this['currentDisplayedUsers']['length']+0x1===_0x5fce8-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1195eb?0x1:0x0)<this['usersCount']){for(const _0x804cb9 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x804cb9['id'])&&(this['currentDisplayedUsers']['add'](_0x804cb9,Math['min'](this['currentDisplayedUsers']['length']-(_0x1195eb?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1195eb?0x1:0x0)===_0x5fce8-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x163a11=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x163a11['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x21acc9}=this['presenceDropdownView'];_0x21acc9['items']['bindTo'](this['_allConnectedUsers'])['using'](_0xd309d9=>{if(!_0x163a11['displayMe']&&_0xd309d9['isMe'])return null;const _0x371263=new k(this['context']['locale'],_0xd309d9,!!_0x163a11['onClick']);return _0x163a11['onClick']&&this['listenTo'](_0x371263,'execute',()=>{_0x163a11['onClick'](_0xd309d9,_0x371263['element']);}),_0x371263;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x21acc9['focus'](),_0x21acc9['checkIfScrollable']();const _0x22db08=(_0xc52489,_0x2cc985)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2cc985();};_0x21acc9['keystrokes']['set']('Esc',_0x22db08),_0x21acc9['keystrokes']['set']('Shift+Tab',_0x22db08),_0x21acc9['keystrokes']['set']('Tab',(_0xd507d,_0x35ef1a)=>{!function(_0x50a49a){const _0x4908e7=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x4f5593=>_0x4f5593+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xd68df=[...document['body']['querySelectorAll'](_0x4908e7)]['filter'](_0x5740fd=>_0x5740fd===document['activeElement']||_0x5740fd['offsetWidth']+_0x5740fd['offsetHeight']>0x0)['sort']((_0x23fe92,_0x4cb419)=>(_0x23fe92['tabIndex']||0x0)-(_0x4cb419['tabIndex']||0x0)),_0x3857b2=_0xd68df['indexOf'](_0x50a49a),_0x34728f=_0xd68df[(_0x3857b2+0x1)%_0xd68df['length']];_0x34728f&&_0x34728f['focus']();}(this['view']['element']),this['hideDropdown'](),_0x35ef1a();}),_0x21acc9['focusTracker']['add'](this['view']['element']),_0x21acc9['focusTracker']['on']('change:isFocused',(_0x4c1e51,_0x20476a,_0x4349f9)=>{_0x4349f9||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x2da3ca{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
|
23
|
+
import{ContextPlugin as _0x1c26de,Plugin as _0x5b53f8,PendingActions as _0x1e1965,Context as _0x1ce702}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x51b314,CKEditorError as _0x14f332,Collection as _0x357f48,global as _0x1faad8,version as nt,uid as _0x45d855,KeystrokeHandler as _0x2acc1a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x4f1115,View as _0x29d60d,ListView as _0x30d786,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x1d776a,clickOutsideHandler as _0x2fa8e1,BodyCollection as _0x55757f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ht,History as _0x47e7d3,NoOperation as _0x89b253,InsertOperation as _0x4f5fe0,MarkerOperation as _0xe4b5e,RootAttributeOperation as _0xf8480,transformSets as _0x1daa93,OperationFactory as _0x4d3de2}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as lt,WEB_SOCKET_GATEWAY_STATES as _0x3021e9,CollaborativeEditingService as _0x4a9dfb,User as dt,CommentsService as _0x1531aa,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x332833,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1c3636}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x165a7f}from'es-toolkit/compat';class c extends _0x1c26de{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>lt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x4f1115];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14cf3f){super(_0x14cf3f),this['set']('state',_0x3021e9['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x51b314);}['init'](){const _0x5e86d0=this['context'],_0x366f1a=_0x5e86d0['plugins']['get']('CloudServices'),_0x4bc252=_0x5e86d0['plugins']['get'](_0x4f1115);if(!_0x366f1a['token'])throw new _0x14f332('websocketgateway-missing-token',this);if(!_0x366f1a['webSocketUrl'])throw new _0x14f332('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x366f1a['token'],_0x366f1a['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0xd6afb9=>{if(this['connection']=_0xd6afb9,this['bind']('state')['to'](_0xd6afb9,'state',this,'_isBrowserOffline',(_0x4a2a68,_0x2cfa85)=>('connected'!==_0x4a2a68&&(this['_shouldPluginsReconnect']=!0x0),_0x2cfa85||_0x4a2a68!==_0x3021e9['CONNECTED']?_0x3021e9['DISCONNECTED']:this['state']==_0x3021e9['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3021e9['CONNECTING']):_0x3021e9['CONNECTED'])),this['connection']['on']('error',(_0x39ef67,_0x4f06b2)=>{if('limitExceeded'!==_0x4f06b2['code'])throw console['error'](_0x4f06b2),new _0x14f332('cloudservices-init',null,{'originalError':_0x4f06b2});_0x4bc252['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'});}),!_0xd6afb9['me'])return new Promise(_0x392f42=>_0xd6afb9['on']('change:me',_0x392f42));})['catch'](_0x49c5f0=>{throw console['error'](_0x49c5f0),new _0x14f332('cloudservices-init',null,{'originalError':_0x49c5f0});});}['addToReconnectionStack'](_0x564734){if('function'!=typeof _0x564734['reconnect'])throw new _0x14f332('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x564734))throw new _0x14f332('websocketgateway-plugin-already-registered',this,{'name':_0x564734['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x564734);}['removeFromReconnectionStack'](_0x1d2e3d){this['_reconnectionStack']['delete'](_0x1d2e3d);}['isInReconnectionStack'](_0x1d02c6){return this['_reconnectionStack']['has'](_0x1d02c6);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x35199c=>_0x35199c['reconnect']())))['then'](()=>this['state']=_0x3021e9['CONNECTED'])['catch'](_0x549a43=>{throw console['error'](_0x549a43),new _0x14f332('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3021e9['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x1c26de{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x332833];}constructor(_0x946862){super(_0x946862),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x357f48(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x332833);}['init'](){const _0x25be44=this['context']['plugins']['get'](c);this['listenTo'](_0x25be44,'change:state',(_0x3170b8,_0x305a7e,_0x20519b)=>{if('connected'!==_0x20519b)this['channelSessions']['forEach'](_0x4df5ef=>_0x4df5ef['clear']()),this['channelConnectedUsers']['forEach'](_0x3d487d=>_0x3d487d['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5d8fa7,_0x4e7b66]of this['_registeredSessions'])for(const _0x201765 of _0x4e7b66)this['_handleSessionAdd'](_0x5d8fa7,_0x201765);}}),this['_createUser'](_0x25be44['connection']['me'],!0x0);}['register'](_0x439867,_0x55a54d){if(this['_registeredSessions']['has'](_0x439867))throw new _0x14f332('sessions-register-already-registered',null,{'channelId':_0x439867});this['_registeredSessions']['set'](_0x439867,_0x55a54d),this['channelSessions']['set'](_0x439867,new _0x357f48()),this['channelConnectedUsers']['set'](_0x439867,new _0x357f48()),this['listenTo'](_0x55a54d,'add',(_0x4d4998,_0x543989)=>this['_handleSessionAdd'](_0x439867,_0x543989)),this['listenTo'](_0x55a54d,'remove',(_0x5e900a,_0x42426c)=>this['_handleSessionRemove'](_0x439867,_0x42426c));for(const _0x4d1f20 of _0x55a54d)this['_handleSessionAdd'](_0x439867,_0x4d1f20);}['unregister'](_0x14a533){if(!this['_registeredSessions']['has'](_0x14a533))throw new _0x14f332('sessions-unregister-not-exist',null,{'channelId':_0x14a533});const _0x1fc0d2=this['_registeredSessions']['get'](_0x14a533);this['stopListening'](_0x1fc0d2);for(const _0x39bb2f of _0x1fc0d2)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x14a533,_0x39bb2f);this['_registeredSessions']['delete'](_0x14a533),this['channelSessions']['delete'](_0x14a533),this['channelConnectedUsers']['delete'](_0x14a533);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x373fe4){for(const _0x166a32 of this['channelSessions']['values']())for(const _0x313d26 of _0x166a32)if(_0x313d26['id']===_0x373fe4)return _0x313d26['user'];}['getUserSessions'](_0x358305,_0x36b68d){const _0x44fd17=_0x36b68d?[this['channelSessions']['get'](_0x36b68d)]:this['channelSessions']['values'](),_0x5eea5f=new Set();for(const _0x3da6ab of _0x44fd17)for(const _0x16fe39 of _0x3da6ab)_0x16fe39['user']['id']===_0x358305['id']&&_0x5eea5f['add'](_0x16fe39['id']);return _0x5eea5f;}['getUserRole'](_0x1a61e2){for(const _0x989e4e of this['channelSessions']['values']())for(const _0x5e8024 of _0x989e4e)if(_0x5e8024['user']===_0x1a61e2)return _0x5e8024['role'];}['_handleSessionAdd'](_0x1b57a2,_0x589332){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x241192=_0x589332['user'],_0x1e94a5=this['_users']['getUser'](_0x241192['id'])||this['_createUser'](_0x241192),_0x305e80=Object['assign']({},_0x589332,{'user':_0x1e94a5});this['channelSessions']['get'](_0x1b57a2)['add'](_0x305e80);const _0x203696=this['channelConnectedUsers']['get'](_0x1b57a2);_0x203696['has'](_0x1e94a5['id'])||_0x203696['add'](_0x1e94a5),this['allConnectedUsers']['has'](_0x1e94a5['id'])||this['allConnectedUsers']['add'](_0x1e94a5,_0x1e94a5['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x1b57a2,{'channelId':_0x1b57a2,'session':_0x305e80});}['_handleSessionRemove'](_0x43c70c,_0xe93616){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x34ecf8=this['channelConnectedUsers']['get'](_0x43c70c),_0x151693=_0xe93616['user'];_0x151693['id']&&(this['channelSessions']['get'](_0x43c70c)['remove'](_0xe93616['id']),_0x34ecf8['has'](_0x151693['id'])&&!this['getUserSessions'](_0x151693,_0x43c70c)['size']&&_0x34ecf8['remove'](_0x151693['id']),this['allConnectedUsers']['get'](_0x151693['id'])&&!this['getUserSessions'](_0x151693)['size']&&this['allConnectedUsers']['remove'](_0x151693['id']));}['_createUser'](_0x1e00cd,_0x47cf2b){const _0x135347=this['_users']['addUser'](_0x1e00cd);return _0x47cf2b&&this['_users']['defineMe'](_0x1e00cd['id']),_0x135347['orderNumber']=this['_uniqueUsersCount']++,_0x135347;}}class q extends _0x5b53f8{['_domEmitter']=new(_0x51b314())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x38973d=this['editor'],_0x170183=_0x38973d['plugins']['get'](i);_0x38973d['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x2f236c,{writer:_0x255008})=>function(_0x38cb9b,_0x3fec38,_0x1b9992,_0x488eec){const _0x289c3f=_0x38cb9b['markerName']['split'](':')[0x2],_0x346858=_0x1b9992['getUserBySessionId'](_0x289c3f);if(!_0x346858||_0x289c3f===_0x1b9992['mySessionId'])return;if(!_0x488eec['model']['schema']['checkChild'](_0x38cb9b['markerRange']['start'],'$text'))return;const _0x197116={'class':'ck-user__marker\x20'+_0x346858['color']['getMarkerClass'](),'data-name':_0x346858['name'],'data-session-id':_0x289c3f},_0x1eb458=_0x488eec['model']['markers']['get'](_0x38cb9b['markerName']),_0x2efd13=_0x1eb458['getStart'](),_0x71eb82=_0x2efd13['nodeAfter'],_0x101c5b=_0x488eec['model']['schema'];if(_0x71eb82&&_0x101c5b['isObject'](_0x71eb82)&&_0x101c5b['isInline'](_0x71eb82)&&!_0x488eec['model']['markers']['get']('user:range:'+_0x289c3f)['getRange']()['isCollapsed'])return;const _0x5208eb=_0x2efd13['parent'];return _0x488eec['model']['schema']['isLimit'](_0x5208eb)&&!_0x488eec['model']['hasContent'](_0x5208eb)&&(_0x197116['contenteditable']=!0x1),function(_0x9d8f5b,_0x481b60,_0x5282f6){const _0x3775ab=_0x9d8f5b['createUIElement']('span',_0x481b60);return _0x9d8f5b['setCustomProperty']('userPositionMarker',!0x0,_0x3775ab),_0x3775ab['render']=function(_0x20ef3f){const _0x5835c4=this['toDomElement'](_0x20ef3f),_0x20ea64=document['createElement']('span');return _0x20ea64['classList']['add']('ck-user__marker-tooltip'),_0x20ea64['setAttribute']('contenteditable','false'),_0x20ea64['setAttribute']('spellcheck','false'),_0x20ea64['textContent']=_0x5282f6['name'],_0x5835c4['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x20ea64['outerHTML']+'',_0x5835c4['addEventListener']('mouseenter',()=>{_0x5835c4['classList']['add']('ck-user__marker_hovered');}),_0x5835c4['addEventListener']('mouseleave',()=>{_0x5835c4['classList']['remove']('ck-user__marker_hovered');}),_0x5835c4;},_0x3775ab['isSimilar']=function(_0x3cc787){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3cc787['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3cc787['getAttribute']('data-session-id'));},_0x3775ab;}(_0x3fec38,_0x197116,_0x346858);}(_0x2f236c,_0x255008,_0x170183,_0x38973d)}),_0x38973d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5be9fb=>function(_0x17f006,_0x2df4ba){const _0x157338=_0x17f006['markerName']['split'](':')[0x2];if(_0x157338===_0x2df4ba['mySessionId'])return null;const _0x2edac7=_0x2df4ba['getUserBySessionId'](_0x157338);if(!_0x2edac7)return{'id':_0x157338,'classes':[]};return{'id':_0x157338,'classes':['ck-user__selection',_0x2edac7['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x157338},'priority':0x7d0+_0x2edac7['orderNumber']};}(_0x5be9fb,_0x170183)}),function(_0x46ecdb){const _0x5ca872=_0x46ecdb['model'],_0x4a2da2=new Map(),_0x2d47d5=_0x46ecdb['plugins']['get'](i);_0x5ca872['markers']['on']('update:user:range',(_0x1af5cc,_0x12274,_0x259deb,_0x25c046)=>{if(!_0x25c046&&_0x4a2da2['get'](_0x12274['name']))return _0x4a2da2['get'](_0x12274['name'])['detach'](),void _0x4a2da2['delete'](_0x12274['name']);const _0x3eee9b=_0x12274['name']['split'](':')[0x2];if(_0x3eee9b===_0x2d47d5['mySessionId'])return;const _0x20f9bd='user:position:'+_0x3eee9b;_0x5ca872['markers']['has'](_0x20f9bd)&&_0x46ecdb['editing']['reconvertMarker'](_0x20f9bd),_0x12274['on']('change:range',(_0x39da9e,_0x1307e1,_0x221159)=>{if('$graveyard'!=_0x1307e1['root']['rootName']&&'$graveyard'==_0x12274['getRange']()['root']['rootName']&&!_0x4a2da2['has'](_0x12274['name'])){const _0xd86485=_0x5ca872['schema']['getNearestSelectionRange'](_0x221159['deletionPosition']);if(_0xd86485){const _0x47c47c=ht['fromRange'](_0xd86485);_0x4a2da2['set'](_0x12274['name'],_0x47c47c),_0x47c47c['on']('change:range',(_0x4ce166,_0x347b8f,_0x3818d0)=>{if('$graveyard'==_0x47c47c['root']['rootName']){const _0x1a3a22=_0x5ca872['schema']['getNearestSelectionRange'](_0x3818d0['deletionPosition']);_0x1a3a22?(_0x47c47c['start']=_0x1a3a22['start'],_0x47c47c['end']=_0x1a3a22['end']):(_0x4a2da2['delete'](_0x12274['name']),_0x47c47c['detach']());}});}}});}),_0x5ca872['document']['on']('change',()=>{_0x4a2da2['size']>0x0&&_0x5ca872['enqueueChange']({'isUndoable':!0x1},_0x59bf48=>{for(const [_0x4a8ddc,_0x3575b0]of _0x4a2da2)'$graveyard'==_0x5ca872['markers']['get'](_0x4a8ddc)['getRange']()['root']['rootName']&&(te(_0x4a8ddc['split'](':')[0x2],_0x3575b0['toRange'](),_0x5ca872,_0x59bf48),_0x3575b0['detach']());_0x4a2da2['clear']();});});}(_0x38973d),this['_domEmitter']['listenTo'](_0x1faad8['document'],'keydown',(_0x4eb200,{key:_0x329391})=>{'Escape'===_0x329391&&function(_0x1a8182){_0x1a8182['editing']['view']['change'](_0x2fb007=>{for(const _0x2b0032 of _0x1a8182['model']['markers']){if(!_0x2b0032['name']['startsWith']('user:position'))continue;const _0x506000=_0x1a8182['editing']['mapper']['markerNameToElements'](_0x2b0032['name']);if(_0x506000){for(const _0x35dc89 of _0x506000)_0x2fb007['removeClass']('ck-user__marker_hovered',_0x35dc89);}}});}(_0x38973d);},{'useCapture':!0x0});}['afterInit'](){const _0x2e714a=this['editor'],_0x223583=_0x2e714a['commands']['get']('undo');_0x223583&&_0x2e714a['model']['on']('applyOperation',(_0x9b0b58,_0x17be2f)=>{const _0x49110f=_0x17be2f[0x0];if(!_0x49110f['isDocumentOperation'])return;if('marker'!=_0x49110f['type']||!_0x49110f['name']['startsWith']('user:'))return;const _0x1ce4f4=_0x49110f['batch'];_0x223583['_createdBatches']['has'](_0x1ce4f4)&&(_0x49110f['newRange']=_0x49110f['oldRange']?_0x2e714a['model']['createRange'](_0x49110f['oldRange']['start'],_0x49110f['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x37831f=this['editor'],_0x62fbed=_0x37831f['model']['document'],_0x59401a=_0x37831f['plugins']['get'](i);_0x37831f['model']['enqueueChange']({'isUndoable':!0x1},_0x2a9445=>{const _0x4a0e2b='user:range:'+_0x59401a['mySessionId'],_0x102b0f='user:position:'+_0x59401a['mySessionId'],_0x3bdacd=_0x37831f['model']['markers']['has'](_0x4a0e2b);_0x37831f['editing']['view']['hasDomSelection']?te(_0x59401a['mySessionId'],_0x62fbed['selection']['getFirstRange'](),_0x37831f['model'],_0x2a9445):_0x3bdacd&&(_0x2a9445['removeMarker'](_0x4a0e2b),_0x2a9445['removeMarker'](_0x102b0f));});}}function te(_0x212811,_0x5303a5,_0x26d757,_0x281a8d){const _0x114607='user:range:'+_0x212811,_0x339334='user:position:'+_0x212811,_0x7cd8c4=_0x5303a5['getContainedElement']();let _0x288125=_0x5303a5['start'];if(_0x7cd8c4&&_0x7cd8c4['is']('element','tableCell')){const _0x498738=function(_0x2994b6,_0x3717ed){for(const _0x5b697a of _0x2994b6['getPositions']())if(_0x3717ed['schema']['checkChild'](_0x5b697a,'$text'))return _0x5b697a;}(_0x5303a5,_0x26d757);_0x498738&&(_0x288125=_0x498738,_0x5303a5=_0x281a8d['createRange'](_0x288125));}const _0x2db8b8=_0x281a8d['createRange'](_0x288125);_0x26d757['markers']['has'](_0x114607)?(_0x281a8d['updateMarker'](_0x114607,{'range':_0x5303a5}),_0x281a8d['updateMarker'](_0x339334,{'range':_0x2db8b8})):(_0x281a8d['addMarker'](_0x114607,{'range':_0x5303a5,'usingOperation':!0x0}),_0x281a8d['addMarker'](_0x339334,{'range':_0x2db8b8,'usingOperation':!0x0}));}function G(_0x25582c,_0x3efb13,_0x4c1d76){const _0x3bcea3=_0x25582c['t'],t=_0x25582c['t'];switch(_0x3efb13){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 _0x3bcea3({'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'},_0x4c1d76);default:return'';}}let J=0x1;class l extends _0x5b53f8{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x4a9dfb)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,q,_0x1e1965,_0x332833,_0x4f1115];}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 _0x5e0f24=this['serverHistory']['getOperations']();for(let _0x1dae57=_0x5e0f24['length']-0x1;_0x1dae57>=0x0;_0x1dae57--){const _0x16956a=_0x5e0f24[_0x1dae57];if(!this['_disconnectionOperations']['has'](_0x16956a))return _0x16956a['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x19f57a){if(super(_0x19f57a),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x47e7d3(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x14f332('collaboration-missing-channelid',this);const _0x5274c3=_0x19f57a['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x5274c3,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1c3636(),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 Y(this['_disconnectionOperations']);}['init'](){const _0x5e3aa0=this['editor'],_0x181f4a=_0x5e3aa0['plugins']['get'](_0x332833),_0x391a81=_0x5e3aa0['plugins']['get'](c);this['listenTo'](_0x181f4a,'getOperationAuthor',(_0x37f590,_0x18180c)=>{const _0x4825a8=_0x18180c[0x0];_0x4825a8['_authorId']&&(_0x37f590['return']=_0x181f4a['getUser'](_0x4825a8['_authorId']),_0x37f590['stop']()),null===_0x4825a8['_authorId']&&(_0x37f590['return']=null,_0x37f590['stop']());},{'priority':'high'}),this['listenTo'](_0x5e3aa0['model']['document']['selection'],'change:range',(_0x4245a4,_0x2ce285)=>{_0x2ce285['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x5e3aa0['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x5e3aa0['model']['on']('applyOperation',(_0x58a5bb,_0xb87097)=>{const _0x1a40e1=_0xb87097[0x0];_0x1a40e1['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1a40e1),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x391a81,'state',this,'_hasSynchronizationProblem',(_0x4ac1e6,_0xa27c39)=>'connected'===_0x4ac1e6&&!_0xa27c39),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x5e3aa0['disableReadOnlyMode']('rtc-offline'):_0x5e3aa0['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x5e3aa0['disableReadOnlyMode']('rtc-offline'):_0x5e3aa0['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4025bd=this['editor']['plugins']['get'](i),_0x4b6f32=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x4025bd['unregister'](this['_channelId']);const _0x2020bd=await this['_service']['reconnect'](_0x4b6f32['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x2020bd)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x47734f=await this['_service']['getConnectedSessions']();_0x4025bd['register'](this['_channelId'],_0x47734f),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x1c7382){if(function(_0x38b86c){return'404'===_0x38b86c['code'];}(_0x1c7382)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5d2266){return'409'===_0x5d2266['code'];}(_0x1c7382)){const _0x36679d=G(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'](_0x36679d);}else{if(!(_0x1c7382 instanceof Q))throw _0x1c7382;this['_handleReconnectionError']();}}}}['destroy'](){const _0x2cc07c=this['editor']['plugins']['get'](c),_0x24aa2d=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x24aa2d['channelSessions']['has'](this['_channelId'])&&_0x24aa2d['unregister'](this['_channelId']),_0x2cc07c['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x43ae9b){if(this['sessionId']!==_0x43ae9b['sessionId']&&this['_lastSyncedOperationId']!==_0x43ae9b['lastOperationId'])throw new Q();return this['sessionId']=_0x43ae9b['sessionId'],this['_handleServerResponse']([],{..._0x43ae9b,'wereChangesApplied':!0x1,'data':_0x43ae9b['data']},'reconnect');}async['_connectService'](_0x3c1c78,_0x13f6c1=!0x1){const {connection:_0x49d822}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x49d822,this['_channelId'])['then'](_0x23dbc2=>this['_initSessionsHandling'](_0x23dbc2))['catch'](_0x34169c=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x34169c);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x447ec3,_0x3b6783)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3b6783);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x2c1066=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3c1c78);this['_isPendingUpdate']=!0x0;const _0x253f60=await this['_service']['connect'](_0x49d822,this['_compressOperations'](_0x3c1c78),_0x2c1066);if(this['sessionId']=_0x253f60['sessionId'],_0x13f6c1){if(!_0x253f60['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x253f60['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3c1c78,_0x253f60,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x253f60,_0x3c1c78);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3241a8=this['editor']['plugins']['get'](i),_0x143b5c=this['editor']['plugins']['get'](q),_0x5ac63c=_0x3241a8['channelSessions']['get'](this['_channelId']);_0x5ac63c&&_0x5ac63c['length']>0x1?_0x143b5c['createUserMarkerOperations']():this['listenTo'](_0x3241a8,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3241a8['channelSessions']['get'](this['_channelId'])['length']&&_0x143b5c['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x2347f2,_0x3a1e4,_0x59fd1f,_0x68d30d){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3a1e4){const _0x235d61=this['_decompressOperations'](_0x59fd1f,_0x68d30d);await this['_fetchMissingUsers'](_0x235d61),this['_handleExternalOperations'](_0x235d61,_0x3a1e4,_0x59fd1f['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x5c0f26}=this['editor'];let _0x32ab41;try{_0x32ab41=await this['_service']['getDocumentDetails']();}catch{const _0x755891=G(_0x5c0f26,'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'](_0x755891);}const _0x59b407=_0x32ab41['currentDocumentSession']||_0x32ab41['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x59b407['lastOperationId']){const _0x5132bc=G(_0x5c0f26,'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'](_0x5132bc);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x4b5890){const _0x44b627=this['editor']['plugins']['get'](i);this['listenTo'](_0x44b627,'sessionAdd:'+this['_channelId'],(_0x3f7658,{session:_0xb3c239})=>{if(_0xb3c239['id']===_0x44b627['mySessionId']){_0x3f7658['off']();const _0xb8947b=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3fc44a=_0xb3c239['permissions'];_0xb8947b&&_0xb8947b['isEnabled']&&(_0x3fc44a=_0x3fc44a['filter'](_0x275033=>'document:write'!==_0x275033)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3fc44a,this['_channelId']);}}),_0x44b627['register'](this['_channelId'],_0x4b5890);}['_initThrowingOnDataSet'](){const _0x1d82af=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4ce90c)=>{if(!_0x4ce90c[_0x4ce90c['length']-0x1]['suppressErrorInCollaboration'])throw new _0x14f332('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x1d82af['apply'](this['editor']['data'],_0x4ce90c);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x546852,[_0x1f5aa3])=>{if(this['_document']['version'])throw new _0x14f332('realtimecollaborationclient-init-document-already-initialized',this);_0x546852['stop'](),this['_setPendingAction']();const _0x4bbab8=this['editor']['config']['get']('rootsAttributes'),_0x3efec0=this['_getOperationsFromInitData'](_0x1f5aa3,_0x4bbab8);0x0==_0x3efec0['length']&&_0x3efec0['push'](new _0x89b253(0x0)),_0x546852['return']=this['_connectService'](_0x3efec0)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x30dadc=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x30dadc))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x18fb73,[_0x126199,_0x51beb1])=>{_0x18fb73['stop']();const _0x4732e3=this['editor']['model']['document']['getRoot'](_0x126199);if(!this['_knownRootNames']['has'](_0x126199)){const _0x27b7f1=_0x51beb1&&_0x51beb1['data']?_0x51beb1['data']:'',_0x314604=_0x51beb1&&_0x51beb1['attributes']?_0x51beb1['attributes']:{};await this['_loadRoot'](_0x126199,_0x27b7f1,_0x314604);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x4732e3['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x4732e3);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x2439ec){const _0x73a7a=this['editor']['plugins']['get'](_0x332833),{connection:_0x4c581d}=this['editor']['plugins']['get'](c),_0x42207c=new Set();for(const _0x7baad5 of _0x2439ec){const _0x3fa843=_0x7baad5['_authorId'];_0x3fa843&&!_0x73a7a['getUser'](_0x3fa843)&&_0x42207c['add'](_0x3fa843);}if(0x0===_0x42207c['size'])return;const _0x4f8d82=await dt['getMany'](_0x4c581d,Array['from'](_0x42207c));for(const _0x5e66d3 of _0x4f8d82)_0x73a7a['getUser'](_0x5e66d3['id'])||_0x73a7a['addUser'](_0x5e66d3);}['_getOperationsFromInitData'](_0x182dc8,_0x931ea1={}){const _0x251a58=this['editor']['model'],_0x58bbb8=[];let _0x5e77d1=0x0;const _0x2216c4='string'==typeof _0x182dc8?{'main':_0x182dc8}:_0x182dc8;for(const _0x2bedbf of Object['keys'](_0x2216c4)){if(!this['_document']['roots']['has'](_0x2bedbf))throw new _0x14f332('realtimecollaborationclient-init-non-existent-root',this);const _0x4fcd93=this['editor']['data']['parse'](_0x2216c4[_0x2bedbf]),_0x327d1d=this['_document']['getRoot'](_0x2bedbf),_0x4aec57=new _0x4f5fe0(_0x251a58['createPositionAt'](_0x327d1d,0x0),_0x4fcd93,_0x5e77d1++);_0x58bbb8['push'](_0x4aec57);for(const [_0x2b5e98,_0x110122]of _0x4fcd93['markers']){const _0x473fa4=_0x251a58['createRange'](_0x251a58['createPositionFromPath'](_0x327d1d,_0x110122['start']['path']['slice']()),_0x251a58['createPositionFromPath'](_0x327d1d,_0x110122['end']['path']['slice']())),_0x4c90e2=new _0xe4b5e(_0x2b5e98,null,_0x473fa4,_0x251a58['markers'],!0x0,_0x5e77d1++);_0x58bbb8['push'](_0x4c90e2);}}if(_0x931ea1)for(const [_0x32ce30,_0x472782]of Object['entries'](_0x931ea1)){const _0x5513fa=_0x251a58['document']['getRoot'](_0x32ce30);if(!_0x5513fa)throw new _0x14f332('multi-root-editor-root-attributes-no-root',null);for(const [_0x330946,_0x35c31a]of Object['entries'](_0x472782))if(null!==_0x35c31a){const _0x456a17=new _0xf8480(_0x5513fa,_0x330946,null,_0x35c31a,_0x5e77d1++);_0x58bbb8['push'](_0x456a17);}}return _0x58bbb8;}async['_loadRoot'](_0x3b8ecb,_0x4a9c9a,_0x5ed392){this['_getOperationsFromInitData']({[_0x3b8ecb]:_0x4a9c9a},{[_0x3b8ecb]:_0x5ed392})['forEach']((_0x22d53e,_0x1a5c1d)=>{_0x22d53e['baseVersion']=this['_document']['version']+_0x1a5c1d,_0x22d53e['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x22d53e);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5ded51,_0x44f52b){let _0x7ff4f4;this['_offset']=_0x5ded51['offset'];const _0x339525=_0x5ded51['wereChangesApplied']&&!_0x5ded51['initData'],_0xb4c822=_0x339525?0x0:_0x5ded51['data']['baseVersion'];if(_0x44f52b['forEach'](_0x4a6171=>{_0x4a6171['_isInit']=!0x0,_0x4a6171['createdAt']=_0x5ded51['sessionCreatedAt'],_0x4a6171['_authorId']=null;}),_0x339525)_0x7ff4f4=_0x44f52b,this['_applyOperationsSet'](_0x7ff4f4,_0x339525);else{if(_0x5ded51['initData']){const _0x4e9bc7=this['_getOperationsFromInitData'](_0x5ded51['initData']);this['_document']['history']['version']=-_0x4e9bc7['length'],_0x4e9bc7['forEach'](_0x5ee881=>{_0x5ee881['baseVersion']-=_0x4e9bc7['length'],_0x5ee881['createdAt']=_0x5ded51['sessionCreatedAt'],_0x5ee881['_isInit']=!0x0,_0x5ee881['_authorId']=null;}),this['_applyOperationsSet'](_0x4e9bc7,!0x0),this['serverHistory']['version']=-_0x4e9bc7['length']+this['_offset'],this['_updateServerHistory'](_0x4e9bc7);}this['_document']['history']['version']=_0xb4c822,_0x7ff4f4=this['_decompressOperations'](_0x5ded51['data'],_0x5ded51['metadata']),await this['_fetchMissingUsers'](_0x7ff4f4),this['_applyOperationsSet'](_0x7ff4f4,_0x339525);}_0x5ded51['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x7ff4f4,_0x5ded51['lastOperationId']),this['_lastSyncedOperationId']=_0x5ded51['lastOperationId']),this['serverHistory']['version']=_0xb4c822+this['_offset'],this['_updateServerHistory'](_0x7ff4f4),_0x44f52b['filter'](_0x32513a=>{const _0x548d63=this['_getAffectedRoot'](_0x32513a);return _0x548d63&&!this['_knownRootNames']['has'](_0x548d63);})['forEach']((_0x4a80f4,_0x4665c9)=>{_0x4a80f4['baseVersion']=this['_document']['version']+_0x4665c9,this['_saveOperationInBuffer'](_0x4a80f4);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4d920f,_0xbf6a0e){const _0x2b08d6=_0xbf6a0e&&_0xbf6a0e['message'];if(_0x2b08d6&&_0x2b08d6['startsWith']('realtimecollaborationclient'))throw _0xbf6a0e;const _0x527a99=this['editor']['plugins']['get'](c);throw this['_isPendingUpdate']=!0x0,_0x527a99['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x14f332(_0x4d920f,this['editor'],_0x2b08d6?{'originalError':_0x2b08d6}:void 0x0);}['_saveOperationInBuffer'](_0x28ed8a){this['_knownOperations']['has'](_0x28ed8a)||(this['_knownOperations']['add'](_0x28ed8a),this['_bufferedOperations']['push'](_0x28ed8a),this['_pendingAction']||'marker'==_0x28ed8a['type']&&!_0x28ed8a['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3d82b1=!0x1){!_0x3d82b1&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x485a0a=>{_0x485a0a&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2ce653=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x4790b5){return _0x4790b5['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4790b5['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x4790b5['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2ce653)||this['_crash'](_0x2ce653['message'],_0x2ce653);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x28f425=>{this['on']('change:_isPendingUpdate',()=>{_0x28f425();});});}async['_sendBufferedOperations'](){const _0x5eaf40=this['editor']['plugins']['get'](q);if(this['_shouldSendSelectionUpdate']()&&(_0x5eaf40['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2712df=[...this['_bufferedOperations']];for(const _0x4ec364 of _0x2712df)_0x4ec364['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4ec364);const _0x3f5e29=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2712df),_0x3a0921=J++,_0x27a0d9=this['_compressOperations'](_0x2712df),_0x8ef0ad=await this['_service']['sendOperations'](_0x27a0d9,_0x27a0d9['baseVersion'],_0x3f5e29);try{return await this['_handleServerResponse'](_0x2712df,_0x8ef0ad,_0x3a0921);}catch(_0x4ece35){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4ece35);}}async['_handleServerResponse'](_0x52f1c2,_0x4ec195,_0x2b317b){if('error'in _0x4ec195)throw _0x4ec195['error'];let _0x45849f=!0x1;if(_0x4ec195['wereChangesApplied']){_0x4ec195['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4ec195['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x46222f=>!_0x52f1c2['includes'](_0x46222f));for(const _0x55037e of _0x52f1c2)_0x55037e['createdAt']='lastOperationAcceptedAt'in _0x4ec195&&_0x4ec195['lastOperationAcceptedAt']||void 0x0;X(_0x52f1c2,_0x4ec195['version']-_0x52f1c2['length']),this['_updateServerHistory'](_0x52f1c2);const _0x1aa6cd=_0x52f1c2['filter'](_0x24d7f7=>{if(!_0x24d7f7['_isInit'])return!0x1;const _0x2accfd=this['_getAffectedRoot'](_0x24d7f7);return _0x2accfd&&!this['_knownRootNames']['has'](_0x2accfd);});X(_0x1aa6cd,this['_document']['version']),this['_applyOperationsSet'](_0x1aa6cd),_0x45849f=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x24cba8=this['_decompressOperations'](_0x4ec195['data'],_0x4ec195['metadata'])['filter'](_0x535f92=>_0x535f92['baseVersion']>=this['_lastServerVersion']);_0x24cba8['forEach'](_0x47c964=>this['_addKnownRoot'](_0x47c964)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2a65d2=>!_0x2a65d2['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2a65d2))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x24cba8),_0x45849f=this['_handleExternalOperations'](_0x24cba8,_0x4ec195['version'],_0x4ec195['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x45849f?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x5d80fe,_0x534f8a,_0x11076f){try{const _0x588d1a={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4843a0,operationsB:_0x31c856,originalOperations:_0xd5c3cb}=_0x1daa93(_0x5d80fe,this['_bufferedOperations'],_0x588d1a);X(_0x4843a0,this['_document']['version']),X(_0x31c856,_0x534f8a);for(const _0x3b2f43 of _0x4843a0){const _0x355824=_0xd5c3cb['get'](_0x3b2f43);_0x3b2f43['_authorId']=_0x355824?_0x355824['_authorId']:null;}_0x11076f&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5d80fe,_0x11076f),this['_lastSyncedOperationId']=_0x11076f),this['_bufferedOperations']=[..._0x31c856],this['_applyOperationsSet'](_0x4843a0),this['_updateServerHistory'](_0x5d80fe);}catch(_0x3dd0f3){return console['error'](_0x3dd0f3),!0x1;}return!0x0;}['_applyOperationsSet'](_0x47fe05,_0x47243b=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x224583=>{for(const _0x337aea of _0x47fe05)this['_knownOperations']['add'](_0x337aea),this['_addKnownRoot'](_0x337aea),_0x224583['batch']['addOperation'](_0x337aea),this['editor']['model']['applyOperation'](_0x337aea);});}['_addKnownRoot'](_0x57c83e){const _0x50dcb2=this['_getAffectedRoot'](_0x57c83e);_0x50dcb2&&this['_knownRootNames']['add'](_0x50dcb2);}['_getAffectedRoot'](_0x5645ce){let _0x494ab2,_0x26bff0;switch(_0x5645ce['type']){case'insert':_0x494ab2=_0x5645ce['position']['root'];break;case'marker':if(_0x26bff0=_0x5645ce['newRange'],!_0x26bff0)return null;_0x494ab2=_0x26bff0['root'];break;case'addRootAttribute':_0x494ab2=_0x5645ce['root'];break;case'addRoot':_0x494ab2=_0x5645ce['affectedSelectable'];break;case'move':_0x494ab2=_0x5645ce['targetPosition']['root'];break;default:return null;}return _0x494ab2['rootName'];}['_updateServerHistory'](_0x47ee8b){_0x47ee8b['forEach'](_0x1c229a=>{const _0x571218=_0x1c229a['clone']();_0x571218['_authorId']=_0x1c229a['_authorId'],_0x571218['_isInit']=!!_0x1c229a['_isInit'],_0x571218['createdAt']=_0x1c229a['createdAt'],_0x571218['baseVersion']+=this['_offset'],_0x1c229a['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x571218),this['serverHistory']['addOperation'](_0x571218);});}['_handleReconnectionError'](_0x21921e){const _0x3c8f12=this['editor']['plugins']['get']('Notification'),_0x2bb01c=this['editor']['locale'];_0x21921e||(_0x21921e=G(_0x2bb01c,'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.')),_0x3c8f12['showWarning'](_0x21921e,{'title':G(_0x2bb01c,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x1e1965)['add'](G(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1e1965)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x4e1a4e){const _0x344b3a=_0x4e1a4e['map'](_0x8677fe=>_0x8677fe['toJSON']());return this['_compressor']['compress'](_0x344b3a);}['_decompressOperations'](_0x4672b4,_0x2cde4e){return this['_compressor']['decompress'](_0x4672b4)['map']((_0x13bcce,_0x57490e)=>{const _0x3052f4='init'==_0x2cde4e[_0x57490e]['type'];if('InsertOperation'==_0x13bcce['__className']){const _0x5138f2=_0x13bcce['position']['root'];!this['_document']['getRoot'](_0x5138f2)&&(this['_document']['createRoot']('$root',_0x5138f2)['_isAttached']=!0x1);}const _0x50261c=_0x4d3de2['fromJSON'](_0x13bcce,this['_document']);return _0x50261c['wasUndone']=_0x13bcce['wasUndone'],_0x50261c['_isInit']=_0x3052f4,_0x50261c['_authorId']=_0x3052f4?null:_0x2cde4e[_0x57490e]['userId'],_0x50261c['_isDisconnection']='cs:removeUser'===_0x2cde4e[_0x57490e]['type'],_0x50261c['createdAt']=_0x2cde4e[_0x57490e]['createdAt'],_0x50261c;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x51615a=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x51615a&&_0x51615a['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Q extends Error{}function X(_0x57ddc0,_0x495906){for(const _0x2719b5 of _0x57ddc0)_0x2719b5['baseVersion']=_0x495906++;}class Y{['_ignoredOperations'];['_operationToId'];constructor(_0x408206){this['_ignoredOperations']=_0x408206,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x190d40){let _0x46946b=_0x190d40['length'];for(;_0x46946b--;){const _0x29b9d0=_0x190d40[_0x46946b];if(!this['_ignoredOperations']['has'](_0x29b9d0)){if(!this['_operationToId']['has'](_0x29b9d0)){const _0xf5fa8f=_0x45d855()['slice'](0x1,0x12);this['_operationToId']['set'](_0x29b9d0,_0xf5fa8f);}return this['_operationToId']['get'](_0x29b9d0);}}}['setIdForTheLastOperation'](_0x5d59f6,_0x5d1561){if(!_0x5d1561)return;let _0xbdb1ed=_0x5d59f6['length'];for(;_0xbdb1ed--;){const _0x5e3eb9=_0x5d59f6[_0xbdb1ed];this['_ignoredOperations']['has'](_0x5e3eb9)||this['_operationToId']['set'](_0x5e3eb9,_0x5d1561);}}}class n extends _0x5b53f8{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x1c26de{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x1531aa)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x332833];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x38dcae){super(_0x38dcae),this['_services']=new Map();}async['init'](){const _0x8f0ccc=this['context'],_0x25bc34=_0x8f0ccc['plugins']['get']('CommentsRepository');if(_0x8f0ccc['plugins']['get'](c)['addToReconnectionStack'](this),_0x25bc34['adapter']={'addCommentThread':async({channelId:_0x1c885e,threadId:_0x539ba5,comments:_0xf131e1,resolvedAt:_0x3c5ac2,resolvedBy:_0x566c20,context:_0x2770b5,attributes:_0x179fa5})=>{const _0x159a0b=await this['_getService'](_0x1c885e)['addCommentThread']({'commentThreadId':_0x539ba5,'comments':_0xf131e1['map'](_0x574d8a=>function(_0x5bc6c4,_0x4b457a,_0x232954){return{'commentThreadId':_0x232954,'commentId':_0x5bc6c4['commentId'],'userId':_0x5bc6c4['authorId'],'content':_0x5bc6c4['content'],'documentId':_0x4b457a,'createdAt':_0x5bc6c4['createdAt'],'attributes':_0x5bc6c4['attributes']||{}};}(_0x574d8a,_0x1c885e,_0x539ba5)),'resolvedAt':_0x3c5ac2,'resolvedBy':_0x566c20,'context':_0x2770b5,'attributes':_0x179fa5})['catch'](ut);return{'threadId':_0x159a0b['commentThreadId'],'comments':_0x159a0b['comments']};},'getCommentThread':async({channelId:_0x4ae740,threadId:_0x425aa6})=>{const _0x30fa0b=await this['_getService'](_0x4ae740)['getCommentThread'](_0x425aa6)['catch'](ut);return _0x30fa0b['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x30fa0b]),{'threadId':_0x30fa0b['commentThreadId'],'comments':_0x30fa0b['comments']['map'](_),'context':_0x30fa0b['context'],'resolvedAt':_0x30fa0b['resolvedAt'],'resolvedBy':_0x30fa0b['resolvedBy'],'attributes':_0x30fa0b['attributes']||{}});},'updateCommentThread':async({channelId:_0x30ad59,threadId:_0x2946a4,context:_0x48b51b,unlinkedAt:_0x424492,attributes:_0xd3794e})=>this['_getService'](_0x30ad59)['updateCommentThread']({'commentThreadId':_0x2946a4,'context':_0x48b51b,'attributes':_0xd3794e,'unlinkedAt':_0x424492})['catch'](S)['catch'](ut),'resolveCommentThread':async({channelId:_0x2518ac,threadId:_0x9c9d9})=>{const _0x5ac20b=await this['_getService'](_0x2518ac)['resolveCommentThread'](_0x9c9d9)['catch'](S)['catch'](ut);return{'threadId':_0x5ac20b['commentThreadId'],'resolvedAt':_0x5ac20b['resolvedAt'],'resolvedBy':_0x5ac20b['resolvedBy']};},'reopenCommentThread':async({channelId:_0x2026d8,threadId:_0x37b71c})=>this['_getService'](_0x2026d8)['reopenCommentThread'](_0x37b71c)['catch'](S)['catch'](ut),'removeCommentThread':({channelId:_0x28d5c6,threadId:_0x14a1b3})=>this['_getService'](_0x28d5c6)['removeCommentThread'](_0x14a1b3)['catch'](S)['catch'](ut),'addComment':({channelId:_0x57eb84,threadId:_0x2853db,commentId:_0x382599,content:_0x4caf82,attributes:_0x10f89a})=>this['_getService'](_0x57eb84)['addComment'](_0x2853db,_0x382599,_0x4caf82,_0x10f89a)['catch'](ut),'updateComment':({channelId:_0x27d273,threadId:_0x14da77,commentId:_0x4b99da,content:_0x2ed345,attributes:_0x2fbdad})=>this['_getService'](_0x27d273)['updateComment'](_0x14da77,_0x4b99da,_0x2ed345,_0x2fbdad)['catch'](S)['catch'](ut),'removeComment':({channelId:_0x3791b8,threadId:_0x1d4496,commentId:_0x106edc})=>this['_getService'](_0x3791b8)['removeComment'](_0x1d4496,_0x106edc)['catch'](S)['catch'](ut)},_0x8f0ccc instanceof _0x1ce702){const _0x3dd327=_0x8f0ccc['config']['get']('collaboration.channelId'),_0x23fa0a=_0x8f0ccc['plugins']['get'](i);await this['_setUpService'](_0x3dd327);const _0x9195ca=await this['_services']['get'](_0x3dd327)['getConnectedSessions']();this['listenTo'](_0x23fa0a,'sessionAdd:'+_0x3dd327,(_0x342802,{session:_0x4e2f99})=>{_0x4e2f99['id']===_0x23fa0a['mySessionId']&&(_0x342802['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4e2f99['permissions'],_0x3dd327));}),_0x23fa0a['register'](_0x3dd327,_0x9195ca);}}async['_setUpService'](_0x947900){if(this['_services']['has'](_0x947900))throw new _0x14f332('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x947900});const _0x41f505=this['context']['plugins']['get']('CommentsRepository'),_0x28a23e=new a['CommentsService'](_0x947900);this['_services']['set'](_0x947900,_0x28a23e),this['listenTo'](_0x28a23e,'commentThreadAdded',(_0x2e3ba8,_0x59ce45)=>{const {commentThreadId:_0x2a891a,documentId:_0x47b8b4,context:_0x5664b6,attributes:_0x440a43,resolvedAt:_0x5407dc,resolvedBy:_0x1ffb29,comments:_0x25387c}=_0x59ce45;_0x41f505['getCommentThread'](_0x2a891a)||_0x41f505['addCommentThread']({'threadId':_0x2a891a,'channelId':_0x47b8b4,'comments':_0x25387c?_0x25387c['map'](_):[],'context':_0x5664b6,'attributes':_0x440a43,'resolvedAt':_0x5407dc,'resolvedBy':_0x1ffb29,'isFromAdapter':!0x0});}),this['listenTo'](_0x28a23e,'commentThreadUpdated',(_0x378ec7,{commentThreadId:_0x21a81a,documentId:_0xb2cc39,context:_0x5d3df6,unlinkedAt:_0x37a495,attributes:_0x457496})=>{_0x41f505['getCommentThread'](_0x21a81a)&&_0x41f505['updateCommentThread']({'threadId':_0x21a81a,'channelId':_0xb2cc39,'context':_0x5d3df6,'unlinkedAt':_0x37a495,'attributes':_0x457496,'isFromAdapter':!0x0});}),this['listenTo'](_0x28a23e,'commentThreadResolved',(_0x238971,{commentThreadId:_0x513e06,resolvedBy:_0x4a97cb,resolvedAt:_0xd4be48})=>{const _0x221fc9=_0x41f505['getCommentThread'](_0x513e06);_0x221fc9&&_0x221fc9['resolve']({'resolvedBy':_0x4a97cb,'resolvedAt':_0xd4be48,'isFromAdapter':!0x0});}),this['listenTo'](_0x28a23e,'commentThreadReopened',(_0x3d5def,{commentThreadId:_0x397d50})=>{const _0x3029e8=_0x41f505['getCommentThread'](_0x397d50);_0x3029e8&&_0x3029e8['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x28a23e,'commentThreadRemoved',(_0x1e8274,{commentThreadId:_0x5cccac})=>{const _0x3b5409=_0x41f505['getCommentThread'](_0x5cccac);_0x3b5409&&_0x3b5409['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x28a23e,'commentAdded',(_0x45e84c,_0x1a8c7e)=>{const _0x2b2120=_0x1a8c7e['commentThreadId'],_0xc0fa5e=_0x41f505['getCommentThread'](_0x2b2120);_0xc0fa5e&&_0xc0fa5e['addComment']({..._(_0x1a8c7e),'isFromAdapter':!0x0});}),this['listenTo'](_0x28a23e,'commentUpdated',(_0x50b9ef,{commentThreadId:_0x4e7ec4,commentId:_0x11428e,content:_0x2f31a2,attributes:_0x90c3df})=>{const _0x3bad65=_0x41f505['getCommentThread'](_0x4e7ec4);if(_0x3bad65){const _0xc985e7=_0x3bad65['getComment'](_0x11428e);_0xc985e7&&_0xc985e7['update']({'content':_0x2f31a2,'attributes':_0x90c3df,'isFromAdapter':!0x0});}}),this['listenTo'](_0x28a23e,'commentRemoved',(_0x342a80,{commentThreadId:_0x37978c,commentId:_0x337829})=>{const _0x5b5ff9=_0x41f505['getCommentThread'](_0x37978c);if(_0x5b5ff9){const _0x449df8=_0x5b5ff9['getComment'](_0x337829);_0x449df8&&_0x449df8['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x947900);}['destroy'](){if(this['context']instanceof _0x1ce702){const _0x18abfe=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x18abfe);}}['_terminateService'](_0x36e3da){if(!this['_services']['has'](_0x36e3da))throw new _0x14f332('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x36e3da});this['_getService'](_0x36e3da)['disconnect'](),this['_services']['delete'](_0x36e3da);}async['reconnect'](){for(const _0x10b5f3 of this['_services']['keys']())await this['_connectService'](_0x10b5f3);if(this['context']instanceof _0x1ce702){const _0x5a8e75=this['context']['config']['get']('collaboration.channelId'),_0x471957=this['context']['plugins']['get'](i);_0x471957['unregister'](_0x5a8e75);const _0x253652=await this['_services']['get'](_0x5a8e75)['getConnectedSessions']();_0x471957['register'](_0x5a8e75,_0x253652);}}async['_connectService'](_0x132ef1){const {connection:_0x38a8b9}=this['context']['plugins']['get'](c),_0x1e3bf1=this['context']['plugins']['get']('CommentsRepository'),_0x952713=this['_services']['get'](_0x132ef1),_0x1e0e93=await _0x952713['connect'](_0x38a8b9);await this['_fetchMissingUsersForThreads'](_0x1e0e93);const _0x1d9b7d=new Set(Array['from'](_0x1e3bf1['getCommentThreads']({'channelId':_0x132ef1}),_0x2b5ad0=>_0x2b5ad0['id']));for(const _0x398122 of _0x1e0e93)_0x398122['deletedAt']||_0x1d9b7d['delete'](_0x398122['commentThreadId']);for(const _0x53df91 of _0x1d9b7d)_0x1e3bf1['getCommentThread'](_0x53df91)['remove']({'isFromAdapter':!0x0});for(const _0x2823ec of _0x1e0e93){let _0x4cda9e=_0x1e3bf1['getCommentThread'](_0x2823ec['commentThreadId']);const {commentThreadId:_0x2e7331,context:_0x16f87f,attributes:_0x2b01cd,resolvedBy:_0x5633d9,resolvedAt:_0x275aab,unlinkedAt:_0x3c7d71,deletedAt:_0x5db0b0}=_0x2823ec;if(_0x5db0b0)continue;_0x4cda9e||(_0x4cda9e=_0x1e3bf1['addCommentThread']({'channelId':_0x132ef1,'threadId':_0x2e7331,'context':_0x16f87f,'attributes':_0x2b01cd||{},'resolvedBy':_0x5633d9,'resolvedAt':_0x275aab,'unlinkedAt':_0x3c7d71,'isFromAdapter':!0x0}));const _0x4a8648=new Set(Array['from'](_0x4cda9e['comments'],_0xe66e6e=>_0xe66e6e['id']));for(const _0x4dac3a of _0x2823ec['comments'])_0x4a8648['delete'](_0x4dac3a['commentId']);for(const _0x3aecb8 of _0x4a8648)_0x4cda9e['getComment'](_0x3aecb8)['remove']({'isFromAdapter':!0x0});for(const _0x3fb9f9 of _0x2823ec['comments']){const _0x116387=_0x4cda9e['getComment'](_0x3fb9f9['commentId']);_0x116387?_0x116387['content']!==_0x3fb9f9['content']&&_0x116387['update']({'content':_0x3fb9f9['content'],'isFromAdapter':!0x0}):_0x4cda9e['addComment'](Object['assign'](_(_0x3fb9f9),{'isFromAdapter':!0x0}));}}}['_getService'](_0xe3463e){if(!this['_services']['has'](_0xe3463e))throw new _0x14f332('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xe3463e});return this['_services']['get'](_0xe3463e);}async['_fetchMissingUsersForThreads'](_0x11b446){const _0x48930c=this['context']['plugins']['get'](_0x332833),{connection:_0x88ce81}=this['context']['plugins']['get'](c),_0x5ed07d=new Set();for(const {resolvedBy:_0x2c34d3,comments:_0x5de01e}of _0x11b446){_0x2c34d3&&!_0x48930c['getUser'](_0x2c34d3)&&_0x5ed07d['add'](_0x2c34d3);for(const {userId:_0x2aab4c}of _0x5de01e)_0x48930c['getUser'](_0x2aab4c)||_0x5ed07d['add'](_0x2aab4c);}if(0x0===_0x5ed07d['size'])return;const _0x2a508d=await dt['getMany'](_0x88ce81,Array['from'](_0x5ed07d));for(const _0x3ccb15 of _0x2a508d)_0x48930c['getUser'](_0x3ccb15['id'])||_0x48930c['addUser'](_0x3ccb15);}}async function S(_0xd0d1a5){if('404'!==_0xd0d1a5['code'])throw _0xd0d1a5;}function ut(_0x130fdc){if((_0x2a2b45=_0x130fdc)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2a2b45['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2a2b45['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2a2b45;throw _0x130fdc;}function _(_0x5260c5){return{'threadId':_0x5260c5['commentThreadId'],'commentId':_0x5260c5['commentId'],'content':_0x5260c5['content'],'createdAt':_0x5260c5['createdAt'],'authorId':_0x5260c5['userId'],'attributes':_0x5260c5['attributes']||{}};}class f extends _0x5b53f8{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x159e37){super(_0x159e37);const _0x830c0f=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x830c0f);}['init'](){const _0x3c7368=this['editor']['plugins']['get'](c),_0x563a13=this['editor']['plugins']['get']('TrackChangesEditing');return _0x563a13['adapter']={'getSuggestion':async _0x39e359=>{await this['_waitForServiceReady']();const _0x286a1d=await this['_trackChangesService']['get'](_0x39e359)['catch'](R);return await this['_fetchMissingUsersForThreads']([_0x286a1d]),_0x286a1d;},'addSuggestion':async({id:_0x5238c0,type:_0xcabf1e,data:_0x5bc3a2,originalSuggestionId:_0x7f2e0c,attributes:_0x1a9f71})=>{await this['_waitForServiceReady']();const _0x40a41c={'id':_0x5238c0,'type':_0xcabf1e,'data':_0x5bc3a2,'originalSuggestionId':_0x7f2e0c,'attributes':_0x1a9f71},_0x3bb2d8=await this['_trackChangesService']['add'](_0x5238c0,_0xcabf1e,_0x5bc3a2,_0x7f2e0c,_0x1a9f71)['catch'](_0x515ee6=>{if(ft(_0x515ee6))return new Promise(_0x1f2345=>{this['_bufferedRequests']['set'](_0x5238c0,{'resolve':_0x1f2345,'suggestionData':_0x40a41c});});throw _0x515ee6;});return this['_bufferedRequests']['delete'](_0x5238c0),_0x3bb2d8;},'updateSuggestion':async(_0x386c7a,_0x4c8f42)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4c8f42['state'])return this['_trackChangesService']['update'](_0x386c7a,_0x4c8f42)['catch'](R);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x150b90,_0x51b917)=>{_0x563a13['hasSuggestion'](_0x51b917['id'])&&(_0x563a13['getSuggestion'](_0x51b917['id'])['attributes']=_0x51b917['attributes']);}),this['_trackChangesService']['connect'](_0x3c7368['connection'])['then'](_0x4c719e=>(_0x3c7368['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x4c719e)['then'](()=>{for(const _0x37be29 of _0x4c719e){_0x563a13['addSuggestionData'](_0x37be29)['_saved']=!0x0;}})));}async['reconnect'](){const _0x64076f=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x16ffe3}=this['editor']['plugins']['get'](c),_0x465386=await this['_trackChangesService']['connect'](_0x16ffe3);await this['_fetchMissingUsersForThreads'](_0x465386);for(const {suggestionData:_0x5713ee,resolve:_0x29253f}of this['_bufferedRequests']['values']()){let _0x2964af=_0x465386['find'](_0x299184=>_0x299184['id']===_0x5713ee['id']);_0x2964af||(_0x2964af=await this['_trackChangesService']['add'](_0x5713ee['id'],_0x5713ee['type'],_0x5713ee['data'],_0x5713ee['originalSuggestionId'])),_0x29253f(_0x2964af);}for(const _0x5ed508 of _0x465386)_0x64076f['hasSuggestion'](_0x5ed508['id'])||_0x64076f['addSuggestionData'](_0x5ed508);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x2ab11a=>{this['listenTo'](this['_trackChangesService'],'connected',_0x5e5703=>{_0x5e5703['off'](),_0x2ab11a();});});}async['_fetchMissingUsersForThreads'](_0x1654e5){const _0x3a31e1=this['editor']['plugins']['get'](_0x332833),{connection:_0x234ee1}=this['editor']['plugins']['get'](c),_0x40b943=new Set();for(const {authorId:_0x370f07}of _0x1654e5)_0x3a31e1['getUser'](_0x370f07)||_0x40b943['add'](_0x370f07);if(0x0===_0x40b943['size'])return;const _0x5e69ee=await dt['getMany'](_0x234ee1,Array['from'](_0x40b943));for(const _0x28196d of _0x5e69ee)_0x3a31e1['getUser'](_0x28196d['id'])||_0x3a31e1['addUser'](_0x28196d);}}function R(_0x178d51){if(ft(_0x178d51))return new Promise(()=>{});throw _0x178d51;}function ft(_0x497a31){return _0x497a31['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x497a31['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x5b53f8{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3f7dc0=this['editor']['plugins']['get'](c),_0xb08e87=this['editor']['plugins']['get']('CommentsEditing'),_0x2abb95=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3f7dc0,'change:state',(_0x2c9ffd,_0x2cd7e6,_0x2711a1)=>{_0xb08e87['isThreadsLoadingPaused']='connected'!==_0x2711a1;});}),this['listenTo'](_0x3f7dc0,'change:state',(_0x466933,_0x4fb63b,_0x4513bc)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x4513bc);}),_0x2abb95['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x5b53f8{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x5b53f8{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionHistory',i,_0x332833];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2bc80a){super(_0x2bc80a);const _0x351b59=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x351b59);}async['init'](){const _0x588b1c=this['editor']['plugins']['get'](l),_0x5cb186=_0x588b1c['serverHistory'],_0x1c8899=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x5cb186,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x588b1c['sessionId']});const _0x35e442=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0xc478d5=await tt['isBundleUploaded'](_0x1c8899['connection'],_0x35e442);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1acb0b})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1acb0b)),'updateRevisions':async _0x4ad7a6=>{await this['_waitForServiceReady']();const _0x6e0d49=this['_revisionTracker']['currentRevision'];if(_0xc478d5&&0x1===_0x4ad7a6['length']&&_0x4ad7a6[0x0]['id']===_0x6e0d49['id'])return _0x4ad7a6;for(const _0x1fab41 of _0x4ad7a6)_0x1fab41['id']===_0x6e0d49['id']&&(_0x1fab41['isEmptyCurrent']=_0x1fab41['fromVersion']===_0x1fab41['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x4ad7a6,this['_lastRequestId'])['then'](_0x5eea83=>(this['_lastRequestId']=_0x5eea83,_0x4ad7a6))['catch'](_0x2348f2=>{if(st(_0x2348f2)||'400'===_0x2348f2['code']&&void 0x0!==_0x2348f2['data']['wrongRequestId']){for(const _0x1fcd04 of _0x4ad7a6){!this['_revisionTracker']['repository']['getRevision'](_0x1fcd04['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1fcd04['id'],_0x1fcd04,!0x1);}if(st(_0x2348f2))throw _0x2348f2;return _0x4ad7a6;}throw _0x2348f2;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x581d0f,{revisionsData:_0x3a5f31,requestId:_0x3906d8})=>{Math['max'](..._0x3a5f31['map'](_0x2be219=>_0x2be219['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3a5f31,_0x3906d8);}):this['_handleRevisionsUpdate'](_0x3a5f31,_0x3906d8);});const {revisions:_0x4c49ac,requestId:_0x47d29b}=await this['_revisionHistoryService']['connect'](_0x1c8899['connection']);_0x1c8899['addToReconnectionStack'](this),this['_lastRequestId']=_0x47d29b,await this['_fetchMissingUsers'](_0x4c49ac);for(const _0x1248e5 of _0x4c49ac)this['_revisionTracker']['addRevisionData'](_0x1248e5);this['listenTo'](_0x588b1c,'change:_isConnected',(_0x56dfbf,_0x97d09,_0x124eb4)=>{_0x124eb4&&(this['_oldOffset']=_0x588b1c['_offset'],_0x56dfbf['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x1c8899,'state',_0x3bb771=>_0x3bb771===_0x3021e9['CONNECTED']);}async['reconnect'](){const _0x17abe3=this['editor']['plugins']['get'](c),_0x7a7c0f=this['editor']['plugins']['get'](l),_0x4960b8=async()=>{const _0x5bc9d4=this['_revisionTracker']['currentRevision'],_0x508e38=_0x5bc9d4['id'],_0x2a2672=_0x508e38!==_0x7a7c0f['sessionId'];if(_0x2a2672){const _0x1f4a33=_0x7a7c0f['_offset']-this['_oldOffset'],_0x349165=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x5bc9d4['toVersion']+_0x1f4a33!==_0x349165){const _0x1d0dbc=_0x5bc9d4['fromVersion']+_0x1f4a33,_0x22445c=this['editor']['plugins']['get'](_0x332833),_0x33e051=this['_revisionTracker']['buildRevisionData']({'revision':_0x5bc9d4,'from':_0x1d0dbc,'to':_0x349165});_0x33e051['id']=_0x5bc9d4['id'];const _0x41de32=_0x33e051['authorsIds']['map'](_0x330b5a=>_0x22445c['getUser'](_0x330b5a));_0x5bc9d4['_update']({..._0x33e051,'authors':_0x41de32},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x5bc9d4['id'],_0x33e051,!0x0);}this['_revisionTracker']['_startingVersion']=_0x349165,(_0x5bc9d4['toVersion']===_0x5bc9d4['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x508e38)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x508e38),this['_revisionTracker']['_createCurrentRevision'](_0x349165));}const {revisions:_0x786145,requestId:_0x3faf83}=await this['_revisionHistoryService']['reconnect'](_0x17abe3['connection'],this['_lastRequestId']);_0x2a2672&&_0x786145['length']>0x0?_0x7a7c0f['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x786145),this['_handleRevisionsUpdate'](_0x786145,_0x3faf83),this['_revisionTracker']['sendBufferedUpdates']());};return _0x7a7c0f['_isConnected']?_0x4960b8():new Promise((_0x4ab24f,_0x29fdbb)=>{_0x7a7c0f['once']('change:_isConnected',()=>{_0x4960b8()['then'](_0x4ab24f)['catch'](_0x29fdbb);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x479be8=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x39b7b6=>{_0x39b7b6['off'](),_0x479be8();});});}['_getLatestVersionFromServerOperations'](){const _0x3a2bbf=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2ea0ff of _0x3a2bbf)if('marker'!==_0x2ea0ff['type']||_0x2ea0ff['affectsData'])return _0x2ea0ff['baseVersion']+0x1;}['_getLatestVersion'](){const _0x578ff0=this['editor']['plugins']['get'](l);return new Promise(_0x36435f=>{_0x578ff0['_isPendingUpdate']?_0x578ff0['once']('change:_isPendingUpdate',()=>{_0x36435f(this['_getLatestVersionFromServerOperations']());}):_0x36435f(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x3b67c5,_0xeb7c64){const _0x187056=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xeb7c64;for(const _0x4703da of _0x3b67c5){const _0x1fd642=_0x187056['getRevision'](_0x4703da['id']);if(_0x1fd642){if((_0x4703da['fromVersion']||_0x4703da['toVersion'])&&(_0x4703da['diffData']=null),_0x1fd642===this['_revisionTracker']['currentRevision']){const _0x2002f9=Math['max'](_0x1fd642['toVersion'],_0x4703da['toVersion']),_0x496248=Math['max'](_0x1fd642['fromVersion'],_0x4703da['fromVersion']);let _0x31260d;_0x1fd642['toVersion']===_0x4703da['toVersion']&&_0x1fd642['fromVersion']===_0x4703da['fromVersion']?(_0x31260d=!0x0,this['_preventResendingRevisionData'](_0x4703da)):_0x4703da['toVersion']===_0x2002f9&&_0x4703da['fromVersion']===_0x496248?_0x31260d=!0x1:(_0x1fd642['toVersion']===_0x2002f9&&_0x1fd642['fromVersion']===_0x496248||this['_fixRevision']({'revision':_0x1fd642,'from':_0x496248,'to':_0x2002f9}),_0x31260d=!0x0),_0x31260d&&(delete _0x4703da['fromVersion'],delete _0x4703da['toVersion'],delete _0x4703da['diffData'],delete _0x4703da['createdAt'],delete _0x4703da['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x4703da),this['_preventResendingRevisionData'](_0x4703da);}else this['_revisionTracker']['addRevisionData'](_0x4703da);}const _0x342601=_0x187056['getRevisions']();_0x342601['reverse']();for(let _0x22de28=0x0;_0x22de28<_0x342601['length']-0x1;_0x22de28++){const _0x1f00e7=_0x342601[_0x22de28],_0x3dae26=_0x342601[_0x22de28+0x1];if(_0x1f00e7['fromVersion']<_0x3dae26['toVersion']){const _0x59e6f5=_0x3dae26['toVersion'],_0x36a60d=Math['max'](_0x59e6f5,_0x1f00e7['toVersion']);this['_fixRevision']({'revision':_0x1f00e7,'from':_0x59e6f5,'to':_0x36a60d});}}}['_fixRevision']({revision:_0x7463e1,from:_0x24e1af,to:_0x24dc37}={}){const _0x10cbc1=this['editor']['plugins']['get'](_0x332833),_0x43d48c=this['_revisionTracker']['buildRevisionData']({'revision':_0x7463e1,'from':_0x24e1af,'to':_0x24dc37});_0x43d48c['authors']=_0x43d48c['authorsIds']['map'](_0x1d095c=>_0x10cbc1['getUser'](_0x1d095c)),_0x7463e1['_update'](_0x43d48c);}['_preventResendingRevisionData'](_0x4648f6){const _0x47a1b3={};_0x47a1b3['id']=_0x4648f6['id'];for(const _0x5e2996 of Object['keys'](_0x4648f6))'id'!==_0x5e2996&&(_0x47a1b3[_0x5e2996]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x47a1b3['id'],_0x47a1b3,!0x0);}async['_fetchMissingUsers'](_0x38a40f){const _0xed04b8=this['editor']['plugins']['get'](_0x332833),{connection:_0x3ddadc}=this['editor']['plugins']['get'](c),_0x3b417c=new Set();for(const _0x18bf46 of _0x38a40f){for(const _0x4e51f0 of _0x18bf46['authorsIds'])_0x1e6357(_0x4e51f0);_0x18bf46['creatorId']&&_0x1e6357(_0x18bf46['creatorId']);}if(0x0===_0x3b417c['size'])return;const _0x31f581=await dt['getMany'](_0x3ddadc,Array['from'](_0x3b417c));for(const _0x5ea263 of _0x31f581)_0xed04b8['getUser'](_0x5ea263['id'])||_0xed04b8['addUser'](_0x5ea263);function _0x1e6357(_0x272256){_0xed04b8['getUser'](_0x272256)||_0x3b417c['add'](_0x272256);}}}function st(_0x8d54fa){return _0x8d54fa['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x8d54fa['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x8d54fa['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x5b53f8{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class A extends _0x29d60d{['_collapseAt'];constructor(_0x24abea,_0xe2463c=0x6){super(_0x24abea);const _0xb2f1e6=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0xe2463c,this['bind']('isHidden')['to'](this,'usersCount',_0xf40171=>_0xf40171<_0xe2463c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0xb2f1e6['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':_0xb2f1e6['to']('usersCount',_0x197a18=>'+'+(_0x197a18-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class ts extends _0x29d60d{['items'];['keystrokes'];constructor(_0x44e30b){super(_0x44e30b);const _0x1a26a1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2acc1a(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1a26a1['if']('hasPopup'),'aria-expanded':_0x1a26a1['to']('isExpanded',_0x44d9fd=>this['hasPopup']&&String(_0x44d9fd)),'aria-label':_0x1a26a1['to']('hasPopup',_0x2e1873=>G(_0x44e30b,_0x2e1873?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1a26a1['to']('hasPopup',_0x135e99=>!!_0x135e99&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x1a26a1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x1a26a1['to'](_0x4794bc=>{const _0x48be50=_0x4794bc,_0x563348=document['querySelector']('.ck-presence-list__dropdown-list'),_0x401f14=document['querySelector']('.ck-balloon-panel_with-arrow');_0x563348?.['contains'](_0x48be50['relatedTarget'])||_0x401f14?.['contains'](_0x48be50['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x7614ce,_0x3dd447,_0x24ec62)=>{this['element']&&(_0x24ec62?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class j extends _0x29d60d{['counterView'];['inlineListView'];constructor(_0x3bd730,_0x277b03=0x6){super(_0x3bd730);const _0x4849eb=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new A(this['locale'],_0x277b03),this['inlineListView']=new ts(_0x3bd730),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x21d4ed of this['inlineListView']['items'])_0x21d4ed['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',_0x4849eb['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class x extends _0x29d60d{['listWrapperView'];constructor(_0x47f236,_0x44b25e){super(_0x47f236);const _0x1cebe0=this['bindTemplate'];this['listWrapperView']=new mt(_0x47f236,_0x44b25e),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':G(_0x47f236,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x1cebe0['to'](_0x26ce9e=>{const _0x4dd65f=_0x26ce9e,_0x25ffbc=document['querySelector']('.ck-presence-list__list'),_0xe9f6c4=document['querySelector']('.ck-balloon-panel_with-arrow');_0x25ffbc?.['contains'](_0x4dd65f['relatedTarget'])||_0xe9f6c4?.['contains'](_0x4dd65f['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class mt extends _0x30d786{constructor(_0x3cd53b,_0x352f1f){super(_0x3cd53b);const _0xa6e307=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x352f1f?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0xa6e307['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0xa6e307['to']('role'),'aria-label':_0xa6e307['to']('ariaLabel'),'aria-labelledby':_0xa6e307['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x1faad8['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x296c2b=this['element'];_0x296c2b&&(this['_isScrollable']=Math['max'](_0x296c2b['scrollHeight'],_0x296c2b['clientHeight'])>0.8*window['innerHeight']);}}class k extends rt{['userView'];constructor(_0x595ae1,_0x109363,_0x1887da){super(_0x595ae1);const _0x36b610=this['bindTemplate'];this['userView']=new ct(_0x595ae1,_0x109363);const _0x1e43e1={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x109363['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x109363['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x109363['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x1887da&&(_0x1e43e1['tag']='button',_0x1e43e1['on']={'click':_0x36b610['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x1e43e1);}['focus'](){this['element']['focus']();}}class y extends _0x29d60d{['userView'];['markerView'];constructor(_0x2a9a71,_0x26c550,_0x23eab6){super(_0x2a9a71);const _0x1e374c=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x2a9a71,_0x26c550),this['markerView']=new at(_0x2a9a71,_0x26c550);const _0x2e829e=new ot(_0x2a9a71);_0x2e829e['template']['tag']='span',_0x2e829e['text']=_0x26c550['name'];const _0x40a2ab={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1e374c['to']('isFocusable',_0x14bd52=>!!_0x14bd52&&0x0),'aria-labelledby':_0x2e829e['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1e374c['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1e374c['to']('hasTooltip',_0x7a04c0=>!_0x7a04c0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2e829e]};_0x23eab6&&(_0x40a2ab['tag']='button',_0x40a2ab['on']={'click':_0x1e374c['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x40a2ab);}}class at extends _0x29d60d{constructor(_0x1c3f28,_0x4d521f){super(_0x1c3f28),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4d521f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const C={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x1c26de{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x49179a){super(_0x49179a),this['context']['config']['define']('presenceList',C);const _0x4ff902=_0x49179a['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4ff902)throw new _0x14f332('presencelist-collapseat-invalid-format',this);if(_0x4ff902<0x1)throw new _0x14f332('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x357f48(),this['balloonPanelView']=new _0x1d776a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x45859d of this['_allConnectedUsers'])this['_handleUserAdd'](_0x45859d);this['listenTo'](this['_allConnectedUsers'],'add',(_0x273882,_0x31782d)=>{this['_handleUserAdd'](_0x31782d);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x490551,_0xde15da)=>{this['_handleUserRemove'](_0xde15da);});}['_createView'](){const _0x413299=this['context'],_0x538082=new j(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x150f3e=this['balloonPanelView'];if(!_0x165a7f(_0x413299['config']['get']('presenceList.container')))throw new _0x14f332('presencelist-missing-container',this);return _0x538082['counterView']['bind']('usersCount')['to'](this),_0x538082['bind']('isCollapsed')['to'](this,'usersCount',_0x113056=>{const {collapseAt:_0x3b57ff}=_0x413299['config']['get']('presenceList'),_0x3c9989=_0x113056>=_0x3b57ff;if(_0x3c9989&&!_0x538082['inlineListView']['items']['find'](_0x1c5e3f=>_0x1c5e3f instanceof A)){const _0x141df1=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x141df1&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x538082['inlineListView']['items']['add'](_0x538082['counterView']);}return _0x3c9989||this['hideDropdown'](),_0x3c9989;}),_0x538082['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1bc80b=>{const _0x4f1305=_0x413299['config']['get']('presenceList'),_0x20b8ce=new y(_0x413299['locale'],_0x1bc80b,!!_0x4f1305['onClick']);return _0x20b8ce['bind']('hasTooltip')['to'](_0x538082,'isCollapsed',_0x59dd1e=>!_0x59dd1e),_0x20b8ce['bind']('isFocusable')['to'](_0x538082,'isCollapsed',_0x1e09fa=>!_0x1e09fa),_0x4f1305['onClick']&&this['listenTo'](_0x20b8ce,'execute',()=>{this['view']['isCollapsed']||_0x4f1305['onClick'](_0x1bc80b,_0x20b8ce['element']);}),_0x20b8ce;}),this['listenTo'](_0x538082['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x538082['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x538082['inlineListView']['keystrokes']['set']('Enter',(_0x42e125,_0xd46a17)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0xd46a17());}),_0x538082['render'](),_0x150f3e['render'](),_0x2fa8e1({'emitter':_0x538082,'activator':()=>_0x150f3e['isVisible'],'contextElements':[_0x150f3e['element'],_0x538082['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x413299['config']['get']('presenceList.container')['appendChild'](_0x538082['element']),this['_bodyCollection']=new _0x55757f(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x538082;}['_handleUserAdd'](_0x3c14c2){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3c14c2['isMe'])return;const _0x4d7a33=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x4d7a33-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x378470=_0x3c14c2['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3c14c2,_0x378470);}['_handleUserRemove'](_0x5a2d84){this['usersCount']--;const {collapseAt:_0x5cdf08}=this['context']['config']['get']('presenceList'),_0x2b5474=this['usersCount']>=_0x5cdf08;if(this['currentDisplayedUsers']['get'](_0x5a2d84['id']))this['currentDisplayedUsers']['remove'](_0x5a2d84['id']);else{if(_0x2b5474&&this['currentDisplayedUsers']['length']+0x1===_0x5cdf08-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x2b5474?0x1:0x0)<this['usersCount']){for(const _0x4e9b43 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4e9b43['id'])&&(this['currentDisplayedUsers']['add'](_0x4e9b43,Math['min'](this['currentDisplayedUsers']['length']-(_0x2b5474?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x2b5474?0x1:0x0)===_0x5cdf08-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1321b1=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new x(this['context']['locale'],!!_0x1321b1['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1e1cfe}=this['presenceDropdownView'];_0x1e1cfe['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4b1ec3=>{if(!_0x1321b1['displayMe']&&_0x4b1ec3['isMe'])return null;const _0x59bea5=new k(this['context']['locale'],_0x4b1ec3,!!_0x1321b1['onClick']);return _0x1321b1['onClick']&&this['listenTo'](_0x59bea5,'execute',()=>{_0x1321b1['onClick'](_0x4b1ec3,_0x59bea5['element']);}),_0x59bea5;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1e1cfe['focus'](),_0x1e1cfe['checkIfScrollable']();const _0x10e590=(_0x52ff41,_0x2c662c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2c662c();};_0x1e1cfe['keystrokes']['set']('Esc',_0x10e590),_0x1e1cfe['keystrokes']['set']('Shift+Tab',_0x10e590),_0x1e1cfe['keystrokes']['set']('Tab',(_0x1c830f,_0x24d38b)=>{!function(_0x5f1ca5){const _0x2337ec=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x215b75=>_0x215b75+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x578f00=[...document['body']['querySelectorAll'](_0x2337ec)]['filter'](_0x57d57f=>_0x57d57f===document['activeElement']||_0x57d57f['offsetWidth']+_0x57d57f['offsetHeight']>0x0)['sort']((_0x2e198d,_0x2c7060)=>(_0x2e198d['tabIndex']||0x0)-(_0x2c7060['tabIndex']||0x0)),_0x4ff3f1=_0x578f00['indexOf'](_0x5f1ca5),_0x50af27=_0x578f00[(_0x4ff3f1+0x1)%_0x578f00['length']];_0x50af27&&_0x50af27['focus']();}(this['view']['element']),this['hideDropdown'](),_0x24d38b();}),_0x1e1cfe['focusTracker']['add'](this['view']['element']),_0x1e1cfe['focusTracker']['on']('change:isFocused',(_0x2d5b43,_0x1af097,_0x285a98)=>{_0x285a98||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x1c26de{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges,i as Sessions};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x3aaaac=>0x1!=_0x3aaaac}};
|