@ckeditor/ckeditor5-real-time-collaboration 49.0.1 → 49.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/augmentation.d.ts +2 -1
  2. package/dist/index-editor.css +13 -9
  3. package/dist/index.css +13 -9
  4. package/dist/index.d.ts +1 -0
  5. package/dist/index.js +6 -6
  6. package/dist/realtimecollaborativecomments/cloudservicescommentsadapter.d.ts +0 -6
  7. package/dist/realtimecollaborativecomments/utils.d.ts +1 -0
  8. package/dist/realtimecollaborativecomments.d.ts +7 -2
  9. package/dist/realtimecollaborativeediting/realtimecontentfetcher.d.ts +43 -0
  10. package/dist/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.d.ts +7 -1
  11. package/dist/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.d.ts +11 -2
  12. package/dist/translations/af.umd.js +1 -1
  13. package/dist/translations/ar.umd.js +1 -1
  14. package/dist/translations/ast.umd.js +1 -1
  15. package/dist/translations/az.umd.js +1 -1
  16. package/dist/translations/be.umd.js +1 -1
  17. package/dist/translations/bg.umd.js +1 -1
  18. package/dist/translations/bn.umd.js +1 -1
  19. package/dist/translations/bs.umd.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.umd.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.umd.js +1 -1
  24. package/dist/translations/de.umd.js +1 -1
  25. package/dist/translations/el.umd.js +1 -1
  26. package/dist/translations/en-au.umd.js +1 -1
  27. package/dist/translations/en-gb.umd.js +1 -1
  28. package/dist/translations/en.umd.js +1 -1
  29. package/dist/translations/eo.umd.js +1 -1
  30. package/dist/translations/es-co.umd.js +1 -1
  31. package/dist/translations/es.umd.js +1 -1
  32. package/dist/translations/et.umd.js +1 -1
  33. package/dist/translations/eu.umd.js +1 -1
  34. package/dist/translations/fa.umd.js +1 -1
  35. package/dist/translations/fi.umd.js +1 -1
  36. package/dist/translations/fr.umd.js +1 -1
  37. package/dist/translations/gl.umd.js +1 -1
  38. package/dist/translations/gu.umd.js +1 -1
  39. package/dist/translations/he.umd.js +1 -1
  40. package/dist/translations/hi.umd.js +1 -1
  41. package/dist/translations/hr.umd.js +1 -1
  42. package/dist/translations/hu.umd.js +1 -1
  43. package/dist/translations/hy.umd.js +1 -1
  44. package/dist/translations/id.umd.js +1 -1
  45. package/dist/translations/it.umd.js +1 -1
  46. package/dist/translations/ja.umd.js +1 -1
  47. package/dist/translations/jv.umd.js +1 -1
  48. package/dist/translations/kk.umd.js +1 -1
  49. package/dist/translations/km.umd.js +1 -1
  50. package/dist/translations/kn.umd.js +1 -1
  51. package/dist/translations/ko.umd.js +1 -1
  52. package/dist/translations/ku.umd.js +1 -1
  53. package/dist/translations/lt.umd.js +1 -1
  54. package/dist/translations/lv.umd.js +1 -1
  55. package/dist/translations/ms.umd.js +1 -1
  56. package/dist/translations/nb.umd.js +1 -1
  57. package/dist/translations/ne.umd.js +1 -1
  58. package/dist/translations/nl.umd.js +1 -1
  59. package/dist/translations/no.umd.js +1 -1
  60. package/dist/translations/oc.umd.js +1 -1
  61. package/dist/translations/pl.umd.js +1 -1
  62. package/dist/translations/pt-br.umd.js +1 -1
  63. package/dist/translations/pt.umd.js +1 -1
  64. package/dist/translations/ro.umd.js +1 -1
  65. package/dist/translations/ru.umd.js +1 -1
  66. package/dist/translations/si.umd.js +1 -1
  67. package/dist/translations/sk.umd.js +1 -1
  68. package/dist/translations/sl.umd.js +1 -1
  69. package/dist/translations/sq.umd.js +1 -1
  70. package/dist/translations/sr-latn.umd.js +1 -1
  71. package/dist/translations/sr.umd.js +1 -1
  72. package/dist/translations/sv.umd.js +1 -1
  73. package/dist/translations/th.umd.js +1 -1
  74. package/dist/translations/ti.umd.js +1 -1
  75. package/dist/translations/tk.umd.js +1 -1
  76. package/dist/translations/tr.umd.js +1 -1
  77. package/dist/translations/tt.umd.js +1 -1
  78. package/dist/translations/ug.umd.js +1 -1
  79. package/dist/translations/uk.umd.js +1 -1
  80. package/dist/translations/ur.umd.js +1 -1
  81. package/dist/translations/uz.umd.js +1 -1
  82. package/dist/translations/vi.umd.js +1 -1
  83. package/dist/translations/zh-cn.umd.js +1 -1
  84. package/dist/translations/zh.umd.js +1 -1
  85. package/package.json +13 -13
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Context as _0x363235,ContextPlugin as _0x5dbaf5,PendingActions as _0x1040cb,Plugin as _0x52e8ef}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x18939e,Collection as _0x11a6e2,DomEmitterMixin as _0x32e2a3,KeystrokeHandler as _0x35d8f6,getOverlayMountRoot as _0x9144b7,global as _0x18b49a,trustedHtml as _0x179a4b,uid as _0x4b2f0e,version as _0x3b79db}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x57bb6a,LabelView as _0x17b8ff,ListItemView as _0x1a8f6c,ListView as _0xdc9acc,Notification as _0x4c22da,OverlayHost as _0x6295c0,View as _0x120ca6,clickOutsideHandler as _0x1398a0}from'@ckeditor/ckeditor5-ui';import{History as _0x42d906,InsertOperation as _0x1daecc,MarkerOperation as _0x43a658,ModelLiveRange as _0x3ecb29,NoOperation as _0x14b2ce,OperationFactory as _0x37dd8e,RootAttributeOperation as _0x4bcd32,transformOperationSets as _0x5e7bcc}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x5a346f}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x42f616,CommentsService as _0x5c0c92,EditorService as _0x430b33,RevisionHistoryService as _0x13e383,TrackChangesService as _0x127256,User as _0x9bed89,WEB_SOCKET_GATEWAY_STATES as _0x19177b,WebSocketGateway as _0x89423a}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0xec502c,Users as _0x867fa1,isPointerStillOver as _0x7e1130}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x1753d2}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x58dfb9,TrackChangesEditing as _0x66e8c5}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x381f45,CommentsEditing as _0x1923ce,CommentsRepository as _0x1bbc91}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x31414e}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x2df90e}from'es-toolkit/compat';var J=class WebSocketGateway extends _0x5dbaf5{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
- ((()=>_0x89423a)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x5a346f,_0x4c22da];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5fe301){super(_0x5fe301),this['set']('state',_0x19177b['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x32e2a3())();}init(){const _0x5b818b=this['context'],_0x510958=_0x5b818b['plugins']['get'](_0x5a346f),_0x2706cb=_0x5b818b['plugins']['get'](_0x4c22da);if(!_0x510958['token'])throw new _0x18939e('websocketgateway-missing-token',this);if(!_0x510958['webSocketUrl'])throw new _0x18939e('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),WebSocketGateway['WebSocketGateway']['connect'](_0x510958['token'],_0x510958['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5b4212=>{if(this['connection']=_0x5b4212,this['bind']('state')['to'](_0x5b4212,'state',this,'_isBrowserOffline',(_0x222a07,_0x4a918c)=>('connected'!==_0x222a07&&(this['_shouldPluginsReconnect']=!0x0),_0x4a918c||_0x222a07!==_0x19177b['CONNECTED']?_0x19177b['DISCONNECTED']:this['state']==_0x19177b['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x19177b['CONNECTING']):_0x19177b['CONNECTED'])),this['connection']['on']('error',(_0x382860,_0x4491e3)=>{if('limitExceeded'!==_0x4491e3['code'])throw console['error'](_0x4491e3),new _0x18939e('cloudservices-init',null,{'originalError':_0x4491e3});_0x2706cb['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'});}),!_0x5b4212['me'])return new Promise(_0x351b21=>_0x5b4212['on']('change:me',_0x351b21));})['catch'](_0x1aaba1=>{throw console['error'](_0x1aaba1),new _0x18939e('cloudservices-init',null,{'originalError':_0x1aaba1});});}addToReconnectionStack(_0x11d81e){if('function'!=typeof _0x11d81e['reconnect'])throw new _0x18939e('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x11d81e))throw new _0x18939e('websocketgateway-plugin-already-registered',this,{'name':_0x11d81e['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x11d81e);}removeFromReconnectionStack(_0x107f88){this['_reconnectionStack']['delete'](_0x107f88);}isInReconnectionStack(_0x433d96){return this['_reconnectionStack']['has'](_0x433d96);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x21cac0=>_0x21cac0['reconnect']())))['then'](()=>this['state']=_0x19177b['CONNECTED'])['catch'](_0x2bf2a5=>{throw console['error'](_0x2bf2a5),new _0x18939e('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0x19177b['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},Q=class extends _0x5dbaf5{['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[J,_0x867fa1];}constructor(_0x2e429f){super(_0x2e429f),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x11a6e2(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x867fa1);}init(){const _0x2989f6=this['context']['plugins']['get'](J);this['listenTo'](_0x2989f6,'change:state',(_0x2ce78c,_0x20a2d6,_0x59d2cd)=>{if('connected'!==_0x59d2cd)this['channelSessions']['forEach'](_0x36e199=>_0x36e199['clear']()),this['channelConnectedUsers']['forEach'](_0x403b97=>_0x403b97['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x15d384,_0x4a1227]of this['_registeredSessions'])for(const _0x201826 of _0x4a1227)this['_handleSessionAdd'](_0x15d384,_0x201826);}}),this['_createUser'](_0x2989f6['connection']['me'],!0x0);}register(_0x21f9ba,_0x37aece){if(this['_registeredSessions']['has'](_0x21f9ba))throw new _0x18939e('sessions-register-already-registered',null,{'channelId':_0x21f9ba});this['_registeredSessions']['set'](_0x21f9ba,_0x37aece),this['channelSessions']['set'](_0x21f9ba,new _0x11a6e2()),this['channelConnectedUsers']['set'](_0x21f9ba,new _0x11a6e2()),this['listenTo'](_0x37aece,'add',(_0x5d29e8,_0x56bd40)=>this['_handleSessionAdd'](_0x21f9ba,_0x56bd40)),this['listenTo'](_0x37aece,'remove',(_0x218497,_0x320e0d)=>this['_handleSessionRemove'](_0x21f9ba,_0x320e0d));for(const _0x85b02c of _0x37aece)this['_handleSessionAdd'](_0x21f9ba,_0x85b02c);}unregister(_0x1f4552){if(!this['_registeredSessions']['has'](_0x1f4552))throw new _0x18939e('sessions-unregister-not-exist',null,{'channelId':_0x1f4552});const _0x5793ee=this['_registeredSessions']['get'](_0x1f4552);this['stopListening'](_0x5793ee);for(const _0x2d9993 of _0x5793ee)'connected'===this['context']['plugins']['get'](J)['state']&&this['_handleSessionRemove'](_0x1f4552,_0x2d9993);this['_registeredSessions']['delete'](_0x1f4552),this['channelSessions']['delete'](_0x1f4552),this['channelConnectedUsers']['delete'](_0x1f4552);}get['mySessionId'](){return this['context']['plugins']['get'](J)['connection']['sessionId'];}getUserBySessionId(_0x268423){for(const _0x360099 of this['channelSessions']['values']())for(const _0x2d3ced of _0x360099)if(_0x2d3ced['id']===_0x268423)return _0x2d3ced['user'];}getUserSessions(_0x26d248,_0x3f767){const _0xa97f44=_0x3f767?[this['channelSessions']['get'](_0x3f767)]:this['channelSessions']['values'](),_0x46c0b9=new Set();for(const _0x30ea02 of _0xa97f44)for(const _0x6421d0 of _0x30ea02)_0x6421d0['user']['id']===_0x26d248['id']&&_0x46c0b9['add'](_0x6421d0['id']);return _0x46c0b9;}getUserRole(_0x24b8a9){for(const _0x51a10c of this['channelSessions']['values']())for(const _0x3e82fa of _0x51a10c)if(_0x3e82fa['user']===_0x24b8a9)return _0x3e82fa['role'];}['_handleSessionAdd'](_0x3503c9,_0x4943cd){if('connected'!==this['context']['plugins']['get'](J)['state'])return;const _0x28f577=_0x4943cd['user'],_0xb7f580=this['_users']['getUser'](_0x28f577['id'])||this['_createUser'](_0x28f577),_0x3b7bf5=Object['assign']({},_0x4943cd,{'user':_0xb7f580});if(this['channelSessions']['get'](_0x3503c9)['add'](_0x3b7bf5),!_0x28f577['hiddenInPresenceList']){const _0x37a29a=this['channelConnectedUsers']['get'](_0x3503c9);_0x37a29a['has'](_0xb7f580['id'])||_0x37a29a['add'](_0xb7f580),this['allConnectedUsers']['has'](_0xb7f580['id'])||_0x28f577['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xb7f580,_0xb7f580['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x3503c9,{'channelId':_0x3503c9,'session':_0x3b7bf5});}['_handleSessionRemove'](_0x41cc0f,_0x54bc8d){if('connected'!==this['context']['plugins']['get'](J)['state'])return;const _0x38a431=this['channelConnectedUsers']['get'](_0x41cc0f),_0xe5b8d4=_0x54bc8d['user'];_0xe5b8d4['id']&&(this['channelSessions']['get'](_0x41cc0f)['remove'](_0x54bc8d['id']),_0x38a431['has'](_0xe5b8d4['id'])&&!this['getUserSessions'](_0xe5b8d4,_0x41cc0f)['size']&&_0x38a431['remove'](_0xe5b8d4['id']),this['allConnectedUsers']['get'](_0xe5b8d4['id'])&&!this['getUserSessions'](_0xe5b8d4)['size']&&this['allConnectedUsers']['remove'](_0xe5b8d4['id']));}_createUser(_0x4319cd,_0x22239b){const _0x382cc9=this['_users']['addUser'](_0x4319cd);return _0x22239b&&this['_users']['defineMe'](_0x4319cd['id']),_0x382cc9['orderNumber']=this['_uniqueUsersCount']++,_0x382cc9;}},X=class extends _0x52e8ef{_domEmitter=new(_0x32e2a3())();static get requires(){return[Q];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5f545d=this['editor'],_0x8aa676=_0x5f545d['plugins']['get'](Q);_0x5f545d['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x13a2f7,{writer:_0x3c2e4d})=>function(_0x49fcc7,_0x2ed16e,_0x3ee0ec,_0x1eb6cc){const _0x171fb5=_0x49fcc7['markerName']['split'](':')[0x2],_0x2a16c0=_0x3ee0ec['getUserBySessionId'](_0x171fb5);if(!_0x2a16c0||_0x171fb5===_0x3ee0ec['mySessionId'])return;if(!_0x1eb6cc['model']['schema']['checkChild'](_0x49fcc7['markerRange']['start'],'$text'))return;const _0x51f9f6={'class':'ck-user__marker\x20'+_0x2a16c0['color']['getMarkerClass'](),'style':tt(_0x2a16c0),'data-name':_0x2a16c0['name'],'data-session-id':_0x171fb5},_0x7057a1=_0x1eb6cc['model']['markers']['get'](_0x49fcc7['markerName'])['getStart'](),_0x368e75=_0x7057a1['nodeAfter'],_0x4229d4=_0x1eb6cc['model']['schema'];if(_0x368e75&&_0x4229d4['isObject'](_0x368e75)&&_0x4229d4['isInline'](_0x368e75)&&!_0x1eb6cc['model']['markers']['get']('user:range:'+_0x171fb5)['getRange']()['isCollapsed'])return;const _0xa6d5e=_0x7057a1['parent'];return _0x1eb6cc['model']['schema']['isLimit'](_0xa6d5e)&&!_0x1eb6cc['model']['hasContent'](_0xa6d5e)&&(_0x51f9f6['contenteditable']=!0x1),function(_0x2d6d60,_0x20004e,_0x554cc6){const _0x3120de=_0x2d6d60['createUIElement']('span',_0x20004e);return _0x2d6d60['setCustomProperty']('userPositionMarker',!0x0,_0x3120de),_0x3120de['render']=function(_0x2dedff){const _0x48e024=this['toDomElement'](_0x2dedff),_0x1156b6=document['createElement']('span');return _0x1156b6['classList']['add']('ck-user__marker-tooltip'),_0x1156b6['setAttribute']('contenteditable','false'),_0x1156b6['setAttribute']('spellcheck','false'),_0x1156b6['textContent']=_0x554cc6['name'],_0x48e024['innerHTML']=_0x179a4b('⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x1156b6['outerHTML']+'⁠'),_0x48e024['addEventListener']('mouseenter',()=>{_0x48e024['classList']['add']('ck-user__marker_hovered');}),_0x48e024['addEventListener']('mouseleave',()=>{_0x48e024['classList']['remove']('ck-user__marker_hovered');}),_0x48e024;},_0x3120de['isSimilar']=function(_0x3dfb1d){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3dfb1d['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3dfb1d['getAttribute']('data-session-id'));},_0x3120de;}(_0x2ed16e,_0x51f9f6,_0x2a16c0);}(_0x13a2f7,_0x3c2e4d,_0x8aa676,_0x5f545d)}),_0x5f545d['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x409029=>function(_0x5f0d21,_0x2ecca6){const _0xc38f4b=_0x5f0d21['markerName']['split'](':')[0x2];if(_0xc38f4b===_0x2ecca6['mySessionId'])return null;const _0x1b808d=_0x2ecca6['getUserBySessionId'](_0xc38f4b);return _0x1b808d?{'id':_0xc38f4b,'classes':['ck-user__selection',_0x1b808d['color']['getSelectionClass']()],'attributes':{'style':tt(_0x1b808d),'data-session-id':_0xc38f4b},'priority':0x7d0+_0x1b808d['orderNumber']}:{'id':_0xc38f4b,'classes':[]};}(_0x409029,_0x8aa676)}),function(_0x1bfc22){const _0x2deaaf=_0x1bfc22['model'],_0xa43945=new Map(),_0x5e80c6=_0x1bfc22['plugins']['get'](Q);_0x2deaaf['markers']['on']('update:user:range',(_0x7ac01a,_0x19df25,_0x3a357a,_0x3f8578)=>{if(!_0x3f8578&&_0xa43945['get'](_0x19df25['name']))return _0xa43945['get'](_0x19df25['name'])['detach'](),void _0xa43945['delete'](_0x19df25['name']);const _0x22a8bb=_0x19df25['name']['split'](':')[0x2];if(_0x22a8bb===_0x5e80c6['mySessionId'])return;const _0x1c2068='user:position:'+_0x22a8bb;_0x2deaaf['markers']['has'](_0x1c2068)&&_0x1bfc22['editing']['reconvertMarker'](_0x1c2068),_0x19df25['on']('change:range',(_0x2cbe2b,_0x3e3baf,_0x5783f6)=>{if('$graveyard'!=_0x3e3baf['root']['rootName']&&'$graveyard'==_0x19df25['getRange']()['root']['rootName']&&!_0xa43945['has'](_0x19df25['name'])){const _0x236712=_0x2deaaf['schema']['getNearestSelectionRange'](_0x5783f6['deletionPosition']);if(_0x236712){const _0x4d9a0c=_0x3ecb29['fromRange'](_0x236712);_0xa43945['set'](_0x19df25['name'],_0x4d9a0c),_0x4d9a0c['on']('change:range',(_0x451086,_0x4d0b6b,_0xccb261)=>{if('$graveyard'==_0x4d9a0c['root']['rootName']){const _0xcfefa3=_0x2deaaf['schema']['getNearestSelectionRange'](_0xccb261['deletionPosition']);_0xcfefa3?(_0x4d9a0c['start']=_0xcfefa3['start'],_0x4d9a0c['end']=_0xcfefa3['end']):(_0xa43945['delete'](_0x19df25['name']),_0x4d9a0c['detach']());}});}}});}),_0x2deaaf['document']['on']('change',()=>{_0xa43945['size']>0x0&&_0x2deaaf['enqueueChange']({'isUndoable':!0x1},_0x497613=>{for(const [_0x10d309,_0x4b5908]of _0xa43945)'$graveyard'==_0x2deaaf['markers']['get'](_0x10d309)['getRange']()['root']['rootName']&&(Z(_0x10d309['split'](':')[0x2],_0x4b5908['toRange'](),_0x2deaaf,_0x497613),_0x4b5908['detach']());_0xa43945['clear']();});});}(_0x5f545d),this['_domEmitter']['listenTo'](_0x18b49a['document'],'keydown',(_0x570b04,{key:_0xa8cfeb})=>{'Escape'===_0xa8cfeb&&function(_0x4af67b){_0x4af67b['editing']['view']['change'](_0x280293=>{for(const _0x18ccfb of _0x4af67b['model']['markers']){if(!_0x18ccfb['name']['startsWith']('user:position'))continue;const _0x52b648=_0x4af67b['editing']['mapper']['markerNameToElements'](_0x18ccfb['name']);if(_0x52b648){for(const _0x3a3248 of _0x52b648)_0x280293['removeClass']('ck-user__marker_hovered',_0x3a3248);}}});}(_0x5f545d);},{'useCapture':!0x0});}afterInit(){const _0x25ac24=this['editor'],_0x6017ab=_0x25ac24['commands']['get']('undo');_0x6017ab&&_0x25ac24['model']['on']('applyOperation',(_0x1fc87d,_0x1b6339)=>{const _0x1e1acb=_0x1b6339[0x0];if(!_0x1e1acb['isDocumentOperation'])return;if('marker'!=_0x1e1acb['type']||!_0x1e1acb['name']['startsWith']('user:'))return;const _0x1694b6=_0x1e1acb['batch'];_0x6017ab['_createdBatches']['has'](_0x1694b6)&&(_0x1e1acb['newRange']=_0x1e1acb['oldRange']?_0x25ac24['model']['createRange'](_0x1e1acb['oldRange']['start'],_0x1e1acb['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x2cbcfe=this['editor'],_0x5dbee1=_0x2cbcfe['model']['document'],_0x55c70d=_0x2cbcfe['plugins']['get'](Q);_0x2cbcfe['model']['enqueueChange']({'isUndoable':!0x1},_0x481740=>{const _0x3868c7='user:range:'+_0x55c70d['mySessionId'],_0x579bea='user:position:'+_0x55c70d['mySessionId'],_0x5f5446=_0x2cbcfe['model']['markers']['has'](_0x3868c7);_0x2cbcfe['editing']['view']['hasDomSelection']?Z(_0x55c70d['mySessionId'],_0x5dbee1['selection']['getFirstRange'](),_0x2cbcfe['model'],_0x481740):_0x5f5446&&(_0x481740['removeMarker'](_0x3868c7),_0x481740['removeMarker'](_0x579bea));});}};function Z(_0x5120bc,_0xa1f1b2,_0x1a6442,_0x2ef8a1){const _0x3947f4='user:range:'+_0x5120bc,_0x111dfe='user:position:'+_0x5120bc,_0x249677=_0xa1f1b2['getContainedElement']();let _0x450b83=_0xa1f1b2['start'];if(_0x249677&&_0x249677['is']('element','tableCell')){const _0x2f9c3b=function(_0x111a89,_0x3b16a4){for(const _0x44846a of _0x111a89['getPositions']())if(_0x3b16a4['schema']['checkChild'](_0x44846a,'$text'))return _0x44846a;}(_0xa1f1b2,_0x1a6442);_0x2f9c3b&&(_0x450b83=_0x2f9c3b,_0xa1f1b2=_0x2ef8a1['createRange'](_0x450b83));}const _0x5e3a45=_0x2ef8a1['createRange'](_0x450b83);_0x1a6442['markers']['has'](_0x3947f4)?(_0x2ef8a1['updateMarker'](_0x3947f4,{'range':_0xa1f1b2}),_0x2ef8a1['updateMarker'](_0x111dfe,{'range':_0x5e3a45})):(_0x2ef8a1['addMarker'](_0x3947f4,{'range':_0xa1f1b2,'usingOperation':!0x0}),_0x2ef8a1['addMarker'](_0x111dfe,{'range':_0x5e3a45,'usingOperation':!0x0}));}function tt(_0x49ba5f){return'--ck-user-color:'+_0x49ba5f['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x49ba5f['color']['getColorAlphaVariable']()+';';}function et(_0x3db717,_0x3c3428,_0x8ae8d4){const _0x2b360e=_0x3db717['t'],t=_0x3db717['t'];switch(_0x3c3428){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 _0x2b360e({'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'},_0x8ae8d4);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x52e8ef{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
- ((()=>_0x42f616)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[J,Q,X,_0x1040cb,_0x867fa1,_0x4c22da];}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 _0x7f332d=this['serverHistory']['getOperations']();for(let _0x1879af=_0x7f332d['length']-0x1;_0x1879af>=0x0;_0x1879af--){const _0x3cbc74=_0x7f332d[_0x1879af];if(!this['_disconnectionOperations']['has'](_0x3cbc74))return _0x3cbc74['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x380bc0){if(super(_0x380bc0),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x42d906(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x18939e('collaboration-missing-channelid',this);const _0xf0c3fa=_0x380bc0['config']['get']('cloudServices.bundleVersion')||_0x3b79db;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0xf0c3fa,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1753d2(),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 rt(this['_disconnectionOperations']);}init(){const _0x4ae769=this['editor'],_0x2819e9=_0x4ae769['plugins']['get'](_0x867fa1),_0x5769d7=_0x4ae769['plugins']['get'](J);this['listenTo'](_0x2819e9,'getOperationAuthor',(_0x3256e1,_0x2f174c)=>{const _0x51395e=_0x2f174c[0x0];_0x51395e['_authorId']&&(_0x3256e1['return']=_0x2819e9['getUser'](_0x51395e['_authorId']),_0x3256e1['stop']()),null===_0x51395e['_authorId']&&(_0x3256e1['return']=null,_0x3256e1['stop']());},{'priority':'high'}),this['listenTo'](_0x4ae769['model']['document']['selection'],'change:range',(_0x3c4c13,_0x30546d)=>{_0x30546d['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4ae769['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4ae769['model']['on']('applyOperation',(_0x3c39fd,_0x2d07f2)=>{const _0x6f42f9=_0x2d07f2[0x0];_0x6f42f9['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x6f42f9),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x5769d7,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x58b88e,_0x2922f0,_0x11788f)=>'connected'===_0x58b88e&&!_0x2922f0&&!_0x11788f),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4ae769['disableReadOnlyMode']('rtc-offline'):_0x4ae769['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4ae769['disableReadOnlyMode']('rtc-offline'):_0x4ae769['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x3dbfde=this['editor']['plugins']['get'](Q),_0x43db60=this['editor']['plugins']['get'](J);try{this['_isPendingUpdate']=!0x0,_0x3dbfde['unregister'](this['_channelId']);const _0x5606ca=await this['_service']['reconnect'](_0x43db60['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5606ca)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x27daaa=await this['_service']['getConnectedSessions']();_0x3dbfde['register'](this['_channelId'],_0x27daaa),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2c57de){if(function(_0x3bc97e){return'404'===_0x3bc97e['code'];}(_0x2c57de)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x2a7441){return'409'===_0x2a7441['code'];}(_0x2c57de)){const _0x2389e4=et(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'](_0x2389e4);}else{if(!(_0x2c57de instanceof nt))throw _0x2c57de;this['_handleReconnectionError']();}}}}destroy(){const _0x286162=this['editor']['plugins']['get'](J),_0x470ae6=this['editor']['plugins']['get'](Q);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x470ae6['channelSessions']['has'](this['_channelId'])&&_0x470ae6['unregister'](this['_channelId']),_0x286162['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x22b4d7){if(this['sessionId']!==_0x22b4d7['sessionId']&&this['_lastSyncedOperationId']!==_0x22b4d7['lastOperationId'])throw new nt();return this['sessionId']=_0x22b4d7['sessionId'],this['_handleServerResponse']([],{..._0x22b4d7,'wereChangesApplied':!0x1,'data':_0x22b4d7['data']},'reconnect');}async _connectService(_0x1d2dd8,_0x5800f3=!0x1){const {connection:_0xc5dc0b}=this['editor']['plugins']['get'](J);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0xc5dc0b,this['_channelId'])['then'](_0xace42f=>this['_initSessionsHandling'](_0xace42f))['catch'](_0x257d6d=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x257d6d);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x16e214,_0x41a41f)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x41a41f);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x117542=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1d2dd8);this['_isPendingUpdate']=!0x0;const _0x259978=await this['_service']['connect'](_0xc5dc0b,this['_compressOperations'](_0x1d2dd8),_0x117542);if(this['sessionId']=_0x259978['sessionId'],_0x5800f3){if(!_0x259978['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x259978['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x1d2dd8,_0x259978,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x259978,_0x1d2dd8);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x4fc947=this['editor']['plugins']['get'](Q),_0x426fc8=this['editor']['plugins']['get'](X),_0x16e630=_0x4fc947['channelSessions']['get'](this['_channelId']);_0x16e630&&_0x16e630['length']>0x1?_0x426fc8['createUserMarkerOperations']():this['listenTo'](_0x4fc947,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x4fc947['channelSessions']['get'](this['_channelId'])['length']&&_0x426fc8['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x2143c5,_0x2f0f37,_0xdeb6fe,_0x18dbd8){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x2f0f37){const _0x177a94=this['_decompressOperations'](_0xdeb6fe,_0x18dbd8);await this['_fetchMissingUsers'](_0x177a94),this['_handleExternalOperations'](_0x177a94,_0x2f0f37,_0xdeb6fe['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x14e0a2}=this['editor'];let _0x28ab40;try{_0x28ab40=await this['_service']['getDocumentDetails']();}catch{const _0x29d660=et(_0x14e0a2,'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'](_0x29d660);}const _0x149449=_0x28ab40['currentDocumentSession']||_0x28ab40['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x149449['lastOperationId']){const _0x1c492f=et(_0x14e0a2,'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'](_0x1c492f);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x3e628b=this['editor']['plugins']['get'](J);if(this['_isConnected']=!0x1,!_0x3e628b['connection']||'connected'!==_0x3e628b['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x43fe09=this['editor']['plugins']['get'](Q);_0x43fe09['channelSessions']['has'](this['_channelId'])&&_0x43fe09['unregister'](this['_channelId']),_0x3e628b['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x49b1a6){const _0x372e91=this['editor']['plugins']['get'](Q);this['listenTo'](_0x372e91,'sessionAdd:'+this['_channelId'],(_0x3b62dc,{session:_0x17cebe})=>{if(_0x17cebe['id']===_0x372e91['mySessionId']){_0x3b62dc['off']();const _0x3dfd1f=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4df350=_0x17cebe['permissions'];_0x3dfd1f&&_0x3dfd1f['isEnabled']&&(_0x4df350=_0x4df350['filter'](_0x67d5fb=>'document:write'!==_0x67d5fb)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4df350,this['_channelId']);}}),_0x372e91['register'](this['_channelId'],_0x49b1a6);}_initThrowingOnDataSet(){const _0x262a78=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x4a892)=>{if(!_0x4a892[_0x4a892['length']-0x1]['suppressErrorInCollaboration'])throw new _0x18939e('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x262a78['apply'](this['editor']['data'],_0x4a892);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x2d7fa8,[_0x2fb6e4])=>{if(this['_document']['version'])throw new _0x18939e('realtimecollaborationclient-init-document-already-initialized',this);_0x2d7fa8['stop'](),this['_setPendingAction']();const _0x343714=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0x5e209d])=>!_0x5e209d['lazyLoad'])['map'](([_0x30def2,_0x5200b5])=>[_0x30def2,_0x5200b5['modelAttributes']||{}])),_0x5c08b4=this['_getOperationsFromInitData'](_0x2fb6e4,_0x343714);0x0==_0x5c08b4['length']&&_0x5c08b4['push'](new _0x14b2ce(0x0)),_0x2d7fa8['return']=this['_connectService'](_0x5c08b4)['then'](()=>{this['editor']['plugins']['get'](J)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x4bfcea=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x4bfcea))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x3fac09,[_0x46268c,_0x4ba14e])=>{_0x3fac09['stop']();const _0x4303ef=this['editor']['model']['document']['getRoot'](_0x46268c);if(!this['_knownRootNames']['has'](_0x46268c)){const _0x359fe7=_0x4ba14e&&_0x4ba14e['data']?_0x4ba14e['data']:'',_0x2a032a=_0x4ba14e&&_0x4ba14e['attributes']?_0x4ba14e['attributes']:{};await this['_loadRoot'](_0x46268c,_0x359fe7,_0x2a032a);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x4303ef['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x4303ef);});},{'priority':'high'});}async _fetchMissingUsers(_0x1d3882){const _0x3d57dc=this['editor']['plugins']['get'](_0x867fa1),{connection:_0x207c17}=this['editor']['plugins']['get'](J),_0xd1e5f3=new Set();for(const _0x5015f2 of _0x1d3882){const _0x207bff=_0x5015f2['_authorId'];_0x207bff&&!_0x3d57dc['getUser'](_0x207bff)&&_0xd1e5f3['add'](_0x207bff);}if(0x0===_0xd1e5f3['size'])return;const _0x46f8b2=await _0x9bed89['getMany'](_0x207c17,Array['from'](_0xd1e5f3));for(const _0x401e88 of _0x46f8b2)_0x3d57dc['getUser'](_0x401e88['id'])||_0x3d57dc['addUser'](_0x401e88);}_getOperationsFromInitData(_0x5d0015,_0x2a25af={}){const _0x5f41fb=this['editor']['model'],_0x4a1c2f=[];let _0x11dc23=0x0;const _0x2a951a='string'==typeof _0x5d0015?{'main':_0x5d0015}:_0x5d0015;for(const _0x1b73c7 of Object['keys'](_0x2a951a)){if(!this['_document']['roots']['has'](_0x1b73c7))throw new _0x18939e('realtimecollaborationclient-init-non-existent-root',this);const _0x3c8121=this['_document']['getRoot'](_0x1b73c7),_0xd20530=this['editor']['data']['parse'](_0x2a951a[_0x1b73c7],_0x3c8121),_0x5bfd7f=new _0x1daecc(_0x5f41fb['createPositionAt'](_0x3c8121,0x0),_0xd20530,_0x11dc23++);_0x4a1c2f['push'](_0x5bfd7f);for(const [_0x2d20c4,_0x107e1e]of _0xd20530['markers']){const _0x5c5525=_0x5f41fb['createRange'](_0x5f41fb['createPositionFromPath'](_0x3c8121,_0x107e1e['start']['path']['slice']()),_0x5f41fb['createPositionFromPath'](_0x3c8121,_0x107e1e['end']['path']['slice']())),_0x5f1606=new _0x43a658(_0x2d20c4,null,_0x5c5525,_0x5f41fb['markers'],!0x0,_0x11dc23++);_0x4a1c2f['push'](_0x5f1606);}}if(_0x2a25af)for(const [_0x29ec14,_0x56e112]of Object['entries'](_0x2a25af)){const _0x1b384e=_0x5f41fb['document']['getRoot'](_0x29ec14);if(!_0x1b384e)throw new _0x18939e('multi-root-editor-root-attributes-no-root',null);for(const [_0x1c695d,_0xc1febd]of Object['entries'](_0x56e112))if(null!==_0xc1febd){const _0x55afe2=new _0x4bcd32(_0x1b384e,_0x1c695d,null,_0xc1febd,_0x11dc23++);_0x4a1c2f['push'](_0x55afe2);}}return _0x4a1c2f;}async _loadRoot(_0x41fd75,_0x151f60,_0x3f128b){this['_getOperationsFromInitData']({[_0x41fd75]:_0x151f60},{[_0x41fd75]:_0x3f128b})['forEach']((_0x395f62,_0x37d94c)=>{_0x395f62['baseVersion']=this['_document']['version']+_0x37d94c,_0x395f62['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x395f62);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x284be8,_0x8071eb){let _0x4e1479;this['_offset']=_0x284be8['offset'];const _0x46ca69=_0x284be8['wereChangesApplied']&&!_0x284be8['initData'],_0x68cdf5=_0x46ca69?0x0:_0x284be8['data']['baseVersion'];if(_0x8071eb['forEach'](_0x1cce84=>{_0x1cce84['_isInit']=!0x0,_0x1cce84['createdAt']=_0x284be8['sessionCreatedAt'],_0x1cce84['_authorId']=null;}),_0x46ca69)_0x4e1479=_0x8071eb,this['_applyOperationsSet'](_0x4e1479,_0x46ca69);else{if(_0x284be8['initData']){const _0x59dbc8=this['_getOperationsFromInitData'](_0x284be8['initData']);this['_document']['history']['version']=-_0x59dbc8['length'],_0x59dbc8['forEach'](_0x6b9a30=>{_0x6b9a30['baseVersion']-=_0x59dbc8['length'],_0x6b9a30['createdAt']=_0x284be8['sessionCreatedAt'],_0x6b9a30['_isInit']=!0x0,_0x6b9a30['_authorId']=null;}),this['_applyOperationsSet'](_0x59dbc8,!0x0),this['serverHistory']['version']=-_0x59dbc8['length']+this['_offset'],this['_updateServerHistory'](_0x59dbc8);}this['_document']['history']['version']=_0x68cdf5,_0x4e1479=this['_decompressOperations'](_0x284be8['data'],_0x284be8['metadata']),await this['_fetchMissingUsers'](_0x4e1479),this['_applyOperationsSet'](_0x4e1479,_0x46ca69);}_0x284be8['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4e1479,_0x284be8['lastOperationId']),this['_lastSyncedOperationId']=_0x284be8['lastOperationId']),this['serverHistory']['version']=_0x68cdf5+this['_offset'],this['_updateServerHistory'](_0x4e1479),_0x8071eb['filter'](_0xfaab52=>{const _0x17a68b=this['_getAffectedRoot'](_0xfaab52);return _0x17a68b&&!this['_knownRootNames']['has'](_0x17a68b);})['forEach']((_0x4bd0c6,_0x2c4b80)=>{_0x4bd0c6['baseVersion']=this['_document']['version']+_0x2c4b80,this['_saveOperationInBuffer'](_0x4bd0c6);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4f132f,_0x248e0a){const _0x288448=_0x248e0a&&_0x248e0a['message'];if(_0x288448&&_0x288448['startsWith']('realtimecollaborationclient'))throw _0x248e0a;const _0x188d8a=this['editor']['plugins']['get'](J);throw this['_isPendingUpdate']=!0x0,_0x188d8a['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x18939e(_0x4f132f,this['editor'],_0x288448?{'originalError':_0x288448}:void 0x0);}_saveOperationInBuffer(_0x5e39d0){this['_knownOperations']['has'](_0x5e39d0)||(this['_knownOperations']['add'](_0x5e39d0),this['_bufferedOperations']['push'](_0x5e39d0),this['_pendingAction']||'marker'==_0x5e39d0['type']&&!_0x5e39d0['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x30a78b=!0x1){!_0x30a78b&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x3a4f2b=>{_0x3a4f2b&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x44cd20=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3b9e5d){return _0x3b9e5d['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3b9e5d['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3b9e5d['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x44cd20)||this['_crash'](_0x44cd20['message'],_0x44cd20);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x380104=>{this['on']('change:_isPendingUpdate',()=>{_0x380104();});});}async _sendBufferedOperations(){const _0x59ad7b=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x59ad7b['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xe99c03=[...this['_bufferedOperations']];for(const _0x213650 of _0xe99c03)_0x213650['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x213650);const _0x151be7=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xe99c03),_0x3821ce=st++,_0x38e494=this['_compressOperations'](_0xe99c03),_0x3f367e=await this['_service']['sendOperations'](_0x38e494,_0x38e494['baseVersion'],_0x151be7);try{return await this['_handleServerResponse'](_0xe99c03,_0x3f367e,_0x3821ce);}catch(_0x3e79c6){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x3e79c6);}}async['_handleServerResponse'](_0xe44d68,_0x2ab576,_0x2afe1e){if('error'in _0x2ab576)throw _0x2ab576['error'];let _0x32cda6;if(_0x2ab576['wereChangesApplied']){_0x2ab576['lastOperationId']&&(this['_lastSyncedOperationId']=_0x2ab576['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x51698e=>!_0xe44d68['includes'](_0x51698e));for(const _0x4208a7 of _0xe44d68)_0x4208a7['createdAt']='lastOperationAcceptedAt'in _0x2ab576&&_0x2ab576['lastOperationAcceptedAt']||void 0x0;ot(_0xe44d68,_0x2ab576['version']-_0xe44d68['length']),this['_updateServerHistory'](_0xe44d68);const _0xf95f1f=_0xe44d68['filter'](_0x4b388f=>{if(!_0x4b388f['_isInit'])return!0x1;const _0x56ffa5=this['_getAffectedRoot'](_0x4b388f);return _0x56ffa5&&!this['_knownRootNames']['has'](_0x56ffa5);});ot(_0xf95f1f,this['_document']['version']),this['_applyOperationsSet'](_0xf95f1f),_0x32cda6=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x1f5b94=this['_decompressOperations'](_0x2ab576['data'],_0x2ab576['metadata'])['filter'](_0x33a11a=>_0x33a11a['baseVersion']>=this['_lastServerVersion']);_0x1f5b94['forEach'](_0x35db8f=>this['_addKnownRoot'](_0x35db8f)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x423cf0=>!_0x423cf0['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x423cf0))),this['_bufferedOperations']['length']&&ot(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x1f5b94),_0x32cda6=this['_handleExternalOperations'](_0x1f5b94,_0x2ab576['version'],_0x2ab576['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x32cda6?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x45d29b,_0x54839b,_0x21d761){try{const _0x57b848={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2613fa,operationsB:_0x54971e,originalOperations:_0x385754}=_0x5e7bcc(_0x45d29b,this['_bufferedOperations'],_0x57b848);ot(_0x2613fa,this['_document']['version']),ot(_0x54971e,_0x54839b);for(const _0x3b7d47 of _0x2613fa){const _0x321055=_0x385754['get'](_0x3b7d47);_0x321055?(_0x3b7d47['_authorId']=_0x321055['_authorId'],'noop'!==_0x3b7d47['type']&&(_0x3b7d47['_aiSource']=_0x321055['_aiSource'])):_0x3b7d47['_authorId']=null;}for(const _0xea7158 of _0x54971e)'noop'!==_0xea7158['type']&&(_0xea7158['_aiSource']=_0x385754['get'](_0xea7158)?.['_aiSource']);_0x21d761&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x45d29b,_0x21d761),this['_lastSyncedOperationId']=_0x21d761),this['_bufferedOperations']=[..._0x54971e],this['_applyOperationsSet'](_0x2613fa),this['_updateServerHistory'](_0x45d29b);}catch(_0x1085b4){return console['error'](_0x1085b4),!0x1;}return!0x0;}_applyOperationsSet(_0x14f957,_0x48578f=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x9c976d=>{for(const _0xf52a12 of _0x14f957)this['_knownOperations']['add'](_0xf52a12),this['_addKnownRoot'](_0xf52a12),_0x9c976d['batch']['addOperation'](_0xf52a12),this['editor']['model']['applyOperation'](_0xf52a12);});}_addKnownRoot(_0x43a36f){const _0x25b095=this['_getAffectedRoot'](_0x43a36f);_0x25b095&&this['_knownRootNames']['add'](_0x25b095);}_getAffectedRoot(_0xa0c87b){let _0x1cd2f3,_0x56c0fc;switch(_0xa0c87b['type']){case'insert':_0x1cd2f3=_0xa0c87b['position']['root'];break;case'marker':if(_0x56c0fc=_0xa0c87b['newRange'],!_0x56c0fc)return null;_0x1cd2f3=_0x56c0fc['root'];break;case'addRootAttribute':_0x1cd2f3=_0xa0c87b['root'];break;case'addRoot':_0x1cd2f3=_0xa0c87b['affectedSelectable'];break;case'move':_0x1cd2f3=_0xa0c87b['targetPosition']['root'];break;default:return null;}return _0x1cd2f3['rootName'];}_updateServerHistory(_0x50e9a1){_0x50e9a1['forEach'](_0x4f134a=>{const _0x5898e5=_0x4f134a['clone']();_0x5898e5['_authorId']=_0x4f134a['_authorId'],_0x5898e5['_isInit']=!!_0x4f134a['_isInit'],_0x5898e5['_aiSource']=_0x4f134a['_aiSource'],_0x5898e5['createdAt']=_0x4f134a['createdAt'],_0x5898e5['baseVersion']+=this['_offset'],_0x4f134a['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x5898e5),this['serverHistory']['addOperation'](_0x5898e5);});}_handleReconnectionError(_0x47ac4e){const _0xc9204c=this['editor']['plugins']['get']('Notification'),_0x5c5750=this['editor']['locale'];_0x47ac4e||(_0x47ac4e=et(_0x5c5750,'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.')),_0xc9204c['showWarning'](_0x47ac4e,{'title':et(_0x5c5750,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](J)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x1040cb)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1040cb)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x3e01e4){const _0x122b29=_0x3e01e4['map'](_0x3316a6=>_0x3316a6['toJSON']());return this['_compressor']['compress'](_0x122b29);}_decompressOperations(_0x2c67c9,_0x4b78a4){return this['_compressor']['decompress'](_0x2c67c9)['map']((_0x4752dc,_0x3296f1)=>{const _0x2ccd72='init'==_0x4b78a4[_0x3296f1]['type'];if('InsertOperation'==_0x4752dc['__className']){const _0x497390=_0x4752dc['position']['root'];!this['_document']['getRoot'](_0x497390)&&(this['_document']['createRoot']('$unknown',_0x497390)['_isAttached']=!0x1);}else{if('RootOperation'==_0x4752dc['__className']){const _0x51ce21=this['_document']['getRoot'](_0x4752dc['rootName']);_0x51ce21&&'$unknown'==_0x51ce21['name']&&_0x4752dc['elementName']!=_0x51ce21['name']&&(_0x51ce21['name']=_0x4752dc['elementName']);}}const _0x5a9c07=_0x37dd8e['fromJSON'](_0x4752dc,this['_document']);return _0x5a9c07['wasUndone']=_0x4752dc['wasUndone'],_0x5a9c07['_isInit']=_0x2ccd72,_0x5a9c07['_authorId']=_0x2ccd72?null:_0x4b78a4[_0x3296f1]['userId'],_0x5a9c07['_isDisconnection']='cs:removeUser'===_0x4b78a4[_0x3296f1]['type'],_0x5a9c07['_aiSource']=_0x4752dc['_aiSource']||void 0x0,_0x5a9c07['createdAt']=_0x4b78a4[_0x3296f1]['createdAt'],_0x5a9c07;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x5e3359=this['editor']['plugins']['get'](Q)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5e3359&&_0x5e3359['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function ot(_0x5cf4d2,_0x1c813e){for(const _0x3ac200 of _0x5cf4d2)_0x3ac200['baseVersion']=_0x1c813e++;}var rt=class{_ignoredOperations;_operationToId;constructor(_0xed8675){this['_ignoredOperations']=_0xed8675,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x96a1e9){let _0xe7fbaf=_0x96a1e9['length'];for(;_0xe7fbaf--;){const _0x5dc7d0=_0x96a1e9[_0xe7fbaf];if(!this['_ignoredOperations']['has'](_0x5dc7d0)){if(!this['_operationToId']['has'](_0x5dc7d0)){const _0x32119b=_0x4b2f0e()['slice'](0x1,0x12);this['_operationToId']['set'](_0x5dc7d0,_0x32119b);}return this['_operationToId']['get'](_0x5dc7d0);}}}setIdForTheLastOperation(_0x2b31a1,_0x2b9728){if(!_0x2b9728)return;let _0x3f7bb3=_0x2b31a1['length'];for(;_0x3f7bb3--;){const _0x2f9348=_0x2b31a1[_0x3f7bb3];this['_ignoredOperations']['has'](_0x2f9348)||this['_operationToId']['set'](_0x2f9348,_0x2b9728);}}},ct=class extends _0x52e8ef{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class CloudServicesCommentsAdapter extends _0x5dbaf5{static CommentsService=/* #__PURE__ -- @preserve */
26
- ((()=>_0x5c0c92)());['_services'];static get requires(){return[J,_0x1bbc91,Q,_0x867fa1];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x52bceb){super(_0x52bceb),this['_services']=new Map();}async init(){const _0x14c9e4=this['context'],_0x2ad3ec=_0x14c9e4['plugins']['get'](_0x1bbc91);if(_0x14c9e4['plugins']['get'](J)['addToReconnectionStack'](this),_0x2ad3ec['adapter']={'addCommentThread':async({channelId:_0x394ca2,threadId:_0x39ac77,comments:_0x372b5d,resolvedAt:_0x454d24,resolvedBy:_0x298856,context:_0x32d92f,attributes:_0x29301e})=>{const _0x2840dd=await this['_getService'](_0x394ca2)['addCommentThread']({'commentThreadId':_0x39ac77,'comments':_0x372b5d['map'](_0x25f214=>function(_0x392528,_0x3d0c85,_0xb89023){return{'commentThreadId':_0xb89023,'commentId':_0x392528['commentId'],'userId':_0x392528['authorId'],'content':_0x392528['content'],'documentId':_0x3d0c85,'createdAt':_0x392528['createdAt'],'attributes':_0x392528['attributes']||{}};}(_0x25f214,_0x394ca2,_0x39ac77)),'resolvedAt':_0x454d24,'resolvedBy':_0x298856,'context':_0x32d92f,'attributes':_0x29301e})['catch'](lt);return{'threadId':_0x2840dd['commentThreadId'],'comments':_0x2840dd['comments']};},'getCommentThread':async({channelId:_0x534c09,threadId:_0x37a05d})=>{const _0x523ec0=await this['_getService'](_0x534c09)['getCommentThread'](_0x37a05d)['catch'](ht)['catch'](lt);return _0x523ec0?_0x523ec0['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x523ec0]),{'threadId':_0x523ec0['commentThreadId'],'comments':_0x523ec0['comments']['map'](dt),'context':_0x523ec0['context'],'resolvedAt':_0x523ec0['resolvedAt'],'resolvedBy':_0x523ec0['resolvedBy'],'attributes':_0x523ec0['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x5ba0f7,threadId:_0x4f8d56,context:_0x15b639,unlinkedAt:_0x2b24e5,attributes:_0x26f8ac})=>this['_getService'](_0x5ba0f7)['updateCommentThread']({'commentThreadId':_0x4f8d56,'context':_0x15b639,'attributes':_0x26f8ac,'unlinkedAt':_0x2b24e5})['catch'](ht)['catch'](lt),'resolveCommentThread':async({channelId:_0x23d0f9,threadId:_0x2b69b3})=>{const _0x401930=await this['_getService'](_0x23d0f9)['resolveCommentThread'](_0x2b69b3)['catch'](ht)['catch'](lt);return{'threadId':_0x401930['commentThreadId'],'resolvedAt':_0x401930['resolvedAt'],'resolvedBy':_0x401930['resolvedBy']};},'reopenCommentThread':async({channelId:_0x462bbc,threadId:_0x539bef})=>this['_getService'](_0x462bbc)['reopenCommentThread'](_0x539bef)['catch'](ht)['catch'](lt),'removeCommentThread':({channelId:_0x3c03b6,threadId:_0x447fad})=>this['_getService'](_0x3c03b6)['removeCommentThread'](_0x447fad)['catch'](ht)['catch'](lt),'addComment':({channelId:_0x5607b0,threadId:_0x488282,commentId:_0xa9028b,content:_0x49dffa,attributes:_0x4e26a0})=>this['_getService'](_0x5607b0)['addComment'](_0x488282,_0xa9028b,_0x49dffa,_0x4e26a0)['catch'](lt),'updateComment':({channelId:_0xea42f3,threadId:_0xe21269,commentId:_0x5c2982,content:_0x119ca8,attributes:_0x4d2a8d})=>this['_getService'](_0xea42f3)['updateComment'](_0xe21269,_0x5c2982,_0x119ca8,_0x4d2a8d)['catch'](ht)['catch'](lt),'removeComment':({channelId:_0x22bb2a,threadId:_0x1a1862,commentId:_0x201010})=>this['_getService'](_0x22bb2a)['removeComment'](_0x1a1862,_0x201010)['catch'](ht)['catch'](lt)},_0x14c9e4 instanceof _0x363235){const _0x265d09=_0x14c9e4['config']['get']('collaboration.channelId'),_0x24bc08=_0x14c9e4['plugins']['get'](Q);await this['_setUpService'](_0x265d09);const _0x26a70c=await this['_services']['get'](_0x265d09)['getConnectedSessions']();this['listenTo'](_0x24bc08,'sessionAdd:'+_0x265d09,(_0x5a80c2,{session:_0x5084b9})=>{_0x5084b9['id']===_0x24bc08['mySessionId']&&(_0x5a80c2['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x5084b9['permissions'],_0x265d09));}),_0x24bc08['register'](_0x265d09,_0x26a70c);}}async _setUpService(_0x42e862){if(this['_services']['has'](_0x42e862))throw new _0x18939e('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x42e862});const _0x35e175=this['context']['plugins']['get'](_0x1bbc91),_0x1e6d54=new CloudServicesCommentsAdapter['CommentsService'](_0x42e862);this['_services']['set'](_0x42e862,_0x1e6d54),this['listenTo'](_0x1e6d54,'commentThreadAdded',(_0x587aa5,_0x77cdd)=>{const {commentThreadId:_0x5d8f12,documentId:_0x28849b,context:_0x117e62,attributes:_0x160853,resolvedAt:_0x5e8e07,resolvedBy:_0xb854c2,comments:_0xb66b25}=_0x77cdd;_0x35e175['getCommentThread'](_0x5d8f12)||_0x35e175['addCommentThread']({'threadId':_0x5d8f12,'channelId':_0x28849b,'comments':_0xb66b25?_0xb66b25['map'](dt):[],'context':_0x117e62,'attributes':_0x160853,'resolvedAt':_0x5e8e07,'resolvedBy':_0xb854c2,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e6d54,'commentThreadUpdated',(_0x4375f8,{commentThreadId:_0x3b0714,documentId:_0x264deb,context:_0x7f313d,unlinkedAt:_0x31f3de,attributes:_0x59b603})=>{_0x35e175['getCommentThread'](_0x3b0714)&&_0x35e175['updateCommentThread']({'threadId':_0x3b0714,'channelId':_0x264deb,'context':_0x7f313d,'unlinkedAt':_0x31f3de,'attributes':_0x59b603,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e6d54,'commentThreadResolved',(_0x10ff54,{commentThreadId:_0x3df24a,resolvedBy:_0x5d2c39,resolvedAt:_0x47f9eb})=>{const _0x848fb8=_0x35e175['getCommentThread'](_0x3df24a);_0x848fb8&&_0x848fb8['resolve']({'resolvedBy':_0x5d2c39,'resolvedAt':_0x47f9eb,'isFromAdapter':!0x0});}),this['listenTo'](_0x1e6d54,'commentThreadReopened',(_0x4e907c,{commentThreadId:_0x3402a2})=>{const _0x3ee503=_0x35e175['getCommentThread'](_0x3402a2);_0x3ee503&&_0x3ee503['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e6d54,'commentThreadRemoved',(_0xb36b55,{commentThreadId:_0x2172fc})=>{const _0x39d7fc=_0x35e175['getCommentThread'](_0x2172fc);_0x39d7fc&&_0x39d7fc['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x1e6d54,'commentAdded',(_0x290671,_0x4a868a)=>{const _0x51118c=_0x4a868a['commentThreadId'],_0x53f92d=_0x35e175['getCommentThread'](_0x51118c);_0x53f92d&&_0x53f92d['addComment']({...dt(_0x4a868a),'isFromAdapter':!0x0});}),this['listenTo'](_0x1e6d54,'commentUpdated',(_0x11f3e2,{commentThreadId:_0x161da0,commentId:_0x1b5f4f,content:_0x26f75c,attributes:_0x520cf6})=>{const _0x132c01=_0x35e175['getCommentThread'](_0x161da0);if(_0x132c01){const _0x1facb9=_0x132c01['getComment'](_0x1b5f4f);_0x1facb9&&_0x1facb9['update']({'content':_0x26f75c,'attributes':_0x520cf6,'isFromAdapter':!0x0});}}),this['listenTo'](_0x1e6d54,'commentRemoved',(_0x2945bf,{commentThreadId:_0x2ba825,commentId:_0x12c538})=>{const _0x2a328b=_0x35e175['getCommentThread'](_0x2ba825);if(_0x2a328b){const _0x4e2a12=_0x2a328b['getComment'](_0x12c538);_0x4e2a12&&_0x4e2a12['remove']({'isFromAdapter':!0x0});}}),this['listenTo'](_0x1e6d54,'disconnected',()=>{'connected'===this['context']['plugins']['get'](J)['connection']?.['state']&&(this['_services']['delete'](_0x42e862),this['stopListening'](_0x1e6d54));}),await this['_connectService'](_0x42e862);}destroy(){if(this['context']instanceof _0x363235){const _0x475d26=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x475d26)&&this['_terminateService'](_0x475d26);}}_terminateService(_0x39a0b3){if(!this['_services']['has'](_0x39a0b3))throw new _0x18939e('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x39a0b3});this['_getService'](_0x39a0b3)['disconnect'](),this['_services']['delete'](_0x39a0b3);}async reconnect(){for(const _0x8293e7 of this['_services']['keys']())await this['_connectService'](_0x8293e7);if(this['context']instanceof _0x363235){const _0x1233dd=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x1233dd)){const _0x438a33=this['context']['plugins']['get'](Q);_0x438a33['unregister'](_0x1233dd);const _0x341f66=await this['_services']['get'](_0x1233dd)['getConnectedSessions']();_0x438a33['register'](_0x1233dd,_0x341f66);}}}async _connectService(_0x20b4ca){const {connection:_0x1bfb2d}=this['context']['plugins']['get'](J),_0x43a64d=this['context']['plugins']['get'](_0x1bbc91),_0x4a3db1=await this['_services']['get'](_0x20b4ca)['connect'](_0x1bfb2d);await this['_fetchMissingUsersForThreads'](_0x4a3db1);const _0x21f537=new Set(Array['from'](_0x43a64d['getCommentThreads']({'channelId':_0x20b4ca}),_0x34354f=>_0x34354f['id']));for(const _0x4af48e of _0x4a3db1)_0x4af48e['deletedAt']||_0x21f537['delete'](_0x4af48e['commentThreadId']);for(const _0x5683e8 of _0x21f537)_0x43a64d['getCommentThread'](_0x5683e8)['remove']({'isFromAdapter':!0x0});for(const _0x3213c2 of _0x4a3db1){let _0x2128ac=_0x43a64d['getCommentThread'](_0x3213c2['commentThreadId']);const {commentThreadId:_0xfd7bde,context:_0x249f4d,attributes:_0x2201d7,resolvedBy:_0x4b03e9,resolvedAt:_0x2d3272,unlinkedAt:_0x5d38e9,deletedAt:_0x5dab3a}=_0x3213c2;if(_0x5dab3a)continue;_0x2128ac||(_0x2128ac=_0x43a64d['addCommentThread']({'channelId':_0x20b4ca,'threadId':_0xfd7bde,'context':_0x249f4d,'attributes':_0x2201d7||{},'resolvedBy':_0x4b03e9,'resolvedAt':_0x2d3272,'unlinkedAt':_0x5d38e9,'isFromAdapter':!0x0}));const _0x3dab6e=new Set(Array['from'](_0x2128ac['comments'],_0x3fa800=>_0x3fa800['id']));for(const _0x59f007 of _0x3213c2['comments'])_0x3dab6e['delete'](_0x59f007['commentId']);for(const _0x2bcad3 of _0x3dab6e)_0x2128ac['getComment'](_0x2bcad3)['remove']({'isFromAdapter':!0x0});for(const _0x2aa714 of _0x3213c2['comments']){const _0x4a45d3=_0x2128ac['getComment'](_0x2aa714['commentId']);_0x4a45d3?_0x4a45d3['content']!==_0x2aa714['content']&&_0x4a45d3['update']({'content':_0x2aa714['content'],'isFromAdapter':!0x0}):_0x2128ac['addComment'](Object['assign'](dt(_0x2aa714),{'isFromAdapter':!0x0}));}}}_getService(_0x5d8b9f){if(!this['_services']['has'](_0x5d8b9f))throw new _0x18939e('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x5d8b9f});return this['_services']['get'](_0x5d8b9f);}async _fetchMissingUsersForThreads(_0x158fda){const _0x5150b0=this['context']['plugins']['get'](_0x867fa1),{connection:_0x438f8a}=this['context']['plugins']['get'](J),_0x1fc98e=new Set();for(const {resolvedBy:_0x3341f9,comments:_0xd2143b}of _0x158fda){_0x3341f9&&!_0x5150b0['getUser'](_0x3341f9)&&_0x1fc98e['add'](_0x3341f9);for(const {userId:_0x411e79}of _0xd2143b)_0x5150b0['getUser'](_0x411e79)||_0x1fc98e['add'](_0x411e79);}if(0x0===_0x1fc98e['size'])return;const _0x50982d=await _0x9bed89['getMany'](_0x438f8a,Array['from'](_0x1fc98e));for(const _0x3117d2 of _0x50982d)_0x5150b0['getUser'](_0x3117d2['id'])||_0x5150b0['addUser'](_0x3117d2);}};async function ht(_0x37486e){if('404'!==_0x37486e['code'])throw _0x37486e;}function lt(_0x59fe5f){if((_0x33c2a8=_0x59fe5f)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x33c2a8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x33c2a8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x33c2a8;throw _0x59fe5f;}function dt(_0x3acf4f){return{'threadId':_0x3acf4f['commentThreadId'],'commentId':_0x3acf4f['commentId'],'content':_0x3acf4f['content'],'createdAt':_0x3acf4f['createdAt'],'authorId':_0x3acf4f['userId'],'attributes':_0x3acf4f['attributes']||{}};}var ut=class CloudServicesTrackChangesAdapter extends _0x52e8ef{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>_0x127256)());_bufferedRequests;_trackChangesService;static get requires(){return[at,_0x66e8c5,J];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xf9db65){super(_0xf9db65);const _0x236665=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0x236665);}init(){const _0x5aa004=this['editor']['plugins']['get'](J),_0x66c637=this['editor']['plugins']['get'](_0x66e8c5);return _0x66c637['adapter']={'getSuggestion':async _0x1aa949=>{await this['_waitForServiceReady']();const _0x4fb7fe=await this['_trackChangesService']['get'](_0x1aa949)['catch'](ft);return await this['_fetchMissingUsersForThreads']([_0x4fb7fe]),_0x4fb7fe;},'addSuggestion':async({id:_0x14620f,type:_0x36bc94,data:_0x29b140,originalSuggestionId:_0x9f54a9,attributes:_0x12b48e})=>{await this['_waitForServiceReady']();const _0x48c8ba={'id':_0x14620f,'type':_0x36bc94,'data':_0x29b140,'originalSuggestionId':_0x9f54a9,'attributes':_0x12b48e},_0x50eefc=await this['_trackChangesService']['add'](_0x14620f,_0x36bc94,_0x29b140,_0x9f54a9,_0x12b48e)['catch'](_0x1e45ff=>{if(mt(_0x1e45ff))return new Promise(_0x2dd89e=>{this['_bufferedRequests']['set'](_0x14620f,{'resolve':_0x2dd89e,'suggestionData':_0x48c8ba});});throw _0x1e45ff;});return this['_bufferedRequests']['delete'](_0x14620f),_0x50eefc;},'updateSuggestion':async(_0x9da2e,_0x397fa5)=>{if(await this['_waitForServiceReady'](),'open'!==_0x397fa5['state'])return this['_trackChangesService']['update'](_0x9da2e,_0x397fa5)['catch'](ft);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0xfb889e,_0x1e217f)=>{_0x66c637['hasSuggestion'](_0x1e217f['id'])&&(_0x66c637['getSuggestion'](_0x1e217f['id'])['attributes']=_0x1e217f['attributes']);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x5aa004['connection']?.['state']&&(_0x5aa004['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));}),this['_trackChangesService']['connect'](_0x5aa004['connection'])['then'](_0xce8856=>(_0x5aa004['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0xce8856)['then'](()=>{for(const _0x323590 of _0xce8856){_0x66c637['addSuggestionData'](_0x323590)['_saved']=!0x0;}})));}async reconnect(){const _0x1a810c=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x24c65d}=this['editor']['plugins']['get'](J),_0xb0a7b7=await this['_trackChangesService']['connect'](_0x24c65d);await this['_fetchMissingUsersForThreads'](_0xb0a7b7);for(const {suggestionData:_0x1e35b4,resolve:_0x353f46}of this['_bufferedRequests']['values']()){let _0xf2e2d8=_0xb0a7b7['find'](_0x3e4d5e=>_0x3e4d5e['id']===_0x1e35b4['id']);_0xf2e2d8||(_0xf2e2d8=await this['_trackChangesService']['add'](_0x1e35b4['id'],_0x1e35b4['type'],_0x1e35b4['data'],_0x1e35b4['originalSuggestionId'])),_0x353f46(_0xf2e2d8);}for(const _0x43fddf of _0xb0a7b7)_0x1a810c['hasSuggestion'](_0x43fddf['id'])||_0x1a810c['addSuggestionData'](_0x43fddf);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x138c96=>{this['listenTo'](this['_trackChangesService'],'connected',_0x14e757=>{_0x14e757['off'](),_0x138c96();});});}async _fetchMissingUsersForThreads(_0xfae57){const _0x44bcdc=this['editor']['plugins']['get'](_0x867fa1),{connection:_0x63db62}=this['editor']['plugins']['get'](J),_0xcbbe48=new Set();for(const {authorId:_0x19c20e}of _0xfae57)_0x44bcdc['getUser'](_0x19c20e)||_0xcbbe48['add'](_0x19c20e);if(0x0===_0xcbbe48['size'])return;const _0x3f4b64=await _0x9bed89['getMany'](_0x63db62,Array['from'](_0xcbbe48));for(const _0x47e636 of _0x3f4b64)_0x44bcdc['getUser'](_0x47e636['id'])||_0x44bcdc['addUser'](_0x47e636);}};function ft(_0x2474e8){if(mt(_0x2474e8))return new Promise(()=>{});throw _0x2474e8;}function mt(_0x292d61){return _0x292d61['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x292d61['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var pt=class extends _0x52e8ef{static get requires(){return[_0x381f45,at,ct,J];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x131483=this['editor']['plugins']['get'](J),_0x2bcf07=this['editor']['plugins']['get'](_0x1923ce),_0x4f78b8=this['editor']['plugins']['get'](at);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x131483,'change:state',(_0x5d7c8e,_0x25cdbb,_0x13d8eb)=>{_0x2bcf07['isThreadsLoadingPaused']='connected'!==_0x13d8eb;});}),this['listenTo'](_0x131483,'change:state',(_0x294c1f,_0x3b7b8f,_0x3d8ee7)=>{this['editor']['plugins']['get'](_0x1bbc91)['switchReadOnly']('connected'!==_0x3d8ee7);}),_0x4f78b8['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}destroy(){const _0x4f8b61=this['editor']['plugins']['get'](at),_0x4b9d46=this['editor']['config']['get']('collaboration.channelId');_0x4f8b61['_services']['has'](_0x4b9d46)&&_0x4f8b61['_terminateService'](_0x4b9d46),super['destroy']();}},gt=class extends _0x52e8ef{static get requires(){return[pt,ut,_0x58dfb9];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},wt=class CloudServicesRevisionHistoryAdapter extends _0x52e8ef{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
- ((()=>_0x13e383)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;static get requires(){return[J,it,_0x31414e,Q,_0x867fa1];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4eb18c){super(_0x4eb18c);const _0x307584=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x307584);}async init(){const _0x106539=this['editor']['plugins']['get'](it),_0x2ae7a8=_0x106539['serverHistory'],_0x5b66f7=this['editor']['plugins']['get'](J);this['_revisionTracker']['setSource']({'history':_0x2ae7a8,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x106539['sessionId']});const _0x4df35a=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x3b79db,_0x3176c8=await _0x430b33['isBundleUploaded'](_0x5b66f7['connection'],_0x4df35a);this['editor']['plugins']['get'](_0x31414e)['adapter']={'getRevision':async({revisionId:_0x5d9da6})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x5d9da6)),'updateRevisions':async _0x16585a=>{await this['_waitForServiceReady']();const _0x279901=this['_revisionTracker']['currentRevision'];if(_0x3176c8&&0x1===_0x16585a['length']&&_0x16585a[0x0]['id']===_0x279901['id'])return _0x16585a;for(const _0xcae9ea of _0x16585a)_0xcae9ea['id']===_0x279901['id']&&(_0xcae9ea['isEmptyCurrent']=_0xcae9ea['fromVersion']===_0xcae9ea['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x16585a,this['_lastRequestId'])['then'](_0x183b2e=>(this['_lastRequestId']=_0x183b2e,_0x16585a))['catch'](_0x54ca77=>{if(vt(_0x54ca77)||'400'===_0x54ca77['code']&&void 0x0!==_0x54ca77['data']['wrongRequestId']){for(const _0x3b28f7 of _0x16585a)this['_revisionTracker']['repository']['getRevision'](_0x3b28f7['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x3b28f7['id'],_0x3b28f7,!0x1);if(vt(_0x54ca77)&&'destroyed'!==this['editor']['state'])throw _0x54ca77;return _0x16585a;}throw _0x54ca77;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x4b0388,{revisionsData:_0x432019,requestId:_0x1adcc0})=>{Math['max'](..._0x432019['map'](_0x4e489a=>_0x4e489a['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x432019,_0x1adcc0);}):this['_handleRevisionsUpdate'](_0x432019,_0x1adcc0);}),this['set']('_isServiceConnected',!0x1),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x5b66f7['connection']?.['state']&&(_0x5b66f7['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const {revisions:_0x264bdc,requestId:_0x5149f6}=await this['_revisionHistoryService']['connect'](_0x5b66f7['connection']);_0x5b66f7['addToReconnectionStack'](this),this['_lastRequestId']=_0x5149f6,await this['_fetchMissingUsers'](_0x264bdc);for(const _0x3fc1eb of _0x264bdc)this['_revisionTracker']['addRevisionData'](_0x3fc1eb);this['listenTo'](_0x106539,'change:_isConnected',(_0x2d2f02,_0x2c8c5a,_0x58c0b5)=>{_0x58c0b5&&(this['_oldOffset']=_0x106539['_offset'],_0x2d2f02['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected');}async reconnect(){const _0xd67fa7=this['editor']['plugins']['get'](J),_0x2695e1=this['editor']['plugins']['get'](it),_0x314d6e=async()=>{const _0x3351f7=this['_revisionTracker']['currentRevision'],_0x1d4da6=_0x3351f7['id'],_0x2225b4=_0x1d4da6!==_0x2695e1['sessionId'];if(_0x2225b4){const _0x23d8f0=_0x2695e1['_offset']-this['_oldOffset'],_0x22ff53=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x3351f7['toVersion']+_0x23d8f0!==_0x22ff53){const _0x3ab16c=_0x3351f7['fromVersion']+_0x23d8f0,_0x594475=this['editor']['plugins']['get'](_0x867fa1),_0x5a4c82=this['_revisionTracker']['buildRevisionData']({'revision':_0x3351f7,'from':_0x3ab16c,'to':_0x22ff53});_0x5a4c82['id']=_0x3351f7['id'];const _0x44cec7=_0x5a4c82['authorsIds']['map'](_0x18c61a=>_0x594475['getUser'](_0x18c61a));_0x3351f7['_update']({..._0x5a4c82,'authors':_0x44cec7},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x3351f7['id'],_0x5a4c82,!0x0);}this['_revisionTracker']['_startingVersion']=_0x22ff53,_0x3351f7['toVersion']!==_0x3351f7['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x1d4da6)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x1d4da6),this['_revisionTracker']['_createCurrentRevision'](_0x22ff53);}const {revisions:_0x3464a6,requestId:_0x3f94a9}=await this['_revisionHistoryService']['reconnect'](_0xd67fa7['connection'],this['_lastRequestId']);_0x2225b4&&_0x3464a6['length']>0x0?_0x2695e1['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3464a6),this['_handleRevisionsUpdate'](_0x3464a6,_0x3f94a9),this['_revisionTracker']['sendBufferedUpdates']());};return _0x2695e1['_isConnected']?_0x314d6e():new Promise((_0xc76ac1,_0x2f0d53)=>{_0x2695e1['once']('change:_isConnected',()=>{_0x314d6e()['then'](_0xc76ac1)['catch'](_0x2f0d53);});});}destroy(){super['destroy']();}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x12ef27=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x360279=>{_0x360279['off'](),_0x12ef27();});});}_getLatestVersionFromServerOperations(){const _0x1ae91b=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x1ed653 of _0x1ae91b)if('marker'!==_0x1ed653['type']||_0x1ed653['affectsData'])return _0x1ed653['baseVersion']+0x1;}_getLatestVersion(){const _0x3fe7fe=this['editor']['plugins']['get'](it);return new Promise(_0x284d88=>{_0x3fe7fe['_isPendingUpdate']?_0x3fe7fe['once']('change:_isPendingUpdate',()=>{_0x284d88(this['_getLatestVersionFromServerOperations']());}):_0x284d88(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x46f0c5,_0x3cd700){const _0x5c039d=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3cd700;for(const _0x359415 of _0x46f0c5){const _0x544518=_0x5c039d['getRevision'](_0x359415['id']);if(_0x544518){if((_0x359415['fromVersion']||_0x359415['toVersion'])&&(_0x359415['diffData']=null),_0x544518===this['_revisionTracker']['currentRevision']){const _0x24487a=Math['max'](_0x544518['toVersion'],_0x359415['toVersion']),_0x53f8d8=Math['max'](_0x544518['fromVersion'],_0x359415['fromVersion']);let _0x16004f;_0x544518['toVersion']===_0x359415['toVersion']&&_0x544518['fromVersion']===_0x359415['fromVersion']?(_0x16004f=!0x0,this['_preventResendingRevisionData'](_0x359415)):_0x359415['toVersion']===_0x24487a&&_0x359415['fromVersion']===_0x53f8d8?_0x16004f=!0x1:(_0x544518['toVersion']===_0x24487a&&_0x544518['fromVersion']===_0x53f8d8||this['_fixRevision']({'revision':_0x544518,'from':_0x53f8d8,'to':_0x24487a}),_0x16004f=!0x0),_0x16004f&&(delete _0x359415['fromVersion'],delete _0x359415['toVersion'],delete _0x359415['diffData'],delete _0x359415['createdAt'],delete _0x359415['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x359415),this['_preventResendingRevisionData'](_0x359415);}else this['_revisionTracker']['addRevisionData'](_0x359415);}const _0x5d99d8=_0x5c039d['getRevisions']();_0x5d99d8['reverse']();for(let _0x4c4e28=0x0;_0x4c4e28<_0x5d99d8['length']-0x1;_0x4c4e28++){const _0x3032bb=_0x5d99d8[_0x4c4e28],_0x11de62=_0x5d99d8[_0x4c4e28+0x1];if(_0x3032bb['fromVersion']<_0x11de62['toVersion']){const _0x230447=_0x11de62['toVersion'],_0x5de4d5=Math['max'](_0x230447,_0x3032bb['toVersion']);this['_fixRevision']({'revision':_0x3032bb,'from':_0x230447,'to':_0x5de4d5});}}}['_fixRevision']({revision:_0x1b81e9,from:_0x33ac38,to:_0x43359b}={}){const _0x316ce3=this['editor']['plugins']['get'](_0x867fa1),_0x212188=this['_revisionTracker']['buildRevisionData']({'revision':_0x1b81e9,'from':_0x33ac38,'to':_0x43359b});_0x212188['authors']=_0x212188['authorsIds']['map'](_0x36c3fc=>_0x316ce3['getUser'](_0x36c3fc)),_0x1b81e9['_update'](_0x212188);}_preventResendingRevisionData(_0x3e73b9){const _0x8f62ef={};_0x8f62ef['id']=_0x3e73b9['id'];for(const _0x28ba56 of Object['keys'](_0x3e73b9))'id'!==_0x28ba56&&(_0x8f62ef[_0x28ba56]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x8f62ef['id'],_0x8f62ef,!0x0);}async _fetchMissingUsers(_0x57b0f1){const _0x12d9c8=this['editor']['plugins']['get'](_0x867fa1),{connection:_0x2a57ae}=this['editor']['plugins']['get'](J),_0x2be504=new Set();for(const _0x2f622a of _0x57b0f1){for(const _0x276a5d of _0x2f622a['authorsIds'])_0x43bfa2(_0x276a5d);_0x2f622a['creatorId']&&_0x43bfa2(_0x2f622a['creatorId']);}if(0x0===_0x2be504['size'])return;const _0x2bc70d=await _0x9bed89['getMany'](_0x2a57ae,Array['from'](_0x2be504));for(const _0x7f6fbb of _0x2bc70d)_0x12d9c8['getUser'](_0x7f6fbb['id'])||_0x12d9c8['addUser'](_0x7f6fbb);function _0x43bfa2(_0x2f877d){_0x12d9c8['getUser'](_0x2f877d)||_0x2be504['add'](_0x2f877d);}}};function vt(_0xc69517){return _0xc69517['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0xc69517['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xc69517['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var _t=class extends _0x52e8ef{static get requires(){return[_0x31414e,wt,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},yt=class extends _0x120ca6{_collapseAt;constructor(_0x24d0ae,_0x260577=0x6){super(_0x24d0ae);const _0x4438e2=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x260577,this['bind']('isHidden')['to'](this,'usersCount',_0x11e5ed=>_0x11e5ed<_0x260577),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x4438e2['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':_0x4438e2['to']('usersCount',_0x23ab03=>'+'+(_0x23ab03-this['_collapseAt']+0x2)['toString']())}]}]}]});}},bt=class extends _0x120ca6{items;keystrokes;constructor(_0x5eddea){super(_0x5eddea);const _0x45d77e=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x35d8f6(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x45d77e['if']('hasPopup'),'aria-expanded':_0x45d77e['to']('isExpanded',_0x4b98ef=>this['hasPopup']&&String(_0x4b98ef)),'aria-label':_0x45d77e['to']('hasPopup',_0x48976a=>et(_0x5eddea,_0x48976a?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x45d77e['to']('hasPopup',_0x3c84e1=>!!_0x3c84e1&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0xe0b047,_0x25eead,_0x1ed067)=>{this['element']&&(_0x1ed067?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']);}},kt=class extends _0x120ca6{counterView;inlineListView;constructor(_0x21714e,_0x5c3398=0x6){super(_0x21714e);const _0x2c9eb6=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new yt(this['locale'],_0x5c3398),this['inlineListView']=new bt(_0x21714e),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x293dc5 of this['inlineListView']['items'])_0x293dc5['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',_0x2c9eb6['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},It=class extends _0x120ca6{listWrapperView;constructor(_0x50615e,_0x54f22a){super(_0x50615e),this['listWrapperView']=new St(_0x50615e,_0x54f22a),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0x50615e,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},St=class extends _0xdc9acc{constructor(_0x5b14b4,_0x4a1171){super(_0x5b14b4);const _0x2de001=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4a1171?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x2de001['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x2de001['to']('role'),'aria-label':_0x2de001['to']('ariaLabel'),'aria-labelledby':_0x2de001['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x18b49a['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x526e41=this['element'];_0x526e41&&(this['_isScrollable']=Math['max'](_0x526e41['scrollHeight'],_0x526e41['clientHeight'])>0.8*window['innerHeight']);}},Tt=class extends _0x1a8f6c{['userView'];constructor(_0x242a43,_0x15809a,_0x54a947){super(_0x242a43);const _0x449135=this['bindTemplate'];this['userView']=new _0xec502c(_0x242a43,_0x15809a);const _0x40ea67={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x15809a['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x15809a['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x15809a['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x15809a['color']['getColorVariable'](),'--ck-user-color-alpha':_0x15809a['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x54a947&&(_0x40ea67['tag']='button',_0x40ea67['on']={'click':_0x449135['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x40ea67);}['focus'](){this['element']['focus']();}},Ct=class extends _0x120ca6{['userView'];['markerView'];constructor(_0x240f74,_0x27ed43,_0x531c4c){super(_0x240f74);const _0x4a975f=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0xec502c(_0x240f74,_0x27ed43),this['markerView']=new At(_0x240f74,_0x27ed43);const _0x42afd6=new _0x17b8ff(_0x240f74);_0x42afd6['template']['tag']='span',_0x42afd6['text']=_0x27ed43['name'];const _0x4297e2={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x4a975f['to']('isFocusable',_0x400ff7=>_0x400ff7?0x0:-0x1),'aria-labelledby':_0x42afd6['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x4a975f['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x4a975f['to']('hasTooltip',_0x27030e=>!_0x27030e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x42afd6]};_0x531c4c&&(_0x4297e2['tag']='button',_0x4297e2['on']={'click':_0x4a975f['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4297e2);}},At=class extends _0x120ca6{constructor(_0x58699f,_0x3cc333){super(_0x58699f),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x3cc333['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x3cc333['color']['getColorVariable'](),'--ck-user-color-alpha':_0x3cc333['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Pt={'collapseAt':0x6,'displayMe':!0x0};var Ot=class extends _0x5dbaf5{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x22d26f){super(_0x22d26f),this['context']['config']['define']('presenceList',Pt);const _0x5d80f2=_0x22d26f['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x5d80f2)throw new _0x18939e('presencelist-collapseat-invalid-format',this);if(_0x5d80f2<0x1)throw new _0x18939e('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](Q)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x11a6e2(),this['balloonPanelView']=new _0x57bb6a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[Q];}init(){for(const _0x9fdd44 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x9fdd44);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1be8d9,_0x3080df)=>{this['_handleUserAdd'](_0x3080df);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x48ae34,_0x16c2d0)=>{this['_handleUserRemove'](_0x16c2d0);});}_createView(){const _0xb9f10a=this['context'],_0x437f67=new kt(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x43ed4c=this['balloonPanelView'];if(!_0x2df90e(_0xb9f10a['config']['get']('presenceList.container')))throw new _0x18939e('presencelist-missing-container',this);_0x437f67['counterView']['bind']('usersCount')['to'](this),_0x437f67['bind']('isCollapsed')['to'](this,'usersCount',_0x7b7343=>{const {collapseAt:_0x1b43eb}=_0xb9f10a['config']['get']('presenceList'),_0x30c9cf=_0x7b7343>=_0x1b43eb;if(_0x30c9cf&&!_0x437f67['inlineListView']['items']['find'](_0x1072b7=>_0x1072b7 instanceof yt)){const _0x32a583=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x32a583&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x437f67['inlineListView']['items']['add'](_0x437f67['counterView']);}return _0x30c9cf||this['hideDropdown'](),_0x30c9cf;}),_0x437f67['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x82824d=>{const _0x1492c3=_0xb9f10a['config']['get']('presenceList'),_0x4040bb=new Ct(_0xb9f10a['locale'],_0x82824d,!!_0x1492c3['onClick']);return _0x4040bb['bind']('hasTooltip')['to'](_0x437f67,'isCollapsed',_0xb7938f=>!_0xb7938f),_0x4040bb['bind']('isFocusable')['to'](_0x437f67,'isCollapsed',_0x40f01f=>!_0x40f01f),_0x1492c3['onClick']&&this['listenTo'](_0x4040bb,'execute',()=>{this['view']['isCollapsed']||_0x1492c3['onClick'](_0x82824d,_0x4040bb['element']);}),_0x4040bb;}),_0x437f67['inlineListView']['keystrokes']['set']('Enter',(_0x325666,_0x524cfa)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0x524cfa());}),_0x437f67['render'](),_0x43ed4c['render'](),_0x437f67['listenTo'](_0x437f67['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x45875f=(_0x1a6f84,_0x13f492)=>{this['_hideDropdownUnlessPointerInside'](_0x13f492);};return _0x437f67['listenTo'](_0x437f67['inlineListView']['element'],'mouseleave',_0x45875f),_0x437f67['listenTo'](_0x43ed4c['element'],'mouseleave',_0x45875f),_0x1398a0({'emitter':_0x437f67,'activator':()=>_0x43ed4c['isVisible'],'contextElements':[_0x43ed4c['element'],_0x437f67['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0xb9f10a['config']['get']('presenceList.container')['appendChild'](_0x437f67['element']),this['_overlayHost']=new _0x6295c0(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x437f67;}_resolveOverlayTarget(){const _0x35519b=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x35519b)return _0x35519b;const _0x113a29=this['context']['config']['get']('presenceList.container');return _0x113a29?_0x9144b7(_0x113a29):null;}['_handleUserAdd'](_0x25a1ac){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x25a1ac['isMe'])return;const _0x34346b=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x34346b-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x314c80=_0x25a1ac['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x25a1ac,_0x314c80);}['_handleUserRemove'](_0x456454){this['usersCount']--;const {collapseAt:_0x20176e}=this['context']['config']['get']('presenceList'),_0x433c1a=this['usersCount']>=_0x20176e;if(this['currentDisplayedUsers']['get'](_0x456454['id']))this['currentDisplayedUsers']['remove'](_0x456454['id']);else{if(_0x433c1a&&this['currentDisplayedUsers']['length']+0x1===_0x20176e-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x433c1a?0x1:0x0)<this['usersCount']){for(const _0x5a2c4b of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x5a2c4b['id'])&&(this['currentDisplayedUsers']['add'](_0x5a2c4b,Math['min'](this['currentDisplayedUsers']['length']-(_0x433c1a?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x433c1a?0x1:0x0)===_0x20176e-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x170192=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new It(this['context']['locale'],!!_0x170192['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x113a5b}=this['presenceDropdownView'];_0x113a5b['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5655fe=>{if(!_0x170192['displayMe']&&_0x5655fe['isMe'])return null;const _0x39d42d=new Tt(this['context']['locale'],_0x5655fe,!!_0x170192['onClick']);return _0x170192['onClick']&&this['listenTo'](_0x39d42d,'execute',()=>{_0x170192['onClick'](_0x5655fe,_0x39d42d['element']);}),_0x39d42d;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']);const _0x1af6c9=_0x57bb6a['generatePositions']({'heightOffset':0x3,'config':{'withArrow':!0x1}});this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element'],'positions':[_0x1af6c9['southArrowNorth'],_0x1af6c9['southArrowNorthMiddleWest'],_0x1af6c9['southArrowNorthMiddleEast'],_0x1af6c9['southArrowNorthWest'],_0x1af6c9['southArrowNorthEast'],_0x1af6c9['northArrowSouth'],_0x1af6c9['northArrowSouthMiddleWest'],_0x1af6c9['northArrowSouthMiddleEast'],_0x1af6c9['northArrowSouthWest'],_0x1af6c9['northArrowSouthEast'],_0x1af6c9['viewportStickyNorth']]}),_0x113a5b['focus'](),_0x113a5b['checkIfScrollable']();const _0x4a7c84=(_0x3e9c11,_0x48a233)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x48a233();};_0x113a5b['keystrokes']['set']('Esc',_0x4a7c84),_0x113a5b['keystrokes']['set']('Shift+Tab',_0x4a7c84),_0x113a5b['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0x113a5b['focusTracker']['add'](this['view']['element']),_0x113a5b['focusTracker']['on']('change:isFocused',(_0x558a27,_0x5b3153,_0x35083b)=>{_0x35083b||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);}_hideDropdownUnlessPointerInside(_0x1180a3){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x2e743b=>_0x7e1130(_0x2e743b,_0x1180a3))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},xt=class extends _0x5dbaf5{static get requires(){return[Q,Ot];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{at as CloudServicesCommentsAdapter,wt as CloudServicesRevisionHistoryAdapter,ut as CloudServicesTrackChangesAdapter,xt as PresenceList,Ot as PresenceListUI,it as RealTimeCollaborationClient,pt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,_t as RealTimeCollaborativeRevisionHistory,gt as RealTimeCollaborativeTrackChanges,Q as Sessions,J as WebSocketGateway};
23
+ import{Context as _0x173008,ContextPlugin as _0x334b4d,PendingActions as _0x1597fd,Plugin as _0x347055}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x31a26d,Collection as _0x15ab26,DomEmitterMixin as _0x373b1e,KeystrokeHandler as _0x13848e,getOverlayMountRoot as _0x43009b,global as _0x575d0f,trustedHtml as _0x1bd9bb,uid as _0x305c1a,version as _0x5205bd}from'@ckeditor/ckeditor5-utils';import{BalloonPanelView as _0x250a77,LabelView as _0x2545d3,ListItemView as _0x37736a,ListView as _0x3eb0aa,Notification as _0x48617a,OverlayHost as _0x325e75,View as _0x125328,clickOutsideHandler as _0x2ba919}from'@ckeditor/ckeditor5-ui';import{History as _0x1f93fe,InsertOperation as _0x286c5c,MarkerOperation as _0x2822bc,ModelLiveRange as _0x2ace55,NoOperation as _0x17a90c,OperationFactory as _0x2d2939,RootAttributeOperation as _0xd1239,transformOperationSets as _0xa939b6}from'@ckeditor/ckeditor5-engine';import{CloudServices as _0x479238}from'@ckeditor/ckeditor5-cloud-services';import{CollaborativeEditingService as _0x287155,CommentsService as _0x3a107a,EditorService as _0x2ae61f,RevisionHistoryService as _0x1e9a0f,TrackChangesService as _0x4b74e0,User as _0x38da0f,WEB_SOCKET_GATEWAY_STATES as _0xd5f518,WebSocketGateway as _0x5ef846}from'@ckeditor/ckeditor-cloud-services-collaboration';import{UserView as _0x765632,Users as _0x2d7ca7,isPointerStillOver as _0x4f9984}from'@ckeditor/ckeditor5-collaboration-core';import{Compressor as _0x5e359a}from'@ckeditor/ckeditor5-operations-compressor';import{TrackChanges as _0x5d5d91,TrackChangesEditing as _0x190799}from'@ckeditor/ckeditor5-track-changes';import{Comments as _0x13b05e,CommentsEditing as _0x4194ba,CommentsRepository as _0x246c24}from'@ckeditor/ckeditor5-comments';import{RevisionHistory as _0x85f044}from'@ckeditor/ckeditor5-revision-history';import{isElement as _0x31a194}from'es-toolkit/compat';var K=class WebSocketGateway extends _0x334b4d{static WebSocketGateway=/* #__PURE__ -- @preserve */
24
+ ((()=>_0x5ef846)());static initialReconnectionInterval=0x3e8;connection;_reconnectionStack;_shouldPluginsReconnect;_domEmitter;static get requires(){return[_0x479238,_0x48617a];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x246676){super(_0x246676),this['set']('state',_0xd5f518['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x373b1e())();}init(){const _0x2c6e69=this['context'],_0x14c398=_0x2c6e69['plugins']['get'](_0x479238),_0x359893=_0x2c6e69['plugins']['get'](_0x48617a);if(!_0x14c398['token'])throw new _0x31a26d('websocketgateway-missing-token',this);if(!_0x14c398['webSocketUrl'])throw new _0x31a26d('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),WebSocketGateway['WebSocketGateway']['connect'](_0x14c398['token'],_0x14c398['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x3d885f=>{if(this['connection']=_0x3d885f,this['bind']('state')['to'](_0x3d885f,'state',this,'_isBrowserOffline',(_0x250504,_0x596b66)=>('connected'!==_0x250504&&(this['_shouldPluginsReconnect']=!0x0),_0x596b66||_0x250504!==_0xd5f518['CONNECTED']?_0xd5f518['DISCONNECTED']:this['state']==_0xd5f518['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0xd5f518['CONNECTING']):_0xd5f518['CONNECTED'])),this['connection']['on']('error',(_0x305b01,_0x448b7f)=>{if('limitExceeded'!==_0x448b7f['code'])throw console['error'](_0x448b7f),new _0x31a26d('cloudservices-init',null,{'originalError':_0x448b7f});_0x359893['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'});}),!_0x3d885f['me'])return new Promise(_0x3bf405=>_0x3d885f['on']('change:me',_0x3bf405));})['catch'](_0x666661=>{throw console['error'](_0x666661),new _0x31a26d('cloudservices-init',null,{'originalError':_0x666661});});}addToReconnectionStack(_0x20f295){if('function'!=typeof _0x20f295['reconnect'])throw new _0x31a26d('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x20f295))throw new _0x31a26d('websocketgateway-plugin-already-registered',this,{'name':_0x20f295['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x20f295);}removeFromReconnectionStack(_0x2cb12a){this['_reconnectionStack']['delete'](_0x2cb12a);}isInReconnectionStack(_0x4756ad){return this['_reconnectionStack']['has'](_0x4756ad);}_reconnect(){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x58b5db=>_0x58b5db['reconnect']())))['then'](()=>this['state']=_0xd5f518['CONNECTED'])['catch'](_0x438ee8=>{throw console['error'](_0x438ee8),new _0x31a26d('cloudservices-reconnection-error',this['context']);});}disconnect(){this['connection']&&this['connection']['disconnect'](),this['state']=_0xd5f518['DISCONNECTED'],this['_domEmitter']['stopListening']();}destroy(){this['disconnect'](),super['destroy']();}},J=class extends _0x334b4d{['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[K,_0x2d7ca7];}constructor(_0x2b0fd2){super(_0x2b0fd2),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x15ab26(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x2d7ca7);}init(){const _0x563c77=this['context']['plugins']['get'](K);this['listenTo'](_0x563c77,'change:state',(_0x4cf83c,_0x1d3ca2,_0x11685f)=>{if('connected'!==_0x11685f)this['channelSessions']['forEach'](_0x215a72=>_0x215a72['clear']()),this['channelConnectedUsers']['forEach'](_0x312b30=>_0x312b30['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x551dc8,_0x412f4b]of this['_registeredSessions'])for(const _0x193db9 of _0x412f4b)this['_handleSessionAdd'](_0x551dc8,_0x193db9);}}),this['_createUser'](_0x563c77['connection']['me'],!0x0);}register(_0x9839c8,_0x3ef546){if(this['_registeredSessions']['has'](_0x9839c8))throw new _0x31a26d('sessions-register-already-registered',null,{'channelId':_0x9839c8});this['_registeredSessions']['set'](_0x9839c8,_0x3ef546),this['channelSessions']['set'](_0x9839c8,new _0x15ab26()),this['channelConnectedUsers']['set'](_0x9839c8,new _0x15ab26()),this['listenTo'](_0x3ef546,'add',(_0xc6c674,_0x4c169f)=>this['_handleSessionAdd'](_0x9839c8,_0x4c169f)),this['listenTo'](_0x3ef546,'remove',(_0x4ee896,_0x4a9916)=>this['_handleSessionRemove'](_0x9839c8,_0x4a9916));for(const _0x1467d9 of _0x3ef546)this['_handleSessionAdd'](_0x9839c8,_0x1467d9);}unregister(_0x3691b7){if(!this['_registeredSessions']['has'](_0x3691b7))throw new _0x31a26d('sessions-unregister-not-exist',null,{'channelId':_0x3691b7});const _0x4a6756=this['_registeredSessions']['get'](_0x3691b7);this['stopListening'](_0x4a6756);for(const _0x505f35 of _0x4a6756)'connected'===this['context']['plugins']['get'](K)['state']&&this['_handleSessionRemove'](_0x3691b7,_0x505f35);this['_registeredSessions']['delete'](_0x3691b7),this['channelSessions']['delete'](_0x3691b7),this['channelConnectedUsers']['delete'](_0x3691b7);}get['mySessionId'](){return this['context']['plugins']['get'](K)['connection']['sessionId'];}getUserBySessionId(_0x3cd200){for(const _0x177a79 of this['channelSessions']['values']())for(const _0x1c712e of _0x177a79)if(_0x1c712e['id']===_0x3cd200)return _0x1c712e['user'];}getUserSessions(_0xa383f7,_0x9c53bd){const _0x58585a=_0x9c53bd?[this['channelSessions']['get'](_0x9c53bd)]:this['channelSessions']['values'](),_0x5b348d=new Set();for(const _0x537038 of _0x58585a)for(const _0xa6942e of _0x537038)_0xa6942e['user']['id']===_0xa383f7['id']&&_0x5b348d['add'](_0xa6942e['id']);return _0x5b348d;}getUserRole(_0x3d62b){for(const _0x5e97bd of this['channelSessions']['values']())for(const _0x3cddae of _0x5e97bd)if(_0x3cddae['user']===_0x3d62b)return _0x3cddae['role'];}['_handleSessionAdd'](_0x2ed657,_0x29dec0){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x1cae43=_0x29dec0['user'],_0x4f8500=this['_users']['getUser'](_0x1cae43['id'])||this['_createUser'](_0x1cae43),_0x487ab9=Object['assign']({},_0x29dec0,{'user':_0x4f8500});if(this['channelSessions']['get'](_0x2ed657)['add'](_0x487ab9),!_0x1cae43['hiddenInPresenceList']){const _0x54bc00=this['channelConnectedUsers']['get'](_0x2ed657);_0x54bc00['has'](_0x4f8500['id'])||_0x54bc00['add'](_0x4f8500),this['allConnectedUsers']['has'](_0x4f8500['id'])||_0x1cae43['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x4f8500,_0x4f8500['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x2ed657,{'channelId':_0x2ed657,'session':_0x487ab9});}['_handleSessionRemove'](_0x1d54de,_0x52f9b3){if('connected'!==this['context']['plugins']['get'](K)['state'])return;const _0x3a9444=this['channelConnectedUsers']['get'](_0x1d54de),_0x1c0cf6=_0x52f9b3['user'];_0x1c0cf6['id']&&(this['channelSessions']['get'](_0x1d54de)['remove'](_0x52f9b3['id']),_0x3a9444['has'](_0x1c0cf6['id'])&&!this['getUserSessions'](_0x1c0cf6,_0x1d54de)['size']&&_0x3a9444['remove'](_0x1c0cf6['id']),this['allConnectedUsers']['get'](_0x1c0cf6['id'])&&!this['getUserSessions'](_0x1c0cf6)['size']&&this['allConnectedUsers']['remove'](_0x1c0cf6['id']));}_createUser(_0x40ecf1,_0x5b7041){const _0x4c6be0=this['_users']['addUser'](_0x40ecf1);return _0x5b7041&&this['_users']['defineMe'](_0x40ecf1['id']),_0x4c6be0['orderNumber']=this['_uniqueUsersCount']++,_0x4c6be0;}},X=class extends _0x347055{_domEmitter=new(_0x373b1e())();static get requires(){return[J];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x2d83ea=this['editor'],_0x3c379a=_0x2d83ea['plugins']['get'](J);_0x2d83ea['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x57cd6f,{writer:_0x2ed3a3})=>function(_0x934de4,_0x55c6d7,_0x401c5d,_0x35fdda){const _0x4726b=_0x934de4['markerName']['split'](':')[0x2],_0x3d730c=_0x401c5d['getUserBySessionId'](_0x4726b);if(!_0x3d730c||_0x4726b===_0x401c5d['mySessionId'])return;if(!_0x35fdda['model']['schema']['checkChild'](_0x934de4['markerRange']['start'],'$text'))return;const _0x5eed20={'class':'ck-user__marker\x20'+_0x3d730c['color']['getMarkerClass'](),'style':tt(_0x3d730c),'data-name':_0x3d730c['name'],'data-session-id':_0x4726b},_0x481c8d=_0x35fdda['model']['markers']['get'](_0x934de4['markerName'])['getStart'](),_0xe2393d=_0x481c8d['nodeAfter'],_0x4534c2=_0x35fdda['model']['schema'];if(_0xe2393d&&_0x4534c2['isObject'](_0xe2393d)&&_0x4534c2['isInline'](_0xe2393d)&&!_0x35fdda['model']['markers']['get']('user:range:'+_0x4726b)['getRange']()['isCollapsed'])return;const _0xf15d3e=_0x481c8d['parent'];return _0x35fdda['model']['schema']['isLimit'](_0xf15d3e)&&!_0x35fdda['model']['hasContent'](_0xf15d3e)&&(_0x5eed20['contenteditable']=!0x1),function(_0x2c6029,_0x225d99,_0x1ca2d7){const _0x925bed=_0x2c6029['createUIElement']('span',_0x225d99);return _0x2c6029['setCustomProperty']('userPositionMarker',!0x0,_0x925bed),_0x925bed['render']=function(_0x63df38){const _0x282337=this['toDomElement'](_0x63df38),_0x54dbee=document['createElement']('span');return _0x54dbee['classList']['add']('ck-user__marker-tooltip'),_0x54dbee['setAttribute']('contenteditable','false'),_0x54dbee['setAttribute']('spellcheck','false'),_0x54dbee['textContent']=_0x1ca2d7['name'],_0x282337['innerHTML']=_0x1bd9bb('⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x54dbee['outerHTML']+'⁠'),_0x282337['addEventListener']('mouseenter',()=>{_0x282337['classList']['add']('ck-user__marker_hovered');}),_0x282337['addEventListener']('mouseleave',()=>{_0x282337['classList']['remove']('ck-user__marker_hovered');}),_0x282337;},_0x925bed['isSimilar']=function(_0x4acd6d){return!(!this['getCustomProperty']('userPositionMarker')||!_0x4acd6d['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x4acd6d['getAttribute']('data-session-id'));},_0x925bed;}(_0x55c6d7,_0x5eed20,_0x3d730c);}(_0x57cd6f,_0x2ed3a3,_0x3c379a,_0x2d83ea)}),_0x2d83ea['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x15aced=>function(_0x39d48c,_0x36d612){const _0x562549=_0x39d48c['markerName']['split'](':')[0x2];if(_0x562549===_0x36d612['mySessionId'])return null;const _0x391274=_0x36d612['getUserBySessionId'](_0x562549);return _0x391274?{'id':_0x562549,'classes':['ck-user__selection',_0x391274['color']['getSelectionClass']()],'attributes':{'style':tt(_0x391274),'data-session-id':_0x562549},'priority':0x7d0+_0x391274['orderNumber']}:{'id':_0x562549,'classes':[]};}(_0x15aced,_0x3c379a)}),function(_0x12457c){const _0x2b82df=_0x12457c['model'],_0x16056f=new Map(),_0x2afa99=_0x12457c['plugins']['get'](J);_0x2b82df['markers']['on']('update:user:range',(_0x3bebae,_0x5a4317,_0xb2714,_0x5c52c0)=>{if(!_0x5c52c0&&_0x16056f['get'](_0x5a4317['name']))return _0x16056f['get'](_0x5a4317['name'])['detach'](),void _0x16056f['delete'](_0x5a4317['name']);const _0x27b3fe=_0x5a4317['name']['split'](':')[0x2];if(_0x27b3fe===_0x2afa99['mySessionId'])return;const _0x545c06='user:position:'+_0x27b3fe;_0x2b82df['markers']['has'](_0x545c06)&&_0x12457c['editing']['reconvertMarker'](_0x545c06),_0x5a4317['on']('change:range',(_0x51cdbd,_0x16b9d2,_0x1e1f16)=>{if('$graveyard'!=_0x16b9d2['root']['rootName']&&'$graveyard'==_0x5a4317['getRange']()['root']['rootName']&&!_0x16056f['has'](_0x5a4317['name'])){const _0x1f7ece=_0x2b82df['schema']['getNearestSelectionRange'](_0x1e1f16['deletionPosition']);if(_0x1f7ece){const _0x20fa31=_0x2ace55['fromRange'](_0x1f7ece);_0x16056f['set'](_0x5a4317['name'],_0x20fa31),_0x20fa31['on']('change:range',(_0x34611e,_0x8bf331,_0x112797)=>{if('$graveyard'==_0x20fa31['root']['rootName']){const _0x20e2e6=_0x2b82df['schema']['getNearestSelectionRange'](_0x112797['deletionPosition']);_0x20e2e6?(_0x20fa31['start']=_0x20e2e6['start'],_0x20fa31['end']=_0x20e2e6['end']):(_0x16056f['delete'](_0x5a4317['name']),_0x20fa31['detach']());}});}}});}),_0x2b82df['document']['on']('change',()=>{_0x16056f['size']>0x0&&_0x2b82df['enqueueChange']({'isUndoable':!0x1},_0x2624d0=>{for(const [_0x25cef1,_0x56f2ce]of _0x16056f)'$graveyard'==_0x2b82df['markers']['get'](_0x25cef1)['getRange']()['root']['rootName']&&(Z(_0x25cef1['split'](':')[0x2],_0x56f2ce['toRange'](),_0x2b82df,_0x2624d0),_0x56f2ce['detach']());_0x16056f['clear']();});});}(_0x2d83ea),this['_domEmitter']['listenTo'](_0x575d0f['document'],'keydown',(_0x2f3c2e,{key:_0x1cde15})=>{'Escape'===_0x1cde15&&function(_0x1e0134){_0x1e0134['editing']['view']['change'](_0x22a361=>{for(const _0xe86184 of _0x1e0134['model']['markers']){if(!_0xe86184['name']['startsWith']('user:position'))continue;const _0x1f49af=_0x1e0134['editing']['mapper']['markerNameToElements'](_0xe86184['name']);if(_0x1f49af){for(const _0x39e640 of _0x1f49af)_0x22a361['removeClass']('ck-user__marker_hovered',_0x39e640);}}});}(_0x2d83ea);},{'useCapture':!0x0});}afterInit(){const _0x23fff4=this['editor'],_0x55036c=_0x23fff4['commands']['get']('undo');_0x55036c&&_0x23fff4['model']['on']('applyOperation',(_0x3932c6,_0x317c7a)=>{const _0x3bc866=_0x317c7a[0x0];if(!_0x3bc866['isDocumentOperation'])return;if('marker'!=_0x3bc866['type']||!_0x3bc866['name']['startsWith']('user:'))return;const _0x25d882=_0x3bc866['batch'];_0x55036c['_createdBatches']['has'](_0x25d882)&&(_0x3bc866['newRange']=_0x3bc866['oldRange']?_0x23fff4['model']['createRange'](_0x3bc866['oldRange']['start'],_0x3bc866['oldRange']['end']):null);},{'priority':'highest'});}destroy(){return this['_domEmitter']['stopListening'](),super['destroy']();}createUserMarkerOperations(){const _0x32c5ba=this['editor'],_0x5d77b8=_0x32c5ba['model']['document'],_0x49fcac=_0x32c5ba['plugins']['get'](J);_0x32c5ba['model']['enqueueChange']({'isUndoable':!0x1},_0x116097=>{const _0x39784c='user:range:'+_0x49fcac['mySessionId'],_0x4f9deb='user:position:'+_0x49fcac['mySessionId'],_0x1c9012=_0x32c5ba['model']['markers']['has'](_0x39784c);_0x32c5ba['editing']['view']['hasDomSelection']?Z(_0x49fcac['mySessionId'],_0x5d77b8['selection']['getFirstRange'](),_0x32c5ba['model'],_0x116097):_0x1c9012&&(_0x116097['removeMarker'](_0x39784c),_0x116097['removeMarker'](_0x4f9deb));});}};function Z(_0x1397cf,_0x578f11,_0x436b13,_0x3eb350){const _0x3d690='user:range:'+_0x1397cf,_0x59eb60='user:position:'+_0x1397cf,_0x52c283=_0x578f11['getContainedElement']();let _0x1157bb=_0x578f11['start'];if(_0x52c283&&_0x52c283['is']('element','tableCell')){const _0x488cfc=function(_0x21586c,_0xccb330){for(const _0x334c3c of _0x21586c['getPositions']())if(_0xccb330['schema']['checkChild'](_0x334c3c,'$text'))return _0x334c3c;}(_0x578f11,_0x436b13);_0x488cfc&&(_0x1157bb=_0x488cfc,_0x578f11=_0x3eb350['createRange'](_0x1157bb));}const _0x37b4f7=_0x3eb350['createRange'](_0x1157bb);_0x436b13['markers']['has'](_0x3d690)?(_0x3eb350['updateMarker'](_0x3d690,{'range':_0x578f11}),_0x3eb350['updateMarker'](_0x59eb60,{'range':_0x37b4f7})):(_0x3eb350['addMarker'](_0x3d690,{'range':_0x578f11,'usingOperation':!0x0}),_0x3eb350['addMarker'](_0x59eb60,{'range':_0x37b4f7,'usingOperation':!0x0}));}function tt(_0x498428){return'--ck-user-color:'+_0x498428['color']['getColorVariable']()+';--ck-user-color-alpha:'+_0x498428['color']['getColorAlphaVariable']()+';';}function et(_0x3fe5ae,_0x458095,_0x3a6934){const _0x1cffa7=_0x3fe5ae['t'],t=_0x3fe5ae['t'];switch(_0x458095){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 _0x1cffa7({'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'},_0x3a6934);default:return'';}}let st=0x1;var it=class RealTimeCollaborationClient extends _0x347055{static CollaborativeEditingService=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x287155)());_offset;['sessionId'];serverHistory;['_channelId'];['_service'];_document;['_compressor'];_bufferedOperations;_knownOperations;_knownRootNames;_pendingAction;_hasSelectionChanged;_sendBufferedOperationsDelayId;['_baseBufferDelay'];_currentBufferDelay;_lastSyncedOperationId;_disconnectionOperations;_operationIdentifier;static get requires(){return[K,J,X,_0x1597fd,_0x2d7ca7,_0x48617a];}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 _0x523858=this['serverHistory']['getOperations']();for(let _0x16cfe7=_0x523858['length']-0x1;_0x16cfe7>=0x0;_0x16cfe7--){const _0x5d06b0=_0x523858[_0x16cfe7];if(!this['_disconnectionOperations']['has'](_0x5d06b0))return _0x5d06b0['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x135a3b){if(super(_0x135a3b),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x1f93fe(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x31a26d('collaboration-missing-channelid',this);const _0x4d9c99=_0x135a3b['config']['get']('cloudServices.bundleVersion')||_0x5205bd;this['_service']=new RealTimeCollaborationClient['CollaborativeEditingService'](_0x4d9c99,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x5e359a(),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 ot(this['_disconnectionOperations']);}init(){const _0x2e7cc3=this['editor'],_0x2cf474=_0x2e7cc3['plugins']['get'](_0x2d7ca7),_0x2ab933=_0x2e7cc3['plugins']['get'](K);this['listenTo'](_0x2cf474,'getOperationAuthor',(_0x6c38f9,_0x527657)=>{const _0x18909d=_0x527657[0x0];_0x18909d['_authorId']&&(_0x6c38f9['return']=_0x2cf474['getUser'](_0x18909d['_authorId']),_0x6c38f9['stop']()),null===_0x18909d['_authorId']&&(_0x6c38f9['return']=null,_0x6c38f9['stop']());},{'priority':'high'}),this['listenTo'](_0x2e7cc3['model']['document']['selection'],'change:range',(_0x2f1779,_0x19693d)=>{_0x19693d['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x2e7cc3['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x2e7cc3['model']['on']('applyOperation',(_0x5286c9,_0x366a4c)=>{const _0x2fe6de=_0x366a4c[0x0];_0x2fe6de['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x2fe6de),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['set']('_isChannelFlushed',!0x1),this['bind']('_isEditingAllowed')['to'](_0x2ab933,'state',this,'_hasSynchronizationProblem',this,'_isChannelFlushed',(_0x1c9bac,_0x58ccca,_0x191790)=>'connected'===_0x1c9bac&&!_0x58ccca&&!_0x191790),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x2e7cc3['disableReadOnlyMode']('rtc-offline'):_0x2e7cc3['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x2e7cc3['disableReadOnlyMode']('rtc-offline'):_0x2e7cc3['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async reconnect(){const _0x57821b=this['editor']['plugins']['get'](J),_0x712df0=this['editor']['plugins']['get'](K);try{this['_isPendingUpdate']=!0x0,_0x57821b['unregister'](this['_channelId']);const _0x3df16b=await this['_service']['reconnect'](_0x712df0['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x3df16b)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0xc573b7=await this['_service']['getConnectedSessions']();_0x57821b['register'](this['_channelId'],_0xc573b7),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x5575ce){if(function(_0x52951d){return'404'===_0x52951d['code'];}(_0x5575ce)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x4a4b96){return'409'===_0x4a4b96['code'];}(_0x5575ce)){const _0xd54f77=et(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'](_0xd54f77);}else{if(!(_0x5575ce instanceof nt))throw _0x5575ce;this['_handleReconnectionError']();}}}}destroy(){const _0x4d5d8a=this['editor']['plugins']['get'](K),_0x130f2d=this['editor']['plugins']['get'](J);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x130f2d['channelSessions']['has'](this['_channelId'])&&_0x130f2d['unregister'](this['_channelId']),_0x4d5d8a['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async _handleReconnectionResponse(_0x4e25e6){if(this['sessionId']!==_0x4e25e6['sessionId']&&this['_lastSyncedOperationId']!==_0x4e25e6['lastOperationId'])throw new nt();return this['sessionId']=_0x4e25e6['sessionId'],this['_handleServerResponse']([],{..._0x4e25e6,'wereChangesApplied':!0x1,'data':_0x4e25e6['data']},'reconnect');}async _connectService(_0xa1ced3,_0x2c0055=!0x1){const {connection:_0x21c40a}=this['editor']['plugins']['get'](K);RealTimeCollaborationClient['CollaborativeEditingService']['getConnectedSessions'](_0x21c40a,this['_channelId'])['then'](_0x400f89=>this['_initSessionsHandling'](_0x400f89))['catch'](_0x1397dd=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1397dd);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x204d33,_0x3a0865)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x3a0865);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_handleChannelDisconnected']();});const _0x10b258=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xa1ced3);this['_isPendingUpdate']=!0x0;const _0x41ae08=await this['_service']['connect'](_0x21c40a,this['_compressOperations'](_0xa1ced3),_0x10b258);if(this['sessionId']=_0x41ae08['sessionId'],_0x2c0055){if(!_0x41ae08['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x41ae08['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0xa1ced3,_0x41ae08,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x41ae08,_0xa1ced3);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}_handleSendingSelectionMarkers(){const _0x30c635=this['editor']['plugins']['get'](J),_0x505bed=this['editor']['plugins']['get'](X),_0x4ac60e=_0x30c635['channelSessions']['get'](this['_channelId']);_0x4ac60e&&_0x4ac60e['length']>0x1?_0x505bed['createUserMarkerOperations']():this['listenTo'](_0x30c635,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x30c635['channelSessions']['get'](this['_channelId'])['length']&&_0x505bed['createUserMarkerOperations']();});}async _handleReceivedOperations(_0x5c9c4f,_0x195745,_0x5e0ae7,_0x44bd87){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x195745){const _0x3a246e=this['_decompressOperations'](_0x5e0ae7,_0x44bd87);await this['_fetchMissingUsers'](_0x3a246e),this['_handleExternalOperations'](_0x3a246e,_0x195745,_0x5e0ae7['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async _connectAfterSessionHasBeenFlushed(){this['_disconnectService']();const {locale:_0x1f6bfd}=this['editor'];let _0x4dc023;try{_0x4dc023=await this['_service']['getDocumentDetails']();}catch{const _0x32a37b=et(_0x1f6bfd,'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'](_0x32a37b);}const _0x9329ae=_0x4dc023['currentDocumentSession']||_0x4dc023['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x9329ae['lastOperationId']){const _0x5bc523=et(_0x1f6bfd,'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'](_0x5bc523);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}_handleChannelDisconnected(){const _0x854c82=this['editor']['plugins']['get'](K);if(this['_isConnected']=!0x1,!_0x854c82['connection']||'connected'!==_0x854c82['connection']['state'])return;this['_isChannelFlushed']=!0x0;const _0x4dbe60=this['editor']['plugins']['get'](J);_0x4dbe60['channelSessions']['has'](this['_channelId'])&&_0x4dbe60['unregister'](this['_channelId']),_0x854c82['removeFromReconnectionStack'](this),this['_disconnectService']();}_disconnectService(){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['stopListening'](this['_service']);}_initSessionsHandling(_0x1a491c){const _0x2c57e6=this['editor']['plugins']['get'](J);this['listenTo'](_0x2c57e6,'sessionAdd:'+this['_channelId'],(_0x19a926,{session:_0xe24766})=>{if(_0xe24766['id']===_0x2c57e6['mySessionId']){_0x19a926['off']();const _0x5871ce=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x188d78=_0xe24766['permissions'];_0x5871ce&&_0x5871ce['isEnabled']&&(_0x188d78=_0x188d78['filter'](_0xabdde3=>'document:write'!==_0xabdde3)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x188d78,this['_channelId']);}}),_0x2c57e6['register'](this['_channelId'],_0x1a491c);}_initThrowingOnDataSet(){const _0x28dfd5=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x3a21e)=>{if(!_0x3a21e[_0x3a21e['length']-0x1]['suppressErrorInCollaboration'])throw new _0x31a26d('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x28dfd5['apply'](this['editor']['data'],_0x3a21e);};}_setUpDataInit(){this['editor']['data']['on']('init',(_0x1c274c,[_0x505fd6])=>{if(this['_document']['version'])throw new _0x31a26d('realtimecollaborationclient-init-document-already-initialized',this);_0x1c274c['stop'](),this['_setPendingAction']();const _0x2265ed=Object['fromEntries'](Object['entries'](this['editor']['config']['get']('roots')||{})['filter'](([,_0xf2351b])=>!_0xf2351b['lazyLoad'])['map'](([_0xfa52d,_0x1e389f])=>[_0xfa52d,_0x1e389f['modelAttributes']||{}])),_0x25c576=this['_getOperationsFromInitData'](_0x505fd6,_0x2265ed);0x0==_0x25c576['length']&&_0x25c576['push'](new _0x17a90c(0x0)),_0x1c274c['return']=this['_connectService'](_0x25c576)['then'](()=>{this['editor']['plugins']['get'](K)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x3ea863=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x3ea863))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x544439,[_0x292eca,_0x119905])=>{_0x544439['stop']();const _0x3c5379=this['editor']['model']['document']['getRoot'](_0x292eca);if(!this['_knownRootNames']['has'](_0x292eca)){const _0x27b047=_0x119905&&_0x119905['data']?_0x119905['data']:'',_0x535925=_0x119905&&_0x119905['attributes']?_0x119905['attributes']:{};await this['_loadRoot'](_0x292eca,_0x27b047,_0x535925);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x3c5379['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x3c5379);});},{'priority':'high'});}async _fetchMissingUsers(_0x5f4413){const _0x3cdedb=this['editor']['plugins']['get'](_0x2d7ca7),{connection:_0x34622b}=this['editor']['plugins']['get'](K),_0x58a667=new Set();for(const _0x2a05ea of _0x5f4413){const _0x4fefa1=_0x2a05ea['_authorId'];_0x4fefa1&&!_0x3cdedb['getUser'](_0x4fefa1)&&_0x58a667['add'](_0x4fefa1);}if(0x0===_0x58a667['size'])return;const _0x2945e0=await _0x38da0f['getMany'](_0x34622b,Array['from'](_0x58a667));for(const _0x185041 of _0x2945e0)_0x3cdedb['getUser'](_0x185041['id'])||_0x3cdedb['addUser'](_0x185041);}_getOperationsFromInitData(_0x4124d8,_0xcfc80a={}){const _0x3dd4b8=this['editor']['model'],_0x13849e=[];let _0x479df9=0x0;const _0x1b666e='string'==typeof _0x4124d8?{'main':_0x4124d8}:_0x4124d8;for(const _0x27dcd9 of Object['keys'](_0x1b666e)){if(!this['_document']['roots']['has'](_0x27dcd9))throw new _0x31a26d('realtimecollaborationclient-init-non-existent-root',this);const _0x511aa2=this['_document']['getRoot'](_0x27dcd9),_0x37ee49=this['editor']['data']['parse'](_0x1b666e[_0x27dcd9],_0x511aa2),_0x187eb0=new _0x286c5c(_0x3dd4b8['createPositionAt'](_0x511aa2,0x0),_0x37ee49,_0x479df9++);_0x13849e['push'](_0x187eb0);for(const [_0x13bdd4,_0x595b71]of _0x37ee49['markers']){const _0x4f0b26=_0x3dd4b8['createRange'](_0x3dd4b8['createPositionFromPath'](_0x511aa2,_0x595b71['start']['path']['slice']()),_0x3dd4b8['createPositionFromPath'](_0x511aa2,_0x595b71['end']['path']['slice']())),_0x11eed8=new _0x2822bc(_0x13bdd4,null,_0x4f0b26,_0x3dd4b8['markers'],!0x0,_0x479df9++);_0x13849e['push'](_0x11eed8);}}if(_0xcfc80a)for(const [_0x20ff0c,_0x3c78dc]of Object['entries'](_0xcfc80a)){const _0xce373d=_0x3dd4b8['document']['getRoot'](_0x20ff0c);if(!_0xce373d)throw new _0x31a26d('multi-root-editor-root-attributes-no-root',null);for(const [_0x2a9130,_0x5f14ea]of Object['entries'](_0x3c78dc))if(null!==_0x5f14ea){const _0x144fef=new _0xd1239(_0xce373d,_0x2a9130,null,_0x5f14ea,_0x479df9++);_0x13849e['push'](_0x144fef);}}return _0x13849e;}async _loadRoot(_0x27c81d,_0x45a6d7,_0x189e85){this['_getOperationsFromInitData']({[_0x27c81d]:_0x45a6d7},{[_0x27c81d]:_0x189e85})['forEach']((_0x350ce6,_0x6d3db8)=>{_0x350ce6['baseVersion']=this['_document']['version']+_0x6d3db8,_0x350ce6['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x350ce6);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async _handleInitialConnectionData(_0x54bad2,_0x17b299){let _0x9cf2be;this['_offset']=_0x54bad2['offset'];const _0x2b63fa=_0x54bad2['wereChangesApplied']&&!_0x54bad2['initData'],_0x3a2253=_0x2b63fa?0x0:_0x54bad2['data']['baseVersion'];if(_0x17b299['forEach'](_0x565954=>{_0x565954['_isInit']=!0x0,_0x565954['createdAt']=_0x54bad2['sessionCreatedAt'],_0x565954['_authorId']=null;}),_0x2b63fa)_0x9cf2be=_0x17b299,this['_applyOperationsSet'](_0x9cf2be,_0x2b63fa);else{if(_0x54bad2['initData']){const _0x44cee6=this['_getOperationsFromInitData'](_0x54bad2['initData']);this['_document']['history']['version']=-_0x44cee6['length'],_0x44cee6['forEach'](_0x3b4506=>{_0x3b4506['baseVersion']-=_0x44cee6['length'],_0x3b4506['createdAt']=_0x54bad2['sessionCreatedAt'],_0x3b4506['_isInit']=!0x0,_0x3b4506['_authorId']=null;}),this['_applyOperationsSet'](_0x44cee6,!0x0),this['serverHistory']['version']=-_0x44cee6['length']+this['_offset'],this['_updateServerHistory'](_0x44cee6);}this['_document']['history']['version']=_0x3a2253,_0x9cf2be=this['_decompressOperations'](_0x54bad2['data'],_0x54bad2['metadata']),await this['_fetchMissingUsers'](_0x9cf2be),this['_applyOperationsSet'](_0x9cf2be,_0x2b63fa);}_0x54bad2['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x9cf2be,_0x54bad2['lastOperationId']),this['_lastSyncedOperationId']=_0x54bad2['lastOperationId']),this['serverHistory']['version']=_0x3a2253+this['_offset'],this['_updateServerHistory'](_0x9cf2be),_0x17b299['filter'](_0x43c5c6=>{const _0x24ad08=this['_getAffectedRoot'](_0x43c5c6);return _0x24ad08&&!this['_knownRootNames']['has'](_0x24ad08);})['forEach']((_0xe32aef,_0x517805)=>{_0xe32aef['baseVersion']=this['_document']['version']+_0x517805,this['_saveOperationInBuffer'](_0xe32aef);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x44c4f1,_0x1924cb){const _0x121ef3=_0x1924cb&&_0x1924cb['message'];if(_0x121ef3&&_0x121ef3['startsWith']('realtimecollaborationclient'))throw _0x1924cb;const _0xbf4fe8=this['editor']['plugins']['get'](K);throw this['_isPendingUpdate']=!0x0,_0xbf4fe8['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x31a26d(_0x44c4f1,this['editor'],_0x121ef3?{'originalError':_0x121ef3}:void 0x0);}_saveOperationInBuffer(_0x543014){this['_knownOperations']['has'](_0x543014)||(this['_knownOperations']['add'](_0x543014),this['_bufferedOperations']['push'](_0x543014),this['_pendingAction']||'marker'==_0x543014['type']&&!_0x543014['affectsData']||this['_setPendingAction']());}_sendBufferedOperationsDelayed(_0x782a73=!0x1){!_0x782a73&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x51cd58=>{_0x51cd58&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x13f459=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xefb65f){return _0xefb65f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xefb65f['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xefb65f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x13f459)||this['_crash'](_0x13f459['message'],_0x13f459);});},this['_currentBufferDelay']));}_waitUntilSynced(){return new Promise(_0x54ca07=>{this['on']('change:_isPendingUpdate',()=>{_0x54ca07();});});}async _sendBufferedOperations(){const _0x2d0aa3=this['editor']['plugins']['get'](X);if(this['_shouldSendSelectionUpdate']()&&(_0x2d0aa3['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3bc716=[...this['_bufferedOperations']];for(const _0x2f589d of _0x3bc716)_0x2f589d['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2f589d);const _0x4270d3=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3bc716),_0x916d9=st++,_0xefad28=this['_compressOperations'](_0x3bc716),_0x262b54=await this['_service']['sendOperations'](_0xefad28,_0xefad28['baseVersion'],_0x4270d3);try{return await this['_handleServerResponse'](_0x3bc716,_0x262b54,_0x916d9);}catch(_0x17c528){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x17c528);}}async['_handleServerResponse'](_0x30ec1b,_0x1e1ce6,_0x5abce2){if('error'in _0x1e1ce6)throw _0x1e1ce6['error'];let _0x7f3a5;if(_0x1e1ce6['wereChangesApplied']){_0x1e1ce6['lastOperationId']&&(this['_lastSyncedOperationId']=_0x1e1ce6['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x4cbc07=>!_0x30ec1b['includes'](_0x4cbc07));for(const _0x49d89e of _0x30ec1b)_0x49d89e['createdAt']='lastOperationAcceptedAt'in _0x1e1ce6&&_0x1e1ce6['lastOperationAcceptedAt']||void 0x0;rt(_0x30ec1b,_0x1e1ce6['version']-_0x30ec1b['length']),this['_updateServerHistory'](_0x30ec1b);const _0xe5a934=_0x30ec1b['filter'](_0xf5fcb3=>{if(!_0xf5fcb3['_isInit'])return!0x1;const _0x49c087=this['_getAffectedRoot'](_0xf5fcb3);return _0x49c087&&!this['_knownRootNames']['has'](_0x49c087);});rt(_0xe5a934,this['_document']['version']),this['_applyOperationsSet'](_0xe5a934),_0x7f3a5=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x3cc23e=this['_decompressOperations'](_0x1e1ce6['data'],_0x1e1ce6['metadata'])['filter'](_0x9ccfac=>_0x9ccfac['baseVersion']>=this['_lastServerVersion']);_0x3cc23e['forEach'](_0x1deb79=>this['_addKnownRoot'](_0x1deb79)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x274e51=>!_0x274e51['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x274e51))),this['_bufferedOperations']['length']&&rt(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x3cc23e),_0x7f3a5=this['_handleExternalOperations'](_0x3cc23e,_0x1e1ce6['version'],_0x1e1ce6['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x7f3a5?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}_handleExternalOperations(_0x18999a,_0x3784a7,_0x5774e0){try{const _0x25916f={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2cd5d6,operationsB:_0x36dc19,originalOperations:_0x209adf}=_0xa939b6(_0x18999a,this['_bufferedOperations'],_0x25916f);rt(_0x2cd5d6,this['_document']['version']),rt(_0x36dc19,_0x3784a7);for(const _0x4f9a81 of _0x2cd5d6){const _0x2c178e=_0x209adf['get'](_0x4f9a81);_0x2c178e?(_0x4f9a81['_authorId']=_0x2c178e['_authorId'],'noop'!==_0x4f9a81['type']&&(_0x4f9a81['_aiSource']=_0x2c178e['_aiSource'])):_0x4f9a81['_authorId']=null;}for(const _0x19cd7d of _0x36dc19)'noop'!==_0x19cd7d['type']&&(_0x19cd7d['_aiSource']=_0x209adf['get'](_0x19cd7d)?.['_aiSource']);_0x5774e0&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x18999a,_0x5774e0),this['_lastSyncedOperationId']=_0x5774e0),this['_bufferedOperations']=[..._0x36dc19],this['_applyOperationsSet'](_0x2cd5d6),this['_updateServerHistory'](_0x18999a);}catch(_0x5bd3b0){return console['error'](_0x5bd3b0),!0x1;}return!0x0;}_applyOperationsSet(_0x57a162,_0x46058f=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x3d3937=>{for(const _0x1ffe21 of _0x57a162)this['_knownOperations']['add'](_0x1ffe21),this['_addKnownRoot'](_0x1ffe21),_0x3d3937['batch']['addOperation'](_0x1ffe21),this['editor']['model']['applyOperation'](_0x1ffe21);});}_addKnownRoot(_0x1fa43f){const _0x2de6c8=this['_getAffectedRoot'](_0x1fa43f);_0x2de6c8&&this['_knownRootNames']['add'](_0x2de6c8);}_getAffectedRoot(_0xe1f1ed){let _0x18643a,_0x44ef14;switch(_0xe1f1ed['type']){case'insert':_0x18643a=_0xe1f1ed['position']['root'];break;case'marker':if(_0x44ef14=_0xe1f1ed['newRange'],!_0x44ef14)return null;_0x18643a=_0x44ef14['root'];break;case'addRootAttribute':_0x18643a=_0xe1f1ed['root'];break;case'addRoot':_0x18643a=_0xe1f1ed['affectedSelectable'];break;case'move':_0x18643a=_0xe1f1ed['targetPosition']['root'];break;default:return null;}return _0x18643a['rootName'];}_updateServerHistory(_0x45218b){_0x45218b['forEach'](_0x12e1fa=>{const _0x3ff6fb=_0x12e1fa['clone']();_0x3ff6fb['_authorId']=_0x12e1fa['_authorId'],_0x3ff6fb['_isInit']=!!_0x12e1fa['_isInit'],_0x3ff6fb['_aiSource']=_0x12e1fa['_aiSource'],_0x3ff6fb['createdAt']=_0x12e1fa['createdAt'],_0x3ff6fb['baseVersion']+=this['_offset'],_0x12e1fa['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3ff6fb),this['serverHistory']['addOperation'](_0x3ff6fb);});}_handleReconnectionError(_0x166826){const _0x419ad5=this['editor']['plugins']['get']('Notification'),_0x46f91=this['editor']['locale'];_0x166826||(_0x166826=et(_0x46f91,'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.')),_0x419ad5['showWarning'](_0x166826,{'title':et(_0x46f91,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](K)['disconnect']();}_setPendingAction(){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x1597fd)['add'](et(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}_clearPendingAction(){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x1597fd)['remove'](this['_pendingAction']),this['_pendingAction']=null);}_compressOperations(_0x962355){const _0x4dacd9=_0x962355['map'](_0x29e4d0=>_0x29e4d0['toJSON']());return this['_compressor']['compress'](_0x4dacd9);}_decompressOperations(_0x45efae,_0x34a45f){return this['_compressor']['decompress'](_0x45efae)['map']((_0x569804,_0x50278b)=>{const _0x3f0cee='init'==_0x34a45f[_0x50278b]['type'];if('InsertOperation'==_0x569804['__className']){const _0x2b69a4=_0x569804['position']['root'];!this['_document']['getRoot'](_0x2b69a4)&&(this['_document']['createRoot']('$unknown',_0x2b69a4)['_isAttached']=!0x1);}else{if('RootOperation'==_0x569804['__className']){const _0x135a17=this['_document']['getRoot'](_0x569804['rootName']);_0x135a17&&'$unknown'==_0x135a17['name']&&_0x569804['elementName']!=_0x135a17['name']&&(_0x135a17['name']=_0x569804['elementName']);}}const _0x29f054=_0x2d2939['fromJSON'](_0x569804,this['_document']);return _0x29f054['wasUndone']=_0x569804['wasUndone'],_0x29f054['_isInit']=_0x3f0cee,_0x29f054['_authorId']=_0x3f0cee?null:_0x34a45f[_0x50278b]['userId'],_0x29f054['_isDisconnection']='cs:removeUser'===_0x34a45f[_0x50278b]['type'],_0x29f054['_aiSource']=_0x569804['_aiSource']||void 0x0,_0x29f054['createdAt']=_0x34a45f[_0x50278b]['createdAt'],_0x29f054;});}_refreshUserSelectionMarkers(){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}_shouldSendSelectionUpdate(){const _0x55dee5=this['editor']['plugins']['get'](J)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x55dee5&&_0x55dee5['length']>0x1&&this['_hasSelectionChanged'];}_shouldSendUpdate(){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}},nt=class extends Error{};function rt(_0x47e4a2,_0x234f2c){for(const _0x1234f9 of _0x47e4a2)_0x1234f9['baseVersion']=_0x234f2c++;}var ot=class{_ignoredOperations;_operationToId;constructor(_0x573a1a){this['_ignoredOperations']=_0x573a1a,this['_operationToId']=new WeakMap();}getIdOfTheLastOperation(_0x26988d){let _0x2f890b=_0x26988d['length'];for(;_0x2f890b--;){const _0x1dc6c7=_0x26988d[_0x2f890b];if(!this['_ignoredOperations']['has'](_0x1dc6c7)){if(!this['_operationToId']['has'](_0x1dc6c7)){const _0x38b588=_0x305c1a()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1dc6c7,_0x38b588);}return this['_operationToId']['get'](_0x1dc6c7);}}}setIdForTheLastOperation(_0x134366,_0x3799f4){if(!_0x3799f4)return;let _0xd495=_0x134366['length'];for(;_0xd495--;){const _0x182c59=_0x134366[_0xd495];this['_ignoredOperations']['has'](_0x182c59)||this['_operationToId']['set'](_0x182c59,_0x3799f4);}}},ct=class extends _0x347055{static get requires(){return[it];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},at=class extends _0x347055{['_sources']=new Map();_data=null;_hasStarted=!0x1;static get requires(){return[K,J,_0x2d7ca7];}static get['pluginName'](){return'RealTimeContentFetcher';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}_register(_0x9e36aa,_0x567926){if(this['_hasStarted'])throw new _0x31a26d('realtimecontentfetcher-register-after-init',null,{'name':_0x9e36aa});if(this['_sources']['has'](_0x9e36aa))throw new _0x31a26d('realtimecontentfetcher-register-duplicate',null,{'name':_0x9e36aa});this['_sources']['set'](_0x9e36aa,_0x567926);}_takeInitialData(_0x2efc2b){if(!this['_data'])throw new _0x31a26d('realtimecontentfetcher-data-not-ready',null,{'name':_0x2efc2b});if(!this['_data']['has'](_0x2efc2b))throw new _0x31a26d('realtimecontentfetcher-data-not-available',null,{'name':_0x2efc2b});const _0x285b31=this['_data']['get'](_0x2efc2b);return this['_data']['delete'](_0x2efc2b),_0x285b31;}async init(){this['_hasStarted']=!0x0;const _0x8b2407=Array['from'](this['_sources']),_0x27519e=await Promise['all'](_0x8b2407['map'](([,_0x310f3f])=>_0x310f3f['fetch']()));await this['_fetchMissingUsers'](_0x8b2407['map'](([,_0x1954f6],_0x2c49f5)=>_0x1954f6['getUserIds'](_0x27519e[_0x2c49f5]))),this['_data']=new Map(_0x8b2407['map'](([_0x51b925],_0x27644a)=>[_0x51b925,_0x27519e[_0x27644a]]));}async _fetchMissingUsers(_0x2361be){const _0x199d2e=this['editor']['plugins']['get'](_0x2d7ca7),_0x1467b0=new Set();for(const _0x5cf61d of _0x2361be)for(const _0x404345 of _0x5cf61d)_0x199d2e['getUser'](_0x404345)||_0x1467b0['add'](_0x404345);if(0x0===_0x1467b0['size'])return;const {connection:_0x35428c}=this['editor']['plugins']['get'](K),_0x323f5c=await _0x38da0f['getMany'](_0x35428c,Array['from'](_0x1467b0));for(const _0x37e585 of _0x323f5c)_0x199d2e['getUser'](_0x37e585['id'])||_0x199d2e['addUser'](_0x37e585);}};function ht(_0x3d6de1){const _0x1e09e3=new Set();for(const {resolvedBy:_0x50ba69,comments:_0x2626ba}of _0x3d6de1){_0x50ba69&&_0x1e09e3['add'](_0x50ba69);for(const {userId:_0x12f1b8}of _0x2626ba)_0x1e09e3['add'](_0x12f1b8);}return _0x1e09e3;}var lt=class CloudServicesCommentsAdapter extends _0x334b4d{static CommentsService=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x3a107a)());['_services'];_pendingServiceEvents=new Map();_channelsAwaitingInitialData=new Set();static get requires(){return[K,_0x246c24,J,_0x2d7ca7];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x14993c){super(_0x14993c),this['_services']=new Map();}async init(){const _0x36e669=this['context'],_0x22a69d=_0x36e669['plugins']['get'](_0x246c24);if(_0x36e669['plugins']['get'](K)['addToReconnectionStack'](this),_0x22a69d['adapter']={'addCommentThread':async({channelId:_0x43d6d8,threadId:_0x46adcd,comments:_0x419a80,resolvedAt:_0x17e4bb,resolvedBy:_0x45acf6,context:_0x14c2fb,attributes:_0x112fb3})=>{const _0x5c7047=await this['_getService'](_0x43d6d8)['addCommentThread']({'commentThreadId':_0x46adcd,'comments':_0x419a80['map'](_0x511bc0=>function(_0x251683,_0x277f5c,_0xb79362){return{'commentThreadId':_0xb79362,'commentId':_0x251683['commentId'],'userId':_0x251683['authorId'],'content':_0x251683['content'],'documentId':_0x277f5c,'createdAt':_0x251683['createdAt'],'attributes':_0x251683['attributes']||{}};}(_0x511bc0,_0x43d6d8,_0x46adcd)),'resolvedAt':_0x17e4bb,'resolvedBy':_0x45acf6,'context':_0x14c2fb,'attributes':_0x112fb3})['catch'](ut);return{'threadId':_0x5c7047['commentThreadId'],'comments':_0x5c7047['comments']};},'getCommentThread':async({channelId:_0x4c6239,threadId:_0x3c7730})=>{const _0x40628a=await this['_getService'](_0x4c6239)['getCommentThread'](_0x3c7730)['catch'](dt)['catch'](ut);return _0x40628a?_0x40628a['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x40628a]),{'threadId':_0x40628a['commentThreadId'],'comments':_0x40628a['comments']['map'](ft),'context':_0x40628a['context'],'resolvedAt':_0x40628a['resolvedAt'],'resolvedBy':_0x40628a['resolvedBy'],'attributes':_0x40628a['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x5f3496,threadId:_0x5ed2a5,context:_0x37a994,unlinkedAt:_0x518d04,attributes:_0x3d85a0})=>this['_getService'](_0x5f3496)['updateCommentThread']({'commentThreadId':_0x5ed2a5,'context':_0x37a994,'attributes':_0x3d85a0,'unlinkedAt':_0x518d04})['catch'](dt)['catch'](ut),'resolveCommentThread':async({channelId:_0x5224ea,threadId:_0x56aa0f})=>{const _0x342ec5=await this['_getService'](_0x5224ea)['resolveCommentThread'](_0x56aa0f)['catch'](dt)['catch'](ut);return{'threadId':_0x342ec5['commentThreadId'],'resolvedAt':_0x342ec5['resolvedAt'],'resolvedBy':_0x342ec5['resolvedBy']};},'reopenCommentThread':async({channelId:_0x17b38d,threadId:_0x39e482})=>this['_getService'](_0x17b38d)['reopenCommentThread'](_0x39e482)['catch'](dt)['catch'](ut),'removeCommentThread':({channelId:_0x298f90,threadId:_0x23f5d2})=>this['_getService'](_0x298f90)['removeCommentThread'](_0x23f5d2)['catch'](dt)['catch'](ut),'addComment':({channelId:_0x241ea2,threadId:_0x173c38,commentId:_0x4d136f,content:_0x4c46ed,attributes:_0x176bff})=>this['_getService'](_0x241ea2)['addComment'](_0x173c38,_0x4d136f,_0x4c46ed,_0x176bff)['catch'](ut),'updateComment':({channelId:_0x343bd0,threadId:_0x2e96df,commentId:_0x51e0e1,content:_0x276e9e,attributes:_0x198e21})=>this['_getService'](_0x343bd0)['updateComment'](_0x2e96df,_0x51e0e1,_0x276e9e,_0x198e21)['catch'](dt)['catch'](ut),'removeComment':({channelId:_0x31a5d6,threadId:_0x415f9e,commentId:_0x32d08a})=>this['_getService'](_0x31a5d6)['removeComment'](_0x415f9e,_0x32d08a)['catch'](dt)['catch'](ut)},_0x36e669 instanceof _0x173008){const _0x200ceb=_0x36e669['config']['get']('collaboration.channelId'),_0x283739=_0x36e669['plugins']['get'](J);await this['_setUpService'](_0x200ceb);const _0x517073=await this['_services']['get'](_0x200ceb)['getConnectedSessions']();this['listenTo'](_0x283739,'sessionAdd:'+_0x200ceb,(_0x397121,{session:_0x44c73e})=>{_0x44c73e['id']===_0x283739['mySessionId']&&(_0x397121['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x44c73e['permissions'],_0x200ceb));}),_0x283739['register'](_0x200ceb,_0x517073);}}async _setUpService(_0x53ce0a){this['_createService'](_0x53ce0a),await this['_connectService'](_0x53ce0a);}_createService(_0x336be4){if(this['_services']['has'](_0x336be4))throw new _0x31a26d('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x336be4});const _0x56694e=this['context']['plugins']['get'](_0x246c24),_0x131201=new CloudServicesCommentsAdapter['CommentsService'](_0x336be4);this['_services']['set'](_0x336be4,_0x131201),this['listenTo'](_0x131201,'commentThreadAdded',(_0x558d18,_0x1241c8)=>{const {commentThreadId:_0xbdbdaa,documentId:_0x34c13b,context:_0x30208c,attributes:_0x26582e,resolvedAt:_0xd78c53,resolvedBy:_0x285ddb,comments:_0x32413d}=_0x1241c8,_0x33d7db=_0x32413d?_0x32413d['map'](({userId:_0x553343})=>_0x553343):[];_0x285ddb&&_0x33d7db['push'](_0x285ddb),this['_handleOrQueueServiceEvent'](_0x336be4,_0x33d7db,()=>{_0x56694e['getCommentThread'](_0xbdbdaa)||_0x56694e['addCommentThread']({'threadId':_0xbdbdaa,'channelId':_0x34c13b,'comments':_0x32413d?_0x32413d['map'](ft):[],'context':_0x30208c,'attributes':_0x26582e,'resolvedAt':_0xd78c53,'resolvedBy':_0x285ddb,'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'commentThreadUpdated',(_0x460a58,{commentThreadId:_0x15542d,documentId:_0x5ceab8,context:_0x3d55f1,unlinkedAt:_0x49ddfe,attributes:_0x12f95d})=>{this['_handleOrQueueServiceEvent'](_0x336be4,[],()=>{_0x56694e['getCommentThread'](_0x15542d)&&_0x56694e['updateCommentThread']({'threadId':_0x15542d,'channelId':_0x5ceab8,'context':_0x3d55f1,'unlinkedAt':_0x49ddfe,'attributes':_0x12f95d,'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'commentThreadResolved',(_0x175d80,{commentThreadId:_0x118c58,resolvedBy:_0x298bde,resolvedAt:_0xd31150})=>{this['_handleOrQueueServiceEvent'](_0x336be4,[_0x298bde],()=>{const _0x5228d2=_0x56694e['getCommentThread'](_0x118c58);_0x5228d2&&!_0x5228d2['isResolved']&&_0x5228d2['resolve']({'resolvedBy':_0x298bde,'resolvedAt':_0xd31150,'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'commentThreadReopened',(_0x5cce99,{commentThreadId:_0x5ba436})=>{this['_handleOrQueueServiceEvent'](_0x336be4,[],()=>{const _0x55a80b=_0x56694e['getCommentThread'](_0x5ba436);_0x55a80b&&_0x55a80b['isResolved']&&_0x55a80b['reopen']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'commentThreadRemoved',(_0x38f4fe,{commentThreadId:_0x25c028})=>{this['_handleOrQueueServiceEvent'](_0x336be4,[],()=>{const _0x58a4e9=_0x56694e['getCommentThread'](_0x25c028);_0x58a4e9&&_0x58a4e9['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'commentAdded',(_0x5bd6b2,_0x49f3e1)=>{this['_handleOrQueueServiceEvent'](_0x336be4,[_0x49f3e1['userId']],()=>{const _0x469a23=_0x56694e['getCommentThread'](_0x49f3e1['commentThreadId']);_0x469a23&&!_0x469a23['getComment'](_0x49f3e1['commentId'])&&_0x469a23['addComment']({...ft(_0x49f3e1),'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'commentUpdated',(_0x5ec418,{commentThreadId:_0x3964da,commentId:_0x5c5bc2,content:_0x5303e1,attributes:_0x212425})=>{this['_handleOrQueueServiceEvent'](_0x336be4,[],()=>{const _0x254ed1=_0x56694e['getCommentThread'](_0x3964da)?.['getComment'](_0x5c5bc2);_0x254ed1&&_0x254ed1['update']({'content':_0x5303e1,'attributes':_0x212425,'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'commentRemoved',(_0x1b9f64,{commentThreadId:_0x49fad4,commentId:_0x4e7466})=>{this['_handleOrQueueServiceEvent'](_0x336be4,[],()=>{const _0x1e76a9=_0x56694e['getCommentThread'](_0x49fad4)?.['getComment'](_0x4e7466);_0x1e76a9&&_0x1e76a9['remove']({'isFromAdapter':!0x0});});}),this['listenTo'](_0x131201,'disconnected',()=>{'connected'===this['context']['plugins']['get'](K)['connection']?.['state']&&(this['_services']['delete'](_0x336be4),this['_pendingServiceEvents']['delete'](_0x336be4),this['stopListening'](_0x131201));});}destroy(){if(this['context']instanceof _0x173008){const _0x176d66=this['context']['config']['get']('collaboration.channelId');this['_services']['has'](_0x176d66)&&this['_terminateService'](_0x176d66);}}_terminateService(_0x354fbc){if(!this['_services']['has'](_0x354fbc))throw new _0x31a26d('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x354fbc});this['_getService'](_0x354fbc)['disconnect'](),this['_services']['delete'](_0x354fbc);}async reconnect(){for(const _0x49d77d of this['_services']['keys']())await this['_connectService'](_0x49d77d);if(this['context']instanceof _0x173008){const _0x3287b4=this['context']['config']['get']('collaboration.channelId');if(this['_services']['has'](_0x3287b4)){const _0x394caa=this['context']['plugins']['get'](J);_0x394caa['unregister'](_0x3287b4);const _0x45ccab=await this['_services']['get'](_0x3287b4)['getConnectedSessions']();_0x394caa['register'](_0x3287b4,_0x45ccab);}}}_fetchInitialChannelData(_0x22dbc4){return this['_channelsAwaitingInitialData']['add'](_0x22dbc4),this['_fetchChannelData'](_0x22dbc4);}async _applyInitialChannelData(_0x37fcd9,_0x59f67d){this['_channelsAwaitingInitialData']['delete'](_0x37fcd9)&&await this['_applyChannelData'](_0x37fcd9,_0x59f67d);}async _fetchChannelData(_0x40ce27){const {connection:_0x537470}=this['context']['plugins']['get'](K);return this['_pendingServiceEvents']['set'](_0x40ce27,[]),await this['_services']['get'](_0x40ce27)['connect'](_0x537470);}async _applyChannelData(_0x9a6477,_0x509792){const _0xe309c5=this['context']['plugins']['get'](_0x246c24),_0x5700ba=new Set(Array['from'](_0xe309c5['getCommentThreads']({'channelId':_0x9a6477}),_0x10606f=>_0x10606f['id']));for(const _0x4efebf of _0x509792)_0x4efebf['deletedAt']||_0x5700ba['delete'](_0x4efebf['commentThreadId']);for(const _0x2a1147 of _0x5700ba)_0xe309c5['getCommentThread'](_0x2a1147)['remove']({'isFromAdapter':!0x0});for(const _0x157fcd of _0x509792){let _0x1ce473=_0xe309c5['getCommentThread'](_0x157fcd['commentThreadId']);const {commentThreadId:_0x53aadd,context:_0x4e6e68,attributes:_0x3f1d05,resolvedBy:_0x1ffcc3,resolvedAt:_0x238b5d,unlinkedAt:_0x1226f4,deletedAt:_0x452e19}=_0x157fcd;if(_0x452e19)continue;_0x1ce473||(_0x1ce473=_0xe309c5['addCommentThread']({'channelId':_0x9a6477,'threadId':_0x53aadd,'context':_0x4e6e68,'attributes':_0x3f1d05||{},'resolvedBy':_0x1ffcc3,'resolvedAt':_0x238b5d,'unlinkedAt':_0x1226f4,'isFromAdapter':!0x0}));const _0x2e6a4b=new Set(Array['from'](_0x1ce473['comments'],_0x76d80b=>_0x76d80b['id']));for(const _0x3981de of _0x157fcd['comments'])_0x2e6a4b['delete'](_0x3981de['commentId']);for(const _0x922c5c of _0x2e6a4b)_0x1ce473['getComment'](_0x922c5c)['remove']({'isFromAdapter':!0x0});for(const _0x4b3bd4 of _0x157fcd['comments']){const _0x1f9b9c=_0x1ce473['getComment'](_0x4b3bd4['commentId']);_0x1f9b9c?_0x1f9b9c['content']!==_0x4b3bd4['content']&&_0x1f9b9c['update']({'content':_0x4b3bd4['content'],'isFromAdapter':!0x0}):_0x1ce473['addComment'](Object['assign'](ft(_0x4b3bd4),{'isFromAdapter':!0x0}));}}await this['_applyPendingServiceEvents'](_0x9a6477);}_handleOrQueueServiceEvent(_0x416d0a,_0xa0808a,_0x3e93f0){const _0x8cf84f=this['_pendingServiceEvents']['get'](_0x416d0a);_0x8cf84f?_0x8cf84f['push']({'userIds':_0xa0808a,'apply':_0x3e93f0}):_0x3e93f0();}async _applyPendingServiceEvents(_0x2be9e7){const _0x55dfb3=this['_pendingServiceEvents']['get'](_0x2be9e7)||[];for(;_0x55dfb3['length'];){const _0x16c27e=_0x55dfb3['splice'](0x0);await this['_fetchMissingUsers'](_0x16c27e['flatMap'](({userIds:_0x3eed19})=>_0x3eed19));for(const {apply:_0x6492e4}of _0x16c27e)_0x6492e4();}this['_discardPendingServiceEvents'](_0x2be9e7,_0x55dfb3);}_discardPendingServiceEvents(_0x208fa5,_0x5c97c7){this['_pendingServiceEvents']['get'](_0x208fa5)===_0x5c97c7&&this['_pendingServiceEvents']['delete'](_0x208fa5);}async _connectService(_0xd68ca4){const _0x497258=this['_channelsAwaitingInitialData']['delete'](_0xd68ca4),_0x43de9a=this['_fetchChannelData'](_0xd68ca4),_0x290814=this['_pendingServiceEvents']['get'](_0xd68ca4);let _0x41b5f0=!0x1;try{const _0x3087e9=await _0x43de9a;_0x41b5f0=!0x0,await this['_fetchMissingUsersForThreads'](_0x3087e9),await this['_applyChannelData'](_0xd68ca4,_0x3087e9);}catch(_0x479730){throw this['_discardPendingServiceEvents'](_0xd68ca4,_0x290814),_0x497258&&!_0x41b5f0&&this['_channelsAwaitingInitialData']['add'](_0xd68ca4),_0x479730;}}_getService(_0x1a299a){if(!this['_services']['has'](_0x1a299a))throw new _0x31a26d('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x1a299a});return this['_services']['get'](_0x1a299a);}async _fetchMissingUsersForThreads(_0xccd255){return this['_fetchMissingUsers'](ht(_0xccd255));}async _fetchMissingUsers(_0x7189f6){const _0x10db1f=this['context']['plugins']['get'](_0x2d7ca7),{connection:_0x2eee89}=this['context']['plugins']['get'](K),_0x4d0428=Array['from'](new Set(_0x7189f6))['filter'](_0x32411e=>!_0x10db1f['getUser'](_0x32411e));if(0x0===_0x4d0428['length'])return;const _0x3338c1=await _0x38da0f['getMany'](_0x2eee89,_0x4d0428);for(const _0x77022b of _0x3338c1)_0x10db1f['getUser'](_0x77022b['id'])||_0x10db1f['addUser'](_0x77022b);}};async function dt(_0x5b2c48){if('404'!==_0x5b2c48['code'])throw _0x5b2c48;}function ut(_0x1a9f20){if((_0x58356f=_0x1a9f20)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x58356f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x58356f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x58356f;throw _0x1a9f20;}function ft(_0x4cffcc){return{'threadId':_0x4cffcc['commentThreadId'],'commentId':_0x4cffcc['commentId'],'content':_0x4cffcc['content'],'createdAt':_0x4cffcc['createdAt'],'authorId':_0x4cffcc['userId'],'attributes':_0x4cffcc['attributes']||{}};}var mt=class CloudServicesTrackChangesAdapter extends _0x347055{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x4b74e0)());_bufferedRequests;_trackChangesService;['_isChannelFlushed']=!0x1;_pendingSuggestionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[lt,_0x190799,K,at];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x11e781){super(_0x11e781);const _0xaa049c=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new CloudServicesTrackChangesAdapter['TrackChangesService'](_0xaa049c),_0x11e781['plugins']['get'](at)['_register']('trackChanges',{'fetch':()=>this['_fetchInitialSuggestions'](),'getUserIds':_0x358787=>_0x358787['map'](({authorId:_0x1890d5})=>_0x1890d5)});}init(){const _0x47d93f=this['editor']['plugins']['get'](_0x190799);_0x47d93f['adapter']={'getSuggestion':async _0x13af3c=>{await this['_waitForServiceReady']();const _0x7342bf=await this['_trackChangesService']['get'](_0x13af3c)['catch'](pt);return await this['_fetchMissingUsersForThreads']([_0x7342bf]),_0x7342bf;},'addSuggestion':async({id:_0x4dd2e4,type:_0x40201f,data:_0x1c0641,originalSuggestionId:_0x19d9f5,attributes:_0x5dfa72})=>{await this['_waitForServiceReady']();const _0x252aae={'id':_0x4dd2e4,'type':_0x40201f,'data':_0x1c0641,'originalSuggestionId':_0x19d9f5,'attributes':_0x5dfa72},_0x278e1b=await this['_trackChangesService']['add'](_0x4dd2e4,_0x40201f,_0x1c0641,_0x19d9f5,_0x5dfa72)['catch'](_0x47d06f=>{if(gt(_0x47d06f))return new Promise(_0x19c224=>{this['_bufferedRequests']['set'](_0x4dd2e4,{'resolve':_0x19c224,'suggestionData':_0x252aae});});throw _0x47d06f;});return this['_bufferedRequests']['delete'](_0x4dd2e4),_0x278e1b;},'updateSuggestion':async(_0x2eb36b,_0x52ea92)=>{if(await this['_waitForServiceReady'](),'open'!==_0x52ea92['state'])return this['_trackChangesService']['update'](_0x2eb36b,_0x52ea92)['catch'](pt);}};const _0x168fe3=this['editor']['plugins']['get'](at)['_takeInitialData']('trackChanges');for(const _0x544267 of _0x168fe3){_0x47d93f['addSuggestionData'](_0x544267)['_saved']=!0x0;}for(const {id:_0x3f25fc,attributes:_0x4fafe0}of this['_pendingSuggestionsUpdates'])this['_handleSuggestionUpdate'](_0x3f25fc,_0x4fafe0);this['_pendingSuggestionsUpdates']=null,this['_setReadyForReconnect']();}async _fetchInitialSuggestions(){const _0x17a5ed=this['editor']['plugins']['get'](K);this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x459c80,{id:_0x1dc29b,attributes:_0x335d9c})=>{this['_pendingSuggestionsUpdates']?this['_pendingSuggestionsUpdates']['push']({'id':_0x1dc29b,'attributes':_0x335d9c}):this['_handleSuggestionUpdate'](_0x1dc29b,_0x335d9c);}),this['listenTo'](this['_trackChangesService'],'disconnected',()=>{'connected'===_0x17a5ed['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x17a5ed['removeFromReconnectionStack'](this),this['stopListening'](this['_trackChangesService']));});const _0x373835=await this['_trackChangesService']['connect'](_0x17a5ed['connection']);return this['_isChannelFlushed']||_0x17a5ed['addToReconnectionStack'](this),_0x373835;}_handleSuggestionUpdate(_0x3af876,_0x1dfb23){const _0x3fe083=this['editor']['plugins']['get'](_0x190799);_0x3fe083['hasSuggestion'](_0x3af876)&&(_0x3fe083['getSuggestion'](_0x3af876)['attributes']=_0x1dfb23);}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x43259b=>console['error'](_0x43259b)));}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x7a5533=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x17f70f}=this['editor']['plugins']['get'](K),_0x3dbbe6=await this['_trackChangesService']['connect'](_0x17f70f);await this['_fetchMissingUsersForThreads'](_0x3dbbe6);for(const {suggestionData:_0x4024c7,resolve:_0x1ffce5}of this['_bufferedRequests']['values']()){let _0x594db4=_0x3dbbe6['find'](_0x3418a5=>_0x3418a5['id']===_0x4024c7['id']);_0x594db4||(_0x594db4=await this['_trackChangesService']['add'](_0x4024c7['id'],_0x4024c7['type'],_0x4024c7['data'],_0x4024c7['originalSuggestionId'])),_0x1ffce5(_0x594db4);}for(const _0x4d9bef of _0x3dbbe6)_0x7a5533['hasSuggestion'](_0x4d9bef['id'])||_0x7a5533['addSuggestionData'](_0x4d9bef);}async _waitForServiceReady(){this['_trackChangesService']['isConnected']||await new Promise(_0x68f456=>{this['listenTo'](this['_trackChangesService'],'connected',_0x4672e8=>{_0x4672e8['off'](),_0x68f456();});});}async _fetchMissingUsersForThreads(_0x24858b){const _0x37c4c1=this['editor']['plugins']['get'](_0x2d7ca7),{connection:_0x19c274}=this['editor']['plugins']['get'](K),_0x1b9f02=new Set();for(const {authorId:_0x627a4d}of _0x24858b)_0x37c4c1['getUser'](_0x627a4d)||_0x1b9f02['add'](_0x627a4d);if(0x0===_0x1b9f02['size'])return;const _0x54c1b1=await _0x38da0f['getMany'](_0x19c274,Array['from'](_0x1b9f02));for(const _0x326c69 of _0x54c1b1)_0x37c4c1['getUser'](_0x326c69['id'])||_0x37c4c1['addUser'](_0x326c69);}};function pt(_0x2cc2a4){if(gt(_0x2cc2a4))return new Promise(()=>{});throw _0x2cc2a4;}function gt(_0x39559b){return _0x39559b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x39559b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var wt=class extends _0x347055{static get requires(){return[_0x13b05e,lt,ct,K,at];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ee142){super(_0x3ee142);const _0x33cb19=_0x3ee142['plugins']['get'](lt),_0x51e4e6=_0x3ee142['config']['get']('collaboration.channelId');_0x3ee142['plugins']['get'](at)['_register']('comments',{'fetch':()=>(_0x33cb19['_createService'](_0x51e4e6),_0x33cb19['_fetchInitialChannelData'](_0x51e4e6)),'getUserIds':ht});}init(){const _0x28682f=this['editor']['plugins']['get'](K),_0x11a0be=this['editor']['plugins']['get'](_0x4194ba),_0x1dbb50=this['editor']['plugins']['get'](lt);this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x28682f,'change:state',(_0x3a216b,_0x78bf1e,_0xee31a4)=>{_0x11a0be['isThreadsLoadingPaused']='connected'!==_0xee31a4;});}),this['listenTo'](_0x28682f,'change:state',(_0x29a32b,_0x5af476,_0x476f3e)=>{this['editor']['plugins']['get'](_0x246c24)['switchReadOnly']('connected'!==_0x476f3e);});const _0x2c93f3=this['editor']['config']['get']('collaboration.channelId'),_0x400bb6=this['editor']['plugins']['get'](at)['_takeInitialData']('comments');return _0x1dbb50['_applyInitialChannelData'](_0x2c93f3,_0x400bb6);}destroy(){const _0x5e2445=this['editor']['plugins']['get'](lt),_0x39882e=this['editor']['config']['get']('collaboration.channelId');_0x5e2445['_services']['has'](_0x39882e)&&_0x5e2445['_terminateService'](_0x39882e),super['destroy']();}},vt=class extends _0x347055{static get requires(){return[wt,mt,_0x5d5d91];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},_t=class CloudServicesRevisionHistoryAdapter extends _0x347055{static RevisionHistoryService=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x1e9a0f)());_lastRequestId;['_revisionTracker'];_revisionHistoryService;_oldOffset;['_isChannelFlushed']=!0x1;_newestRevisionPrefetch=null;_pendingRevisionsUpdates=[];_isReadyForReconnect=!0x1;_isReconnectPending=!0x1;static get requires(){return[K,it,_0x85f044,J,_0x2d7ca7,at];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x32f1e0){super(_0x32f1e0);const _0x29409a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new CloudServicesRevisionHistoryAdapter['RevisionHistoryService'](_0x29409a),this['set']('_isServiceConnected',!0x1),_0x32f1e0['plugins']['get'](at)['_register']('revisionHistory',{'fetch':()=>this['_fetchInitialData'](),'getUserIds':({revisions:_0x3b8404})=>_0x3b8404['flatMap'](({authorsIds:_0x114149,creatorId:_0x4fc9c1})=>_0x4fc9c1?[..._0x114149,_0x4fc9c1]:_0x114149)});}async init(){const _0x406248=this['editor']['plugins']['get'](it),{hasEditorBundle:_0xab49af,revisions:_0x461c0a}=this['editor']['plugins']['get'](at)['_takeInitialData']('revisionHistory');this['listenTo'](this['editor']['data'],'ready',()=>{this['_setReadyForReconnect'](),this['_newestRevisionPrefetch']=null;}),this['editor']['plugins']['get'](_0x85f044)['adapter']={'getRevision':async({revisionId:_0x2ef8ea})=>{const _0x3030d7=this['_newestRevisionPrefetch'];return _0x3030d7&&_0x3030d7['revisionId']===_0x2ef8ea?(this['_newestRevisionPrefetch']=null,_0x3030d7['promise']):(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x2ef8ea));},'updateRevisions':async _0x113143=>{await this['_waitForServiceReady']();const _0x426bb6=this['_revisionTracker']['currentRevision'];if(_0xab49af&&0x1===_0x113143['length']&&_0x113143[0x0]['id']===_0x426bb6['id'])return _0x113143;for(const _0x5bcfc0 of _0x113143)_0x5bcfc0['id']===_0x426bb6['id']&&(_0x5bcfc0['isEmptyCurrent']=_0x5bcfc0['fromVersion']===_0x5bcfc0['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x113143,this['_lastRequestId'])['then'](_0x4ddddd=>(this['_lastRequestId']=_0x4ddddd,_0x113143))['catch'](_0x584c5c=>{if(yt(_0x584c5c)||'400'===_0x584c5c['code']&&void 0x0!==_0x584c5c['data']['wrongRequestId']){for(const _0x5d1362 of _0x113143)this['_revisionTracker']['repository']['getRevision'](_0x5d1362['id'])&&this['_revisionTracker']['_bufferUpdate'](_0x5d1362['id'],_0x5d1362,!0x1);if(yt(_0x584c5c)&&'destroyed'!==this['editor']['state'])throw _0x584c5c;return _0x113143;}throw _0x584c5c;});}};for(const _0x289448 of _0x461c0a)this['_revisionTracker']['addRevisionData'](_0x289448);this['listenTo'](_0x406248,'change:_isConnected',(_0x5ed680,_0x2c39d3,_0x32ebf3)=>{_0x32ebf3&&(this['_oldOffset']=_0x406248['_offset'],_0x5ed680['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](this,'_isServiceConnected'),await this['_applyPendingRevisionsUpdates']();}async _fetchInitialData(){const _0x31b6c3=this['editor']['plugins']['get'](it),_0x5d75ed=this['editor']['plugins']['get'](K),_0x330551=_0x31b6c3['serverHistory'];this['_revisionTracker']['setSource']({'history':_0x330551,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x31b6c3['sessionId']}),this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1950ee,{revisionsData:_0x4f7cb9,requestId:_0x13f0cc})=>{_0x4f7cb9['some'](({id:_0x34ff83})=>_0x34ff83===this['_newestRevisionPrefetch']?.['revisionId'])&&(this['_newestRevisionPrefetch']=null),Math['max'](..._0x4f7cb9['map'](_0x179857=>_0x179857['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleOrQueueRevisionsUpdate'](_0x4f7cb9,_0x13f0cc);}):this['_handleOrQueueRevisionsUpdate'](_0x4f7cb9,_0x13f0cc);}),this['listenTo'](this['_revisionHistoryService'],'connected',()=>{this['_isServiceConnected']=!0x0;}),this['listenTo'](this['_revisionHistoryService'],'disconnected',()=>{this['_isServiceConnected']=!0x1,'connected'===_0x5d75ed['connection']?.['state']&&(this['_isChannelFlushed']=!0x0,_0x5d75ed['removeFromReconnectionStack'](this),this['stopListening'](this['_revisionHistoryService']));});const _0x324892=this['editor']['config']['get']('cloudServices.bundleVersion')||_0x5205bd,[_0x95e6bc,_0x54b171]=await Promise['all']([_0x2ae61f['isBundleUploaded'](_0x5d75ed['connection'],_0x324892),this['_revisionHistoryService']['connect'](_0x5d75ed['connection'])['then'](_0x11dd92=>(this['_lastRequestId']=_0x11dd92['requestId'],this['_isChannelFlushed']||_0x5d75ed['addToReconnectionStack'](this),this['_prefetchNewestRevision'](_0x11dd92['revisions']),_0x11dd92['revisions']))]);return{'hasEditorBundle':_0x95e6bc,'revisions':_0x54b171};}_handleOrQueueRevisionsUpdate(_0x2b7a2d,_0x1f8484){this['_pendingRevisionsUpdates']?this['_pendingRevisionsUpdates']['push']({'revisionsData':_0x2b7a2d,'requestId':_0x1f8484}):this['_handleRevisionsUpdate'](_0x2b7a2d,_0x1f8484);}async _applyPendingRevisionsUpdates(){for(;this['_pendingRevisionsUpdates']['length'];){const _0x161327=this['_pendingRevisionsUpdates']['splice'](0x0);await this['_fetchMissingUsers'](_0x161327['flatMap'](({revisionsData:_0x434afb})=>_0x434afb));for(const {revisionsData:_0x4c30cc,requestId:_0x2b5d4d}of _0x161327)this['_handleRevisionsUpdate'](_0x4c30cc,_0x2b5d4d);}this['_pendingRevisionsUpdates']=null;}_prefetchNewestRevision(_0x4c6e26){const _0x174a55=_0x4c6e26['reduce']((_0x5e394a,_0x22dade)=>_0x5e394a?(_0x22dade['toVersion']-_0x5e394a['toVersion']||_0x22dade['fromVersion']-_0x5e394a['fromVersion'])>0x0?_0x22dade:_0x5e394a:_0x22dade,null);if(!_0x174a55||_0x174a55['diffData'])return;const _0xb493a5=this['_revisionHistoryService']['getRevision'](_0x174a55['id']);_0xb493a5['catch'](()=>{}),this['_newestRevisionPrefetch']={'revisionId':_0x174a55['id'],'promise':_0xb493a5};}async reconnect(){if(!this['_isReadyForReconnect'])return void(this['_isReconnectPending']=!0x0);const _0x395355=this['editor']['plugins']['get'](K),_0x23085c=this['editor']['plugins']['get'](it),_0x1539c5=async()=>{const _0x46855d=this['_revisionTracker']['currentRevision'],_0x3f08ac=_0x46855d['id'],_0x496285=_0x3f08ac!==_0x23085c['sessionId'];if(_0x496285){const _0x1a7c4e=_0x23085c['_offset']-this['_oldOffset'],_0x449e96=this['_getLatestVersionFromServerOperations']();if(this['_revisionTracker']['_revisionDataBuilder']['reInit'](),_0x46855d['toVersion']+_0x1a7c4e!==_0x449e96){const _0x327604=_0x46855d['fromVersion']+_0x1a7c4e,_0x54f582=this['editor']['plugins']['get'](_0x2d7ca7),_0x2ba2e4=this['_revisionTracker']['buildRevisionData']({'revision':_0x46855d,'from':_0x327604,'to':_0x449e96});_0x2ba2e4['id']=_0x46855d['id'];const _0x2de133=_0x2ba2e4['authorsIds']['map'](_0x3596a2=>_0x54f582['getUser'](_0x3596a2));_0x46855d['_update']({..._0x2ba2e4,'authors':_0x2de133},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x46855d['id'],_0x2ba2e4,!0x0);}this['_revisionTracker']['_startingVersion']=_0x449e96,_0x46855d['toVersion']!==_0x46855d['fromVersion']||this['_revisionTracker']['_bufferedUpdates']['has'](_0x3f08ac)||this['_revisionTracker']['repository']['_revisions']['remove'](_0x3f08ac),this['_revisionTracker']['_createCurrentRevision'](_0x449e96);}const {revisions:_0x3eb5cd,requestId:_0x5b0202}=await this['_revisionHistoryService']['reconnect'](_0x395355['connection'],this['_lastRequestId']);_0x496285&&_0x3eb5cd['length']>0x0?_0x23085c['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3eb5cd),this['_handleRevisionsUpdate'](_0x3eb5cd,_0x5b0202),this['_revisionTracker']['sendBufferedUpdates']());};return _0x23085c['_isConnected']?_0x1539c5():new Promise((_0x5df2c1,_0xb868ec)=>{_0x23085c['once']('change:_isConnected',()=>{_0x1539c5()['then'](_0x5df2c1)['catch'](_0xb868ec);});});}destroy(){this['editor']['plugins']['get'](K)['removeFromReconnectionStack'](this),super['destroy']();}_setReadyForReconnect(){this['_isReadyForReconnect']=!0x0,this['_isReconnectPending']&&(this['_isReconnectPending']=!0x1,this['reconnect']()['catch'](_0x5f1d51=>console['error'](_0x5f1d51)));}async _waitForServiceReady(){this['_revisionHistoryService']['isConnected']||await new Promise(_0x13452f=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x8b90a0=>{_0x8b90a0['off'](),_0x13452f();});});}_getLatestVersionFromServerOperations(){const _0x38a086=this['editor']['plugins']['get'](it)['serverHistory']['getOperations']()['reverse']();for(const _0x3fdb04 of _0x38a086)if('marker'!==_0x3fdb04['type']||_0x3fdb04['affectsData'])return _0x3fdb04['baseVersion']+0x1;}_getLatestVersion(){const _0x36e554=this['editor']['plugins']['get'](it);return new Promise(_0x1887b8=>{_0x36e554['_isPendingUpdate']?_0x36e554['once']('change:_isPendingUpdate',()=>{_0x1887b8(this['_getLatestVersionFromServerOperations']());}):_0x1887b8(this['_getLatestVersionFromServerOperations']());});}_handleRevisionsUpdate(_0x39c2fe,_0x35c9ec){const _0x4c8d05=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x35c9ec;for(const _0x339e30 of _0x39c2fe){const _0x3a5085=_0x4c8d05['getRevision'](_0x339e30['id']);if(_0x3a5085){if((_0x339e30['fromVersion']||_0x339e30['toVersion'])&&(_0x339e30['diffData']=null),_0x3a5085===this['_revisionTracker']['currentRevision']){const _0x33bc2c=Math['max'](_0x3a5085['toVersion'],_0x339e30['toVersion']),_0x251955=Math['max'](_0x3a5085['fromVersion'],_0x339e30['fromVersion']);let _0x999945;_0x3a5085['toVersion']===_0x339e30['toVersion']&&_0x3a5085['fromVersion']===_0x339e30['fromVersion']?(_0x999945=!0x0,this['_preventResendingRevisionData'](_0x339e30)):_0x339e30['toVersion']===_0x33bc2c&&_0x339e30['fromVersion']===_0x251955?_0x999945=!0x1:(_0x3a5085['toVersion']===_0x33bc2c&&_0x3a5085['fromVersion']===_0x251955||this['_fixRevision']({'revision':_0x3a5085,'from':_0x251955,'to':_0x33bc2c}),_0x999945=!0x0),_0x999945&&(delete _0x339e30['fromVersion'],delete _0x339e30['toVersion'],delete _0x339e30['diffData'],delete _0x339e30['createdAt'],delete _0x339e30['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x339e30),this['_preventResendingRevisionData'](_0x339e30);}else this['_revisionTracker']['addRevisionData'](_0x339e30);}const _0x1c9699=_0x4c8d05['getRevisions']();_0x1c9699['reverse']();for(let _0x5a256a=0x0;_0x5a256a<_0x1c9699['length']-0x1;_0x5a256a++){const _0x9cd04=_0x1c9699[_0x5a256a],_0x329aef=_0x1c9699[_0x5a256a+0x1];if(_0x9cd04['fromVersion']<_0x329aef['toVersion']){const _0x52aabb=_0x329aef['toVersion'],_0x1c1726=Math['max'](_0x52aabb,_0x9cd04['toVersion']);this['_fixRevision']({'revision':_0x9cd04,'from':_0x52aabb,'to':_0x1c1726});}}}['_fixRevision']({revision:_0x2a431a,from:_0x11ef67,to:_0x325c36}={}){const _0x3424ee=this['editor']['plugins']['get'](_0x2d7ca7),_0x1f3c05=this['_revisionTracker']['buildRevisionData']({'revision':_0x2a431a,'from':_0x11ef67,'to':_0x325c36});_0x1f3c05['authors']=_0x1f3c05['authorsIds']['map'](_0x346759=>_0x3424ee['getUser'](_0x346759)),_0x2a431a['_update'](_0x1f3c05);}_preventResendingRevisionData(_0x189b41){const _0x26e9b5={};_0x26e9b5['id']=_0x189b41['id'];for(const _0x1a0c36 of Object['keys'](_0x189b41))'id'!==_0x1a0c36&&(_0x26e9b5[_0x1a0c36]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x26e9b5['id'],_0x26e9b5,!0x0);}async _fetchMissingUsers(_0x3ab319){const _0x5bd38e=this['editor']['plugins']['get'](_0x2d7ca7),{connection:_0xbc21f5}=this['editor']['plugins']['get'](K),_0xbedefe=new Set();for(const _0x396111 of _0x3ab319){for(const _0x10a490 of _0x396111['authorsIds']||[])_0xe41667(_0x10a490);_0x396111['creatorId']&&_0xe41667(_0x396111['creatorId']);}if(0x0===_0xbedefe['size'])return;const _0x275731=await _0x38da0f['getMany'](_0xbc21f5,Array['from'](_0xbedefe));for(const _0x311a6f of _0x275731)_0x5bd38e['getUser'](_0x311a6f['id'])||_0x5bd38e['addUser'](_0x311a6f);function _0xe41667(_0x4b39f5){_0x5bd38e['getUser'](_0x4b39f5)||_0xbedefe['add'](_0x4b39f5);}}};function yt(_0x14a1b0){return _0x14a1b0['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x14a1b0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x14a1b0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}var bt=class extends _0x347055{static get requires(){return[_0x85f044,_t,ct];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}},kt=class extends _0x125328{_collapseAt;constructor(_0x51c8f4,_0x595559=0x6){super(_0x51c8f4);const _0x376c2e=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x595559,this['bind']('isHidden')['to'](this,'usersCount',_0x175a22=>_0x175a22<_0x595559),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x376c2e['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':_0x376c2e['to']('usersCount',_0x34e915=>'+'+(_0x34e915-this['_collapseAt']+0x2)['toString']())}]}]}]});}},It=class extends _0x125328{items;keystrokes;constructor(_0x5f41f7){super(_0x5f41f7);const _0x32cde6=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x13848e(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x32cde6['if']('hasPopup'),'aria-expanded':_0x32cde6['to']('isExpanded',_0x4aad44=>this['hasPopup']&&String(_0x4aad44)),'aria-label':_0x32cde6['to']('hasPopup',_0x317998=>et(_0x5f41f7,_0x317998?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x32cde6['to']('hasPopup',_0x2602e=>!!_0x2602e&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items']}),this['on']('change:hasPopup',(_0xe07113,_0x3eba67,_0x228424)=>{this['element']&&(_0x228424?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']);}},St=class extends _0x125328{counterView;inlineListView;constructor(_0x506ae1,_0x5ab2d6=0x6){super(_0x506ae1);const _0x3ee8c1=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new kt(this['locale'],_0x5ab2d6),this['inlineListView']=new It(_0x506ae1),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x36197d of this['inlineListView']['items'])_0x36197d['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',_0x3ee8c1['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}},Ct=class extends _0x125328{listWrapperView;constructor(_0x4abb11,_0x426e79){super(_0x4abb11),this['listWrapperView']=new Tt(_0x4abb11,_0x426e79),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':et(_0x4abb11,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}},Tt=class extends _0x3eb0aa{constructor(_0x4c0d44,_0x479deb){super(_0x4c0d44);const _0x3bfda0=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x479deb?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x3bfda0['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x3bfda0['to']('role'),'aria-label':_0x3bfda0['to']('ariaLabel'),'aria-labelledby':_0x3bfda0['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x575d0f['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x37ecd7=this['element'];_0x37ecd7&&(this['_isScrollable']=Math['max'](_0x37ecd7['scrollHeight'],_0x37ecd7['clientHeight'])>0.8*window['innerHeight']);}},At=class extends _0x37736a{['userView'];constructor(_0x2f115f,_0x4bdfba,_0x533844){super(_0x2f115f);const _0x320028=this['bindTemplate'];this['userView']=new _0x765632(_0x2f115f,_0x4bdfba);const _0x5ddce3={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x4bdfba['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x4bdfba['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4bdfba['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x4bdfba['color']['getColorVariable'](),'--ck-user-color-alpha':_0x4bdfba['color']['getColorAlphaVariable']()},'aria-hidden':'true'}}]};_0x533844&&(_0x5ddce3['tag']='button',_0x5ddce3['on']={'click':_0x320028['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5ddce3);}['focus'](){this['element']['focus']();}},Pt=class extends _0x125328{['userView'];['markerView'];constructor(_0x2910d9,_0x3b914b,_0x1470d5){super(_0x2910d9);const _0x4b1f32=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new _0x765632(_0x2910d9,_0x3b914b),this['markerView']=new Rt(_0x2910d9,_0x3b914b);const _0x539927=new _0x2545d3(_0x2910d9);_0x539927['template']['tag']='span',_0x539927['text']=_0x3b914b['name'];const _0x260bc6={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x4b1f32['to']('isFocusable',_0x55c4a3=>_0x55c4a3?0x0:-0x1),'aria-labelledby':_0x539927['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x4b1f32['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x4b1f32['to']('hasTooltip',_0x58aeec=>!_0x58aeec),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x539927]};_0x1470d5&&(_0x260bc6['tag']='button',_0x260bc6['on']={'click':_0x4b1f32['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x260bc6);}},Rt=class extends _0x125328{constructor(_0x1cb22c,_0x5972c3){super(_0x1cb22c),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x5972c3['color']['getBackgroundColorClass']()],'style':{'--ck-user-color':_0x5972c3['color']['getColorVariable'](),'--ck-user-color-alpha':_0x5972c3['color']['getColorAlphaVariable']()},'aria-hidden':'true'}});}};const Ot={'collapseAt':0x6,'displayMe':!0x0};var xt=class extends _0x334b4d{currentDisplayedUsers;['balloonPanelView'];['view'];['presenceDropdownView'];_overlayHost=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4b3d78){super(_0x4b3d78),this['context']['config']['define']('presenceList',Ot);const _0x3bfee8=_0x4b3d78['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x3bfee8)throw new _0x31a26d('presencelist-collapseat-invalid-format',this);if(_0x3bfee8<0x1)throw new _0x31a26d('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](J)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x15ab26(),this['balloonPanelView']=new _0x250a77(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get requires(){return[J];}init(){for(const _0x193669 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x193669);this['listenTo'](this['_allConnectedUsers'],'add',(_0x32ac50,_0x1ce6b7)=>{this['_handleUserAdd'](_0x1ce6b7);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x400731,_0x2cded4)=>{this['_handleUserRemove'](_0x2cded4);});}_createView(){const _0x46972e=this['context'],_0x60be5f=new St(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x5ee4a4=this['balloonPanelView'];if(!_0x31a194(_0x46972e['config']['get']('presenceList.container')))throw new _0x31a26d('presencelist-missing-container',this);_0x60be5f['counterView']['bind']('usersCount')['to'](this),_0x60be5f['bind']('isCollapsed')['to'](this,'usersCount',_0x3812ee=>{const {collapseAt:_0x46ecdd}=_0x46972e['config']['get']('presenceList'),_0x1b5adf=_0x3812ee>=_0x46ecdd;if(_0x1b5adf&&!_0x60be5f['inlineListView']['items']['find'](_0x3f0f2f=>_0x3f0f2f instanceof kt)){const _0x3419fc=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x3419fc&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x60be5f['inlineListView']['items']['add'](_0x60be5f['counterView']);}return _0x1b5adf||this['hideDropdown'](),_0x1b5adf;}),_0x60be5f['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xeac4de=>{const _0x3fd502=_0x46972e['config']['get']('presenceList'),_0x551236=new Pt(_0x46972e['locale'],_0xeac4de,!!_0x3fd502['onClick']);return _0x551236['bind']('hasTooltip')['to'](_0x60be5f,'isCollapsed',_0x69f902=>!_0x69f902),_0x551236['bind']('isFocusable')['to'](_0x60be5f,'isCollapsed',_0x39dbb5=>!_0x39dbb5),_0x3fd502['onClick']&&this['listenTo'](_0x551236,'execute',()=>{this['view']['isCollapsed']||_0x3fd502['onClick'](_0xeac4de,_0x551236['element']);}),_0x551236;}),_0x60be5f['inlineListView']['keystrokes']['set']('Enter',(_0x5d8932,_0x5bd822)=>{this['view']['isCollapsed']&&(this['showDropdown'](),this['presenceDropdownView']?.['listWrapperView']['focus'](),_0x5bd822());}),_0x60be5f['render'](),_0x5ee4a4['render'](),_0x60be5f['listenTo'](_0x60be5f['inlineListView']['element'],'mouseenter',()=>{this['view']['isCollapsed']&&this['showDropdown']();});const _0x2d30ee=(_0x1119c8,_0x9c97e3)=>{this['_hideDropdownUnlessPointerInside'](_0x9c97e3);};return _0x60be5f['listenTo'](_0x60be5f['inlineListView']['element'],'mouseleave',_0x2d30ee),_0x60be5f['listenTo'](_0x5ee4a4['element'],'mouseleave',_0x2d30ee),_0x2ba919({'emitter':_0x60be5f,'activator':()=>_0x5ee4a4['isVisible'],'contextElements':[_0x5ee4a4['element'],_0x60be5f['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x46972e['config']['get']('presenceList.container')['appendChild'](_0x60be5f['element']),this['_overlayHost']=new _0x325e75(this['context']['locale'],{'resolveMountTarget':()=>this['_resolveOverlayTarget'](),'resolveInlineContainer':()=>this['context']['config']['get']('presenceList.container')}),this['_overlayHost']['sync'](),this['_overlayHost']['bodyCollection']['add'](this['balloonPanelView']),_0x60be5f;}_resolveOverlayTarget(){const _0x4b0fd1=this['context']['config']['get']('presenceList.overlayContainer')||this['context']['config']['get']('ui.overlayContainer');if(_0x4b0fd1)return _0x4b0fd1;const _0x365525=this['context']['config']['get']('presenceList.container');return _0x365525?_0x43009b(_0x365525):null;}['_handleUserAdd'](_0x41c8a5){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x41c8a5['isMe'])return;const _0x169200=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x169200-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x3b6d62=_0x41c8a5['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x41c8a5,_0x3b6d62);}['_handleUserRemove'](_0x98ebec){this['usersCount']--;const {collapseAt:_0x204746}=this['context']['config']['get']('presenceList'),_0x18ec40=this['usersCount']>=_0x204746;if(this['currentDisplayedUsers']['get'](_0x98ebec['id']))this['currentDisplayedUsers']['remove'](_0x98ebec['id']);else{if(_0x18ec40&&this['currentDisplayedUsers']['length']+0x1===_0x204746-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x18ec40?0x1:0x0)<this['usersCount']){for(const _0x13f1f of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x13f1f['id'])&&(this['currentDisplayedUsers']['add'](_0x13f1f,Math['min'](this['currentDisplayedUsers']['length']-(_0x18ec40?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x18ec40?0x1:0x0)===_0x204746-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1d4fac=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new Ct(this['context']['locale'],!!_0x1d4fac['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x40e62e}=this['presenceDropdownView'];_0x40e62e['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4d53a9=>{if(!_0x1d4fac['displayMe']&&_0x4d53a9['isMe'])return null;const _0xb21f02=new At(this['context']['locale'],_0x4d53a9,!!_0x1d4fac['onClick']);return _0x1d4fac['onClick']&&this['listenTo'](_0xb21f02,'execute',()=>{_0x1d4fac['onClick'](_0x4d53a9,_0xb21f02['element']);}),_0xb21f02;}),this['_overlayHost']?.['sync'](),this['balloonPanelView']['content']['add'](this['presenceDropdownView']);const _0xa39d63=_0x250a77['generatePositions']({'heightOffset':0x3,'config':{'withArrow':!0x1}});this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element'],'positions':[_0xa39d63['southArrowNorth'],_0xa39d63['southArrowNorthMiddleWest'],_0xa39d63['southArrowNorthMiddleEast'],_0xa39d63['southArrowNorthWest'],_0xa39d63['southArrowNorthEast'],_0xa39d63['northArrowSouth'],_0xa39d63['northArrowSouthMiddleWest'],_0xa39d63['northArrowSouthMiddleEast'],_0xa39d63['northArrowSouthWest'],_0xa39d63['northArrowSouthEast'],_0xa39d63['viewportStickyNorth']]}),_0x40e62e['focus'](),_0x40e62e['checkIfScrollable']();const _0x2f44e0=(_0x39d574,_0x410f35)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x410f35();};_0x40e62e['keystrokes']['set']('Esc',_0x2f44e0),_0x40e62e['keystrokes']['set']('Shift+Tab',_0x2f44e0),_0x40e62e['keystrokes']['set']('Tab',()=>{this['view']['inlineListView']['focus'](),this['hideDropdown']();}),_0x40e62e['focusTracker']['add'](this['view']['element']),_0x40e62e['focusTracker']['on']('change:isFocused',(_0x1fe700,_0x161684,_0x40c6de)=>{_0x40c6de||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);}_hideDropdownUnlessPointerInside(_0x20ff0f){this['presenceDropdownView']&&([this['view']['inlineListView']['element'],this['balloonPanelView']['element']]['some'](_0x27b0d6=>_0x4f9984(_0x27b0d6,_0x20ff0f))||this['hideDropdown']());}destroy(){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_overlayHost']&&(this['_overlayHost']['destroy'](),this['_overlayHost']=null);}},Nt=class extends _0x334b4d{static get requires(){return[J,xt];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{lt as CloudServicesCommentsAdapter,_t as CloudServicesRevisionHistoryAdapter,mt as CloudServicesTrackChangesAdapter,Nt as PresenceList,xt as PresenceListUI,it as RealTimeCollaborationClient,wt as RealTimeCollaborativeComments,ct as RealTimeCollaborativeEditing,bt as RealTimeCollaborativeRevisionHistory,vt as RealTimeCollaborativeTrackChanges,at as RealTimeContentFetcher,J as Sessions,K as WebSocketGateway};