@ckeditor/ckeditor5-real-time-collaboration 47.7.2 → 47.7.3-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 (170) hide show
  1. package/build/real-time-collaboration.js +2 -2
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +15 -15
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x4067ea,Plugin as _0x1e5d58,PendingActions as _0x5a7c8a,Context as _0x2e2ce6}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x9de3d6,CKEditorError as _0x3a9443,Collection as _0x36276b,global as _0x19a405,version as nt,uid as _0x36f6e1,KeystrokeHandler as _0x745df6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x529457,View as _0x4bb216,ListView as _0x3e031c,ListItemView as st,LabelView as at,BalloonPanelView as _0x2a3eb9,clickOutsideHandler as _0x56d96c,BodyCollection as _0x20e53c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x1d7bba,History as _0x5e4bad,NoOperation as _0x2546a3,InsertOperation as _0x543630,MarkerOperation as _0x49f499,RootAttributeOperation as _0x15a55f,transformOperationSets as _0x5cbfc9,OperationFactory as _0x1c848c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ct,WEB_SOCKET_GATEWAY_STATES as _0x3d1e25,CollaborativeEditingService as _0x4e90ee,User as ht,CommentsService as _0x5409e7,TrackChangesService as it,RevisionHistoryService as _0x5df08f,EditorService as _0xd9b4ec}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x52815c,UserView as rt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x20e1aa}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x15409c}from'es-toolkit/compat';class n extends _0x4067ea{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ct)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x529457];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x542bf0){super(_0x542bf0),this['set']('state',_0x3d1e25['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x9de3d6())();}['init'](){const _0x1c1466=this['context'],_0x267924=_0x1c1466['plugins']['get']('CloudServices'),_0x515dc8=_0x1c1466['plugins']['get'](_0x529457);if(!_0x267924['token'])throw new _0x3a9443('websocketgateway-missing-token',this);if(!_0x267924['webSocketUrl'])throw new _0x3a9443('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x267924['token'],_0x267924['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x16f026=>{if(this['connection']=_0x16f026,this['bind']('state')['to'](_0x16f026,'state',this,'_isBrowserOffline',(_0x56900a,_0x3177af)=>('connected'!==_0x56900a&&(this['_shouldPluginsReconnect']=!0x0),_0x3177af||_0x56900a!==_0x3d1e25['CONNECTED']?_0x3d1e25['DISCONNECTED']:this['state']==_0x3d1e25['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x3d1e25['CONNECTING']):_0x3d1e25['CONNECTED'])),this['connection']['on']('error',(_0x580c1b,_0x5a466c)=>{if('limitExceeded'!==_0x5a466c['code'])throw console['error'](_0x5a466c),new _0x3a9443('cloudservices-init',null,{'originalError':_0x5a466c});_0x515dc8['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'});}),!_0x16f026['me'])return new Promise(_0x318735=>_0x16f026['on']('change:me',_0x318735));})['catch'](_0x535197=>{throw console['error'](_0x535197),new _0x3a9443('cloudservices-init',null,{'originalError':_0x535197});});}['addToReconnectionStack'](_0x2ece9d){if('function'!=typeof _0x2ece9d['reconnect'])throw new _0x3a9443('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x2ece9d))throw new _0x3a9443('websocketgateway-plugin-already-registered',this,{'name':_0x2ece9d['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x2ece9d);}['removeFromReconnectionStack'](_0x272840){this['_reconnectionStack']['delete'](_0x272840);}['isInReconnectionStack'](_0x58ef87){return this['_reconnectionStack']['has'](_0x58ef87);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x226439=>_0x226439['reconnect']())))['then'](()=>this['state']=_0x3d1e25['CONNECTED'])['catch'](_0x250ae0=>{throw console['error'](_0x250ae0),new _0x3a9443('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x3d1e25['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x4067ea{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x52815c];}constructor(_0x1b192f){super(_0x1b192f),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x36276b(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x52815c);}['init'](){const _0x1e0424=this['context']['plugins']['get'](n);this['listenTo'](_0x1e0424,'change:state',(_0xbb87e3,_0x5808bf,_0x29a966)=>{if('connected'!==_0x29a966)this['channelSessions']['forEach'](_0x21fcad=>_0x21fcad['clear']()),this['channelConnectedUsers']['forEach'](_0x4fcf90=>_0x4fcf90['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x358ca8,_0x3d1d4b]of this['_registeredSessions'])for(const _0x24c3a5 of _0x3d1d4b)this['_handleSessionAdd'](_0x358ca8,_0x24c3a5);}}),this['_createUser'](_0x1e0424['connection']['me'],!0x0);}['register'](_0x292ecd,_0x126cda){if(this['_registeredSessions']['has'](_0x292ecd))throw new _0x3a9443('sessions-register-already-registered',null,{'channelId':_0x292ecd});this['_registeredSessions']['set'](_0x292ecd,_0x126cda),this['channelSessions']['set'](_0x292ecd,new _0x36276b()),this['channelConnectedUsers']['set'](_0x292ecd,new _0x36276b()),this['listenTo'](_0x126cda,'add',(_0x417762,_0x4fd045)=>this['_handleSessionAdd'](_0x292ecd,_0x4fd045)),this['listenTo'](_0x126cda,'remove',(_0x1f12d1,_0x3407fc)=>this['_handleSessionRemove'](_0x292ecd,_0x3407fc));for(const _0x5bab84 of _0x126cda)this['_handleSessionAdd'](_0x292ecd,_0x5bab84);}['unregister'](_0x271124){if(!this['_registeredSessions']['has'](_0x271124))throw new _0x3a9443('sessions-unregister-not-exist',null,{'channelId':_0x271124});const _0x37aff5=this['_registeredSessions']['get'](_0x271124);this['stopListening'](_0x37aff5);for(const _0x32f724 of _0x37aff5)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x271124,_0x32f724);this['_registeredSessions']['delete'](_0x271124),this['channelSessions']['delete'](_0x271124),this['channelConnectedUsers']['delete'](_0x271124);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x64267b){for(const _0x20b31f of this['channelSessions']['values']())for(const _0x9fa30c of _0x20b31f)if(_0x9fa30c['id']===_0x64267b)return _0x9fa30c['user'];}['getUserSessions'](_0x3e1c26,_0x52d250){const _0x5b46d5=_0x52d250?[this['channelSessions']['get'](_0x52d250)]:this['channelSessions']['values'](),_0x1655ba=new Set();for(const _0x1b8fb5 of _0x5b46d5)for(const _0x39ebb0 of _0x1b8fb5)_0x39ebb0['user']['id']===_0x3e1c26['id']&&_0x1655ba['add'](_0x39ebb0['id']);return _0x1655ba;}['getUserRole'](_0x41c342){for(const _0x6268da of this['channelSessions']['values']())for(const _0x4ebae3 of _0x6268da)if(_0x4ebae3['user']===_0x41c342)return _0x4ebae3['role'];}['_handleSessionAdd'](_0x492aa1,_0x2d0812){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3de37a=_0x2d0812['user'],_0x18b28f=this['_users']['getUser'](_0x3de37a['id'])||this['_createUser'](_0x3de37a),_0x58041e=Object['assign']({},_0x2d0812,{'user':_0x18b28f});if(this['channelSessions']['get'](_0x492aa1)['add'](_0x58041e),!_0x3de37a['hiddenInPresenceList']){const _0x1ce21e=this['channelConnectedUsers']['get'](_0x492aa1);_0x1ce21e['has'](_0x18b28f['id'])||_0x1ce21e['add'](_0x18b28f),this['allConnectedUsers']['has'](_0x18b28f['id'])||_0x3de37a['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x18b28f,_0x18b28f['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x492aa1,{'channelId':_0x492aa1,'session':_0x58041e});}['_handleSessionRemove'](_0x4c959d,_0x537b49){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x22e527=this['channelConnectedUsers']['get'](_0x4c959d),_0x293332=_0x537b49['user'];_0x293332['id']&&(this['channelSessions']['get'](_0x4c959d)['remove'](_0x537b49['id']),_0x22e527['has'](_0x293332['id'])&&!this['getUserSessions'](_0x293332,_0x4c959d)['size']&&_0x22e527['remove'](_0x293332['id']),this['allConnectedUsers']['get'](_0x293332['id'])&&!this['getUserSessions'](_0x293332)['size']&&this['allConnectedUsers']['remove'](_0x293332['id']));}['_createUser'](_0x5adabb,_0x311438){const _0x503701=this['_users']['addUser'](_0x5adabb);return _0x311438&&this['_users']['defineMe'](_0x5adabb['id']),_0x503701['orderNumber']=this['_uniqueUsersCount']++,_0x503701;}}class z extends _0x1e5d58{['_domEmitter']=new(_0x9de3d6())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x317318=this['editor'],_0xd8dbef=_0x317318['plugins']['get'](i);_0x317318['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x9ef1c5,{writer:_0x24f68d})=>function(_0x41a19c,_0x2dfcea,_0x29ee1a,_0x6eaad){const _0x2b07c4=_0x41a19c['markerName']['split'](':')[0x2],_0x4b4b20=_0x29ee1a['getUserBySessionId'](_0x2b07c4);if(!_0x4b4b20||_0x2b07c4===_0x29ee1a['mySessionId'])return;if(!_0x6eaad['model']['schema']['checkChild'](_0x41a19c['markerRange']['start'],'$text'))return;const _0x139636={'class':'ck-user__marker\x20'+_0x4b4b20['color']['getMarkerClass'](),'data-name':_0x4b4b20['name'],'data-session-id':_0x2b07c4},_0x1f8f6d=_0x6eaad['model']['markers']['get'](_0x41a19c['markerName']),_0x51715b=_0x1f8f6d['getStart'](),_0x25831e=_0x51715b['nodeAfter'],_0x414ee7=_0x6eaad['model']['schema'];if(_0x25831e&&_0x414ee7['isObject'](_0x25831e)&&_0x414ee7['isInline'](_0x25831e)&&!_0x6eaad['model']['markers']['get']('user:range:'+_0x2b07c4)['getRange']()['isCollapsed'])return;const _0x358f8b=_0x51715b['parent'];return _0x6eaad['model']['schema']['isLimit'](_0x358f8b)&&!_0x6eaad['model']['hasContent'](_0x358f8b)&&(_0x139636['contenteditable']=!0x1),function(_0x4de50c,_0x464e62,_0x430ab){const _0x3a4321=_0x4de50c['createUIElement']('span',_0x464e62);return _0x4de50c['setCustomProperty']('userPositionMarker',!0x0,_0x3a4321),_0x3a4321['render']=function(_0x1ebc29){const _0x25c328=this['toDomElement'](_0x1ebc29),_0x4d2420=document['createElement']('span');return _0x4d2420['classList']['add']('ck-user__marker-tooltip'),_0x4d2420['setAttribute']('contenteditable','false'),_0x4d2420['setAttribute']('spellcheck','false'),_0x4d2420['textContent']=_0x430ab['name'],_0x25c328['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x4d2420['outerHTML']+'⁠',_0x25c328['addEventListener']('mouseenter',()=>{_0x25c328['classList']['add']('ck-user__marker_hovered');}),_0x25c328['addEventListener']('mouseleave',()=>{_0x25c328['classList']['remove']('ck-user__marker_hovered');}),_0x25c328;},_0x3a4321['isSimilar']=function(_0x62d181){return!(!this['getCustomProperty']('userPositionMarker')||!_0x62d181['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x62d181['getAttribute']('data-session-id'));},_0x3a4321;}(_0x2dfcea,_0x139636,_0x4b4b20);}(_0x9ef1c5,_0x24f68d,_0xd8dbef,_0x317318)}),_0x317318['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x560850=>function(_0xf16640,_0x251ab4){const _0xda280b=_0xf16640['markerName']['split'](':')[0x2];if(_0xda280b===_0x251ab4['mySessionId'])return null;const _0x2789fa=_0x251ab4['getUserBySessionId'](_0xda280b);if(!_0x2789fa)return{'id':_0xda280b,'classes':[]};return{'id':_0xda280b,'classes':['ck-user__selection',_0x2789fa['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xda280b},'priority':0x7d0+_0x2789fa['orderNumber']};}(_0x560850,_0xd8dbef)}),function(_0x5ac737){const _0x47eb82=_0x5ac737['model'],_0x3429c7=new Map(),_0x588c80=_0x5ac737['plugins']['get'](i);_0x47eb82['markers']['on']('update:user:range',(_0x27e51a,_0x4d6c15,_0x14ae60,_0x3d402e)=>{if(!_0x3d402e&&_0x3429c7['get'](_0x4d6c15['name']))return _0x3429c7['get'](_0x4d6c15['name'])['detach'](),void _0x3429c7['delete'](_0x4d6c15['name']);const _0x47c46f=_0x4d6c15['name']['split'](':')[0x2];if(_0x47c46f===_0x588c80['mySessionId'])return;const _0x3feca6='user:position:'+_0x47c46f;_0x47eb82['markers']['has'](_0x3feca6)&&_0x5ac737['editing']['reconvertMarker'](_0x3feca6),_0x4d6c15['on']('change:range',(_0x1c9a7e,_0x51d58b,_0x4581ac)=>{if('$graveyard'!=_0x51d58b['root']['rootName']&&'$graveyard'==_0x4d6c15['getRange']()['root']['rootName']&&!_0x3429c7['has'](_0x4d6c15['name'])){const _0x22dc71=_0x47eb82['schema']['getNearestSelectionRange'](_0x4581ac['deletionPosition']);if(_0x22dc71){const _0x4bf1ef=_0x1d7bba['fromRange'](_0x22dc71);_0x3429c7['set'](_0x4d6c15['name'],_0x4bf1ef),_0x4bf1ef['on']('change:range',(_0x4d640d,_0x172339,_0x34e5fd)=>{if('$graveyard'==_0x4bf1ef['root']['rootName']){const _0x207cd5=_0x47eb82['schema']['getNearestSelectionRange'](_0x34e5fd['deletionPosition']);_0x207cd5?(_0x4bf1ef['start']=_0x207cd5['start'],_0x4bf1ef['end']=_0x207cd5['end']):(_0x3429c7['delete'](_0x4d6c15['name']),_0x4bf1ef['detach']());}});}}});}),_0x47eb82['document']['on']('change',()=>{_0x3429c7['size']>0x0&&_0x47eb82['enqueueChange']({'isUndoable':!0x1},_0x520bbd=>{for(const [_0x501bf0,_0x3a538c]of _0x3429c7)'$graveyard'==_0x47eb82['markers']['get'](_0x501bf0)['getRange']()['root']['rootName']&&(Q(_0x501bf0['split'](':')[0x2],_0x3a538c['toRange'](),_0x47eb82,_0x520bbd),_0x3a538c['detach']());_0x3429c7['clear']();});});}(_0x317318),this['_domEmitter']['listenTo'](_0x19a405['document'],'keydown',(_0x5844d4,{key:_0x2056ac})=>{'Escape'===_0x2056ac&&function(_0x1d486e){_0x1d486e['editing']['view']['change'](_0x5ef634=>{for(const _0x2ecf80 of _0x1d486e['model']['markers']){if(!_0x2ecf80['name']['startsWith']('user:position'))continue;const _0x44269a=_0x1d486e['editing']['mapper']['markerNameToElements'](_0x2ecf80['name']);if(_0x44269a){for(const _0x467e61 of _0x44269a)_0x5ef634['removeClass']('ck-user__marker_hovered',_0x467e61);}}});}(_0x317318);},{'useCapture':!0x0});}['afterInit'](){const _0x492ef9=this['editor'],_0x15183e=_0x492ef9['commands']['get']('undo');_0x15183e&&_0x492ef9['model']['on']('applyOperation',(_0x5850ce,_0x4e55ca)=>{const _0x912c42=_0x4e55ca[0x0];if(!_0x912c42['isDocumentOperation'])return;if('marker'!=_0x912c42['type']||!_0x912c42['name']['startsWith']('user:'))return;const _0x3a81dc=_0x912c42['batch'];_0x15183e['_createdBatches']['has'](_0x3a81dc)&&(_0x912c42['newRange']=_0x912c42['oldRange']?_0x492ef9['model']['createRange'](_0x912c42['oldRange']['start'],_0x912c42['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x5da213=this['editor'],_0x3ed0a5=_0x5da213['model']['document'],_0x5736eb=_0x5da213['plugins']['get'](i);_0x5da213['model']['enqueueChange']({'isUndoable':!0x1},_0x25cd73=>{const _0x3830bb='user:range:'+_0x5736eb['mySessionId'],_0x37a038='user:position:'+_0x5736eb['mySessionId'],_0x354d2e=_0x5da213['model']['markers']['has'](_0x3830bb);_0x5da213['editing']['view']['hasDomSelection']?Q(_0x5736eb['mySessionId'],_0x3ed0a5['selection']['getFirstRange'](),_0x5da213['model'],_0x25cd73):_0x354d2e&&(_0x25cd73['removeMarker'](_0x3830bb),_0x25cd73['removeMarker'](_0x37a038));});}}function Q(_0x5715ee,_0x10a03c,_0x5d2fcb,_0xa9dadf){const _0x516d1f='user:range:'+_0x5715ee,_0x3f4737='user:position:'+_0x5715ee,_0x480e19=_0x10a03c['getContainedElement']();let _0x5db0d1=_0x10a03c['start'];if(_0x480e19&&_0x480e19['is']('element','tableCell')){const _0x24b213=function(_0x2f794a,_0x800835){for(const _0x3c7db6 of _0x2f794a['getPositions']())if(_0x800835['schema']['checkChild'](_0x3c7db6,'$text'))return _0x3c7db6;}(_0x10a03c,_0x5d2fcb);_0x24b213&&(_0x5db0d1=_0x24b213,_0x10a03c=_0xa9dadf['createRange'](_0x5db0d1));}const _0x575409=_0xa9dadf['createRange'](_0x5db0d1);_0x5d2fcb['markers']['has'](_0x516d1f)?(_0xa9dadf['updateMarker'](_0x516d1f,{'range':_0x10a03c}),_0xa9dadf['updateMarker'](_0x3f4737,{'range':_0x575409})):(_0xa9dadf['addMarker'](_0x516d1f,{'range':_0x10a03c,'usingOperation':!0x0}),_0xa9dadf['addMarker'](_0x3f4737,{'range':_0x575409,'usingOperation':!0x0}));}function V(_0x4ede6b,_0x56be7e,_0x386937){const _0x547919=_0x4ede6b['t'],t=_0x4ede6b['t'];switch(_0x56be7e){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 _0x547919({'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'},_0x386937);default:return'';}}let q=0x1;class l extends _0x1e5d58{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x4e90ee)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,z,_0x5a7c8a,_0x52815c,_0x529457];}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 _0x3b8993=this['serverHistory']['getOperations']();for(let _0x177d6e=_0x3b8993['length']-0x1;_0x177d6e>=0x0;_0x177d6e--){const _0x59f814=_0x3b8993[_0x177d6e];if(!this['_disconnectionOperations']['has'](_0x59f814))return _0x59f814['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x2576e5){if(super(_0x2576e5),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x5e4bad(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3a9443('collaboration-missing-channelid',this);const _0x50fc68=_0x2576e5['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x50fc68,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x20e1aa(),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 OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x1ebe20=this['editor'],_0x4ba413=_0x1ebe20['plugins']['get'](_0x52815c),_0x5ae507=_0x1ebe20['plugins']['get'](n);this['listenTo'](_0x4ba413,'getOperationAuthor',(_0x579b2e,_0x5b5a63)=>{const _0x27e52a=_0x5b5a63[0x0];_0x27e52a['_authorId']&&(_0x579b2e['return']=_0x4ba413['getUser'](_0x27e52a['_authorId']),_0x579b2e['stop']()),null===_0x27e52a['_authorId']&&(_0x579b2e['return']=null,_0x579b2e['stop']());},{'priority':'high'}),this['listenTo'](_0x1ebe20['model']['document']['selection'],'change:range',(_0x46ccd2,_0x4a2de1)=>{_0x4a2de1['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1ebe20['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1ebe20['model']['on']('applyOperation',(_0x4cc979,_0x571a82)=>{const _0x507c5d=_0x571a82[0x0];_0x507c5d['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x507c5d),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5ae507,'state',this,'_hasSynchronizationProblem',(_0x583d3f,_0x5bb0f1)=>'connected'===_0x583d3f&&!_0x5bb0f1),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1ebe20['disableReadOnlyMode']('rtc-offline'):_0x1ebe20['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1ebe20['disableReadOnlyMode']('rtc-offline'):_0x1ebe20['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x4eedaa=this['editor']['plugins']['get'](i),_0x5b2cd4=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x4eedaa['unregister'](this['_channelId']);const _0xadb81c=await this['_service']['reconnect'](_0x5b2cd4['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0xadb81c)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3170d0=await this['_service']['getConnectedSessions']();_0x4eedaa['register'](this['_channelId'],_0x3170d0),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x531250){if(function(_0x3537e1){return'404'===_0x3537e1['code'];}(_0x531250)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x5477f0){return'409'===_0x5477f0['code'];}(_0x531250)){const _0x50772a=V(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x50772a);}else{if(!(_0x531250 instanceof ReconnectionError))throw _0x531250;this['_handleReconnectionError']();}}}}['destroy'](){const _0x14c35a=this['editor']['plugins']['get'](n),_0x48b3c6=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x48b3c6['channelSessions']['has'](this['_channelId'])&&_0x48b3c6['unregister'](this['_channelId']),_0x14c35a['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x25b259){if(this['sessionId']!==_0x25b259['sessionId']&&this['_lastSyncedOperationId']!==_0x25b259['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x25b259['sessionId'],this['_handleServerResponse']([],{..._0x25b259,'wereChangesApplied':!0x1,'data':_0x25b259['data']},'reconnect');}async['_connectService'](_0x2bd98c,_0x18ad12=!0x1){const {connection:_0x255099}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x255099,this['_channelId'])['then'](_0x5a42bc=>this['_initSessionsHandling'](_0x5a42bc))['catch'](_0x5de325=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5de325);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x4d14c0,_0x19ea48)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x19ea48);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x21a10c=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2bd98c);this['_isPendingUpdate']=!0x0;const _0x549ed0=await this['_service']['connect'](_0x255099,this['_compressOperations'](_0x2bd98c),_0x21a10c);if(this['sessionId']=_0x549ed0['sessionId'],_0x18ad12){if(!_0x549ed0['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x549ed0['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2bd98c,_0x549ed0,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x549ed0,_0x2bd98c);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x583e1a=this['editor']['plugins']['get'](i),_0x1d6a86=this['editor']['plugins']['get'](z),_0x595a3c=_0x583e1a['channelSessions']['get'](this['_channelId']);_0x595a3c&&_0x595a3c['length']>0x1?_0x1d6a86['createUserMarkerOperations']():this['listenTo'](_0x583e1a,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x583e1a['channelSessions']['get'](this['_channelId'])['length']&&_0x1d6a86['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x19242b,_0x337542,_0x6bebc1,_0x1704dd){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x337542){const _0x3310fe=this['_decompressOperations'](_0x6bebc1,_0x1704dd);await this['_fetchMissingUsers'](_0x3310fe),this['_handleExternalOperations'](_0x3310fe,_0x337542,_0x6bebc1['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x519571}=this['editor'];let _0x402036;try{_0x402036=await this['_service']['getDocumentDetails']();}catch{const _0x4f6712=V(_0x519571,'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'](_0x4f6712);}const _0x5367fe=_0x402036['currentDocumentSession']||_0x402036['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x5367fe['lastOperationId']){const _0x56c553=V(_0x519571,'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'](_0x56c553);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xde3909){const _0xabb3e3=this['editor']['plugins']['get'](i);this['listenTo'](_0xabb3e3,'sessionAdd:'+this['_channelId'],(_0x3717e0,{session:_0x8f56ad})=>{if(_0x8f56ad['id']===_0xabb3e3['mySessionId']){_0x3717e0['off']();const _0x1b9be3=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x4fd702=_0x8f56ad['permissions'];_0x1b9be3&&_0x1b9be3['isEnabled']&&(_0x4fd702=_0x4fd702['filter'](_0x148a3c=>'document:write'!==_0x148a3c)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x4fd702,this['_channelId']);}}),_0xabb3e3['register'](this['_channelId'],_0xde3909);}['_initThrowingOnDataSet'](){const _0x36725e=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x352993)=>{if(!_0x352993[_0x352993['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3a9443('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x36725e['apply'](this['editor']['data'],_0x352993);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4ec234,[_0x214f36])=>{if(this['_document']['version'])throw new _0x3a9443('realtimecollaborationclient-init-document-already-initialized',this);_0x4ec234['stop'](),this['_setPendingAction']();const _0x2e38ad=this['editor']['config']['get']('rootsAttributes'),_0x15b9f0=this['_getOperationsFromInitData'](_0x214f36,_0x2e38ad);0x0==_0x15b9f0['length']&&_0x15b9f0['push'](new _0x2546a3(0x0)),_0x4ec234['return']=this['_connectService'](_0x15b9f0)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x546ad8=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x546ad8))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x57587a,[_0x5e395c,_0x220428])=>{_0x57587a['stop']();const _0x5af114=this['editor']['model']['document']['getRoot'](_0x5e395c);if(!this['_knownRootNames']['has'](_0x5e395c)){const _0x122d3d=_0x220428&&_0x220428['data']?_0x220428['data']:'',_0x327d8a=_0x220428&&_0x220428['attributes']?_0x220428['attributes']:{};await this['_loadRoot'](_0x5e395c,_0x122d3d,_0x327d8a);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x5af114['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x5af114);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x103cb1){const _0x28162d=this['editor']['plugins']['get'](_0x52815c),{connection:_0x12892e}=this['editor']['plugins']['get'](n),_0x1c6b5c=new Set();for(const _0x4a037a of _0x103cb1){const _0xec7c92=_0x4a037a['_authorId'];_0xec7c92&&!_0x28162d['getUser'](_0xec7c92)&&_0x1c6b5c['add'](_0xec7c92);}if(0x0===_0x1c6b5c['size'])return;const _0x449f6a=await ht['getMany'](_0x12892e,Array['from'](_0x1c6b5c));for(const _0x3f9889 of _0x449f6a)_0x28162d['getUser'](_0x3f9889['id'])||_0x28162d['addUser'](_0x3f9889);}['_getOperationsFromInitData'](_0x46003b,_0x420977={}){const _0x45dd63=this['editor']['model'],_0x210ab8=[];let _0x1fffce=0x0;const _0xb92397='string'==typeof _0x46003b?{'main':_0x46003b}:_0x46003b;for(const _0x1869b2 of Object['keys'](_0xb92397)){if(!this['_document']['roots']['has'](_0x1869b2))throw new _0x3a9443('realtimecollaborationclient-init-non-existent-root',this);const _0x3ee0cc=this['editor']['data']['parse'](_0xb92397[_0x1869b2]),_0xc501a9=this['_document']['getRoot'](_0x1869b2),_0x4267f0=new _0x543630(_0x45dd63['createPositionAt'](_0xc501a9,0x0),_0x3ee0cc,_0x1fffce++);_0x210ab8['push'](_0x4267f0);for(const [_0x180c14,_0x99b986]of _0x3ee0cc['markers']){const _0x31d8a8=_0x45dd63['createRange'](_0x45dd63['createPositionFromPath'](_0xc501a9,_0x99b986['start']['path']['slice']()),_0x45dd63['createPositionFromPath'](_0xc501a9,_0x99b986['end']['path']['slice']())),_0x251d33=new _0x49f499(_0x180c14,null,_0x31d8a8,_0x45dd63['markers'],!0x0,_0x1fffce++);_0x210ab8['push'](_0x251d33);}}if(_0x420977)for(const [_0x512e2f,_0x543d3c]of Object['entries'](_0x420977)){const _0x425148=_0x45dd63['document']['getRoot'](_0x512e2f);if(!_0x425148)throw new _0x3a9443('multi-root-editor-root-attributes-no-root',null);for(const [_0x5a3847,_0x138149]of Object['entries'](_0x543d3c))if(null!==_0x138149){const _0x26ba39=new _0x15a55f(_0x425148,_0x5a3847,null,_0x138149,_0x1fffce++);_0x210ab8['push'](_0x26ba39);}}return _0x210ab8;}async['_loadRoot'](_0x5bc957,_0x1ffb1b,_0x12528c){this['_getOperationsFromInitData']({[_0x5bc957]:_0x1ffb1b},{[_0x5bc957]:_0x12528c})['forEach']((_0x243694,_0xb2f129)=>{_0x243694['baseVersion']=this['_document']['version']+_0xb2f129,_0x243694['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x243694);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x246082,_0x18115d){let _0x3243b1;this['_offset']=_0x246082['offset'];const _0x209d6f=_0x246082['wereChangesApplied']&&!_0x246082['initData'],_0x511b98=_0x209d6f?0x0:_0x246082['data']['baseVersion'];if(_0x18115d['forEach'](_0x1279eb=>{_0x1279eb['_isInit']=!0x0,_0x1279eb['createdAt']=_0x246082['sessionCreatedAt'],_0x1279eb['_authorId']=null;}),_0x209d6f)_0x3243b1=_0x18115d,this['_applyOperationsSet'](_0x3243b1,_0x209d6f);else{if(_0x246082['initData']){const _0x481aff=this['_getOperationsFromInitData'](_0x246082['initData']);this['_document']['history']['version']=-_0x481aff['length'],_0x481aff['forEach'](_0x50eee2=>{_0x50eee2['baseVersion']-=_0x481aff['length'],_0x50eee2['createdAt']=_0x246082['sessionCreatedAt'],_0x50eee2['_isInit']=!0x0,_0x50eee2['_authorId']=null;}),this['_applyOperationsSet'](_0x481aff,!0x0),this['serverHistory']['version']=-_0x481aff['length']+this['_offset'],this['_updateServerHistory'](_0x481aff);}this['_document']['history']['version']=_0x511b98,_0x3243b1=this['_decompressOperations'](_0x246082['data'],_0x246082['metadata']),await this['_fetchMissingUsers'](_0x3243b1),this['_applyOperationsSet'](_0x3243b1,_0x209d6f);}_0x246082['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3243b1,_0x246082['lastOperationId']),this['_lastSyncedOperationId']=_0x246082['lastOperationId']),this['serverHistory']['version']=_0x511b98+this['_offset'],this['_updateServerHistory'](_0x3243b1),_0x18115d['filter'](_0x5c532c=>{const _0x444941=this['_getAffectedRoot'](_0x5c532c);return _0x444941&&!this['_knownRootNames']['has'](_0x444941);})['forEach']((_0x22ea32,_0x163145)=>{_0x22ea32['baseVersion']=this['_document']['version']+_0x163145,this['_saveOperationInBuffer'](_0x22ea32);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4e2971,_0x3d7d0a){const _0x31e6f4=_0x3d7d0a&&_0x3d7d0a['message'];if(_0x31e6f4&&_0x31e6f4['startsWith']('realtimecollaborationclient'))throw _0x3d7d0a;const _0x545fd2=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x545fd2['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3a9443(_0x4e2971,this['editor'],_0x31e6f4?{'originalError':_0x31e6f4}:void 0x0);}['_saveOperationInBuffer'](_0x429fc8){this['_knownOperations']['has'](_0x429fc8)||(this['_knownOperations']['add'](_0x429fc8),this['_bufferedOperations']['push'](_0x429fc8),this['_pendingAction']||'marker'==_0x429fc8['type']&&!_0x429fc8['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x15cb21=!0x1){!_0x15cb21&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xc30689=>{_0xc30689&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x35a9d2=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x3becfe){return _0x3becfe['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x3becfe['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x3becfe['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x35a9d2)||this['_crash'](_0x35a9d2['message'],_0x35a9d2);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x3cdf8b=>{this['on']('change:_isPendingUpdate',()=>{_0x3cdf8b();});});}async['_sendBufferedOperations'](){const _0x5ef11f=this['editor']['plugins']['get'](z);if(this['_shouldSendSelectionUpdate']()&&(_0x5ef11f['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3a265b=[...this['_bufferedOperations']];for(const _0x57e03c of _0x3a265b)_0x57e03c['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x57e03c);const _0x38d765=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3a265b),_0x2f52fd=q++,_0x4754c6=this['_compressOperations'](_0x3a265b),_0x3e72e4=await this['_service']['sendOperations'](_0x4754c6,_0x4754c6['baseVersion'],_0x38d765);try{return await this['_handleServerResponse'](_0x3a265b,_0x3e72e4,_0x2f52fd);}catch(_0x4305f2){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4305f2);}}async['_handleServerResponse'](_0x130e41,_0x351cf6,_0x20df22){if('error'in _0x351cf6)throw _0x351cf6['error'];let _0x567cba=!0x1;if(_0x351cf6['wereChangesApplied']){_0x351cf6['lastOperationId']&&(this['_lastSyncedOperationId']=_0x351cf6['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x58e5ce=>!_0x130e41['includes'](_0x58e5ce));for(const _0x11c840 of _0x130e41)_0x11c840['createdAt']='lastOperationAcceptedAt'in _0x351cf6&&_0x351cf6['lastOperationAcceptedAt']||void 0x0;G(_0x130e41,_0x351cf6['version']-_0x130e41['length']),this['_updateServerHistory'](_0x130e41);const _0x381d4b=_0x130e41['filter'](_0x263d61=>{if(!_0x263d61['_isInit'])return!0x1;const _0x389b44=this['_getAffectedRoot'](_0x263d61);return _0x389b44&&!this['_knownRootNames']['has'](_0x389b44);});G(_0x381d4b,this['_document']['version']),this['_applyOperationsSet'](_0x381d4b),_0x567cba=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x518bbe=this['_decompressOperations'](_0x351cf6['data'],_0x351cf6['metadata'])['filter'](_0x25f3ff=>_0x25f3ff['baseVersion']>=this['_lastServerVersion']);_0x518bbe['forEach'](_0x351207=>this['_addKnownRoot'](_0x351207)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x3eb65c=>!_0x3eb65c['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x3eb65c))),this['_bufferedOperations']['length']&&G(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x518bbe),_0x567cba=this['_handleExternalOperations'](_0x518bbe,_0x351cf6['version'],_0x351cf6['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x567cba?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3d9805,_0xb82fd4,_0x186975){try{const _0x20f3a1={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x1f7659,operationsB:_0x49e60d,originalOperations:_0x31dcfb}=_0x5cbfc9(_0x3d9805,this['_bufferedOperations'],_0x20f3a1);G(_0x1f7659,this['_document']['version']),G(_0x49e60d,_0xb82fd4);for(const _0x2ea8f3 of _0x1f7659){const _0x4198ad=_0x31dcfb['get'](_0x2ea8f3);_0x2ea8f3['_authorId']=_0x4198ad?_0x4198ad['_authorId']:null;}_0x186975&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3d9805,_0x186975),this['_lastSyncedOperationId']=_0x186975),this['_bufferedOperations']=[..._0x49e60d],this['_applyOperationsSet'](_0x1f7659),this['_updateServerHistory'](_0x3d9805);}catch(_0x46c8b4){return console['error'](_0x46c8b4),!0x1;}return!0x0;}['_applyOperationsSet'](_0x242978,_0x11085c=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x141c66=>{for(const _0x516b82 of _0x242978)this['_knownOperations']['add'](_0x516b82),this['_addKnownRoot'](_0x516b82),_0x141c66['batch']['addOperation'](_0x516b82),this['editor']['model']['applyOperation'](_0x516b82);});}['_addKnownRoot'](_0x3f9390){const _0x590bd6=this['_getAffectedRoot'](_0x3f9390);_0x590bd6&&this['_knownRootNames']['add'](_0x590bd6);}['_getAffectedRoot'](_0x28a63f){let _0x2a37c3,_0x120461;switch(_0x28a63f['type']){case'insert':_0x2a37c3=_0x28a63f['position']['root'];break;case'marker':if(_0x120461=_0x28a63f['newRange'],!_0x120461)return null;_0x2a37c3=_0x120461['root'];break;case'addRootAttribute':_0x2a37c3=_0x28a63f['root'];break;case'addRoot':_0x2a37c3=_0x28a63f['affectedSelectable'];break;case'move':_0x2a37c3=_0x28a63f['targetPosition']['root'];break;default:return null;}return _0x2a37c3['rootName'];}['_updateServerHistory'](_0x4ee202){_0x4ee202['forEach'](_0x309614=>{const _0x4eeda7=_0x309614['clone']();_0x4eeda7['_authorId']=_0x309614['_authorId'],_0x4eeda7['_isInit']=!!_0x309614['_isInit'],_0x4eeda7['createdAt']=_0x309614['createdAt'],_0x4eeda7['baseVersion']+=this['_offset'],_0x309614['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x4eeda7),this['serverHistory']['addOperation'](_0x4eeda7);});}['_handleReconnectionError'](_0x39f6cf){const _0x2f8018=this['editor']['plugins']['get']('Notification'),_0x4fb6b4=this['editor']['locale'];_0x39f6cf||(_0x39f6cf=V(_0x4fb6b4,'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.')),_0x2f8018['showWarning'](_0x39f6cf,{'title':V(_0x4fb6b4,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x5a7c8a)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x5a7c8a)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x5e9537){const _0x3004dc=_0x5e9537['map'](_0x429f44=>_0x429f44['toJSON']());return this['_compressor']['compress'](_0x3004dc);}['_decompressOperations'](_0x5e5cc8,_0xc41365){return this['_compressor']['decompress'](_0x5e5cc8)['map']((_0x3adc95,_0x19a7e1)=>{const _0x1be1b5='init'==_0xc41365[_0x19a7e1]['type'];if('InsertOperation'==_0x3adc95['__className']){const _0x26b29e=_0x3adc95['position']['root'];!this['_document']['getRoot'](_0x26b29e)&&(this['_document']['createRoot']('$root',_0x26b29e)['_isAttached']=!0x1);}const _0x4cc327=_0x1c848c['fromJSON'](_0x3adc95,this['_document']);return _0x4cc327['wasUndone']=_0x3adc95['wasUndone'],_0x4cc327['_isInit']=_0x1be1b5,_0x4cc327['_authorId']=_0x1be1b5?null:_0xc41365[_0x19a7e1]['userId'],_0x4cc327['_isDisconnection']='cs:removeUser'===_0xc41365[_0x19a7e1]['type'],_0x4cc327['createdAt']=_0xc41365[_0x19a7e1]['createdAt'],_0x4cc327;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x3b25f8=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x3b25f8&&_0x3b25f8['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function G(_0x5bdf7c,_0x2dbce7){for(const _0x1dd89f of _0x5bdf7c)_0x1dd89f['baseVersion']=_0x2dbce7++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x1a19f7){this['_ignoredOperations']=_0x1a19f7,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x2af1d2){let _0x1843f5=_0x2af1d2['length'];for(;_0x1843f5--;){const _0x50bc8c=_0x2af1d2[_0x1843f5];if(!this['_ignoredOperations']['has'](_0x50bc8c)){if(!this['_operationToId']['has'](_0x50bc8c)){const _0x26fd09=_0x36f6e1()['slice'](0x1,0x12);this['_operationToId']['set'](_0x50bc8c,_0x26fd09);}return this['_operationToId']['get'](_0x50bc8c);}}}['setIdForTheLastOperation'](_0x10fa16,_0x64b05f){if(!_0x64b05f)return;let _0x3670cb=_0x10fa16['length'];for(;_0x3670cb--;){const _0x2c1497=_0x10fa16[_0x3670cb];this['_ignoredOperations']['has'](_0x2c1497)||this['_operationToId']['set'](_0x2c1497,_0x64b05f);}}}class a extends _0x1e5d58{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x4067ea{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x5409e7)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x52815c];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5efc17){super(_0x5efc17),this['_services']=new Map();}async['init'](){const _0x196f17=this['context'],_0x6988ab=_0x196f17['plugins']['get']('CommentsRepository');if(_0x196f17['plugins']['get'](n)['addToReconnectionStack'](this),_0x6988ab['adapter']={'addCommentThread':async({channelId:_0x4a3f28,threadId:_0x30f9f3,comments:_0x12d9a9,resolvedAt:_0x63e635,resolvedBy:_0x295988,context:_0x1d4ea0,attributes:_0x5e8fd7})=>{const _0x248a98=await this['_getService'](_0x4a3f28)['addCommentThread']({'commentThreadId':_0x30f9f3,'comments':_0x12d9a9['map'](_0x5de561=>function(_0x356425,_0x3e31a3,_0x144e7a){return{'commentThreadId':_0x144e7a,'commentId':_0x356425['commentId'],'userId':_0x356425['authorId'],'content':_0x356425['content'],'documentId':_0x3e31a3,'createdAt':_0x356425['createdAt'],'attributes':_0x356425['attributes']||{}};}(_0x5de561,_0x4a3f28,_0x30f9f3)),'resolvedAt':_0x63e635,'resolvedBy':_0x295988,'context':_0x1d4ea0,'attributes':_0x5e8fd7})['catch'](lt);return{'threadId':_0x248a98['commentThreadId'],'comments':_0x248a98['comments']};},'getCommentThread':async({channelId:_0x581aa9,threadId:_0x1820d0})=>{const _0xa8b227=await this['_getService'](_0x581aa9)['getCommentThread'](_0x1820d0)['catch'](tt)['catch'](lt);return _0xa8b227?_0xa8b227['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0xa8b227]),{'threadId':_0xa8b227['commentThreadId'],'comments':_0xa8b227['comments']['map'](ot),'context':_0xa8b227['context'],'resolvedAt':_0xa8b227['resolvedAt'],'resolvedBy':_0xa8b227['resolvedBy'],'attributes':_0xa8b227['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3febb9,threadId:_0x16aff4,context:_0xc85c56,unlinkedAt:_0x40ed56,attributes:_0x5ac4b7})=>this['_getService'](_0x3febb9)['updateCommentThread']({'commentThreadId':_0x16aff4,'context':_0xc85c56,'attributes':_0x5ac4b7,'unlinkedAt':_0x40ed56})['catch'](tt)['catch'](lt),'resolveCommentThread':async({channelId:_0x5caa6a,threadId:_0xc08e45})=>{const _0x1a45df=await this['_getService'](_0x5caa6a)['resolveCommentThread'](_0xc08e45)['catch'](tt)['catch'](lt);return{'threadId':_0x1a45df['commentThreadId'],'resolvedAt':_0x1a45df['resolvedAt'],'resolvedBy':_0x1a45df['resolvedBy']};},'reopenCommentThread':async({channelId:_0x58c831,threadId:_0x2d762a})=>this['_getService'](_0x58c831)['reopenCommentThread'](_0x2d762a)['catch'](tt)['catch'](lt),'removeCommentThread':({channelId:_0x1a8e10,threadId:_0x396bcf})=>this['_getService'](_0x1a8e10)['removeCommentThread'](_0x396bcf)['catch'](tt)['catch'](lt),'addComment':({channelId:_0x5a5717,threadId:_0x4e8e55,commentId:_0x2e6817,content:_0x2739d1,attributes:_0x366541})=>this['_getService'](_0x5a5717)['addComment'](_0x4e8e55,_0x2e6817,_0x2739d1,_0x366541)['catch'](lt),'updateComment':({channelId:_0x20147a,threadId:_0x4d0917,commentId:_0x3ab782,content:_0x1cacd6,attributes:_0x33c74b})=>this['_getService'](_0x20147a)['updateComment'](_0x4d0917,_0x3ab782,_0x1cacd6,_0x33c74b)['catch'](tt)['catch'](lt),'removeComment':({channelId:_0x11d95f,threadId:_0x533ee5,commentId:_0x31a60e})=>this['_getService'](_0x11d95f)['removeComment'](_0x533ee5,_0x31a60e)['catch'](tt)['catch'](lt)},_0x196f17 instanceof _0x2e2ce6){const _0x1f8ec9=_0x196f17['config']['get']('collaboration.channelId'),_0x24d243=_0x196f17['plugins']['get'](i);await this['_setUpService'](_0x1f8ec9);const _0x139f19=await this['_services']['get'](_0x1f8ec9)['getConnectedSessions']();this['listenTo'](_0x24d243,'sessionAdd:'+_0x1f8ec9,(_0x3e09ab,{session:_0x951c83})=>{_0x951c83['id']===_0x24d243['mySessionId']&&(_0x3e09ab['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x951c83['permissions'],_0x1f8ec9));}),_0x24d243['register'](_0x1f8ec9,_0x139f19);}}async['_setUpService'](_0x28d1dd){if(this['_services']['has'](_0x28d1dd))throw new _0x3a9443('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x28d1dd});const _0x59eb88=this['context']['plugins']['get']('CommentsRepository'),_0x35856a=new s['CommentsService'](_0x28d1dd);this['_services']['set'](_0x28d1dd,_0x35856a),this['listenTo'](_0x35856a,'commentThreadAdded',(_0x1a0ca0,_0x1a4e27)=>{const {commentThreadId:_0x5b252e,documentId:_0x254a88,context:_0x3e49cc,attributes:_0x5bf64c,resolvedAt:_0x4f03c7,resolvedBy:_0x4cedb1,comments:_0x38d408}=_0x1a4e27;_0x59eb88['getCommentThread'](_0x5b252e)||_0x59eb88['addCommentThread']({'threadId':_0x5b252e,'channelId':_0x254a88,'comments':_0x38d408?_0x38d408['map'](ot):[],'context':_0x3e49cc,'attributes':_0x5bf64c,'resolvedAt':_0x4f03c7,'resolvedBy':_0x4cedb1,'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadUpdated',(_0x3b758e,{commentThreadId:_0x23b51b,documentId:_0x33ef7a,context:_0x480422,unlinkedAt:_0x49dbab,attributes:_0xa8f5aa})=>{_0x59eb88['getCommentThread'](_0x23b51b)&&_0x59eb88['updateCommentThread']({'threadId':_0x23b51b,'channelId':_0x33ef7a,'context':_0x480422,'unlinkedAt':_0x49dbab,'attributes':_0xa8f5aa,'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadResolved',(_0x23880d,{commentThreadId:_0x4d2d15,resolvedBy:_0x436991,resolvedAt:_0x2e5178})=>{const _0x1eaede=_0x59eb88['getCommentThread'](_0x4d2d15);_0x1eaede&&_0x1eaede['resolve']({'resolvedBy':_0x436991,'resolvedAt':_0x2e5178,'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadReopened',(_0x10ffe3,{commentThreadId:_0x124679})=>{const _0x2680c9=_0x59eb88['getCommentThread'](_0x124679);_0x2680c9&&_0x2680c9['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentThreadRemoved',(_0x214211,{commentThreadId:_0x171dff})=>{const _0x140cf7=_0x59eb88['getCommentThread'](_0x171dff);_0x140cf7&&_0x140cf7['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentAdded',(_0x5c3f34,_0x1c6573)=>{const _0x3cda74=_0x1c6573['commentThreadId'],_0x23c4bb=_0x59eb88['getCommentThread'](_0x3cda74);_0x23c4bb&&_0x23c4bb['addComment']({...ot(_0x1c6573),'isFromAdapter':!0x0});}),this['listenTo'](_0x35856a,'commentUpdated',(_0x14c774,{commentThreadId:_0x42105a,commentId:_0x172cbf,content:_0x32931d,attributes:_0x21b050})=>{const _0x3fdac8=_0x59eb88['getCommentThread'](_0x42105a);if(_0x3fdac8){const _0x1e267f=_0x3fdac8['getComment'](_0x172cbf);_0x1e267f&&_0x1e267f['update']({'content':_0x32931d,'attributes':_0x21b050,'isFromAdapter':!0x0});}}),this['listenTo'](_0x35856a,'commentRemoved',(_0x2c10c6,{commentThreadId:_0x120e84,commentId:_0x419694})=>{const _0x514295=_0x59eb88['getCommentThread'](_0x120e84);if(_0x514295){const _0x73250a=_0x514295['getComment'](_0x419694);_0x73250a&&_0x73250a['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x28d1dd);}['destroy'](){if(this['context']instanceof _0x2e2ce6){const _0x492096=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x492096);}}['_terminateService'](_0x35faac){if(!this['_services']['has'](_0x35faac))throw new _0x3a9443('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x35faac});this['_getService'](_0x35faac)['disconnect'](),this['_services']['delete'](_0x35faac);}async['reconnect'](){for(const _0x381093 of this['_services']['keys']())await this['_connectService'](_0x381093);if(this['context']instanceof _0x2e2ce6){const _0x4a25d0=this['context']['config']['get']('collaboration.channelId'),_0x5823c5=this['context']['plugins']['get'](i);_0x5823c5['unregister'](_0x4a25d0);const _0x403a05=await this['_services']['get'](_0x4a25d0)['getConnectedSessions']();_0x5823c5['register'](_0x4a25d0,_0x403a05);}}async['_connectService'](_0x2337c1){const {connection:_0x2eeec3}=this['context']['plugins']['get'](n),_0x289301=this['context']['plugins']['get']('CommentsRepository'),_0x467be9=this['_services']['get'](_0x2337c1),_0x2d5d7c=await _0x467be9['connect'](_0x2eeec3);await this['_fetchMissingUsersForThreads'](_0x2d5d7c);const _0x422d83=new Set(Array['from'](_0x289301['getCommentThreads']({'channelId':_0x2337c1}),_0x141600=>_0x141600['id']));for(const _0x453ca5 of _0x2d5d7c)_0x453ca5['deletedAt']||_0x422d83['delete'](_0x453ca5['commentThreadId']);for(const _0x38ebb6 of _0x422d83)_0x289301['getCommentThread'](_0x38ebb6)['remove']({'isFromAdapter':!0x0});for(const _0x1b47f9 of _0x2d5d7c){let _0x4dddd1=_0x289301['getCommentThread'](_0x1b47f9['commentThreadId']);const {commentThreadId:_0x59d9d8,context:_0x125493,attributes:_0x278300,resolvedBy:_0x4f5dce,resolvedAt:_0x16df85,unlinkedAt:_0x19d5d2,deletedAt:_0x2e5e39}=_0x1b47f9;if(_0x2e5e39)continue;_0x4dddd1||(_0x4dddd1=_0x289301['addCommentThread']({'channelId':_0x2337c1,'threadId':_0x59d9d8,'context':_0x125493,'attributes':_0x278300||{},'resolvedBy':_0x4f5dce,'resolvedAt':_0x16df85,'unlinkedAt':_0x19d5d2,'isFromAdapter':!0x0}));const _0x1c498a=new Set(Array['from'](_0x4dddd1['comments'],_0x21370b=>_0x21370b['id']));for(const _0x220e92 of _0x1b47f9['comments'])_0x1c498a['delete'](_0x220e92['commentId']);for(const _0x3263e2 of _0x1c498a)_0x4dddd1['getComment'](_0x3263e2)['remove']({'isFromAdapter':!0x0});for(const _0xb97983 of _0x1b47f9['comments']){const _0x394726=_0x4dddd1['getComment'](_0xb97983['commentId']);_0x394726?_0x394726['content']!==_0xb97983['content']&&_0x394726['update']({'content':_0xb97983['content'],'isFromAdapter':!0x0}):_0x4dddd1['addComment'](Object['assign'](ot(_0xb97983),{'isFromAdapter':!0x0}));}}}['_getService'](_0xafcb2c){if(!this['_services']['has'](_0xafcb2c))throw new _0x3a9443('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xafcb2c});return this['_services']['get'](_0xafcb2c);}async['_fetchMissingUsersForThreads'](_0x4439da){const _0x4d8a3f=this['context']['plugins']['get'](_0x52815c),{connection:_0x29a421}=this['context']['plugins']['get'](n),_0x5dcb3e=new Set();for(const {resolvedBy:_0x1bb9b1,comments:_0x121a56}of _0x4439da){_0x1bb9b1&&!_0x4d8a3f['getUser'](_0x1bb9b1)&&_0x5dcb3e['add'](_0x1bb9b1);for(const {userId:_0x436b9a}of _0x121a56)_0x4d8a3f['getUser'](_0x436b9a)||_0x5dcb3e['add'](_0x436b9a);}if(0x0===_0x5dcb3e['size'])return;const _0x563325=await ht['getMany'](_0x29a421,Array['from'](_0x5dcb3e));for(const _0x51d19f of _0x563325)_0x4d8a3f['getUser'](_0x51d19f['id'])||_0x4d8a3f['addUser'](_0x51d19f);}}async function tt(_0x27aabb){if('404'!==_0x27aabb['code'])throw _0x27aabb;}function lt(_0x46aad4){if((_0x5eba66=_0x46aad4)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5eba66['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5eba66['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5eba66;throw _0x46aad4;}function ot(_0x1fcb29){return{'threadId':_0x1fcb29['commentThreadId'],'commentId':_0x1fcb29['commentId'],'content':_0x1fcb29['content'],'createdAt':_0x1fcb29['createdAt'],'authorId':_0x1fcb29['userId'],'attributes':_0x1fcb29['attributes']||{}};}class m extends _0x1e5d58{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>it)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3c0af8){super(_0x3c0af8);const _0x28119e=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x28119e);}['init'](){const _0xa6a855=this['editor']['plugins']['get'](n),_0x13d327=this['editor']['plugins']['get']('TrackChangesEditing');return _0x13d327['adapter']={'getSuggestion':async _0x10ecd5=>{await this['_waitForServiceReady']();const _0x391c5f=await this['_trackChangesService']['get'](_0x10ecd5)['catch'](et);return await this['_fetchMissingUsersForThreads']([_0x391c5f]),_0x391c5f;},'addSuggestion':async({id:_0x4724a8,type:_0x213340,data:_0xae4b2d,originalSuggestionId:_0x48501d,attributes:_0x30ef1d})=>{await this['_waitForServiceReady']();const _0x308a68={'id':_0x4724a8,'type':_0x213340,'data':_0xae4b2d,'originalSuggestionId':_0x48501d,'attributes':_0x30ef1d},_0x5ed5ca=await this['_trackChangesService']['add'](_0x4724a8,_0x213340,_0xae4b2d,_0x48501d,_0x30ef1d)['catch'](_0x3f1e6b=>{if(dt(_0x3f1e6b))return new Promise(_0x2875ba=>{this['_bufferedRequests']['set'](_0x4724a8,{'resolve':_0x2875ba,'suggestionData':_0x308a68});});throw _0x3f1e6b;});return this['_bufferedRequests']['delete'](_0x4724a8),_0x5ed5ca;},'updateSuggestion':async(_0xe70309,_0x136fe1)=>{if(await this['_waitForServiceReady'](),'open'!==_0x136fe1['state'])return this['_trackChangesService']['update'](_0xe70309,_0x136fe1)['catch'](et);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x1b63f,_0x574186)=>{_0x13d327['hasSuggestion'](_0x574186['id'])&&(_0x13d327['getSuggestion'](_0x574186['id'])['attributes']=_0x574186['attributes']);}),this['_trackChangesService']['connect'](_0xa6a855['connection'])['then'](_0x5a6047=>(_0xa6a855['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x5a6047)['then'](()=>{for(const _0x3704cc of _0x5a6047){_0x13d327['addSuggestionData'](_0x3704cc)['_saved']=!0x0;}})));}async['reconnect'](){const _0x1fe348=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1f49a8}=this['editor']['plugins']['get'](n),_0x5b7411=await this['_trackChangesService']['connect'](_0x1f49a8);await this['_fetchMissingUsersForThreads'](_0x5b7411);for(const {suggestionData:_0x222ad1,resolve:_0x4dcba7}of this['_bufferedRequests']['values']()){let _0x4063ac=_0x5b7411['find'](_0x219428=>_0x219428['id']===_0x222ad1['id']);_0x4063ac||(_0x4063ac=await this['_trackChangesService']['add'](_0x222ad1['id'],_0x222ad1['type'],_0x222ad1['data'],_0x222ad1['originalSuggestionId'])),_0x4dcba7(_0x4063ac);}for(const _0x3df0d7 of _0x5b7411)_0x1fe348['hasSuggestion'](_0x3df0d7['id'])||_0x1fe348['addSuggestionData'](_0x3df0d7);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x20cd26=>{this['listenTo'](this['_trackChangesService'],'connected',_0x1b8f33=>{_0x1b8f33['off'](),_0x20cd26();});});}async['_fetchMissingUsersForThreads'](_0x2f2bdf){const _0x1337d6=this['editor']['plugins']['get'](_0x52815c),{connection:_0x158cc2}=this['editor']['plugins']['get'](n),_0x4e2d1f=new Set();for(const {authorId:_0x4197f8}of _0x2f2bdf)_0x1337d6['getUser'](_0x4197f8)||_0x4e2d1f['add'](_0x4197f8);if(0x0===_0x4e2d1f['size'])return;const _0xc1ef21=await ht['getMany'](_0x158cc2,Array['from'](_0x4e2d1f));for(const _0x16b050 of _0xc1ef21)_0x1337d6['getUser'](_0x16b050['id'])||_0x1337d6['addUser'](_0x16b050);}}function et(_0x414d20){if(dt(_0x414d20))return new Promise(()=>{});throw _0x414d20;}function dt(_0x2c683e){return _0x2c683e['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2c683e['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1e5d58{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x5af2de=this['editor']['plugins']['get'](n),_0x25cfc8=this['editor']['plugins']['get']('CommentsEditing'),_0x11412c=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x5af2de,'change:state',(_0x56183d,_0x649f6,_0x5ccd39)=>{_0x25cfc8['isThreadsLoadingPaused']='connected'!==_0x5ccd39;});}),this['listenTo'](_0x5af2de,'change:state',(_0x345ce9,_0x66ed41,_0x1a6939)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x1a6939);}),_0x11412c['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class RealTimeCollaborativeTrackChanges extends _0x1e5d58{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x1e5d58{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x5df08f)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x52815c];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41a37b){super(_0x41a37b);const _0x2af571=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x2af571);}async['init'](){const _0x5b2d41=this['editor']['plugins']['get'](l),_0xfb03e5=_0x5b2d41['serverHistory'],_0x5ef1e6=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0xfb03e5,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5b2d41['sessionId']});const _0x1c47f7=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x1c5433=await _0xd9b4ec['isBundleUploaded'](_0x5ef1e6['connection'],_0x1c47f7);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x13833a})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x13833a)),'updateRevisions':async _0x339036=>{await this['_waitForServiceReady']();const _0x700033=this['_revisionTracker']['currentRevision'];if(_0x1c5433&&0x1===_0x339036['length']&&_0x339036[0x0]['id']===_0x700033['id'])return _0x339036;for(const _0x2ad05f of _0x339036)_0x2ad05f['id']===_0x700033['id']&&(_0x2ad05f['isEmptyCurrent']=_0x2ad05f['fromVersion']===_0x2ad05f['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x339036,this['_lastRequestId'])['then'](_0x512da3=>(this['_lastRequestId']=_0x512da3,_0x339036))['catch'](_0x14aab8=>{if(I(_0x14aab8)||'400'===_0x14aab8['code']&&void 0x0!==_0x14aab8['data']['wrongRequestId']){for(const _0x1bf2fd of _0x339036){!this['_revisionTracker']['repository']['getRevision'](_0x1bf2fd['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1bf2fd['id'],_0x1bf2fd,!0x1);}if(I(_0x14aab8))throw _0x14aab8;return _0x339036;}throw _0x14aab8;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x1b13d7,{revisionsData:_0x1b277f,requestId:_0x9b6fff})=>{Math['max'](..._0x1b277f['map'](_0x2290d4=>_0x2290d4['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1b277f,_0x9b6fff);}):this['_handleRevisionsUpdate'](_0x1b277f,_0x9b6fff);});const {revisions:_0x28a499,requestId:_0x1c16b0}=await this['_revisionHistoryService']['connect'](_0x5ef1e6['connection']);_0x5ef1e6['addToReconnectionStack'](this),this['_lastRequestId']=_0x1c16b0,await this['_fetchMissingUsers'](_0x28a499);for(const _0x539852 of _0x28a499)this['_revisionTracker']['addRevisionData'](_0x539852);this['listenTo'](_0x5b2d41,'change:_isConnected',(_0x2b4aae,_0x53384e,_0x555b07)=>{_0x555b07&&(this['_oldOffset']=_0x5b2d41['_offset'],_0x2b4aae['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5ef1e6,'state',_0x4d104f=>_0x4d104f===_0x3d1e25['CONNECTED']);}async['reconnect'](){const _0x34d9d9=this['editor']['plugins']['get'](n),_0x43d42e=this['editor']['plugins']['get'](l),_0x1052a=async()=>{const _0x534bc8=this['_revisionTracker']['currentRevision'],_0x50ba16=_0x534bc8['id'],_0x10a14a=_0x50ba16!==_0x43d42e['sessionId'];if(_0x10a14a){const _0xebc072=_0x43d42e['_offset']-this['_oldOffset'],_0x5e2b98=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x534bc8['toVersion']+_0xebc072!==_0x5e2b98){const _0x592926=_0x534bc8['fromVersion']+_0xebc072,_0x1305a3=this['editor']['plugins']['get'](_0x52815c),_0x4fe56a=this['_revisionTracker']['buildRevisionData']({'revision':_0x534bc8,'from':_0x592926,'to':_0x5e2b98});_0x4fe56a['id']=_0x534bc8['id'];const _0x45f1b4=_0x4fe56a['authorsIds']['map'](_0x2c289e=>_0x1305a3['getUser'](_0x2c289e));_0x534bc8['_update']({..._0x4fe56a,'authors':_0x45f1b4},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x534bc8['id'],_0x4fe56a,!0x0);}this['_revisionTracker']['_startingVersion']=_0x5e2b98,(_0x534bc8['toVersion']===_0x534bc8['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x50ba16)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x50ba16),this['_revisionTracker']['_createCurrentRevision'](_0x5e2b98));}const {revisions:_0x38185b,requestId:_0x35d818}=await this['_revisionHistoryService']['reconnect'](_0x34d9d9['connection'],this['_lastRequestId']);_0x10a14a&&_0x38185b['length']>0x0?_0x43d42e['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x38185b),this['_handleRevisionsUpdate'](_0x38185b,_0x35d818),this['_revisionTracker']['sendBufferedUpdates']());};return _0x43d42e['_isConnected']?_0x1052a():new Promise((_0x3bd418,_0x2465e4)=>{_0x43d42e['once']('change:_isConnected',()=>{_0x1052a()['then'](_0x3bd418)['catch'](_0x2465e4);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x244278=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x46ec70=>{_0x46ec70['off'](),_0x244278();});});}['_getLatestVersionFromServerOperations'](){const _0x458a82=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x295d5b of _0x458a82)if('marker'!==_0x295d5b['type']||_0x295d5b['affectsData'])return _0x295d5b['baseVersion']+0x1;}['_getLatestVersion'](){const _0x3cf938=this['editor']['plugins']['get'](l);return new Promise(_0x172d3f=>{_0x3cf938['_isPendingUpdate']?_0x3cf938['once']('change:_isPendingUpdate',()=>{_0x172d3f(this['_getLatestVersionFromServerOperations']());}):_0x172d3f(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x15df7f,_0x407c98){const _0x57ceee=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x407c98;for(const _0xeca1a5 of _0x15df7f){const _0x45cd96=_0x57ceee['getRevision'](_0xeca1a5['id']);if(_0x45cd96){if((_0xeca1a5['fromVersion']||_0xeca1a5['toVersion'])&&(_0xeca1a5['diffData']=null),_0x45cd96===this['_revisionTracker']['currentRevision']){const _0x176970=Math['max'](_0x45cd96['toVersion'],_0xeca1a5['toVersion']),_0x26d7f7=Math['max'](_0x45cd96['fromVersion'],_0xeca1a5['fromVersion']);let _0x2aa3d8;_0x45cd96['toVersion']===_0xeca1a5['toVersion']&&_0x45cd96['fromVersion']===_0xeca1a5['fromVersion']?(_0x2aa3d8=!0x0,this['_preventResendingRevisionData'](_0xeca1a5)):_0xeca1a5['toVersion']===_0x176970&&_0xeca1a5['fromVersion']===_0x26d7f7?_0x2aa3d8=!0x1:(_0x45cd96['toVersion']===_0x176970&&_0x45cd96['fromVersion']===_0x26d7f7||this['_fixRevision']({'revision':_0x45cd96,'from':_0x26d7f7,'to':_0x176970}),_0x2aa3d8=!0x0),_0x2aa3d8&&(delete _0xeca1a5['fromVersion'],delete _0xeca1a5['toVersion'],delete _0xeca1a5['diffData'],delete _0xeca1a5['createdAt'],delete _0xeca1a5['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0xeca1a5),this['_preventResendingRevisionData'](_0xeca1a5);}else this['_revisionTracker']['addRevisionData'](_0xeca1a5);}const _0xfd943f=_0x57ceee['getRevisions']();_0xfd943f['reverse']();for(let _0x21e45a=0x0;_0x21e45a<_0xfd943f['length']-0x1;_0x21e45a++){const _0x1213ca=_0xfd943f[_0x21e45a],_0xabef84=_0xfd943f[_0x21e45a+0x1];if(_0x1213ca['fromVersion']<_0xabef84['toVersion']){const _0x27fca9=_0xabef84['toVersion'],_0x29af58=Math['max'](_0x27fca9,_0x1213ca['toVersion']);this['_fixRevision']({'revision':_0x1213ca,'from':_0x27fca9,'to':_0x29af58});}}}['_fixRevision']({revision:_0x55e63b,from:_0x30bf42,to:_0x3ae3b2}={}){const _0x3be028=this['editor']['plugins']['get'](_0x52815c),_0x37cf26=this['_revisionTracker']['buildRevisionData']({'revision':_0x55e63b,'from':_0x30bf42,'to':_0x3ae3b2});_0x37cf26['authors']=_0x37cf26['authorsIds']['map'](_0x5c21a3=>_0x3be028['getUser'](_0x5c21a3)),_0x55e63b['_update'](_0x37cf26);}['_preventResendingRevisionData'](_0x499208){const _0xe251ef={};_0xe251ef['id']=_0x499208['id'];for(const _0x21d29a of Object['keys'](_0x499208))'id'!==_0x21d29a&&(_0xe251ef[_0x21d29a]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xe251ef['id'],_0xe251ef,!0x0);}async['_fetchMissingUsers'](_0x192472){const _0x4479e7=this['editor']['plugins']['get'](_0x52815c),{connection:_0x3a9f1a}=this['editor']['plugins']['get'](n),_0x50b418=new Set();for(const _0x24b901 of _0x192472){for(const _0x3171b5 of _0x24b901['authorsIds'])_0x1ca72a(_0x3171b5);_0x24b901['creatorId']&&_0x1ca72a(_0x24b901['creatorId']);}if(0x0===_0x50b418['size'])return;const _0x21df72=await ht['getMany'](_0x3a9f1a,Array['from'](_0x50b418));for(const _0x20e008 of _0x21df72)_0x4479e7['getUser'](_0x20e008['id'])||_0x4479e7['addUser'](_0x20e008);function _0x1ca72a(_0x39c5d2){_0x4479e7['getUser'](_0x39c5d2)||_0x50b418['add'](_0x39c5d2);}}}function I(_0x655675){return _0x655675['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x655675['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x655675['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x1e5d58{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x4bb216{['_collapseAt'];constructor(_0x3921b0,_0x2150dd=0x6){super(_0x3921b0);const _0x5ee958=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x2150dd,this['bind']('isHidden')['to'](this,'usersCount',_0xb39fc3=>_0xb39fc3<_0x2150dd),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x5ee958['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':_0x5ee958['to']('usersCount',_0x5dc172=>'+'+(_0x5dc172-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x4bb216{['items'];['keystrokes'];constructor(_0x10006c){super(_0x10006c);const _0x5be2e1=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x745df6(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x5be2e1['if']('hasPopup'),'aria-expanded':_0x5be2e1['to']('isExpanded',_0x4a77b8=>this['hasPopup']&&String(_0x4a77b8)),'aria-label':_0x5be2e1['to']('hasPopup',_0x324a5b=>V(_0x10006c,_0x324a5b?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x5be2e1['to']('hasPopup',_0x585ec2=>!!_0x585ec2&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x5be2e1['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x5be2e1['to'](_0x3dd659=>{const _0x244ac0=_0x3dd659,_0x11d293=document['querySelector']('.ck-presence-list__dropdown-list'),_0x344182=document['querySelector']('.ck-balloon-panel_with-arrow');_0x11d293?.['contains'](_0x244ac0['relatedTarget'])||_0x344182?.['contains'](_0x244ac0['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x291064,_0xaa83b0,_0x3a4bdc)=>{this['element']&&(_0x3a4bdc?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x4bb216{['counterView'];['inlineListView'];constructor(_0x14dc85,_0x1b440c=0x6){super(_0x14dc85);const _0x3357e9=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x1b440c),this['inlineListView']=new is(_0x14dc85),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4fd228 of this['inlineListView']['items'])_0x4fd228['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',_0x3357e9['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x4bb216{['listWrapperView'];constructor(_0x3799e1,_0x3af22c){super(_0x3799e1);const _0x34e1c7=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x3799e1,_0x3af22c),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x3799e1,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x34e1c7['to'](_0x1fe0eb=>{const _0x4ac30f=_0x1fe0eb,_0x549de7=document['querySelector']('.ck-presence-list__list'),_0x4e457f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x549de7?.['contains'](_0x4ac30f['relatedTarget'])||_0x4e457f?.['contains'](_0x4ac30f['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x3e031c{constructor(_0x2f343d,_0x713886){super(_0x2f343d);const _0x1a54b7=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x713886?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x1a54b7['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x1a54b7['to']('role'),'aria-label':_0x1a54b7['to']('ariaLabel'),'aria-labelledby':_0x1a54b7['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x19a405['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0xe202d8=this['element'];_0xe202d8&&(this['_isScrollable']=Math['max'](_0xe202d8['scrollHeight'],_0xe202d8['clientHeight'])>0.8*window['innerHeight']);}}class j extends st{['userView'];constructor(_0xfef18e,_0x25e8bd,_0x5220b3){super(_0xfef18e);const _0x3e4f1a=this['bindTemplate'];this['userView']=new rt(_0xfef18e,_0x25e8bd);const _0x29fcdc={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x25e8bd['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x25e8bd['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x25e8bd['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x5220b3&&(_0x29fcdc['tag']='button',_0x29fcdc['on']={'click':_0x3e4f1a['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x29fcdc);}['focus'](){this['element']['focus']();}}class A extends _0x4bb216{['userView'];['markerView'];constructor(_0x5e8dcc,_0x298255,_0x5a54ef){super(_0x5e8dcc);const _0x509eed=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new rt(_0x5e8dcc,_0x298255),this['markerView']=new MarkerView(_0x5e8dcc,_0x298255);const _0x2094e2=new at(_0x5e8dcc);_0x2094e2['template']['tag']='span',_0x2094e2['text']=_0x298255['name'];const _0x2ba590={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x509eed['to']('isFocusable',_0x5ecb35=>!!_0x5ecb35&&0x0),'aria-labelledby':_0x2094e2['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x509eed['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x509eed['to']('hasTooltip',_0x54bd92=>!_0x54bd92),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x2094e2]};_0x5a54ef&&(_0x2ba590['tag']='button',_0x2ba590['on']={'click':_0x509eed['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2ba590);}}class MarkerView extends _0x4bb216{constructor(_0x107ea1,_0x1460ee){super(_0x107ea1),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1460ee['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x4067ea{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4f7afa){super(_0x4f7afa),this['context']['config']['define']('presenceList',x);const _0x57ab9c=_0x4f7afa['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x57ab9c)throw new _0x3a9443('presencelist-collapseat-invalid-format',this);if(_0x57ab9c<0x1)throw new _0x3a9443('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x36276b(),this['balloonPanelView']=new _0x2a3eb9(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x51f50c of this['_allConnectedUsers'])this['_handleUserAdd'](_0x51f50c);this['listenTo'](this['_allConnectedUsers'],'add',(_0x12230a,_0x3ba06c)=>{this['_handleUserAdd'](_0x3ba06c);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x573364,_0x15591c)=>{this['_handleUserRemove'](_0x15591c);});}['_createView'](){const _0x55d8da=this['context'],_0x3c9571=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4cc98e=this['balloonPanelView'];if(!_0x15409c(_0x55d8da['config']['get']('presenceList.container')))throw new _0x3a9443('presencelist-missing-container',this);return _0x3c9571['counterView']['bind']('usersCount')['to'](this),_0x3c9571['bind']('isCollapsed')['to'](this,'usersCount',_0x40521f=>{const {collapseAt:_0x10df78}=_0x55d8da['config']['get']('presenceList'),_0x108697=_0x40521f>=_0x10df78;if(_0x108697&&!_0x3c9571['inlineListView']['items']['find'](_0x19dccb=>_0x19dccb instanceof b)){const _0x36d047=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x36d047&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x3c9571['inlineListView']['items']['add'](_0x3c9571['counterView']);}return _0x108697||this['hideDropdown'](),_0x108697;}),_0x3c9571['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x31e043=>{const _0x59a278=_0x55d8da['config']['get']('presenceList'),_0x56fdc5=new A(_0x55d8da['locale'],_0x31e043,!!_0x59a278['onClick']);return _0x56fdc5['bind']('hasTooltip')['to'](_0x3c9571,'isCollapsed',_0x5965f8=>!_0x5965f8),_0x56fdc5['bind']('isFocusable')['to'](_0x3c9571,'isCollapsed',_0x2ccf46=>!_0x2ccf46),_0x59a278['onClick']&&this['listenTo'](_0x56fdc5,'execute',()=>{this['view']['isCollapsed']||_0x59a278['onClick'](_0x31e043,_0x56fdc5['element']);}),_0x56fdc5;}),this['listenTo'](_0x3c9571['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x3c9571['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x3c9571['inlineListView']['keystrokes']['set']('Enter',(_0x1a3788,_0x994ec9)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x994ec9());}),_0x3c9571['render'](),_0x4cc98e['render'](),_0x56d96c({'emitter':_0x3c9571,'activator':()=>_0x4cc98e['isVisible'],'contextElements':[_0x4cc98e['element'],_0x3c9571['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x55d8da['config']['get']('presenceList.container')['appendChild'](_0x3c9571['element']),this['_bodyCollection']=new _0x20e53c(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x3c9571;}['_handleUserAdd'](_0x2df788){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2df788['isMe'])return;const _0x22ebae=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x22ebae-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x941984=_0x2df788['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2df788,_0x941984);}['_handleUserRemove'](_0x51a8da){this['usersCount']--;const {collapseAt:_0x2d431c}=this['context']['config']['get']('presenceList'),_0x306308=this['usersCount']>=_0x2d431c;if(this['currentDisplayedUsers']['get'](_0x51a8da['id']))this['currentDisplayedUsers']['remove'](_0x51a8da['id']);else{if(_0x306308&&this['currentDisplayedUsers']['length']+0x1===_0x2d431c-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x306308?0x1:0x0)<this['usersCount']){for(const _0x4cb044 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x4cb044['id'])&&(this['currentDisplayedUsers']['add'](_0x4cb044,Math['min'](this['currentDisplayedUsers']['length']-(_0x306308?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x306308?0x1:0x0)===_0x2d431c-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x3afe1a=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x3afe1a['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x36d716}=this['presenceDropdownView'];_0x36d716['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5a8a81=>{if(!_0x3afe1a['displayMe']&&_0x5a8a81['isMe'])return null;const _0x523236=new j(this['context']['locale'],_0x5a8a81,!!_0x3afe1a['onClick']);return _0x3afe1a['onClick']&&this['listenTo'](_0x523236,'execute',()=>{_0x3afe1a['onClick'](_0x5a8a81,_0x523236['element']);}),_0x523236;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x36d716['focus'](),_0x36d716['checkIfScrollable']();const _0x258a54=(_0x20b710,_0x2383d7)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x2383d7();};_0x36d716['keystrokes']['set']('Esc',_0x258a54),_0x36d716['keystrokes']['set']('Shift+Tab',_0x258a54),_0x36d716['keystrokes']['set']('Tab',(_0x39893c,_0x198265)=>{!function(_0x1902f2){const _0xce2e23=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xc1add8=>_0xc1add8+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xf1cf59=[...document['body']['querySelectorAll'](_0xce2e23)]['filter'](_0x3b2eb6=>_0x3b2eb6===document['activeElement']||_0x3b2eb6['offsetWidth']+_0x3b2eb6['offsetHeight']>0x0)['sort']((_0x32b23c,_0x178b47)=>(_0x32b23c['tabIndex']||0x0)-(_0x178b47['tabIndex']||0x0)),_0x3b85c4=_0xf1cf59['indexOf'](_0x1902f2),_0x57c773=_0xf1cf59[(_0x3b85c4+0x1)%_0xf1cf59['length']];_0x57c773&&_0x57c773['focus']();}(this['view']['element']),this['hideDropdown'](),_0x198265();}),_0x36d716['focusTracker']['add'](this['view']['element']),_0x36d716['focusTracker']['on']('change:isFocused',(_0x42122e,_0x1e087b,_0x4b0cd7)=>{_0x4b0cd7||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class PresenceList extends _0x4067ea{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0x38fb43,Plugin as _0x1178f7,PendingActions as _0x477f66,Context as _0x8ee687}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x429a99,CKEditorError as _0x138eb8,Collection as _0x505ced,global as _0x439b3d,version as nt,uid as _0x57da16,KeystrokeHandler as _0x5c6d96}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3b6069,View as _0x260788,ListView as _0x1953fa,ListItemView as et,LabelView as it,BalloonPanelView as _0x2b336b,clickOutsideHandler as _0x1b15b6,BodyCollection as _0x11f0a4}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x3b0e83,History as _0x3f7e60,NoOperation as _0x42bd19,InsertOperation as _0x17ca5c,MarkerOperation as _0x5b36d3,RootAttributeOperation as _0x47a098,transformOperationSets as _0x4eaa7b,OperationFactory as _0xc5e8b3}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ot,WEB_SOCKET_GATEWAY_STATES as _0x34396e,CollaborativeEditingService as _0x4aa299,User as rt,CommentsService as _0x17ae11,TrackChangesService as tt,RevisionHistoryService as _0x366578,EditorService as _0x332ed7}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x5d9668,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x3b6f0c}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3c8a9f}from'es-toolkit/compat';class n extends _0x38fb43{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ot)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3b6069];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x571c45){super(_0x571c45),this['set']('state',_0x34396e['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x429a99())();}['init'](){const _0x27f1d6=this['context'],_0x416962=_0x27f1d6['plugins']['get']('CloudServices'),_0x541c0f=_0x27f1d6['plugins']['get'](_0x3b6069);if(!_0x416962['token'])throw new _0x138eb8('websocketgateway-missing-token',this);if(!_0x416962['webSocketUrl'])throw new _0x138eb8('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x416962['token'],_0x416962['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x933fb6=>{if(this['connection']=_0x933fb6,this['bind']('state')['to'](_0x933fb6,'state',this,'_isBrowserOffline',(_0x5b4ffa,_0x408af9)=>('connected'!==_0x5b4ffa&&(this['_shouldPluginsReconnect']=!0x0),_0x408af9||_0x5b4ffa!==_0x34396e['CONNECTED']?_0x34396e['DISCONNECTED']:this['state']==_0x34396e['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x34396e['CONNECTING']):_0x34396e['CONNECTED'])),this['connection']['on']('error',(_0x90344f,_0x41abd2)=>{if('limitExceeded'!==_0x41abd2['code'])throw console['error'](_0x41abd2),new _0x138eb8('cloudservices-init',null,{'originalError':_0x41abd2});_0x541c0f['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'});}),!_0x933fb6['me'])return new Promise(_0x319cc2=>_0x933fb6['on']('change:me',_0x319cc2));})['catch'](_0x214614=>{throw console['error'](_0x214614),new _0x138eb8('cloudservices-init',null,{'originalError':_0x214614});});}['addToReconnectionStack'](_0x5b90d3){if('function'!=typeof _0x5b90d3['reconnect'])throw new _0x138eb8('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5b90d3))throw new _0x138eb8('websocketgateway-plugin-already-registered',this,{'name':_0x5b90d3['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5b90d3);}['removeFromReconnectionStack'](_0x10bc3b){this['_reconnectionStack']['delete'](_0x10bc3b);}['isInReconnectionStack'](_0x594ebb){return this['_reconnectionStack']['has'](_0x594ebb);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1d65a0=>_0x1d65a0['reconnect']())))['then'](()=>this['state']=_0x34396e['CONNECTED'])['catch'](_0x216de5=>{throw console['error'](_0x216de5),new _0x138eb8('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x34396e['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x38fb43{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x5d9668];}constructor(_0x1bbc4f){super(_0x1bbc4f),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x505ced(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5d9668);}['init'](){const _0x479939=this['context']['plugins']['get'](n);this['listenTo'](_0x479939,'change:state',(_0x24424e,_0x41ec61,_0x4c2878)=>{if('connected'!==_0x4c2878)this['channelSessions']['forEach'](_0x2e8584=>_0x2e8584['clear']()),this['channelConnectedUsers']['forEach'](_0x1e8588=>_0x1e8588['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x31ceab,_0x2cf675]of this['_registeredSessions'])for(const _0x114188 of _0x2cf675)this['_handleSessionAdd'](_0x31ceab,_0x114188);}}),this['_createUser'](_0x479939['connection']['me'],!0x0);}['register'](_0x2a4b6a,_0x3b6f0d){if(this['_registeredSessions']['has'](_0x2a4b6a))throw new _0x138eb8('sessions-register-already-registered',null,{'channelId':_0x2a4b6a});this['_registeredSessions']['set'](_0x2a4b6a,_0x3b6f0d),this['channelSessions']['set'](_0x2a4b6a,new _0x505ced()),this['channelConnectedUsers']['set'](_0x2a4b6a,new _0x505ced()),this['listenTo'](_0x3b6f0d,'add',(_0xc960b3,_0x1e2048)=>this['_handleSessionAdd'](_0x2a4b6a,_0x1e2048)),this['listenTo'](_0x3b6f0d,'remove',(_0x33d932,_0x18fbfb)=>this['_handleSessionRemove'](_0x2a4b6a,_0x18fbfb));for(const _0x5da6d2 of _0x3b6f0d)this['_handleSessionAdd'](_0x2a4b6a,_0x5da6d2);}['unregister'](_0x5c3bd3){if(!this['_registeredSessions']['has'](_0x5c3bd3))throw new _0x138eb8('sessions-unregister-not-exist',null,{'channelId':_0x5c3bd3});const _0x208648=this['_registeredSessions']['get'](_0x5c3bd3);this['stopListening'](_0x208648);for(const _0x197fe8 of _0x208648)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x5c3bd3,_0x197fe8);this['_registeredSessions']['delete'](_0x5c3bd3),this['channelSessions']['delete'](_0x5c3bd3),this['channelConnectedUsers']['delete'](_0x5c3bd3);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x5de3d9){for(const _0x45e8ed of this['channelSessions']['values']())for(const _0x42ba5f of _0x45e8ed)if(_0x42ba5f['id']===_0x5de3d9)return _0x42ba5f['user'];}['getUserSessions'](_0x159604,_0x4ddbd2){const _0x1cdbc6=_0x4ddbd2?[this['channelSessions']['get'](_0x4ddbd2)]:this['channelSessions']['values'](),_0x5836df=new Set();for(const _0x3257f8 of _0x1cdbc6)for(const _0x45977f of _0x3257f8)_0x45977f['user']['id']===_0x159604['id']&&_0x5836df['add'](_0x45977f['id']);return _0x5836df;}['getUserRole'](_0x585262){for(const _0x1e977e of this['channelSessions']['values']())for(const _0xeac735 of _0x1e977e)if(_0xeac735['user']===_0x585262)return _0xeac735['role'];}['_handleSessionAdd'](_0x310365,_0x401fe6){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x11b4c2=_0x401fe6['user'],_0x2c83bb=this['_users']['getUser'](_0x11b4c2['id'])||this['_createUser'](_0x11b4c2),_0x1a6e54=Object['assign']({},_0x401fe6,{'user':_0x2c83bb});if(this['channelSessions']['get'](_0x310365)['add'](_0x1a6e54),!_0x11b4c2['hiddenInPresenceList']){const _0x1edd0a=this['channelConnectedUsers']['get'](_0x310365);_0x1edd0a['has'](_0x2c83bb['id'])||_0x1edd0a['add'](_0x2c83bb),this['allConnectedUsers']['has'](_0x2c83bb['id'])||_0x11b4c2['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x2c83bb,_0x2c83bb['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x310365,{'channelId':_0x310365,'session':_0x1a6e54});}['_handleSessionRemove'](_0x378610,_0x18c17b){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x530739=this['channelConnectedUsers']['get'](_0x378610),_0x59a32c=_0x18c17b['user'];_0x59a32c['id']&&(this['channelSessions']['get'](_0x378610)['remove'](_0x18c17b['id']),_0x530739['has'](_0x59a32c['id'])&&!this['getUserSessions'](_0x59a32c,_0x378610)['size']&&_0x530739['remove'](_0x59a32c['id']),this['allConnectedUsers']['get'](_0x59a32c['id'])&&!this['getUserSessions'](_0x59a32c)['size']&&this['allConnectedUsers']['remove'](_0x59a32c['id']));}['_createUser'](_0x32597b,_0x592b00){const _0x3a21d4=this['_users']['addUser'](_0x32597b);return _0x592b00&&this['_users']['defineMe'](_0x32597b['id']),_0x3a21d4['orderNumber']=this['_uniqueUsersCount']++,_0x3a21d4;}}class G extends _0x1178f7{['_domEmitter']=new(_0x429a99())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3fb856=this['editor'],_0x530964=_0x3fb856['plugins']['get'](i);_0x3fb856['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x1e1725,{writer:_0x1bea8b})=>function(_0x446830,_0x378742,_0xf5041f,_0x1aec36){const _0xdb9c47=_0x446830['markerName']['split'](':')[0x2],_0x131087=_0xf5041f['getUserBySessionId'](_0xdb9c47);if(!_0x131087||_0xdb9c47===_0xf5041f['mySessionId'])return;if(!_0x1aec36['model']['schema']['checkChild'](_0x446830['markerRange']['start'],'$text'))return;const _0x3e9efc={'class':'ck-user__marker\x20'+_0x131087['color']['getMarkerClass'](),'data-name':_0x131087['name'],'data-session-id':_0xdb9c47},_0x1e8a02=_0x1aec36['model']['markers']['get'](_0x446830['markerName']),_0x1dedc5=_0x1e8a02['getStart'](),_0x31416c=_0x1dedc5['nodeAfter'],_0x5a96a3=_0x1aec36['model']['schema'];if(_0x31416c&&_0x5a96a3['isObject'](_0x31416c)&&_0x5a96a3['isInline'](_0x31416c)&&!_0x1aec36['model']['markers']['get']('user:range:'+_0xdb9c47)['getRange']()['isCollapsed'])return;const _0x16df7a=_0x1dedc5['parent'];return _0x1aec36['model']['schema']['isLimit'](_0x16df7a)&&!_0x1aec36['model']['hasContent'](_0x16df7a)&&(_0x3e9efc['contenteditable']=!0x1),function(_0x4d281b,_0x1e5fae,_0x4b5c18){const _0x4ad7f6=_0x4d281b['createUIElement']('span',_0x1e5fae);return _0x4d281b['setCustomProperty']('userPositionMarker',!0x0,_0x4ad7f6),_0x4ad7f6['render']=function(_0x4e470e){const _0x21369e=this['toDomElement'](_0x4e470e),_0x161b95=document['createElement']('span');return _0x161b95['classList']['add']('ck-user__marker-tooltip'),_0x161b95['setAttribute']('contenteditable','false'),_0x161b95['setAttribute']('spellcheck','false'),_0x161b95['textContent']=_0x4b5c18['name'],_0x21369e['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x161b95['outerHTML']+'⁠',_0x21369e['addEventListener']('mouseenter',()=>{_0x21369e['classList']['add']('ck-user__marker_hovered');}),_0x21369e['addEventListener']('mouseleave',()=>{_0x21369e['classList']['remove']('ck-user__marker_hovered');}),_0x21369e;},_0x4ad7f6['isSimilar']=function(_0x54907f){return!(!this['getCustomProperty']('userPositionMarker')||!_0x54907f['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x54907f['getAttribute']('data-session-id'));},_0x4ad7f6;}(_0x378742,_0x3e9efc,_0x131087);}(_0x1e1725,_0x1bea8b,_0x530964,_0x3fb856)}),_0x3fb856['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x2503f8=>function(_0xe81e9e,_0x253286){const _0xaa29a0=_0xe81e9e['markerName']['split'](':')[0x2];if(_0xaa29a0===_0x253286['mySessionId'])return null;const _0x3a5696=_0x253286['getUserBySessionId'](_0xaa29a0);if(!_0x3a5696)return{'id':_0xaa29a0,'classes':[]};return{'id':_0xaa29a0,'classes':['ck-user__selection',_0x3a5696['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xaa29a0},'priority':0x7d0+_0x3a5696['orderNumber']};}(_0x2503f8,_0x530964)}),function(_0x588300){const _0x2b7921=_0x588300['model'],_0x22154e=new Map(),_0x457bc0=_0x588300['plugins']['get'](i);_0x2b7921['markers']['on']('update:user:range',(_0x308648,_0x44418f,_0x27a4fb,_0x2367a3)=>{if(!_0x2367a3&&_0x22154e['get'](_0x44418f['name']))return _0x22154e['get'](_0x44418f['name'])['detach'](),void _0x22154e['delete'](_0x44418f['name']);const _0x1cde19=_0x44418f['name']['split'](':')[0x2];if(_0x1cde19===_0x457bc0['mySessionId'])return;const _0x2fb64a='user:position:'+_0x1cde19;_0x2b7921['markers']['has'](_0x2fb64a)&&_0x588300['editing']['reconvertMarker'](_0x2fb64a),_0x44418f['on']('change:range',(_0x247bc2,_0x12ae72,_0x30795)=>{if('$graveyard'!=_0x12ae72['root']['rootName']&&'$graveyard'==_0x44418f['getRange']()['root']['rootName']&&!_0x22154e['has'](_0x44418f['name'])){const _0x10bdb7=_0x2b7921['schema']['getNearestSelectionRange'](_0x30795['deletionPosition']);if(_0x10bdb7){const _0x30cc4c=_0x3b0e83['fromRange'](_0x10bdb7);_0x22154e['set'](_0x44418f['name'],_0x30cc4c),_0x30cc4c['on']('change:range',(_0x46d91b,_0x6aefc5,_0x552431)=>{if('$graveyard'==_0x30cc4c['root']['rootName']){const _0x263241=_0x2b7921['schema']['getNearestSelectionRange'](_0x552431['deletionPosition']);_0x263241?(_0x30cc4c['start']=_0x263241['start'],_0x30cc4c['end']=_0x263241['end']):(_0x22154e['delete'](_0x44418f['name']),_0x30cc4c['detach']());}});}}});}),_0x2b7921['document']['on']('change',()=>{_0x22154e['size']>0x0&&_0x2b7921['enqueueChange']({'isUndoable':!0x1},_0x4201c7=>{for(const [_0x2c2a21,_0x1e56d8]of _0x22154e)'$graveyard'==_0x2b7921['markers']['get'](_0x2c2a21)['getRange']()['root']['rootName']&&(re(_0x2c2a21['split'](':')[0x2],_0x1e56d8['toRange'](),_0x2b7921,_0x4201c7),_0x1e56d8['detach']());_0x22154e['clear']();});});}(_0x3fb856),this['_domEmitter']['listenTo'](_0x439b3d['document'],'keydown',(_0x2bd436,{key:_0x12dd3c})=>{'Escape'===_0x12dd3c&&function(_0x4e2597){_0x4e2597['editing']['view']['change'](_0x48b698=>{for(const _0x23f7dc of _0x4e2597['model']['markers']){if(!_0x23f7dc['name']['startsWith']('user:position'))continue;const _0x31f93b=_0x4e2597['editing']['mapper']['markerNameToElements'](_0x23f7dc['name']);if(_0x31f93b){for(const _0x2f57e7 of _0x31f93b)_0x48b698['removeClass']('ck-user__marker_hovered',_0x2f57e7);}}});}(_0x3fb856);},{'useCapture':!0x0});}['afterInit'](){const _0x5f179f=this['editor'],_0x1db3d7=_0x5f179f['commands']['get']('undo');_0x1db3d7&&_0x5f179f['model']['on']('applyOperation',(_0x596211,_0x26475b)=>{const _0xc100ec=_0x26475b[0x0];if(!_0xc100ec['isDocumentOperation'])return;if('marker'!=_0xc100ec['type']||!_0xc100ec['name']['startsWith']('user:'))return;const _0x4adf2a=_0xc100ec['batch'];_0x1db3d7['_createdBatches']['has'](_0x4adf2a)&&(_0xc100ec['newRange']=_0xc100ec['oldRange']?_0x5f179f['model']['createRange'](_0xc100ec['oldRange']['start'],_0xc100ec['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x404d4e=this['editor'],_0x8e5b6c=_0x404d4e['model']['document'],_0x4fbe1d=_0x404d4e['plugins']['get'](i);_0x404d4e['model']['enqueueChange']({'isUndoable':!0x1},_0xd610bb=>{const _0xb18e58='user:range:'+_0x4fbe1d['mySessionId'],_0x275e58='user:position:'+_0x4fbe1d['mySessionId'],_0x409905=_0x404d4e['model']['markers']['has'](_0xb18e58);_0x404d4e['editing']['view']['hasDomSelection']?re(_0x4fbe1d['mySessionId'],_0x8e5b6c['selection']['getFirstRange'](),_0x404d4e['model'],_0xd610bb):_0x409905&&(_0xd610bb['removeMarker'](_0xb18e58),_0xd610bb['removeMarker'](_0x275e58));});}}function re(_0x3d9c11,_0x2aa8f3,_0x48a46c,_0x18cb72){const _0x2c2c95='user:range:'+_0x3d9c11,_0x383f89='user:position:'+_0x3d9c11,_0x25c5ff=_0x2aa8f3['getContainedElement']();let _0x3b9d43=_0x2aa8f3['start'];if(_0x25c5ff&&_0x25c5ff['is']('element','tableCell')){const _0x20fb77=function(_0x36535c,_0x4774c9){for(const _0x3f4d83 of _0x36535c['getPositions']())if(_0x4774c9['schema']['checkChild'](_0x3f4d83,'$text'))return _0x3f4d83;}(_0x2aa8f3,_0x48a46c);_0x20fb77&&(_0x3b9d43=_0x20fb77,_0x2aa8f3=_0x18cb72['createRange'](_0x3b9d43));}const _0x2771ac=_0x18cb72['createRange'](_0x3b9d43);_0x48a46c['markers']['has'](_0x2c2c95)?(_0x18cb72['updateMarker'](_0x2c2c95,{'range':_0x2aa8f3}),_0x18cb72['updateMarker'](_0x383f89,{'range':_0x2771ac})):(_0x18cb72['addMarker'](_0x2c2c95,{'range':_0x2aa8f3,'usingOperation':!0x0}),_0x18cb72['addMarker'](_0x383f89,{'range':_0x2771ac,'usingOperation':!0x0}));}function $(_0x2fbf49,_0x39d501,_0x62cde2){const _0x366e91=_0x2fbf49['t'],t=_0x2fbf49['t'];switch(_0x39d501){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 _0x366e91({'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'},_0x62cde2);default:return'';}}let Q=0x1;class l extends _0x1178f7{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x4aa299)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x477f66,_0x5d9668,_0x3b6069];}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 _0x496d54=this['serverHistory']['getOperations']();for(let _0x1cfa0d=_0x496d54['length']-0x1;_0x1cfa0d>=0x0;_0x1cfa0d--){const _0x190164=_0x496d54[_0x1cfa0d];if(!this['_disconnectionOperations']['has'](_0x190164))return _0x190164['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x109fe7){if(super(_0x109fe7),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x3f7e60(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x138eb8('collaboration-missing-channelid',this);const _0x4abff9=_0x109fe7['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x4abff9,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x3b6f0c(),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 OperationIdentifier(this['_disconnectionOperations']);}['init'](){const _0x250ef4=this['editor'],_0x8ba856=_0x250ef4['plugins']['get'](_0x5d9668),_0x2f877e=_0x250ef4['plugins']['get'](n);this['listenTo'](_0x8ba856,'getOperationAuthor',(_0x50caca,_0x14cbf7)=>{const _0x372178=_0x14cbf7[0x0];_0x372178['_authorId']&&(_0x50caca['return']=_0x8ba856['getUser'](_0x372178['_authorId']),_0x50caca['stop']()),null===_0x372178['_authorId']&&(_0x50caca['return']=null,_0x50caca['stop']());},{'priority':'high'}),this['listenTo'](_0x250ef4['model']['document']['selection'],'change:range',(_0xf8d251,_0x5366e1)=>{_0x5366e1['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x250ef4['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x250ef4['model']['on']('applyOperation',(_0x3c6181,_0x54d35f)=>{const _0x16b0fd=_0x54d35f[0x0];_0x16b0fd['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x16b0fd),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2f877e,'state',this,'_hasSynchronizationProblem',(_0x12c9d9,_0x58eb47)=>'connected'===_0x12c9d9&&!_0x58eb47),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x250ef4['disableReadOnlyMode']('rtc-offline'):_0x250ef4['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x250ef4['disableReadOnlyMode']('rtc-offline'):_0x250ef4['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x5ef5a9=this['editor']['plugins']['get'](i),_0x1ee0eb=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x5ef5a9['unregister'](this['_channelId']);const _0x1e60b9=await this['_service']['reconnect'](_0x1ee0eb['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x1e60b9)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2b3440=await this['_service']['getConnectedSessions']();_0x5ef5a9['register'](this['_channelId'],_0x2b3440),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x5baefd){if(function(_0x302672){return'404'===_0x302672['code'];}(_0x5baefd)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x19cc1e){return'409'===_0x19cc1e['code'];}(_0x5baefd)){const _0x2881c4=$(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'](_0x2881c4);}else{if(!(_0x5baefd instanceof ReconnectionError))throw _0x5baefd;this['_handleReconnectionError']();}}}}['destroy'](){const _0x189883=this['editor']['plugins']['get'](n),_0x12274d=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x12274d['channelSessions']['has'](this['_channelId'])&&_0x12274d['unregister'](this['_channelId']),_0x189883['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x1db030){if(this['sessionId']!==_0x1db030['sessionId']&&this['_lastSyncedOperationId']!==_0x1db030['lastOperationId'])throw new ReconnectionError();return this['sessionId']=_0x1db030['sessionId'],this['_handleServerResponse']([],{..._0x1db030,'wereChangesApplied':!0x1,'data':_0x1db030['data']},'reconnect');}async['_connectService'](_0x32f47d,_0x2bd8f5=!0x1){const {connection:_0x415285}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x415285,this['_channelId'])['then'](_0x39ec2c=>this['_initSessionsHandling'](_0x39ec2c))['catch'](_0x380663=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x380663);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x2a9d75,_0x2d09ff)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x2d09ff);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x35270b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x32f47d);this['_isPendingUpdate']=!0x0;const _0x3998c9=await this['_service']['connect'](_0x415285,this['_compressOperations'](_0x32f47d),_0x35270b);if(this['sessionId']=_0x3998c9['sessionId'],_0x2bd8f5){if(!_0x3998c9['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3998c9['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x32f47d,_0x3998c9,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3998c9,_0x32f47d);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x51d626=this['editor']['plugins']['get'](i),_0xa0d40=this['editor']['plugins']['get'](G),_0x28d56b=_0x51d626['channelSessions']['get'](this['_channelId']);_0x28d56b&&_0x28d56b['length']>0x1?_0xa0d40['createUserMarkerOperations']():this['listenTo'](_0x51d626,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x51d626['channelSessions']['get'](this['_channelId'])['length']&&_0xa0d40['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x556763,_0x4969a8,_0x1489dc,_0x3b7b07){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x4969a8){const _0x1a367d=this['_decompressOperations'](_0x1489dc,_0x3b7b07);await this['_fetchMissingUsers'](_0x1a367d),this['_handleExternalOperations'](_0x1a367d,_0x4969a8,_0x1489dc['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x244cd2}=this['editor'];let _0x10fca9;try{_0x10fca9=await this['_service']['getDocumentDetails']();}catch{const _0x388086=$(_0x244cd2,'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'](_0x388086);}const _0x2ce69f=_0x10fca9['currentDocumentSession']||_0x10fca9['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x2ce69f['lastOperationId']){const _0x3fa11c=$(_0x244cd2,'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'](_0x3fa11c);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x42d829){const _0x3d413a=this['editor']['plugins']['get'](i);this['listenTo'](_0x3d413a,'sessionAdd:'+this['_channelId'],(_0x25bc19,{session:_0x1a0fd1})=>{if(_0x1a0fd1['id']===_0x3d413a['mySessionId']){_0x25bc19['off']();const _0x36a6e5=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3943de=_0x1a0fd1['permissions'];_0x36a6e5&&_0x36a6e5['isEnabled']&&(_0x3943de=_0x3943de['filter'](_0x37063d=>'document:write'!==_0x37063d)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3943de,this['_channelId']);}}),_0x3d413a['register'](this['_channelId'],_0x42d829);}['_initThrowingOnDataSet'](){const _0x1ac6b4=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x13f5db)=>{if(!_0x13f5db[_0x13f5db['length']-0x1]['suppressErrorInCollaboration'])throw new _0x138eb8('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x1ac6b4['apply'](this['editor']['data'],_0x13f5db);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x1d971f,[_0x41fff5])=>{if(this['_document']['version'])throw new _0x138eb8('realtimecollaborationclient-init-document-already-initialized',this);_0x1d971f['stop'](),this['_setPendingAction']();const _0x576e50=this['editor']['config']['get']('rootsAttributes'),_0x45aad9=this['_getOperationsFromInitData'](_0x41fff5,_0x576e50);0x0==_0x45aad9['length']&&_0x45aad9['push'](new _0x42bd19(0x0)),_0x1d971f['return']=this['_connectService'](_0x45aad9)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x273bdf=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x273bdf))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x35a1ef,[_0x502b96,_0x5b5dd6])=>{_0x35a1ef['stop']();const _0x34b7e4=this['editor']['model']['document']['getRoot'](_0x502b96);if(!this['_knownRootNames']['has'](_0x502b96)){const _0x2008bc=_0x5b5dd6&&_0x5b5dd6['data']?_0x5b5dd6['data']:'',_0x31bcbb=_0x5b5dd6&&_0x5b5dd6['attributes']?_0x5b5dd6['attributes']:{};await this['_loadRoot'](_0x502b96,_0x2008bc,_0x31bcbb);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x34b7e4['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x34b7e4);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x529e44){const _0x5b914e=this['editor']['plugins']['get'](_0x5d9668),{connection:_0x3b2456}=this['editor']['plugins']['get'](n),_0x3a029a=new Set();for(const _0x1ff6ec of _0x529e44){const _0x2bbcbe=_0x1ff6ec['_authorId'];_0x2bbcbe&&!_0x5b914e['getUser'](_0x2bbcbe)&&_0x3a029a['add'](_0x2bbcbe);}if(0x0===_0x3a029a['size'])return;const _0x3ba7e8=await rt['getMany'](_0x3b2456,Array['from'](_0x3a029a));for(const _0x5644f1 of _0x3ba7e8)_0x5b914e['getUser'](_0x5644f1['id'])||_0x5b914e['addUser'](_0x5644f1);}['_getOperationsFromInitData'](_0x320b20,_0x5067b3={}){const _0x1b9d7b=this['editor']['model'],_0x117e4e=[];let _0x4c7338=0x0;const _0x130d00='string'==typeof _0x320b20?{'main':_0x320b20}:_0x320b20;for(const _0x35d7c8 of Object['keys'](_0x130d00)){if(!this['_document']['roots']['has'](_0x35d7c8))throw new _0x138eb8('realtimecollaborationclient-init-non-existent-root',this);const _0x598fb7=this['editor']['data']['parse'](_0x130d00[_0x35d7c8]),_0x1e2230=this['_document']['getRoot'](_0x35d7c8),_0x3a7b43=new _0x17ca5c(_0x1b9d7b['createPositionAt'](_0x1e2230,0x0),_0x598fb7,_0x4c7338++);_0x117e4e['push'](_0x3a7b43);for(const [_0x35e894,_0x4fa1fc]of _0x598fb7['markers']){const _0x38560e=_0x1b9d7b['createRange'](_0x1b9d7b['createPositionFromPath'](_0x1e2230,_0x4fa1fc['start']['path']['slice']()),_0x1b9d7b['createPositionFromPath'](_0x1e2230,_0x4fa1fc['end']['path']['slice']())),_0x5777b7=new _0x5b36d3(_0x35e894,null,_0x38560e,_0x1b9d7b['markers'],!0x0,_0x4c7338++);_0x117e4e['push'](_0x5777b7);}}if(_0x5067b3)for(const [_0x48255a,_0x34961a]of Object['entries'](_0x5067b3)){const _0x23aaa5=_0x1b9d7b['document']['getRoot'](_0x48255a);if(!_0x23aaa5)throw new _0x138eb8('multi-root-editor-root-attributes-no-root',null);for(const [_0x2277cf,_0x3dedc6]of Object['entries'](_0x34961a))if(null!==_0x3dedc6){const _0xcac4e0=new _0x47a098(_0x23aaa5,_0x2277cf,null,_0x3dedc6,_0x4c7338++);_0x117e4e['push'](_0xcac4e0);}}return _0x117e4e;}async['_loadRoot'](_0x353643,_0x2d453a,_0x22c1a3){this['_getOperationsFromInitData']({[_0x353643]:_0x2d453a},{[_0x353643]:_0x22c1a3})['forEach']((_0x22a0e0,_0x4073a3)=>{_0x22a0e0['baseVersion']=this['_document']['version']+_0x4073a3,_0x22a0e0['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x22a0e0);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x3e1129,_0x32c3cc){let _0x1f5c3e;this['_offset']=_0x3e1129['offset'];const _0x25c70e=_0x3e1129['wereChangesApplied']&&!_0x3e1129['initData'],_0x2f014b=_0x25c70e?0x0:_0x3e1129['data']['baseVersion'];if(_0x32c3cc['forEach'](_0x3da5c0=>{_0x3da5c0['_isInit']=!0x0,_0x3da5c0['createdAt']=_0x3e1129['sessionCreatedAt'],_0x3da5c0['_authorId']=null;}),_0x25c70e)_0x1f5c3e=_0x32c3cc,this['_applyOperationsSet'](_0x1f5c3e,_0x25c70e);else{if(_0x3e1129['initData']){const _0x592efa=this['_getOperationsFromInitData'](_0x3e1129['initData']);this['_document']['history']['version']=-_0x592efa['length'],_0x592efa['forEach'](_0x4aad44=>{_0x4aad44['baseVersion']-=_0x592efa['length'],_0x4aad44['createdAt']=_0x3e1129['sessionCreatedAt'],_0x4aad44['_isInit']=!0x0,_0x4aad44['_authorId']=null;}),this['_applyOperationsSet'](_0x592efa,!0x0),this['serverHistory']['version']=-_0x592efa['length']+this['_offset'],this['_updateServerHistory'](_0x592efa);}this['_document']['history']['version']=_0x2f014b,_0x1f5c3e=this['_decompressOperations'](_0x3e1129['data'],_0x3e1129['metadata']),await this['_fetchMissingUsers'](_0x1f5c3e),this['_applyOperationsSet'](_0x1f5c3e,_0x25c70e);}_0x3e1129['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1f5c3e,_0x3e1129['lastOperationId']),this['_lastSyncedOperationId']=_0x3e1129['lastOperationId']),this['serverHistory']['version']=_0x2f014b+this['_offset'],this['_updateServerHistory'](_0x1f5c3e),_0x32c3cc['filter'](_0x25b807=>{const _0x11fdf9=this['_getAffectedRoot'](_0x25b807);return _0x11fdf9&&!this['_knownRootNames']['has'](_0x11fdf9);})['forEach']((_0x2277de,_0xb84cca)=>{_0x2277de['baseVersion']=this['_document']['version']+_0xb84cca,this['_saveOperationInBuffer'](_0x2277de);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x19d095,_0x1acaec){const _0x15ced5=_0x1acaec&&_0x1acaec['message'];if(_0x15ced5&&_0x15ced5['startsWith']('realtimecollaborationclient'))throw _0x1acaec;const _0x4e9ed1=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x4e9ed1['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x138eb8(_0x19d095,this['editor'],_0x15ced5?{'originalError':_0x15ced5}:void 0x0);}['_saveOperationInBuffer'](_0x46d8c0){this['_knownOperations']['has'](_0x46d8c0)||(this['_knownOperations']['add'](_0x46d8c0),this['_bufferedOperations']['push'](_0x46d8c0),this['_pendingAction']||'marker'==_0x46d8c0['type']&&!_0x46d8c0['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3c333e=!0x1){!_0x3c333e&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4be5d6=>{_0x4be5d6&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x184df4=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x4a0e2b){return _0x4a0e2b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4a0e2b['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x4a0e2b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x184df4)||this['_crash'](_0x184df4['message'],_0x184df4);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x29abfa=>{this['on']('change:_isPendingUpdate',()=>{_0x29abfa();});});}async['_sendBufferedOperations'](){const _0x4a7c11=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x4a7c11['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x5cb1a3=[...this['_bufferedOperations']];for(const _0x3a9c60 of _0x5cb1a3)_0x3a9c60['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3a9c60);const _0x5e5a3b=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x5cb1a3),_0x345f4c=Q++,_0x5be54f=this['_compressOperations'](_0x5cb1a3),_0x3ff0e4=await this['_service']['sendOperations'](_0x5be54f,_0x5be54f['baseVersion'],_0x5e5a3b);try{return await this['_handleServerResponse'](_0x5cb1a3,_0x3ff0e4,_0x345f4c);}catch(_0x425735){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x425735);}}async['_handleServerResponse'](_0x23f8a1,_0x329f18,_0x36b7f5){if('error'in _0x329f18)throw _0x329f18['error'];let _0x2c4166=!0x1;if(_0x329f18['wereChangesApplied']){_0x329f18['lastOperationId']&&(this['_lastSyncedOperationId']=_0x329f18['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1ec746=>!_0x23f8a1['includes'](_0x1ec746));for(const _0x5edbe2 of _0x23f8a1)_0x5edbe2['createdAt']='lastOperationAcceptedAt'in _0x329f18&&_0x329f18['lastOperationAcceptedAt']||void 0x0;X(_0x23f8a1,_0x329f18['version']-_0x23f8a1['length']),this['_updateServerHistory'](_0x23f8a1);const _0x59d977=_0x23f8a1['filter'](_0x121e46=>{if(!_0x121e46['_isInit'])return!0x1;const _0x45915b=this['_getAffectedRoot'](_0x121e46);return _0x45915b&&!this['_knownRootNames']['has'](_0x45915b);});X(_0x59d977,this['_document']['version']),this['_applyOperationsSet'](_0x59d977),_0x2c4166=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x44a952=this['_decompressOperations'](_0x329f18['data'],_0x329f18['metadata'])['filter'](_0x4fd408=>_0x4fd408['baseVersion']>=this['_lastServerVersion']);_0x44a952['forEach'](_0x96e8cb=>this['_addKnownRoot'](_0x96e8cb)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x553aac=>!_0x553aac['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x553aac))),this['_bufferedOperations']['length']&&X(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x44a952),_0x2c4166=this['_handleExternalOperations'](_0x44a952,_0x329f18['version'],_0x329f18['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x2c4166?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x3779bf,_0x318c15,_0x506cff){try{const _0x3d382b={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x2563fb,operationsB:_0x391588,originalOperations:_0x329e6a}=_0x4eaa7b(_0x3779bf,this['_bufferedOperations'],_0x3d382b);X(_0x2563fb,this['_document']['version']),X(_0x391588,_0x318c15);for(const _0x3ca111 of _0x2563fb){const _0x190aa2=_0x329e6a['get'](_0x3ca111);_0x3ca111['_authorId']=_0x190aa2?_0x190aa2['_authorId']:null;}_0x506cff&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x3779bf,_0x506cff),this['_lastSyncedOperationId']=_0x506cff),this['_bufferedOperations']=[..._0x391588],this['_applyOperationsSet'](_0x2563fb),this['_updateServerHistory'](_0x3779bf);}catch(_0x32e6cb){return console['error'](_0x32e6cb),!0x1;}return!0x0;}['_applyOperationsSet'](_0x183a90,_0x1155ba=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0xc45404=>{for(const _0x49f898 of _0x183a90)this['_knownOperations']['add'](_0x49f898),this['_addKnownRoot'](_0x49f898),_0xc45404['batch']['addOperation'](_0x49f898),this['editor']['model']['applyOperation'](_0x49f898);});}['_addKnownRoot'](_0x5cc1dd){const _0x3afeeb=this['_getAffectedRoot'](_0x5cc1dd);_0x3afeeb&&this['_knownRootNames']['add'](_0x3afeeb);}['_getAffectedRoot'](_0x325375){let _0xd233f2,_0x14eff1;switch(_0x325375['type']){case'insert':_0xd233f2=_0x325375['position']['root'];break;case'marker':if(_0x14eff1=_0x325375['newRange'],!_0x14eff1)return null;_0xd233f2=_0x14eff1['root'];break;case'addRootAttribute':_0xd233f2=_0x325375['root'];break;case'addRoot':_0xd233f2=_0x325375['affectedSelectable'];break;case'move':_0xd233f2=_0x325375['targetPosition']['root'];break;default:return null;}return _0xd233f2['rootName'];}['_updateServerHistory'](_0x19b7cc){_0x19b7cc['forEach'](_0x425c25=>{const _0x1cc394=_0x425c25['clone']();_0x1cc394['_authorId']=_0x425c25['_authorId'],_0x1cc394['_isInit']=!!_0x425c25['_isInit'],_0x1cc394['createdAt']=_0x425c25['createdAt'],_0x1cc394['baseVersion']+=this['_offset'],_0x425c25['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x1cc394),this['serverHistory']['addOperation'](_0x1cc394);});}['_handleReconnectionError'](_0x1672f5){const _0x83c180=this['editor']['plugins']['get']('Notification'),_0x1c146b=this['editor']['locale'];_0x1672f5||(_0x1672f5=$(_0x1c146b,'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.')),_0x83c180['showWarning'](_0x1672f5,{'title':$(_0x1c146b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x477f66)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x477f66)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x18e7a0){const _0x157f62=_0x18e7a0['map'](_0x3b267c=>_0x3b267c['toJSON']());return this['_compressor']['compress'](_0x157f62);}['_decompressOperations'](_0x4d2960,_0x54ef68){return this['_compressor']['decompress'](_0x4d2960)['map']((_0x1b292c,_0xb9a8fc)=>{const _0x55cbfc='init'==_0x54ef68[_0xb9a8fc]['type'];if('InsertOperation'==_0x1b292c['__className']){const _0x423f25=_0x1b292c['position']['root'];!this['_document']['getRoot'](_0x423f25)&&(this['_document']['createRoot']('$root',_0x423f25)['_isAttached']=!0x1);}const _0x21368b=_0xc5e8b3['fromJSON'](_0x1b292c,this['_document']);return _0x21368b['wasUndone']=_0x1b292c['wasUndone'],_0x21368b['_isInit']=_0x55cbfc,_0x21368b['_authorId']=_0x55cbfc?null:_0x54ef68[_0xb9a8fc]['userId'],_0x21368b['_isDisconnection']='cs:removeUser'===_0x54ef68[_0xb9a8fc]['type'],_0x21368b['createdAt']=_0x54ef68[_0xb9a8fc]['createdAt'],_0x21368b;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0xda53c4=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0xda53c4&&_0xda53c4['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class ReconnectionError extends Error{}function X(_0x30e9c5,_0x5eb5cd){for(const _0x4254a1 of _0x30e9c5)_0x4254a1['baseVersion']=_0x5eb5cd++;}class OperationIdentifier{['_ignoredOperations'];['_operationToId'];constructor(_0x32c0c2){this['_ignoredOperations']=_0x32c0c2,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x1e2b81){let _0x1a9641=_0x1e2b81['length'];for(;_0x1a9641--;){const _0x3140a0=_0x1e2b81[_0x1a9641];if(!this['_ignoredOperations']['has'](_0x3140a0)){if(!this['_operationToId']['has'](_0x3140a0)){const _0x2a7c46=_0x57da16()['slice'](0x1,0x12);this['_operationToId']['set'](_0x3140a0,_0x2a7c46);}return this['_operationToId']['get'](_0x3140a0);}}}['setIdForTheLastOperation'](_0x3f9fd1,_0xda224e){if(!_0xda224e)return;let _0x13c393=_0x3f9fd1['length'];for(;_0x13c393--;){const _0x2e9bfc=_0x3f9fd1[_0x13c393];this['_ignoredOperations']['has'](_0x2e9bfc)||this['_operationToId']['set'](_0x2e9bfc,_0xda224e);}}}class a extends _0x1178f7{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x38fb43{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x17ae11)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x5d9668];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x13e5cd){super(_0x13e5cd),this['_services']=new Map();}async['init'](){const _0x49a5ad=this['context'],_0x2bc3c5=_0x49a5ad['plugins']['get']('CommentsRepository');if(_0x49a5ad['plugins']['get'](n)['addToReconnectionStack'](this),_0x2bc3c5['adapter']={'addCommentThread':async({channelId:_0x5c02fe,threadId:_0x2d3168,comments:_0x598380,resolvedAt:_0x491b97,resolvedBy:_0x579fd4,context:_0x5db092,attributes:_0x19c09c})=>{const _0x4d9614=await this['_getService'](_0x5c02fe)['addCommentThread']({'commentThreadId':_0x2d3168,'comments':_0x598380['map'](_0x412117=>function(_0x4a4194,_0x435185,_0x438de6){return{'commentThreadId':_0x438de6,'commentId':_0x4a4194['commentId'],'userId':_0x4a4194['authorId'],'content':_0x4a4194['content'],'documentId':_0x435185,'createdAt':_0x4a4194['createdAt'],'attributes':_0x4a4194['attributes']||{}};}(_0x412117,_0x5c02fe,_0x2d3168)),'resolvedAt':_0x491b97,'resolvedBy':_0x579fd4,'context':_0x5db092,'attributes':_0x19c09c})['catch'](at);return{'threadId':_0x4d9614['commentThreadId'],'comments':_0x4d9614['comments']};},'getCommentThread':async({channelId:_0x2630f7,threadId:_0x10d1cb})=>{const _0x17ada5=await this['_getService'](_0x2630f7)['getCommentThread'](_0x10d1cb)['catch'](F)['catch'](at);return _0x17ada5?_0x17ada5['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x17ada5]),{'threadId':_0x17ada5['commentThreadId'],'comments':_0x17ada5['comments']['map'](S),'context':_0x17ada5['context'],'resolvedAt':_0x17ada5['resolvedAt'],'resolvedBy':_0x17ada5['resolvedBy'],'attributes':_0x17ada5['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x56d48e,threadId:_0x5a2485,context:_0x179570,unlinkedAt:_0x37ffca,attributes:_0x23afa0})=>this['_getService'](_0x56d48e)['updateCommentThread']({'commentThreadId':_0x5a2485,'context':_0x179570,'attributes':_0x23afa0,'unlinkedAt':_0x37ffca})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x34dec0,threadId:_0x3edf65})=>{const _0xf61d77=await this['_getService'](_0x34dec0)['resolveCommentThread'](_0x3edf65)['catch'](F)['catch'](at);return{'threadId':_0xf61d77['commentThreadId'],'resolvedAt':_0xf61d77['resolvedAt'],'resolvedBy':_0xf61d77['resolvedBy']};},'reopenCommentThread':async({channelId:_0x58e8a9,threadId:_0x187e40})=>this['_getService'](_0x58e8a9)['reopenCommentThread'](_0x187e40)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0x33d1a0,threadId:_0x17d03f})=>this['_getService'](_0x33d1a0)['removeCommentThread'](_0x17d03f)['catch'](F)['catch'](at),'addComment':({channelId:_0x572976,threadId:_0x379621,commentId:_0x2ca90a,content:_0x16eae0,attributes:_0x3da434})=>this['_getService'](_0x572976)['addComment'](_0x379621,_0x2ca90a,_0x16eae0,_0x3da434)['catch'](at),'updateComment':({channelId:_0x41d31e,threadId:_0x118389,commentId:_0x3525f2,content:_0x51dc34,attributes:_0x8cf56c})=>this['_getService'](_0x41d31e)['updateComment'](_0x118389,_0x3525f2,_0x51dc34,_0x8cf56c)['catch'](F)['catch'](at),'removeComment':({channelId:_0x2ead83,threadId:_0x39c0ff,commentId:_0x2dffce})=>this['_getService'](_0x2ead83)['removeComment'](_0x39c0ff,_0x2dffce)['catch'](F)['catch'](at)},_0x49a5ad instanceof _0x8ee687){const _0x4f9195=_0x49a5ad['config']['get']('collaboration.channelId'),_0x21b23b=_0x49a5ad['plugins']['get'](i);await this['_setUpService'](_0x4f9195);const _0xb0f426=await this['_services']['get'](_0x4f9195)['getConnectedSessions']();this['listenTo'](_0x21b23b,'sessionAdd:'+_0x4f9195,(_0x322db2,{session:_0x58bb0a})=>{_0x58bb0a['id']===_0x21b23b['mySessionId']&&(_0x322db2['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x58bb0a['permissions'],_0x4f9195));}),_0x21b23b['register'](_0x4f9195,_0xb0f426);}}async['_setUpService'](_0x4521d3){if(this['_services']['has'](_0x4521d3))throw new _0x138eb8('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4521d3});const _0x5eed65=this['context']['plugins']['get']('CommentsRepository'),_0x592115=new s['CommentsService'](_0x4521d3);this['_services']['set'](_0x4521d3,_0x592115),this['listenTo'](_0x592115,'commentThreadAdded',(_0x37742a,_0xc9f158)=>{const {commentThreadId:_0x23dafc,documentId:_0x350801,context:_0x4c18e0,attributes:_0x388be6,resolvedAt:_0x391b80,resolvedBy:_0x5f28dc,comments:_0x5eb94e}=_0xc9f158;_0x5eed65['getCommentThread'](_0x23dafc)||_0x5eed65['addCommentThread']({'threadId':_0x23dafc,'channelId':_0x350801,'comments':_0x5eb94e?_0x5eb94e['map'](S):[],'context':_0x4c18e0,'attributes':_0x388be6,'resolvedAt':_0x391b80,'resolvedBy':_0x5f28dc,'isFromAdapter':!0x0});}),this['listenTo'](_0x592115,'commentThreadUpdated',(_0x4e6cdf,{commentThreadId:_0x419de7,documentId:_0x375444,context:_0x5ab033,unlinkedAt:_0x2e0a21,attributes:_0x103bcc})=>{_0x5eed65['getCommentThread'](_0x419de7)&&_0x5eed65['updateCommentThread']({'threadId':_0x419de7,'channelId':_0x375444,'context':_0x5ab033,'unlinkedAt':_0x2e0a21,'attributes':_0x103bcc,'isFromAdapter':!0x0});}),this['listenTo'](_0x592115,'commentThreadResolved',(_0x27bc71,{commentThreadId:_0x447c0a,resolvedBy:_0x5dccf6,resolvedAt:_0x3eb5fc})=>{const _0x13e57c=_0x5eed65['getCommentThread'](_0x447c0a);_0x13e57c&&_0x13e57c['resolve']({'resolvedBy':_0x5dccf6,'resolvedAt':_0x3eb5fc,'isFromAdapter':!0x0});}),this['listenTo'](_0x592115,'commentThreadReopened',(_0x11cef4,{commentThreadId:_0x1baef2})=>{const _0x567062=_0x5eed65['getCommentThread'](_0x1baef2);_0x567062&&_0x567062['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x592115,'commentThreadRemoved',(_0x61dd81,{commentThreadId:_0x361c37})=>{const _0xcf0a24=_0x5eed65['getCommentThread'](_0x361c37);_0xcf0a24&&_0xcf0a24['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x592115,'commentAdded',(_0x21e469,_0x2599e2)=>{const _0x10fe69=_0x2599e2['commentThreadId'],_0x42b570=_0x5eed65['getCommentThread'](_0x10fe69);_0x42b570&&_0x42b570['addComment']({...S(_0x2599e2),'isFromAdapter':!0x0});}),this['listenTo'](_0x592115,'commentUpdated',(_0x56d683,{commentThreadId:_0x506572,commentId:_0x57c7a4,content:_0xfc9909,attributes:_0x360a1b})=>{const _0x2d7601=_0x5eed65['getCommentThread'](_0x506572);if(_0x2d7601){const _0x305b21=_0x2d7601['getComment'](_0x57c7a4);_0x305b21&&_0x305b21['update']({'content':_0xfc9909,'attributes':_0x360a1b,'isFromAdapter':!0x0});}}),this['listenTo'](_0x592115,'commentRemoved',(_0x224540,{commentThreadId:_0x2692b4,commentId:_0x238e69})=>{const _0x495fcd=_0x5eed65['getCommentThread'](_0x2692b4);if(_0x495fcd){const _0x246f68=_0x495fcd['getComment'](_0x238e69);_0x246f68&&_0x246f68['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4521d3);}['destroy'](){if(this['context']instanceof _0x8ee687){const _0x2f6c2b=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x2f6c2b);}}['_terminateService'](_0x227a06){if(!this['_services']['has'](_0x227a06))throw new _0x138eb8('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x227a06});this['_getService'](_0x227a06)['disconnect'](),this['_services']['delete'](_0x227a06);}async['reconnect'](){for(const _0x4a4990 of this['_services']['keys']())await this['_connectService'](_0x4a4990);if(this['context']instanceof _0x8ee687){const _0x551c54=this['context']['config']['get']('collaboration.channelId'),_0x1d5c67=this['context']['plugins']['get'](i);_0x1d5c67['unregister'](_0x551c54);const _0x296be1=await this['_services']['get'](_0x551c54)['getConnectedSessions']();_0x1d5c67['register'](_0x551c54,_0x296be1);}}async['_connectService'](_0x263ca9){const {connection:_0x149509}=this['context']['plugins']['get'](n),_0x32c57d=this['context']['plugins']['get']('CommentsRepository'),_0x36041a=this['_services']['get'](_0x263ca9),_0x180c66=await _0x36041a['connect'](_0x149509);await this['_fetchMissingUsersForThreads'](_0x180c66);const _0x211615=new Set(Array['from'](_0x32c57d['getCommentThreads']({'channelId':_0x263ca9}),_0x59392a=>_0x59392a['id']));for(const _0x11e64a of _0x180c66)_0x11e64a['deletedAt']||_0x211615['delete'](_0x11e64a['commentThreadId']);for(const _0x210f47 of _0x211615)_0x32c57d['getCommentThread'](_0x210f47)['remove']({'isFromAdapter':!0x0});for(const _0x49de5c of _0x180c66){let _0x31f803=_0x32c57d['getCommentThread'](_0x49de5c['commentThreadId']);const {commentThreadId:_0x1eeddd,context:_0x56e29a,attributes:_0x5d0b56,resolvedBy:_0x55e2a4,resolvedAt:_0x250a9a,unlinkedAt:_0x5ac4a1,deletedAt:_0x2cea27}=_0x49de5c;if(_0x2cea27)continue;_0x31f803||(_0x31f803=_0x32c57d['addCommentThread']({'channelId':_0x263ca9,'threadId':_0x1eeddd,'context':_0x56e29a,'attributes':_0x5d0b56||{},'resolvedBy':_0x55e2a4,'resolvedAt':_0x250a9a,'unlinkedAt':_0x5ac4a1,'isFromAdapter':!0x0}));const _0x1b3705=new Set(Array['from'](_0x31f803['comments'],_0x4fe8b8=>_0x4fe8b8['id']));for(const _0x22e8a1 of _0x49de5c['comments'])_0x1b3705['delete'](_0x22e8a1['commentId']);for(const _0x47f00e of _0x1b3705)_0x31f803['getComment'](_0x47f00e)['remove']({'isFromAdapter':!0x0});for(const _0x50dbbb of _0x49de5c['comments']){const _0x222df1=_0x31f803['getComment'](_0x50dbbb['commentId']);_0x222df1?_0x222df1['content']!==_0x50dbbb['content']&&_0x222df1['update']({'content':_0x50dbbb['content'],'isFromAdapter':!0x0}):_0x31f803['addComment'](Object['assign'](S(_0x50dbbb),{'isFromAdapter':!0x0}));}}}['_getService'](_0x11e698){if(!this['_services']['has'](_0x11e698))throw new _0x138eb8('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x11e698});return this['_services']['get'](_0x11e698);}async['_fetchMissingUsersForThreads'](_0xcaedb0){const _0x228f2b=this['context']['plugins']['get'](_0x5d9668),{connection:_0x5bc7bc}=this['context']['plugins']['get'](n),_0x38a5a7=new Set();for(const {resolvedBy:_0x241b4b,comments:_0x17bbce}of _0xcaedb0){_0x241b4b&&!_0x228f2b['getUser'](_0x241b4b)&&_0x38a5a7['add'](_0x241b4b);for(const {userId:_0x37bc16}of _0x17bbce)_0x228f2b['getUser'](_0x37bc16)||_0x38a5a7['add'](_0x37bc16);}if(0x0===_0x38a5a7['size'])return;const _0x394bc1=await rt['getMany'](_0x5bc7bc,Array['from'](_0x38a5a7));for(const _0x15eda4 of _0x394bc1)_0x228f2b['getUser'](_0x15eda4['id'])||_0x228f2b['addUser'](_0x15eda4);}}async function F(_0xd99f7f){if('404'!==_0xd99f7f['code'])throw _0xd99f7f;}function at(_0x1814c8){if((_0x267106=_0x1814c8)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x267106['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x267106['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x267106;throw _0x1814c8;}function S(_0x4fe8ea){return{'threadId':_0x4fe8ea['commentThreadId'],'commentId':_0x4fe8ea['commentId'],'content':_0x4fe8ea['content'],'createdAt':_0x4fe8ea['createdAt'],'authorId':_0x4fe8ea['userId'],'attributes':_0x4fe8ea['attributes']||{}};}class m extends _0x1178f7{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x57fa84){super(_0x57fa84);const _0x1f3868=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x1f3868);}['init'](){const _0x41661d=this['editor']['plugins']['get'](n),_0x3e323e=this['editor']['plugins']['get']('TrackChangesEditing');return _0x3e323e['adapter']={'getSuggestion':async _0x10b628=>{await this['_waitForServiceReady']();const _0x49246b=await this['_trackChangesService']['get'](_0x10b628)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0x49246b]),_0x49246b;},'addSuggestion':async({id:_0x45aa3b,type:_0xcf8dec,data:_0x405f07,originalSuggestionId:_0xe59725,attributes:_0x1cecba})=>{await this['_waitForServiceReady']();const _0x311737={'id':_0x45aa3b,'type':_0xcf8dec,'data':_0x405f07,'originalSuggestionId':_0xe59725,'attributes':_0x1cecba},_0x572eb8=await this['_trackChangesService']['add'](_0x45aa3b,_0xcf8dec,_0x405f07,_0xe59725,_0x1cecba)['catch'](_0x22bf67=>{if(ct(_0x22bf67))return new Promise(_0x1b5fa1=>{this['_bufferedRequests']['set'](_0x45aa3b,{'resolve':_0x1b5fa1,'suggestionData':_0x311737});});throw _0x22bf67;});return this['_bufferedRequests']['delete'](_0x45aa3b),_0x572eb8;},'updateSuggestion':async(_0x141c0b,_0x181a81)=>{if(await this['_waitForServiceReady'](),'open'!==_0x181a81['state'])return this['_trackChangesService']['update'](_0x141c0b,_0x181a81)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x3f2962,_0x342c4d)=>{_0x3e323e['hasSuggestion'](_0x342c4d['id'])&&(_0x3e323e['getSuggestion'](_0x342c4d['id'])['attributes']=_0x342c4d['attributes']);}),this['_trackChangesService']['connect'](_0x41661d['connection'])['then'](_0x4bda62=>(_0x41661d['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x4bda62)['then'](()=>{for(const _0x37511c of _0x4bda62){_0x3e323e['addSuggestionData'](_0x37511c)['_saved']=!0x0;}})));}async['reconnect'](){const _0xb57911=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x44b25f}=this['editor']['plugins']['get'](n),_0x400709=await this['_trackChangesService']['connect'](_0x44b25f);await this['_fetchMissingUsersForThreads'](_0x400709);for(const {suggestionData:_0x1da75f,resolve:_0x2aa006}of this['_bufferedRequests']['values']()){let _0x58c2c5=_0x400709['find'](_0x5a39b6=>_0x5a39b6['id']===_0x1da75f['id']);_0x58c2c5||(_0x58c2c5=await this['_trackChangesService']['add'](_0x1da75f['id'],_0x1da75f['type'],_0x1da75f['data'],_0x1da75f['originalSuggestionId'])),_0x2aa006(_0x58c2c5);}for(const _0x21fdf5 of _0x400709)_0xb57911['hasSuggestion'](_0x21fdf5['id'])||_0xb57911['addSuggestionData'](_0x21fdf5);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x5365d5=>{this['listenTo'](this['_trackChangesService'],'connected',_0x16068d=>{_0x16068d['off'](),_0x5365d5();});});}async['_fetchMissingUsersForThreads'](_0x3a5c0f){const _0x3669f4=this['editor']['plugins']['get'](_0x5d9668),{connection:_0x205a20}=this['editor']['plugins']['get'](n),_0x284fa5=new Set();for(const {authorId:_0x39705c}of _0x3a5c0f)_0x3669f4['getUser'](_0x39705c)||_0x284fa5['add'](_0x39705c);if(0x0===_0x284fa5['size'])return;const _0x4a2ba0=await rt['getMany'](_0x205a20,Array['from'](_0x284fa5));for(const _0x1cc49f of _0x4a2ba0)_0x3669f4['getUser'](_0x1cc49f['id'])||_0x3669f4['addUser'](_0x1cc49f);}}function k(_0x49e51a){if(ct(_0x49e51a))return new Promise(()=>{});throw _0x49e51a;}function ct(_0x234e6f){return _0x234e6f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x234e6f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1178f7{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3c4593=this['editor']['plugins']['get'](n),_0x189fd4=this['editor']['plugins']['get']('CommentsEditing'),_0x2f02b5=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3c4593,'change:state',(_0xace7cc,_0x1e663f,_0x5a8b72)=>{_0x189fd4['isThreadsLoadingPaused']='connected'!==_0x5a8b72;});}),this['listenTo'](_0x3c4593,'change:state',(_0x5ed47a,_0x463f0e,_0x4c88e2)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x4c88e2);}),_0x2f02b5['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class RealTimeCollaborativeTrackChanges extends _0x1178f7{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x1178f7{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x366578)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x5d9668];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x30dede){super(_0x30dede);const _0x5648e2=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x5648e2);}async['init'](){const _0x165afb=this['editor']['plugins']['get'](l),_0x182cf4=_0x165afb['serverHistory'],_0x309add=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x182cf4,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x165afb['sessionId']});const _0x472b8c=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0xf4c6d6=await _0x332ed7['isBundleUploaded'](_0x309add['connection'],_0x472b8c);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x28bc27})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x28bc27)),'updateRevisions':async _0x4d39f1=>{await this['_waitForServiceReady']();const _0x4b310b=this['_revisionTracker']['currentRevision'];if(_0xf4c6d6&&0x1===_0x4d39f1['length']&&_0x4d39f1[0x0]['id']===_0x4b310b['id'])return _0x4d39f1;for(const _0x11361c of _0x4d39f1)_0x11361c['id']===_0x4b310b['id']&&(_0x11361c['isEmptyCurrent']=_0x11361c['fromVersion']===_0x11361c['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x4d39f1,this['_lastRequestId'])['then'](_0x36862d=>(this['_lastRequestId']=_0x36862d,_0x4d39f1))['catch'](_0x35d00a=>{if(q(_0x35d00a)||'400'===_0x35d00a['code']&&void 0x0!==_0x35d00a['data']['wrongRequestId']){for(const _0x37a5c2 of _0x4d39f1){!this['_revisionTracker']['repository']['getRevision'](_0x37a5c2['id'])||this['_revisionTracker']['_bufferUpdate'](_0x37a5c2['id'],_0x37a5c2,!0x1);}if(q(_0x35d00a))throw _0x35d00a;return _0x4d39f1;}throw _0x35d00a;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x3202fd,{revisionsData:_0x159708,requestId:_0x416891})=>{Math['max'](..._0x159708['map'](_0x3ef8ae=>_0x3ef8ae['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x159708,_0x416891);}):this['_handleRevisionsUpdate'](_0x159708,_0x416891);});const {revisions:_0x1f6c66,requestId:_0x248d0d}=await this['_revisionHistoryService']['connect'](_0x309add['connection']);_0x309add['addToReconnectionStack'](this),this['_lastRequestId']=_0x248d0d,await this['_fetchMissingUsers'](_0x1f6c66);for(const _0x46406a of _0x1f6c66)this['_revisionTracker']['addRevisionData'](_0x46406a);this['listenTo'](_0x165afb,'change:_isConnected',(_0x3420ca,_0x11c8cf,_0x20a0d0)=>{_0x20a0d0&&(this['_oldOffset']=_0x165afb['_offset'],_0x3420ca['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x309add,'state',_0x514d62=>_0x514d62===_0x34396e['CONNECTED']);}async['reconnect'](){const _0x49f870=this['editor']['plugins']['get'](n),_0x27af14=this['editor']['plugins']['get'](l),_0x323168=async()=>{const _0x2d1f93=this['_revisionTracker']['currentRevision'],_0x4bb6a0=_0x2d1f93['id'],_0x4ba31c=_0x4bb6a0!==_0x27af14['sessionId'];if(_0x4ba31c){const _0x3ab54e=_0x27af14['_offset']-this['_oldOffset'],_0xff6b90=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2d1f93['toVersion']+_0x3ab54e!==_0xff6b90){const _0x26a906=_0x2d1f93['fromVersion']+_0x3ab54e,_0x69c619=this['editor']['plugins']['get'](_0x5d9668),_0x5df535=this['_revisionTracker']['buildRevisionData']({'revision':_0x2d1f93,'from':_0x26a906,'to':_0xff6b90});_0x5df535['id']=_0x2d1f93['id'];const _0x3fe8d0=_0x5df535['authorsIds']['map'](_0x51ea3a=>_0x69c619['getUser'](_0x51ea3a));_0x2d1f93['_update']({..._0x5df535,'authors':_0x3fe8d0},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2d1f93['id'],_0x5df535,!0x0);}this['_revisionTracker']['_startingVersion']=_0xff6b90,(_0x2d1f93['toVersion']===_0x2d1f93['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x4bb6a0)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x4bb6a0),this['_revisionTracker']['_createCurrentRevision'](_0xff6b90));}const {revisions:_0x1eba7b,requestId:_0x56b61e}=await this['_revisionHistoryService']['reconnect'](_0x49f870['connection'],this['_lastRequestId']);_0x4ba31c&&_0x1eba7b['length']>0x0?_0x27af14['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x1eba7b),this['_handleRevisionsUpdate'](_0x1eba7b,_0x56b61e),this['_revisionTracker']['sendBufferedUpdates']());};return _0x27af14['_isConnected']?_0x323168():new Promise((_0x5ec513,_0x5f3b92)=>{_0x27af14['once']('change:_isConnected',()=>{_0x323168()['then'](_0x5ec513)['catch'](_0x5f3b92);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x29b26b=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x48404c=>{_0x48404c['off'](),_0x29b26b();});});}['_getLatestVersionFromServerOperations'](){const _0x28e8b6=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2ec61f of _0x28e8b6)if('marker'!==_0x2ec61f['type']||_0x2ec61f['affectsData'])return _0x2ec61f['baseVersion']+0x1;}['_getLatestVersion'](){const _0x18f501=this['editor']['plugins']['get'](l);return new Promise(_0x1e8fd3=>{_0x18f501['_isPendingUpdate']?_0x18f501['once']('change:_isPendingUpdate',()=>{_0x1e8fd3(this['_getLatestVersionFromServerOperations']());}):_0x1e8fd3(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x46abd9,_0x142875){const _0x108593=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x142875;for(const _0x364fac of _0x46abd9){const _0x49bb7a=_0x108593['getRevision'](_0x364fac['id']);if(_0x49bb7a){if((_0x364fac['fromVersion']||_0x364fac['toVersion'])&&(_0x364fac['diffData']=null),_0x49bb7a===this['_revisionTracker']['currentRevision']){const _0x172e13=Math['max'](_0x49bb7a['toVersion'],_0x364fac['toVersion']),_0x27b94a=Math['max'](_0x49bb7a['fromVersion'],_0x364fac['fromVersion']);let _0x2ceae0;_0x49bb7a['toVersion']===_0x364fac['toVersion']&&_0x49bb7a['fromVersion']===_0x364fac['fromVersion']?(_0x2ceae0=!0x0,this['_preventResendingRevisionData'](_0x364fac)):_0x364fac['toVersion']===_0x172e13&&_0x364fac['fromVersion']===_0x27b94a?_0x2ceae0=!0x1:(_0x49bb7a['toVersion']===_0x172e13&&_0x49bb7a['fromVersion']===_0x27b94a||this['_fixRevision']({'revision':_0x49bb7a,'from':_0x27b94a,'to':_0x172e13}),_0x2ceae0=!0x0),_0x2ceae0&&(delete _0x364fac['fromVersion'],delete _0x364fac['toVersion'],delete _0x364fac['diffData'],delete _0x364fac['createdAt'],delete _0x364fac['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x364fac),this['_preventResendingRevisionData'](_0x364fac);}else this['_revisionTracker']['addRevisionData'](_0x364fac);}const _0x254d9e=_0x108593['getRevisions']();_0x254d9e['reverse']();for(let _0x35e280=0x0;_0x35e280<_0x254d9e['length']-0x1;_0x35e280++){const _0x2de3cb=_0x254d9e[_0x35e280],_0x90cf37=_0x254d9e[_0x35e280+0x1];if(_0x2de3cb['fromVersion']<_0x90cf37['toVersion']){const _0x18c152=_0x90cf37['toVersion'],_0x313fa3=Math['max'](_0x18c152,_0x2de3cb['toVersion']);this['_fixRevision']({'revision':_0x2de3cb,'from':_0x18c152,'to':_0x313fa3});}}}['_fixRevision']({revision:_0x20a67c,from:_0x4e1c2c,to:_0x30a7a9}={}){const _0x34c29b=this['editor']['plugins']['get'](_0x5d9668),_0x5bf867=this['_revisionTracker']['buildRevisionData']({'revision':_0x20a67c,'from':_0x4e1c2c,'to':_0x30a7a9});_0x5bf867['authors']=_0x5bf867['authorsIds']['map'](_0x458f7e=>_0x34c29b['getUser'](_0x458f7e)),_0x20a67c['_update'](_0x5bf867);}['_preventResendingRevisionData'](_0x32679f){const _0x5da08c={};_0x5da08c['id']=_0x32679f['id'];for(const _0xa738cd of Object['keys'](_0x32679f))'id'!==_0xa738cd&&(_0x5da08c[_0xa738cd]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x5da08c['id'],_0x5da08c,!0x0);}async['_fetchMissingUsers'](_0x39c3a3){const _0x2548f4=this['editor']['plugins']['get'](_0x5d9668),{connection:_0x4e0b1f}=this['editor']['plugins']['get'](n),_0x476bf2=new Set();for(const _0x1dc68d of _0x39c3a3){for(const _0xed4e73 of _0x1dc68d['authorsIds'])_0x569675(_0xed4e73);_0x1dc68d['creatorId']&&_0x569675(_0x1dc68d['creatorId']);}if(0x0===_0x476bf2['size'])return;const _0x5a73b2=await rt['getMany'](_0x4e0b1f,Array['from'](_0x476bf2));for(const _0x50a1a9 of _0x5a73b2)_0x2548f4['getUser'](_0x50a1a9['id'])||_0x2548f4['addUser'](_0x50a1a9);function _0x569675(_0x12cebd){_0x2548f4['getUser'](_0x12cebd)||_0x476bf2['add'](_0x12cebd);}}}function q(_0x4de56b){return _0x4de56b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x4de56b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4de56b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class RealTimeCollaborativeRevisionHistory extends _0x1178f7{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x260788{['_collapseAt'];constructor(_0x5d9543,_0x5a3d14=0x6){super(_0x5d9543);const _0x37714f=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x5a3d14,this['bind']('isHidden')['to'](this,'usersCount',_0x4e91df=>_0x4e91df<_0x5a3d14),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x37714f['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':_0x37714f['to']('usersCount',_0xbcccd7=>'+'+(_0xbcccd7-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x260788{['items'];['keystrokes'];constructor(_0x1427c4){super(_0x1427c4);const _0x2d23c5=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5c6d96(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x2d23c5['if']('hasPopup'),'aria-expanded':_0x2d23c5['to']('isExpanded',_0x22d0cd=>this['hasPopup']&&String(_0x22d0cd)),'aria-label':_0x2d23c5['to']('hasPopup',_0x417be1=>$(_0x1427c4,_0x417be1?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x2d23c5['to']('hasPopup',_0x4978ca=>!!_0x4978ca&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x2d23c5['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x2d23c5['to'](_0x31f6ce=>{const _0x9276b5=_0x31f6ce,_0xd490e5=document['querySelector']('.ck-presence-list__dropdown-list'),_0x3a63a9=document['querySelector']('.ck-balloon-panel_with-arrow');_0xd490e5?.['contains'](_0x9276b5['relatedTarget'])||_0x3a63a9?.['contains'](_0x9276b5['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x2cd15f,_0x3d5ca1,_0x458fe8)=>{this['element']&&(_0x458fe8?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x260788{['counterView'];['inlineListView'];constructor(_0xe2c1be,_0x2aba97=0x6){super(_0xe2c1be);const _0x48605d=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x2aba97),this['inlineListView']=new is(_0xe2c1be),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x20e051 of this['inlineListView']['items'])_0x20e051['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',_0x48605d['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x260788{['listWrapperView'];constructor(_0x268a9c,_0x3e69ab){super(_0x268a9c);const _0x1935ce=this['bindTemplate'];this['listWrapperView']=new PresenceDropdownListWrapperView(_0x268a9c,_0x3e69ab),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x268a9c,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x1935ce['to'](_0x1372ca=>{const _0x4d38e3=_0x1372ca,_0x49d977=document['querySelector']('.ck-presence-list__list'),_0x4ef5db=document['querySelector']('.ck-balloon-panel_with-arrow');_0x49d977?.['contains'](_0x4d38e3['relatedTarget'])||_0x4ef5db?.['contains'](_0x4d38e3['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class PresenceDropdownListWrapperView extends _0x1953fa{constructor(_0x4c2635,_0x2f7bbd){super(_0x4c2635);const _0x43f77=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x2f7bbd?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x43f77['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x43f77['to']('role'),'aria-label':_0x43f77['to']('ariaLabel'),'aria-labelledby':_0x43f77['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x439b3d['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x4e5d15=this['element'];_0x4e5d15&&(this['_isScrollable']=Math['max'](_0x4e5d15['scrollHeight'],_0x4e5d15['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x3208dd,_0x288fc9,_0x4cf922){super(_0x3208dd);const _0x495055=this['bindTemplate'];this['userView']=new st(_0x3208dd,_0x288fc9);const _0x4578c1={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x288fc9['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x288fc9['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x288fc9['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x4cf922&&(_0x4578c1['tag']='button',_0x4578c1['on']={'click':_0x495055['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x4578c1);}['focus'](){this['element']['focus']();}}class A extends _0x260788{['userView'];['markerView'];constructor(_0x2587cb,_0x1c3929,_0x4bc803){super(_0x2587cb);const _0x64eebe=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x2587cb,_0x1c3929),this['markerView']=new MarkerView(_0x2587cb,_0x1c3929);const _0x1dcdd4=new it(_0x2587cb);_0x1dcdd4['template']['tag']='span',_0x1dcdd4['text']=_0x1c3929['name'];const _0x147d26={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x64eebe['to']('isFocusable',_0x2196f5=>!!_0x2196f5&&0x0),'aria-labelledby':_0x1dcdd4['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x64eebe['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x64eebe['to']('hasTooltip',_0x493eb3=>!_0x493eb3),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x1dcdd4]};_0x4bc803&&(_0x147d26['tag']='button',_0x147d26['on']={'click':_0x64eebe['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x147d26);}}class MarkerView extends _0x260788{constructor(_0x43b846,_0x345cd9){super(_0x43b846),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x345cd9['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x38fb43{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x130422){super(_0x130422),this['context']['config']['define']('presenceList',x);const _0x4843fe=_0x130422['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4843fe)throw new _0x138eb8('presencelist-collapseat-invalid-format',this);if(_0x4843fe<0x1)throw new _0x138eb8('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x505ced(),this['balloonPanelView']=new _0x2b336b(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x2d20dc of this['_allConnectedUsers'])this['_handleUserAdd'](_0x2d20dc);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1b613b,_0x1f175c)=>{this['_handleUserAdd'](_0x1f175c);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x41230c,_0x32565c)=>{this['_handleUserRemove'](_0x32565c);});}['_createView'](){const _0x4c20d3=this['context'],_0x455122=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x33a27e=this['balloonPanelView'];if(!_0x3c8a9f(_0x4c20d3['config']['get']('presenceList.container')))throw new _0x138eb8('presencelist-missing-container',this);return _0x455122['counterView']['bind']('usersCount')['to'](this),_0x455122['bind']('isCollapsed')['to'](this,'usersCount',_0x50e2a3=>{const {collapseAt:_0x2a0057}=_0x4c20d3['config']['get']('presenceList'),_0x101d18=_0x50e2a3>=_0x2a0057;if(_0x101d18&&!_0x455122['inlineListView']['items']['find'](_0x1e1ac1=>_0x1e1ac1 instanceof b)){const _0x46b37f=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x46b37f&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x455122['inlineListView']['items']['add'](_0x455122['counterView']);}return _0x101d18||this['hideDropdown'](),_0x101d18;}),_0x455122['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x48f685=>{const _0x2d3899=_0x4c20d3['config']['get']('presenceList'),_0x3608ee=new A(_0x4c20d3['locale'],_0x48f685,!!_0x2d3899['onClick']);return _0x3608ee['bind']('hasTooltip')['to'](_0x455122,'isCollapsed',_0x25a716=>!_0x25a716),_0x3608ee['bind']('isFocusable')['to'](_0x455122,'isCollapsed',_0x13d5d5=>!_0x13d5d5),_0x2d3899['onClick']&&this['listenTo'](_0x3608ee,'execute',()=>{this['view']['isCollapsed']||_0x2d3899['onClick'](_0x48f685,_0x3608ee['element']);}),_0x3608ee;}),this['listenTo'](_0x455122['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x455122['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x455122['inlineListView']['keystrokes']['set']('Enter',(_0x7e7070,_0x3eacdf)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3eacdf());}),_0x455122['render'](),_0x33a27e['render'](),_0x1b15b6({'emitter':_0x455122,'activator':()=>_0x33a27e['isVisible'],'contextElements':[_0x33a27e['element'],_0x455122['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x4c20d3['config']['get']('presenceList.container')['appendChild'](_0x455122['element']),this['_bodyCollection']=new _0x11f0a4(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x455122;}['_handleUserAdd'](_0x350936){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x350936['isMe'])return;const _0x3cddc0=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x3cddc0-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0xad9f92=_0x350936['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x350936,_0xad9f92);}['_handleUserRemove'](_0x35205b){this['usersCount']--;const {collapseAt:_0x16a947}=this['context']['config']['get']('presenceList'),_0x5047ba=this['usersCount']>=_0x16a947;if(this['currentDisplayedUsers']['get'](_0x35205b['id']))this['currentDisplayedUsers']['remove'](_0x35205b['id']);else{if(_0x5047ba&&this['currentDisplayedUsers']['length']+0x1===_0x16a947-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x5047ba?0x1:0x0)<this['usersCount']){for(const _0x178558 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x178558['id'])&&(this['currentDisplayedUsers']['add'](_0x178558,Math['min'](this['currentDisplayedUsers']['length']-(_0x5047ba?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x5047ba?0x1:0x0)===_0x16a947-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1c1cbb=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x1c1cbb['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x1760a7}=this['presenceDropdownView'];_0x1760a7['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x1f07e9=>{if(!_0x1c1cbb['displayMe']&&_0x1f07e9['isMe'])return null;const _0x199712=new j(this['context']['locale'],_0x1f07e9,!!_0x1c1cbb['onClick']);return _0x1c1cbb['onClick']&&this['listenTo'](_0x199712,'execute',()=>{_0x1c1cbb['onClick'](_0x1f07e9,_0x199712['element']);}),_0x199712;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x1760a7['focus'](),_0x1760a7['checkIfScrollable']();const _0x42a6d9=(_0x52314d,_0x255e2d)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x255e2d();};_0x1760a7['keystrokes']['set']('Esc',_0x42a6d9),_0x1760a7['keystrokes']['set']('Shift+Tab',_0x42a6d9),_0x1760a7['keystrokes']['set']('Tab',(_0xcddaea,_0x1b573b)=>{!function(_0x3f7a7e){const _0x362806=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x294c5d=>_0x294c5d+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3a56da=[...document['body']['querySelectorAll'](_0x362806)]['filter'](_0xfa8f3a=>_0xfa8f3a===document['activeElement']||_0xfa8f3a['offsetWidth']+_0xfa8f3a['offsetHeight']>0x0)['sort']((_0x52c314,_0x49ce5f)=>(_0x52c314['tabIndex']||0x0)-(_0x49ce5f['tabIndex']||0x0)),_0x4d3f7b=_0x3a56da['indexOf'](_0x3f7a7e),_0x52f211=_0x3a56da[(_0x4d3f7b+0x1)%_0x3a56da['length']];_0x52f211&&_0x52f211['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1b573b();}),_0x1760a7['focusTracker']['add'](this['view']['element']),_0x1760a7['focusTracker']['on']('change:isFocused',(_0x43d224,_0x470a3c,_0x13654c)=>{_0x13654c||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class PresenceList extends _0x38fb43{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,RealTimeCollaborativeRevisionHistory,RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x30392a=>0x1!=_0x30392a}};
23
+ export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x1ea514=>0x1!=_0x1ea514}};