@ckeditor/ckeditor5-real-time-collaboration 46.1.0-alpha.0 → 46.1.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/real-time-collaboration.js +2 -2
- package/dist/index.js +6 -6
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +14 -14
- package/src/common-translations.js +1 -1
- package/src/index.js +1 -1
- package/src/presencelist/presencelistui.js +1 -1
- package/src/presencelist/view/presencecounterview.js +1 -1
- package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
- package/src/presencelist/view/presencedropdownlistview.js +1 -1
- package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
- package/src/presencelist/view/presenceinlinelistview.js +1 -1
- package/src/presencelist/view/presencelistview.js +1 -1
- package/src/presencelist.js +1 -1
- package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
- package/src/realtimecollaborativecomments.js +1 -1
- package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
- package/src/realtimecollaborativeediting/sessions.js +1 -1
- package/src/realtimecollaborativeediting/usermarkers.js +1 -1
- package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
- package/src/realtimecollaborativeediting.js +1 -1
- package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
- package/src/realtimecollaborativerevisionhistory.js +1 -1
- package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
- package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{ContextPlugin as
|
|
24
|
-
((()=>dt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x52c10d];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3255b5){super(_0x3255b5),this['set']('state',_0x176d8f['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x22bbd9())();}['init'](){const _0x549a10=this['context'],_0xc09891=_0x549a10['plugins']['get']('CloudServices'),_0x26c11f=_0x549a10['plugins']['get'](_0x52c10d);if(!_0xc09891['token'])throw new _0x593b20('websocketgateway-missing-token',this);if(!_0xc09891['webSocketUrl'])throw new _0x593b20('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0xc09891['token'],_0xc09891['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x459f6e=>{if(this['connection']=_0x459f6e,this['bind']('state')['to'](_0x459f6e,'state',this,'_isBrowserOffline',(_0x431c95,_0x2c13ec)=>('connected'!==_0x431c95&&(this['_shouldPluginsReconnect']=!0x0),_0x2c13ec||_0x431c95!==_0x176d8f['CONNECTED']?_0x176d8f['DISCONNECTED']:this['state']==_0x176d8f['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x176d8f['CONNECTING']):_0x176d8f['CONNECTED'])),this['connection']['on']('error',(_0x5797e2,_0x37d29a)=>{if('limitExceeded'!==_0x37d29a['code'])throw console['error'](_0x37d29a),new _0x593b20('cloudservices-init',null,{'originalError':_0x37d29a});_0x26c11f['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'});}),!_0x459f6e['me'])return new Promise(_0x4c7b34=>_0x459f6e['on']('change:me',_0x4c7b34));})['catch'](_0x2ce3f4=>{throw console['error'](_0x2ce3f4),new _0x593b20('cloudservices-init',null,{'originalError':_0x2ce3f4});});}['addToReconnectionStack'](_0x3589a0){if('function'!=typeof _0x3589a0['reconnect'])throw new _0x593b20('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3589a0))throw new _0x593b20('websocketgateway-plugin-already-registered',this,{'name':_0x3589a0['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3589a0);}['removeFromReconnectionStack'](_0xd3eaab){this['_reconnectionStack']['delete'](_0xd3eaab);}['isInReconnectionStack'](_0x393728){return this['_reconnectionStack']['has'](_0x393728);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1dac8f=>_0x1dac8f['reconnect']())))['then'](()=>this['state']=_0x176d8f['CONNECTED'])['catch'](_0xeaaf39=>{throw console['error'](_0xeaaf39),new _0x593b20('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x176d8f['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x3214d6{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x501a96];}constructor(_0x54a4da){super(_0x54a4da),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1216b9(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x501a96);}['init'](){const _0x532808=this['context']['plugins']['get'](n);this['listenTo'](_0x532808,'change:state',(_0x1fa83d,_0x518dff,_0x1f8801)=>{if('connected'!==_0x1f8801)this['channelSessions']['forEach'](_0x2acdbc=>_0x2acdbc['clear']()),this['channelConnectedUsers']['forEach'](_0x5d0205=>_0x5d0205['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0xa51b2e,_0x4bc88e]of this['_registeredSessions'])for(const _0x179e47 of _0x4bc88e)this['_handleSessionAdd'](_0xa51b2e,_0x179e47);}}),this['_createUser'](_0x532808['connection']['me'],!0x0);}['register'](_0x3ed1ae,_0x354d8b){if(this['_registeredSessions']['has'](_0x3ed1ae))throw new _0x593b20('sessions-register-already-registered',null,{'channelId':_0x3ed1ae});this['_registeredSessions']['set'](_0x3ed1ae,_0x354d8b),this['channelSessions']['set'](_0x3ed1ae,new _0x1216b9()),this['channelConnectedUsers']['set'](_0x3ed1ae,new _0x1216b9()),this['listenTo'](_0x354d8b,'add',(_0x12cb16,_0x25acf8)=>this['_handleSessionAdd'](_0x3ed1ae,_0x25acf8)),this['listenTo'](_0x354d8b,'remove',(_0x3bb62f,_0x3add5b)=>this['_handleSessionRemove'](_0x3ed1ae,_0x3add5b));for(const _0x3f6d18 of _0x354d8b)this['_handleSessionAdd'](_0x3ed1ae,_0x3f6d18);}['unregister'](_0x32bd7c){if(!this['_registeredSessions']['has'](_0x32bd7c))throw new _0x593b20('sessions-unregister-not-exist',null,{'channelId':_0x32bd7c});const _0x9f8e5e=this['_registeredSessions']['get'](_0x32bd7c);this['stopListening'](_0x9f8e5e);for(const _0x34f8f3 of _0x9f8e5e)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x32bd7c,_0x34f8f3);this['_registeredSessions']['delete'](_0x32bd7c),this['channelSessions']['delete'](_0x32bd7c),this['channelConnectedUsers']['delete'](_0x32bd7c);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x375c98){for(const _0x8122b0 of this['channelSessions']['values']())for(const _0x3d42e9 of _0x8122b0)if(_0x3d42e9['id']===_0x375c98)return _0x3d42e9['user'];}['getUserSessions'](_0x357a83,_0x39606c){const _0xde745d=_0x39606c?[this['channelSessions']['get'](_0x39606c)]:this['channelSessions']['values'](),_0x4bf293=new Set();for(const _0x163d74 of _0xde745d)for(const _0x500ddc of _0x163d74)_0x500ddc['user']['id']===_0x357a83['id']&&_0x4bf293['add'](_0x500ddc['id']);return _0x4bf293;}['getUserRole'](_0x404379){for(const _0x2e830e of this['channelSessions']['values']())for(const _0xd5096e of _0x2e830e)if(_0xd5096e['user']===_0x404379)return _0xd5096e['role'];}['_handleSessionAdd'](_0x1ac0b7,_0x325034){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x2dd61c=_0x325034['user'],_0x273890=this['_users']['getUser'](_0x2dd61c['id'])||this['_createUser'](_0x2dd61c),_0x5ace37=Object['assign']({},_0x325034,{'user':_0x273890});if(this['channelSessions']['get'](_0x1ac0b7)['add'](_0x5ace37),!_0x2dd61c['hiddenInPresenceList']){const _0x133868=this['channelConnectedUsers']['get'](_0x1ac0b7);_0x133868['has'](_0x273890['id'])||_0x133868['add'](_0x273890),this['allConnectedUsers']['has'](_0x273890['id'])||_0x2dd61c['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x273890,_0x273890['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x1ac0b7,{'channelId':_0x1ac0b7,'session':_0x5ace37});}['_handleSessionRemove'](_0x38cc0b,_0xfb59c){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x522d5a=this['channelConnectedUsers']['get'](_0x38cc0b),_0x1ec2e1=_0xfb59c['user'];_0x1ec2e1['id']&&(this['channelSessions']['get'](_0x38cc0b)['remove'](_0xfb59c['id']),_0x522d5a['has'](_0x1ec2e1['id'])&&!this['getUserSessions'](_0x1ec2e1,_0x38cc0b)['size']&&_0x522d5a['remove'](_0x1ec2e1['id']),this['allConnectedUsers']['get'](_0x1ec2e1['id'])&&!this['getUserSessions'](_0x1ec2e1)['size']&&this['allConnectedUsers']['remove'](_0x1ec2e1['id']));}['_createUser'](_0x59a3f7,_0x5cef01){const _0x10e3ac=this['_users']['addUser'](_0x59a3f7);return _0x5cef01&&this['_users']['defineMe'](_0x59a3f7['id']),_0x10e3ac['orderNumber']=this['_uniqueUsersCount']++,_0x10e3ac;}}class H extends _0x1bf704{['_domEmitter']=new(_0x22bbd9())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3128fa=this['editor'],_0x4cf648=_0x3128fa['plugins']['get'](i);_0x3128fa['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x28d12c,{writer:_0x35213b})=>function(_0x4c190c,_0x56c4e0,_0x3b7f96,_0x4ef110){const _0x314599=_0x4c190c['markerName']['split'](':')[0x2],_0x392a7e=_0x3b7f96['getUserBySessionId'](_0x314599);if(!_0x392a7e||_0x314599===_0x3b7f96['mySessionId'])return;if(!_0x4ef110['model']['schema']['checkChild'](_0x4c190c['markerRange']['start'],'$text'))return;const _0x1dc4a2={'class':'ck-user__marker\x20'+_0x392a7e['color']['getMarkerClass'](),'data-name':_0x392a7e['name'],'data-session-id':_0x314599},_0x448d13=_0x4ef110['model']['markers']['get'](_0x4c190c['markerName']),_0x4eabcb=_0x448d13['getStart'](),_0x4bc9dd=_0x4eabcb['nodeAfter'],_0x327891=_0x4ef110['model']['schema'];if(_0x4bc9dd&&_0x327891['isObject'](_0x4bc9dd)&&_0x327891['isInline'](_0x4bc9dd)&&!_0x4ef110['model']['markers']['get']('user:range:'+_0x314599)['getRange']()['isCollapsed'])return;const _0x326257=_0x4eabcb['parent'];return _0x4ef110['model']['schema']['isLimit'](_0x326257)&&!_0x4ef110['model']['hasContent'](_0x326257)&&(_0x1dc4a2['contenteditable']=!0x1),function(_0x5325a4,_0x586cc1,_0x459b34){const _0x233b66=_0x5325a4['createUIElement']('span',_0x586cc1);return _0x5325a4['setCustomProperty']('userPositionMarker',!0x0,_0x233b66),_0x233b66['render']=function(_0x3a871){const _0x226f42=this['toDomElement'](_0x3a871),_0x203f7f=document['createElement']('span');return _0x203f7f['classList']['add']('ck-user__marker-tooltip'),_0x203f7f['setAttribute']('contenteditable','false'),_0x203f7f['setAttribute']('spellcheck','false'),_0x203f7f['textContent']=_0x459b34['name'],_0x226f42['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x203f7f['outerHTML']+'',_0x226f42['addEventListener']('mouseenter',()=>{_0x226f42['classList']['add']('ck-user__marker_hovered');}),_0x226f42['addEventListener']('mouseleave',()=>{_0x226f42['classList']['remove']('ck-user__marker_hovered');}),_0x226f42;},_0x233b66['isSimilar']=function(_0x338f40){return!(!this['getCustomProperty']('userPositionMarker')||!_0x338f40['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x338f40['getAttribute']('data-session-id'));},_0x233b66;}(_0x56c4e0,_0x1dc4a2,_0x392a7e);}(_0x28d12c,_0x35213b,_0x4cf648,_0x3128fa)}),_0x3128fa['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x262eb3=>function(_0x1d5059,_0x20cd92){const _0x273bc0=_0x1d5059['markerName']['split'](':')[0x2];if(_0x273bc0===_0x20cd92['mySessionId'])return null;const _0x4d5df4=_0x20cd92['getUserBySessionId'](_0x273bc0);if(!_0x4d5df4)return{'id':_0x273bc0,'classes':[]};return{'id':_0x273bc0,'classes':['ck-user__selection',_0x4d5df4['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x273bc0},'priority':0x7d0+_0x4d5df4['orderNumber']};}(_0x262eb3,_0x4cf648)}),function(_0x26cf45){const _0x5a4b4c=_0x26cf45['model'],_0x2f9abe=new Map(),_0x1dc6e2=_0x26cf45['plugins']['get'](i);_0x5a4b4c['markers']['on']('update:user:range',(_0xa87f42,_0x13cac5,_0x22420c,_0x1a2b82)=>{if(!_0x1a2b82&&_0x2f9abe['get'](_0x13cac5['name']))return _0x2f9abe['get'](_0x13cac5['name'])['detach'](),void _0x2f9abe['delete'](_0x13cac5['name']);const _0x19151e=_0x13cac5['name']['split'](':')[0x2];if(_0x19151e===_0x1dc6e2['mySessionId'])return;const _0x1611f0='user:position:'+_0x19151e;_0x5a4b4c['markers']['has'](_0x1611f0)&&_0x26cf45['editing']['reconvertMarker'](_0x1611f0),_0x13cac5['on']('change:range',(_0x1ac616,_0x169671,_0x1f2e09)=>{if('$graveyard'!=_0x169671['root']['rootName']&&'$graveyard'==_0x13cac5['getRange']()['root']['rootName']&&!_0x2f9abe['has'](_0x13cac5['name'])){const _0xbba6f9=_0x5a4b4c['schema']['getNearestSelectionRange'](_0x1f2e09['deletionPosition']);if(_0xbba6f9){const _0x1cb3a7=_0x14d445['fromRange'](_0xbba6f9);_0x2f9abe['set'](_0x13cac5['name'],_0x1cb3a7),_0x1cb3a7['on']('change:range',(_0x10d845,_0x49b25d,_0x1ff78c)=>{if('$graveyard'==_0x1cb3a7['root']['rootName']){const _0x4cad70=_0x5a4b4c['schema']['getNearestSelectionRange'](_0x1ff78c['deletionPosition']);_0x4cad70?(_0x1cb3a7['start']=_0x4cad70['start'],_0x1cb3a7['end']=_0x4cad70['end']):(_0x2f9abe['delete'](_0x13cac5['name']),_0x1cb3a7['detach']());}});}}});}),_0x5a4b4c['document']['on']('change',()=>{_0x2f9abe['size']>0x0&&_0x5a4b4c['enqueueChange']({'isUndoable':!0x1},_0x1df919=>{for(const [_0x56776e,_0x46a50b]of _0x2f9abe)'$graveyard'==_0x5a4b4c['markers']['get'](_0x56776e)['getRange']()['root']['rootName']&&(Y(_0x56776e['split'](':')[0x2],_0x46a50b['toRange'](),_0x5a4b4c,_0x1df919),_0x46a50b['detach']());_0x2f9abe['clear']();});});}(_0x3128fa),this['_domEmitter']['listenTo'](_0xfff1fd['document'],'keydown',(_0x1e3df2,{key:_0x38e8bc})=>{'Escape'===_0x38e8bc&&function(_0x5612bb){_0x5612bb['editing']['view']['change'](_0x2c333a=>{for(const _0x56e5ba of _0x5612bb['model']['markers']){if(!_0x56e5ba['name']['startsWith']('user:position'))continue;const _0x586cff=_0x5612bb['editing']['mapper']['markerNameToElements'](_0x56e5ba['name']);if(_0x586cff){for(const _0x28dab3 of _0x586cff)_0x2c333a['removeClass']('ck-user__marker_hovered',_0x28dab3);}}});}(_0x3128fa);},{'useCapture':!0x0});}['afterInit'](){const _0x19cb04=this['editor'],_0x3da693=_0x19cb04['commands']['get']('undo');_0x3da693&&_0x19cb04['model']['on']('applyOperation',(_0x5130d1,_0x1cbcc7)=>{const _0x33a099=_0x1cbcc7[0x0];if(!_0x33a099['isDocumentOperation'])return;if('marker'!=_0x33a099['type']||!_0x33a099['name']['startsWith']('user:'))return;const _0x198e01=_0x33a099['batch'];_0x3da693['_createdBatches']['has'](_0x198e01)&&(_0x33a099['newRange']=_0x33a099['oldRange']?_0x19cb04['model']['createRange'](_0x33a099['oldRange']['start'],_0x33a099['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x40b6d5=this['editor'],_0xc72212=_0x40b6d5['model']['document'],_0x274680=_0x40b6d5['plugins']['get'](i);_0x40b6d5['model']['enqueueChange']({'isUndoable':!0x1},_0x3571ec=>{const _0x55198b='user:range:'+_0x274680['mySessionId'],_0x499380='user:position:'+_0x274680['mySessionId'],_0x1b8ddf=_0x40b6d5['model']['markers']['has'](_0x55198b);_0x40b6d5['editing']['view']['hasDomSelection']?Y(_0x274680['mySessionId'],_0xc72212['selection']['getFirstRange'](),_0x40b6d5['model'],_0x3571ec):_0x1b8ddf&&(_0x3571ec['removeMarker'](_0x55198b),_0x3571ec['removeMarker'](_0x499380));});}}function Y(_0x59befc,_0x2c6733,_0x3d5d9a,_0x597073){const _0x4a2007='user:range:'+_0x59befc,_0x335def='user:position:'+_0x59befc,_0x15a3b2=_0x2c6733['getContainedElement']();let _0x552a96=_0x2c6733['start'];if(_0x15a3b2&&_0x15a3b2['is']('element','tableCell')){const _0x2613d9=function(_0x5213ab,_0x6319a){for(const _0x375211 of _0x5213ab['getPositions']())if(_0x6319a['schema']['checkChild'](_0x375211,'$text'))return _0x375211;}(_0x2c6733,_0x3d5d9a);_0x2613d9&&(_0x552a96=_0x2613d9,_0x2c6733=_0x597073['createRange'](_0x552a96));}const _0x8b8068=_0x597073['createRange'](_0x552a96);_0x3d5d9a['markers']['has'](_0x4a2007)?(_0x597073['updateMarker'](_0x4a2007,{'range':_0x2c6733}),_0x597073['updateMarker'](_0x335def,{'range':_0x8b8068})):(_0x597073['addMarker'](_0x4a2007,{'range':_0x2c6733,'usingOperation':!0x0}),_0x597073['addMarker'](_0x335def,{'range':_0x8b8068,'usingOperation':!0x0}));}function V(_0x499ab5,_0x3832a4,_0x3a0a6d){const _0x63360c=_0x499ab5['t'],t=_0x499ab5['t'];switch(_0x3832a4){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 _0x63360c({'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'},_0x3a0a6d);default:return'';}}let q=0x1;class l extends _0x1bf704{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
-
((()=>_0x4eb68d)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,H,_0x4a177a,_0x501a96,_0x52c10d];}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 _0xc9d26c=this['serverHistory']['getOperations']();for(let _0x47d351=_0xc9d26c['length']-0x1;_0x47d351>=0x0;_0x47d351--){const _0x44fec7=_0xc9d26c[_0x47d351];if(!this['_disconnectionOperations']['has'](_0x44fec7))return _0x44fec7['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x531fc4){if(super(_0x531fc4),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x2339bd(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x593b20('collaboration-missing-channelid',this);const _0x574fa7=_0x531fc4['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x574fa7,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x217b10(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new K(this['_disconnectionOperations']);}['init'](){const _0x187df0=this['editor'],_0x2b1413=_0x187df0['plugins']['get'](_0x501a96),_0x4b6e80=_0x187df0['plugins']['get'](n);this['listenTo'](_0x2b1413,'getOperationAuthor',(_0x10b608,_0x39b0ac)=>{const _0x54595e=_0x39b0ac[0x0];_0x54595e['_authorId']&&(_0x10b608['return']=_0x2b1413['getUser'](_0x54595e['_authorId']),_0x10b608['stop']()),null===_0x54595e['_authorId']&&(_0x10b608['return']=null,_0x10b608['stop']());},{'priority':'high'}),this['listenTo'](_0x187df0['model']['document']['selection'],'change:range',(_0x519b69,_0xa9a260)=>{_0xa9a260['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x187df0['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x187df0['model']['on']('applyOperation',(_0x366165,_0x184e15)=>{const _0x321369=_0x184e15[0x0];_0x321369['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x321369),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x4b6e80,'state',this,'_hasSynchronizationProblem',(_0x175eae,_0x929ea2)=>'connected'===_0x175eae&&!_0x929ea2),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x187df0['disableReadOnlyMode']('rtc-offline'):_0x187df0['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x187df0['disableReadOnlyMode']('rtc-offline'):_0x187df0['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x28d772=this['editor']['plugins']['get'](i),_0x3484f5=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x28d772['unregister'](this['_channelId']);const _0x3d09d9=await this['_service']['reconnect'](_0x3484f5['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x3d09d9)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x36428a=await this['_service']['getConnectedSessions']();_0x28d772['register'](this['_channelId'],_0x36428a),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x4a897c){if(function(_0x127537){return'404'===_0x127537['code'];}(_0x4a897c)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x102014){return'409'===_0x102014['code'];}(_0x4a897c)){const _0x3702c8=V(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x3702c8);}else{if(!(_0x4a897c instanceof G))throw _0x4a897c;this['_handleReconnectionError']();}}}}['destroy'](){const _0x252cb5=this['editor']['plugins']['get'](n),_0x4a17d5=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x4a17d5['channelSessions']['has'](this['_channelId'])&&_0x4a17d5['unregister'](this['_channelId']),_0x252cb5['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0xb23d6a){if(this['sessionId']!==_0xb23d6a['sessionId']&&this['_lastSyncedOperationId']!==_0xb23d6a['lastOperationId'])throw new G();return this['sessionId']=_0xb23d6a['sessionId'],this['_handleServerResponse']([],{..._0xb23d6a,'wereChangesApplied':!0x1,'data':_0xb23d6a['data']},'reconnect');}async['_connectService'](_0x41ca19,_0x82f954=!0x1){const {connection:_0x5e4dd2}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x5e4dd2,this['_channelId'])['then'](_0x4d5482=>this['_initSessionsHandling'](_0x4d5482))['catch'](_0x1806c4=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1806c4);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x147648,_0x169211)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x169211);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x16bbe8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x41ca19);this['_isPendingUpdate']=!0x0;const _0x1aac0d=await this['_service']['connect'](_0x5e4dd2,this['_compressOperations'](_0x41ca19),_0x16bbe8);if(this['sessionId']=_0x1aac0d['sessionId'],_0x82f954){if(!_0x1aac0d['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x1aac0d['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x41ca19,_0x1aac0d,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x1aac0d,_0x41ca19);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x7dcb85=this['editor']['plugins']['get'](i),_0x460b87=this['editor']['plugins']['get'](H),_0x2c3dd3=_0x7dcb85['channelSessions']['get'](this['_channelId']);_0x2c3dd3&&_0x2c3dd3['length']>0x1?_0x460b87['createUserMarkerOperations']():this['listenTo'](_0x7dcb85,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x7dcb85['channelSessions']['get'](this['_channelId'])['length']&&_0x460b87['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x568d4b,_0x27d8b3,_0x1dd4ef,_0x28a02f){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x27d8b3){const _0x2eac38=this['_decompressOperations'](_0x1dd4ef,_0x28a02f);await this['_fetchMissingUsers'](_0x2eac38),this['_handleExternalOperations'](_0x2eac38,_0x27d8b3,_0x1dd4ef['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x564034}=this['editor'];let _0x313815;try{_0x313815=await this['_service']['getDocumentDetails']();}catch{const _0x24c265=V(_0x564034,'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'](_0x24c265);}const _0x2ff4a4=_0x313815['currentDocumentSession']||_0x313815['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x2ff4a4['lastOperationId']){const _0x1e3a06=V(_0x564034,'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'](_0x1e3a06);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x22e3b2){const _0x57a1c6=this['editor']['plugins']['get'](i);this['listenTo'](_0x57a1c6,'sessionAdd:'+this['_channelId'],(_0x4fe3cd,{session:_0x149502})=>{if(_0x149502['id']===_0x57a1c6['mySessionId']){_0x4fe3cd['off']();const _0x342620=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x2c987d=_0x149502['permissions'];_0x342620&&_0x342620['isEnabled']&&(_0x2c987d=_0x2c987d['filter'](_0x3bb20f=>'document:write'!==_0x3bb20f)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x2c987d,this['_channelId']);}}),_0x57a1c6['register'](this['_channelId'],_0x22e3b2);}['_initThrowingOnDataSet'](){const _0x331ba2=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5abdbd)=>{if(!_0x5abdbd[_0x5abdbd['length']-0x1]['suppressErrorInCollaboration'])throw new _0x593b20('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x331ba2['apply'](this['editor']['data'],_0x5abdbd);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x26816c,[_0x19bf93])=>{if(this['_document']['version'])throw new _0x593b20('realtimecollaborationclient-init-document-already-initialized',this);_0x26816c['stop'](),this['_setPendingAction']();const _0x2b13ad=this['editor']['config']['get']('rootsAttributes'),_0x2a6f73=this['_getOperationsFromInitData'](_0x19bf93,_0x2b13ad);0x0==_0x2a6f73['length']&&_0x2a6f73['push'](new _0x152ccf(0x0)),_0x26816c['return']=this['_connectService'](_0x2a6f73)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4b95a9=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4b95a9))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x1c1a5c,[_0x344827,_0x125115])=>{_0x1c1a5c['stop']();const _0x3d65c5=this['editor']['model']['document']['getRoot'](_0x344827);if(!this['_knownRootNames']['has'](_0x344827)){const _0x24c7f6=_0x125115&&_0x125115['data']?_0x125115['data']:'',_0x21acf=_0x125115&&_0x125115['attributes']?_0x125115['attributes']:{};await this['_loadRoot'](_0x344827,_0x24c7f6,_0x21acf);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3d65c5['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3d65c5);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x574b61){const _0x2608ec=this['editor']['plugins']['get'](_0x501a96),{connection:_0x45bb3b}=this['editor']['plugins']['get'](n),_0x59491d=new Set();for(const _0x3ee34e of _0x574b61){const _0x4a859d=_0x3ee34e['_authorId'];_0x4a859d&&!_0x2608ec['getUser'](_0x4a859d)&&_0x59491d['add'](_0x4a859d);}if(0x0===_0x59491d['size'])return;const _0x53c06a=await ut['getMany'](_0x45bb3b,Array['from'](_0x59491d));for(const _0x1e8912 of _0x53c06a)_0x2608ec['getUser'](_0x1e8912['id'])||_0x2608ec['addUser'](_0x1e8912);}['_getOperationsFromInitData'](_0xe04b7e,_0x2b3507={}){const _0x3cf733=this['editor']['model'],_0x1f973c=[];let _0x22c218=0x0;const _0x1c8547='string'==typeof _0xe04b7e?{'main':_0xe04b7e}:_0xe04b7e;for(const _0x3b26a8 of Object['keys'](_0x1c8547)){if(!this['_document']['roots']['has'](_0x3b26a8))throw new _0x593b20('realtimecollaborationclient-init-non-existent-root',this);const _0x3407ef=this['editor']['data']['parse'](_0x1c8547[_0x3b26a8]),_0x339819=this['_document']['getRoot'](_0x3b26a8),_0x52ca31=new _0x3ab41f(_0x3cf733['createPositionAt'](_0x339819,0x0),_0x3407ef,_0x22c218++);_0x1f973c['push'](_0x52ca31);for(const [_0x5180ba,_0x3966db]of _0x3407ef['markers']){const _0x18fad2=_0x3cf733['createRange'](_0x3cf733['createPositionFromPath'](_0x339819,_0x3966db['start']['path']['slice']()),_0x3cf733['createPositionFromPath'](_0x339819,_0x3966db['end']['path']['slice']())),_0x2694f9=new _0x3b1e2c(_0x5180ba,null,_0x18fad2,_0x3cf733['markers'],!0x0,_0x22c218++);_0x1f973c['push'](_0x2694f9);}}if(_0x2b3507)for(const [_0x5045f3,_0x8b5b63]of Object['entries'](_0x2b3507)){const _0x764cb9=_0x3cf733['document']['getRoot'](_0x5045f3);if(!_0x764cb9)throw new _0x593b20('multi-root-editor-root-attributes-no-root',null);for(const [_0x14910a,_0x3e93e1]of Object['entries'](_0x8b5b63))if(null!==_0x3e93e1){const _0x4b8362=new _0x2a4541(_0x764cb9,_0x14910a,null,_0x3e93e1,_0x22c218++);_0x1f973c['push'](_0x4b8362);}}return _0x1f973c;}async['_loadRoot'](_0x54e4e1,_0x1dfa1d,_0x3597ef){this['_getOperationsFromInitData']({[_0x54e4e1]:_0x1dfa1d},{[_0x54e4e1]:_0x3597ef})['forEach']((_0x2d621f,_0x1457b4)=>{_0x2d621f['baseVersion']=this['_document']['version']+_0x1457b4,_0x2d621f['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2d621f);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x2db719,_0x4638d7){let _0x3d592e;this['_offset']=_0x2db719['offset'];const _0x34a228=_0x2db719['wereChangesApplied']&&!_0x2db719['initData'],_0x32d059=_0x34a228?0x0:_0x2db719['data']['baseVersion'];if(_0x4638d7['forEach'](_0x2c22bd=>{_0x2c22bd['_isInit']=!0x0,_0x2c22bd['createdAt']=_0x2db719['sessionCreatedAt'],_0x2c22bd['_authorId']=null;}),_0x34a228)_0x3d592e=_0x4638d7,this['_applyOperationsSet'](_0x3d592e,_0x34a228);else{if(_0x2db719['initData']){const _0xf7eedb=this['_getOperationsFromInitData'](_0x2db719['initData']);this['_document']['history']['version']=-_0xf7eedb['length'],_0xf7eedb['forEach'](_0x364f3e=>{_0x364f3e['baseVersion']-=_0xf7eedb['length'],_0x364f3e['createdAt']=_0x2db719['sessionCreatedAt'],_0x364f3e['_isInit']=!0x0,_0x364f3e['_authorId']=null;}),this['_applyOperationsSet'](_0xf7eedb,!0x0),this['serverHistory']['version']=-_0xf7eedb['length']+this['_offset'],this['_updateServerHistory'](_0xf7eedb);}this['_document']['history']['version']=_0x32d059,_0x3d592e=this['_decompressOperations'](_0x2db719['data'],_0x2db719['metadata']),await this['_fetchMissingUsers'](_0x3d592e),this['_applyOperationsSet'](_0x3d592e,_0x34a228);}_0x2db719['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3d592e,_0x2db719['lastOperationId']),this['_lastSyncedOperationId']=_0x2db719['lastOperationId']),this['serverHistory']['version']=_0x32d059+this['_offset'],this['_updateServerHistory'](_0x3d592e),_0x4638d7['filter'](_0x145438=>{const _0x57df07=this['_getAffectedRoot'](_0x145438);return _0x57df07&&!this['_knownRootNames']['has'](_0x57df07);})['forEach']((_0x564812,_0x282935)=>{_0x564812['baseVersion']=this['_document']['version']+_0x282935,this['_saveOperationInBuffer'](_0x564812);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x298e2f,_0x59cbfc){const _0x5aa5ef=_0x59cbfc&&_0x59cbfc['message'];if(_0x5aa5ef&&_0x5aa5ef['startsWith']('realtimecollaborationclient'))throw _0x59cbfc;const _0x11591e=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x11591e['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x593b20(_0x298e2f,this['editor'],_0x5aa5ef?{'originalError':_0x5aa5ef}:void 0x0);}['_saveOperationInBuffer'](_0x35e89e){this['_knownOperations']['has'](_0x35e89e)||(this['_knownOperations']['add'](_0x35e89e),this['_bufferedOperations']['push'](_0x35e89e),this['_pendingAction']||'marker'==_0x35e89e['type']&&!_0x35e89e['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3febc6=!0x1){!_0x3febc6&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2a5226=>{_0x2a5226&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x412e0a=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x37567a){return _0x37567a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x37567a['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x37567a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x412e0a)||this['_crash'](_0x412e0a['message'],_0x412e0a);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x36e866=>{this['on']('change:_isPendingUpdate',()=>{_0x36e866();});});}async['_sendBufferedOperations'](){const _0x77b4ed=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0x77b4ed['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x2eca7e=[...this['_bufferedOperations']];for(const _0x111fa3 of _0x2eca7e)_0x111fa3['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x111fa3);const _0x30e29c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2eca7e),_0x2b1d85=q++,_0x3c49dd=this['_compressOperations'](_0x2eca7e),_0x5ce584=await this['_service']['sendOperations'](_0x3c49dd,_0x3c49dd['baseVersion'],_0x30e29c);try{return await this['_handleServerResponse'](_0x2eca7e,_0x5ce584,_0x2b1d85);}catch(_0xd09776){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0xd09776);}}async['_handleServerResponse'](_0x11c8b9,_0x4a23b7,_0x41b582){if('error'in _0x4a23b7)throw _0x4a23b7['error'];let _0x520403=!0x1;if(_0x4a23b7['wereChangesApplied']){_0x4a23b7['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4a23b7['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3659b7=>!_0x11c8b9['includes'](_0x3659b7));for(const _0x47d86c of _0x11c8b9)_0x47d86c['createdAt']='lastOperationAcceptedAt'in _0x4a23b7&&_0x4a23b7['lastOperationAcceptedAt']||void 0x0;$(_0x11c8b9,_0x4a23b7['version']-_0x11c8b9['length']),this['_updateServerHistory'](_0x11c8b9);const _0xb71f0c=_0x11c8b9['filter'](_0x359a2c=>{if(!_0x359a2c['_isInit'])return!0x1;const _0x3fe7f1=this['_getAffectedRoot'](_0x359a2c);return _0x3fe7f1&&!this['_knownRootNames']['has'](_0x3fe7f1);});$(_0xb71f0c,this['_document']['version']),this['_applyOperationsSet'](_0xb71f0c),_0x520403=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0xc89a8f=this['_decompressOperations'](_0x4a23b7['data'],_0x4a23b7['metadata'])['filter'](_0xc13fc3=>_0xc13fc3['baseVersion']>=this['_lastServerVersion']);_0xc89a8f['forEach'](_0x2278ac=>this['_addKnownRoot'](_0x2278ac)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4c0a91=>!_0x4c0a91['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x4c0a91))),this['_bufferedOperations']['length']&&$(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0xc89a8f),_0x520403=this['_handleExternalOperations'](_0xc89a8f,_0x4a23b7['version'],_0x4a23b7['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x520403?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x31987b,_0x263b2a,_0x53da7d){try{const _0x31bfe8={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x3e996f,operationsB:_0x31c985,originalOperations:_0x192b0b}=_0x465da8(_0x31987b,this['_bufferedOperations'],_0x31bfe8);$(_0x3e996f,this['_document']['version']),$(_0x31c985,_0x263b2a);for(const _0x4c4315 of _0x3e996f){const _0x316cf4=_0x192b0b['get'](_0x4c4315);_0x4c4315['_authorId']=_0x316cf4?_0x316cf4['_authorId']:null;}_0x53da7d&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x31987b,_0x53da7d),this['_lastSyncedOperationId']=_0x53da7d),this['_bufferedOperations']=[..._0x31c985],this['_applyOperationsSet'](_0x3e996f),this['_updateServerHistory'](_0x31987b);}catch(_0x50924d){return console['error'](_0x50924d),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4e59cb,_0x28f37d=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1e4279=>{for(const _0x3d5af8 of _0x4e59cb)this['_knownOperations']['add'](_0x3d5af8),this['_addKnownRoot'](_0x3d5af8),_0x1e4279['batch']['addOperation'](_0x3d5af8),this['editor']['model']['applyOperation'](_0x3d5af8);});}['_addKnownRoot'](_0xc3a70e){const _0x31b172=this['_getAffectedRoot'](_0xc3a70e);_0x31b172&&this['_knownRootNames']['add'](_0x31b172);}['_getAffectedRoot'](_0x21213d){let _0x1a51e3,_0x2e6b08;switch(_0x21213d['type']){case'insert':_0x1a51e3=_0x21213d['position']['root'];break;case'marker':if(_0x2e6b08=_0x21213d['newRange'],!_0x2e6b08)return null;_0x1a51e3=_0x2e6b08['root'];break;case'addRootAttribute':_0x1a51e3=_0x21213d['root'];break;case'addRoot':_0x1a51e3=_0x21213d['affectedSelectable'];break;case'move':_0x1a51e3=_0x21213d['targetPosition']['root'];break;default:return null;}return _0x1a51e3['rootName'];}['_updateServerHistory'](_0x505c12){_0x505c12['forEach'](_0x39200e=>{const _0x12fc2c=_0x39200e['clone']();_0x12fc2c['_authorId']=_0x39200e['_authorId'],_0x12fc2c['_isInit']=!!_0x39200e['_isInit'],_0x12fc2c['createdAt']=_0x39200e['createdAt'],_0x12fc2c['baseVersion']+=this['_offset'],_0x39200e['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x12fc2c),this['serverHistory']['addOperation'](_0x12fc2c);});}['_handleReconnectionError'](_0x25f040){const _0x4613fb=this['editor']['plugins']['get']('Notification'),_0x58b072=this['editor']['locale'];_0x25f040||(_0x25f040=V(_0x58b072,'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.')),_0x4613fb['showWarning'](_0x25f040,{'title':V(_0x58b072,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x4a177a)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x4a177a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5d7d54){const _0x59b0c8=_0x5d7d54['map'](_0x381fd1=>_0x381fd1['toJSON']());return this['_compressor']['compress'](_0x59b0c8);}['_decompressOperations'](_0x94cbe5,_0x4258e4){return this['_compressor']['decompress'](_0x94cbe5)['map']((_0x31320d,_0x58adbc)=>{const _0x3a7f89='init'==_0x4258e4[_0x58adbc]['type'];if('InsertOperation'==_0x31320d['__className']){const _0x391a0f=_0x31320d['position']['root'];!this['_document']['getRoot'](_0x391a0f)&&(this['_document']['createRoot']('$root',_0x391a0f)['_isAttached']=!0x1);}const _0x42e965=_0x208794['fromJSON'](_0x31320d,this['_document']);return _0x42e965['wasUndone']=_0x31320d['wasUndone'],_0x42e965['_isInit']=_0x3a7f89,_0x42e965['_authorId']=_0x3a7f89?null:_0x4258e4[_0x58adbc]['userId'],_0x42e965['_isDisconnection']='cs:removeUser'===_0x4258e4[_0x58adbc]['type'],_0x42e965['createdAt']=_0x4258e4[_0x58adbc]['createdAt'],_0x42e965;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3b8d74=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3b8d74&&_0x3b8d74['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class G extends Error{}function $(_0x2e04f6,_0x3c2715){for(const _0xc8238a of _0x2e04f6)_0xc8238a['baseVersion']=_0x3c2715++;}class K{['_ignoredOperations'];['_operationToId'];constructor(_0xe66ba2){this['_ignoredOperations']=_0xe66ba2,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x2274f2){let _0xbe3704=_0x2274f2['length'];for(;_0xbe3704--;){const _0x4510f3=_0x2274f2[_0xbe3704];if(!this['_ignoredOperations']['has'](_0x4510f3)){if(!this['_operationToId']['has'](_0x4510f3)){const _0x6513a3=_0x102894()['slice'](0x1,0x12);this['_operationToId']['set'](_0x4510f3,_0x6513a3);}return this['_operationToId']['get'](_0x4510f3);}}}['setIdForTheLastOperation'](_0x3f00f0,_0x59eb33){if(!_0x59eb33)return;let _0x148669=_0x3f00f0['length'];for(;_0x148669--;){const _0x1eaf37=_0x3f00f0[_0x148669];this['_ignoredOperations']['has'](_0x1eaf37)||this['_operationToId']['set'](_0x1eaf37,_0x59eb33);}}}class a extends _0x1bf704{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x3214d6{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
-
((()=>et)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x501a96];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4411eb){super(_0x4411eb),this['_services']=new Map();}async['init'](){const _0x1345bb=this['context'],_0x4bb303=_0x1345bb['plugins']['get']('CommentsRepository');if(_0x1345bb['plugins']['get'](n)['addToReconnectionStack'](this),_0x4bb303['adapter']={'addCommentThread':async({channelId:_0x5ddc28,threadId:_0x28e9b6,comments:_0x3312cb,resolvedAt:_0x3da713,resolvedBy:_0x305cc9,context:_0x4dba53,attributes:_0x52b406})=>{const _0x57f824=await this['_getService'](_0x5ddc28)['addCommentThread']({'commentThreadId':_0x28e9b6,'comments':_0x3312cb['map'](_0x429ae4=>function(_0x4259cb,_0x393f48,_0x141505){return{'commentThreadId':_0x141505,'commentId':_0x4259cb['commentId'],'userId':_0x4259cb['authorId'],'content':_0x4259cb['content'],'documentId':_0x393f48,'createdAt':_0x4259cb['createdAt'],'attributes':_0x4259cb['attributes']||{}};}(_0x429ae4,_0x5ddc28,_0x28e9b6)),'resolvedAt':_0x3da713,'resolvedBy':_0x305cc9,'context':_0x4dba53,'attributes':_0x52b406})['catch'](ft);return{'threadId':_0x57f824['commentThreadId'],'comments':_0x57f824['comments']};},'getCommentThread':async({channelId:_0x419852,threadId:_0x343b0f})=>{const _0x5d3c6d=await this['_getService'](_0x419852)['getCommentThread'](_0x343b0f)['catch'](ot)['catch'](ft);return _0x5d3c6d?_0x5d3c6d['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5d3c6d]),{'threadId':_0x5d3c6d['commentThreadId'],'comments':_0x5d3c6d['comments']['map'](st),'context':_0x5d3c6d['context'],'resolvedAt':_0x5d3c6d['resolvedAt'],'resolvedBy':_0x5d3c6d['resolvedBy'],'attributes':_0x5d3c6d['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3317f2,threadId:_0x10f685,context:_0x363694,unlinkedAt:_0x52023e,attributes:_0xbb6325})=>this['_getService'](_0x3317f2)['updateCommentThread']({'commentThreadId':_0x10f685,'context':_0x363694,'attributes':_0xbb6325,'unlinkedAt':_0x52023e})['catch'](ot)['catch'](ft),'resolveCommentThread':async({channelId:_0x2329e5,threadId:_0x5f1a5b})=>{const _0x4fe79a=await this['_getService'](_0x2329e5)['resolveCommentThread'](_0x5f1a5b)['catch'](ot)['catch'](ft);return{'threadId':_0x4fe79a['commentThreadId'],'resolvedAt':_0x4fe79a['resolvedAt'],'resolvedBy':_0x4fe79a['resolvedBy']};},'reopenCommentThread':async({channelId:_0x43651c,threadId:_0x12d8fb})=>this['_getService'](_0x43651c)['reopenCommentThread'](_0x12d8fb)['catch'](ot)['catch'](ft),'removeCommentThread':({channelId:_0x556f58,threadId:_0xa0c803})=>this['_getService'](_0x556f58)['removeCommentThread'](_0xa0c803)['catch'](ot)['catch'](ft),'addComment':({channelId:_0x3d5972,threadId:_0x386e57,commentId:_0x28a7a9,content:_0x21640d,attributes:_0x1d36aa})=>this['_getService'](_0x3d5972)['addComment'](_0x386e57,_0x28a7a9,_0x21640d,_0x1d36aa)['catch'](ft),'updateComment':({channelId:_0x4d31f3,threadId:_0x30a711,commentId:_0x556721,content:_0x1d6f6f,attributes:_0x5be196})=>this['_getService'](_0x4d31f3)['updateComment'](_0x30a711,_0x556721,_0x1d6f6f,_0x5be196)['catch'](ot)['catch'](ft),'removeComment':({channelId:_0x557491,threadId:_0x39ba7f,commentId:_0x2bf84f})=>this['_getService'](_0x557491)['removeComment'](_0x39ba7f,_0x2bf84f)['catch'](ot)['catch'](ft)},_0x1345bb instanceof tt){const _0x21af38=_0x1345bb['config']['get']('collaboration.channelId'),_0x55877a=_0x1345bb['plugins']['get'](i);await this['_setUpService'](_0x21af38);const _0x3125d0=await this['_services']['get'](_0x21af38)['getConnectedSessions']();this['listenTo'](_0x55877a,'sessionAdd:'+_0x21af38,(_0x5046a3,{session:_0x591eb8})=>{_0x591eb8['id']===_0x55877a['mySessionId']&&(_0x5046a3['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x591eb8['permissions'],_0x21af38));}),_0x55877a['register'](_0x21af38,_0x3125d0);}}async['_setUpService'](_0x462d54){if(this['_services']['has'](_0x462d54))throw new _0x593b20('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x462d54});const _0x2b7902=this['context']['plugins']['get']('CommentsRepository'),_0x198c4c=new s['CommentsService'](_0x462d54);this['_services']['set'](_0x462d54,_0x198c4c),this['listenTo'](_0x198c4c,'commentThreadAdded',(_0x359984,_0x27ad32)=>{const {commentThreadId:_0x54de31,documentId:_0x36d5d1,context:_0x175c3e,attributes:_0xf37402,resolvedAt:_0xd7c38a,resolvedBy:_0x298296,comments:_0x590909}=_0x27ad32;_0x2b7902['getCommentThread'](_0x54de31)||_0x2b7902['addCommentThread']({'threadId':_0x54de31,'channelId':_0x36d5d1,'comments':_0x590909?_0x590909['map'](st):[],'context':_0x175c3e,'attributes':_0xf37402,'resolvedAt':_0xd7c38a,'resolvedBy':_0x298296,'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadUpdated',(_0x2f63f9,{commentThreadId:_0x23b35d,documentId:_0x3b9e0f,context:_0x4ec94e,unlinkedAt:_0x152606,attributes:_0x31afbc})=>{_0x2b7902['getCommentThread'](_0x23b35d)&&_0x2b7902['updateCommentThread']({'threadId':_0x23b35d,'channelId':_0x3b9e0f,'context':_0x4ec94e,'unlinkedAt':_0x152606,'attributes':_0x31afbc,'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadResolved',(_0x92859e,{commentThreadId:_0x40d4f5,resolvedBy:_0x23c3d9,resolvedAt:_0x2a9fc3})=>{const _0x3b43a9=_0x2b7902['getCommentThread'](_0x40d4f5);_0x3b43a9&&_0x3b43a9['resolve']({'resolvedBy':_0x23c3d9,'resolvedAt':_0x2a9fc3,'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadReopened',(_0x4f4d30,{commentThreadId:_0x550896})=>{const _0x40d356=_0x2b7902['getCommentThread'](_0x550896);_0x40d356&&_0x40d356['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentThreadRemoved',(_0x2e59b0,{commentThreadId:_0x2f74cc})=>{const _0x261565=_0x2b7902['getCommentThread'](_0x2f74cc);_0x261565&&_0x261565['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentAdded',(_0x2570d9,_0x45e658)=>{const _0x448eae=_0x45e658['commentThreadId'],_0x15cf8f=_0x2b7902['getCommentThread'](_0x448eae);_0x15cf8f&&_0x15cf8f['addComment']({...st(_0x45e658),'isFromAdapter':!0x0});}),this['listenTo'](_0x198c4c,'commentUpdated',(_0x1090e8,{commentThreadId:_0x53b136,commentId:_0x51faa4,content:_0x45f6e7,attributes:_0x486e12})=>{const _0xfcc382=_0x2b7902['getCommentThread'](_0x53b136);if(_0xfcc382){const _0x5e43ed=_0xfcc382['getComment'](_0x51faa4);_0x5e43ed&&_0x5e43ed['update']({'content':_0x45f6e7,'attributes':_0x486e12,'isFromAdapter':!0x0});}}),this['listenTo'](_0x198c4c,'commentRemoved',(_0x3a7184,{commentThreadId:_0x56994b,commentId:_0x2f0ef5})=>{const _0x17ff0b=_0x2b7902['getCommentThread'](_0x56994b);if(_0x17ff0b){const _0x58587b=_0x17ff0b['getComment'](_0x2f0ef5);_0x58587b&&_0x58587b['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x462d54);}['destroy'](){if(this['context']instanceof tt){const _0x2292e7=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x2292e7);}}['_terminateService'](_0x4663e2){if(!this['_services']['has'](_0x4663e2))throw new _0x593b20('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x4663e2});this['_getService'](_0x4663e2)['disconnect'](),this['_services']['delete'](_0x4663e2);}async['reconnect'](){for(const _0x5ef6d1 of this['_services']['keys']())await this['_connectService'](_0x5ef6d1);if(this['context']instanceof tt){const _0x467a54=this['context']['config']['get']('collaboration.channelId'),_0x5239f1=this['context']['plugins']['get'](i);_0x5239f1['unregister'](_0x467a54);const _0x135db4=await this['_services']['get'](_0x467a54)['getConnectedSessions']();_0x5239f1['register'](_0x467a54,_0x135db4);}}async['_connectService'](_0x4c0e0b){const {connection:_0x3d286e}=this['context']['plugins']['get'](n),_0x4d3cb8=this['context']['plugins']['get']('CommentsRepository'),_0x55928d=this['_services']['get'](_0x4c0e0b),_0x427925=await _0x55928d['connect'](_0x3d286e);await this['_fetchMissingUsersForThreads'](_0x427925);const _0x237b70=new Set(Array['from'](_0x4d3cb8['getCommentThreads']({'channelId':_0x4c0e0b}),_0x4380f8=>_0x4380f8['id']));for(const _0x220b61 of _0x427925)_0x220b61['deletedAt']||_0x237b70['delete'](_0x220b61['commentThreadId']);for(const _0x381100 of _0x237b70)_0x4d3cb8['getCommentThread'](_0x381100)['remove']({'isFromAdapter':!0x0});for(const _0x3cf6d2 of _0x427925){let _0x158616=_0x4d3cb8['getCommentThread'](_0x3cf6d2['commentThreadId']);const {commentThreadId:_0x4cd255,context:_0x3780eb,attributes:_0x58495c,resolvedBy:_0xe1a979,resolvedAt:_0x43af6e,unlinkedAt:_0x3b3a7f,deletedAt:_0x42461d}=_0x3cf6d2;if(_0x42461d)continue;_0x158616||(_0x158616=_0x4d3cb8['addCommentThread']({'channelId':_0x4c0e0b,'threadId':_0x4cd255,'context':_0x3780eb,'attributes':_0x58495c||{},'resolvedBy':_0xe1a979,'resolvedAt':_0x43af6e,'unlinkedAt':_0x3b3a7f,'isFromAdapter':!0x0}));const _0x1d0ee3=new Set(Array['from'](_0x158616['comments'],_0x54a937=>_0x54a937['id']));for(const _0x41349f of _0x3cf6d2['comments'])_0x1d0ee3['delete'](_0x41349f['commentId']);for(const _0x4d69d3 of _0x1d0ee3)_0x158616['getComment'](_0x4d69d3)['remove']({'isFromAdapter':!0x0});for(const _0x3259b0 of _0x3cf6d2['comments']){const _0x1f74e7=_0x158616['getComment'](_0x3259b0['commentId']);_0x1f74e7?_0x1f74e7['content']!==_0x3259b0['content']&&_0x1f74e7['update']({'content':_0x3259b0['content'],'isFromAdapter':!0x0}):_0x158616['addComment'](Object['assign'](st(_0x3259b0),{'isFromAdapter':!0x0}));}}}['_getService'](_0x380e2d){if(!this['_services']['has'](_0x380e2d))throw new _0x593b20('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x380e2d});return this['_services']['get'](_0x380e2d);}async['_fetchMissingUsersForThreads'](_0x303bd5){const _0x3deadc=this['context']['plugins']['get'](_0x501a96),{connection:_0x398aac}=this['context']['plugins']['get'](n),_0xf1e08e=new Set();for(const {resolvedBy:_0x2d9187,comments:_0x7292b2}of _0x303bd5){_0x2d9187&&!_0x3deadc['getUser'](_0x2d9187)&&_0xf1e08e['add'](_0x2d9187);for(const {userId:_0x37bec1}of _0x7292b2)_0x3deadc['getUser'](_0x37bec1)||_0xf1e08e['add'](_0x37bec1);}if(0x0===_0xf1e08e['size'])return;const _0x2f8699=await ut['getMany'](_0x398aac,Array['from'](_0xf1e08e));for(const _0x14a09f of _0x2f8699)_0x3deadc['getUser'](_0x14a09f['id'])||_0x3deadc['addUser'](_0x14a09f);}}async function ot(_0x26019b){if('404'!==_0x26019b['code'])throw _0x26019b;}function ft(_0x567290){if((_0x56899b=_0x567290)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x56899b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x56899b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x56899b;throw _0x567290;}function st(_0x55c7a5){return{'threadId':_0x55c7a5['commentThreadId'],'commentId':_0x55c7a5['commentId'],'content':_0x55c7a5['content'],'createdAt':_0x55c7a5['createdAt'],'authorId':_0x55c7a5['userId'],'attributes':_0x55c7a5['attributes']||{}};}class m extends _0x1bf704{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
-
((()=>
|
|
28
|
-
((()=>_0xdca4cc)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x501a96];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x270e88){super(_0x270e88);const _0x478582=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x478582);}async['init'](){const _0x3ea15b=this['editor']['plugins']['get'](l),_0x13d392=_0x3ea15b['serverHistory'],_0x18b64d=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x13d392,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x3ea15b['sessionId']});const _0x3e1350=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x817af7=await _0x519c59['isBundleUploaded'](_0x18b64d['connection'],_0x3e1350);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x205c76})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x205c76)),'updateRevisions':async _0x46c6da=>{await this['_waitForServiceReady']();const _0x1ea440=this['_revisionTracker']['currentRevision'];if(_0x817af7&&0x1===_0x46c6da['length']&&_0x46c6da[0x0]['id']===_0x1ea440['id'])return _0x46c6da;for(const _0x172b8f of _0x46c6da)_0x172b8f['id']===_0x1ea440['id']&&(_0x172b8f['isEmptyCurrent']=_0x172b8f['fromVersion']===_0x172b8f['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x46c6da,this['_lastRequestId'])['then'](_0x502645=>(this['_lastRequestId']=_0x502645,_0x46c6da))['catch'](_0x4cfc4b=>{if(P(_0x4cfc4b)||'400'===_0x4cfc4b['code']&&void 0x0!==_0x4cfc4b['data']['wrongRequestId']){for(const _0x1f639d of _0x46c6da){!this['_revisionTracker']['repository']['getRevision'](_0x1f639d['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1f639d['id'],_0x1f639d,!0x1);}if(P(_0x4cfc4b))throw _0x4cfc4b;return _0x46c6da;}throw _0x4cfc4b;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x11cb14,{revisionsData:_0x4bee97,requestId:_0x55049c})=>{Math['max'](..._0x4bee97['map'](_0x22242e=>_0x22242e['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x4bee97,_0x55049c);}):this['_handleRevisionsUpdate'](_0x4bee97,_0x55049c);});const {revisions:_0x57a2bd,requestId:_0x2dafe8}=await this['_revisionHistoryService']['connect'](_0x18b64d['connection']);_0x18b64d['addToReconnectionStack'](this),this['_lastRequestId']=_0x2dafe8,await this['_fetchMissingUsers'](_0x57a2bd);for(const _0x9c7f52 of _0x57a2bd)this['_revisionTracker']['addRevisionData'](_0x9c7f52);this['listenTo'](_0x3ea15b,'change:_isConnected',(_0x3ec3b8,_0x359744,_0x51a591)=>{_0x51a591&&(this['_oldOffset']=_0x3ea15b['_offset'],_0x3ec3b8['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x18b64d,'state',_0x3658fa=>_0x3658fa===_0x176d8f['CONNECTED']);}async['reconnect'](){const _0x22a737=this['editor']['plugins']['get'](n),_0xafd203=this['editor']['plugins']['get'](l),_0x5987ec=async()=>{const _0x4f93f9=this['_revisionTracker']['currentRevision'],_0x19742a=_0x4f93f9['id'],_0x2356d1=_0x19742a!==_0xafd203['sessionId'];if(_0x2356d1){const _0x1f6868=_0xafd203['_offset']-this['_oldOffset'],_0x1e820e=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x4f93f9['toVersion']+_0x1f6868!==_0x1e820e){const _0x1dc651=_0x4f93f9['fromVersion']+_0x1f6868,_0x5f4e65=this['editor']['plugins']['get'](_0x501a96),_0x4346cf=this['_revisionTracker']['buildRevisionData']({'revision':_0x4f93f9,'from':_0x1dc651,'to':_0x1e820e});_0x4346cf['id']=_0x4f93f9['id'];const _0x2e1b21=_0x4346cf['authorsIds']['map'](_0x481799=>_0x5f4e65['getUser'](_0x481799));_0x4f93f9['_update']({..._0x4346cf,'authors':_0x2e1b21},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x4f93f9['id'],_0x4346cf,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1e820e,(_0x4f93f9['toVersion']===_0x4f93f9['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x19742a)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x19742a),this['_revisionTracker']['_createCurrentRevision'](_0x1e820e));}const {revisions:_0x7a1d35,requestId:_0x479d39}=await this['_revisionHistoryService']['reconnect'](_0x22a737['connection'],this['_lastRequestId']);_0x2356d1&&_0x7a1d35['length']>0x0?_0xafd203['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x7a1d35),this['_handleRevisionsUpdate'](_0x7a1d35,_0x479d39),this['_revisionTracker']['sendBufferedUpdates']());};return _0xafd203['_isConnected']?_0x5987ec():new Promise((_0x159236,_0x3c7847)=>{_0xafd203['once']('change:_isConnected',()=>{_0x5987ec()['then'](_0x159236)['catch'](_0x3c7847);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x8e862e=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x510b66=>{_0x510b66['off'](),_0x8e862e();});});}['_getLatestVersionFromServerOperations'](){const _0x5bb2f3=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x58e172 of _0x5bb2f3)if('marker'!==_0x58e172['type']||_0x58e172['affectsData'])return _0x58e172['baseVersion']+0x1;}['_getLatestVersion'](){const _0x4cc358=this['editor']['plugins']['get'](l);return new Promise(_0x2ead9e=>{_0x4cc358['_isPendingUpdate']?_0x4cc358['once']('change:_isPendingUpdate',()=>{_0x2ead9e(this['_getLatestVersionFromServerOperations']());}):_0x2ead9e(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x17460a,_0x4e1e8c){const _0x32841c=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x4e1e8c;for(const _0x16e41f of _0x17460a){const _0x301f14=_0x32841c['getRevision'](_0x16e41f['id']);if(_0x301f14){if((_0x16e41f['fromVersion']||_0x16e41f['toVersion'])&&(_0x16e41f['diffData']=null),_0x301f14===this['_revisionTracker']['currentRevision']){const _0x33b0f6=Math['max'](_0x301f14['toVersion'],_0x16e41f['toVersion']),_0x2dcdc2=Math['max'](_0x301f14['fromVersion'],_0x16e41f['fromVersion']);let _0x57f962;_0x301f14['toVersion']===_0x16e41f['toVersion']&&_0x301f14['fromVersion']===_0x16e41f['fromVersion']?(_0x57f962=!0x0,this['_preventResendingRevisionData'](_0x16e41f)):_0x16e41f['toVersion']===_0x33b0f6&&_0x16e41f['fromVersion']===_0x2dcdc2?_0x57f962=!0x1:(_0x301f14['toVersion']===_0x33b0f6&&_0x301f14['fromVersion']===_0x2dcdc2||this['_fixRevision']({'revision':_0x301f14,'from':_0x2dcdc2,'to':_0x33b0f6}),_0x57f962=!0x0),_0x57f962&&(delete _0x16e41f['fromVersion'],delete _0x16e41f['toVersion'],delete _0x16e41f['diffData'],delete _0x16e41f['createdAt'],delete _0x16e41f['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x16e41f),this['_preventResendingRevisionData'](_0x16e41f);}else this['_revisionTracker']['addRevisionData'](_0x16e41f);}const _0x44c0db=_0x32841c['getRevisions']();_0x44c0db['reverse']();for(let _0x1c708d=0x0;_0x1c708d<_0x44c0db['length']-0x1;_0x1c708d++){const _0x201a5f=_0x44c0db[_0x1c708d],_0x3253b0=_0x44c0db[_0x1c708d+0x1];if(_0x201a5f['fromVersion']<_0x3253b0['toVersion']){const _0x4030df=_0x3253b0['toVersion'],_0x359f8e=Math['max'](_0x4030df,_0x201a5f['toVersion']);this['_fixRevision']({'revision':_0x201a5f,'from':_0x4030df,'to':_0x359f8e});}}}['_fixRevision']({revision:_0x240f94,from:_0x1be048,to:_0x19b65d}={}){const _0x252b25=this['editor']['plugins']['get'](_0x501a96),_0x4fe127=this['_revisionTracker']['buildRevisionData']({'revision':_0x240f94,'from':_0x1be048,'to':_0x19b65d});_0x4fe127['authors']=_0x4fe127['authorsIds']['map'](_0x4ee02f=>_0x252b25['getUser'](_0x4ee02f)),_0x240f94['_update'](_0x4fe127);}['_preventResendingRevisionData'](_0x477e4b){const _0x4f4e22={};_0x4f4e22['id']=_0x477e4b['id'];for(const _0x57d5f0 of Object['keys'](_0x477e4b))'id'!==_0x57d5f0&&(_0x4f4e22[_0x57d5f0]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4f4e22['id'],_0x4f4e22,!0x0);}async['_fetchMissingUsers'](_0x3b8779){const _0x3425c1=this['editor']['plugins']['get'](_0x501a96),{connection:_0x4f2174}=this['editor']['plugins']['get'](n),_0x1ba18e=new Set();for(const _0x45411e of _0x3b8779){for(const _0x443d73 of _0x45411e['authorsIds'])_0x4c0fce(_0x443d73);_0x45411e['creatorId']&&_0x4c0fce(_0x45411e['creatorId']);}if(0x0===_0x1ba18e['size'])return;const _0x323330=await ut['getMany'](_0x4f2174,Array['from'](_0x1ba18e));for(const _0x50fb4a of _0x323330)_0x3425c1['getUser'](_0x50fb4a['id'])||_0x3425c1['addUser'](_0x50fb4a);function _0x4c0fce(_0x316c3b){_0x3425c1['getUser'](_0x316c3b)||_0x1ba18e['add'](_0x316c3b);}}}function P(_0x41fff8){return _0x41fff8['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x41fff8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x41fff8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class gt extends _0x1bf704{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x16db83{['_collapseAt'];constructor(_0x599dd3,_0x550bd1=0x6){super(_0x599dd3);const _0x4f2af9=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x550bd1,this['bind']('isHidden')['to'](this,'usersCount',_0x470aa0=>_0x470aa0<_0x550bd1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4f2af9['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':_0x4f2af9['to']('usersCount',_0x1bbb06=>'+'+(_0x1bbb06-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x16db83{['items'];['keystrokes'];constructor(_0x5cb08f){super(_0x5cb08f);const _0xd3408d=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x215678(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0xd3408d['if']('hasPopup'),'aria-expanded':_0xd3408d['to']('isExpanded',_0x148a29=>this['hasPopup']&&String(_0x148a29)),'aria-label':_0xd3408d['to']('hasPopup',_0x338c47=>V(_0x5cb08f,_0x338c47?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0xd3408d['to']('hasPopup',_0x92e4c9=>!!_0x92e4c9&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0xd3408d['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0xd3408d['to'](_0x199895=>{const _0x58c7ba=_0x199895,_0x222daf=document['querySelector']('.ck-presence-list__dropdown-list'),_0x2ea261=document['querySelector']('.ck-balloon-panel_with-arrow');_0x222daf?.['contains'](_0x58c7ba['relatedTarget'])||_0x2ea261?.['contains'](_0x58c7ba['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x11e6d4,_0x1e3c17,_0x58b41d)=>{this['element']&&(_0x58b41d?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x16db83{['counterView'];['inlineListView'];constructor(_0x4f427b,_0x4d12ea=0x6){super(_0x4f427b);const _0x4197c6=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x4d12ea),this['inlineListView']=new is(_0x4f427b),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x142aa8 of this['inlineListView']['items'])_0x142aa8['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',_0x4197c6['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x16db83{['listWrapperView'];constructor(_0x3dae92,_0x5269fa){super(_0x3dae92);const _0x5d0f7d=this['bindTemplate'];this['listWrapperView']=new wt(_0x3dae92,_0x5269fa),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x3dae92,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5d0f7d['to'](_0xb4cf24=>{const _0x1e31ec=_0xb4cf24,_0x3176ab=document['querySelector']('.ck-presence-list__list'),_0x51e4dd=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3176ab?.['contains'](_0x1e31ec['relatedTarget'])||_0x51e4dd?.['contains'](_0x1e31ec['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class wt extends _0x61da62{constructor(_0x3faf5a,_0x4163e3){super(_0x3faf5a);const _0x3623a2=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4163e3?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3623a2['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3623a2['to']('role'),'aria-label':_0x3623a2['to']('ariaLabel'),'aria-labelledby':_0x3623a2['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xfff1fd['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3a6f21=this['element'];_0x3a6f21&&(this['_isScrollable']=Math['max'](_0x3a6f21['scrollHeight'],_0x3a6f21['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x38ae6a,_0x48e6c7,_0x55cf52){super(_0x38ae6a);const _0x5e9d68=this['bindTemplate'];this['userView']=new ct(_0x38ae6a,_0x48e6c7);const _0x31e2a2={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x48e6c7['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x48e6c7['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x48e6c7['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x55cf52&&(_0x31e2a2['tag']='button',_0x31e2a2['on']={'click':_0x5e9d68['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x31e2a2);}['focus'](){this['element']['focus']();}}class A extends _0x16db83{['userView'];['markerView'];constructor(_0xfc8ba0,_0x39cb42,_0x320b1d){super(_0xfc8ba0);const _0x1a3fea=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0xfc8ba0,_0x39cb42),this['markerView']=new lt(_0xfc8ba0,_0x39cb42);const _0x67e9b2=new at(_0xfc8ba0);_0x67e9b2['template']['tag']='span',_0x67e9b2['text']=_0x39cb42['name'];const _0x46cd84={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x1a3fea['to']('isFocusable',_0x43f426=>!!_0x43f426&&0x0),'aria-labelledby':_0x67e9b2['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x1a3fea['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x1a3fea['to']('hasTooltip',_0x422416=>!_0x422416),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x67e9b2]};_0x320b1d&&(_0x46cd84['tag']='button',_0x46cd84['on']={'click':_0x1a3fea['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x46cd84);}}class lt extends _0x16db83{constructor(_0x2f045a,_0x25b707){super(_0x2f045a),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x25b707['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x3214d6{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x39215e){super(_0x39215e),this['context']['config']['define']('presenceList',x);const _0x1aa6a1=_0x39215e['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1aa6a1)throw new _0x593b20('presencelist-collapseat-invalid-format',this);if(_0x1aa6a1<0x1)throw new _0x593b20('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1216b9(),this['balloonPanelView']=new _0x3afab7(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x3cfa57 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x3cfa57);this['listenTo'](this['_allConnectedUsers'],'add',(_0x41c440,_0x470e1d)=>{this['_handleUserAdd'](_0x470e1d);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0xfcad97,_0x3d2926)=>{this['_handleUserRemove'](_0x3d2926);});}['_createView'](){const _0x1a1e15=this['context'],_0x3834a2=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0xecf69a=this['balloonPanelView'];if(!_0xff7fb5(_0x1a1e15['config']['get']('presenceList.container')))throw new _0x593b20('presencelist-missing-container',this);return _0x3834a2['counterView']['bind']('usersCount')['to'](this),_0x3834a2['bind']('isCollapsed')['to'](this,'usersCount',_0x64677c=>{const {collapseAt:_0xad7eb3}=_0x1a1e15['config']['get']('presenceList'),_0x3651e0=_0x64677c>=_0xad7eb3;if(_0x3651e0&&!_0x3834a2['inlineListView']['items']['find'](_0x5d498a=>_0x5d498a instanceof b)){const _0x1ef51b=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x1ef51b&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3834a2['inlineListView']['items']['add'](_0x3834a2['counterView']);}return _0x3651e0||this['hideDropdown'](),_0x3651e0;}),_0x3834a2['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x190400=>{const _0x104b77=_0x1a1e15['config']['get']('presenceList'),_0xadacba=new A(_0x1a1e15['locale'],_0x190400,!!_0x104b77['onClick']);return _0xadacba['bind']('hasTooltip')['to'](_0x3834a2,'isCollapsed',_0x44b8ec=>!_0x44b8ec),_0xadacba['bind']('isFocusable')['to'](_0x3834a2,'isCollapsed',_0x1450a3=>!_0x1450a3),_0x104b77['onClick']&&this['listenTo'](_0xadacba,'execute',()=>{this['view']['isCollapsed']||_0x104b77['onClick'](_0x190400,_0xadacba['element']);}),_0xadacba;}),this['listenTo'](_0x3834a2['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3834a2['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3834a2['inlineListView']['keystrokes']['set']('Enter',(_0x6eb1d,_0x26483d)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x26483d());}),_0x3834a2['render'](),_0xecf69a['render'](),_0x13d43c({'emitter':_0x3834a2,'activator':()=>_0xecf69a['isVisible'],'contextElements':[_0xecf69a['element'],_0x3834a2['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1a1e15['config']['get']('presenceList.container')['appendChild'](_0x3834a2['element']),this['_bodyCollection']=new _0x168d9c(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3834a2;}['_handleUserAdd'](_0x3679b0){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x3679b0['isMe'])return;const _0x12297e=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x12297e-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x54e614=_0x3679b0['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x3679b0,_0x54e614);}['_handleUserRemove'](_0x516c95){this['usersCount']--;const {collapseAt:_0x2c4b10}=this['context']['config']['get']('presenceList'),_0x118222=this['usersCount']>=_0x2c4b10;if(this['currentDisplayedUsers']['get'](_0x516c95['id']))this['currentDisplayedUsers']['remove'](_0x516c95['id']);else{if(_0x118222&&this['currentDisplayedUsers']['length']+0x1===_0x2c4b10-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x118222?0x1:0x0)<this['usersCount']){for(const _0x5d9c68 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5d9c68['id'])&&(this['currentDisplayedUsers']['add'](_0x5d9c68,Math['min'](this['currentDisplayedUsers']['length']-(_0x118222?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x118222?0x1:0x0)===_0x2c4b10-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x494ce4=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x494ce4['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1a27c7}=this['presenceDropdownView'];_0x1a27c7['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x456ce2=>{if(!_0x494ce4['displayMe']&&_0x456ce2['isMe'])return null;const _0x470b64=new j(this['context']['locale'],_0x456ce2,!!_0x494ce4['onClick']);return _0x494ce4['onClick']&&this['listenTo'](_0x470b64,'execute',()=>{_0x494ce4['onClick'](_0x456ce2,_0x470b64['element']);}),_0x470b64;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1a27c7['focus'](),_0x1a27c7['checkIfScrollable']();const _0x3a4a61=(_0x2e0c11,_0x477969)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x477969();};_0x1a27c7['keystrokes']['set']('Esc',_0x3a4a61),_0x1a27c7['keystrokes']['set']('Shift+Tab',_0x3a4a61),_0x1a27c7['keystrokes']['set']('Tab',(_0x2ec611,_0x1af031)=>{!function(_0x296f13){const _0x225fc2=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x7e3bdd=>_0x7e3bdd+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x5da8da=[...document['body']['querySelectorAll'](_0x225fc2)]['filter'](_0x35a3db=>_0x35a3db===document['activeElement']||_0x35a3db['offsetWidth']+_0x35a3db['offsetHeight']>0x0)['sort']((_0xb9df72,_0x250d4a)=>(_0xb9df72['tabIndex']||0x0)-(_0x250d4a['tabIndex']||0x0)),_0x19dd3e=_0x5da8da['indexOf'](_0x296f13),_0x4f95f6=_0x5da8da[(_0x19dd3e+0x1)%_0x5da8da['length']];_0x4f95f6&&_0x4f95f6['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1af031();}),_0x1a27c7['focusTracker']['add'](this['view']['element']),_0x1a27c7['focusTracker']['on']('change:isFocused',(_0x1c39d7,_0x5d2b24,_0x21b941)=>{_0x21b941||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class vt extends _0x3214d6{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,vt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,gt as RealTimeCollaborativeRevisionHistory,pt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
|
23
|
+
import{ContextPlugin as _0x14a72f,Plugin as _0x582e6d,PendingActions as _0x215d15,Context as _0x3e4173}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x220b4c,CKEditorError as _0x31eaa2,Collection as _0x5d33df,global as _0x497bba,version as nt,uid as _0xde7275,KeystrokeHandler as _0x3bc9e9}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x5a9875,View as _0x5a7e76,ListView as _0x5687c4,ListItemView as rt,LabelView as ot,BalloonPanelView as _0xbdfd38,clickOutsideHandler as _0x377a1f,BodyCollection as _0xda32c4}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x332ae1,History as _0x3f0332,NoOperation as _0x59727a,InsertOperation as _0x1b2e5d,MarkerOperation as _0x41ae6b,RootAttributeOperation as _0x4ab7ff,transformOperationSets as _0x4b4afd,OperationFactory as _0x52243b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x508833,User as lt,CommentsService as _0x4357f9,TrackChangesService as tt,RevisionHistoryService as et,EditorService as st}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x438ac2,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x43f72e}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1f73a5}from'es-toolkit/compat';class n extends _0x14a72f{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
|
|
24
|
+
((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x5a9875];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x25819f){super(_0x25819f),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x220b4c())();}['init'](){const _0x2df340=this['context'],_0x10c64b=_0x2df340['plugins']['get']('CloudServices'),_0xbbf28e=_0x2df340['plugins']['get'](_0x5a9875);if(!_0x10c64b['token'])throw new _0x31eaa2('websocketgateway-missing-token',this);if(!_0x10c64b['webSocketUrl'])throw new _0x31eaa2('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x10c64b['token'],_0x10c64b['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x16f9bd=>{if(this['connection']=_0x16f9bd,this['bind']('state')['to'](_0x16f9bd,'state',this,'_isBrowserOffline',(_0x2d7946,_0x3dc436)=>('connected'!==_0x2d7946&&(this['_shouldPluginsReconnect']=!0x0),_0x3dc436||_0x2d7946!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x33916e,_0xc2bf4c)=>{if('limitExceeded'!==_0xc2bf4c['code'])throw console['error'](_0xc2bf4c),new _0x31eaa2('cloudservices-init',null,{'originalError':_0xc2bf4c});_0xbbf28e['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'});}),!_0x16f9bd['me'])return new Promise(_0x3c84ab=>_0x16f9bd['on']('change:me',_0x3c84ab));})['catch'](_0x5b73aa=>{throw console['error'](_0x5b73aa),new _0x31eaa2('cloudservices-init',null,{'originalError':_0x5b73aa});});}['addToReconnectionStack'](_0x4ae2b0){if('function'!=typeof _0x4ae2b0['reconnect'])throw new _0x31eaa2('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x4ae2b0))throw new _0x31eaa2('websocketgateway-plugin-already-registered',this,{'name':_0x4ae2b0['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x4ae2b0);}['removeFromReconnectionStack'](_0x4cfc37){this['_reconnectionStack']['delete'](_0x4cfc37);}['isInReconnectionStack'](_0x1eb524){return this['_reconnectionStack']['has'](_0x1eb524);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x2e8a88=>_0x2e8a88['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x1bc280=>{throw console['error'](_0x1bc280),new _0x31eaa2('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x14a72f{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x438ac2];}constructor(_0x5ef0f4){super(_0x5ef0f4),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5d33df(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x438ac2);}['init'](){const _0x32fe4d=this['context']['plugins']['get'](n);this['listenTo'](_0x32fe4d,'change:state',(_0x3066b4,_0x55c3f4,_0xf4149e)=>{if('connected'!==_0xf4149e)this['channelSessions']['forEach'](_0x3bfbe8=>_0x3bfbe8['clear']()),this['channelConnectedUsers']['forEach'](_0x1c7234=>_0x1c7234['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x5cb830,_0x2ed7d7]of this['_registeredSessions'])for(const _0x595902 of _0x2ed7d7)this['_handleSessionAdd'](_0x5cb830,_0x595902);}}),this['_createUser'](_0x32fe4d['connection']['me'],!0x0);}['register'](_0x269838,_0x9d45ec){if(this['_registeredSessions']['has'](_0x269838))throw new _0x31eaa2('sessions-register-already-registered',null,{'channelId':_0x269838});this['_registeredSessions']['set'](_0x269838,_0x9d45ec),this['channelSessions']['set'](_0x269838,new _0x5d33df()),this['channelConnectedUsers']['set'](_0x269838,new _0x5d33df()),this['listenTo'](_0x9d45ec,'add',(_0x383b8f,_0x1794c8)=>this['_handleSessionAdd'](_0x269838,_0x1794c8)),this['listenTo'](_0x9d45ec,'remove',(_0xdfd2a2,_0x16f884)=>this['_handleSessionRemove'](_0x269838,_0x16f884));for(const _0xafee6a of _0x9d45ec)this['_handleSessionAdd'](_0x269838,_0xafee6a);}['unregister'](_0x1c2791){if(!this['_registeredSessions']['has'](_0x1c2791))throw new _0x31eaa2('sessions-unregister-not-exist',null,{'channelId':_0x1c2791});const _0x296d79=this['_registeredSessions']['get'](_0x1c2791);this['stopListening'](_0x296d79);for(const _0x236bde of _0x296d79)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x1c2791,_0x236bde);this['_registeredSessions']['delete'](_0x1c2791),this['channelSessions']['delete'](_0x1c2791),this['channelConnectedUsers']['delete'](_0x1c2791);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x54d434){for(const _0x30793e of this['channelSessions']['values']())for(const _0x1b16b2 of _0x30793e)if(_0x1b16b2['id']===_0x54d434)return _0x1b16b2['user'];}['getUserSessions'](_0xfb2fe4,_0x12c365){const _0x162314=_0x12c365?[this['channelSessions']['get'](_0x12c365)]:this['channelSessions']['values'](),_0x3361d1=new Set();for(const _0x604e3d of _0x162314)for(const _0x31a31a of _0x604e3d)_0x31a31a['user']['id']===_0xfb2fe4['id']&&_0x3361d1['add'](_0x31a31a['id']);return _0x3361d1;}['getUserRole'](_0x36decb){for(const _0xb46bfa of this['channelSessions']['values']())for(const _0xb67d02 of _0xb46bfa)if(_0xb67d02['user']===_0x36decb)return _0xb67d02['role'];}['_handleSessionAdd'](_0x47733b,_0x57dff5){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x25d368=_0x57dff5['user'],_0x31f564=this['_users']['getUser'](_0x25d368['id'])||this['_createUser'](_0x25d368),_0x522f79=Object['assign']({},_0x57dff5,{'user':_0x31f564});if(this['channelSessions']['get'](_0x47733b)['add'](_0x522f79),!_0x25d368['hiddenInPresenceList']){const _0x549234=this['channelConnectedUsers']['get'](_0x47733b);_0x549234['has'](_0x31f564['id'])||_0x549234['add'](_0x31f564),this['allConnectedUsers']['has'](_0x31f564['id'])||_0x25d368['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x31f564,_0x31f564['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x47733b,{'channelId':_0x47733b,'session':_0x522f79});}['_handleSessionRemove'](_0xf3f873,_0x5702de){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3a43fb=this['channelConnectedUsers']['get'](_0xf3f873),_0x3aa027=_0x5702de['user'];_0x3aa027['id']&&(this['channelSessions']['get'](_0xf3f873)['remove'](_0x5702de['id']),_0x3a43fb['has'](_0x3aa027['id'])&&!this['getUserSessions'](_0x3aa027,_0xf3f873)['size']&&_0x3a43fb['remove'](_0x3aa027['id']),this['allConnectedUsers']['get'](_0x3aa027['id'])&&!this['getUserSessions'](_0x3aa027)['size']&&this['allConnectedUsers']['remove'](_0x3aa027['id']));}['_createUser'](_0x1d849c,_0xc7879f){const _0x235e40=this['_users']['addUser'](_0x1d849c);return _0xc7879f&&this['_users']['defineMe'](_0x1d849c['id']),_0x235e40['orderNumber']=this['_uniqueUsersCount']++,_0x235e40;}}class V extends _0x582e6d{['_domEmitter']=new(_0x220b4c())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x44803f=this['editor'],_0x3622b3=_0x44803f['plugins']['get'](i);_0x44803f['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x5c968c,{writer:_0x41d56c})=>function(_0x5b94a6,_0x3d394f,_0x393bce,_0x4fba39){const _0x3f441a=_0x5b94a6['markerName']['split'](':')[0x2],_0x15cbc2=_0x393bce['getUserBySessionId'](_0x3f441a);if(!_0x15cbc2||_0x3f441a===_0x393bce['mySessionId'])return;if(!_0x4fba39['model']['schema']['checkChild'](_0x5b94a6['markerRange']['start'],'$text'))return;const _0x1a94c9={'class':'ck-user__marker\x20'+_0x15cbc2['color']['getMarkerClass'](),'data-name':_0x15cbc2['name'],'data-session-id':_0x3f441a},_0x2a1005=_0x4fba39['model']['markers']['get'](_0x5b94a6['markerName']),_0x3b5c2f=_0x2a1005['getStart'](),_0x3b8430=_0x3b5c2f['nodeAfter'],_0x31103c=_0x4fba39['model']['schema'];if(_0x3b8430&&_0x31103c['isObject'](_0x3b8430)&&_0x31103c['isInline'](_0x3b8430)&&!_0x4fba39['model']['markers']['get']('user:range:'+_0x3f441a)['getRange']()['isCollapsed'])return;const _0x4baa23=_0x3b5c2f['parent'];return _0x4fba39['model']['schema']['isLimit'](_0x4baa23)&&!_0x4fba39['model']['hasContent'](_0x4baa23)&&(_0x1a94c9['contenteditable']=!0x1),function(_0x190cbc,_0x468c77,_0x45142c){const _0x3f8b57=_0x190cbc['createUIElement']('span',_0x468c77);return _0x190cbc['setCustomProperty']('userPositionMarker',!0x0,_0x3f8b57),_0x3f8b57['render']=function(_0x4b947b){const _0x25f669=this['toDomElement'](_0x4b947b),_0xfec23f=document['createElement']('span');return _0xfec23f['classList']['add']('ck-user__marker-tooltip'),_0xfec23f['setAttribute']('contenteditable','false'),_0xfec23f['setAttribute']('spellcheck','false'),_0xfec23f['textContent']=_0x45142c['name'],_0x25f669['innerHTML']='<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0xfec23f['outerHTML']+'',_0x25f669['addEventListener']('mouseenter',()=>{_0x25f669['classList']['add']('ck-user__marker_hovered');}),_0x25f669['addEventListener']('mouseleave',()=>{_0x25f669['classList']['remove']('ck-user__marker_hovered');}),_0x25f669;},_0x3f8b57['isSimilar']=function(_0xca28be){return!(!this['getCustomProperty']('userPositionMarker')||!_0xca28be['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xca28be['getAttribute']('data-session-id'));},_0x3f8b57;}(_0x3d394f,_0x1a94c9,_0x15cbc2);}(_0x5c968c,_0x41d56c,_0x3622b3,_0x44803f)}),_0x44803f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x42a6cd=>function(_0x247673,_0x169992){const _0x37f8c5=_0x247673['markerName']['split'](':')[0x2];if(_0x37f8c5===_0x169992['mySessionId'])return null;const _0x2e9bbb=_0x169992['getUserBySessionId'](_0x37f8c5);if(!_0x2e9bbb)return{'id':_0x37f8c5,'classes':[]};return{'id':_0x37f8c5,'classes':['ck-user__selection',_0x2e9bbb['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x37f8c5},'priority':0x7d0+_0x2e9bbb['orderNumber']};}(_0x42a6cd,_0x3622b3)}),function(_0x335c27){const _0x1dc04e=_0x335c27['model'],_0x42eb16=new Map(),_0x43e98f=_0x335c27['plugins']['get'](i);_0x1dc04e['markers']['on']('update:user:range',(_0xd7eb10,_0x286d6a,_0x52c87a,_0x16f626)=>{if(!_0x16f626&&_0x42eb16['get'](_0x286d6a['name']))return _0x42eb16['get'](_0x286d6a['name'])['detach'](),void _0x42eb16['delete'](_0x286d6a['name']);const _0x76e01d=_0x286d6a['name']['split'](':')[0x2];if(_0x76e01d===_0x43e98f['mySessionId'])return;const _0x3b7920='user:position:'+_0x76e01d;_0x1dc04e['markers']['has'](_0x3b7920)&&_0x335c27['editing']['reconvertMarker'](_0x3b7920),_0x286d6a['on']('change:range',(_0x4e278a,_0x448e14,_0x5117fb)=>{if('$graveyard'!=_0x448e14['root']['rootName']&&'$graveyard'==_0x286d6a['getRange']()['root']['rootName']&&!_0x42eb16['has'](_0x286d6a['name'])){const _0x18945a=_0x1dc04e['schema']['getNearestSelectionRange'](_0x5117fb['deletionPosition']);if(_0x18945a){const _0x354099=_0x332ae1['fromRange'](_0x18945a);_0x42eb16['set'](_0x286d6a['name'],_0x354099),_0x354099['on']('change:range',(_0x19f2ca,_0x4390ad,_0x58da65)=>{if('$graveyard'==_0x354099['root']['rootName']){const _0x151df5=_0x1dc04e['schema']['getNearestSelectionRange'](_0x58da65['deletionPosition']);_0x151df5?(_0x354099['start']=_0x151df5['start'],_0x354099['end']=_0x151df5['end']):(_0x42eb16['delete'](_0x286d6a['name']),_0x354099['detach']());}});}}});}),_0x1dc04e['document']['on']('change',()=>{_0x42eb16['size']>0x0&&_0x1dc04e['enqueueChange']({'isUndoable':!0x1},_0x4bbf7c=>{for(const [_0x2c729c,_0x37aed0]of _0x42eb16)'$graveyard'==_0x1dc04e['markers']['get'](_0x2c729c)['getRange']()['root']['rootName']&&(Z(_0x2c729c['split'](':')[0x2],_0x37aed0['toRange'](),_0x1dc04e,_0x4bbf7c),_0x37aed0['detach']());_0x42eb16['clear']();});});}(_0x44803f),this['_domEmitter']['listenTo'](_0x497bba['document'],'keydown',(_0x4c8842,{key:_0x3188bc})=>{'Escape'===_0x3188bc&&function(_0xb3d906){_0xb3d906['editing']['view']['change'](_0x594f63=>{for(const _0x2b55f3 of _0xb3d906['model']['markers']){if(!_0x2b55f3['name']['startsWith']('user:position'))continue;const _0xb72533=_0xb3d906['editing']['mapper']['markerNameToElements'](_0x2b55f3['name']);if(_0xb72533){for(const _0x16d777 of _0xb72533)_0x594f63['removeClass']('ck-user__marker_hovered',_0x16d777);}}});}(_0x44803f);},{'useCapture':!0x0});}['afterInit'](){const _0x22dea6=this['editor'],_0x374bbb=_0x22dea6['commands']['get']('undo');_0x374bbb&&_0x22dea6['model']['on']('applyOperation',(_0x11792d,_0x764792)=>{const _0x277932=_0x764792[0x0];if(!_0x277932['isDocumentOperation'])return;if('marker'!=_0x277932['type']||!_0x277932['name']['startsWith']('user:'))return;const _0x209dac=_0x277932['batch'];_0x374bbb['_createdBatches']['has'](_0x209dac)&&(_0x277932['newRange']=_0x277932['oldRange']?_0x22dea6['model']['createRange'](_0x277932['oldRange']['start'],_0x277932['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x330aa5=this['editor'],_0x371758=_0x330aa5['model']['document'],_0x584038=_0x330aa5['plugins']['get'](i);_0x330aa5['model']['enqueueChange']({'isUndoable':!0x1},_0x550171=>{const _0x57ae90='user:range:'+_0x584038['mySessionId'],_0x2f126e='user:position:'+_0x584038['mySessionId'],_0x37f351=_0x330aa5['model']['markers']['has'](_0x57ae90);_0x330aa5['editing']['view']['hasDomSelection']?Z(_0x584038['mySessionId'],_0x371758['selection']['getFirstRange'](),_0x330aa5['model'],_0x550171):_0x37f351&&(_0x550171['removeMarker'](_0x57ae90),_0x550171['removeMarker'](_0x2f126e));});}}function Z(_0x120035,_0x3be68d,_0x14cd30,_0x416e1f){const _0x54ae4c='user:range:'+_0x120035,_0x5dd7ef='user:position:'+_0x120035,_0x33eab6=_0x3be68d['getContainedElement']();let _0x5d07c8=_0x3be68d['start'];if(_0x33eab6&&_0x33eab6['is']('element','tableCell')){const _0x4a91b3=function(_0x5143d9,_0x4e1f11){for(const _0x11d0b0 of _0x5143d9['getPositions']())if(_0x4e1f11['schema']['checkChild'](_0x11d0b0,'$text'))return _0x11d0b0;}(_0x3be68d,_0x14cd30);_0x4a91b3&&(_0x5d07c8=_0x4a91b3,_0x3be68d=_0x416e1f['createRange'](_0x5d07c8));}const _0x2fd7c0=_0x416e1f['createRange'](_0x5d07c8);_0x14cd30['markers']['has'](_0x54ae4c)?(_0x416e1f['updateMarker'](_0x54ae4c,{'range':_0x3be68d}),_0x416e1f['updateMarker'](_0x5dd7ef,{'range':_0x2fd7c0})):(_0x416e1f['addMarker'](_0x54ae4c,{'range':_0x3be68d,'usingOperation':!0x0}),_0x416e1f['addMarker'](_0x5dd7ef,{'range':_0x2fd7c0,'usingOperation':!0x0}));}function W(_0x33651d,_0xf0090,_0x23d289){const _0x581fe1=_0x33651d['t'],t=_0x33651d['t'];switch(_0xf0090){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 _0x581fe1({'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'},_0x23d289);default:return'';}}let G=0x1;class l extends _0x582e6d{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
|
|
25
|
+
((()=>_0x508833)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,V,_0x215d15,_0x438ac2,_0x5a9875];}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 _0x3454f4=this['serverHistory']['getOperations']();for(let _0x25ffbc=_0x3454f4['length']-0x1;_0x25ffbc>=0x0;_0x25ffbc--){const _0x30fe39=_0x3454f4[_0x25ffbc];if(!this['_disconnectionOperations']['has'](_0x30fe39))return _0x30fe39['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x5e339f){if(super(_0x5e339f),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x3f0332(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x31eaa2('collaboration-missing-channelid',this);const _0x553830=_0x5e339f['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x553830,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x43f72e(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new J(this['_disconnectionOperations']);}['init'](){const _0x54fb01=this['editor'],_0x2fcd81=_0x54fb01['plugins']['get'](_0x438ac2),_0x49f151=_0x54fb01['plugins']['get'](n);this['listenTo'](_0x2fcd81,'getOperationAuthor',(_0x46a4ed,_0x2d91e1)=>{const _0x36d30c=_0x2d91e1[0x0];_0x36d30c['_authorId']&&(_0x46a4ed['return']=_0x2fcd81['getUser'](_0x36d30c['_authorId']),_0x46a4ed['stop']()),null===_0x36d30c['_authorId']&&(_0x46a4ed['return']=null,_0x46a4ed['stop']());},{'priority':'high'}),this['listenTo'](_0x54fb01['model']['document']['selection'],'change:range',(_0x147bce,_0x2664df)=>{_0x2664df['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x54fb01['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x54fb01['model']['on']('applyOperation',(_0x290000,_0x2431fb)=>{const _0x1ea2e8=_0x2431fb[0x0];_0x1ea2e8['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x1ea2e8),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x49f151,'state',this,'_hasSynchronizationProblem',(_0x49559c,_0xbf897f)=>'connected'===_0x49559c&&!_0xbf897f),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x54fb01['disableReadOnlyMode']('rtc-offline'):_0x54fb01['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x54fb01['disableReadOnlyMode']('rtc-offline'):_0x54fb01['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x57ca61=this['editor']['plugins']['get'](i),_0x1d0ddb=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x57ca61['unregister'](this['_channelId']);const _0x10eb42=await this['_service']['reconnect'](_0x1d0ddb['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x10eb42)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3b6efe=await this['_service']['getConnectedSessions']();_0x57ca61['register'](this['_channelId'],_0x3b6efe),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x228b82){if(function(_0x302a1d){return'404'===_0x302a1d['code'];}(_0x228b82)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x27c204){return'409'===_0x27c204['code'];}(_0x228b82)){const _0x40b984=W(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x40b984);}else{if(!(_0x228b82 instanceof $))throw _0x228b82;this['_handleReconnectionError']();}}}}['destroy'](){const _0x97839d=this['editor']['plugins']['get'](n),_0x2c5a0f=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2c5a0f['channelSessions']['has'](this['_channelId'])&&_0x2c5a0f['unregister'](this['_channelId']),_0x97839d['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x460978){if(this['sessionId']!==_0x460978['sessionId']&&this['_lastSyncedOperationId']!==_0x460978['lastOperationId'])throw new $();return this['sessionId']=_0x460978['sessionId'],this['_handleServerResponse']([],{..._0x460978,'wereChangesApplied':!0x1,'data':_0x460978['data']},'reconnect');}async['_connectService'](_0x1c4ba1,_0x23ef34=!0x1){const {connection:_0x3665d4}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x3665d4,this['_channelId'])['then'](_0x326279=>this['_initSessionsHandling'](_0x326279))['catch'](_0x269f5a=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x269f5a);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4f3ad1,_0x46865b)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x46865b);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x8d3450=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1c4ba1);this['_isPendingUpdate']=!0x0;const _0x3951eb=await this['_service']['connect'](_0x3665d4,this['_compressOperations'](_0x1c4ba1),_0x8d3450);if(this['sessionId']=_0x3951eb['sessionId'],_0x23ef34){if(!_0x3951eb['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3951eb['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x1c4ba1,_0x3951eb,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3951eb,_0x1c4ba1);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x26d870=this['editor']['plugins']['get'](i),_0xbfa468=this['editor']['plugins']['get'](V),_0x3c1804=_0x26d870['channelSessions']['get'](this['_channelId']);_0x3c1804&&_0x3c1804['length']>0x1?_0xbfa468['createUserMarkerOperations']():this['listenTo'](_0x26d870,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x26d870['channelSessions']['get'](this['_channelId'])['length']&&_0xbfa468['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x40d6de,_0x593564,_0x245a1e,_0x1ae8e4){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x593564){const _0x364f06=this['_decompressOperations'](_0x245a1e,_0x1ae8e4);await this['_fetchMissingUsers'](_0x364f06),this['_handleExternalOperations'](_0x364f06,_0x593564,_0x245a1e['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x356e89}=this['editor'];let _0x4c142f;try{_0x4c142f=await this['_service']['getDocumentDetails']();}catch{const _0x4efb68=W(_0x356e89,'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'](_0x4efb68);}const _0x5cdd54=_0x4c142f['currentDocumentSession']||_0x4c142f['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5cdd54['lastOperationId']){const _0x4eb043=W(_0x356e89,'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'](_0x4eb043);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x291908){const _0x4756b0=this['editor']['plugins']['get'](i);this['listenTo'](_0x4756b0,'sessionAdd:'+this['_channelId'],(_0x3eaa0f,{session:_0xd2fcd1})=>{if(_0xd2fcd1['id']===_0x4756b0['mySessionId']){_0x3eaa0f['off']();const _0x2eb4f2=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x1f503d=_0xd2fcd1['permissions'];_0x2eb4f2&&_0x2eb4f2['isEnabled']&&(_0x1f503d=_0x1f503d['filter'](_0x3707d2=>'document:write'!==_0x3707d2)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x1f503d,this['_channelId']);}}),_0x4756b0['register'](this['_channelId'],_0x291908);}['_initThrowingOnDataSet'](){const _0x313db9=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4cc8f0)=>{if(!_0x4cc8f0[_0x4cc8f0['length']-0x1]['suppressErrorInCollaboration'])throw new _0x31eaa2('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x313db9['apply'](this['editor']['data'],_0x4cc8f0);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0xf4317d,[_0x2ca527])=>{if(this['_document']['version'])throw new _0x31eaa2('realtimecollaborationclient-init-document-already-initialized',this);_0xf4317d['stop'](),this['_setPendingAction']();const _0x1411c5=this['editor']['config']['get']('rootsAttributes'),_0x26384a=this['_getOperationsFromInitData'](_0x2ca527,_0x1411c5);0x0==_0x26384a['length']&&_0x26384a['push'](new _0x59727a(0x0)),_0xf4317d['return']=this['_connectService'](_0x26384a)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x463d7e=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x463d7e))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3c12bd,[_0x2e55db,_0x25b089])=>{_0x3c12bd['stop']();const _0x3864eb=this['editor']['model']['document']['getRoot'](_0x2e55db);if(!this['_knownRootNames']['has'](_0x2e55db)){const _0x11466b=_0x25b089&&_0x25b089['data']?_0x25b089['data']:'',_0x1c3cc0=_0x25b089&&_0x25b089['attributes']?_0x25b089['attributes']:{};await this['_loadRoot'](_0x2e55db,_0x11466b,_0x1c3cc0);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3864eb['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3864eb);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x3bb6d6){const _0x4ad34a=this['editor']['plugins']['get'](_0x438ac2),{connection:_0x32bd80}=this['editor']['plugins']['get'](n),_0x487d40=new Set();for(const _0xeaebee of _0x3bb6d6){const _0x53e038=_0xeaebee['_authorId'];_0x53e038&&!_0x4ad34a['getUser'](_0x53e038)&&_0x487d40['add'](_0x53e038);}if(0x0===_0x487d40['size'])return;const _0x15ce6c=await lt['getMany'](_0x32bd80,Array['from'](_0x487d40));for(const _0x146969 of _0x15ce6c)_0x4ad34a['getUser'](_0x146969['id'])||_0x4ad34a['addUser'](_0x146969);}['_getOperationsFromInitData'](_0x364c04,_0x2716f3={}){const _0x82d1f6=this['editor']['model'],_0x34000c=[];let _0x255d97=0x0;const _0x379fda='string'==typeof _0x364c04?{'main':_0x364c04}:_0x364c04;for(const _0x2aaf61 of Object['keys'](_0x379fda)){if(!this['_document']['roots']['has'](_0x2aaf61))throw new _0x31eaa2('realtimecollaborationclient-init-non-existent-root',this);const _0xfc628f=this['editor']['data']['parse'](_0x379fda[_0x2aaf61]),_0x529c99=this['_document']['getRoot'](_0x2aaf61),_0x1cd314=new _0x1b2e5d(_0x82d1f6['createPositionAt'](_0x529c99,0x0),_0xfc628f,_0x255d97++);_0x34000c['push'](_0x1cd314);for(const [_0x2dc71e,_0x13e505]of _0xfc628f['markers']){const _0x2506a5=_0x82d1f6['createRange'](_0x82d1f6['createPositionFromPath'](_0x529c99,_0x13e505['start']['path']['slice']()),_0x82d1f6['createPositionFromPath'](_0x529c99,_0x13e505['end']['path']['slice']())),_0x46c4c9=new _0x41ae6b(_0x2dc71e,null,_0x2506a5,_0x82d1f6['markers'],!0x0,_0x255d97++);_0x34000c['push'](_0x46c4c9);}}if(_0x2716f3)for(const [_0x15074a,_0x1de248]of Object['entries'](_0x2716f3)){const _0x2d65ed=_0x82d1f6['document']['getRoot'](_0x15074a);if(!_0x2d65ed)throw new _0x31eaa2('multi-root-editor-root-attributes-no-root',null);for(const [_0x1a4f95,_0x1b9dec]of Object['entries'](_0x1de248))if(null!==_0x1b9dec){const _0x4410af=new _0x4ab7ff(_0x2d65ed,_0x1a4f95,null,_0x1b9dec,_0x255d97++);_0x34000c['push'](_0x4410af);}}return _0x34000c;}async['_loadRoot'](_0x56bbab,_0x451a4e,_0x603916){this['_getOperationsFromInitData']({[_0x56bbab]:_0x451a4e},{[_0x56bbab]:_0x603916})['forEach']((_0x2d245c,_0x2eb79a)=>{_0x2d245c['baseVersion']=this['_document']['version']+_0x2eb79a,_0x2d245c['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x2d245c);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x23a982,_0x37769b){let _0x539dd1;this['_offset']=_0x23a982['offset'];const _0xb0d2fe=_0x23a982['wereChangesApplied']&&!_0x23a982['initData'],_0x474846=_0xb0d2fe?0x0:_0x23a982['data']['baseVersion'];if(_0x37769b['forEach'](_0x584ffc=>{_0x584ffc['_isInit']=!0x0,_0x584ffc['createdAt']=_0x23a982['sessionCreatedAt'],_0x584ffc['_authorId']=null;}),_0xb0d2fe)_0x539dd1=_0x37769b,this['_applyOperationsSet'](_0x539dd1,_0xb0d2fe);else{if(_0x23a982['initData']){const _0x1c1123=this['_getOperationsFromInitData'](_0x23a982['initData']);this['_document']['history']['version']=-_0x1c1123['length'],_0x1c1123['forEach'](_0x5c0545=>{_0x5c0545['baseVersion']-=_0x1c1123['length'],_0x5c0545['createdAt']=_0x23a982['sessionCreatedAt'],_0x5c0545['_isInit']=!0x0,_0x5c0545['_authorId']=null;}),this['_applyOperationsSet'](_0x1c1123,!0x0),this['serverHistory']['version']=-_0x1c1123['length']+this['_offset'],this['_updateServerHistory'](_0x1c1123);}this['_document']['history']['version']=_0x474846,_0x539dd1=this['_decompressOperations'](_0x23a982['data'],_0x23a982['metadata']),await this['_fetchMissingUsers'](_0x539dd1),this['_applyOperationsSet'](_0x539dd1,_0xb0d2fe);}_0x23a982['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x539dd1,_0x23a982['lastOperationId']),this['_lastSyncedOperationId']=_0x23a982['lastOperationId']),this['serverHistory']['version']=_0x474846+this['_offset'],this['_updateServerHistory'](_0x539dd1),_0x37769b['filter'](_0x308d09=>{const _0x4da5e0=this['_getAffectedRoot'](_0x308d09);return _0x4da5e0&&!this['_knownRootNames']['has'](_0x4da5e0);})['forEach']((_0x17f4a1,_0x4a0f5b)=>{_0x17f4a1['baseVersion']=this['_document']['version']+_0x4a0f5b,this['_saveOperationInBuffer'](_0x17f4a1);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x5b69e4,_0x35ba0f){const _0xa7faa1=_0x35ba0f&&_0x35ba0f['message'];if(_0xa7faa1&&_0xa7faa1['startsWith']('realtimecollaborationclient'))throw _0x35ba0f;const _0x520424=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x520424['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x31eaa2(_0x5b69e4,this['editor'],_0xa7faa1?{'originalError':_0xa7faa1}:void 0x0);}['_saveOperationInBuffer'](_0x2ca0e1){this['_knownOperations']['has'](_0x2ca0e1)||(this['_knownOperations']['add'](_0x2ca0e1),this['_bufferedOperations']['push'](_0x2ca0e1),this['_pendingAction']||'marker'==_0x2ca0e1['type']&&!_0x2ca0e1['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x5de0c2=!0x1){!_0x5de0c2&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3c9596=>{_0x3c9596&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x31b2d0=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xbb648a){return _0xbb648a['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xbb648a['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xbb648a['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x31b2d0)||this['_crash'](_0x31b2d0['message'],_0x31b2d0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x42e0a6=>{this['on']('change:_isPendingUpdate',()=>{_0x42e0a6();});});}async['_sendBufferedOperations'](){const _0x2c3a34=this['editor']['plugins']['get'](V);if(this['_shouldSendSelectionUpdate']()&&(_0x2c3a34['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3feace=[...this['_bufferedOperations']];for(const _0xb2e5c6 of _0x3feace)_0xb2e5c6['wasUndone']=this['_document']['history']['isUndoneOperation'](_0xb2e5c6);const _0x2459b5=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3feace),_0x12c402=G++,_0x56d892=this['_compressOperations'](_0x3feace),_0x28fa25=await this['_service']['sendOperations'](_0x56d892,_0x56d892['baseVersion'],_0x2459b5);try{return await this['_handleServerResponse'](_0x3feace,_0x28fa25,_0x12c402);}catch(_0x879cb3){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x879cb3);}}async['_handleServerResponse'](_0x4ad23a,_0x26c559,_0x56a997){if('error'in _0x26c559)throw _0x26c559['error'];let _0x522076=!0x1;if(_0x26c559['wereChangesApplied']){_0x26c559['lastOperationId']&&(this['_lastSyncedOperationId']=_0x26c559['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4d5391=>!_0x4ad23a['includes'](_0x4d5391));for(const _0x3f2e23 of _0x4ad23a)_0x3f2e23['createdAt']='lastOperationAcceptedAt'in _0x26c559&&_0x26c559['lastOperationAcceptedAt']||void 0x0;K(_0x4ad23a,_0x26c559['version']-_0x4ad23a['length']),this['_updateServerHistory'](_0x4ad23a);const _0x2f05ed=_0x4ad23a['filter'](_0x296577=>{if(!_0x296577['_isInit'])return!0x1;const _0x135071=this['_getAffectedRoot'](_0x296577);return _0x135071&&!this['_knownRootNames']['has'](_0x135071);});K(_0x2f05ed,this['_document']['version']),this['_applyOperationsSet'](_0x2f05ed),_0x522076=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x4b7b86=this['_decompressOperations'](_0x26c559['data'],_0x26c559['metadata'])['filter'](_0xac351a=>_0xac351a['baseVersion']>=this['_lastServerVersion']);_0x4b7b86['forEach'](_0x2a3c33=>this['_addKnownRoot'](_0x2a3c33)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x38c7a1=>!_0x38c7a1['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x38c7a1))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x4b7b86),_0x522076=this['_handleExternalOperations'](_0x4b7b86,_0x26c559['version'],_0x26c559['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x522076?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x29b135,_0x5e707d,_0x28e859){try{const _0x3b9f8b={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x53ecfb,operationsB:_0x477344,originalOperations:_0x46db68}=_0x4b4afd(_0x29b135,this['_bufferedOperations'],_0x3b9f8b);K(_0x53ecfb,this['_document']['version']),K(_0x477344,_0x5e707d);for(const _0x4fabed of _0x53ecfb){const _0x24e25c=_0x46db68['get'](_0x4fabed);_0x4fabed['_authorId']=_0x24e25c?_0x24e25c['_authorId']:null;}_0x28e859&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x29b135,_0x28e859),this['_lastSyncedOperationId']=_0x28e859),this['_bufferedOperations']=[..._0x477344],this['_applyOperationsSet'](_0x53ecfb),this['_updateServerHistory'](_0x29b135);}catch(_0x18a9f0){return console['error'](_0x18a9f0),!0x1;}return!0x0;}['_applyOperationsSet'](_0x47412f,_0x578231=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x41cd76=>{for(const _0xfb0569 of _0x47412f)this['_knownOperations']['add'](_0xfb0569),this['_addKnownRoot'](_0xfb0569),_0x41cd76['batch']['addOperation'](_0xfb0569),this['editor']['model']['applyOperation'](_0xfb0569);});}['_addKnownRoot'](_0x52234b){const _0x43fc5f=this['_getAffectedRoot'](_0x52234b);_0x43fc5f&&this['_knownRootNames']['add'](_0x43fc5f);}['_getAffectedRoot'](_0x2ea2f6){let _0x1207fe,_0x132d27;switch(_0x2ea2f6['type']){case'insert':_0x1207fe=_0x2ea2f6['position']['root'];break;case'marker':if(_0x132d27=_0x2ea2f6['newRange'],!_0x132d27)return null;_0x1207fe=_0x132d27['root'];break;case'addRootAttribute':_0x1207fe=_0x2ea2f6['root'];break;case'addRoot':_0x1207fe=_0x2ea2f6['affectedSelectable'];break;case'move':_0x1207fe=_0x2ea2f6['targetPosition']['root'];break;default:return null;}return _0x1207fe['rootName'];}['_updateServerHistory'](_0x5637d5){_0x5637d5['forEach'](_0x54f77a=>{const _0x48065b=_0x54f77a['clone']();_0x48065b['_authorId']=_0x54f77a['_authorId'],_0x48065b['_isInit']=!!_0x54f77a['_isInit'],_0x48065b['createdAt']=_0x54f77a['createdAt'],_0x48065b['baseVersion']+=this['_offset'],_0x54f77a['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x48065b),this['serverHistory']['addOperation'](_0x48065b);});}['_handleReconnectionError'](_0x1bbfd0){const _0x336f28=this['editor']['plugins']['get']('Notification'),_0x3effcf=this['editor']['locale'];_0x1bbfd0||(_0x1bbfd0=W(_0x3effcf,'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.')),_0x336f28['showWarning'](_0x1bbfd0,{'title':W(_0x3effcf,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x215d15)['add'](W(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x215d15)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5da727){const _0x279f73=_0x5da727['map'](_0xfe8049=>_0xfe8049['toJSON']());return this['_compressor']['compress'](_0x279f73);}['_decompressOperations'](_0x102462,_0x1538f3){return this['_compressor']['decompress'](_0x102462)['map']((_0x42ac0d,_0xc49274)=>{const _0x179643='init'==_0x1538f3[_0xc49274]['type'];if('InsertOperation'==_0x42ac0d['__className']){const _0x12fb52=_0x42ac0d['position']['root'];!this['_document']['getRoot'](_0x12fb52)&&(this['_document']['createRoot']('$root',_0x12fb52)['_isAttached']=!0x1);}const _0xf0625d=_0x52243b['fromJSON'](_0x42ac0d,this['_document']);return _0xf0625d['wasUndone']=_0x42ac0d['wasUndone'],_0xf0625d['_isInit']=_0x179643,_0xf0625d['_authorId']=_0x179643?null:_0x1538f3[_0xc49274]['userId'],_0xf0625d['_isDisconnection']='cs:removeUser'===_0x1538f3[_0xc49274]['type'],_0xf0625d['createdAt']=_0x1538f3[_0xc49274]['createdAt'],_0xf0625d;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x4b6c59=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x4b6c59&&_0x4b6c59['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x20a63f,_0xad21ed){for(const _0x25e8a6 of _0x20a63f)_0x25e8a6['baseVersion']=_0xad21ed++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0xcb0b04){this['_ignoredOperations']=_0xcb0b04,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x46dd38){let _0x256530=_0x46dd38['length'];for(;_0x256530--;){const _0x37cb2e=_0x46dd38[_0x256530];if(!this['_ignoredOperations']['has'](_0x37cb2e)){if(!this['_operationToId']['has'](_0x37cb2e)){const _0x32eb54=_0xde7275()['slice'](0x1,0x12);this['_operationToId']['set'](_0x37cb2e,_0x32eb54);}return this['_operationToId']['get'](_0x37cb2e);}}}['setIdForTheLastOperation'](_0x2639e4,_0x4788b2){if(!_0x4788b2)return;let _0x13e2c8=_0x2639e4['length'];for(;_0x13e2c8--;){const _0x459b12=_0x2639e4[_0x13e2c8];this['_ignoredOperations']['has'](_0x459b12)||this['_operationToId']['set'](_0x459b12,_0x4788b2);}}}class a extends _0x582e6d{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x14a72f{static ['CommentsService']=/* #__PURE__ -- @preserve */
|
|
26
|
+
((()=>_0x4357f9)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x438ac2];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x25a5f7){super(_0x25a5f7),this['_services']=new Map();}async['init'](){const _0x25000b=this['context'],_0x2058af=_0x25000b['plugins']['get']('CommentsRepository');if(_0x25000b['plugins']['get'](n)['addToReconnectionStack'](this),_0x2058af['adapter']={'addCommentThread':async({channelId:_0x356012,threadId:_0x1e46a6,comments:_0x1a6b2a,resolvedAt:_0x499551,resolvedBy:_0x5f0a35,context:_0x31722e,attributes:_0x47a89c})=>{const _0x54357a=await this['_getService'](_0x356012)['addCommentThread']({'commentThreadId':_0x1e46a6,'comments':_0x1a6b2a['map'](_0x39d5b9=>function(_0x3dcb83,_0x51564c,_0x48bde3){return{'commentThreadId':_0x48bde3,'commentId':_0x3dcb83['commentId'],'userId':_0x3dcb83['authorId'],'content':_0x3dcb83['content'],'documentId':_0x51564c,'createdAt':_0x3dcb83['createdAt'],'attributes':_0x3dcb83['attributes']||{}};}(_0x39d5b9,_0x356012,_0x1e46a6)),'resolvedAt':_0x499551,'resolvedBy':_0x5f0a35,'context':_0x31722e,'attributes':_0x47a89c})['catch'](dt);return{'threadId':_0x54357a['commentThreadId'],'comments':_0x54357a['comments']};},'getCommentThread':async({channelId:_0x18e8d6,threadId:_0x3de446})=>{const _0x5abc4c=await this['_getService'](_0x18e8d6)['getCommentThread'](_0x3de446)['catch'](v)['catch'](dt);return _0x5abc4c?_0x5abc4c['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x5abc4c]),{'threadId':_0x5abc4c['commentThreadId'],'comments':_0x5abc4c['comments']['map'](p),'context':_0x5abc4c['context'],'resolvedAt':_0x5abc4c['resolvedAt'],'resolvedBy':_0x5abc4c['resolvedBy'],'attributes':_0x5abc4c['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x5b0295,threadId:_0x327378,context:_0x431b69,unlinkedAt:_0x27da3b,attributes:_0x2d8a6a})=>this['_getService'](_0x5b0295)['updateCommentThread']({'commentThreadId':_0x327378,'context':_0x431b69,'attributes':_0x2d8a6a,'unlinkedAt':_0x27da3b})['catch'](v)['catch'](dt),'resolveCommentThread':async({channelId:_0x4d22a2,threadId:_0x5a9364})=>{const _0x59dbf8=await this['_getService'](_0x4d22a2)['resolveCommentThread'](_0x5a9364)['catch'](v)['catch'](dt);return{'threadId':_0x59dbf8['commentThreadId'],'resolvedAt':_0x59dbf8['resolvedAt'],'resolvedBy':_0x59dbf8['resolvedBy']};},'reopenCommentThread':async({channelId:_0x1efff2,threadId:_0x129368})=>this['_getService'](_0x1efff2)['reopenCommentThread'](_0x129368)['catch'](v)['catch'](dt),'removeCommentThread':({channelId:_0x1f6e5d,threadId:_0x511de2})=>this['_getService'](_0x1f6e5d)['removeCommentThread'](_0x511de2)['catch'](v)['catch'](dt),'addComment':({channelId:_0x310abf,threadId:_0x35b535,commentId:_0x117a3b,content:_0x582c54,attributes:_0x4fac3c})=>this['_getService'](_0x310abf)['addComment'](_0x35b535,_0x117a3b,_0x582c54,_0x4fac3c)['catch'](dt),'updateComment':({channelId:_0x11acc8,threadId:_0x43b3f9,commentId:_0x350b43,content:_0x283da9,attributes:_0x2c6722})=>this['_getService'](_0x11acc8)['updateComment'](_0x43b3f9,_0x350b43,_0x283da9,_0x2c6722)['catch'](v)['catch'](dt),'removeComment':({channelId:_0x35ce87,threadId:_0x412d55,commentId:_0x11f29d})=>this['_getService'](_0x35ce87)['removeComment'](_0x412d55,_0x11f29d)['catch'](v)['catch'](dt)},_0x25000b instanceof _0x3e4173){const _0x1aed8a=_0x25000b['config']['get']('collaboration.channelId'),_0x3da8b7=_0x25000b['plugins']['get'](i);await this['_setUpService'](_0x1aed8a);const _0x1a1063=await this['_services']['get'](_0x1aed8a)['getConnectedSessions']();this['listenTo'](_0x3da8b7,'sessionAdd:'+_0x1aed8a,(_0x39f832,{session:_0x1deb3a})=>{_0x1deb3a['id']===_0x3da8b7['mySessionId']&&(_0x39f832['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x1deb3a['permissions'],_0x1aed8a));}),_0x3da8b7['register'](_0x1aed8a,_0x1a1063);}}async['_setUpService'](_0x2c90e0){if(this['_services']['has'](_0x2c90e0))throw new _0x31eaa2('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x2c90e0});const _0x4d3fd8=this['context']['plugins']['get']('CommentsRepository'),_0x11db01=new s['CommentsService'](_0x2c90e0);this['_services']['set'](_0x2c90e0,_0x11db01),this['listenTo'](_0x11db01,'commentThreadAdded',(_0x5667b7,_0x469b30)=>{const {commentThreadId:_0x3fc744,documentId:_0x4be6cf,context:_0x3f1af5,attributes:_0x5686df,resolvedAt:_0x296473,resolvedBy:_0x2eca57,comments:_0x5a71be}=_0x469b30;_0x4d3fd8['getCommentThread'](_0x3fc744)||_0x4d3fd8['addCommentThread']({'threadId':_0x3fc744,'channelId':_0x4be6cf,'comments':_0x5a71be?_0x5a71be['map'](p):[],'context':_0x3f1af5,'attributes':_0x5686df,'resolvedAt':_0x296473,'resolvedBy':_0x2eca57,'isFromAdapter':!0x0});}),this['listenTo'](_0x11db01,'commentThreadUpdated',(_0x5873a4,{commentThreadId:_0x1e7404,documentId:_0x1681cc,context:_0x10b264,unlinkedAt:_0xaa2a25,attributes:_0x106988})=>{_0x4d3fd8['getCommentThread'](_0x1e7404)&&_0x4d3fd8['updateCommentThread']({'threadId':_0x1e7404,'channelId':_0x1681cc,'context':_0x10b264,'unlinkedAt':_0xaa2a25,'attributes':_0x106988,'isFromAdapter':!0x0});}),this['listenTo'](_0x11db01,'commentThreadResolved',(_0x169336,{commentThreadId:_0x4d60f7,resolvedBy:_0x3a13c0,resolvedAt:_0x12b108})=>{const _0x46cff6=_0x4d3fd8['getCommentThread'](_0x4d60f7);_0x46cff6&&_0x46cff6['resolve']({'resolvedBy':_0x3a13c0,'resolvedAt':_0x12b108,'isFromAdapter':!0x0});}),this['listenTo'](_0x11db01,'commentThreadReopened',(_0x10f4c0,{commentThreadId:_0x1a4602})=>{const _0x52ab82=_0x4d3fd8['getCommentThread'](_0x1a4602);_0x52ab82&&_0x52ab82['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x11db01,'commentThreadRemoved',(_0x15d53b,{commentThreadId:_0x1ee3ee})=>{const _0x10dcdb=_0x4d3fd8['getCommentThread'](_0x1ee3ee);_0x10dcdb&&_0x10dcdb['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x11db01,'commentAdded',(_0x2e5155,_0xf78915)=>{const _0x4dfa04=_0xf78915['commentThreadId'],_0x11432a=_0x4d3fd8['getCommentThread'](_0x4dfa04);_0x11432a&&_0x11432a['addComment']({...p(_0xf78915),'isFromAdapter':!0x0});}),this['listenTo'](_0x11db01,'commentUpdated',(_0x15778a,{commentThreadId:_0x1650a8,commentId:_0x19d1c6,content:_0x595859,attributes:_0x11f9ce})=>{const _0x462111=_0x4d3fd8['getCommentThread'](_0x1650a8);if(_0x462111){const _0x39328f=_0x462111['getComment'](_0x19d1c6);_0x39328f&&_0x39328f['update']({'content':_0x595859,'attributes':_0x11f9ce,'isFromAdapter':!0x0});}}),this['listenTo'](_0x11db01,'commentRemoved',(_0xf23d7e,{commentThreadId:_0x124180,commentId:_0x316600})=>{const _0x2fe6dc=_0x4d3fd8['getCommentThread'](_0x124180);if(_0x2fe6dc){const _0x5bc410=_0x2fe6dc['getComment'](_0x316600);_0x5bc410&&_0x5bc410['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x2c90e0);}['destroy'](){if(this['context']instanceof _0x3e4173){const _0x3a2bfb=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3a2bfb);}}['_terminateService'](_0x23e62d){if(!this['_services']['has'](_0x23e62d))throw new _0x31eaa2('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x23e62d});this['_getService'](_0x23e62d)['disconnect'](),this['_services']['delete'](_0x23e62d);}async['reconnect'](){for(const _0x362989 of this['_services']['keys']())await this['_connectService'](_0x362989);if(this['context']instanceof _0x3e4173){const _0x3abf77=this['context']['config']['get']('collaboration.channelId'),_0x3a1468=this['context']['plugins']['get'](i);_0x3a1468['unregister'](_0x3abf77);const _0x345649=await this['_services']['get'](_0x3abf77)['getConnectedSessions']();_0x3a1468['register'](_0x3abf77,_0x345649);}}async['_connectService'](_0x5944e6){const {connection:_0x33b1c5}=this['context']['plugins']['get'](n),_0x45ee48=this['context']['plugins']['get']('CommentsRepository'),_0x50a41c=this['_services']['get'](_0x5944e6),_0x3d213c=await _0x50a41c['connect'](_0x33b1c5);await this['_fetchMissingUsersForThreads'](_0x3d213c);const _0x24aaff=new Set(Array['from'](_0x45ee48['getCommentThreads']({'channelId':_0x5944e6}),_0xfcd3c2=>_0xfcd3c2['id']));for(const _0x3537b2 of _0x3d213c)_0x3537b2['deletedAt']||_0x24aaff['delete'](_0x3537b2['commentThreadId']);for(const _0x5d5602 of _0x24aaff)_0x45ee48['getCommentThread'](_0x5d5602)['remove']({'isFromAdapter':!0x0});for(const _0x5d9ed6 of _0x3d213c){let _0x25675d=_0x45ee48['getCommentThread'](_0x5d9ed6['commentThreadId']);const {commentThreadId:_0x54bf0e,context:_0x1e29e3,attributes:_0x2f3399,resolvedBy:_0xb59ac8,resolvedAt:_0x1f3ebe,unlinkedAt:_0x15665c,deletedAt:_0x4ee970}=_0x5d9ed6;if(_0x4ee970)continue;_0x25675d||(_0x25675d=_0x45ee48['addCommentThread']({'channelId':_0x5944e6,'threadId':_0x54bf0e,'context':_0x1e29e3,'attributes':_0x2f3399||{},'resolvedBy':_0xb59ac8,'resolvedAt':_0x1f3ebe,'unlinkedAt':_0x15665c,'isFromAdapter':!0x0}));const _0x55ae83=new Set(Array['from'](_0x25675d['comments'],_0x331550=>_0x331550['id']));for(const _0x1cbde1 of _0x5d9ed6['comments'])_0x55ae83['delete'](_0x1cbde1['commentId']);for(const _0x17eafb of _0x55ae83)_0x25675d['getComment'](_0x17eafb)['remove']({'isFromAdapter':!0x0});for(const _0x2c7a8f of _0x5d9ed6['comments']){const _0x685431=_0x25675d['getComment'](_0x2c7a8f['commentId']);_0x685431?_0x685431['content']!==_0x2c7a8f['content']&&_0x685431['update']({'content':_0x2c7a8f['content'],'isFromAdapter':!0x0}):_0x25675d['addComment'](Object['assign'](p(_0x2c7a8f),{'isFromAdapter':!0x0}));}}}['_getService'](_0x4d9fee){if(!this['_services']['has'](_0x4d9fee))throw new _0x31eaa2('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x4d9fee});return this['_services']['get'](_0x4d9fee);}async['_fetchMissingUsersForThreads'](_0x17647e){const _0x5b53bb=this['context']['plugins']['get'](_0x438ac2),{connection:_0x22450e}=this['context']['plugins']['get'](n),_0x2bd460=new Set();for(const {resolvedBy:_0x6e235b,comments:_0x323f91}of _0x17647e){_0x6e235b&&!_0x5b53bb['getUser'](_0x6e235b)&&_0x2bd460['add'](_0x6e235b);for(const {userId:_0x9525c2}of _0x323f91)_0x5b53bb['getUser'](_0x9525c2)||_0x2bd460['add'](_0x9525c2);}if(0x0===_0x2bd460['size'])return;const _0x39b63b=await lt['getMany'](_0x22450e,Array['from'](_0x2bd460));for(const _0x3fb693 of _0x39b63b)_0x5b53bb['getUser'](_0x3fb693['id'])||_0x5b53bb['addUser'](_0x3fb693);}}async function v(_0x430b86){if('404'!==_0x430b86['code'])throw _0x430b86;}function dt(_0x396e87){if((_0x580447=_0x396e87)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x580447['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x580447['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x580447;throw _0x396e87;}function p(_0x30029f){return{'threadId':_0x30029f['commentThreadId'],'commentId':_0x30029f['commentId'],'content':_0x30029f['content'],'createdAt':_0x30029f['createdAt'],'authorId':_0x30029f['userId'],'attributes':_0x30029f['attributes']||{}};}class m extends _0x582e6d{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
|
|
27
|
+
((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4ffee8){super(_0x4ffee8);const _0x3aa480=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x3aa480);}['init'](){const _0x54f9e4=this['editor']['plugins']['get'](n),_0x1befa1=this['editor']['plugins']['get']('TrackChangesEditing');return _0x1befa1['adapter']={'getSuggestion':async _0xd0bffa=>{await this['_waitForServiceReady']();const _0x572117=await this['_trackChangesService']['get'](_0xd0bffa)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0x572117]),_0x572117;},'addSuggestion':async({id:_0x1e35ba,type:_0x3e2dbb,data:_0x42fbbd,originalSuggestionId:_0x30f2e2,attributes:_0x4c30d8})=>{await this['_waitForServiceReady']();const _0x446c9c={'id':_0x1e35ba,'type':_0x3e2dbb,'data':_0x42fbbd,'originalSuggestionId':_0x30f2e2,'attributes':_0x4c30d8},_0x2d6ad3=await this['_trackChangesService']['add'](_0x1e35ba,_0x3e2dbb,_0x42fbbd,_0x30f2e2,_0x4c30d8)['catch'](_0x1f410e=>{if(ut(_0x1f410e))return new Promise(_0x5b7baf=>{this['_bufferedRequests']['set'](_0x1e35ba,{'resolve':_0x5b7baf,'suggestionData':_0x446c9c});});throw _0x1f410e;});return this['_bufferedRequests']['delete'](_0x1e35ba),_0x2d6ad3;},'updateSuggestion':async(_0x1defa9,_0x4fc7bd)=>{if(await this['_waitForServiceReady'](),'open'!==_0x4fc7bd['state'])return this['_trackChangesService']['update'](_0x1defa9,_0x4fc7bd)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x2f32f5,_0x259337)=>{_0x1befa1['hasSuggestion'](_0x259337['id'])&&(_0x1befa1['getSuggestion'](_0x259337['id'])['attributes']=_0x259337['attributes']);}),this['_trackChangesService']['connect'](_0x54f9e4['connection'])['then'](_0x38f474=>(_0x54f9e4['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x38f474)['then'](()=>{for(const _0x3f41de of _0x38f474){_0x1befa1['addSuggestionData'](_0x3f41de)['_saved']=!0x0;}})));}async['reconnect'](){const _0x337e87=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x6b5e66}=this['editor']['plugins']['get'](n),_0xe5848c=await this['_trackChangesService']['connect'](_0x6b5e66);await this['_fetchMissingUsersForThreads'](_0xe5848c);for(const {suggestionData:_0x6f9260,resolve:_0x47ef49}of this['_bufferedRequests']['values']()){let _0x10ca48=_0xe5848c['find'](_0x32dba9=>_0x32dba9['id']===_0x6f9260['id']);_0x10ca48||(_0x10ca48=await this['_trackChangesService']['add'](_0x6f9260['id'],_0x6f9260['type'],_0x6f9260['data'],_0x6f9260['originalSuggestionId'])),_0x47ef49(_0x10ca48);}for(const _0x2c73f9 of _0xe5848c)_0x337e87['hasSuggestion'](_0x2c73f9['id'])||_0x337e87['addSuggestionData'](_0x2c73f9);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x55b50c=>{this['listenTo'](this['_trackChangesService'],'connected',_0x553084=>{_0x553084['off'](),_0x55b50c();});});}async['_fetchMissingUsersForThreads'](_0x3e7e6e){const _0x51d32b=this['editor']['plugins']['get'](_0x438ac2),{connection:_0x5721b9}=this['editor']['plugins']['get'](n),_0x2b4382=new Set();for(const {authorId:_0x2ca6af}of _0x3e7e6e)_0x51d32b['getUser'](_0x2ca6af)||_0x2b4382['add'](_0x2ca6af);if(0x0===_0x2b4382['size'])return;const _0x107dcc=await lt['getMany'](_0x5721b9,Array['from'](_0x2b4382));for(const _0x105ea6 of _0x107dcc)_0x51d32b['getUser'](_0x105ea6['id'])||_0x51d32b['addUser'](_0x105ea6);}}function A(_0x8c99ad){if(ut(_0x8c99ad))return new Promise(()=>{});throw _0x8c99ad;}function ut(_0x3861d6){return _0x3861d6['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3861d6['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x582e6d{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x18d008=this['editor']['plugins']['get'](n),_0x4cb584=this['editor']['plugins']['get']('CommentsEditing'),_0x1486ab=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x18d008,'change:state',(_0x448d46,_0x3b4920,_0x1286cd)=>{_0x4cb584['isThreadsLoadingPaused']='connected'!==_0x1286cd;});}),this['listenTo'](_0x18d008,'change:state',(_0x27fd28,_0x3a349e,_0x2209ec)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x2209ec);}),_0x1486ab['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0x582e6d{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x582e6d{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
|
|
28
|
+
((()=>et)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x438ac2];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3134f8){super(_0x3134f8);const _0x111a7a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x111a7a);}async['init'](){const _0x472a9f=this['editor']['plugins']['get'](l),_0x27992f=_0x472a9f['serverHistory'],_0x30a8f5=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x27992f,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x472a9f['sessionId']});const _0x348948=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x7e8f84=await st['isBundleUploaded'](_0x30a8f5['connection'],_0x348948);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x769631})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x769631)),'updateRevisions':async _0x2e65e3=>{await this['_waitForServiceReady']();const _0x9d08a4=this['_revisionTracker']['currentRevision'];if(_0x7e8f84&&0x1===_0x2e65e3['length']&&_0x2e65e3[0x0]['id']===_0x9d08a4['id'])return _0x2e65e3;for(const _0x5831e6 of _0x2e65e3)_0x5831e6['id']===_0x9d08a4['id']&&(_0x5831e6['isEmptyCurrent']=_0x5831e6['fromVersion']===_0x5831e6['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x2e65e3,this['_lastRequestId'])['then'](_0x5dcefa=>(this['_lastRequestId']=_0x5dcefa,_0x2e65e3))['catch'](_0x9c96f0=>{if(it(_0x9c96f0)||'400'===_0x9c96f0['code']&&void 0x0!==_0x9c96f0['data']['wrongRequestId']){for(const _0xba0a5f of _0x2e65e3){!this['_revisionTracker']['repository']['getRevision'](_0xba0a5f['id'])||this['_revisionTracker']['_bufferUpdate'](_0xba0a5f['id'],_0xba0a5f,!0x1);}if(it(_0x9c96f0))throw _0x9c96f0;return _0x2e65e3;}throw _0x9c96f0;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x329ebe,{revisionsData:_0x519008,requestId:_0x38a9e2})=>{Math['max'](..._0x519008['map'](_0x22398e=>_0x22398e['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x519008,_0x38a9e2);}):this['_handleRevisionsUpdate'](_0x519008,_0x38a9e2);});const {revisions:_0x30b875,requestId:_0x4f9668}=await this['_revisionHistoryService']['connect'](_0x30a8f5['connection']);_0x30a8f5['addToReconnectionStack'](this),this['_lastRequestId']=_0x4f9668,await this['_fetchMissingUsers'](_0x30b875);for(const _0x51869f of _0x30b875)this['_revisionTracker']['addRevisionData'](_0x51869f);this['listenTo'](_0x472a9f,'change:_isConnected',(_0x4153b1,_0x2b1b5d,_0x56520e)=>{_0x56520e&&(this['_oldOffset']=_0x472a9f['_offset'],_0x4153b1['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x30a8f5,'state',_0x12f1b4=>_0x12f1b4===te['CONNECTED']);}async['reconnect'](){const _0x2ebd81=this['editor']['plugins']['get'](n),_0x34b170=this['editor']['plugins']['get'](l),_0xd2283e=async()=>{const _0x2f27a3=this['_revisionTracker']['currentRevision'],_0xdecf5a=_0x2f27a3['id'],_0x5e8cfe=_0xdecf5a!==_0x34b170['sessionId'];if(_0x5e8cfe){const _0x5f347c=_0x34b170['_offset']-this['_oldOffset'],_0x5a7458=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2f27a3['toVersion']+_0x5f347c!==_0x5a7458){const _0x17b78e=_0x2f27a3['fromVersion']+_0x5f347c,_0x4fbb2a=this['editor']['plugins']['get'](_0x438ac2),_0x1b5b9c=this['_revisionTracker']['buildRevisionData']({'revision':_0x2f27a3,'from':_0x17b78e,'to':_0x5a7458});_0x1b5b9c['id']=_0x2f27a3['id'];const _0x4f8b9b=_0x1b5b9c['authorsIds']['map'](_0xc6d0b4=>_0x4fbb2a['getUser'](_0xc6d0b4));_0x2f27a3['_update']({..._0x1b5b9c,'authors':_0x4f8b9b},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2f27a3['id'],_0x1b5b9c,!0x0);}this['_revisionTracker']['_startingVersion']=_0x5a7458,(_0x2f27a3['toVersion']===_0x2f27a3['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xdecf5a)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xdecf5a),this['_revisionTracker']['_createCurrentRevision'](_0x5a7458));}const {revisions:_0x4e8971,requestId:_0x38cad3}=await this['_revisionHistoryService']['reconnect'](_0x2ebd81['connection'],this['_lastRequestId']);_0x5e8cfe&&_0x4e8971['length']>0x0?_0x34b170['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x4e8971),this['_handleRevisionsUpdate'](_0x4e8971,_0x38cad3),this['_revisionTracker']['sendBufferedUpdates']());};return _0x34b170['_isConnected']?_0xd2283e():new Promise((_0x3f1b59,_0x5b39af)=>{_0x34b170['once']('change:_isConnected',()=>{_0xd2283e()['then'](_0x3f1b59)['catch'](_0x5b39af);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x1d7ca2=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x554651=>{_0x554651['off'](),_0x1d7ca2();});});}['_getLatestVersionFromServerOperations'](){const _0x549fea=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1fe761 of _0x549fea)if('marker'!==_0x1fe761['type']||_0x1fe761['affectsData'])return _0x1fe761['baseVersion']+0x1;}['_getLatestVersion'](){const _0x3db480=this['editor']['plugins']['get'](l);return new Promise(_0x7daa2e=>{_0x3db480['_isPendingUpdate']?_0x3db480['once']('change:_isPendingUpdate',()=>{_0x7daa2e(this['_getLatestVersionFromServerOperations']());}):_0x7daa2e(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x367f61,_0x8c742e){const _0x1df9fd=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x8c742e;for(const _0x11354f of _0x367f61){const _0x3c604b=_0x1df9fd['getRevision'](_0x11354f['id']);if(_0x3c604b){if((_0x11354f['fromVersion']||_0x11354f['toVersion'])&&(_0x11354f['diffData']=null),_0x3c604b===this['_revisionTracker']['currentRevision']){const _0x39a52c=Math['max'](_0x3c604b['toVersion'],_0x11354f['toVersion']),_0x5c3acb=Math['max'](_0x3c604b['fromVersion'],_0x11354f['fromVersion']);let _0x2dee7a;_0x3c604b['toVersion']===_0x11354f['toVersion']&&_0x3c604b['fromVersion']===_0x11354f['fromVersion']?(_0x2dee7a=!0x0,this['_preventResendingRevisionData'](_0x11354f)):_0x11354f['toVersion']===_0x39a52c&&_0x11354f['fromVersion']===_0x5c3acb?_0x2dee7a=!0x1:(_0x3c604b['toVersion']===_0x39a52c&&_0x3c604b['fromVersion']===_0x5c3acb||this['_fixRevision']({'revision':_0x3c604b,'from':_0x5c3acb,'to':_0x39a52c}),_0x2dee7a=!0x0),_0x2dee7a&&(delete _0x11354f['fromVersion'],delete _0x11354f['toVersion'],delete _0x11354f['diffData'],delete _0x11354f['createdAt'],delete _0x11354f['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x11354f),this['_preventResendingRevisionData'](_0x11354f);}else this['_revisionTracker']['addRevisionData'](_0x11354f);}const _0x4cd83e=_0x1df9fd['getRevisions']();_0x4cd83e['reverse']();for(let _0x1e5873=0x0;_0x1e5873<_0x4cd83e['length']-0x1;_0x1e5873++){const _0x4f2b24=_0x4cd83e[_0x1e5873],_0x37e8c1=_0x4cd83e[_0x1e5873+0x1];if(_0x4f2b24['fromVersion']<_0x37e8c1['toVersion']){const _0x44b1bf=_0x37e8c1['toVersion'],_0xab8e54=Math['max'](_0x44b1bf,_0x4f2b24['toVersion']);this['_fixRevision']({'revision':_0x4f2b24,'from':_0x44b1bf,'to':_0xab8e54});}}}['_fixRevision']({revision:_0x1451b5,from:_0x3594b,to:_0xe220b2}={}){const _0xca8559=this['editor']['plugins']['get'](_0x438ac2),_0x5bb3fa=this['_revisionTracker']['buildRevisionData']({'revision':_0x1451b5,'from':_0x3594b,'to':_0xe220b2});_0x5bb3fa['authors']=_0x5bb3fa['authorsIds']['map'](_0x32ac98=>_0xca8559['getUser'](_0x32ac98)),_0x1451b5['_update'](_0x5bb3fa);}['_preventResendingRevisionData'](_0x5f4629){const _0x342e3a={};_0x342e3a['id']=_0x5f4629['id'];for(const _0xf68669 of Object['keys'](_0x5f4629))'id'!==_0xf68669&&(_0x342e3a[_0xf68669]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x342e3a['id'],_0x342e3a,!0x0);}async['_fetchMissingUsers'](_0x138fc8){const _0x66f865=this['editor']['plugins']['get'](_0x438ac2),{connection:_0x1fa553}=this['editor']['plugins']['get'](n),_0x32fb38=new Set();for(const _0x95dc53 of _0x138fc8){for(const _0x4f1516 of _0x95dc53['authorsIds'])_0x13ea40(_0x4f1516);_0x95dc53['creatorId']&&_0x13ea40(_0x95dc53['creatorId']);}if(0x0===_0x32fb38['size'])return;const _0x21efb5=await lt['getMany'](_0x1fa553,Array['from'](_0x32fb38));for(const _0x14e55e of _0x21efb5)_0x66f865['getUser'](_0x14e55e['id'])||_0x66f865['addUser'](_0x14e55e);function _0x13ea40(_0x259dd3){_0x66f865['getUser'](_0x259dd3)||_0x32fb38['add'](_0x259dd3);}}}function it(_0x59b49b){return _0x59b49b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x59b49b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x59b49b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x582e6d{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0x5a7e76{['_collapseAt'];constructor(_0x1a6f65,_0x3d694a=0x6){super(_0x1a6f65);const _0x16c654=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x3d694a,this['bind']('isHidden')['to'](this,'usersCount',_0x1081c4=>_0x1081c4<_0x3d694a),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x16c654['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':_0x16c654['to']('usersCount',_0x413c62=>'+'+(_0x413c62-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x5a7e76{['items'];['keystrokes'];constructor(_0x2978ee){super(_0x2978ee);const _0x264cf4=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x3bc9e9(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x264cf4['if']('hasPopup'),'aria-expanded':_0x264cf4['to']('isExpanded',_0x363c51=>this['hasPopup']&&String(_0x363c51)),'aria-label':_0x264cf4['to']('hasPopup',_0x22c0bb=>W(_0x2978ee,_0x22c0bb?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x264cf4['to']('hasPopup',_0x1873e6=>!!_0x1873e6&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x264cf4['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x264cf4['to'](_0x14f1d7=>{const _0x3e9127=_0x14f1d7,_0x4ca1aa=document['querySelector']('.ck-presence-list__dropdown-list'),_0x284a94=document['querySelector']('.ck-balloon-panel_with-arrow');_0x4ca1aa?.['contains'](_0x3e9127['relatedTarget'])||_0x284a94?.['contains'](_0x3e9127['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x4a8082,_0x359b40,_0x524ff8)=>{this['element']&&(_0x524ff8?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class k extends _0x5a7e76{['counterView'];['inlineListView'];constructor(_0x3a0970,_0x175581=0x6){super(_0x3a0970);const _0x26827b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0x175581),this['inlineListView']=new is(_0x3a0970),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x41acd3 of this['inlineListView']['items'])_0x41acd3['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',_0x26827b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0x5a7e76{['listWrapperView'];constructor(_0x3cd6cc,_0x19bc17){super(_0x3cd6cc);const _0x29f10b=this['bindTemplate'];this['listWrapperView']=new pt(_0x3cd6cc,_0x19bc17),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':W(_0x3cd6cc,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x29f10b['to'](_0x2a1266=>{const _0x17e775=_0x2a1266,_0x49db5b=document['querySelector']('.ck-presence-list__list'),_0x356be4=document['querySelector']('.ck-balloon-panel_with-arrow');_0x49db5b?.['contains'](_0x17e775['relatedTarget'])||_0x356be4?.['contains'](_0x17e775['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x5687c4{constructor(_0x5afc2,_0x5d69c5){super(_0x5afc2);const _0x54f880=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x5d69c5?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x54f880['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x54f880['to']('role'),'aria-label':_0x54f880['to']('ariaLabel'),'aria-labelledby':_0x54f880['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x497bba['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3c6b92=this['element'];_0x3c6b92&&(this['_isScrollable']=Math['max'](_0x3c6b92['scrollHeight'],_0x3c6b92['clientHeight'])>0.8*window['innerHeight']);}}class P extends rt{['userView'];constructor(_0x1bb8e9,_0x5c9348,_0x87be60){super(_0x1bb8e9);const _0x5e906f=this['bindTemplate'];this['userView']=new ct(_0x1bb8e9,_0x5c9348);const _0x2b0fd9={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x5c9348['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x5c9348['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5c9348['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x87be60&&(_0x2b0fd9['tag']='button',_0x2b0fd9['on']={'click':_0x5e906f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2b0fd9);}['focus'](){this['element']['focus']();}}class _ extends _0x5a7e76{['userView'];['markerView'];constructor(_0xd25402,_0x330c84,_0x552be2){super(_0xd25402);const _0x25f280=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0xd25402,_0x330c84),this['markerView']=new at(_0xd25402,_0x330c84);const _0x464ea3=new ot(_0xd25402);_0x464ea3['template']['tag']='span',_0x464ea3['text']=_0x330c84['name'];const _0x148a2f={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x25f280['to']('isFocusable',_0x53d29e=>!!_0x53d29e&&0x0),'aria-labelledby':_0x464ea3['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x25f280['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x25f280['to']('hasTooltip',_0x30cf1a=>!_0x30cf1a),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x464ea3]};_0x552be2&&(_0x148a2f['tag']='button',_0x148a2f['on']={'click':_0x25f280['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x148a2f);}}class at extends _0x5a7e76{constructor(_0xcb3ff0,_0x5b1ed4){super(_0xcb3ff0),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5b1ed4['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x14a72f{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x132ac5){super(_0x132ac5),this['context']['config']['define']('presenceList',U);const _0x500039=_0x132ac5['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x500039)throw new _0x31eaa2('presencelist-collapseat-invalid-format',this);if(_0x500039<0x1)throw new _0x31eaa2('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5d33df(),this['balloonPanelView']=new _0xbdfd38(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x446982 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x446982);this['listenTo'](this['_allConnectedUsers'],'add',(_0x2bb434,_0x3c3829)=>{this['_handleUserAdd'](_0x3c3829);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x24dd80,_0x297103)=>{this['_handleUserRemove'](_0x297103);});}['_createView'](){const _0x1a87c0=this['context'],_0x3f457e=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3f8176=this['balloonPanelView'];if(!_0x1f73a5(_0x1a87c0['config']['get']('presenceList.container')))throw new _0x31eaa2('presencelist-missing-container',this);return _0x3f457e['counterView']['bind']('usersCount')['to'](this),_0x3f457e['bind']('isCollapsed')['to'](this,'usersCount',_0x316850=>{const {collapseAt:_0x4fb535}=_0x1a87c0['config']['get']('presenceList'),_0x4a901a=_0x316850>=_0x4fb535;if(_0x4a901a&&!_0x3f457e['inlineListView']['items']['find'](_0x2d1000=>_0x2d1000 instanceof y)){const _0x24b170=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x24b170&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3f457e['inlineListView']['items']['add'](_0x3f457e['counterView']);}return _0x4a901a||this['hideDropdown'](),_0x4a901a;}),_0x3f457e['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1ab497=>{const _0x297f4d=_0x1a87c0['config']['get']('presenceList'),_0x557b8f=new _(_0x1a87c0['locale'],_0x1ab497,!!_0x297f4d['onClick']);return _0x557b8f['bind']('hasTooltip')['to'](_0x3f457e,'isCollapsed',_0x44a272=>!_0x44a272),_0x557b8f['bind']('isFocusable')['to'](_0x3f457e,'isCollapsed',_0x3c3df3=>!_0x3c3df3),_0x297f4d['onClick']&&this['listenTo'](_0x557b8f,'execute',()=>{this['view']['isCollapsed']||_0x297f4d['onClick'](_0x1ab497,_0x557b8f['element']);}),_0x557b8f;}),this['listenTo'](_0x3f457e['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3f457e['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3f457e['inlineListView']['keystrokes']['set']('Enter',(_0x4ef948,_0x96c1b5)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x96c1b5());}),_0x3f457e['render'](),_0x3f8176['render'](),_0x377a1f({'emitter':_0x3f457e,'activator':()=>_0x3f8176['isVisible'],'contextElements':[_0x3f8176['element'],_0x3f457e['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1a87c0['config']['get']('presenceList.container')['appendChild'](_0x3f457e['element']),this['_bodyCollection']=new _0xda32c4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3f457e;}['_handleUserAdd'](_0x2de58c){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2de58c['isMe'])return;const _0x2a01af=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2a01af-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x556f0b=_0x2de58c['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2de58c,_0x556f0b);}['_handleUserRemove'](_0x37cb91){this['usersCount']--;const {collapseAt:_0x592936}=this['context']['config']['get']('presenceList'),_0x1aaece=this['usersCount']>=_0x592936;if(this['currentDisplayedUsers']['get'](_0x37cb91['id']))this['currentDisplayedUsers']['remove'](_0x37cb91['id']);else{if(_0x1aaece&&this['currentDisplayedUsers']['length']+0x1===_0x592936-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x1aaece?0x1:0x0)<this['usersCount']){for(const _0x15f46c of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x15f46c['id'])&&(this['currentDisplayedUsers']['add'](_0x15f46c,Math['min'](this['currentDisplayedUsers']['length']-(_0x1aaece?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x1aaece?0x1:0x0)===_0x592936-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0xe784b6=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0xe784b6['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x40e30c}=this['presenceDropdownView'];_0x40e30c['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x44d83d=>{if(!_0xe784b6['displayMe']&&_0x44d83d['isMe'])return null;const _0x2b0161=new P(this['context']['locale'],_0x44d83d,!!_0xe784b6['onClick']);return _0xe784b6['onClick']&&this['listenTo'](_0x2b0161,'execute',()=>{_0xe784b6['onClick'](_0x44d83d,_0x2b0161['element']);}),_0x2b0161;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x40e30c['focus'](),_0x40e30c['checkIfScrollable']();const _0x1aba5d=(_0x8711bf,_0x3ad069)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3ad069();};_0x40e30c['keystrokes']['set']('Esc',_0x1aba5d),_0x40e30c['keystrokes']['set']('Shift+Tab',_0x1aba5d),_0x40e30c['keystrokes']['set']('Tab',(_0x2ce0bf,_0x1cf526)=>{!function(_0x1e532f){const _0x3651d4=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x14f6b1=>_0x14f6b1+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x2a8073=[...document['body']['querySelectorAll'](_0x3651d4)]['filter'](_0x51daa3=>_0x51daa3===document['activeElement']||_0x51daa3['offsetWidth']+_0x51daa3['offsetHeight']>0x0)['sort']((_0x5adc1f,_0x395fac)=>(_0x5adc1f['tabIndex']||0x0)-(_0x395fac['tabIndex']||0x0)),_0x360cde=_0x2a8073['indexOf'](_0x1e532f),_0x33eedc=_0x2a8073[(_0x360cde+0x1)%_0x2a8073['length']];_0x33eedc&&_0x33eedc['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1cf526();}),_0x40e30c['focusTracker']['add'](this['view']['element']),_0x40e30c['focusTracker']['on']('change:isFocused',(_0x5688bd,_0x206084,_0x4f9a64)=>{_0x4f9a64||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class gt extends _0x14a72f{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x5b154e=>0x1!=_0x5b154e}};
|