@ckeditor/ckeditor5-real-time-collaboration 44.0.0-alpha.1 → 44.0.0-alpha.11

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/LICENSE.md +7 -7
  2. package/README.md +12 -10
  3. package/build/real-time-collaboration.js +1 -1
  4. package/dist/index.js +6 -6
  5. package/dist/translations/af.js +1 -1
  6. package/dist/translations/af.umd.js +1 -1
  7. package/dist/translations/ar.js +1 -1
  8. package/dist/translations/ar.umd.js +1 -1
  9. package/dist/translations/ast.js +1 -1
  10. package/dist/translations/ast.umd.js +1 -1
  11. package/dist/translations/az.js +1 -1
  12. package/dist/translations/az.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 +9 -9
  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 +1 -1
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +1 -1
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +1 -1
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +1 -1
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +1 -1
  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 _0x375b1b,Plugin as _0x3b1a90,PendingActions as _0x491601,Context as _0x445727}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x4ab1ad,CKEditorError as _0x3443e5,Collection as _0x2718c8,global as _0x3b8f5d,version as dt,uid as _0x3831d0,KeystrokeHandler as _0x23d333}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x1dfc1e,View as _0x360a48,ListView as _0x5b2324,ListItemView as ct,LabelView as lt,BalloonPanelView as _0x2ae021,clickOutsideHandler as _0x25d192,BodyCollection as tt}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ut,History as _0x49f383,NoOperation as _0x51c15b,InsertOperation as _0x1b8f90,MarkerOperation as _0x17a7da,RootAttributeOperation as _0x44a68e,transformSets as _0x1790a5,OperationFactory as _0x540e13}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ft,WEB_SOCKET_GATEWAY_STATES as _0x51d08e,CollaborativeEditingService as _0xfd8b2a,User as mt,CommentsService as _0x3354a4,TrackChangesService as nt,RevisionHistoryService as _0x141eee,EditorService as _0x132f7f}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x4fe278,UserView as at}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x481af2}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as st}from'lodash-es';class c extends _0x375b1b{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x1dfc1e];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1904e6){super(_0x1904e6),this['set']('state',_0x51d08e['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x4ab1ad);}['init'](){const _0x2ce7b0=this['context'],_0x1d594e=_0x2ce7b0['plugins']['get']('CloudServices'),_0x22fc62=_0x2ce7b0['plugins']['get'](_0x1dfc1e);if(!_0x1d594e['token'])throw new _0x3443e5('websocketgateway-missing-token',this);if(!_0x1d594e['webSocketUrl'])throw new _0x3443e5('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x1d594e['token'],_0x1d594e['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x40aed8=>{if(this['connection']=_0x40aed8,this['bind']('state')['to'](_0x40aed8,'state',this,'_isBrowserOffline',(_0x57eab6,_0x122a70)=>('connected'!==_0x57eab6&&(this['_shouldPluginsReconnect']=!0x0),_0x122a70||_0x57eab6!==_0x51d08e['CONNECTED']?_0x51d08e['DISCONNECTED']:this['state']==_0x51d08e['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x51d08e['CONNECTING']):_0x51d08e['CONNECTED'])),this['connection']['on']('error',(_0x1241d9,_0x3ea848)=>{if('limitExceeded'!==_0x3ea848['code'])throw console['error'](_0x3ea848),new _0x3443e5('cloudservices-init',null,{'originalError':_0x3ea848});_0x22fc62['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'});}),!_0x40aed8['me'])return new Promise(_0x483e7b=>_0x40aed8['on']('change:me',_0x483e7b));})['catch'](_0x350102=>{throw console['error'](_0x350102),new _0x3443e5('cloudservices-init',null,{'originalError':_0x350102});});}['addToReconnectionStack'](_0x338a2c){if('function'!=typeof _0x338a2c['reconnect'])throw new _0x3443e5('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x338a2c))throw new _0x3443e5('websocketgateway-plugin-already-registered',this,{'name':_0x338a2c['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x338a2c);}['removeFromReconnectionStack'](_0x7a4e11){this['_reconnectionStack']['delete'](_0x7a4e11);}['isInReconnectionStack'](_0x165f90){return this['_reconnectionStack']['has'](_0x165f90);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x302117=>_0x302117['reconnect']())))['then'](()=>this['state']=_0x51d08e['CONNECTED'])['catch'](_0x140ae2=>{throw console['error'](_0x140ae2),new _0x3443e5('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x51d08e['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x375b1b{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x4fe278];}constructor(_0x4fbfd9){super(_0x4fbfd9),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x2718c8(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x4fe278);}['init'](){const _0x402cf9=this['context']['plugins']['get'](c);this['listenTo'](_0x402cf9,'change:state',(_0x4b06e6,_0x5da501,_0x22e4ef)=>{if('connected'!==_0x22e4ef)this['channelSessions']['forEach'](_0xe7fda1=>_0xe7fda1['clear']()),this['channelConnectedUsers']['forEach'](_0x376cc5=>_0x376cc5['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x47fcb6,_0x38bb05]of this['_registeredSessions'])for(const _0x20c486 of _0x38bb05)this['_handleSessionAdd'](_0x47fcb6,_0x20c486);}}),this['_createUser'](_0x402cf9['connection']['me'],!0x0);}['register'](_0x50a20c,_0x1976dc){if(this['_registeredSessions']['has'](_0x50a20c))throw new _0x3443e5('sessions-register-already-registered',null,{'channelId':_0x50a20c});this['_registeredSessions']['set'](_0x50a20c,_0x1976dc),this['channelSessions']['set'](_0x50a20c,new _0x2718c8()),this['channelConnectedUsers']['set'](_0x50a20c,new _0x2718c8()),this['listenTo'](_0x1976dc,'add',(_0x13f209,_0x13ba1f)=>this['_handleSessionAdd'](_0x50a20c,_0x13ba1f)),this['listenTo'](_0x1976dc,'remove',(_0x1def98,_0x5c197b)=>this['_handleSessionRemove'](_0x50a20c,_0x5c197b));for(const _0x562e7c of _0x1976dc)this['_handleSessionAdd'](_0x50a20c,_0x562e7c);}['unregister'](_0x6a1b4){if(!this['_registeredSessions']['has'](_0x6a1b4))throw new _0x3443e5('sessions-unregister-not-exist',null,{'channelId':_0x6a1b4});const _0x5e512b=this['_registeredSessions']['get'](_0x6a1b4);this['stopListening'](_0x5e512b);for(const _0x45e562 of _0x5e512b)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x6a1b4,_0x45e562);this['_registeredSessions']['delete'](_0x6a1b4),this['channelSessions']['delete'](_0x6a1b4),this['channelConnectedUsers']['delete'](_0x6a1b4);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x5bbf71){for(const _0x403c0c of this['channelSessions']['values']())for(const _0x6ac881 of _0x403c0c)if(_0x6ac881['id']===_0x5bbf71)return _0x6ac881['user'];}['getUserSessions'](_0x132bfc,_0x185cee){const _0x9e7810=_0x185cee?[this['channelSessions']['get'](_0x185cee)]:this['channelSessions']['values'](),_0x2a39a1=new Set();for(const _0x1665ff of _0x9e7810)for(const _0x56576e of _0x1665ff)_0x56576e['user']['id']===_0x132bfc['id']&&_0x2a39a1['add'](_0x56576e['id']);return _0x2a39a1;}['getUserRole'](_0x4dd2a8){for(const _0x47108f of this['channelSessions']['values']())for(const _0x46445d of _0x47108f)if(_0x46445d['user']===_0x4dd2a8)return _0x46445d['role'];}['_handleSessionAdd'](_0x46601a,_0x14d501){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x5b8ef9=_0x14d501['user'],_0x4b0ee9=this['_users']['getUser'](_0x5b8ef9['id'])||this['_createUser'](_0x5b8ef9),_0x440214=Object['assign']({},_0x14d501,{'user':_0x4b0ee9});this['channelSessions']['get'](_0x46601a)['add'](_0x440214);const _0xeca01d=this['channelConnectedUsers']['get'](_0x46601a);_0xeca01d['has'](_0x4b0ee9['id'])||_0xeca01d['add'](_0x4b0ee9),this['allConnectedUsers']['has'](_0x4b0ee9['id'])||this['allConnectedUsers']['add'](_0x4b0ee9,_0x4b0ee9['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x46601a,{'channelId':_0x46601a,'session':_0x440214});}['_handleSessionRemove'](_0x4f02b3,_0x2a5ba2){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x55f764=this['channelConnectedUsers']['get'](_0x4f02b3),_0x4ba8ca=_0x2a5ba2['user'];_0x4ba8ca['id']&&(this['channelSessions']['get'](_0x4f02b3)['remove'](_0x2a5ba2['id']),_0x55f764['has'](_0x4ba8ca['id'])&&!this['getUserSessions'](_0x4ba8ca,_0x4f02b3)['size']&&_0x55f764['remove'](_0x4ba8ca['id']),this['allConnectedUsers']['get'](_0x4ba8ca['id'])&&!this['getUserSessions'](_0x4ba8ca)['size']&&this['allConnectedUsers']['remove'](_0x4ba8ca['id']));}['_createUser'](_0x29f76f,_0xf3f427){const _0x14b344=this['_users']['addUser'](_0x29f76f);return _0xf3f427&&this['_users']['defineMe'](_0x29f76f['id']),_0x14b344['orderNumber']=this['_uniqueUsersCount']++,_0x14b344;}}class N extends _0x3b1a90{['_domEmitter']=new(_0x4ab1ad())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x52b5a5=this['editor'],_0x2b6bd3=_0x52b5a5['plugins']['get'](i);_0x52b5a5['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x566d65,{writer:_0x562c8c})=>function(_0x122a2c,_0xc7c3f2,_0x386885,_0x15b37f){const _0x298d15=_0x122a2c['markerName']['split'](':')[0x2],_0x581943=_0x386885['getUserBySessionId'](_0x298d15);if(!_0x581943||_0x298d15===_0x386885['mySessionId'])return;if(!_0x15b37f['model']['schema']['checkChild'](_0x122a2c['markerRange']['start'],'$text'))return;const _0x4de790={'class':'ck-user__marker\x20'+_0x581943['color']['getMarkerClass'](),'data-name':_0x581943['name'],'data-session-id':_0x298d15},_0x48de3a=_0x15b37f['model']['markers']['get'](_0x122a2c['markerName']),_0x7ed9ff=_0x48de3a['getStart'](),_0x42aee3=_0x7ed9ff['nodeAfter'],_0x2f2215=_0x15b37f['model']['schema'];if(_0x42aee3&&_0x2f2215['isObject'](_0x42aee3)&&_0x2f2215['isInline'](_0x42aee3)&&!_0x15b37f['model']['markers']['get']('user:range:'+_0x298d15)['getRange']()['isCollapsed'])return;const _0x47d683=_0x7ed9ff['parent'];return _0x15b37f['model']['schema']['isLimit'](_0x47d683)&&!_0x15b37f['model']['hasContent'](_0x47d683)&&(_0x4de790['contenteditable']=!0x1),function(_0x490139,_0x27c6df,_0x48a67d){const _0x4bd0bb=_0x490139['createUIElement']('span',_0x27c6df);return _0x490139['setCustomProperty']('userPositionMarker',!0x0,_0x4bd0bb),_0x4bd0bb['render']=function(_0x1f9db5){const _0xb81324=this['toDomElement'](_0x1f9db5);return _0xb81324['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x48a67d['name']+'</span>⁠',_0xb81324['addEventListener']('mouseenter',()=>{_0xb81324['classList']['add']('ck-user__marker_hovered');}),_0xb81324['addEventListener']('mouseleave',()=>{_0xb81324['classList']['remove']('ck-user__marker_hovered');}),_0xb81324;},_0x4bd0bb['isSimilar']=function(_0x1f5ed3){return!(!this['getCustomProperty']('userPositionMarker')||!_0x1f5ed3['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x1f5ed3['getAttribute']('data-session-id'));},_0x4bd0bb;}(_0xc7c3f2,_0x4de790,_0x581943);}(_0x566d65,_0x562c8c,_0x2b6bd3,_0x52b5a5)}),_0x52b5a5['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x5ead90=>function(_0x3a0f14,_0x54084c){const _0x1734e8=_0x3a0f14['markerName']['split'](':')[0x2];if(_0x1734e8===_0x54084c['mySessionId'])return null;const _0x464a18=_0x54084c['getUserBySessionId'](_0x1734e8);if(!_0x464a18)return{'id':_0x1734e8,'classes':[]};return{'id':_0x1734e8,'classes':['ck-user__selection',_0x464a18['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x1734e8},'priority':0x7d0+_0x464a18['orderNumber']};}(_0x5ead90,_0x2b6bd3)}),function(_0x2e8163){const _0x1aa15c=_0x2e8163['model'],_0x51dffa=new Map(),_0x259d2c=_0x2e8163['plugins']['get'](i);_0x1aa15c['markers']['on']('update:user:range',(_0x16c337,_0xc9ca47,_0x289b3e,_0x38444b)=>{if(!_0x38444b&&_0x51dffa['get'](_0xc9ca47['name']))return _0x51dffa['get'](_0xc9ca47['name'])['detach'](),void _0x51dffa['delete'](_0xc9ca47['name']);const _0x5616bd=_0xc9ca47['name']['split'](':')[0x2];if(_0x5616bd===_0x259d2c['mySessionId'])return;const _0x15b1d9='user:position:'+_0x5616bd;_0x1aa15c['markers']['has'](_0x15b1d9)&&_0x2e8163['editing']['reconvertMarker'](_0x15b1d9),_0xc9ca47['on']('change:range',(_0x29ed07,_0x3438a9,_0x2fcd42)=>{if('$graveyard'!=_0x3438a9['root']['rootName']&&'$graveyard'==_0xc9ca47['getRange']()['root']['rootName']&&!_0x51dffa['has'](_0xc9ca47['name'])){const _0x386abc=_0x1aa15c['schema']['getNearestSelectionRange'](_0x2fcd42['deletionPosition']);if(_0x386abc){const _0x1af3dc=ut['fromRange'](_0x386abc);_0x51dffa['set'](_0xc9ca47['name'],_0x1af3dc),_0x1af3dc['on']('change:range',(_0x230be7,_0xdee545,_0x253dca)=>{if('$graveyard'==_0x1af3dc['root']['rootName']){const _0x2d1f29=_0x1aa15c['schema']['getNearestSelectionRange'](_0x253dca['deletionPosition']);_0x2d1f29?(_0x1af3dc['start']=_0x2d1f29['start'],_0x1af3dc['end']=_0x2d1f29['end']):(_0x51dffa['delete'](_0xc9ca47['name']),_0x1af3dc['detach']());}});}}});}),_0x1aa15c['document']['on']('change',()=>{_0x51dffa['size']>0x0&&_0x1aa15c['enqueueChange']({'isUndoable':!0x1},_0x2d93f7=>{for(const [_0x2e9f0c,_0x224d66]of _0x51dffa)'$graveyard'==_0x1aa15c['markers']['get'](_0x2e9f0c)['getRange']()['root']['rootName']&&(G(_0x2e9f0c['split'](':')[0x2],_0x224d66['toRange'](),_0x1aa15c,_0x2d93f7),_0x224d66['detach']());_0x51dffa['clear']();});});}(_0x52b5a5),this['_domEmitter']['listenTo'](_0x3b8f5d['document'],'keydown',(_0x1609dd,{key:_0x29d335})=>{'Escape'===_0x29d335&&function(_0x19093b){_0x19093b['editing']['view']['change'](_0x4425b0=>{for(const _0x44b3dd of _0x19093b['model']['markers']){if(!_0x44b3dd['name']['startsWith']('user:position'))continue;const _0x5a0313=_0x19093b['editing']['mapper']['markerNameToElements'](_0x44b3dd['name']);if(_0x5a0313){for(const _0x3bbec8 of _0x5a0313)_0x4425b0['removeClass']('ck-user__marker_hovered',_0x3bbec8);}}});}(_0x52b5a5);},{'useCapture':!0x0});}['afterInit'](){const _0x1fb92a=this['editor'],_0x452b97=_0x1fb92a['commands']['get']('undo');_0x452b97&&_0x1fb92a['model']['on']('applyOperation',(_0x3798ae,_0x24c4dc)=>{const _0x3be09d=_0x24c4dc[0x0];if('marker'!=_0x3be09d['type']||!_0x3be09d['name']['startsWith']('user:'))return;const _0x1aa639=_0x3be09d['batch'];_0x452b97['_createdBatches']['has'](_0x1aa639)&&(_0x3be09d['newRange']=_0x3be09d['oldRange']?_0x1fb92a['model']['createRange'](_0x3be09d['oldRange']['start'],_0x3be09d['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x3c121b=this['editor'],_0x173c55=_0x3c121b['model']['document'],_0x4e0bcf=_0x3c121b['plugins']['get'](i);_0x3c121b['model']['enqueueChange']({'isUndoable':!0x1},_0x3b940=>{const _0x2026f1='user:range:'+_0x4e0bcf['mySessionId'],_0x5a460e='user:position:'+_0x4e0bcf['mySessionId'],_0x45ae66=_0x3c121b['model']['markers']['has'](_0x2026f1);_0x3c121b['editing']['view']['hasDomSelection']?G(_0x4e0bcf['mySessionId'],_0x173c55['selection']['getFirstRange'](),_0x3c121b['model'],_0x3b940):_0x45ae66&&(_0x3b940['removeMarker'](_0x2026f1),_0x3b940['removeMarker'](_0x5a460e));});}}function G(_0xdecb36,_0x35d52f,_0x1efc7d,_0x3cc9be){const _0x4502f0='user:range:'+_0xdecb36,_0x216dd8='user:position:'+_0xdecb36,_0x4b4efb=_0x35d52f['getContainedElement']();let _0x2841e2=_0x35d52f['start'];_0x4b4efb&&_0x4b4efb['is']('element','tableCell')&&(_0x2841e2=function(_0x29b971,_0x51b7d4){for(const _0x3ea707 of _0x29b971['getPositions']())if(_0x51b7d4['schema']['checkChild'](_0x3ea707,'$text'))return _0x3ea707;}(_0x35d52f,_0x1efc7d),_0x35d52f=_0x3cc9be['createRange'](_0x2841e2));const _0x6d61b3=_0x3cc9be['createRange'](_0x2841e2);_0x1efc7d['markers']['has'](_0x4502f0)?(_0x3cc9be['updateMarker'](_0x4502f0,{'range':_0x35d52f}),_0x3cc9be['updateMarker'](_0x216dd8,{'range':_0x6d61b3})):(_0x3cc9be['addMarker'](_0x4502f0,{'range':_0x35d52f,'usingOperation':!0x0}),_0x3cc9be['addMarker'](_0x216dd8,{'range':_0x6d61b3,'usingOperation':!0x0}));}function E(_0x414cb2,_0x458886,_0x442afb){const _0x562b45=_0x414cb2['t'],t=_0x414cb2['t'];switch(_0x458886){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 _0x562b45({'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'},_0x442afb);default:return'';}}let M=0x1;class l extends _0x3b1a90{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0xfd8b2a)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,N,_0x491601,_0x4fe278,_0x1dfc1e];}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 _0x42c9b0=this['serverHistory']['getOperations']();for(let _0x3cd933=_0x42c9b0['length']-0x1;_0x3cd933>=0x0;_0x3cd933--){const _0x245e84=_0x42c9b0[_0x3cd933];if(!this['_disconnectionOperations']['has'](_0x245e84))return _0x245e84['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x4fb606){if(super(_0x4fb606),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x49f383(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3443e5('collaboration-missing-channelid',this);const _0x34c4fe=_0x4fb606['config']['get']('cloudServices.bundleVersion')||dt;this['_service']=new l['CollaborativeEditingService'](_0x34c4fe,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x481af2(),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 W(this['_disconnectionOperations']);}['init'](){const _0x161552=this['editor'],_0x2eeb33=_0x161552['plugins']['get'](_0x4fe278),_0x307231=_0x161552['plugins']['get'](c);this['listenTo'](_0x2eeb33,'getOperationAuthor',(_0x222289,_0x340dec)=>{const _0x2d51d3=_0x340dec[0x0];_0x2d51d3['_authorId']&&(_0x222289['return']=_0x2eeb33['getUser'](_0x2d51d3['_authorId']),_0x222289['stop']()),null===_0x2d51d3['_authorId']&&(_0x222289['return']=null,_0x222289['stop']());},{'priority':'high'}),this['listenTo'](_0x161552['model']['document']['selection'],'change:range',(_0x304100,_0x12bb37)=>{_0x12bb37['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x161552['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x161552['model']['on']('applyOperation',(_0x21977e,_0x52e13d)=>{const _0x89fd53=_0x52e13d[0x0];_0x89fd53['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x89fd53),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x307231,'state',this,'_hasSynchronizationProblem',(_0x3c7724,_0x2619fa)=>'connected'===_0x3c7724&&!_0x2619fa),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x161552['disableReadOnlyMode']('rtc-offline'):_0x161552['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x161552['disableReadOnlyMode']('rtc-offline'):_0x161552['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x26f74d=this['editor']['plugins']['get'](i),_0x127e28=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x26f74d['unregister'](this['_channelId']);const _0x5abb65=await this['_service']['reconnect'](_0x127e28['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x5abb65)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1b72d2=await this['_service']['getConnectedSessions']();_0x26f74d['register'](this['_channelId'],_0x1b72d2),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x273888){if(function(_0x355621){return'404'===_0x355621['code'];}(_0x273888)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x31acb9){return'409'===_0x31acb9['code'];}(_0x273888)){const _0x19c7d7=E(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'](_0x19c7d7);}else{if(!(_0x273888 instanceof z))throw _0x273888;this['_handleReconnectionError']();}}}}['destroy'](){const _0x49da24=this['editor']['plugins']['get'](c),_0x18a57a=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x18a57a['channelSessions']['has'](this['_channelId'])&&_0x18a57a['unregister'](this['_channelId']),_0x49da24['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x8c21fc){if(this['sessionId']!==_0x8c21fc['sessionId']&&this['_lastSyncedOperationId']!==_0x8c21fc['lastOperationId'])throw new z();return this['sessionId']=_0x8c21fc['sessionId'],this['_handleServerResponse']([],{..._0x8c21fc,'wereChangesApplied':!0x1,'data':_0x8c21fc['data']},'reconnect');}async['_connectService'](_0x55c562,_0x404220=!0x1){const {connection:_0x26c4e8}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x26c4e8,this['_channelId'])['then'](_0x3ba3fc=>this['_initSessionsHandling'](_0x3ba3fc))['catch'](_0x391ba5=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x391ba5);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x19ebaa,_0x1e1154)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x1e1154);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3d38dc=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x55c562);this['_isPendingUpdate']=!0x0;const _0x4cfdc7=await this['_service']['connect'](_0x26c4e8,this['_compressOperations'](_0x55c562),_0x3d38dc);if(this['sessionId']=_0x4cfdc7['sessionId'],_0x404220){if(!_0x4cfdc7['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x4cfdc7['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x55c562,_0x4cfdc7,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x4cfdc7,_0x55c562);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x1532dc=this['editor']['plugins']['get'](i),_0x30a1ca=this['editor']['plugins']['get'](N),_0x360b82=_0x1532dc['channelSessions']['get'](this['_channelId']);_0x360b82&&_0x360b82['length']>0x1?_0x30a1ca['createUserMarkerOperations']():this['listenTo'](_0x1532dc,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x1532dc['channelSessions']['get'](this['_channelId'])['length']&&_0x30a1ca['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x1f7ea5,_0x18efab,_0x371152,_0x48e0ea){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x18efab){const _0x306a2e=this['_decompressOperations'](_0x371152,_0x48e0ea);await this['_fetchMissingUsers'](_0x306a2e),this['_handleExternalOperations'](_0x306a2e,_0x18efab,_0x371152['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x4fa786}=this['editor'];let _0x46d23c;try{_0x46d23c=await this['_service']['getDocumentDetails']();}catch(_0x3ed00e){const _0x1721b8=E(_0x4fa786,'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'](_0x1721b8);}const _0x67a621=_0x46d23c['currentDocumentSession']||_0x46d23c['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x67a621['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x357774=E(_0x4fa786,'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.');this['_handleReconnectionError'](_0x357774);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x591a5b){const _0x57461e=this['editor']['plugins']['get'](i);this['listenTo'](_0x57461e,'sessionAdd:'+this['_channelId'],(_0x58e5f8,{session:_0x191cd1})=>{if(_0x191cd1['id']===_0x57461e['mySessionId']){_0x58e5f8['off']();const _0x1405ee=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x33f080=_0x191cd1['permissions'];_0x1405ee&&_0x1405ee['isEnabled']&&(_0x33f080=_0x33f080['filter'](_0x41eb0d=>'document:write'!==_0x41eb0d)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x33f080,this['_channelId']);}}),_0x57461e['register'](this['_channelId'],_0x591a5b);}['_initThrowingOnDataSet'](){const _0x6500b8=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x20878d)=>{if(!_0x20878d[_0x20878d['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3443e5('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x6500b8['apply'](this['editor']['data'],_0x20878d);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0xa32651,[_0x5a7933])=>{if(this['_document']['version'])throw new _0x3443e5('realtimecollaborationclient-init-document-already-initialized',this);_0xa32651['stop'](),this['_setPendingAction']();const _0x5796b1=this['editor']['config']['get']('rootsAttributes'),_0x467e88=this['_getOperationsFromInitData'](_0x5a7933,_0x5796b1);0x0==_0x467e88['length']&&_0x467e88['push'](new _0x51c15b(0x0)),_0xa32651['return']=this['_connectService'](_0x467e88)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x5c34cb=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x5c34cb))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x4ecdf9,[_0x4c10f9,_0x4a0056])=>{_0x4ecdf9['stop']();const _0x2a51e6=this['editor']['model']['document']['getRoot'](_0x4c10f9);if(!this['_knownRootNames']['has'](_0x4c10f9)){const _0x2f6f33=_0x4a0056&&_0x4a0056['data']?_0x4a0056['data']:'',_0x4005b6=_0x4a0056&&_0x4a0056['attributes']?_0x4a0056['attributes']:{};await this['_loadRoot'](_0x4c10f9,_0x2f6f33,_0x4005b6);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x2a51e6['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x2a51e6);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x2d5e0e){const _0x4a9840=this['editor']['plugins']['get'](_0x4fe278),{connection:_0x3eed42}=this['editor']['plugins']['get'](c),_0x28bb33=new Set();for(const _0x5c77e9 of _0x2d5e0e){const _0x530ae3=_0x5c77e9['_authorId'];_0x530ae3&&!_0x4a9840['getUser'](_0x530ae3)&&_0x28bb33['add'](_0x530ae3);}if(0x0===_0x28bb33['size'])return;const _0x5e9e17=await mt['getMany'](_0x3eed42,Array['from'](_0x28bb33));for(const _0x54ae8e of _0x5e9e17)_0x4a9840['getUser'](_0x54ae8e['id'])||_0x4a9840['addUser'](_0x54ae8e);}['_getOperationsFromInitData'](_0x4e3311,_0x327652={}){const _0x3e92b7=this['editor']['model'],_0x298021=[];let _0x1deeeb=0x0;const _0x283131='string'==typeof _0x4e3311?{'main':_0x4e3311}:_0x4e3311;for(const _0x402987 of Object['keys'](_0x283131)){if(!this['_document']['roots']['has'](_0x402987))throw new _0x3443e5('realtimecollaborationclient-init-non-existent-root',this);const _0x2a7b1b=this['editor']['data']['parse'](_0x283131[_0x402987]),_0x18fcd2=this['_document']['getRoot'](_0x402987),_0x583f98=new _0x1b8f90(_0x3e92b7['createPositionAt'](_0x18fcd2,0x0),_0x2a7b1b,_0x1deeeb++);_0x298021['push'](_0x583f98);for(const [_0x4c2e16,_0x255ec0]of _0x2a7b1b['markers']){const _0x288367=_0x3e92b7['createRange'](_0x3e92b7['createPositionFromPath'](_0x18fcd2,_0x255ec0['start']['path']['slice']()),_0x3e92b7['createPositionFromPath'](_0x18fcd2,_0x255ec0['end']['path']['slice']())),_0x1b52ec=new _0x17a7da(_0x4c2e16,null,_0x288367,_0x3e92b7['markers'],!0x0,_0x1deeeb++);_0x298021['push'](_0x1b52ec);}}if(_0x327652)for(const [_0x3e418a,_0x209993]of Object['entries'](_0x327652)){const _0x3831d3=_0x3e92b7['document']['getRoot'](_0x3e418a);if(!_0x3831d3)throw new _0x3443e5('multi-root-editor-root-attributes-no-root',null);for(const [_0x275640,_0x55b22b]of Object['entries'](_0x209993))if(null!==_0x55b22b){const _0x941c48=new _0x44a68e(_0x3831d3,_0x275640,null,_0x55b22b,_0x1deeeb++);_0x298021['push'](_0x941c48);}}return _0x298021;}async['_loadRoot'](_0x2b5783,_0x12f240,_0x4eac92){this['_getOperationsFromInitData']({[_0x2b5783]:_0x12f240},{[_0x2b5783]:_0x4eac92})['forEach']((_0xda459a,_0xb6c7d2)=>{_0xda459a['baseVersion']=this['_document']['version']+_0xb6c7d2,_0xda459a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0xda459a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x39044c,_0x5e5be5){let _0x4b49fc;this['_offset']=_0x39044c['offset'];const _0x307984=_0x39044c['wereChangesApplied']&&!_0x39044c['initData'],_0x2b396f=_0x307984?0x0:_0x39044c['data']['baseVersion'];if(_0x5e5be5['forEach'](_0x1e8f0a=>{_0x1e8f0a['_isInit']=!0x0,_0x1e8f0a['createdAt']=_0x39044c['sessionCreatedAt'],_0x1e8f0a['_authorId']=null;}),_0x307984)_0x4b49fc=_0x5e5be5,this['_applyOperationsSet'](_0x4b49fc,_0x307984);else{if(_0x39044c['initData']){const _0x1c6590=this['_getOperationsFromInitData'](_0x39044c['initData']);this['_document']['history']['version']=-_0x1c6590['length'],_0x1c6590['forEach'](_0x3f9770=>{_0x3f9770['baseVersion']-=_0x1c6590['length'],_0x3f9770['createdAt']=_0x39044c['sessionCreatedAt'],_0x3f9770['_isInit']=!0x0,_0x3f9770['_authorId']=null;}),this['_applyOperationsSet'](_0x1c6590,!0x0),this['serverHistory']['version']=-_0x1c6590['length']+this['_offset'],this['_updateServerHistory'](_0x1c6590);}this['_document']['history']['version']=_0x2b396f,_0x4b49fc=this['_decompressOperations'](_0x39044c['data'],_0x39044c['metadata']),await this['_fetchMissingUsers'](_0x4b49fc),this['_applyOperationsSet'](_0x4b49fc,_0x307984);}_0x39044c['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x4b49fc,_0x39044c['lastOperationId']),this['_lastSyncedOperationId']=_0x39044c['lastOperationId']),this['serverHistory']['version']=_0x2b396f+this['_offset'],this['_updateServerHistory'](_0x4b49fc),_0x5e5be5['filter'](_0x2d9b31=>{const _0x597415=this['_getAffectedRoot'](_0x2d9b31);return _0x597415&&!this['_knownRootNames']['has'](_0x597415);})['forEach']((_0x1bd300,_0x30891b)=>{_0x1bd300['baseVersion']=this['_document']['version']+_0x30891b,this['_saveOperationInBuffer'](_0x1bd300);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x2a7dbc,_0xcd85d,_0x1b5e42){throw this['_isPendingUpdate']=!0x0,_0xcd85d&&console['error'](_0xcd85d),_0x1b5e42&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3443e5(_0x2a7dbc,this['editor']);}['_saveOperationInBuffer'](_0x45c8f4){this['_knownOperations']['has'](_0x45c8f4)||(this['_knownOperations']['add'](_0x45c8f4),this['_bufferedOperations']['push'](_0x45c8f4),this['_pendingAction']||'marker'==_0x45c8f4['type']&&!_0x45c8f4['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x11ce07=!0x1){!_0x11ce07&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x4db03f=>{_0x4db03f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x530dcb=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x5b075b){return _0x5b075b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5b075b['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x5b075b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x530dcb)||this['_crash'](_0x530dcb['message'],_0x530dcb,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x447394=>{this['on']('change:_isPendingUpdate',()=>{_0x447394();});});}async['_sendBufferedOperations'](){const _0x2d32b1=this['editor']['plugins']['get'](N);if(this['_shouldSendSelectionUpdate']()&&(_0x2d32b1['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3bc901=[...this['_bufferedOperations']];for(const _0x3dabba of _0x3bc901)_0x3dabba['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3dabba);const _0x35a3a6=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3bc901),_0x40d9e9=M++,_0xcc0400=this['_compressOperations'](_0x3bc901),_0x3fa78d=await this['_service']['sendOperations'](_0xcc0400,_0xcc0400['baseVersion'],_0x35a3a6);try{return await this['_handleServerResponse'](_0x3bc901,_0x3fa78d,_0x40d9e9);}catch(_0x4ea29c){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x4ea29c);}}async['_handleServerResponse'](_0x301704,_0x318fbf,_0x4a8282){if('error'in _0x318fbf)throw _0x318fbf['error'];let _0x439969=!0x1;if(_0x318fbf['wereChangesApplied']){_0x318fbf['lastOperationId']&&(this['_lastSyncedOperationId']=_0x318fbf['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x181761=>!_0x301704['includes'](_0x181761));for(const _0x39c6fa of _0x301704)_0x39c6fa['createdAt']='lastOperationAcceptedAt'in _0x318fbf&&_0x318fbf['lastOperationAcceptedAt']||void 0x0;V(_0x301704,_0x318fbf['version']-_0x301704['length']),this['_updateServerHistory'](_0x301704);const _0x482320=_0x301704['filter'](_0x17b2f3=>{if(!_0x17b2f3['_isInit'])return!0x1;const _0x5348d2=this['_getAffectedRoot'](_0x17b2f3);return _0x5348d2&&!this['_knownRootNames']['has'](_0x5348d2);});V(_0x482320,this['_document']['version']),this['_applyOperationsSet'](_0x482320),_0x439969=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x4edb3f=this['_decompressOperations'](_0x318fbf['data'],_0x318fbf['metadata'])['filter'](_0x23df2c=>_0x23df2c['baseVersion']>=this['_lastServerVersion']);_0x4edb3f['forEach'](_0x1ae6b3=>this['_addKnownRoot'](_0x1ae6b3)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5b7ecb=>!_0x5b7ecb['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5b7ecb))),this['_bufferedOperations']['length']&&V(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x4edb3f),_0x439969=this['_handleExternalOperations'](_0x4edb3f,_0x318fbf['version'],_0x318fbf['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x439969?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x17a7e4,_0x5baab1,_0x41645c){try{const _0x3a67ae={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x243791,operationsB:_0x468f9f,originalOperations:_0x4efdcb}=_0x1790a5(_0x17a7e4,this['_bufferedOperations'],_0x3a67ae);V(_0x243791,this['_document']['version']),V(_0x468f9f,_0x5baab1);for(const _0x3e6de2 of _0x243791){const _0x2847b7=_0x4efdcb['get'](_0x3e6de2);_0x3e6de2['_authorId']=_0x2847b7?_0x2847b7['_authorId']:null;}_0x41645c&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x17a7e4,_0x41645c),this['_lastSyncedOperationId']=_0x41645c),this['_bufferedOperations']=[..._0x468f9f],this['_applyOperationsSet'](_0x243791),this['_updateServerHistory'](_0x17a7e4);}catch(_0x411410){return console['error'](_0x411410),!0x1;}return!0x0;}['_applyOperationsSet'](_0x494f02,_0x120f71=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x419d6f=>{for(const _0x3ed52b of _0x494f02)this['_knownOperations']['add'](_0x3ed52b),this['_addKnownRoot'](_0x3ed52b),_0x419d6f['batch']['addOperation'](_0x3ed52b),this['editor']['model']['applyOperation'](_0x3ed52b);});}['_addKnownRoot'](_0x2f4810){const _0x5f2432=this['_getAffectedRoot'](_0x2f4810);_0x5f2432&&this['_knownRootNames']['add'](_0x5f2432);}['_getAffectedRoot'](_0x2869ca){let _0x4bb83a,_0x3094d1;switch(_0x2869ca['type']){case'insert':_0x4bb83a=_0x2869ca['position']['root'];break;case'marker':if(_0x3094d1=_0x2869ca['newRange'],!_0x3094d1)return null;_0x4bb83a=_0x3094d1['root'];break;case'addRootAttribute':_0x4bb83a=_0x2869ca['root'];break;case'addRoot':_0x4bb83a=_0x2869ca['affectedSelectable'];break;case'move':_0x4bb83a=_0x2869ca['targetPosition']['root'];break;default:return null;}return _0x4bb83a['rootName'];}['_updateServerHistory'](_0xf4c4d9){_0xf4c4d9['forEach'](_0x4f3b8c=>{const _0x481f7d=_0x4f3b8c['clone']();_0x481f7d['_authorId']=_0x4f3b8c['_authorId'],_0x481f7d['_isInit']=!!_0x4f3b8c['_isInit'],_0x481f7d['createdAt']=_0x4f3b8c['createdAt'],_0x481f7d['baseVersion']+=this['_offset'],_0x4f3b8c['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x481f7d),this['serverHistory']['addOperation'](_0x481f7d);});}['_handleReconnectionError'](_0x59e9db){const _0x2cb87a=this['editor']['plugins']['get']('Notification'),_0x35f014=this['editor']['locale'];_0x59e9db||(_0x59e9db=E(_0x35f014,'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.')),_0x2cb87a['showWarning'](_0x59e9db,{'title':E(_0x35f014,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x491601)['add'](E(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x491601)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x44ded6){const _0x273d87=_0x44ded6['map'](_0x3c638f=>_0x3c638f['toJSON']());return this['_compressor']['compress'](_0x273d87);}['_decompressOperations'](_0x37010a,_0x569f64){return this['_compressor']['decompress'](_0x37010a)['map']((_0xb64a4c,_0x27597d)=>{const _0x24e606='init'==_0x569f64[_0x27597d]['type'];if('InsertOperation'==_0xb64a4c['__className']){const _0x57b9c4=_0xb64a4c['position']['root'];!this['_document']['getRoot'](_0x57b9c4)&&(this['_document']['createRoot']('$root',_0x57b9c4)['_isAttached']=!0x1);}const _0x20a49f=_0x540e13['fromJSON'](_0xb64a4c,this['_document']);return _0x20a49f['wasUndone']=_0xb64a4c['wasUndone'],_0x20a49f['_isInit']=_0x24e606,_0x20a49f['_authorId']=_0x24e606?null:_0x569f64[_0x27597d]['userId'],_0x20a49f['_isDisconnection']='cs:removeUser'===_0x569f64[_0x27597d]['type'],_0x20a49f['createdAt']=_0x569f64[_0x27597d]['createdAt'],_0x20a49f;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x5aa1a2=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x5aa1a2&&_0x5aa1a2['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class z extends Error{}function V(_0x126f7a,_0x40eb6f){for(const _0x23591f of _0x126f7a)_0x23591f['baseVersion']=_0x40eb6f++;}class W{['_ignoredOperations'];['_operationToId'];constructor(_0x36f50e){this['_ignoredOperations']=_0x36f50e,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x5cfb83){let _0x1ce9b4=_0x5cfb83['length'];for(;_0x1ce9b4--;){const _0x2e35ae=_0x5cfb83[_0x1ce9b4];if(!this['_ignoredOperations']['has'](_0x2e35ae)){if(!this['_operationToId']['has'](_0x2e35ae)){const _0x36caa5=_0x3831d0()['slice'](0x1,0x12);this['_operationToId']['set'](_0x2e35ae,_0x36caa5);}return this['_operationToId']['get'](_0x2e35ae);}}}['setIdForTheLastOperation'](_0x5135dc,_0x3204fa){if(!_0x3204fa)return;let _0x17edcb=_0x5135dc['length'];for(;_0x17edcb--;){const _0x57fa0a=_0x5135dc[_0x17edcb];this['_ignoredOperations']['has'](_0x57fa0a)||this['_operationToId']['set'](_0x57fa0a,_0x3204fa);}}}class n extends _0x3b1a90{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x375b1b{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x3354a4)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x4fe278];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2e4294){super(_0x2e4294),this['_services']=new Map();}async['init'](){const _0x2729d5=this['context'],_0x1215d6=_0x2729d5['plugins']['get']('CommentsRepository');if(_0x2729d5['plugins']['get'](c)['addToReconnectionStack'](this),_0x1215d6['adapter']={'addCommentThread':async({channelId:_0xd5e649,threadId:_0x51d395,comments:_0x1b012f,resolvedAt:_0x40d5af,resolvedBy:_0xc07d57,context:_0x1b2b56,attributes:_0x478a26})=>{const _0x394e8c=await this['_getService'](_0xd5e649)['addCommentThread']({'commentThreadId':_0x51d395,'comments':_0x1b012f['map'](_0xff77b9=>function(_0x311d79,_0x5b8b68,_0x1c2123){return{'commentThreadId':_0x1c2123,'commentId':_0x311d79['commentId'],'userId':_0x311d79['authorId'],'content':_0x311d79['content'],'documentId':_0x5b8b68,'createdAt':_0x311d79['createdAt'],'attributes':_0x311d79['attributes']||{}};}(_0xff77b9,_0xd5e649,_0x51d395)),'resolvedAt':_0x40d5af,'resolvedBy':_0xc07d57,'context':_0x1b2b56,'attributes':_0x478a26})['catch'](gt);return{'threadId':_0x394e8c['commentThreadId'],'comments':_0x394e8c['comments']};},'getCommentThread':async({channelId:_0x181118,threadId:_0x287a99})=>{const _0x3cc209=await this['_getService'](_0x181118)['getCommentThread'](_0x287a99)['catch'](gt);return _0x3cc209['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x3cc209]),{'threadId':_0x3cc209['commentThreadId'],'comments':_0x3cc209['comments']['map'](b),'context':_0x3cc209['context'],'resolvedAt':_0x3cc209['resolvedAt'],'resolvedBy':_0x3cc209['resolvedBy'],'attributes':_0x3cc209['attributes']||{}});},'updateCommentThread':async({channelId:_0x1cb468,threadId:_0x3d205a,context:_0x213a5b,unlinkedAt:_0x37cd38,attributes:_0x236db1})=>this['_getService'](_0x1cb468)['updateCommentThread']({'commentThreadId':_0x3d205a,'context':_0x213a5b,'attributes':_0x236db1,'unlinkedAt':_0x37cd38})['catch'](y)['catch'](gt),'resolveCommentThread':async({channelId:_0x157382,threadId:_0x377f1c})=>{const _0x3a9528=await this['_getService'](_0x157382)['resolveCommentThread'](_0x377f1c)['catch'](y)['catch'](gt);return{'threadId':_0x3a9528['commentThreadId'],'resolvedAt':_0x3a9528['resolvedAt'],'resolvedBy':_0x3a9528['resolvedBy']};},'reopenCommentThread':async({channelId:_0x498b93,threadId:_0x48f5f9})=>this['_getService'](_0x498b93)['reopenCommentThread'](_0x48f5f9)['catch'](y)['catch'](gt),'removeCommentThread':({channelId:_0x25768a,threadId:_0x5515f3})=>this['_getService'](_0x25768a)['removeCommentThread'](_0x5515f3)['catch'](y)['catch'](gt),'addComment':({channelId:_0x114690,threadId:_0x282f6d,commentId:_0x3195e0,content:_0x49cee7,attributes:_0x41d0c8})=>this['_getService'](_0x114690)['addComment'](_0x282f6d,_0x3195e0,_0x49cee7,_0x41d0c8)['catch'](gt),'updateComment':({channelId:_0x11bea2,threadId:_0x26a799,commentId:_0x590238,content:_0x34357a,attributes:_0x3c922f})=>this['_getService'](_0x11bea2)['updateComment'](_0x26a799,_0x590238,_0x34357a,_0x3c922f)['catch'](y)['catch'](gt),'removeComment':({channelId:_0x35599b,threadId:_0x3911a3,commentId:_0x2ae8dd})=>this['_getService'](_0x35599b)['removeComment'](_0x3911a3,_0x2ae8dd)['catch'](y)['catch'](gt)},_0x2729d5 instanceof _0x445727){const _0x51cbb4=_0x2729d5['config']['get']('collaboration.channelId'),_0x16359b=_0x2729d5['plugins']['get'](i);await this['_setUpService'](_0x51cbb4);const _0x1e5099=await this['_services']['get'](_0x51cbb4)['getConnectedSessions']();this['listenTo'](_0x16359b,'sessionAdd:'+_0x51cbb4,(_0x24e609,{session:_0xecbe49})=>{_0xecbe49['id']===_0x16359b['mySessionId']&&(_0x24e609['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0xecbe49['permissions'],_0x51cbb4));}),_0x16359b['register'](_0x51cbb4,_0x1e5099);}}async['_setUpService'](_0x313342){if(this['_services']['has'](_0x313342))throw new _0x3443e5('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x313342});const _0x310de3=this['context']['plugins']['get']('CommentsRepository'),_0x5c6b5a=new a['CommentsService'](_0x313342);this['_services']['set'](_0x313342,_0x5c6b5a),this['listenTo'](_0x5c6b5a,'commentThreadAdded',(_0x1510bf,_0x5b9676)=>{const {commentThreadId:_0x1474cb,documentId:_0xe60eeb,context:_0x18aa69,attributes:_0x4bf455,resolvedAt:_0xe55393,resolvedBy:_0x2ec56f,comments:_0xcb8b8e}=_0x5b9676;_0x310de3['getCommentThread'](_0x1474cb)||_0x310de3['addCommentThread']({'threadId':_0x1474cb,'channelId':_0xe60eeb,'comments':_0xcb8b8e?_0xcb8b8e['map'](b):[],'context':_0x18aa69,'attributes':_0x4bf455,'resolvedAt':_0xe55393,'resolvedBy':_0x2ec56f,'isFromAdapter':!0x0});}),this['listenTo'](_0x5c6b5a,'commentThreadUpdated',(_0x2501c1,{commentThreadId:_0x55a263,documentId:_0x35cc4c,context:_0x48273a,unlinkedAt:_0xfd57d,attributes:_0xf7e017})=>{_0x310de3['getCommentThread'](_0x55a263)&&_0x310de3['updateCommentThread']({'threadId':_0x55a263,'channelId':_0x35cc4c,'context':_0x48273a,'unlinkedAt':_0xfd57d,'attributes':_0xf7e017,'isFromAdapter':!0x0});}),this['listenTo'](_0x5c6b5a,'commentThreadResolved',(_0x4e48b9,{commentThreadId:_0x37b6ab,resolvedBy:_0x517b40,resolvedAt:_0x5e0f22})=>{const _0x2060f0=_0x310de3['getCommentThread'](_0x37b6ab);_0x2060f0&&_0x2060f0['resolve']({'resolvedBy':_0x517b40,'resolvedAt':_0x5e0f22,'isFromAdapter':!0x0});}),this['listenTo'](_0x5c6b5a,'commentThreadReopened',(_0x17ef2a,{commentThreadId:_0x15875d})=>{const _0x32ccdd=_0x310de3['getCommentThread'](_0x15875d);_0x32ccdd&&_0x32ccdd['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5c6b5a,'commentThreadRemoved',(_0x5b5237,{commentThreadId:_0xf71d98})=>{const _0x155156=_0x310de3['getCommentThread'](_0xf71d98);_0x155156&&_0x155156['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5c6b5a,'commentAdded',(_0x35fe27,_0x3187cc)=>{const _0x550259=_0x3187cc['commentThreadId'],_0x2c08cb=_0x310de3['getCommentThread'](_0x550259);_0x2c08cb&&_0x2c08cb['addComment']({...b(_0x3187cc),'isFromAdapter':!0x0});}),this['listenTo'](_0x5c6b5a,'commentUpdated',(_0x40a9d3,{commentThreadId:_0x42c4d8,commentId:_0x1a2b4f,content:_0x1d330,attributes:_0x56ea18})=>{const _0x4a1619=_0x310de3['getCommentThread'](_0x42c4d8);if(_0x4a1619){const _0x9d5491=_0x4a1619['getComment'](_0x1a2b4f);_0x9d5491&&_0x9d5491['update']({'content':_0x1d330,'attributes':_0x56ea18,'isFromAdapter':!0x0});}}),this['listenTo'](_0x5c6b5a,'commentRemoved',(_0x2a4944,{commentThreadId:_0x2bd65a,commentId:_0x40a5f6})=>{const _0x47cfe5=_0x310de3['getCommentThread'](_0x2bd65a);if(_0x47cfe5){const _0x39a891=_0x47cfe5['getComment'](_0x40a5f6);_0x39a891&&_0x39a891['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x313342);}['destroy'](){if(this['context']instanceof _0x445727){const _0x55f468=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x55f468);}}['_terminateService'](_0x2a0ddd){if(!this['_services']['has'](_0x2a0ddd))throw new _0x3443e5('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x2a0ddd});this['_getService'](_0x2a0ddd)['disconnect'](),this['_services']['delete'](_0x2a0ddd);}async['reconnect'](){for(const _0x2ce61e of this['_services']['keys']())await this['_connectService'](_0x2ce61e);if(this['context']instanceof _0x445727){const _0x328d44=this['context']['config']['get']('collaboration.channelId'),_0x4785b3=this['context']['plugins']['get'](i);_0x4785b3['unregister'](_0x328d44);const _0x4d80c2=await this['_services']['get'](_0x328d44)['getConnectedSessions']();_0x4785b3['register'](_0x328d44,_0x4d80c2);}}async['_connectService'](_0x3fd4c6){const {connection:_0x55652d}=this['context']['plugins']['get'](c),_0x307db2=this['context']['plugins']['get']('CommentsRepository'),_0x64e4be=this['_services']['get'](_0x3fd4c6),_0x155268=await _0x64e4be['connect'](_0x55652d);await this['_fetchMissingUsersForThreads'](_0x155268);const _0x452cc6=new Set(Array['from'](_0x307db2['getCommentThreads']({'channelId':_0x3fd4c6}),_0x5260df=>_0x5260df['id']));for(const _0x182292 of _0x155268)_0x182292['deletedAt']||_0x452cc6['delete'](_0x182292['commentThreadId']);for(const _0x37062b of _0x452cc6)_0x307db2['getCommentThread'](_0x37062b)['remove']({'isFromAdapter':!0x0});for(const _0x189978 of _0x155268){let _0x20805f=_0x307db2['getCommentThread'](_0x189978['commentThreadId']);const {commentThreadId:_0x1d72b4,context:_0x786ede,attributes:_0x52f059,resolvedBy:_0xa65230,resolvedAt:_0x1d729e,unlinkedAt:_0x14a6eb,deletedAt:_0x14f127}=_0x189978;if(_0x14f127)continue;_0x20805f||(_0x20805f=_0x307db2['addCommentThread']({'channelId':_0x3fd4c6,'threadId':_0x1d72b4,'context':_0x786ede,'attributes':_0x52f059||{},'resolvedBy':_0xa65230,'resolvedAt':_0x1d729e,'unlinkedAt':_0x14a6eb,'isFromAdapter':!0x0}));const _0xccb9d7=new Set(Array['from'](_0x20805f['comments'],_0x2ae594=>_0x2ae594['id']));for(const _0x26e501 of _0x189978['comments'])_0xccb9d7['delete'](_0x26e501['commentId']);for(const _0x2ecda8 of _0xccb9d7)_0x20805f['getComment'](_0x2ecda8)['remove']({'isFromAdapter':!0x0});for(const _0x1703ec of _0x189978['comments']){const _0x3d7573=_0x20805f['getComment'](_0x1703ec['commentId']);_0x3d7573?_0x3d7573['content']!==_0x1703ec['content']&&_0x3d7573['update']({'content':_0x1703ec['content'],'isFromAdapter':!0x0}):_0x20805f['addComment'](Object['assign'](b(_0x1703ec),{'isFromAdapter':!0x0}));}}}['_getService'](_0xf99476){if(!this['_services']['has'](_0xf99476))throw new _0x3443e5('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xf99476});return this['_services']['get'](_0xf99476);}async['_fetchMissingUsersForThreads'](_0x152968){const _0x5d61b9=this['context']['plugins']['get'](_0x4fe278),{connection:_0x1c69df}=this['context']['plugins']['get'](c),_0x5d4c37=new Set();for(const {resolvedBy:_0x2cb039,comments:_0x13fb75}of _0x152968){_0x2cb039&&!_0x5d61b9['getUser'](_0x2cb039)&&_0x5d4c37['add'](_0x2cb039);for(const {userId:_0x428df0}of _0x13fb75)_0x5d61b9['getUser'](_0x428df0)||_0x5d4c37['add'](_0x428df0);}if(0x0===_0x5d4c37['size'])return;const _0x4e6292=await mt['getMany'](_0x1c69df,Array['from'](_0x5d4c37));for(const _0x5beabf of _0x4e6292)_0x5d61b9['getUser'](_0x5beabf['id'])||_0x5d61b9['addUser'](_0x5beabf);}}async function y(_0x588aed){if('404'!==_0x588aed['code'])throw _0x588aed;}function gt(_0x4732ac){if((_0x443bbb=_0x4732ac)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x443bbb['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x443bbb['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x443bbb;throw _0x4732ac;}function b(_0x2a138c){return{'threadId':_0x2a138c['commentThreadId'],'commentId':_0x2a138c['commentId'],'content':_0x2a138c['content'],'createdAt':_0x2a138c['createdAt'],'authorId':_0x2a138c['userId'],'attributes':_0x2a138c['attributes']||{}};}class f extends _0x3b1a90{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>nt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51bdc5){super(_0x51bdc5);const _0x313212=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x313212);}['init'](){const _0x4d560c=this['editor']['plugins']['get'](c),_0x48f063=this['editor']['plugins']['get']('TrackChangesEditing');return _0x48f063['adapter']={'getSuggestion':async _0x2a5313=>{await this['_waitForServiceReady']();const _0x1db4bc=await this['_trackChangesService']['get'](_0x2a5313)['catch'](w);return await this['_fetchMissingUsersForThreads']([_0x1db4bc]),_0x1db4bc;},'addSuggestion':async({id:_0x7c794f,type:_0x467829,data:_0x152474,originalSuggestionId:_0x591548,attributes:_0x129858})=>{await this['_waitForServiceReady']();const _0x3cda3e={'id':_0x7c794f,'type':_0x467829,'data':_0x152474,'originalSuggestionId':_0x591548,'attributes':_0x129858},_0x5f0de4=await this['_trackChangesService']['add'](_0x7c794f,_0x467829,_0x152474,_0x591548,_0x129858)['catch'](_0x149c3f=>{if(wt(_0x149c3f))return new Promise(_0x495f8a=>{this['_bufferedRequests']['set'](_0x7c794f,{'resolve':_0x495f8a,'suggestionData':_0x3cda3e});});throw _0x149c3f;});return this['_bufferedRequests']['delete'](_0x7c794f),_0x5f0de4;},'updateSuggestion':async(_0x2191ce,_0x483227)=>{if(await this['_waitForServiceReady'](),'open'!==_0x483227['state'])return this['_trackChangesService']['update'](_0x2191ce,_0x483227)['catch'](w);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x56ab3b,_0x4cdcb7)=>{_0x48f063['hasSuggestion'](_0x4cdcb7['id'])&&(_0x48f063['getSuggestion'](_0x4cdcb7['id'])['attributes']=_0x4cdcb7['attributes']);}),this['_trackChangesService']['connect'](_0x4d560c['connection'])['then'](_0x38be6b=>(_0x4d560c['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x38be6b)['then'](()=>{for(const _0x19eac3 of _0x38be6b){_0x48f063['addSuggestionData'](_0x19eac3)['_saved']=!0x0;}})));}async['reconnect'](){const _0xd01241=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1e21b0}=this['editor']['plugins']['get'](c),_0x14fc60=await this['_trackChangesService']['connect'](_0x1e21b0);await this['_fetchMissingUsersForThreads'](_0x14fc60);for(const {suggestionData:_0x3b4c45,resolve:_0x5e426c}of this['_bufferedRequests']['values']()){let _0x20798f=_0x14fc60['find'](_0x337e9c=>_0x337e9c['id']===_0x3b4c45['id']);_0x20798f||(_0x20798f=await this['_trackChangesService']['add'](_0x3b4c45['id'],_0x3b4c45['type'],_0x3b4c45['data'],_0x3b4c45['originalSuggestionId'])),_0x5e426c(_0x20798f);}for(const _0x218afc of _0x14fc60)_0xd01241['hasSuggestion'](_0x218afc['id'])||_0xd01241['addSuggestionData'](_0x218afc);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x9b154a=>{this['listenTo'](this['_trackChangesService'],'connected',_0x829ca0=>{_0x829ca0['off'](),_0x9b154a();});});}async['_fetchMissingUsersForThreads'](_0x27442f){const _0x1654c7=this['editor']['plugins']['get'](_0x4fe278),{connection:_0x4a82ed}=this['editor']['plugins']['get'](c),_0xd8d4dc=new Set();for(const {authorId:_0x268971}of _0x27442f)_0x1654c7['getUser'](_0x268971)||_0xd8d4dc['add'](_0x268971);if(0x0===_0xd8d4dc['size'])return;const _0x3249a1=await mt['getMany'](_0x4a82ed,Array['from'](_0xd8d4dc));for(const _0xef079 of _0x3249a1)_0x1654c7['getUser'](_0xef079['id'])||_0x1654c7['addUser'](_0xef079);}}function w(_0x226313){if(wt(_0x226313))return new Promise(()=>{});throw _0x226313;}function wt(_0x4a96e2){return _0x4a96e2['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x4a96e2['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x3b1a90{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1b98b1=this['editor']['plugins']['get'](c),_0x3526aa=this['editor']['plugins']['get']('CommentsEditing'),_0x5d6bf2=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x1b98b1,'change:state',(_0x32c166,_0x45ac29,_0x1b98b5)=>{_0x3526aa['isThreadsLoadingPaused']='connected'!==_0x1b98b5;});}),this['listenTo'](_0x1b98b1,'change:state',(_0x15178f,_0xeb51fb,_0x546cfa)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x546cfa);}),_0x5d6bf2['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x3b1a90{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x3b1a90{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>_0x141eee)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x4fe278];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5160a3){super(_0x5160a3);const _0x520633=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x520633);}async['init'](){const _0x1e69e8=this['editor']['plugins']['get'](l),_0x23903e=_0x1e69e8['serverHistory'],_0x2b3d2f=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x23903e,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x1e69e8['sessionId']});const _0x3b69e7=this['editor']['config']['get']('cloudServices.bundleVersion')||dt,_0x12a74c=await _0x132f7f['isBundleUploaded'](_0x2b3d2f['connection'],_0x3b69e7);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x4a53c6})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4a53c6)),'updateRevisions':async _0x769f13=>{await this['_waitForServiceReady']();const _0x3969ee=this['_revisionTracker']['currentRevision'];if(_0x12a74c&&0x1===_0x769f13['length']&&_0x769f13[0x0]['id']===_0x3969ee['id'])return _0x769f13;for(const _0x31136e of _0x769f13)_0x31136e['id']===_0x3969ee['id']&&(_0x31136e['isEmptyCurrent']=_0x31136e['fromVersion']===_0x31136e['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x769f13,this['_lastRequestId'])['then'](_0x40f064=>(this['_lastRequestId']=_0x40f064,_0x769f13))['catch'](_0x49f9c5=>{if(X(_0x49f9c5)||'400'===_0x49f9c5['code']&&void 0x0!==_0x49f9c5['data']['wrongRequestId']){for(const _0x177a73 of _0x769f13){!this['_revisionTracker']['repository']['getRevision'](_0x177a73['id'])||this['_revisionTracker']['_bufferUpdate'](_0x177a73['id'],_0x177a73,!0x1);}if(X(_0x49f9c5))throw _0x49f9c5;return _0x769f13;}throw _0x49f9c5;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x2cb35e,{revisionsData:_0xafe875,requestId:_0x1985b0})=>{Math['max'](..._0xafe875['map'](_0x24bf3b=>_0x24bf3b['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0xafe875,_0x1985b0);}):this['_handleRevisionsUpdate'](_0xafe875,_0x1985b0);});const {revisions:_0x59d0b6,requestId:_0x325554}=await this['_revisionHistoryService']['connect'](_0x2b3d2f['connection']);_0x2b3d2f['addToReconnectionStack'](this),this['_lastRequestId']=_0x325554,await this['_fetchMissingUsers'](_0x59d0b6);for(const _0x12ef1e of _0x59d0b6)this['_revisionTracker']['addRevisionData'](_0x12ef1e);this['listenTo'](_0x1e69e8,'change:_isConnected',(_0x4169ed,_0x1e614b,_0x29c3a0)=>{_0x29c3a0&&(this['_oldOffset']=_0x1e69e8['_offset'],_0x4169ed['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x2b3d2f,'state',_0x488b5e=>_0x488b5e===_0x51d08e['CONNECTED']);}async['reconnect'](){const _0x13a0aa=this['editor']['plugins']['get'](c),_0x5b2803=this['editor']['plugins']['get'](l),_0x147e05=async()=>{const _0x2d01c7=this['_revisionTracker']['currentRevision'],_0xae1ab3=_0x2d01c7['id'],_0x30658=_0xae1ab3!==_0x5b2803['sessionId'];if(_0x30658){const _0x3219e5=_0x5b2803['_offset']-this['_oldOffset'],_0x10fd77=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x2d01c7['toVersion']+_0x3219e5!==_0x10fd77){const _0x58c2e7=_0x2d01c7['fromVersion']+_0x3219e5,_0x3de5cc=this['editor']['plugins']['get'](_0x4fe278),_0x34f40d=this['_revisionTracker']['buildRevisionData']({'revision':_0x2d01c7,'from':_0x58c2e7,'to':_0x10fd77});_0x34f40d['id']=_0x2d01c7['id'];const _0x1d711a=_0x34f40d['authorsIds']['map'](_0x4770a1=>_0x3de5cc['getUser'](_0x4770a1));_0x2d01c7['_update']({..._0x34f40d,'authors':_0x1d711a},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x2d01c7['id'],_0x34f40d,!0x0);}this['_revisionTracker']['_startingVersion']=_0x10fd77,(_0x2d01c7['toVersion']===_0x2d01c7['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xae1ab3)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xae1ab3),this['_revisionTracker']['_createCurrentRevision'](_0x10fd77));}const {revisions:_0x5a0563,requestId:_0x17ac98}=await this['_revisionHistoryService']['reconnect'](_0x13a0aa['connection'],this['_lastRequestId']);_0x30658&&_0x5a0563['length']>0x0?_0x5b2803['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x5a0563),this['_handleRevisionsUpdate'](_0x5a0563,_0x17ac98),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5b2803['_isConnected']?_0x147e05():new Promise((_0x51ceff,_0x1a159c)=>{_0x5b2803['once']('change:_isConnected',()=>{_0x147e05()['then'](_0x51ceff)['catch'](_0x1a159c);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x7a515f=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x4e666c=>{_0x4e666c['off'](),_0x7a515f();});});}['_getLatestVersionFromServerOperations'](){const _0x5073f8=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2c101f of _0x5073f8)if('marker'!==_0x2c101f['type']||_0x2c101f['affectsData'])return _0x2c101f['baseVersion']+0x1;}['_getLatestVersion'](){const _0x29b394=this['editor']['plugins']['get'](l);return new Promise(_0x38feb7=>{_0x29b394['_isPendingUpdate']?_0x29b394['once']('change:_isPendingUpdate',()=>{_0x38feb7(this['_getLatestVersionFromServerOperations']());}):_0x38feb7(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x4a174e,_0xe11f){const _0x536281=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xe11f;for(const _0x3af240 of _0x4a174e){const _0x471cc2=_0x536281['getRevision'](_0x3af240['id']);if(_0x471cc2){if((_0x3af240['fromVersion']||_0x3af240['toVersion'])&&(_0x3af240['diffData']=null),_0x471cc2===this['_revisionTracker']['currentRevision']){const _0x69b19e=Math['max'](_0x471cc2['toVersion'],_0x3af240['toVersion']),_0x5737cc=Math['max'](_0x471cc2['fromVersion'],_0x3af240['fromVersion']);let _0x1f6e48;_0x471cc2['toVersion']===_0x3af240['toVersion']&&_0x471cc2['fromVersion']===_0x3af240['fromVersion']?(_0x1f6e48=!0x0,this['_preventResendingRevisionData'](_0x3af240)):_0x3af240['toVersion']===_0x69b19e&&_0x3af240['fromVersion']===_0x5737cc?_0x1f6e48=!0x1:(_0x471cc2['toVersion']===_0x69b19e&&_0x471cc2['fromVersion']===_0x5737cc||this['_fixRevision']({'revision':_0x471cc2,'from':_0x5737cc,'to':_0x69b19e}),_0x1f6e48=!0x0),_0x1f6e48&&(delete _0x3af240['fromVersion'],delete _0x3af240['toVersion'],delete _0x3af240['diffData'],delete _0x3af240['createdAt'],delete _0x3af240['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x3af240),this['_preventResendingRevisionData'](_0x3af240);}else this['_revisionTracker']['addRevisionData'](_0x3af240);}const _0x3e61b0=_0x536281['getRevisions']();_0x3e61b0['reverse']();for(let _0x23a35b=0x0;_0x23a35b<_0x3e61b0['length']-0x1;_0x23a35b++){const _0x31e4d9=_0x3e61b0[_0x23a35b],_0x1eafd1=_0x3e61b0[_0x23a35b+0x1];if(_0x31e4d9['fromVersion']<_0x1eafd1['toVersion']){const _0x2db3dc=_0x1eafd1['toVersion'],_0x1b997c=Math['max'](_0x2db3dc,_0x31e4d9['toVersion']);this['_fixRevision']({'revision':_0x31e4d9,'from':_0x2db3dc,'to':_0x1b997c});}}}['_fixRevision']({revision:_0x2bd86c,from:_0x2297b1,to:_0x1c6b10}={}){const _0x166733=this['editor']['plugins']['get'](_0x4fe278),_0x159b0a=this['_revisionTracker']['buildRevisionData']({'revision':_0x2bd86c,'from':_0x2297b1,'to':_0x1c6b10});_0x159b0a['authors']=_0x159b0a['authorsIds']['map'](_0x18f49a=>_0x166733['getUser'](_0x18f49a)),_0x2bd86c['_update'](_0x159b0a);}['_preventResendingRevisionData'](_0x242191){const _0x45e917={};_0x45e917['id']=_0x242191['id'];for(const _0x51acce of Object['keys'](_0x242191))'id'!==_0x51acce&&(_0x45e917[_0x51acce]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x45e917['id'],_0x45e917,!0x0);}async['_fetchMissingUsers'](_0x139f5c){const _0x203668=this['editor']['plugins']['get'](_0x4fe278),{connection:_0x2232fa}=this['editor']['plugins']['get'](c),_0x2136ad=new Set();for(const _0x3af32f of _0x139f5c){for(const _0x569c90 of _0x3af32f['authorsIds'])_0x370b90(_0x569c90);_0x3af32f['creatorId']&&_0x370b90(_0x3af32f['creatorId']);}if(0x0===_0x2136ad['size'])return;const _0x64b8ba=await mt['getMany'](_0x2232fa,Array['from'](_0x2136ad));for(const _0x250f92 of _0x64b8ba)_0x203668['getUser'](_0x250f92['id'])||_0x203668['addUser'](_0x250f92);function _0x370b90(_0x549b21){_0x203668['getUser'](_0x549b21)||_0x2136ad['add'](_0x549b21);}}}function X(_0x25ab06){return _0x25ab06['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x25ab06['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x25ab06['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x3b1a90{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x360a48{constructor(_0x3e8753){super(_0x3e8753);const _0x3ef9e3=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x3ef9e3['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x3ef9e3['to']('usersCount',_0x26d52=>E(_0x3e8753,'CONNECTED_USERS',_0x26d52))}]});}}class es extends _0x360a48{['items'];['keystrokes'];constructor(_0x5a307f){super(_0x5a307f);const _0x1779fd=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x23d333(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x1779fd['if']('hasPopup'),'aria-expanded':_0x1779fd['to']('isExpanded',_0x4f1483=>this['hasPopup']&&String(_0x4f1483)),'aria-label':_0x1779fd['to']('hasPopup',_0x4c0050=>E(_0x5a307f,_0x4c0050?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x1779fd['to']('hasPopup',_0x238632=>!!_0x238632&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x1779fd['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x4b71ff,_0x567fc0,_0x149b24)=>{this['element']&&(_0x149b24?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 it extends _0x360a48{['counterView'];['inlineListView'];constructor(_0x311d35){super(_0x311d35);const _0x11c623=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x311d35),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x160cf4 of this['inlineListView']['items'])_0x160cf4['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',_0x11c623['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class et extends _0x360a48{['listWrapperView'];constructor(_0x1ef629,_0x41e970){super(_0x1ef629),this['listWrapperView']=new vt(_0x1ef629,_0x41e970),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':E(_0x1ef629,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x5b2324{constructor(_0x380b5c,_0x825807){super(_0x380b5c);const _0x6bd9be=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x825807?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x6bd9be['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x6bd9be['to']('role'),'aria-label':_0x6bd9be['to']('ariaLabel'),'aria-labelledby':_0x6bd9be['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x3b8f5d['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x3eecac=this['element'];_0x3eecac&&(this['_isScrollable']=Math['max'](_0x3eecac['scrollHeight'],_0x3eecac['clientHeight'])>0.8*window['innerHeight']);}}class ht extends ct{['userView'];constructor(_0x284254,_0x165615,_0x40ff81){super(_0x284254);const _0x16f7c4=this['bindTemplate'];this['userView']=new at(_0x284254,_0x165615);const _0xfe9812={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x165615['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x165615['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x165615['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x40ff81&&(_0xfe9812['tag']='button',_0xfe9812['on']={'click':_0x16f7c4['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xfe9812);}['focus'](){this['element']['focus']();}}class rt extends _0x360a48{['userView'];['markerView'];constructor(_0x2a1d0e,_0x22a331,_0x3f871a){super(_0x2a1d0e);const _0x396ad9=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new at(_0x2a1d0e,_0x22a331),this['markerView']=new pt(_0x2a1d0e,_0x22a331);const _0x36c8b0=new lt(_0x2a1d0e);_0x36c8b0['template']['tag']='span',_0x36c8b0['text']=_0x22a331['name'];const _0x5de156={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x396ad9['to']('isFocusable',_0x588cef=>!!_0x588cef&&0x0),'aria-labelledby':_0x36c8b0['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x396ad9['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x396ad9['to']('hasTooltip',_0x515e6e=>!_0x515e6e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x36c8b0]};_0x3f871a&&(_0x5de156['tag']='button',_0x5de156['on']={'click':_0x396ad9['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x5de156);}}class pt extends _0x360a48{constructor(_0x3c63b1,_0x50c504){super(_0x3c63b1),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x50c504['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const ot={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x375b1b{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x4f31bb){super(_0x4f31bb),this['context']['config']['define']('presenceList',ot);const _0x5c93bd=_0x4f31bb['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x5c93bd)throw new _0x3443e5('presencelist-collapseat-invalid-format',this);if(_0x5c93bd<0x1)throw new _0x3443e5('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x2718c8(),this['balloonPanelView']=new _0x2ae021(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x574fd6 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x574fd6);this['listenTo'](this['_allConnectedUsers'],'add',(_0x194765,_0x512b5d)=>{this['_handleUserAdd'](_0x512b5d);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1630a8,_0x42dcbd)=>{this['_handleUserRemove'](_0x42dcbd);});}['_createView'](){const _0x27b430=this['context'],_0x4f9018=new it(this['context']['locale']),_0x1a0581=this['balloonPanelView'];if(!st(_0x27b430['config']['get']('presenceList.container')))throw new _0x3443e5('presencelist-missing-container',this);return _0x4f9018['counterView']['bind']('usersCount')['to'](this),_0x4f9018['bind']('isCollapsed')['to'](this,'usersCount',_0x3d78bc=>{const {collapseAt:_0x7ab8df,displayMe:_0x1367e0}=_0x27b430['config']['get']('presenceList'),_0x180c86=_0x3d78bc>=_0x7ab8df;return _0x4f9018['counterView']['isHidden']=!(0x1==_0x3d78bc&&_0x1367e0||_0x180c86),_0x180c86||this['hideDropdown'](),_0x180c86;}),_0x4f9018['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1aa5fc=>{const _0x518643=_0x27b430['config']['get']('presenceList'),_0x2a32f9=new rt(_0x27b430['locale'],_0x1aa5fc,!!_0x518643['onClick']);return _0x2a32f9['bind']('hasTooltip')['to'](_0x4f9018,'isCollapsed',_0x26afd5=>!_0x26afd5),_0x2a32f9['bind']('isFocusable')['to'](_0x4f9018,'isCollapsed',_0x194cf1=>!_0x194cf1),_0x518643['onClick']&&this['listenTo'](_0x2a32f9,'execute',()=>{this['view']['isCollapsed']||_0x518643['onClick'](_0x1aa5fc,_0x2a32f9['element']);}),_0x2a32f9;}),this['listenTo'](_0x4f9018['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x4f9018['inlineListView']['keystrokes']['set']('Enter',(_0x395c6b,_0x318806)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x318806());}),_0x4f9018['render'](),_0x1a0581['render'](),_0x25d192({'emitter':_0x4f9018,'activator':()=>_0x1a0581['isVisible'],'contextElements':[_0x1a0581['element'],_0x4f9018['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x27b430['config']['get']('presenceList.container')['appendChild'](_0x4f9018['element']),this['_bodyCollection']=new tt(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x4f9018;}['_handleUserAdd'](_0x204875){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x204875['isMe'])return;const _0xce857e=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0xce857e&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x4959a4=_0x204875['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x204875,_0x4959a4);}['_handleUserRemove'](_0x3de51c){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x3de51c['id'])&&(this['currentDisplayedUsers']['remove'](_0x3de51c['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x384153 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x384153['id']))return void this['currentDisplayedUsers']['add'](_0x384153,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1fc93a=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new et(this['context']['locale'],!!_0x1fc93a['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x2f675e}=this['presenceDropdownView'];_0x2f675e['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x2358b8=>{if(!_0x1fc93a['displayMe']&&_0x2358b8['isMe'])return null;const _0x238a20=new ht(this['context']['locale'],_0x2358b8,!!_0x1fc93a['onClick']);return _0x1fc93a['onClick']&&this['listenTo'](_0x238a20,'execute',()=>{_0x1fc93a['onClick'](_0x2358b8,_0x238a20['element']);}),_0x238a20;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x2f675e['focus'](),_0x2f675e['checkIfScrollable']();const _0x521675=(_0x437be6,_0x1e793b)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x1e793b();};_0x2f675e['keystrokes']['set']('Esc',_0x521675),_0x2f675e['keystrokes']['set']('Shift+Tab',_0x521675),_0x2f675e['keystrokes']['set']('Tab',(_0x37c95b,_0x5a4f50)=>{!function(_0x4bd00d){const _0x11f19f=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0xe64dce=>_0xe64dce+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x586776=[...document['body']['querySelectorAll'](_0x11f19f)]['filter'](_0x5d3a58=>_0x5d3a58===document['activeElement']||_0x5d3a58['offsetWidth']+_0x5d3a58['offsetHeight']>0x0)['sort']((_0x1a8640,_0x512a9f)=>(_0x1a8640['tabIndex']||0x0)-(_0x512a9f['tabIndex']||0x0)),_0x173953=_0x586776['indexOf'](_0x4bd00d),_0x3ee3cf=_0x586776[(_0x173953+0x1)%_0x586776['length']];_0x3ee3cf&&_0x3ee3cf['focus']();}(this['view']['element']),this['hideDropdown'](),_0x5a4f50();}),_0x2f675e['focusTracker']['add'](this['view']['element']),_0x2f675e['focusTracker']['on']('change:isFocused',(_0x1828ff,_0x351ccc,_0x178ffd)=>{_0x178ffd||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x375b1b{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
23
+ import{ContextPlugin as _0x498445,Plugin as _0x293c5a,PendingActions as _0x3e80ae,Context as ot}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x392eb0,CKEditorError as _0x21f60b,Collection as _0x14b0f5,global as _0xd7a97b,version as ht,uid as _0x446026,KeystrokeHandler as _0x193412}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0xc3140,View as _0x21b85b,ListView as _0x6126fa,ListItemView as at,LabelView as pt,BalloonPanelView as _0x4b6953,clickOutsideHandler as _0x5a78ed,BodyCollection as _0xba0c8a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{LiveRange as ut,History as _0x1c51e7,NoOperation as _0x44dfc9,InsertOperation as _0x49f73c,MarkerOperation as _0x547001,RootAttributeOperation as _0x5af919,transformSets as _0x49a2a4,OperationFactory as _0x2400d3}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ft,WEB_SOCKET_GATEWAY_STATES as _0x10fa10,CollaborativeEditingService as _0x33852f,User as mt,CommentsService as nt,TrackChangesService as et,RevisionHistoryService as tt,EditorService as _0x5527f2}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x5bb3d9,UserView as lt}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x2e47fa}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1cfdb0}from'lodash-es';class c extends _0x498445{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>ft)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0xc3140];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5e3804){super(_0x5e3804),this['set']('state',_0x10fa10['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=Object['create'](_0x392eb0);}['init'](){const _0x2e3391=this['context'],_0x282cc2=_0x2e3391['plugins']['get']('CloudServices'),_0x54f525=_0x2e3391['plugins']['get'](_0xc3140);if(!_0x282cc2['token'])throw new _0x21f60b('websocketgateway-missing-token',this);if(!_0x282cc2['webSocketUrl'])throw new _0x21f60b('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),c['WebSocketGateway']['connect'](_0x282cc2['token'],_0x282cc2['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4c4f29=>{if(this['connection']=_0x4c4f29,this['bind']('state')['to'](_0x4c4f29,'state',this,'_isBrowserOffline',(_0x4e2158,_0xdda007)=>('connected'!==_0x4e2158&&(this['_shouldPluginsReconnect']=!0x0),_0xdda007||_0x4e2158!==_0x10fa10['CONNECTED']?_0x10fa10['DISCONNECTED']:this['state']==_0x10fa10['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x10fa10['CONNECTING']):_0x10fa10['CONNECTED'])),this['connection']['on']('error',(_0x3ac2c6,_0x483ec5)=>{if('limitExceeded'!==_0x483ec5['code'])throw console['error'](_0x483ec5),new _0x21f60b('cloudservices-init',null,{'originalError':_0x483ec5});_0x54f525['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'});}),!_0x4c4f29['me'])return new Promise(_0x2dfc19=>_0x4c4f29['on']('change:me',_0x2dfc19));})['catch'](_0xf13f22=>{throw console['error'](_0xf13f22),new _0x21f60b('cloudservices-init',null,{'originalError':_0xf13f22});});}['addToReconnectionStack'](_0x3c8418){if('function'!=typeof _0x3c8418['reconnect'])throw new _0x21f60b('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x3c8418))throw new _0x21f60b('websocketgateway-plugin-already-registered',this,{'name':_0x3c8418['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x3c8418);}['removeFromReconnectionStack'](_0x282a32){this['_reconnectionStack']['delete'](_0x282a32);}['isInReconnectionStack'](_0x2b5282){return this['_reconnectionStack']['has'](_0x2b5282);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x21bc00=>_0x21bc00['reconnect']())))['then'](()=>this['state']=_0x10fa10['CONNECTED'])['catch'](_0x2d95c0=>{throw console['error'](_0x2d95c0),new _0x21f60b('cloudservices-reconnection-error',this['context']);});}['destroy'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x10fa10['DISCONNECTED'],this['_domEmitter']['stopListening'](),super['destroy']();}}class i extends _0x498445{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[c,_0x5bb3d9];}constructor(_0x2de938){super(_0x2de938),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x14b0f5(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x5bb3d9);}['init'](){const _0x5e28ac=this['context']['plugins']['get'](c);this['listenTo'](_0x5e28ac,'change:state',(_0x449e93,_0x1046a0,_0x49bf61)=>{if('connected'!==_0x49bf61)this['channelSessions']['forEach'](_0x4d7129=>_0x4d7129['clear']()),this['channelConnectedUsers']['forEach'](_0x4a809e=>_0x4a809e['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x17a123,_0x1af7e3]of this['_registeredSessions'])for(const _0x167a61 of _0x1af7e3)this['_handleSessionAdd'](_0x17a123,_0x167a61);}}),this['_createUser'](_0x5e28ac['connection']['me'],!0x0);}['register'](_0x5c4c28,_0x20b3fb){if(this['_registeredSessions']['has'](_0x5c4c28))throw new _0x21f60b('sessions-register-already-registered',null,{'channelId':_0x5c4c28});this['_registeredSessions']['set'](_0x5c4c28,_0x20b3fb),this['channelSessions']['set'](_0x5c4c28,new _0x14b0f5()),this['channelConnectedUsers']['set'](_0x5c4c28,new _0x14b0f5()),this['listenTo'](_0x20b3fb,'add',(_0x2af32c,_0x587a2d)=>this['_handleSessionAdd'](_0x5c4c28,_0x587a2d)),this['listenTo'](_0x20b3fb,'remove',(_0x37a043,_0x289970)=>this['_handleSessionRemove'](_0x5c4c28,_0x289970));for(const _0x14ab5f of _0x20b3fb)this['_handleSessionAdd'](_0x5c4c28,_0x14ab5f);}['unregister'](_0x47abb9){if(!this['_registeredSessions']['has'](_0x47abb9))throw new _0x21f60b('sessions-unregister-not-exist',null,{'channelId':_0x47abb9});const _0x2722cf=this['_registeredSessions']['get'](_0x47abb9);this['stopListening'](_0x2722cf);for(const _0x205d79 of _0x2722cf)'connected'===this['context']['plugins']['get'](c)['state']&&this['_handleSessionRemove'](_0x47abb9,_0x205d79);this['_registeredSessions']['delete'](_0x47abb9),this['channelSessions']['delete'](_0x47abb9),this['channelConnectedUsers']['delete'](_0x47abb9);}get['mySessionId'](){return this['context']['plugins']['get'](c)['connection']['sessionId'];}['getUserBySessionId'](_0x4b9a08){for(const _0x3bda7d of this['channelSessions']['values']())for(const _0x558e69 of _0x3bda7d)if(_0x558e69['id']===_0x4b9a08)return _0x558e69['user'];}['getUserSessions'](_0x5a625b,_0x3c227e){const _0x44c5a0=_0x3c227e?[this['channelSessions']['get'](_0x3c227e)]:this['channelSessions']['values'](),_0x30075a=new Set();for(const _0x4d435f of _0x44c5a0)for(const _0x21e159 of _0x4d435f)_0x21e159['user']['id']===_0x5a625b['id']&&_0x30075a['add'](_0x21e159['id']);return _0x30075a;}['getUserRole'](_0xe022b5){for(const _0x1cd068 of this['channelSessions']['values']())for(const _0x1095b8 of _0x1cd068)if(_0x1095b8['user']===_0xe022b5)return _0x1095b8['role'];}['_handleSessionAdd'](_0x2b0686,_0x39024e){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0xb6a776=_0x39024e['user'],_0x27c26e=this['_users']['getUser'](_0xb6a776['id'])||this['_createUser'](_0xb6a776),_0xb0ca59=Object['assign']({},_0x39024e,{'user':_0x27c26e});this['channelSessions']['get'](_0x2b0686)['add'](_0xb0ca59);const _0x396194=this['channelConnectedUsers']['get'](_0x2b0686);_0x396194['has'](_0x27c26e['id'])||_0x396194['add'](_0x27c26e),this['allConnectedUsers']['has'](_0x27c26e['id'])||this['allConnectedUsers']['add'](_0x27c26e,_0x27c26e['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x2b0686,{'channelId':_0x2b0686,'session':_0xb0ca59});}['_handleSessionRemove'](_0x4d4bfd,_0x338adf){if('connected'!==this['context']['plugins']['get'](c)['state'])return;const _0x413003=this['channelConnectedUsers']['get'](_0x4d4bfd),_0x726b47=_0x338adf['user'];_0x726b47['id']&&(this['channelSessions']['get'](_0x4d4bfd)['remove'](_0x338adf['id']),_0x413003['has'](_0x726b47['id'])&&!this['getUserSessions'](_0x726b47,_0x4d4bfd)['size']&&_0x413003['remove'](_0x726b47['id']),this['allConnectedUsers']['get'](_0x726b47['id'])&&!this['getUserSessions'](_0x726b47)['size']&&this['allConnectedUsers']['remove'](_0x726b47['id']));}['_createUser'](_0x1fb050,_0x3826e1){const _0x139c56=this['_users']['addUser'](_0x1fb050);return _0x3826e1&&this['_users']['defineMe'](_0x1fb050['id']),_0x139c56['orderNumber']=this['_uniqueUsersCount']++,_0x139c56;}}class E extends _0x293c5a{['_domEmitter']=new(_0x392eb0())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x1d8de7=this['editor'],_0x403e3a=_0x1d8de7['plugins']['get'](i);_0x1d8de7['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x3db9d8,{writer:_0x34e73c})=>function(_0x56f0ee,_0x3ed3b6,_0x4c83c1,_0xf42218){const _0x2c4633=_0x56f0ee['markerName']['split'](':')[0x2],_0x216054=_0x4c83c1['getUserBySessionId'](_0x2c4633);if(!_0x216054||_0x2c4633===_0x4c83c1['mySessionId'])return;if(!_0xf42218['model']['schema']['checkChild'](_0x56f0ee['markerRange']['start'],'$text'))return;const _0x23fc64={'class':'ck-user__marker\x20'+_0x216054['color']['getMarkerClass'](),'data-name':_0x216054['name'],'data-session-id':_0x2c4633},_0x3cfec8=_0xf42218['model']['markers']['get'](_0x56f0ee['markerName']),_0x233525=_0x3cfec8['getStart'](),_0x58e358=_0x233525['nodeAfter'],_0x372862=_0xf42218['model']['schema'];if(_0x58e358&&_0x372862['isObject'](_0x58e358)&&_0x372862['isInline'](_0x58e358)&&!_0xf42218['model']['markers']['get']('user:range:'+_0x2c4633)['getRange']()['isCollapsed'])return;const _0x4c5780=_0x233525['parent'];return _0xf42218['model']['schema']['isLimit'](_0x4c5780)&&!_0xf42218['model']['hasContent'](_0x4c5780)&&(_0x23fc64['contenteditable']=!0x1),function(_0x4c071f,_0x54f712,_0x1fcedd){const _0x5b2ed2=_0x4c071f['createUIElement']('span',_0x54f712);return _0x4c071f['setCustomProperty']('userPositionMarker',!0x0,_0x5b2ed2),_0x5b2ed2['render']=function(_0x3e4109){const _0x53bc70=this['toDomElement'](_0x3e4109);return _0x53bc70['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span><span\x20class=\x22ck-user__marker-tooltip\x22\x20contenteditable=\x22false\x22\x20spellcheck=\x22false\x22>'+_0x1fcedd['name']+'</span>⁠',_0x53bc70['addEventListener']('mouseenter',()=>{_0x53bc70['classList']['add']('ck-user__marker_hovered');}),_0x53bc70['addEventListener']('mouseleave',()=>{_0x53bc70['classList']['remove']('ck-user__marker_hovered');}),_0x53bc70;},_0x5b2ed2['isSimilar']=function(_0x25a41a){return!(!this['getCustomProperty']('userPositionMarker')||!_0x25a41a['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x25a41a['getAttribute']('data-session-id'));},_0x5b2ed2;}(_0x3ed3b6,_0x23fc64,_0x216054);}(_0x3db9d8,_0x34e73c,_0x403e3a,_0x1d8de7)}),_0x1d8de7['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x1752b3=>function(_0x16a8b6,_0x53727c){const _0xa7a749=_0x16a8b6['markerName']['split'](':')[0x2];if(_0xa7a749===_0x53727c['mySessionId'])return null;const _0x6aa159=_0x53727c['getUserBySessionId'](_0xa7a749);if(!_0x6aa159)return{'id':_0xa7a749,'classes':[]};return{'id':_0xa7a749,'classes':['ck-user__selection',_0x6aa159['color']['getSelectionClass']()],'attributes':{'data-session-id':_0xa7a749},'priority':0x7d0+_0x6aa159['orderNumber']};}(_0x1752b3,_0x403e3a)}),function(_0x2512ed){const _0x14e2a0=_0x2512ed['model'],_0x2861c4=new Map(),_0x5b2edf=_0x2512ed['plugins']['get'](i);_0x14e2a0['markers']['on']('update:user:range',(_0x343d0a,_0x4efef6,_0x2c0085,_0x3c4667)=>{if(!_0x3c4667&&_0x2861c4['get'](_0x4efef6['name']))return _0x2861c4['get'](_0x4efef6['name'])['detach'](),void _0x2861c4['delete'](_0x4efef6['name']);const _0x2c5e60=_0x4efef6['name']['split'](':')[0x2];if(_0x2c5e60===_0x5b2edf['mySessionId'])return;const _0x5e49d8='user:position:'+_0x2c5e60;_0x14e2a0['markers']['has'](_0x5e49d8)&&_0x2512ed['editing']['reconvertMarker'](_0x5e49d8),_0x4efef6['on']('change:range',(_0x4775bc,_0x3b6172,_0x4e98a1)=>{if('$graveyard'!=_0x3b6172['root']['rootName']&&'$graveyard'==_0x4efef6['getRange']()['root']['rootName']&&!_0x2861c4['has'](_0x4efef6['name'])){const _0x3c8c1f=_0x14e2a0['schema']['getNearestSelectionRange'](_0x4e98a1['deletionPosition']);if(_0x3c8c1f){const _0x136a4b=ut['fromRange'](_0x3c8c1f);_0x2861c4['set'](_0x4efef6['name'],_0x136a4b),_0x136a4b['on']('change:range',(_0x9c8611,_0x4d2944,_0x42ca8e)=>{if('$graveyard'==_0x136a4b['root']['rootName']){const _0xe7958c=_0x14e2a0['schema']['getNearestSelectionRange'](_0x42ca8e['deletionPosition']);_0xe7958c?(_0x136a4b['start']=_0xe7958c['start'],_0x136a4b['end']=_0xe7958c['end']):(_0x2861c4['delete'](_0x4efef6['name']),_0x136a4b['detach']());}});}}});}),_0x14e2a0['document']['on']('change',()=>{_0x2861c4['size']>0x0&&_0x14e2a0['enqueueChange']({'isUndoable':!0x1},_0x19f021=>{for(const [_0x252f86,_0x248ddb]of _0x2861c4)'$graveyard'==_0x14e2a0['markers']['get'](_0x252f86)['getRange']()['root']['rootName']&&(Q(_0x252f86['split'](':')[0x2],_0x248ddb['toRange'](),_0x14e2a0,_0x19f021),_0x248ddb['detach']());_0x2861c4['clear']();});});}(_0x1d8de7),this['_domEmitter']['listenTo'](_0xd7a97b['document'],'keydown',(_0x175a04,{key:_0x67a474})=>{'Escape'===_0x67a474&&function(_0x4497f0){_0x4497f0['editing']['view']['change'](_0x33d27b=>{for(const _0x469bde of _0x4497f0['model']['markers']){if(!_0x469bde['name']['startsWith']('user:position'))continue;const _0x288e90=_0x4497f0['editing']['mapper']['markerNameToElements'](_0x469bde['name']);if(_0x288e90){for(const _0xcac5c8 of _0x288e90)_0x33d27b['removeClass']('ck-user__marker_hovered',_0xcac5c8);}}});}(_0x1d8de7);},{'useCapture':!0x0});}['afterInit'](){const _0x3b56ef=this['editor'],_0x511b8c=_0x3b56ef['commands']['get']('undo');_0x511b8c&&_0x3b56ef['model']['on']('applyOperation',(_0x40fa28,_0x4ceb3b)=>{const _0x19d713=_0x4ceb3b[0x0];if('marker'!=_0x19d713['type']||!_0x19d713['name']['startsWith']('user:'))return;const _0x370c7e=_0x19d713['batch'];_0x511b8c['_createdBatches']['has'](_0x370c7e)&&(_0x19d713['newRange']=_0x19d713['oldRange']?_0x3b56ef['model']['createRange'](_0x19d713['oldRange']['start'],_0x19d713['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x1debb4=this['editor'],_0x17c935=_0x1debb4['model']['document'],_0x5d4197=_0x1debb4['plugins']['get'](i);_0x1debb4['model']['enqueueChange']({'isUndoable':!0x1},_0x496491=>{const _0xc0d773='user:range:'+_0x5d4197['mySessionId'],_0x56ae8e='user:position:'+_0x5d4197['mySessionId'],_0x3b3d7a=_0x1debb4['model']['markers']['has'](_0xc0d773);_0x1debb4['editing']['view']['hasDomSelection']?Q(_0x5d4197['mySessionId'],_0x17c935['selection']['getFirstRange'](),_0x1debb4['model'],_0x496491):_0x3b3d7a&&(_0x496491['removeMarker'](_0xc0d773),_0x496491['removeMarker'](_0x56ae8e));});}}function Q(_0x5a96f1,_0x4b909a,_0x568201,_0x1efc79){const _0x4b14cf='user:range:'+_0x5a96f1,_0x59a2ac='user:position:'+_0x5a96f1,_0x221572=_0x4b909a['getContainedElement']();let _0xebcc13=_0x4b909a['start'];_0x221572&&_0x221572['is']('element','tableCell')&&(_0xebcc13=function(_0x1a815a,_0x5c4ea6){for(const _0x4afdb2 of _0x1a815a['getPositions']())if(_0x5c4ea6['schema']['checkChild'](_0x4afdb2,'$text'))return _0x4afdb2;}(_0x4b909a,_0x568201),_0x4b909a=_0x1efc79['createRange'](_0xebcc13));const _0x5607bf=_0x1efc79['createRange'](_0xebcc13);_0x568201['markers']['has'](_0x4b14cf)?(_0x1efc79['updateMarker'](_0x4b14cf,{'range':_0x4b909a}),_0x1efc79['updateMarker'](_0x59a2ac,{'range':_0x5607bf})):(_0x1efc79['addMarker'](_0x4b14cf,{'range':_0x4b909a,'usingOperation':!0x0}),_0x1efc79['addMarker'](_0x59a2ac,{'range':_0x5607bf,'usingOperation':!0x0}));}function B(_0x248d0c,_0x148e48,_0x302027){const _0x4c03fe=_0x248d0c['t'],t=_0x248d0c['t'];switch(_0x148e48){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 _0x4c03fe({'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'},_0x302027);default:return'';}}let F=0x1;class l extends _0x293c5a{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x33852f)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[c,i,E,_0x3e80ae,_0x5bb3d9,_0xc3140];}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 _0x248355=this['serverHistory']['getOperations']();for(let _0x189501=_0x248355['length']-0x1;_0x189501>=0x0;_0x189501--){const _0x443b9a=_0x248355[_0x189501];if(!this['_disconnectionOperations']['has'](_0x443b9a))return _0x443b9a['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x3de8f7){if(super(_0x3de8f7),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x1c51e7(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x21f60b('collaboration-missing-channelid',this);const _0x26f5d5=_0x3de8f7['config']['get']('cloudServices.bundleVersion')||ht;this['_service']=new l['CollaborativeEditingService'](_0x26f5d5,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x2e47fa(),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 G(this['_disconnectionOperations']);}['init'](){const _0x4be335=this['editor'],_0x3becb9=_0x4be335['plugins']['get'](_0x5bb3d9),_0x28620a=_0x4be335['plugins']['get'](c);this['listenTo'](_0x3becb9,'getOperationAuthor',(_0x45f7f7,_0x10a872)=>{const _0x54cef5=_0x10a872[0x0];_0x54cef5['_authorId']&&(_0x45f7f7['return']=_0x3becb9['getUser'](_0x54cef5['_authorId']),_0x45f7f7['stop']()),null===_0x54cef5['_authorId']&&(_0x45f7f7['return']=null,_0x45f7f7['stop']());},{'priority':'high'}),this['listenTo'](_0x4be335['model']['document']['selection'],'change:range',(_0x232589,_0x4c471d)=>{_0x4c471d['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4be335['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4be335['model']['on']('applyOperation',(_0x25ef98,_0x4fa056)=>{const _0x47c1b0=_0x4fa056[0x0];_0x47c1b0['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x47c1b0),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x28620a,'state',this,'_hasSynchronizationProblem',(_0x3ecc44,_0x505f35)=>'connected'===_0x3ecc44&&!_0x505f35),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4be335['disableReadOnlyMode']('rtc-offline'):_0x4be335['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4be335['disableReadOnlyMode']('rtc-offline'):_0x4be335['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x11c6d1=this['editor']['plugins']['get'](i),_0x48da7c=this['editor']['plugins']['get'](c);try{this['_isPendingUpdate']=!0x0,_0x11c6d1['unregister'](this['_channelId']);const _0x4347fc=await this['_service']['reconnect'](_0x48da7c['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4347fc)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x1f5a07=await this['_service']['getConnectedSessions']();_0x11c6d1['register'](this['_channelId'],_0x1f5a07),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0xf5af78){if(function(_0x2a3da4){return'404'===_0x2a3da4['code'];}(_0xf5af78)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x163fac){return'409'===_0x163fac['code'];}(_0xf5af78)){const _0xf382b7=B(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'](_0xf382b7);}else{if(!(_0xf5af78 instanceof H))throw _0xf5af78;this['_handleReconnectionError']();}}}}['destroy'](){const _0x3badf0=this['editor']['plugins']['get'](c),_0x5d6592=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x5d6592['channelSessions']['has'](this['_channelId'])&&_0x5d6592['unregister'](this['_channelId']),_0x3badf0['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x31ed0e){if(this['sessionId']!==_0x31ed0e['sessionId']&&this['_lastSyncedOperationId']!==_0x31ed0e['lastOperationId'])throw new H();return this['sessionId']=_0x31ed0e['sessionId'],this['_handleServerResponse']([],{..._0x31ed0e,'wereChangesApplied':!0x1,'data':_0x31ed0e['data']},'reconnect');}async['_connectService'](_0x3c0d32,_0x264e08=!0x1){const {connection:_0x3cac8a}=this['editor']['plugins']['get'](c);l['CollaborativeEditingService']['getConnectedSessions'](_0x3cac8a,this['_channelId'])['then'](_0x590d27=>this['_initSessionsHandling'](_0x590d27))['catch'](_0x439c5c=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x439c5c);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x21f834,_0x3bcbe5)=>{this['_crash']('realtimecollaborationclient-initservice-internal-error',_0x3bcbe5);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x3fab32=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3c0d32);this['_isPendingUpdate']=!0x0;const _0x287be5=await this['_service']['connect'](_0x3cac8a,this['_compressOperations'](_0x3c0d32),_0x3fab32);if(this['sessionId']=_0x287be5['sessionId'],_0x264e08){if(!_0x287be5['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x287be5['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3c0d32,_0x287be5,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x287be5,_0x3c0d32);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x481c56=this['editor']['plugins']['get'](i),_0x4aa256=this['editor']['plugins']['get'](E),_0x3ee5c3=_0x481c56['channelSessions']['get'](this['_channelId']);_0x3ee5c3&&_0x3ee5c3['length']>0x1?_0x4aa256['createUserMarkerOperations']():this['listenTo'](_0x481c56,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x481c56['channelSessions']['get'](this['_channelId'])['length']&&_0x4aa256['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x14b13f,_0x1b6984,_0x48a212,_0x4c8618){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x1b6984){const _0x20289e=this['_decompressOperations'](_0x48a212,_0x4c8618);await this['_fetchMissingUsers'](_0x20289e),this['_handleExternalOperations'](_0x20289e,_0x1b6984,_0x48a212['lastOperationId'])||this['_crash']('realtimecollaborationclient-initservice-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3ed86e}=this['editor'];let _0x321c21;try{_0x321c21=await this['_service']['getDocumentDetails']();}catch(_0xd4be33){const _0x24b3c0=B(_0x3ed86e,'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'](_0x24b3c0);}const _0x235a50=_0x321c21['currentDocumentSession']||_0x321c21['lastDocumentSession'];if(this['_lastSyncedOperationId']===_0x235a50['lastOperationId'])await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);else{const _0x5abbcb=B(_0x3ed86e,'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.');this['_handleReconnectionError'](_0x5abbcb);}}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x116764){const _0x316652=this['editor']['plugins']['get'](i);this['listenTo'](_0x316652,'sessionAdd:'+this['_channelId'],(_0x1e8c63,{session:_0x251302})=>{if(_0x251302['id']===_0x316652['mySessionId']){_0x1e8c63['off']();const _0x1e3045=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x691676=_0x251302['permissions'];_0x1e3045&&_0x1e3045['isEnabled']&&(_0x691676=_0x691676['filter'](_0x59f6f6=>'document:write'!==_0x59f6f6)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x691676,this['_channelId']);}}),_0x316652['register'](this['_channelId'],_0x116764);}['_initThrowingOnDataSet'](){const _0x185fa9=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x1a3378)=>{if(!_0x1a3378[_0x1a3378['length']-0x1]['suppressErrorInCollaboration'])throw new _0x21f60b('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x185fa9['apply'](this['editor']['data'],_0x1a3378);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2aad45,[_0x1a13e0])=>{if(this['_document']['version'])throw new _0x21f60b('realtimecollaborationclient-init-document-already-initialized',this);_0x2aad45['stop'](),this['_setPendingAction']();const _0x6777bc=this['editor']['config']['get']('rootsAttributes'),_0x2aa075=this['_getOperationsFromInitData'](_0x1a13e0,_0x6777bc);0x0==_0x2aa075['length']&&_0x2aa075['push'](new _0x44dfc9(0x0)),_0x2aad45['return']=this['_connectService'](_0x2aa075)['then'](()=>{this['editor']['plugins']['get'](c)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x55f51c=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x55f51c))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x48f731,[_0x4905a5,_0x219b22])=>{_0x48f731['stop']();const _0x643846=this['editor']['model']['document']['getRoot'](_0x4905a5);if(!this['_knownRootNames']['has'](_0x4905a5)){const _0x2aa3a3=_0x219b22&&_0x219b22['data']?_0x219b22['data']:'',_0x5f1a91=_0x219b22&&_0x219b22['attributes']?_0x219b22['attributes']:{};await this['_loadRoot'](_0x4905a5,_0x2aa3a3,_0x5f1a91);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x643846['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x643846);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x55a609){const _0x7897a1=this['editor']['plugins']['get'](_0x5bb3d9),{connection:_0x1c940b}=this['editor']['plugins']['get'](c),_0x4d1db1=new Set();for(const _0xcce476 of _0x55a609){const _0x2e87f3=_0xcce476['_authorId'];_0x2e87f3&&!_0x7897a1['getUser'](_0x2e87f3)&&_0x4d1db1['add'](_0x2e87f3);}if(0x0===_0x4d1db1['size'])return;const _0x171231=await mt['getMany'](_0x1c940b,Array['from'](_0x4d1db1));for(const _0xa8835c of _0x171231)_0x7897a1['getUser'](_0xa8835c['id'])||_0x7897a1['addUser'](_0xa8835c);}['_getOperationsFromInitData'](_0x1b624c,_0xd642b4={}){const _0x117cb7=this['editor']['model'],_0x5b6428=[];let _0x1900d1=0x0;const _0x1f3302='string'==typeof _0x1b624c?{'main':_0x1b624c}:_0x1b624c;for(const _0x1187f5 of Object['keys'](_0x1f3302)){if(!this['_document']['roots']['has'](_0x1187f5))throw new _0x21f60b('realtimecollaborationclient-init-non-existent-root',this);const _0x326d9d=this['editor']['data']['parse'](_0x1f3302[_0x1187f5]),_0x5c187b=this['_document']['getRoot'](_0x1187f5),_0x5c970f=new _0x49f73c(_0x117cb7['createPositionAt'](_0x5c187b,0x0),_0x326d9d,_0x1900d1++);_0x5b6428['push'](_0x5c970f);for(const [_0x391b9e,_0x8727fe]of _0x326d9d['markers']){const _0x5a3652=_0x117cb7['createRange'](_0x117cb7['createPositionFromPath'](_0x5c187b,_0x8727fe['start']['path']['slice']()),_0x117cb7['createPositionFromPath'](_0x5c187b,_0x8727fe['end']['path']['slice']())),_0x381d69=new _0x547001(_0x391b9e,null,_0x5a3652,_0x117cb7['markers'],!0x0,_0x1900d1++);_0x5b6428['push'](_0x381d69);}}if(_0xd642b4)for(const [_0x49797a,_0xd58822]of Object['entries'](_0xd642b4)){const _0x771b1c=_0x117cb7['document']['getRoot'](_0x49797a);if(!_0x771b1c)throw new _0x21f60b('multi-root-editor-root-attributes-no-root',null);for(const [_0x4902ac,_0x567ccb]of Object['entries'](_0xd58822))if(null!==_0x567ccb){const _0x25d276=new _0x5af919(_0x771b1c,_0x4902ac,null,_0x567ccb,_0x1900d1++);_0x5b6428['push'](_0x25d276);}}return _0x5b6428;}async['_loadRoot'](_0x27935a,_0x3f46fb,_0x1029b7){this['_getOperationsFromInitData']({[_0x27935a]:_0x3f46fb},{[_0x27935a]:_0x1029b7})['forEach']((_0x25b23d,_0x5e93d3)=>{_0x25b23d['baseVersion']=this['_document']['version']+_0x5e93d3,_0x25b23d['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x25b23d);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x71472d,_0x4aa134){let _0x5aeb8d;this['_offset']=_0x71472d['offset'];const _0x46e1c8=_0x71472d['wereChangesApplied']&&!_0x71472d['initData'],_0x4ae3e7=_0x46e1c8?0x0:_0x71472d['data']['baseVersion'];if(_0x4aa134['forEach'](_0xf4db7c=>{_0xf4db7c['_isInit']=!0x0,_0xf4db7c['createdAt']=_0x71472d['sessionCreatedAt'],_0xf4db7c['_authorId']=null;}),_0x46e1c8)_0x5aeb8d=_0x4aa134,this['_applyOperationsSet'](_0x5aeb8d,_0x46e1c8);else{if(_0x71472d['initData']){const _0x56b9b9=this['_getOperationsFromInitData'](_0x71472d['initData']);this['_document']['history']['version']=-_0x56b9b9['length'],_0x56b9b9['forEach'](_0xd8cdf5=>{_0xd8cdf5['baseVersion']-=_0x56b9b9['length'],_0xd8cdf5['createdAt']=_0x71472d['sessionCreatedAt'],_0xd8cdf5['_isInit']=!0x0,_0xd8cdf5['_authorId']=null;}),this['_applyOperationsSet'](_0x56b9b9,!0x0),this['serverHistory']['version']=-_0x56b9b9['length']+this['_offset'],this['_updateServerHistory'](_0x56b9b9);}this['_document']['history']['version']=_0x4ae3e7,_0x5aeb8d=this['_decompressOperations'](_0x71472d['data'],_0x71472d['metadata']),await this['_fetchMissingUsers'](_0x5aeb8d),this['_applyOperationsSet'](_0x5aeb8d,_0x46e1c8);}_0x71472d['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x5aeb8d,_0x71472d['lastOperationId']),this['_lastSyncedOperationId']=_0x71472d['lastOperationId']),this['serverHistory']['version']=_0x4ae3e7+this['_offset'],this['_updateServerHistory'](_0x5aeb8d),_0x4aa134['filter'](_0x455ba7=>{const _0x570fb3=this['_getAffectedRoot'](_0x455ba7);return _0x570fb3&&!this['_knownRootNames']['has'](_0x570fb3);})['forEach']((_0x348f83,_0x10e134)=>{_0x348f83['baseVersion']=this['_document']['version']+_0x10e134,this['_saveOperationInBuffer'](_0x348f83);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x23f673,_0x96763b,_0x405c5f){throw this['_isPendingUpdate']=!0x0,_0x96763b&&console['error'](_0x96763b),_0x405c5f&&this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x21f60b(_0x23f673,this['editor']);}['_saveOperationInBuffer'](_0x18b0ed){this['_knownOperations']['has'](_0x18b0ed)||(this['_knownOperations']['add'](_0x18b0ed),this['_bufferedOperations']['push'](_0x18b0ed),this['_pendingAction']||'marker'==_0x18b0ed['type']&&!_0x18b0ed['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x25170a=!0x1){!_0x25170a&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0xe7a651=>{_0xe7a651&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x53d828=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x1ada99){return _0x1ada99['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1ada99['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x1ada99['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x53d828)||this['_crash'](_0x53d828['message'],_0x53d828,!0x0);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x58a336=>{this['on']('change:_isPendingUpdate',()=>{_0x58a336();});});}async['_sendBufferedOperations'](){const _0x3f8395=this['editor']['plugins']['get'](E);if(this['_shouldSendSelectionUpdate']()&&(_0x3f8395['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x3eb942=[...this['_bufferedOperations']];for(const _0x4e5069 of _0x3eb942)_0x4e5069['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x4e5069);const _0x369cdf=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3eb942),_0x47dfa7=F++,_0x581efe=this['_compressOperations'](_0x3eb942),_0x33e1d6=await this['_service']['sendOperations'](_0x581efe,_0x581efe['baseVersion'],_0x369cdf);try{return await this['_handleServerResponse'](_0x3eb942,_0x33e1d6,_0x47dfa7);}catch(_0x2a85e8){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2a85e8);}}async['_handleServerResponse'](_0x19e6de,_0x393525,_0x54a047){if('error'in _0x393525)throw _0x393525['error'];let _0x20a5cf=!0x1;if(_0x393525['wereChangesApplied']){_0x393525['lastOperationId']&&(this['_lastSyncedOperationId']=_0x393525['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x24dbbc=>!_0x19e6de['includes'](_0x24dbbc));for(const _0x4d98f8 of _0x19e6de)_0x4d98f8['createdAt']='lastOperationAcceptedAt'in _0x393525&&_0x393525['lastOperationAcceptedAt']||void 0x0;q(_0x19e6de,_0x393525['version']-_0x19e6de['length']),this['_updateServerHistory'](_0x19e6de);const _0x4718a8=_0x19e6de['filter'](_0x2d2880=>{if(!_0x2d2880['_isInit'])return!0x1;const _0x2c3744=this['_getAffectedRoot'](_0x2d2880);return _0x2c3744&&!this['_knownRootNames']['has'](_0x2c3744);});q(_0x4718a8,this['_document']['version']),this['_applyOperationsSet'](_0x4718a8),_0x20a5cf=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x33b220=this['_decompressOperations'](_0x393525['data'],_0x393525['metadata'])['filter'](_0x59b48f=>_0x59b48f['baseVersion']>=this['_lastServerVersion']);_0x33b220['forEach'](_0xdbdc7d=>this['_addKnownRoot'](_0xdbdc7d)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x1d78c6=>!_0x1d78c6['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x1d78c6))),this['_bufferedOperations']['length']&&q(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x33b220),_0x20a5cf=this['_handleExternalOperations'](_0x33b220,_0x393525['version'],_0x393525['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x20a5cf?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x40331b,_0x3422b4,_0x445ec0){try{const _0x15ff69={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4ff16d,operationsB:_0x31c715,originalOperations:_0x490e59}=_0x49a2a4(_0x40331b,this['_bufferedOperations'],_0x15ff69);q(_0x4ff16d,this['_document']['version']),q(_0x31c715,_0x3422b4);for(const _0x80788d of _0x4ff16d){const _0x126815=_0x490e59['get'](_0x80788d);_0x80788d['_authorId']=_0x126815?_0x126815['_authorId']:null;}_0x445ec0&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x40331b,_0x445ec0),this['_lastSyncedOperationId']=_0x445ec0),this['_bufferedOperations']=[..._0x31c715],this['_applyOperationsSet'](_0x4ff16d),this['_updateServerHistory'](_0x40331b);}catch(_0x5382a1){return console['error'](_0x5382a1),!0x1;}return!0x0;}['_applyOperationsSet'](_0x3c7241,_0x17140a=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x1824ed=>{for(const _0x495ff8 of _0x3c7241)this['_knownOperations']['add'](_0x495ff8),this['_addKnownRoot'](_0x495ff8),_0x1824ed['batch']['addOperation'](_0x495ff8),this['editor']['model']['applyOperation'](_0x495ff8);});}['_addKnownRoot'](_0x28bb6e){const _0x2aece8=this['_getAffectedRoot'](_0x28bb6e);_0x2aece8&&this['_knownRootNames']['add'](_0x2aece8);}['_getAffectedRoot'](_0x36fd12){let _0x470184,_0x244788;switch(_0x36fd12['type']){case'insert':_0x470184=_0x36fd12['position']['root'];break;case'marker':if(_0x244788=_0x36fd12['newRange'],!_0x244788)return null;_0x470184=_0x244788['root'];break;case'addRootAttribute':_0x470184=_0x36fd12['root'];break;case'addRoot':_0x470184=_0x36fd12['affectedSelectable'];break;case'move':_0x470184=_0x36fd12['targetPosition']['root'];break;default:return null;}return _0x470184['rootName'];}['_updateServerHistory'](_0x1642f7){_0x1642f7['forEach'](_0x2f76c2=>{const _0x3ceb84=_0x2f76c2['clone']();_0x3ceb84['_authorId']=_0x2f76c2['_authorId'],_0x3ceb84['_isInit']=!!_0x2f76c2['_isInit'],_0x3ceb84['createdAt']=_0x2f76c2['createdAt'],_0x3ceb84['baseVersion']+=this['_offset'],_0x2f76c2['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3ceb84),this['serverHistory']['addOperation'](_0x3ceb84);});}['_handleReconnectionError'](_0xf403e){const _0xecf8e9=this['editor']['plugins']['get']('Notification'),_0x3f0e1b=this['editor']['locale'];_0xf403e||(_0xf403e=B(_0x3f0e1b,'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.')),_0xecf8e9['showWarning'](_0xf403e,{'title':B(_0x3f0e1b,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](c)['destroy']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x3e80ae)['add'](B(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3e80ae)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x243910){const _0x16b63f=_0x243910['map'](_0x8eff86=>_0x8eff86['toJSON']());return this['_compressor']['compress'](_0x16b63f);}['_decompressOperations'](_0x59baad,_0x20afc8){return this['_compressor']['decompress'](_0x59baad)['map']((_0x46f76f,_0x4a7511)=>{const _0x24f3f8='init'==_0x20afc8[_0x4a7511]['type'];if('InsertOperation'==_0x46f76f['__className']){const _0x44cd8e=_0x46f76f['position']['root'];!this['_document']['getRoot'](_0x44cd8e)&&(this['_document']['createRoot']('$root',_0x44cd8e)['_isAttached']=!0x1);}const _0xd2eec9=_0x2400d3['fromJSON'](_0x46f76f,this['_document']);return _0xd2eec9['wasUndone']=_0x46f76f['wasUndone'],_0xd2eec9['_isInit']=_0x24f3f8,_0xd2eec9['_authorId']=_0x24f3f8?null:_0x20afc8[_0x4a7511]['userId'],_0xd2eec9['_isDisconnection']='cs:removeUser'===_0x20afc8[_0x4a7511]['type'],_0xd2eec9['createdAt']=_0x20afc8[_0x4a7511]['createdAt'],_0xd2eec9;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x34f9aa=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x34f9aa&&_0x34f9aa['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class H extends Error{}function q(_0x1819a5,_0x3bec52){for(const _0x5aa732 of _0x1819a5)_0x5aa732['baseVersion']=_0x3bec52++;}class G{['_ignoredOperations'];['_operationToId'];constructor(_0x470eb4){this['_ignoredOperations']=_0x470eb4,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x4f2b6e){let _0x177727=_0x4f2b6e['length'];for(;_0x177727--;){const _0x569778=_0x4f2b6e[_0x177727];if(!this['_ignoredOperations']['has'](_0x569778)){if(!this['_operationToId']['has'](_0x569778)){const _0x376d70=_0x446026()['slice'](0x1,0x12);this['_operationToId']['set'](_0x569778,_0x376d70);}return this['_operationToId']['get'](_0x569778);}}}['setIdForTheLastOperation'](_0x324998,_0x5578a3){if(!_0x5578a3)return;let _0x2713e0=_0x324998['length'];for(;_0x2713e0--;){const _0x44877d=_0x324998[_0x2713e0];this['_ignoredOperations']['has'](_0x44877d)||this['_operationToId']['set'](_0x44877d,_0x5578a3);}}}class n extends _0x293c5a{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class a extends _0x498445{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>nt)());['_services'];static get['requires'](){return[c,'CommentsRepository',i,_0x5bb3d9];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x21d1b3){super(_0x21d1b3),this['_services']=new Map();}async['init'](){const _0x4eee5d=this['context'],_0x112256=_0x4eee5d['plugins']['get']('CommentsRepository');if(_0x4eee5d['plugins']['get'](c)['addToReconnectionStack'](this),_0x112256['adapter']={'addCommentThread':async({channelId:_0x190f0b,threadId:_0x18dd83,comments:_0xcd036c,resolvedAt:_0x25e431,resolvedBy:_0x55b96a,context:_0x28707b,attributes:_0x3db0f3})=>{const _0x258c3e=await this['_getService'](_0x190f0b)['addCommentThread']({'commentThreadId':_0x18dd83,'comments':_0xcd036c['map'](_0x18519a=>function(_0x5d71ca,_0x221150,_0x56931f){return{'commentThreadId':_0x56931f,'commentId':_0x5d71ca['commentId'],'userId':_0x5d71ca['authorId'],'content':_0x5d71ca['content'],'documentId':_0x221150,'createdAt':_0x5d71ca['createdAt'],'attributes':_0x5d71ca['attributes']||{}};}(_0x18519a,_0x190f0b,_0x18dd83)),'resolvedAt':_0x25e431,'resolvedBy':_0x55b96a,'context':_0x28707b,'attributes':_0x3db0f3})['catch'](gt);return{'threadId':_0x258c3e['commentThreadId'],'comments':_0x258c3e['comments']};},'getCommentThread':async({channelId:_0x4dfc22,threadId:_0x1362a8})=>{const _0x41e92e=await this['_getService'](_0x4dfc22)['getCommentThread'](_0x1362a8)['catch'](gt);return _0x41e92e['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x41e92e]),{'threadId':_0x41e92e['commentThreadId'],'comments':_0x41e92e['comments']['map'](ct),'context':_0x41e92e['context'],'resolvedAt':_0x41e92e['resolvedAt'],'resolvedBy':_0x41e92e['resolvedBy'],'attributes':_0x41e92e['attributes']||{}});},'updateCommentThread':async({channelId:_0xe012a5,threadId:_0xb2ce4b,context:_0x377470,unlinkedAt:_0x597d32,attributes:_0x4f1e0e})=>this['_getService'](_0xe012a5)['updateCommentThread']({'commentThreadId':_0xb2ce4b,'context':_0x377470,'attributes':_0x4f1e0e,'unlinkedAt':_0x597d32})['catch'](rt)['catch'](gt),'resolveCommentThread':async({channelId:_0x7bd567,threadId:_0x209c6a})=>{const _0x5b0b7c=await this['_getService'](_0x7bd567)['resolveCommentThread'](_0x209c6a)['catch'](rt)['catch'](gt);return{'threadId':_0x5b0b7c['commentThreadId'],'resolvedAt':_0x5b0b7c['resolvedAt'],'resolvedBy':_0x5b0b7c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x360eb5,threadId:_0x2046a2})=>this['_getService'](_0x360eb5)['reopenCommentThread'](_0x2046a2)['catch'](rt)['catch'](gt),'removeCommentThread':({channelId:_0x4cf518,threadId:_0x321901})=>this['_getService'](_0x4cf518)['removeCommentThread'](_0x321901)['catch'](rt)['catch'](gt),'addComment':({channelId:_0x32f267,threadId:_0x2b6d85,commentId:_0x522ab2,content:_0x39bc25,attributes:_0x439d53})=>this['_getService'](_0x32f267)['addComment'](_0x2b6d85,_0x522ab2,_0x39bc25,_0x439d53)['catch'](gt),'updateComment':({channelId:_0x470e70,threadId:_0x1305bf,commentId:_0x9c11b1,content:_0x2a0bee,attributes:_0x5b50e5})=>this['_getService'](_0x470e70)['updateComment'](_0x1305bf,_0x9c11b1,_0x2a0bee,_0x5b50e5)['catch'](rt)['catch'](gt),'removeComment':({channelId:_0x5aa8d4,threadId:_0x5c8382,commentId:_0x36cfc0})=>this['_getService'](_0x5aa8d4)['removeComment'](_0x5c8382,_0x36cfc0)['catch'](rt)['catch'](gt)},_0x4eee5d instanceof ot){const _0x5963d0=_0x4eee5d['config']['get']('collaboration.channelId'),_0xcb54ab=_0x4eee5d['plugins']['get'](i);await this['_setUpService'](_0x5963d0);const _0x4250bd=await this['_services']['get'](_0x5963d0)['getConnectedSessions']();this['listenTo'](_0xcb54ab,'sessionAdd:'+_0x5963d0,(_0x4c68ec,{session:_0x193ed4})=>{_0x193ed4['id']===_0xcb54ab['mySessionId']&&(_0x4c68ec['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x193ed4['permissions'],_0x5963d0));}),_0xcb54ab['register'](_0x5963d0,_0x4250bd);}}async['_setUpService'](_0x35dde7){if(this['_services']['has'](_0x35dde7))throw new _0x21f60b('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x35dde7});const _0x357a93=this['context']['plugins']['get']('CommentsRepository'),_0xd1aef=new a['CommentsService'](_0x35dde7);this['_services']['set'](_0x35dde7,_0xd1aef),this['listenTo'](_0xd1aef,'commentThreadAdded',(_0x19d841,_0x8f307e)=>{const {commentThreadId:_0x38cdf3,documentId:_0x58e59d,context:_0x4377ad,attributes:_0x4ff7b7,resolvedAt:_0x5a167c,resolvedBy:_0x38799e,comments:_0x24907d}=_0x8f307e;_0x357a93['getCommentThread'](_0x38cdf3)||_0x357a93['addCommentThread']({'threadId':_0x38cdf3,'channelId':_0x58e59d,'comments':_0x24907d?_0x24907d['map'](ct):[],'context':_0x4377ad,'attributes':_0x4ff7b7,'resolvedAt':_0x5a167c,'resolvedBy':_0x38799e,'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadUpdated',(_0x38e265,{commentThreadId:_0x568481,documentId:_0x4cfd0b,context:_0x11903c,unlinkedAt:_0x1115e7,attributes:_0x4823a6})=>{_0x357a93['getCommentThread'](_0x568481)&&_0x357a93['updateCommentThread']({'threadId':_0x568481,'channelId':_0x4cfd0b,'context':_0x11903c,'unlinkedAt':_0x1115e7,'attributes':_0x4823a6,'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadResolved',(_0x475717,{commentThreadId:_0x16ea4c,resolvedBy:_0x54f2cc,resolvedAt:_0x34f80d})=>{const _0x2bcf00=_0x357a93['getCommentThread'](_0x16ea4c);_0x2bcf00&&_0x2bcf00['resolve']({'resolvedBy':_0x54f2cc,'resolvedAt':_0x34f80d,'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadReopened',(_0x1ccbd1,{commentThreadId:_0x15cbde})=>{const _0x1ad789=_0x357a93['getCommentThread'](_0x15cbde);_0x1ad789&&_0x1ad789['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentThreadRemoved',(_0x4169cc,{commentThreadId:_0x356136})=>{const _0x35d019=_0x357a93['getCommentThread'](_0x356136);_0x35d019&&_0x35d019['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentAdded',(_0x2ebe70,_0x252184)=>{const _0xf40bb4=_0x252184['commentThreadId'],_0x4cef26=_0x357a93['getCommentThread'](_0xf40bb4);_0x4cef26&&_0x4cef26['addComment']({...ct(_0x252184),'isFromAdapter':!0x0});}),this['listenTo'](_0xd1aef,'commentUpdated',(_0xe22384,{commentThreadId:_0x23fafd,commentId:_0x3f1eaf,content:_0x311143,attributes:_0x632c4f})=>{const _0x5d4dd8=_0x357a93['getCommentThread'](_0x23fafd);if(_0x5d4dd8){const _0x1b78d9=_0x5d4dd8['getComment'](_0x3f1eaf);_0x1b78d9&&_0x1b78d9['update']({'content':_0x311143,'attributes':_0x632c4f,'isFromAdapter':!0x0});}}),this['listenTo'](_0xd1aef,'commentRemoved',(_0x242e61,{commentThreadId:_0x44c987,commentId:_0x184854})=>{const _0xcf15fd=_0x357a93['getCommentThread'](_0x44c987);if(_0xcf15fd){const _0x4dca65=_0xcf15fd['getComment'](_0x184854);_0x4dca65&&_0x4dca65['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x35dde7);}['destroy'](){if(this['context']instanceof ot){const _0x3adfe5=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x3adfe5);}}['_terminateService'](_0x53f3d2){if(!this['_services']['has'](_0x53f3d2))throw new _0x21f60b('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x53f3d2});this['_getService'](_0x53f3d2)['disconnect'](),this['_services']['delete'](_0x53f3d2);}async['reconnect'](){for(const _0x4d2168 of this['_services']['keys']())await this['_connectService'](_0x4d2168);if(this['context']instanceof ot){const _0x5be1dd=this['context']['config']['get']('collaboration.channelId'),_0x305ef5=this['context']['plugins']['get'](i);_0x305ef5['unregister'](_0x5be1dd);const _0xe15103=await this['_services']['get'](_0x5be1dd)['getConnectedSessions']();_0x305ef5['register'](_0x5be1dd,_0xe15103);}}async['_connectService'](_0x2c0ee2){const {connection:_0x4b841d}=this['context']['plugins']['get'](c),_0x11d956=this['context']['plugins']['get']('CommentsRepository'),_0x266d6e=this['_services']['get'](_0x2c0ee2),_0x2eae30=await _0x266d6e['connect'](_0x4b841d);await this['_fetchMissingUsersForThreads'](_0x2eae30);const _0x3ce377=new Set(Array['from'](_0x11d956['getCommentThreads']({'channelId':_0x2c0ee2}),_0x5180fd=>_0x5180fd['id']));for(const _0x740309 of _0x2eae30)_0x740309['deletedAt']||_0x3ce377['delete'](_0x740309['commentThreadId']);for(const _0x55d054 of _0x3ce377)_0x11d956['getCommentThread'](_0x55d054)['remove']({'isFromAdapter':!0x0});for(const _0x3699e9 of _0x2eae30){let _0x296511=_0x11d956['getCommentThread'](_0x3699e9['commentThreadId']);const {commentThreadId:_0x271290,context:_0x454dc2,attributes:_0x566ebc,resolvedBy:_0x4c8b90,resolvedAt:_0x4add4b,unlinkedAt:_0x55c4dc,deletedAt:_0x125e3b}=_0x3699e9;if(_0x125e3b)continue;_0x296511||(_0x296511=_0x11d956['addCommentThread']({'channelId':_0x2c0ee2,'threadId':_0x271290,'context':_0x454dc2,'attributes':_0x566ebc||{},'resolvedBy':_0x4c8b90,'resolvedAt':_0x4add4b,'unlinkedAt':_0x55c4dc,'isFromAdapter':!0x0}));const _0x498bae=new Set(Array['from'](_0x296511['comments'],_0x383f4b=>_0x383f4b['id']));for(const _0x1abdb0 of _0x3699e9['comments'])_0x498bae['delete'](_0x1abdb0['commentId']);for(const _0xb7a48 of _0x498bae)_0x296511['getComment'](_0xb7a48)['remove']({'isFromAdapter':!0x0});for(const _0x511d6d of _0x3699e9['comments']){const _0x239277=_0x296511['getComment'](_0x511d6d['commentId']);_0x239277?_0x239277['content']!==_0x511d6d['content']&&_0x239277['update']({'content':_0x511d6d['content'],'isFromAdapter':!0x0}):_0x296511['addComment'](Object['assign'](ct(_0x511d6d),{'isFromAdapter':!0x0}));}}}['_getService'](_0x2f7ab5){if(!this['_services']['has'](_0x2f7ab5))throw new _0x21f60b('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x2f7ab5});return this['_services']['get'](_0x2f7ab5);}async['_fetchMissingUsersForThreads'](_0x1471b3){const _0x422238=this['context']['plugins']['get'](_0x5bb3d9),{connection:_0x394073}=this['context']['plugins']['get'](c),_0x17ee89=new Set();for(const {resolvedBy:_0x1b3b6d,comments:_0x4e1908}of _0x1471b3){_0x1b3b6d&&!_0x422238['getUser'](_0x1b3b6d)&&_0x17ee89['add'](_0x1b3b6d);for(const {userId:_0x4bba8a}of _0x4e1908)_0x422238['getUser'](_0x4bba8a)||_0x17ee89['add'](_0x4bba8a);}if(0x0===_0x17ee89['size'])return;const _0x4bcf4d=await mt['getMany'](_0x394073,Array['from'](_0x17ee89));for(const _0x252ceb of _0x4bcf4d)_0x422238['getUser'](_0x252ceb['id'])||_0x422238['addUser'](_0x252ceb);}}async function rt(_0x386c24){if('404'!==_0x386c24['code'])throw _0x386c24;}function gt(_0x2f9ea5){if((_0x5b731f=_0x2f9ea5)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5b731f['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5b731f['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5b731f;throw _0x2f9ea5;}function ct(_0x3cde89){return{'threadId':_0x3cde89['commentThreadId'],'commentId':_0x3cde89['commentId'],'content':_0x3cde89['content'],'createdAt':_0x3cde89['createdAt'],'authorId':_0x3cde89['userId'],'attributes':_0x3cde89['attributes']||{}};}class f extends _0x293c5a{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[a,'TrackChangesEditing',c];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x108e89){super(_0x108e89);const _0x4dad72=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new f['TrackChangesService'](_0x4dad72);}['init'](){const _0x1282a2=this['editor']['plugins']['get'](c),_0x9d5f87=this['editor']['plugins']['get']('TrackChangesEditing');return _0x9d5f87['adapter']={'getSuggestion':async _0x54a40d=>{await this['_waitForServiceReady']();const _0x27fd78=await this['_trackChangesService']['get'](_0x54a40d)['catch'](st);return await this['_fetchMissingUsersForThreads']([_0x27fd78]),_0x27fd78;},'addSuggestion':async({id:_0x32e27d,type:_0x431bf4,data:_0x4ff3ac,originalSuggestionId:_0x3177ab,attributes:_0x2d29a2})=>{await this['_waitForServiceReady']();const _0x48f5d7={'id':_0x32e27d,'type':_0x431bf4,'data':_0x4ff3ac,'originalSuggestionId':_0x3177ab,'attributes':_0x2d29a2},_0x2c7f26=await this['_trackChangesService']['add'](_0x32e27d,_0x431bf4,_0x4ff3ac,_0x3177ab,_0x2d29a2)['catch'](_0x3919f5=>{if(wt(_0x3919f5))return new Promise(_0x43131e=>{this['_bufferedRequests']['set'](_0x32e27d,{'resolve':_0x43131e,'suggestionData':_0x48f5d7});});throw _0x3919f5;});return this['_bufferedRequests']['delete'](_0x32e27d),_0x2c7f26;},'updateSuggestion':async(_0x108db8,_0x5669fd)=>{if(await this['_waitForServiceReady'](),'open'!==_0x5669fd['state'])return this['_trackChangesService']['update'](_0x108db8,_0x5669fd)['catch'](st);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x413589,_0x461d25)=>{_0x9d5f87['hasSuggestion'](_0x461d25['id'])&&(_0x9d5f87['getSuggestion'](_0x461d25['id'])['attributes']=_0x461d25['attributes']);}),this['_trackChangesService']['connect'](_0x1282a2['connection'])['then'](_0x1fa416=>(_0x1282a2['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x1fa416)['then'](()=>{for(const _0x34b0ee of _0x1fa416){_0x9d5f87['addSuggestionData'](_0x34b0ee)['_saved']=!0x0;}})));}async['reconnect'](){const _0xf143a1=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x471699}=this['editor']['plugins']['get'](c),_0x783e1b=await this['_trackChangesService']['connect'](_0x471699);await this['_fetchMissingUsersForThreads'](_0x783e1b);for(const {suggestionData:_0x36fbd9,resolve:_0x403c8d}of this['_bufferedRequests']['values']()){let _0x2c65bf=_0x783e1b['find'](_0xe9b403=>_0xe9b403['id']===_0x36fbd9['id']);_0x2c65bf||(_0x2c65bf=await this['_trackChangesService']['add'](_0x36fbd9['id'],_0x36fbd9['type'],_0x36fbd9['data'],_0x36fbd9['originalSuggestionId'])),_0x403c8d(_0x2c65bf);}for(const _0x4eb4a7 of _0x783e1b)_0xf143a1['hasSuggestion'](_0x4eb4a7['id'])||_0xf143a1['addSuggestionData'](_0x4eb4a7);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x1bd4c1=>{this['listenTo'](this['_trackChangesService'],'connected',_0x4a5cfb=>{_0x4a5cfb['off'](),_0x1bd4c1();});});}async['_fetchMissingUsersForThreads'](_0x483674){const _0x5c8c78=this['editor']['plugins']['get'](_0x5bb3d9),{connection:_0x2568f9}=this['editor']['plugins']['get'](c),_0x3ee6f8=new Set();for(const {authorId:_0x4bb899}of _0x483674)_0x5c8c78['getUser'](_0x4bb899)||_0x3ee6f8['add'](_0x4bb899);if(0x0===_0x3ee6f8['size'])return;const _0x45ca62=await mt['getMany'](_0x2568f9,Array['from'](_0x3ee6f8));for(const _0x374992 of _0x45ca62)_0x5c8c78['getUser'](_0x374992['id'])||_0x5c8c78['addUser'](_0x374992);}}function st(_0x145374){if(wt(_0x145374))return new Promise(()=>{});throw _0x145374;}function wt(_0x35aa43){return _0x35aa43['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x35aa43['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class m extends _0x293c5a{static get['requires'](){return['Comments',a,n,c];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x48d0dc=this['editor']['plugins']['get'](c),_0x580189=this['editor']['plugins']['get']('CommentsEditing'),_0x18275e=this['editor']['plugins']['get'](a);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x48d0dc,'change:state',(_0x15fec7,_0x3e4abf,_0x3b50d0)=>{_0x580189['isThreadsLoadingPaused']='connected'!==_0x3b50d0;});}),this['listenTo'](_0x48d0dc,'change:state',(_0x3aeb8a,_0x17adb3,_0xdbd8c1)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0xdbd8c1);}),_0x18275e['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](a)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class p extends _0x293c5a{static get['requires'](){return[m,f,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class u extends _0x293c5a{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>tt)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[c,l,'RevisionTracker',i,_0x5bb3d9];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2ad4b9){super(_0x2ad4b9);const _0x615fd7=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new u['RevisionHistoryService'](_0x615fd7);}async['init'](){const _0x1e8196=this['editor']['plugins']['get'](l),_0x39affd=_0x1e8196['serverHistory'],_0x4e7de0=this['editor']['plugins']['get'](c);this['_revisionTracker']['setSource']({'history':_0x39affd,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x1e8196['sessionId']});const _0x575dbc=this['editor']['config']['get']('cloudServices.bundleVersion')||ht,_0x134e9d=await _0x5527f2['isBundleUploaded'](_0x4e7de0['connection'],_0x575dbc);this['_revisionTracker']['adapter']={'getRevision':async({revisionId:_0x461fba})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x461fba)),'updateRevisions':async _0x52b03d=>{await this['_waitForServiceReady']();const _0x219bc2=this['_revisionTracker']['currentRevision'];if(_0x134e9d&&0x1===_0x52b03d['length']&&_0x52b03d[0x0]['id']===_0x219bc2['id'])return _0x52b03d;for(const _0x124582 of _0x52b03d)_0x124582['id']===_0x219bc2['id']&&(_0x124582['isEmptyCurrent']=_0x124582['fromVersion']===_0x124582['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x52b03d,this['_lastRequestId'])['then'](_0x8672fb=>(this['_lastRequestId']=_0x8672fb,_0x52b03d))['catch'](_0xb9dc79=>{if(it(_0xb9dc79)||'400'===_0xb9dc79['code']&&void 0x0!==_0xb9dc79['data']['wrongRequestId']){for(const _0x388545 of _0x52b03d){!this['_revisionTracker']['repository']['getRevision'](_0x388545['id'])||this['_revisionTracker']['_bufferUpdate'](_0x388545['id'],_0x388545,!0x1);}if(it(_0xb9dc79))throw _0xb9dc79;return _0x52b03d;}throw _0xb9dc79;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x29f106,{revisionsData:_0x3a5866,requestId:_0x108e21})=>{Math['max'](..._0x3a5866['map'](_0x3fe91f=>_0x3fe91f['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x3a5866,_0x108e21);}):this['_handleRevisionsUpdate'](_0x3a5866,_0x108e21);});const {revisions:_0x4e37b4,requestId:_0x58a6f8}=await this['_revisionHistoryService']['connect'](_0x4e7de0['connection']);_0x4e7de0['addToReconnectionStack'](this),this['_lastRequestId']=_0x58a6f8,await this['_fetchMissingUsers'](_0x4e37b4);for(const _0x1f9203 of _0x4e37b4)this['_revisionTracker']['addRevisionData'](_0x1f9203);this['listenTo'](_0x1e8196,'change:_isConnected',(_0x545540,_0x3f3e70,_0x22f49e)=>{_0x22f49e&&(this['_oldOffset']=_0x1e8196['_offset'],_0x545540['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4e7de0,'state',_0x15225d=>_0x15225d===_0x10fa10['CONNECTED']);}async['reconnect'](){const _0x1ca5ba=this['editor']['plugins']['get'](c),_0xf89d22=this['editor']['plugins']['get'](l),_0x373b46=async()=>{const _0x457de6=this['_revisionTracker']['currentRevision'],_0xc38d78=_0x457de6['id'],_0x2a41bf=_0xc38d78!==_0xf89d22['sessionId'];if(_0x2a41bf){const _0x85e7e2=_0xf89d22['_offset']-this['_oldOffset'],_0x1a528a=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x457de6['toVersion']+_0x85e7e2!==_0x1a528a){const _0x409ccd=_0x457de6['fromVersion']+_0x85e7e2,_0x4f49f9=this['editor']['plugins']['get'](_0x5bb3d9),_0x17a000=this['_revisionTracker']['buildRevisionData']({'revision':_0x457de6,'from':_0x409ccd,'to':_0x1a528a});_0x17a000['id']=_0x457de6['id'];const _0x1bd294=_0x17a000['authorsIds']['map'](_0xa13e6e=>_0x4f49f9['getUser'](_0xa13e6e));_0x457de6['_update']({..._0x17a000,'authors':_0x1bd294},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x457de6['id'],_0x17a000,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1a528a,(_0x457de6['toVersion']===_0x457de6['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0xc38d78)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0xc38d78),this['_revisionTracker']['_createCurrentRevision'](_0x1a528a));}const {revisions:_0x3dea0b,requestId:_0x4b46c8}=await this['_revisionHistoryService']['reconnect'](_0x1ca5ba['connection'],this['_lastRequestId']);_0x2a41bf&&_0x3dea0b['length']>0x0?_0xf89d22['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x3dea0b),this['_handleRevisionsUpdate'](_0x3dea0b,_0x4b46c8),this['_revisionTracker']['sendBufferedUpdates']());};return _0xf89d22['_isConnected']?_0x373b46():new Promise((_0x1787de,_0x40a07a)=>{_0xf89d22['once']('change:_isConnected',()=>{_0x373b46()['then'](_0x1787de)['catch'](_0x40a07a);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x289604=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x5bf5b9=>{_0x5bf5b9['off'](),_0x289604();});});}['_getLatestVersionFromServerOperations'](){const _0x411c5f=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x9b1116 of _0x411c5f)if('marker'!==_0x9b1116['type']||_0x9b1116['affectsData'])return _0x9b1116['baseVersion']+0x1;}['_getLatestVersion'](){const _0x37bf6d=this['editor']['plugins']['get'](l);return new Promise(_0x545275=>{_0x37bf6d['_isPendingUpdate']?_0x37bf6d['once']('change:_isPendingUpdate',()=>{_0x545275(this['_getLatestVersionFromServerOperations']());}):_0x545275(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x5270a8,_0xadb77f){const _0x95842f=this['_revisionTracker']['repository'];this['_lastRequestId']=_0xadb77f;for(const _0x48d475 of _0x5270a8){const _0x3e6b1f=_0x95842f['getRevision'](_0x48d475['id']);if(_0x3e6b1f){if((_0x48d475['fromVersion']||_0x48d475['toVersion'])&&(_0x48d475['diffData']=null),_0x3e6b1f===this['_revisionTracker']['currentRevision']){const _0x17e8b4=Math['max'](_0x3e6b1f['toVersion'],_0x48d475['toVersion']),_0x1994f2=Math['max'](_0x3e6b1f['fromVersion'],_0x48d475['fromVersion']);let _0x11fea2;_0x3e6b1f['toVersion']===_0x48d475['toVersion']&&_0x3e6b1f['fromVersion']===_0x48d475['fromVersion']?(_0x11fea2=!0x0,this['_preventResendingRevisionData'](_0x48d475)):_0x48d475['toVersion']===_0x17e8b4&&_0x48d475['fromVersion']===_0x1994f2?_0x11fea2=!0x1:(_0x3e6b1f['toVersion']===_0x17e8b4&&_0x3e6b1f['fromVersion']===_0x1994f2||this['_fixRevision']({'revision':_0x3e6b1f,'from':_0x1994f2,'to':_0x17e8b4}),_0x11fea2=!0x0),_0x11fea2&&(delete _0x48d475['fromVersion'],delete _0x48d475['toVersion'],delete _0x48d475['diffData'],delete _0x48d475['createdAt'],delete _0x48d475['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x48d475),this['_preventResendingRevisionData'](_0x48d475);}else this['_revisionTracker']['addRevisionData'](_0x48d475);}const _0x55d80e=_0x95842f['getRevisions']();_0x55d80e['reverse']();for(let _0x26c902=0x0;_0x26c902<_0x55d80e['length']-0x1;_0x26c902++){const _0x304bff=_0x55d80e[_0x26c902],_0xd3a746=_0x55d80e[_0x26c902+0x1];if(_0x304bff['fromVersion']<_0xd3a746['toVersion']){const _0x2d5856=_0xd3a746['toVersion'],_0x2e4f94=Math['max'](_0x2d5856,_0x304bff['toVersion']);this['_fixRevision']({'revision':_0x304bff,'from':_0x2d5856,'to':_0x2e4f94});}}}['_fixRevision']({revision:_0x3694dd,from:_0x32d799,to:_0x42b774}={}){const _0x465a26=this['editor']['plugins']['get'](_0x5bb3d9),_0x4f43db=this['_revisionTracker']['buildRevisionData']({'revision':_0x3694dd,'from':_0x32d799,'to':_0x42b774});_0x4f43db['authors']=_0x4f43db['authorsIds']['map'](_0x22ebdf=>_0x465a26['getUser'](_0x22ebdf)),_0x3694dd['_update'](_0x4f43db);}['_preventResendingRevisionData'](_0x49db6d){const _0x2f5127={};_0x2f5127['id']=_0x49db6d['id'];for(const _0x2466c2 of Object['keys'](_0x49db6d))'id'!==_0x2466c2&&(_0x2f5127[_0x2466c2]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x2f5127['id'],_0x2f5127,!0x0);}async['_fetchMissingUsers'](_0x4be4c6){const _0x5b803c=this['editor']['plugins']['get'](_0x5bb3d9),{connection:_0x2e29be}=this['editor']['plugins']['get'](c),_0x3e2e38=new Set();for(const _0x4ddf25 of _0x4be4c6){for(const _0x4fce2e of _0x4ddf25['authorsIds'])_0x264e32(_0x4fce2e);_0x4ddf25['creatorId']&&_0x264e32(_0x4ddf25['creatorId']);}if(0x0===_0x3e2e38['size'])return;const _0x42ff37=await mt['getMany'](_0x2e29be,Array['from'](_0x3e2e38));for(const _0x11880a of _0x42ff37)_0x5b803c['getUser'](_0x11880a['id'])||_0x5b803c['addUser'](_0x11880a);function _0x264e32(_0x148b32){_0x5b803c['getUser'](_0x148b32)||_0x3e2e38['add'](_0x148b32);}}}function it(_0x5c8907){return _0x5c8907['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5c8907['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5c8907['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x293c5a{static get['requires'](){return['RevisionHistory',u,n];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class ts extends _0x21b85b{constructor(_0x213c98){super(_0x213c98);const _0x16a8e2=this['bindTemplate'];this['set']('usersCount',0x0),this['set']('isHidden',!0x0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__counter',_0x16a8e2['if']('isHidden','ck-presence-list__counter--hidden')]},'children':[{'text':_0x16a8e2['to']('usersCount',_0x3acc2e=>B(_0x213c98,'CONNECTED_USERS',_0x3acc2e))}]});}}class es extends _0x21b85b{['items'];['keystrokes'];constructor(_0x162092){super(_0x162092);const _0x4414bc=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x193412(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x4414bc['if']('hasPopup'),'aria-expanded':_0x4414bc['to']('isExpanded',_0x568d62=>this['hasPopup']&&String(_0x568d62)),'aria-label':_0x4414bc['to']('hasPopup',_0x155ca9=>B(_0x162092,_0x155ca9?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x4414bc['to']('hasPopup',_0x4db310=>!!_0x4db310&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'click':_0x4414bc['to'](()=>this['fire']('execute'))}}),this['on']('change:hasPopup',(_0x2f2405,_0x5ef8dc,_0x51c809)=>{this['element']&&(_0x51c809?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 L extends _0x21b85b{['counterView'];['inlineListView'];constructor(_0x2f9c6f){super(_0x2f9c6f);const _0x2a775f=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new ts(this['locale']),this['inlineListView']=new es(_0x2f9c6f),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x4e67b5 of this['inlineListView']['items'])_0x4e67b5['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',_0x2a775f['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['counterView'],this['inlineListView']]});}}class j extends _0x21b85b{['listWrapperView'];constructor(_0x498b03,_0x4d97b6){super(_0x498b03),this['listWrapperView']=new vt(_0x498b03,_0x4d97b6),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':B(_0x498b03,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']]});}}class vt extends _0x6126fa{constructor(_0x128d21,_0x4fa3ce){super(_0x128d21);const _0x540d57=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x4fa3ce?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x540d57['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x540d57['to']('role'),'aria-label':_0x540d57['to']('ariaLabel'),'aria-labelledby':_0x540d57['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xd7a97b['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x1dd649=this['element'];_0x1dd649&&(this['_isScrollable']=Math['max'](_0x1dd649['scrollHeight'],_0x1dd649['clientHeight'])>0.8*window['innerHeight']);}}class k extends at{['userView'];constructor(_0x29a61b,_0x29d298,_0x543f3e){super(_0x29a61b);const _0x32be63=this['bindTemplate'];this['userView']=new lt(_0x29a61b,_0x29d298);const _0x3a8a47={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x29d298['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x29d298['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x29d298['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x543f3e&&(_0x3a8a47['tag']='button',_0x3a8a47['on']={'click':_0x32be63['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3a8a47);}['focus'](){this['element']['focus']();}}class y extends _0x21b85b{['userView'];['markerView'];constructor(_0x19a293,_0x1b07d3,_0x3d3626){super(_0x19a293);const _0x44df01=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new lt(_0x19a293,_0x1b07d3),this['markerView']=new dt(_0x19a293,_0x1b07d3);const _0x46de41=new pt(_0x19a293);_0x46de41['template']['tag']='span',_0x46de41['text']=_0x1b07d3['name'];const _0x27e4b7={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x44df01['to']('isFocusable',_0x1ae8f2=>!!_0x1ae8f2&&0x0),'aria-labelledby':_0x46de41['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x44df01['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x44df01['to']('hasTooltip',_0x2f08af=>!_0x2f08af),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x46de41]};_0x3d3626&&(_0x27e4b7['tag']='button',_0x27e4b7['on']={'click':_0x44df01['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x27e4b7);}}class dt extends _0x21b85b{constructor(_0x3d47db,_0x4e2b59){super(_0x3d47db),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x4e2b59['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const A={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x498445{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;constructor(_0x171045){super(_0x171045),this['context']['config']['define']('presenceList',A);const _0x49474f=_0x171045['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x49474f)throw new _0x21f60b('presencelist-collapseat-invalid-format',this);if(_0x49474f<0x1)throw new _0x21f60b('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x14b0f5(),this['balloonPanelView']=new _0x4b6953(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x129d31 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x129d31);this['listenTo'](this['_allConnectedUsers'],'add',(_0x1476e4,_0x2b2218)=>{this['_handleUserAdd'](_0x2b2218);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x12266f,_0x4ad08d)=>{this['_handleUserRemove'](_0x4ad08d);});}['_createView'](){const _0x19b574=this['context'],_0x50fbd8=new L(this['context']['locale']),_0x1d68ce=this['balloonPanelView'];if(!_0x1cfdb0(_0x19b574['config']['get']('presenceList.container')))throw new _0x21f60b('presencelist-missing-container',this);return _0x50fbd8['counterView']['bind']('usersCount')['to'](this),_0x50fbd8['bind']('isCollapsed')['to'](this,'usersCount',_0x5583f3=>{const {collapseAt:_0x4a6c1c,displayMe:_0x3388a5}=_0x19b574['config']['get']('presenceList'),_0x2dd5a7=_0x5583f3>=_0x4a6c1c;return _0x50fbd8['counterView']['isHidden']=!(0x1==_0x5583f3&&_0x3388a5||_0x2dd5a7),_0x2dd5a7||this['hideDropdown'](),_0x2dd5a7;}),_0x50fbd8['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x4146d5=>{const _0x3b859c=_0x19b574['config']['get']('presenceList'),_0x2e1c1c=new y(_0x19b574['locale'],_0x4146d5,!!_0x3b859c['onClick']);return _0x2e1c1c['bind']('hasTooltip')['to'](_0x50fbd8,'isCollapsed',_0x166299=>!_0x166299),_0x2e1c1c['bind']('isFocusable')['to'](_0x50fbd8,'isCollapsed',_0x2c69a2=>!_0x2c69a2),_0x3b859c['onClick']&&this['listenTo'](_0x2e1c1c,'execute',()=>{this['view']['isCollapsed']||_0x3b859c['onClick'](_0x4146d5,_0x2e1c1c['element']);}),_0x2e1c1c;}),this['listenTo'](_0x50fbd8['inlineListView'],'execute',()=>{this['presenceDropdownView']?this['hideDropdown']():this['view']['isCollapsed']&&this['showDropdown']();}),_0x50fbd8['inlineListView']['keystrokes']['set']('Enter',(_0x459010,_0x3db2ff)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x3db2ff());}),_0x50fbd8['render'](),_0x1d68ce['render'](),_0x5a78ed({'emitter':_0x50fbd8,'activator':()=>_0x1d68ce['isVisible'],'contextElements':[_0x1d68ce['element'],_0x50fbd8['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x19b574['config']['get']('presenceList.container')['appendChild'](_0x50fbd8['element']),this['_bodyCollection']=new _0xba0c8a(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x50fbd8;}['_handleUserAdd'](_0x34d03e){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x34d03e['isMe'])return;const _0x2a8c37=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['usersCount']++,this['currentDisplayedUsers']['length']==_0x2a8c37&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](0x1);const _0x17e800=_0x34d03e['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x34d03e,_0x17e800);}['_handleUserRemove'](_0x10d16a){if(this['usersCount']--,this['currentDisplayedUsers']['get'](_0x10d16a['id'])&&(this['currentDisplayedUsers']['remove'](_0x10d16a['id']),this['currentDisplayedUsers']['length']<this['usersCount'])){for(const _0x228ded of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x228ded['id']))return void this['currentDisplayedUsers']['add'](_0x228ded,Math['min'](this['currentDisplayedUsers']['length'],0x1));}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4613b3=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new j(this['context']['locale'],!!_0x4613b3['onClick']),this['view']['inlineListView']['isExpanded']=!0x0;const {listWrapperView:_0x3a7d84}=this['presenceDropdownView'];_0x3a7d84['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x110fa3=>{if(!_0x4613b3['displayMe']&&_0x110fa3['isMe'])return null;const _0xa123f8=new k(this['context']['locale'],_0x110fa3,!!_0x4613b3['onClick']);return _0x4613b3['onClick']&&this['listenTo'](_0xa123f8,'execute',()=>{_0x4613b3['onClick'](_0x110fa3,_0xa123f8['element']);}),_0xa123f8;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x3a7d84['focus'](),_0x3a7d84['checkIfScrollable']();const _0x473ed9=(_0x40addc,_0x3cfb69)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x3cfb69();};_0x3a7d84['keystrokes']['set']('Esc',_0x473ed9),_0x3a7d84['keystrokes']['set']('Shift+Tab',_0x473ed9),_0x3a7d84['keystrokes']['set']('Tab',(_0x35a6ef,_0x42c4ee)=>{!function(_0x4c1e92){const _0xdc53a0=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x58858c=>_0x58858c+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x6ec23e=[...document['body']['querySelectorAll'](_0xdc53a0)]['filter'](_0x32253e=>_0x32253e===document['activeElement']||_0x32253e['offsetWidth']+_0x32253e['offsetHeight']>0x0)['sort']((_0x7d30b5,_0x13bb00)=>(_0x7d30b5['tabIndex']||0x0)-(_0x13bb00['tabIndex']||0x0)),_0x3c5159=_0x6ec23e['indexOf'](_0x4c1e92),_0x1b56b0=_0x6ec23e[(_0x3c5159+0x1)%_0x6ec23e['length']];_0x1b56b0&&_0x1b56b0['focus']();}(this['view']['element']),this['hideDropdown'](),_0x42c4ee();}),_0x3a7d84['focusTracker']['add'](this['view']['element']),_0x3a7d84['focusTracker']['on']('change:isFocused',(_0x514e9b,_0x4a2f38,_0x6dcb47)=>{_0x6dcb47||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class s extends _0x498445{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{a as CloudServicesCommentsAdapter,u as CloudServicesRevisionHistoryAdapter,f as CloudServicesTrackChangesAdapter,s as PresenceList,l as RealTimeCollaborationClient,m as RealTimeCollaborativeComments,n as RealTimeCollaborativeEditing,g as RealTimeCollaborativeRevisionHistory,p as RealTimeCollaborativeTrackChanges};
@@ -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':_0x101a1d=>0x1!=_0x101a1d}};
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':_0x25a07f=>0x1!=_0x25a07f}};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- (_0x322691=>{const {af:{dictionary:_0x3c198e,getPluralForm:_0x13d030}}={'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':_0x43d0de=>0x1!=_0x43d0de}};_0x322691['af']||={'dictionary':{},'getPluralForm':null},_0x322691['af']['dictionary']=Object['assign'](_0x322691['af']['dictionary'],_0x3c198e),_0x322691['af']['getPluralForm']=_0x13d030;})(window['CKEDITOR_TRANSLATIONS']||={});
23
+ (_0x48216f=>{const {af:{dictionary:_0x351264,getPluralForm:_0x3333da}}={'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':_0x545e37=>0x1!=_0x545e37}};_0x48216f['af']||={'dictionary':{},'getPluralForm':null},_0x48216f['af']['dictionary']=Object['assign'](_0x48216f['af']['dictionary'],_0x351264),_0x48216f['af']['getPluralForm']=_0x3333da;})(window['CKEDITOR_TRANSLATIONS']||={});