@ckeditor/ckeditor5-real-time-collaboration 47.6.0-alpha.4 → 47.6.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/build/real-time-collaboration.js +1 -1
  2. package/dist/index.js +6 -6
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/be.js +1 -1
  12. package/dist/translations/be.umd.js +1 -1
  13. package/dist/translations/bg.js +1 -1
  14. package/dist/translations/bg.umd.js +1 -1
  15. package/dist/translations/bn.js +1 -1
  16. package/dist/translations/bn.umd.js +1 -1
  17. package/dist/translations/bs.js +1 -1
  18. package/dist/translations/bs.umd.js +1 -1
  19. package/dist/translations/ca.js +1 -1
  20. package/dist/translations/ca.umd.js +1 -1
  21. package/dist/translations/cs.js +1 -1
  22. package/dist/translations/cs.umd.js +1 -1
  23. package/dist/translations/da.js +1 -1
  24. package/dist/translations/da.umd.js +1 -1
  25. package/dist/translations/de-ch.js +1 -1
  26. package/dist/translations/de-ch.umd.js +1 -1
  27. package/dist/translations/de.js +1 -1
  28. package/dist/translations/de.umd.js +1 -1
  29. package/dist/translations/el.js +1 -1
  30. package/dist/translations/el.umd.js +1 -1
  31. package/dist/translations/en-au.js +1 -1
  32. package/dist/translations/en-au.umd.js +1 -1
  33. package/dist/translations/en-gb.js +1 -1
  34. package/dist/translations/en-gb.umd.js +1 -1
  35. package/dist/translations/en.js +1 -1
  36. package/dist/translations/en.umd.js +1 -1
  37. package/dist/translations/eo.js +1 -1
  38. package/dist/translations/eo.umd.js +1 -1
  39. package/dist/translations/es-co.js +1 -1
  40. package/dist/translations/es-co.umd.js +1 -1
  41. package/dist/translations/es.js +1 -1
  42. package/dist/translations/es.umd.js +1 -1
  43. package/dist/translations/et.js +1 -1
  44. package/dist/translations/et.umd.js +1 -1
  45. package/dist/translations/eu.js +1 -1
  46. package/dist/translations/eu.umd.js +1 -1
  47. package/dist/translations/fa.js +1 -1
  48. package/dist/translations/fa.umd.js +1 -1
  49. package/dist/translations/fi.js +1 -1
  50. package/dist/translations/fi.umd.js +1 -1
  51. package/dist/translations/fr.js +1 -1
  52. package/dist/translations/fr.umd.js +1 -1
  53. package/dist/translations/gl.js +1 -1
  54. package/dist/translations/gl.umd.js +1 -1
  55. package/dist/translations/gu.js +1 -1
  56. package/dist/translations/gu.umd.js +1 -1
  57. package/dist/translations/he.js +1 -1
  58. package/dist/translations/he.umd.js +1 -1
  59. package/dist/translations/hi.js +1 -1
  60. package/dist/translations/hi.umd.js +1 -1
  61. package/dist/translations/hr.js +1 -1
  62. package/dist/translations/hr.umd.js +1 -1
  63. package/dist/translations/hu.js +1 -1
  64. package/dist/translations/hu.umd.js +1 -1
  65. package/dist/translations/hy.js +1 -1
  66. package/dist/translations/hy.umd.js +1 -1
  67. package/dist/translations/id.js +1 -1
  68. package/dist/translations/id.umd.js +1 -1
  69. package/dist/translations/it.js +1 -1
  70. package/dist/translations/it.umd.js +1 -1
  71. package/dist/translations/ja.js +1 -1
  72. package/dist/translations/ja.umd.js +1 -1
  73. package/dist/translations/jv.js +1 -1
  74. package/dist/translations/jv.umd.js +1 -1
  75. package/dist/translations/kk.js +1 -1
  76. package/dist/translations/kk.umd.js +1 -1
  77. package/dist/translations/km.js +1 -1
  78. package/dist/translations/km.umd.js +1 -1
  79. package/dist/translations/kn.js +1 -1
  80. package/dist/translations/kn.umd.js +1 -1
  81. package/dist/translations/ko.js +1 -1
  82. package/dist/translations/ko.umd.js +1 -1
  83. package/dist/translations/ku.js +1 -1
  84. package/dist/translations/ku.umd.js +1 -1
  85. package/dist/translations/lt.js +1 -1
  86. package/dist/translations/lt.umd.js +1 -1
  87. package/dist/translations/lv.js +1 -1
  88. package/dist/translations/lv.umd.js +1 -1
  89. package/dist/translations/ms.js +1 -1
  90. package/dist/translations/ms.umd.js +1 -1
  91. package/dist/translations/nb.js +1 -1
  92. package/dist/translations/nb.umd.js +1 -1
  93. package/dist/translations/ne.js +1 -1
  94. package/dist/translations/ne.umd.js +1 -1
  95. package/dist/translations/nl.js +1 -1
  96. package/dist/translations/nl.umd.js +1 -1
  97. package/dist/translations/no.js +1 -1
  98. package/dist/translations/no.umd.js +1 -1
  99. package/dist/translations/oc.js +1 -1
  100. package/dist/translations/oc.umd.js +1 -1
  101. package/dist/translations/pl.js +1 -1
  102. package/dist/translations/pl.umd.js +1 -1
  103. package/dist/translations/pt-br.js +1 -1
  104. package/dist/translations/pt-br.umd.js +1 -1
  105. package/dist/translations/pt.js +1 -1
  106. package/dist/translations/pt.umd.js +1 -1
  107. package/dist/translations/ro.js +1 -1
  108. package/dist/translations/ro.umd.js +1 -1
  109. package/dist/translations/ru.js +1 -1
  110. package/dist/translations/ru.umd.js +1 -1
  111. package/dist/translations/si.js +1 -1
  112. package/dist/translations/si.umd.js +1 -1
  113. package/dist/translations/sk.js +1 -1
  114. package/dist/translations/sk.umd.js +1 -1
  115. package/dist/translations/sl.js +1 -1
  116. package/dist/translations/sl.umd.js +1 -1
  117. package/dist/translations/sq.js +1 -1
  118. package/dist/translations/sq.umd.js +1 -1
  119. package/dist/translations/sr-latn.js +1 -1
  120. package/dist/translations/sr-latn.umd.js +1 -1
  121. package/dist/translations/sr.js +1 -1
  122. package/dist/translations/sr.umd.js +1 -1
  123. package/dist/translations/sv.js +1 -1
  124. package/dist/translations/sv.umd.js +1 -1
  125. package/dist/translations/th.js +1 -1
  126. package/dist/translations/th.umd.js +1 -1
  127. package/dist/translations/ti.js +1 -1
  128. package/dist/translations/ti.umd.js +1 -1
  129. package/dist/translations/tk.js +1 -1
  130. package/dist/translations/tk.umd.js +1 -1
  131. package/dist/translations/tr.js +1 -1
  132. package/dist/translations/tr.umd.js +1 -1
  133. package/dist/translations/tt.js +1 -1
  134. package/dist/translations/tt.umd.js +1 -1
  135. package/dist/translations/ug.js +1 -1
  136. package/dist/translations/ug.umd.js +1 -1
  137. package/dist/translations/uk.js +1 -1
  138. package/dist/translations/uk.umd.js +1 -1
  139. package/dist/translations/ur.js +1 -1
  140. package/dist/translations/ur.umd.js +1 -1
  141. package/dist/translations/uz.js +1 -1
  142. package/dist/translations/uz.umd.js +1 -1
  143. package/dist/translations/vi.js +1 -1
  144. package/dist/translations/vi.umd.js +1 -1
  145. package/dist/translations/zh-cn.js +1 -1
  146. package/dist/translations/zh-cn.umd.js +1 -1
  147. package/dist/translations/zh.js +1 -1
  148. package/dist/translations/zh.umd.js +1 -1
  149. package/package.json +14 -14
  150. package/src/common-translations.js +1 -1
  151. package/src/index.js +1 -1
  152. package/src/presencelist/presencelistui.js +1 -1
  153. package/src/presencelist/view/presencecounterview.js +1 -1
  154. package/src/presencelist/view/presencedropdownlistitemview.js +1 -1
  155. package/src/presencelist/view/presencedropdownlistview.js +1 -1
  156. package/src/presencelist/view/presenceinlinelistitemview.js +1 -1
  157. package/src/presencelist/view/presenceinlinelistview.js +1 -1
  158. package/src/presencelist/view/presencelistview.js +1 -1
  159. package/src/presencelist.js +1 -1
  160. package/src/realtimecollaborativecomments/cloudservicescommentsadapter.js +2 -2
  161. package/src/realtimecollaborativecomments.js +1 -1
  162. package/src/realtimecollaborativeediting/realtimecollaborationclient.js +2 -2
  163. package/src/realtimecollaborativeediting/sessions.js +1 -1
  164. package/src/realtimecollaborativeediting/usermarkers.js +1 -1
  165. package/src/realtimecollaborativeediting/websocketgateway.js +2 -2
  166. package/src/realtimecollaborativeediting.js +1 -1
  167. package/src/realtimecollaborativerevisionhistory/cloudservicesrevisionhistoryadapter.js +2 -2
  168. package/src/realtimecollaborativerevisionhistory.js +1 -1
  169. package/src/realtimecollaborativetrackchanges/cloudservicestrackchangesadapter.js +2 -2
  170. package/src/realtimecollaborativetrackchanges.js +1 -1
package/dist/index.js CHANGED
@@ -20,9 +20,9 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{ContextPlugin as _0x59b06d,Plugin as _0x1c2520,PendingActions as _0x498470,Context as _0x682e1}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x447917,CKEditorError as _0x1e7226,Collection as _0x1ad15d,global as _0xca9fbc,version as nt,uid as _0x477c16,KeystrokeHandler as _0x5fd7b6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x415cf5,View as _0x97363b,ListView as _0x4e2138,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x21440a,clickOutsideHandler as _0x1b8fa0,BodyCollection as _0x7881da}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0xc672a5,History as _0x43b79e,NoOperation as _0x5a29ab,InsertOperation as _0x1dc74e,MarkerOperation as _0x2d3076,RootAttributeOperation as _0x2a4b3a,transformOperationSets as _0x5e9277,OperationFactory as _0x5c77eb}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x2c7ae4,User as lt,CommentsService as _0x504bb3,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x16cf84,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x3f936c}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x1e927f}from'es-toolkit/compat';class n extends _0x59b06d{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x415cf5];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e20af){super(_0x3e20af),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x447917())();}['init'](){const _0x335316=this['context'],_0x1bb54f=_0x335316['plugins']['get']('CloudServices'),_0x960bf4=_0x335316['plugins']['get'](_0x415cf5);if(!_0x1bb54f['token'])throw new _0x1e7226('websocketgateway-missing-token',this);if(!_0x1bb54f['webSocketUrl'])throw new _0x1e7226('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0x1bb54f['token'],_0x1bb54f['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x5b053f=>{if(this['connection']=_0x5b053f,this['bind']('state')['to'](_0x5b053f,'state',this,'_isBrowserOffline',(_0x68035b,_0x1f4963)=>('connected'!==_0x68035b&&(this['_shouldPluginsReconnect']=!0x0),_0x1f4963||_0x68035b!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x11d2bf,_0x390af6)=>{if('limitExceeded'!==_0x390af6['code'])throw console['error'](_0x390af6),new _0x1e7226('cloudservices-init',null,{'originalError':_0x390af6});_0x960bf4['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'});}),!_0x5b053f['me'])return new Promise(_0xa6fa34=>_0x5b053f['on']('change:me',_0xa6fa34));})['catch'](_0x5c7955=>{throw console['error'](_0x5c7955),new _0x1e7226('cloudservices-init',null,{'originalError':_0x5c7955});});}['addToReconnectionStack'](_0x251cfa){if('function'!=typeof _0x251cfa['reconnect'])throw new _0x1e7226('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x251cfa))throw new _0x1e7226('websocketgateway-plugin-already-registered',this,{'name':_0x251cfa['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x251cfa);}['removeFromReconnectionStack'](_0x34863e){this['_reconnectionStack']['delete'](_0x34863e);}['isInReconnectionStack'](_0x494051){return this['_reconnectionStack']['has'](_0x494051);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x3b234c=>_0x3b234c['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x3c7698=>{throw console['error'](_0x3c7698),new _0x1e7226('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=te['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x59b06d{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x16cf84];}constructor(_0x5282a8){super(_0x5282a8),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x1ad15d(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x16cf84);}['init'](){const _0x45044f=this['context']['plugins']['get'](n);this['listenTo'](_0x45044f,'change:state',(_0x2217e4,_0x2e5e10,_0x544d58)=>{if('connected'!==_0x544d58)this['channelSessions']['forEach'](_0x1423e7=>_0x1423e7['clear']()),this['channelConnectedUsers']['forEach'](_0x39b664=>_0x39b664['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x4fcb34,_0xe7ceae]of this['_registeredSessions'])for(const _0x505acf of _0xe7ceae)this['_handleSessionAdd'](_0x4fcb34,_0x505acf);}}),this['_createUser'](_0x45044f['connection']['me'],!0x0);}['register'](_0x1840e2,_0x136bed){if(this['_registeredSessions']['has'](_0x1840e2))throw new _0x1e7226('sessions-register-already-registered',null,{'channelId':_0x1840e2});this['_registeredSessions']['set'](_0x1840e2,_0x136bed),this['channelSessions']['set'](_0x1840e2,new _0x1ad15d()),this['channelConnectedUsers']['set'](_0x1840e2,new _0x1ad15d()),this['listenTo'](_0x136bed,'add',(_0xac2330,_0x152128)=>this['_handleSessionAdd'](_0x1840e2,_0x152128)),this['listenTo'](_0x136bed,'remove',(_0x41e266,_0x1036e9)=>this['_handleSessionRemove'](_0x1840e2,_0x1036e9));for(const _0x3501ae of _0x136bed)this['_handleSessionAdd'](_0x1840e2,_0x3501ae);}['unregister'](_0xffadca){if(!this['_registeredSessions']['has'](_0xffadca))throw new _0x1e7226('sessions-unregister-not-exist',null,{'channelId':_0xffadca});const _0x490eaf=this['_registeredSessions']['get'](_0xffadca);this['stopListening'](_0x490eaf);for(const _0x4f3bda of _0x490eaf)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0xffadca,_0x4f3bda);this['_registeredSessions']['delete'](_0xffadca),this['channelSessions']['delete'](_0xffadca),this['channelConnectedUsers']['delete'](_0xffadca);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x2bbfd3){for(const _0x203663 of this['channelSessions']['values']())for(const _0x212487 of _0x203663)if(_0x212487['id']===_0x2bbfd3)return _0x212487['user'];}['getUserSessions'](_0x4c1ed9,_0x7a596d){const _0x15a0e8=_0x7a596d?[this['channelSessions']['get'](_0x7a596d)]:this['channelSessions']['values'](),_0x4f6890=new Set();for(const _0x1c976c of _0x15a0e8)for(const _0x12ba24 of _0x1c976c)_0x12ba24['user']['id']===_0x4c1ed9['id']&&_0x4f6890['add'](_0x12ba24['id']);return _0x4f6890;}['getUserRole'](_0x429c49){for(const _0x2f0605 of this['channelSessions']['values']())for(const _0x38b32e of _0x2f0605)if(_0x38b32e['user']===_0x429c49)return _0x38b32e['role'];}['_handleSessionAdd'](_0x52fe3c,_0x3241de){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x438d32=_0x3241de['user'],_0x23bb10=this['_users']['getUser'](_0x438d32['id'])||this['_createUser'](_0x438d32),_0xfbc2c9=Object['assign']({},_0x3241de,{'user':_0x23bb10});if(this['channelSessions']['get'](_0x52fe3c)['add'](_0xfbc2c9),!_0x438d32['hiddenInPresenceList']){const _0x459225=this['channelConnectedUsers']['get'](_0x52fe3c);_0x459225['has'](_0x23bb10['id'])||_0x459225['add'](_0x23bb10),this['allConnectedUsers']['has'](_0x23bb10['id'])||_0x438d32['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0x23bb10,_0x23bb10['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x52fe3c,{'channelId':_0x52fe3c,'session':_0xfbc2c9});}['_handleSessionRemove'](_0x44dfc2,_0x4fcbea){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x3b978a=this['channelConnectedUsers']['get'](_0x44dfc2),_0x4b5024=_0x4fcbea['user'];_0x4b5024['id']&&(this['channelSessions']['get'](_0x44dfc2)['remove'](_0x4fcbea['id']),_0x3b978a['has'](_0x4b5024['id'])&&!this['getUserSessions'](_0x4b5024,_0x44dfc2)['size']&&_0x3b978a['remove'](_0x4b5024['id']),this['allConnectedUsers']['get'](_0x4b5024['id'])&&!this['getUserSessions'](_0x4b5024)['size']&&this['allConnectedUsers']['remove'](_0x4b5024['id']));}['_createUser'](_0x38548f,_0x19da2c){const _0x58ec49=this['_users']['addUser'](_0x38548f);return _0x19da2c&&this['_users']['defineMe'](_0x38548f['id']),_0x58ec49['orderNumber']=this['_uniqueUsersCount']++,_0x58ec49;}}class H extends _0x1c2520{['_domEmitter']=new(_0x447917())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x13b0a6=this['editor'],_0x333868=_0x13b0a6['plugins']['get'](i);_0x13b0a6['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x125f6d,{writer:_0x1685fa})=>function(_0xabbd0,_0x2be0a4,_0x3fa99e,_0xaf1358){const _0x516a3f=_0xabbd0['markerName']['split'](':')[0x2],_0x399310=_0x3fa99e['getUserBySessionId'](_0x516a3f);if(!_0x399310||_0x516a3f===_0x3fa99e['mySessionId'])return;if(!_0xaf1358['model']['schema']['checkChild'](_0xabbd0['markerRange']['start'],'$text'))return;const _0x33cb43={'class':'ck-user__marker\x20'+_0x399310['color']['getMarkerClass'](),'data-name':_0x399310['name'],'data-session-id':_0x516a3f},_0xbf37bb=_0xaf1358['model']['markers']['get'](_0xabbd0['markerName']),_0x6940ed=_0xbf37bb['getStart'](),_0x3e5d30=_0x6940ed['nodeAfter'],_0x178928=_0xaf1358['model']['schema'];if(_0x3e5d30&&_0x178928['isObject'](_0x3e5d30)&&_0x178928['isInline'](_0x3e5d30)&&!_0xaf1358['model']['markers']['get']('user:range:'+_0x516a3f)['getRange']()['isCollapsed'])return;const _0x60eda2=_0x6940ed['parent'];return _0xaf1358['model']['schema']['isLimit'](_0x60eda2)&&!_0xaf1358['model']['hasContent'](_0x60eda2)&&(_0x33cb43['contenteditable']=!0x1),function(_0x5e6916,_0x49888e,_0x5d62bb){const _0x1920fd=_0x5e6916['createUIElement']('span',_0x49888e);return _0x5e6916['setCustomProperty']('userPositionMarker',!0x0,_0x1920fd),_0x1920fd['render']=function(_0x28ff40){const _0x3d3445=this['toDomElement'](_0x28ff40),_0x291d01=document['createElement']('span');return _0x291d01['classList']['add']('ck-user__marker-tooltip'),_0x291d01['setAttribute']('contenteditable','false'),_0x291d01['setAttribute']('spellcheck','false'),_0x291d01['textContent']=_0x5d62bb['name'],_0x3d3445['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x291d01['outerHTML']+'⁠',_0x3d3445['addEventListener']('mouseenter',()=>{_0x3d3445['classList']['add']('ck-user__marker_hovered');}),_0x3d3445['addEventListener']('mouseleave',()=>{_0x3d3445['classList']['remove']('ck-user__marker_hovered');}),_0x3d3445;},_0x1920fd['isSimilar']=function(_0x2620de){return!(!this['getCustomProperty']('userPositionMarker')||!_0x2620de['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x2620de['getAttribute']('data-session-id'));},_0x1920fd;}(_0x2be0a4,_0x33cb43,_0x399310);}(_0x125f6d,_0x1685fa,_0x333868,_0x13b0a6)}),_0x13b0a6['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x3250c4=>function(_0x3e052f,_0x2952c0){const _0x30a762=_0x3e052f['markerName']['split'](':')[0x2];if(_0x30a762===_0x2952c0['mySessionId'])return null;const _0x24a416=_0x2952c0['getUserBySessionId'](_0x30a762);if(!_0x24a416)return{'id':_0x30a762,'classes':[]};return{'id':_0x30a762,'classes':['ck-user__selection',_0x24a416['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x30a762},'priority':0x7d0+_0x24a416['orderNumber']};}(_0x3250c4,_0x333868)}),function(_0x3d9681){const _0x3b7109=_0x3d9681['model'],_0x16540e=new Map(),_0xc8d205=_0x3d9681['plugins']['get'](i);_0x3b7109['markers']['on']('update:user:range',(_0x767061,_0x4cef0c,_0x33e8f2,_0x3054f4)=>{if(!_0x3054f4&&_0x16540e['get'](_0x4cef0c['name']))return _0x16540e['get'](_0x4cef0c['name'])['detach'](),void _0x16540e['delete'](_0x4cef0c['name']);const _0x2a0af1=_0x4cef0c['name']['split'](':')[0x2];if(_0x2a0af1===_0xc8d205['mySessionId'])return;const _0x17304d='user:position:'+_0x2a0af1;_0x3b7109['markers']['has'](_0x17304d)&&_0x3d9681['editing']['reconvertMarker'](_0x17304d),_0x4cef0c['on']('change:range',(_0xf23450,_0x1c2dfa,_0x6cc343)=>{if('$graveyard'!=_0x1c2dfa['root']['rootName']&&'$graveyard'==_0x4cef0c['getRange']()['root']['rootName']&&!_0x16540e['has'](_0x4cef0c['name'])){const _0x8f7ffb=_0x3b7109['schema']['getNearestSelectionRange'](_0x6cc343['deletionPosition']);if(_0x8f7ffb){const _0x512fdd=_0xc672a5['fromRange'](_0x8f7ffb);_0x16540e['set'](_0x4cef0c['name'],_0x512fdd),_0x512fdd['on']('change:range',(_0x1570b9,_0x4c68f3,_0x44e728)=>{if('$graveyard'==_0x512fdd['root']['rootName']){const _0x2c95a7=_0x3b7109['schema']['getNearestSelectionRange'](_0x44e728['deletionPosition']);_0x2c95a7?(_0x512fdd['start']=_0x2c95a7['start'],_0x512fdd['end']=_0x2c95a7['end']):(_0x16540e['delete'](_0x4cef0c['name']),_0x512fdd['detach']());}});}}});}),_0x3b7109['document']['on']('change',()=>{_0x16540e['size']>0x0&&_0x3b7109['enqueueChange']({'isUndoable':!0x1},_0xa5dfb1=>{for(const [_0x18192d,_0x5d046e]of _0x16540e)'$graveyard'==_0x3b7109['markers']['get'](_0x18192d)['getRange']()['root']['rootName']&&(Z(_0x18192d['split'](':')[0x2],_0x5d046e['toRange'](),_0x3b7109,_0xa5dfb1),_0x5d046e['detach']());_0x16540e['clear']();});});}(_0x13b0a6),this['_domEmitter']['listenTo'](_0xca9fbc['document'],'keydown',(_0x2a5366,{key:_0x4ff511})=>{'Escape'===_0x4ff511&&function(_0x3f2eeb){_0x3f2eeb['editing']['view']['change'](_0x3a73a9=>{for(const _0x4e3746 of _0x3f2eeb['model']['markers']){if(!_0x4e3746['name']['startsWith']('user:position'))continue;const _0x296acf=_0x3f2eeb['editing']['mapper']['markerNameToElements'](_0x4e3746['name']);if(_0x296acf){for(const _0x24337c of _0x296acf)_0x3a73a9['removeClass']('ck-user__marker_hovered',_0x24337c);}}});}(_0x13b0a6);},{'useCapture':!0x0});}['afterInit'](){const _0x16ab6a=this['editor'],_0x1cc60c=_0x16ab6a['commands']['get']('undo');_0x1cc60c&&_0x16ab6a['model']['on']('applyOperation',(_0xc94a7d,_0x558a53)=>{const _0x20ad7e=_0x558a53[0x0];if(!_0x20ad7e['isDocumentOperation'])return;if('marker'!=_0x20ad7e['type']||!_0x20ad7e['name']['startsWith']('user:'))return;const _0x15d94d=_0x20ad7e['batch'];_0x1cc60c['_createdBatches']['has'](_0x15d94d)&&(_0x20ad7e['newRange']=_0x20ad7e['oldRange']?_0x16ab6a['model']['createRange'](_0x20ad7e['oldRange']['start'],_0x20ad7e['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x5914ae=this['editor'],_0x41996a=_0x5914ae['model']['document'],_0x562af3=_0x5914ae['plugins']['get'](i);_0x5914ae['model']['enqueueChange']({'isUndoable':!0x1},_0x4c172f=>{const _0x15ce3a='user:range:'+_0x562af3['mySessionId'],_0xd0eb81='user:position:'+_0x562af3['mySessionId'],_0x1f4c5e=_0x5914ae['model']['markers']['has'](_0x15ce3a);_0x5914ae['editing']['view']['hasDomSelection']?Z(_0x562af3['mySessionId'],_0x41996a['selection']['getFirstRange'](),_0x5914ae['model'],_0x4c172f):_0x1f4c5e&&(_0x4c172f['removeMarker'](_0x15ce3a),_0x4c172f['removeMarker'](_0xd0eb81));});}}function Z(_0x3e3bc4,_0xd20aca,_0x292bc9,_0x5bea9f){const _0x633d24='user:range:'+_0x3e3bc4,_0x154c76='user:position:'+_0x3e3bc4,_0x36fa0c=_0xd20aca['getContainedElement']();let _0x4f32dc=_0xd20aca['start'];if(_0x36fa0c&&_0x36fa0c['is']('element','tableCell')){const _0x1f960c=function(_0x1bea37,_0x80ac5a){for(const _0x1e7069 of _0x1bea37['getPositions']())if(_0x80ac5a['schema']['checkChild'](_0x1e7069,'$text'))return _0x1e7069;}(_0xd20aca,_0x292bc9);_0x1f960c&&(_0x4f32dc=_0x1f960c,_0xd20aca=_0x5bea9f['createRange'](_0x4f32dc));}const _0x3113ab=_0x5bea9f['createRange'](_0x4f32dc);_0x292bc9['markers']['has'](_0x633d24)?(_0x5bea9f['updateMarker'](_0x633d24,{'range':_0xd20aca}),_0x5bea9f['updateMarker'](_0x154c76,{'range':_0x3113ab})):(_0x5bea9f['addMarker'](_0x633d24,{'range':_0xd20aca,'usingOperation':!0x0}),_0x5bea9f['addMarker'](_0x154c76,{'range':_0x3113ab,'usingOperation':!0x0}));}function V(_0x19fc8d,_0xc7ad3b,_0x35e7c6){const _0x26d4ed=_0x19fc8d['t'],t=_0x19fc8d['t'];switch(_0xc7ad3b){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 _0x26d4ed({'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'},_0x35e7c6);default:return'';}}let G=0x1;class l extends _0x1c2520{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x2c7ae4)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,H,_0x498470,_0x16cf84,_0x415cf5];}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 _0xb8abfd=this['serverHistory']['getOperations']();for(let _0x3cb80b=_0xb8abfd['length']-0x1;_0x3cb80b>=0x0;_0x3cb80b--){const _0x497527=_0xb8abfd[_0x3cb80b];if(!this['_disconnectionOperations']['has'](_0x497527))return _0x497527['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x123db8){if(super(_0x123db8),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x43b79e(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x1e7226('collaboration-missing-channelid',this);const _0x2aee86=_0x123db8['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x2aee86,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x3f936c(),this['_bufferedOperations']=[],this['_knownOperations']=new WeakSet(),this['_knownRootNames']=new Set(),this['set']('_isPendingUpdate',!0x1),this['set']('_hasSynchronizationProblem',!0x1),this['_pendingAction']=null,this['_hasSelectionChanged']=!0x1,this['_sendBufferedOperationsDelayId']=null,this['_baseBufferDelay']=0x12c,this['_currentBufferDelay']=this['_baseBufferDelay'],this['_lastSyncedOperationId']=null,this['_disconnectionOperations']=new WeakSet(),this['_operationIdentifier']=new J(this['_disconnectionOperations']);}['init'](){const _0x4aef8a=this['editor'],_0x13f481=_0x4aef8a['plugins']['get'](_0x16cf84),_0x5c1e76=_0x4aef8a['plugins']['get'](n);this['listenTo'](_0x13f481,'getOperationAuthor',(_0x98dfcd,_0x8b36fa)=>{const _0x135c7f=_0x8b36fa[0x0];_0x135c7f['_authorId']&&(_0x98dfcd['return']=_0x13f481['getUser'](_0x135c7f['_authorId']),_0x98dfcd['stop']()),null===_0x135c7f['_authorId']&&(_0x98dfcd['return']=null,_0x98dfcd['stop']());},{'priority':'high'}),this['listenTo'](_0x4aef8a['model']['document']['selection'],'change:range',(_0x2bc602,_0x29b862)=>{_0x29b862['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x4aef8a['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x4aef8a['model']['on']('applyOperation',(_0xc1e6ab,_0x3ef087)=>{const _0x29d85a=_0x3ef087[0x0];_0x29d85a['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x29d85a),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x5c1e76,'state',this,'_hasSynchronizationProblem',(_0x5265e7,_0x365706)=>'connected'===_0x5265e7&&!_0x365706),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x4aef8a['disableReadOnlyMode']('rtc-offline'):_0x4aef8a['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x4aef8a['disableReadOnlyMode']('rtc-offline'):_0x4aef8a['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x55091a=this['editor']['plugins']['get'](i),_0x2025f2=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x55091a['unregister'](this['_channelId']);const _0x4768c9=await this['_service']['reconnect'](_0x2025f2['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x4768c9)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x2dcfac=await this['_service']['getConnectedSessions']();_0x55091a['register'](this['_channelId'],_0x2dcfac),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x51168d){if(function(_0x4630f3){return'404'===_0x4630f3['code'];}(_0x51168d)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x34068f){return'409'===_0x34068f['code'];}(_0x51168d)){const _0x1c6666=V(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0x1c6666);}else{if(!(_0x51168d instanceof $))throw _0x51168d;this['_handleReconnectionError']();}}}}['destroy'](){const _0x9cd080=this['editor']['plugins']['get'](n),_0x2691e8=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x2691e8['channelSessions']['has'](this['_channelId'])&&_0x2691e8['unregister'](this['_channelId']),_0x9cd080['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x52655f){if(this['sessionId']!==_0x52655f['sessionId']&&this['_lastSyncedOperationId']!==_0x52655f['lastOperationId'])throw new $();return this['sessionId']=_0x52655f['sessionId'],this['_handleServerResponse']([],{..._0x52655f,'wereChangesApplied':!0x1,'data':_0x52655f['data']},'reconnect');}async['_connectService'](_0x3b09d9,_0x4fa619=!0x1){const {connection:_0x2087dc}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x2087dc,this['_channelId'])['then'](_0x453d1b=>this['_initSessionsHandling'](_0x453d1b))['catch'](_0x3161fe=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x3161fe);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x77eb44,_0x504f52)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x504f52);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x24c69d=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x3b09d9);this['_isPendingUpdate']=!0x0;const _0x3ddc54=await this['_service']['connect'](_0x2087dc,this['_compressOperations'](_0x3b09d9),_0x24c69d);if(this['sessionId']=_0x3ddc54['sessionId'],_0x4fa619){if(!_0x3ddc54['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3ddc54['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x3b09d9,_0x3ddc54,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3ddc54,_0x3b09d9);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x315df7=this['editor']['plugins']['get'](i),_0x2304ef=this['editor']['plugins']['get'](H),_0x28156a=_0x315df7['channelSessions']['get'](this['_channelId']);_0x28156a&&_0x28156a['length']>0x1?_0x2304ef['createUserMarkerOperations']():this['listenTo'](_0x315df7,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x315df7['channelSessions']['get'](this['_channelId'])['length']&&_0x2304ef['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x310842,_0x3d00ab,_0x2c77b4,_0x2105da){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x3d00ab){const _0x351c4c=this['_decompressOperations'](_0x2c77b4,_0x2105da);await this['_fetchMissingUsers'](_0x351c4c),this['_handleExternalOperations'](_0x351c4c,_0x3d00ab,_0x2c77b4['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x21fb26}=this['editor'];let _0x408171;try{_0x408171=await this['_service']['getDocumentDetails']();}catch{const _0x5d78b8=V(_0x21fb26,'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'](_0x5d78b8);}const _0x2735b5=_0x408171['currentDocumentSession']||_0x408171['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x2735b5['lastOperationId']){const _0x1cc6ee=V(_0x21fb26,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x1cc6ee);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x387a71){const _0x477cec=this['editor']['plugins']['get'](i);this['listenTo'](_0x477cec,'sessionAdd:'+this['_channelId'],(_0xb5cc3e,{session:_0x303311})=>{if(_0x303311['id']===_0x477cec['mySessionId']){_0xb5cc3e['off']();const _0x3f1747=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x37adf2=_0x303311['permissions'];_0x3f1747&&_0x3f1747['isEnabled']&&(_0x37adf2=_0x37adf2['filter'](_0x48af7e=>'document:write'!==_0x48af7e)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x37adf2,this['_channelId']);}}),_0x477cec['register'](this['_channelId'],_0x387a71);}['_initThrowingOnDataSet'](){const _0x1c6689=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x24794f)=>{if(!_0x24794f[_0x24794f['length']-0x1]['suppressErrorInCollaboration'])throw new _0x1e7226('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x1c6689['apply'](this['editor']['data'],_0x24794f);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0xebc62d,[_0x17dddb])=>{if(this['_document']['version'])throw new _0x1e7226('realtimecollaborationclient-init-document-already-initialized',this);_0xebc62d['stop'](),this['_setPendingAction']();const _0x1e9940=this['editor']['config']['get']('rootsAttributes'),_0x58280d=this['_getOperationsFromInitData'](_0x17dddb,_0x1e9940);0x0==_0x58280d['length']&&_0x58280d['push'](new _0x5a29ab(0x0)),_0xebc62d['return']=this['_connectService'](_0x58280d)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0xd49b6f=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0xd49b6f))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x33957d,[_0x252259,_0x61afef])=>{_0x33957d['stop']();const _0x430056=this['editor']['model']['document']['getRoot'](_0x252259);if(!this['_knownRootNames']['has'](_0x252259)){const _0x8b2833=_0x61afef&&_0x61afef['data']?_0x61afef['data']:'',_0xdabee7=_0x61afef&&_0x61afef['attributes']?_0x61afef['attributes']:{};await this['_loadRoot'](_0x252259,_0x8b2833,_0xdabee7);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x430056['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x430056);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x37e696){const _0x165d08=this['editor']['plugins']['get'](_0x16cf84),{connection:_0x3bc4d3}=this['editor']['plugins']['get'](n),_0x2bf8a4=new Set();for(const _0x7c17b7 of _0x37e696){const _0x3b8ed0=_0x7c17b7['_authorId'];_0x3b8ed0&&!_0x165d08['getUser'](_0x3b8ed0)&&_0x2bf8a4['add'](_0x3b8ed0);}if(0x0===_0x2bf8a4['size'])return;const _0x5dd617=await lt['getMany'](_0x3bc4d3,Array['from'](_0x2bf8a4));for(const _0x3516dc of _0x5dd617)_0x165d08['getUser'](_0x3516dc['id'])||_0x165d08['addUser'](_0x3516dc);}['_getOperationsFromInitData'](_0x30ea30,_0x4c7e9d={}){const _0x5be967=this['editor']['model'],_0x5ad32b=[];let _0x283b62=0x0;const _0x1260d2='string'==typeof _0x30ea30?{'main':_0x30ea30}:_0x30ea30;for(const _0x2f68e6 of Object['keys'](_0x1260d2)){if(!this['_document']['roots']['has'](_0x2f68e6))throw new _0x1e7226('realtimecollaborationclient-init-non-existent-root',this);const _0x4c3961=this['editor']['data']['parse'](_0x1260d2[_0x2f68e6]),_0xe98a09=this['_document']['getRoot'](_0x2f68e6),_0x4eea9c=new _0x1dc74e(_0x5be967['createPositionAt'](_0xe98a09,0x0),_0x4c3961,_0x283b62++);_0x5ad32b['push'](_0x4eea9c);for(const [_0x2e9ce7,_0x4c752c]of _0x4c3961['markers']){const _0x14bb56=_0x5be967['createRange'](_0x5be967['createPositionFromPath'](_0xe98a09,_0x4c752c['start']['path']['slice']()),_0x5be967['createPositionFromPath'](_0xe98a09,_0x4c752c['end']['path']['slice']())),_0x5c9d7=new _0x2d3076(_0x2e9ce7,null,_0x14bb56,_0x5be967['markers'],!0x0,_0x283b62++);_0x5ad32b['push'](_0x5c9d7);}}if(_0x4c7e9d)for(const [_0x33922c,_0x14b18e]of Object['entries'](_0x4c7e9d)){const _0x18b770=_0x5be967['document']['getRoot'](_0x33922c);if(!_0x18b770)throw new _0x1e7226('multi-root-editor-root-attributes-no-root',null);for(const [_0x1da846,_0x5574db]of Object['entries'](_0x14b18e))if(null!==_0x5574db){const _0xae24fc=new _0x2a4b3a(_0x18b770,_0x1da846,null,_0x5574db,_0x283b62++);_0x5ad32b['push'](_0xae24fc);}}return _0x5ad32b;}async['_loadRoot'](_0x351eb8,_0x3d59c8,_0x441d41){this['_getOperationsFromInitData']({[_0x351eb8]:_0x3d59c8},{[_0x351eb8]:_0x441d41})['forEach']((_0x1e2309,_0x59c803)=>{_0x1e2309['baseVersion']=this['_document']['version']+_0x59c803,_0x1e2309['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x1e2309);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x51fa87,_0x2b5343){let _0x1b8a32;this['_offset']=_0x51fa87['offset'];const _0x19c04e=_0x51fa87['wereChangesApplied']&&!_0x51fa87['initData'],_0x434fd=_0x19c04e?0x0:_0x51fa87['data']['baseVersion'];if(_0x2b5343['forEach'](_0x2bb123=>{_0x2bb123['_isInit']=!0x0,_0x2bb123['createdAt']=_0x51fa87['sessionCreatedAt'],_0x2bb123['_authorId']=null;}),_0x19c04e)_0x1b8a32=_0x2b5343,this['_applyOperationsSet'](_0x1b8a32,_0x19c04e);else{if(_0x51fa87['initData']){const _0x50c469=this['_getOperationsFromInitData'](_0x51fa87['initData']);this['_document']['history']['version']=-_0x50c469['length'],_0x50c469['forEach'](_0x56c2ac=>{_0x56c2ac['baseVersion']-=_0x50c469['length'],_0x56c2ac['createdAt']=_0x51fa87['sessionCreatedAt'],_0x56c2ac['_isInit']=!0x0,_0x56c2ac['_authorId']=null;}),this['_applyOperationsSet'](_0x50c469,!0x0),this['serverHistory']['version']=-_0x50c469['length']+this['_offset'],this['_updateServerHistory'](_0x50c469);}this['_document']['history']['version']=_0x434fd,_0x1b8a32=this['_decompressOperations'](_0x51fa87['data'],_0x51fa87['metadata']),await this['_fetchMissingUsers'](_0x1b8a32),this['_applyOperationsSet'](_0x1b8a32,_0x19c04e);}_0x51fa87['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x1b8a32,_0x51fa87['lastOperationId']),this['_lastSyncedOperationId']=_0x51fa87['lastOperationId']),this['serverHistory']['version']=_0x434fd+this['_offset'],this['_updateServerHistory'](_0x1b8a32),_0x2b5343['filter'](_0x545e85=>{const _0x1521ca=this['_getAffectedRoot'](_0x545e85);return _0x1521ca&&!this['_knownRootNames']['has'](_0x1521ca);})['forEach']((_0x5cb169,_0x4b8bd2)=>{_0x5cb169['baseVersion']=this['_document']['version']+_0x4b8bd2,this['_saveOperationInBuffer'](_0x5cb169);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x683bb,_0x3d5026){const _0x2532a9=_0x3d5026&&_0x3d5026['message'];if(_0x2532a9&&_0x2532a9['startsWith']('realtimecollaborationclient'))throw _0x3d5026;const _0x50991a=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x50991a['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x1e7226(_0x683bb,this['editor'],_0x2532a9?{'originalError':_0x2532a9}:void 0x0);}['_saveOperationInBuffer'](_0x2ecc85){this['_knownOperations']['has'](_0x2ecc85)||(this['_knownOperations']['add'](_0x2ecc85),this['_bufferedOperations']['push'](_0x2ecc85),this['_pendingAction']||'marker'==_0x2ecc85['type']&&!_0x2ecc85['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x140d1d=!0x1){!_0x140d1d&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x570d3f=>{_0x570d3f&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x2b2455=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xb5b517){return _0xb5b517['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xb5b517['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xb5b517['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x2b2455)||this['_crash'](_0x2b2455['message'],_0x2b2455);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x304a80=>{this['on']('change:_isPendingUpdate',()=>{_0x304a80();});});}async['_sendBufferedOperations'](){const _0xbd6ca8=this['editor']['plugins']['get'](H);if(this['_shouldSendSelectionUpdate']()&&(_0xbd6ca8['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x39ed64=[...this['_bufferedOperations']];for(const _0x486059 of _0x39ed64)_0x486059['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x486059);const _0x51900a=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x39ed64),_0x35eb6f=G++,_0x5b2cf8=this['_compressOperations'](_0x39ed64),_0x5080d3=await this['_service']['sendOperations'](_0x5b2cf8,_0x5b2cf8['baseVersion'],_0x51900a);try{return await this['_handleServerResponse'](_0x39ed64,_0x5080d3,_0x35eb6f);}catch(_0x2f8090){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x2f8090);}}async['_handleServerResponse'](_0x484287,_0x7e1b84,_0x263a41){if('error'in _0x7e1b84)throw _0x7e1b84['error'];let _0x296f84=!0x1;if(_0x7e1b84['wereChangesApplied']){_0x7e1b84['lastOperationId']&&(this['_lastSyncedOperationId']=_0x7e1b84['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x54fda1=>!_0x484287['includes'](_0x54fda1));for(const _0x4ab8cd of _0x484287)_0x4ab8cd['createdAt']='lastOperationAcceptedAt'in _0x7e1b84&&_0x7e1b84['lastOperationAcceptedAt']||void 0x0;K(_0x484287,_0x7e1b84['version']-_0x484287['length']),this['_updateServerHistory'](_0x484287);const _0x12a1a2=_0x484287['filter'](_0x4a6cbb=>{if(!_0x4a6cbb['_isInit'])return!0x1;const _0x4bc1c7=this['_getAffectedRoot'](_0x4a6cbb);return _0x4bc1c7&&!this['_knownRootNames']['has'](_0x4bc1c7);});K(_0x12a1a2,this['_document']['version']),this['_applyOperationsSet'](_0x12a1a2),_0x296f84=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x515d03=this['_decompressOperations'](_0x7e1b84['data'],_0x7e1b84['metadata'])['filter'](_0x502334=>_0x502334['baseVersion']>=this['_lastServerVersion']);_0x515d03['forEach'](_0x3b8083=>this['_addKnownRoot'](_0x3b8083)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x11702d=>!_0x11702d['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x11702d))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x515d03),_0x296f84=this['_handleExternalOperations'](_0x515d03,_0x7e1b84['version'],_0x7e1b84['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x296f84?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x8e8ea1,_0x27c93e,_0xb0d51f){try{const _0x1f792b={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x461131,operationsB:_0x109c11,originalOperations:_0xd22118}=_0x5e9277(_0x8e8ea1,this['_bufferedOperations'],_0x1f792b);K(_0x461131,this['_document']['version']),K(_0x109c11,_0x27c93e);for(const _0x572be5 of _0x461131){const _0x54fd7c=_0xd22118['get'](_0x572be5);_0x572be5['_authorId']=_0x54fd7c?_0x54fd7c['_authorId']:null;}_0xb0d51f&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x8e8ea1,_0xb0d51f),this['_lastSyncedOperationId']=_0xb0d51f),this['_bufferedOperations']=[..._0x109c11],this['_applyOperationsSet'](_0x461131),this['_updateServerHistory'](_0x8e8ea1);}catch(_0x476fd0){return console['error'](_0x476fd0),!0x1;}return!0x0;}['_applyOperationsSet'](_0x334178,_0x3f584c=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x5ef663=>{for(const _0x3ced72 of _0x334178)this['_knownOperations']['add'](_0x3ced72),this['_addKnownRoot'](_0x3ced72),_0x5ef663['batch']['addOperation'](_0x3ced72),this['editor']['model']['applyOperation'](_0x3ced72);});}['_addKnownRoot'](_0xf92ca8){const _0x3210ad=this['_getAffectedRoot'](_0xf92ca8);_0x3210ad&&this['_knownRootNames']['add'](_0x3210ad);}['_getAffectedRoot'](_0x46c274){let _0x512b27,_0x34fe3b;switch(_0x46c274['type']){case'insert':_0x512b27=_0x46c274['position']['root'];break;case'marker':if(_0x34fe3b=_0x46c274['newRange'],!_0x34fe3b)return null;_0x512b27=_0x34fe3b['root'];break;case'addRootAttribute':_0x512b27=_0x46c274['root'];break;case'addRoot':_0x512b27=_0x46c274['affectedSelectable'];break;case'move':_0x512b27=_0x46c274['targetPosition']['root'];break;default:return null;}return _0x512b27['rootName'];}['_updateServerHistory'](_0x59380d){_0x59380d['forEach'](_0x308e4f=>{const _0x3a3c7c=_0x308e4f['clone']();_0x3a3c7c['_authorId']=_0x308e4f['_authorId'],_0x3a3c7c['_isInit']=!!_0x308e4f['_isInit'],_0x3a3c7c['createdAt']=_0x308e4f['createdAt'],_0x3a3c7c['baseVersion']+=this['_offset'],_0x308e4f['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3a3c7c),this['serverHistory']['addOperation'](_0x3a3c7c);});}['_handleReconnectionError'](_0x249686){const _0x554805=this['editor']['plugins']['get']('Notification'),_0x3cc10c=this['editor']['locale'];_0x249686||(_0x249686=V(_0x3cc10c,'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.')),_0x554805['showWarning'](_0x249686,{'title':V(_0x3cc10c,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x498470)['add'](V(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x498470)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x22f5a0){const _0x48060e=_0x22f5a0['map'](_0x202dca=>_0x202dca['toJSON']());return this['_compressor']['compress'](_0x48060e);}['_decompressOperations'](_0x2fb179,_0x528d17){return this['_compressor']['decompress'](_0x2fb179)['map']((_0x19e013,_0x35ce38)=>{const _0x59f299='init'==_0x528d17[_0x35ce38]['type'];if('InsertOperation'==_0x19e013['__className']){const _0x5efb96=_0x19e013['position']['root'];!this['_document']['getRoot'](_0x5efb96)&&(this['_document']['createRoot']('$root',_0x5efb96)['_isAttached']=!0x1);}const _0x3a0b00=_0x5c77eb['fromJSON'](_0x19e013,this['_document']);return _0x3a0b00['wasUndone']=_0x19e013['wasUndone'],_0x3a0b00['_isInit']=_0x59f299,_0x3a0b00['_authorId']=_0x59f299?null:_0x528d17[_0x35ce38]['userId'],_0x3a0b00['_isDisconnection']='cs:removeUser'===_0x528d17[_0x35ce38]['type'],_0x3a0b00['createdAt']=_0x528d17[_0x35ce38]['createdAt'],_0x3a0b00;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x1b1856=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x1b1856&&_0x1b1856['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x10fc43,_0x513bee){for(const _0x1365ee of _0x10fc43)_0x1365ee['baseVersion']=_0x513bee++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x29fa87){this['_ignoredOperations']=_0x29fa87,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x37c241){let _0x1332c6=_0x37c241['length'];for(;_0x1332c6--;){const _0x53538a=_0x37c241[_0x1332c6];if(!this['_ignoredOperations']['has'](_0x53538a)){if(!this['_operationToId']['has'](_0x53538a)){const _0x510e14=_0x477c16()['slice'](0x1,0x12);this['_operationToId']['set'](_0x53538a,_0x510e14);}return this['_operationToId']['get'](_0x53538a);}}}['setIdForTheLastOperation'](_0x3be9d6,_0x172e87){if(!_0x172e87)return;let _0x3fd546=_0x3be9d6['length'];for(;_0x3fd546--;){const _0xe6a8eb=_0x3be9d6[_0x3fd546];this['_ignoredOperations']['has'](_0xe6a8eb)||this['_operationToId']['set'](_0xe6a8eb,_0x172e87);}}}class a extends _0x1c2520{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x59b06d{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x504bb3)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x16cf84];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x361143){super(_0x361143),this['_services']=new Map();}async['init'](){const _0xac3e1e=this['context'],_0x197e2b=_0xac3e1e['plugins']['get']('CommentsRepository');if(_0xac3e1e['plugins']['get'](n)['addToReconnectionStack'](this),_0x197e2b['adapter']={'addCommentThread':async({channelId:_0x13251b,threadId:_0x4b0716,comments:_0x68114a,resolvedAt:_0x482e32,resolvedBy:_0x20a275,context:_0x12fe9d,attributes:_0x32a512})=>{const _0x211c8c=await this['_getService'](_0x13251b)['addCommentThread']({'commentThreadId':_0x4b0716,'comments':_0x68114a['map'](_0x63ec6f=>function(_0x2f86bb,_0x10dec4,_0x302619){return{'commentThreadId':_0x302619,'commentId':_0x2f86bb['commentId'],'userId':_0x2f86bb['authorId'],'content':_0x2f86bb['content'],'documentId':_0x10dec4,'createdAt':_0x2f86bb['createdAt'],'attributes':_0x2f86bb['attributes']||{}};}(_0x63ec6f,_0x13251b,_0x4b0716)),'resolvedAt':_0x482e32,'resolvedBy':_0x20a275,'context':_0x12fe9d,'attributes':_0x32a512})['catch'](dt);return{'threadId':_0x211c8c['commentThreadId'],'comments':_0x211c8c['comments']};},'getCommentThread':async({channelId:_0x5a7ea3,threadId:_0x54e86c})=>{const _0x23a7da=await this['_getService'](_0x5a7ea3)['getCommentThread'](_0x54e86c)['catch'](F)['catch'](dt);return _0x23a7da?_0x23a7da['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x23a7da]),{'threadId':_0x23a7da['commentThreadId'],'comments':_0x23a7da['comments']['map'](S),'context':_0x23a7da['context'],'resolvedAt':_0x23a7da['resolvedAt'],'resolvedBy':_0x23a7da['resolvedBy'],'attributes':_0x23a7da['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0xb91652,threadId:_0x52b7f9,context:_0x1e776c,unlinkedAt:_0x2f6385,attributes:_0x10f0f7})=>this['_getService'](_0xb91652)['updateCommentThread']({'commentThreadId':_0x52b7f9,'context':_0x1e776c,'attributes':_0x10f0f7,'unlinkedAt':_0x2f6385})['catch'](F)['catch'](dt),'resolveCommentThread':async({channelId:_0x346064,threadId:_0x561533})=>{const _0x5f3bb9=await this['_getService'](_0x346064)['resolveCommentThread'](_0x561533)['catch'](F)['catch'](dt);return{'threadId':_0x5f3bb9['commentThreadId'],'resolvedAt':_0x5f3bb9['resolvedAt'],'resolvedBy':_0x5f3bb9['resolvedBy']};},'reopenCommentThread':async({channelId:_0x485ba3,threadId:_0x54ff62})=>this['_getService'](_0x485ba3)['reopenCommentThread'](_0x54ff62)['catch'](F)['catch'](dt),'removeCommentThread':({channelId:_0x3a9c58,threadId:_0x29f58c})=>this['_getService'](_0x3a9c58)['removeCommentThread'](_0x29f58c)['catch'](F)['catch'](dt),'addComment':({channelId:_0x4a16d6,threadId:_0x4d0691,commentId:_0x14b0c3,content:_0x316dff,attributes:_0x519549})=>this['_getService'](_0x4a16d6)['addComment'](_0x4d0691,_0x14b0c3,_0x316dff,_0x519549)['catch'](dt),'updateComment':({channelId:_0x4e5715,threadId:_0x5a7a75,commentId:_0x2d45cf,content:_0x2ec11a,attributes:_0x7bbf0})=>this['_getService'](_0x4e5715)['updateComment'](_0x5a7a75,_0x2d45cf,_0x2ec11a,_0x7bbf0)['catch'](F)['catch'](dt),'removeComment':({channelId:_0x45e28e,threadId:_0x64f538,commentId:_0x4a9d9a})=>this['_getService'](_0x45e28e)['removeComment'](_0x64f538,_0x4a9d9a)['catch'](F)['catch'](dt)},_0xac3e1e instanceof _0x682e1){const _0x3e474b=_0xac3e1e['config']['get']('collaboration.channelId'),_0x12396a=_0xac3e1e['plugins']['get'](i);await this['_setUpService'](_0x3e474b);const _0x50ce34=await this['_services']['get'](_0x3e474b)['getConnectedSessions']();this['listenTo'](_0x12396a,'sessionAdd:'+_0x3e474b,(_0x3b5ec9,{session:_0x4ce12d})=>{_0x4ce12d['id']===_0x12396a['mySessionId']&&(_0x3b5ec9['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4ce12d['permissions'],_0x3e474b));}),_0x12396a['register'](_0x3e474b,_0x50ce34);}}async['_setUpService'](_0x33969b){if(this['_services']['has'](_0x33969b))throw new _0x1e7226('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x33969b});const _0x3076b1=this['context']['plugins']['get']('CommentsRepository'),_0x5e820a=new s['CommentsService'](_0x33969b);this['_services']['set'](_0x33969b,_0x5e820a),this['listenTo'](_0x5e820a,'commentThreadAdded',(_0x227397,_0x1ec50d)=>{const {commentThreadId:_0x4cd5f5,documentId:_0x2b3e91,context:_0x2bf4f3,attributes:_0x4631d7,resolvedAt:_0x460b8b,resolvedBy:_0x29443d,comments:_0x141843}=_0x1ec50d;_0x3076b1['getCommentThread'](_0x4cd5f5)||_0x3076b1['addCommentThread']({'threadId':_0x4cd5f5,'channelId':_0x2b3e91,'comments':_0x141843?_0x141843['map'](S):[],'context':_0x2bf4f3,'attributes':_0x4631d7,'resolvedAt':_0x460b8b,'resolvedBy':_0x29443d,'isFromAdapter':!0x0});}),this['listenTo'](_0x5e820a,'commentThreadUpdated',(_0x22c786,{commentThreadId:_0x226c5e,documentId:_0x213865,context:_0x4da0ff,unlinkedAt:_0x58915c,attributes:_0x2c904d})=>{_0x3076b1['getCommentThread'](_0x226c5e)&&_0x3076b1['updateCommentThread']({'threadId':_0x226c5e,'channelId':_0x213865,'context':_0x4da0ff,'unlinkedAt':_0x58915c,'attributes':_0x2c904d,'isFromAdapter':!0x0});}),this['listenTo'](_0x5e820a,'commentThreadResolved',(_0x22db97,{commentThreadId:_0x4e2697,resolvedBy:_0x3f7f34,resolvedAt:_0xf565c})=>{const _0x42c76a=_0x3076b1['getCommentThread'](_0x4e2697);_0x42c76a&&_0x42c76a['resolve']({'resolvedBy':_0x3f7f34,'resolvedAt':_0xf565c,'isFromAdapter':!0x0});}),this['listenTo'](_0x5e820a,'commentThreadReopened',(_0x3b80b0,{commentThreadId:_0x25e17b})=>{const _0x5694d5=_0x3076b1['getCommentThread'](_0x25e17b);_0x5694d5&&_0x5694d5['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5e820a,'commentThreadRemoved',(_0x36f6f0,{commentThreadId:_0x37cd29})=>{const _0x23afbd=_0x3076b1['getCommentThread'](_0x37cd29);_0x23afbd&&_0x23afbd['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x5e820a,'commentAdded',(_0x5b3639,_0x2ea5ae)=>{const _0x1aeaad=_0x2ea5ae['commentThreadId'],_0x539a26=_0x3076b1['getCommentThread'](_0x1aeaad);_0x539a26&&_0x539a26['addComment']({...S(_0x2ea5ae),'isFromAdapter':!0x0});}),this['listenTo'](_0x5e820a,'commentUpdated',(_0xdd74f8,{commentThreadId:_0x3127ee,commentId:_0x4f8f21,content:_0x33c662,attributes:_0x57e35c})=>{const _0x5bef2d=_0x3076b1['getCommentThread'](_0x3127ee);if(_0x5bef2d){const _0x37783b=_0x5bef2d['getComment'](_0x4f8f21);_0x37783b&&_0x37783b['update']({'content':_0x33c662,'attributes':_0x57e35c,'isFromAdapter':!0x0});}}),this['listenTo'](_0x5e820a,'commentRemoved',(_0x358b8e,{commentThreadId:_0x5c4877,commentId:_0x121d16})=>{const _0x511005=_0x3076b1['getCommentThread'](_0x5c4877);if(_0x511005){const _0x460ee6=_0x511005['getComment'](_0x121d16);_0x460ee6&&_0x460ee6['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x33969b);}['destroy'](){if(this['context']instanceof _0x682e1){const _0x5a0ed0=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x5a0ed0);}}['_terminateService'](_0x39b6f3){if(!this['_services']['has'](_0x39b6f3))throw new _0x1e7226('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x39b6f3});this['_getService'](_0x39b6f3)['disconnect'](),this['_services']['delete'](_0x39b6f3);}async['reconnect'](){for(const _0x23f01e of this['_services']['keys']())await this['_connectService'](_0x23f01e);if(this['context']instanceof _0x682e1){const _0x8177e4=this['context']['config']['get']('collaboration.channelId'),_0x3d34f6=this['context']['plugins']['get'](i);_0x3d34f6['unregister'](_0x8177e4);const _0x1fbbcb=await this['_services']['get'](_0x8177e4)['getConnectedSessions']();_0x3d34f6['register'](_0x8177e4,_0x1fbbcb);}}async['_connectService'](_0x139376){const {connection:_0x4b775b}=this['context']['plugins']['get'](n),_0x279068=this['context']['plugins']['get']('CommentsRepository'),_0x2171cd=this['_services']['get'](_0x139376),_0x4afb9f=await _0x2171cd['connect'](_0x4b775b);await this['_fetchMissingUsersForThreads'](_0x4afb9f);const _0x20ae2a=new Set(Array['from'](_0x279068['getCommentThreads']({'channelId':_0x139376}),_0x47cd95=>_0x47cd95['id']));for(const _0x20a006 of _0x4afb9f)_0x20a006['deletedAt']||_0x20ae2a['delete'](_0x20a006['commentThreadId']);for(const _0x3827c of _0x20ae2a)_0x279068['getCommentThread'](_0x3827c)['remove']({'isFromAdapter':!0x0});for(const _0x369730 of _0x4afb9f){let _0x3772cb=_0x279068['getCommentThread'](_0x369730['commentThreadId']);const {commentThreadId:_0x46e22f,context:_0x537145,attributes:_0x34a998,resolvedBy:_0x379245,resolvedAt:_0x4e3491,unlinkedAt:_0x14140e,deletedAt:_0x3508e7}=_0x369730;if(_0x3508e7)continue;_0x3772cb||(_0x3772cb=_0x279068['addCommentThread']({'channelId':_0x139376,'threadId':_0x46e22f,'context':_0x537145,'attributes':_0x34a998||{},'resolvedBy':_0x379245,'resolvedAt':_0x4e3491,'unlinkedAt':_0x14140e,'isFromAdapter':!0x0}));const _0x461a9b=new Set(Array['from'](_0x3772cb['comments'],_0x33d519=>_0x33d519['id']));for(const _0x290132 of _0x369730['comments'])_0x461a9b['delete'](_0x290132['commentId']);for(const _0x4ec0be of _0x461a9b)_0x3772cb['getComment'](_0x4ec0be)['remove']({'isFromAdapter':!0x0});for(const _0x57f549 of _0x369730['comments']){const _0x5d54b7=_0x3772cb['getComment'](_0x57f549['commentId']);_0x5d54b7?_0x5d54b7['content']!==_0x57f549['content']&&_0x5d54b7['update']({'content':_0x57f549['content'],'isFromAdapter':!0x0}):_0x3772cb['addComment'](Object['assign'](S(_0x57f549),{'isFromAdapter':!0x0}));}}}['_getService'](_0x52c794){if(!this['_services']['has'](_0x52c794))throw new _0x1e7226('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x52c794});return this['_services']['get'](_0x52c794);}async['_fetchMissingUsersForThreads'](_0x576357){const _0x1f42b9=this['context']['plugins']['get'](_0x16cf84),{connection:_0x5a9c3b}=this['context']['plugins']['get'](n),_0x530aef=new Set();for(const {resolvedBy:_0x515535,comments:_0x379d6c}of _0x576357){_0x515535&&!_0x1f42b9['getUser'](_0x515535)&&_0x530aef['add'](_0x515535);for(const {userId:_0x260184}of _0x379d6c)_0x1f42b9['getUser'](_0x260184)||_0x530aef['add'](_0x260184);}if(0x0===_0x530aef['size'])return;const _0x3d880c=await lt['getMany'](_0x5a9c3b,Array['from'](_0x530aef));for(const _0x4008fd of _0x3d880c)_0x1f42b9['getUser'](_0x4008fd['id'])||_0x1f42b9['addUser'](_0x4008fd);}}async function F(_0x7f064c){if('404'!==_0x7f064c['code'])throw _0x7f064c;}function dt(_0x58a3ff){if((_0x1bdf5b=_0x58a3ff)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x1bdf5b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1bdf5b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x1bdf5b;throw _0x58a3ff;}function S(_0x5343de){return{'threadId':_0x5343de['commentThreadId'],'commentId':_0x5343de['commentId'],'content':_0x5343de['content'],'createdAt':_0x5343de['createdAt'],'authorId':_0x5343de['userId'],'attributes':_0x5343de['attributes']||{}};}class m extends _0x1c2520{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
- ((()=>et)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x720fb5){super(_0x720fb5);const _0x30f333=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x30f333);}['init'](){const _0x3ce7f8=this['editor']['plugins']['get'](n),_0x1dba5b=this['editor']['plugins']['get']('TrackChangesEditing');return _0x1dba5b['adapter']={'getSuggestion':async _0x1cbddc=>{await this['_waitForServiceReady']();const _0x2b2ffd=await this['_trackChangesService']['get'](_0x1cbddc)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0x2b2ffd]),_0x2b2ffd;},'addSuggestion':async({id:_0x29170e,type:_0x49dfe1,data:_0x2bdeea,originalSuggestionId:_0x129505,attributes:_0x1db174})=>{await this['_waitForServiceReady']();const _0x14a748={'id':_0x29170e,'type':_0x49dfe1,'data':_0x2bdeea,'originalSuggestionId':_0x129505,'attributes':_0x1db174},_0x3bf84f=await this['_trackChangesService']['add'](_0x29170e,_0x49dfe1,_0x2bdeea,_0x129505,_0x1db174)['catch'](_0x1002e5=>{if(ut(_0x1002e5))return new Promise(_0x557919=>{this['_bufferedRequests']['set'](_0x29170e,{'resolve':_0x557919,'suggestionData':_0x14a748});});throw _0x1002e5;});return this['_bufferedRequests']['delete'](_0x29170e),_0x3bf84f;},'updateSuggestion':async(_0x15ac3d,_0x41f61c)=>{if(await this['_waitForServiceReady'](),'open'!==_0x41f61c['state'])return this['_trackChangesService']['update'](_0x15ac3d,_0x41f61c)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x2987cf,_0x441741)=>{_0x1dba5b['hasSuggestion'](_0x441741['id'])&&(_0x1dba5b['getSuggestion'](_0x441741['id'])['attributes']=_0x441741['attributes']);}),this['_trackChangesService']['connect'](_0x3ce7f8['connection'])['then'](_0x2d5f59=>(_0x3ce7f8['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2d5f59)['then'](()=>{for(const _0x2d6413 of _0x2d5f59){_0x1dba5b['addSuggestionData'](_0x2d6413)['_saved']=!0x0;}})));}async['reconnect'](){const _0x26702d=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x2f5c62}=this['editor']['plugins']['get'](n),_0x1dd62d=await this['_trackChangesService']['connect'](_0x2f5c62);await this['_fetchMissingUsersForThreads'](_0x1dd62d);for(const {suggestionData:_0x53cc30,resolve:_0x20213e}of this['_bufferedRequests']['values']()){let _0x27462c=_0x1dd62d['find'](_0x289853=>_0x289853['id']===_0x53cc30['id']);_0x27462c||(_0x27462c=await this['_trackChangesService']['add'](_0x53cc30['id'],_0x53cc30['type'],_0x53cc30['data'],_0x53cc30['originalSuggestionId'])),_0x20213e(_0x27462c);}for(const _0x331cee of _0x1dd62d)_0x26702d['hasSuggestion'](_0x331cee['id'])||_0x26702d['addSuggestionData'](_0x331cee);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0xb8ded5=>{this['listenTo'](this['_trackChangesService'],'connected',_0xc46369=>{_0xc46369['off'](),_0xb8ded5();});});}async['_fetchMissingUsersForThreads'](_0x595f18){const _0x24ce0c=this['editor']['plugins']['get'](_0x16cf84),{connection:_0x4080bd}=this['editor']['plugins']['get'](n),_0x307b16=new Set();for(const {authorId:_0x247b64}of _0x595f18)_0x24ce0c['getUser'](_0x247b64)||_0x307b16['add'](_0x247b64);if(0x0===_0x307b16['size'])return;const _0x27d791=await lt['getMany'](_0x4080bd,Array['from'](_0x307b16));for(const _0x4bd59f of _0x27d791)_0x24ce0c['getUser'](_0x4bd59f['id'])||_0x24ce0c['addUser'](_0x4bd59f);}}function k(_0x179a5d){if(ut(_0x179a5d))return new Promise(()=>{});throw _0x179a5d;}function ut(_0xfcf02c){return _0xfcf02c['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xfcf02c['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1c2520{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3301c3=this['editor']['plugins']['get'](n),_0x5f395a=this['editor']['plugins']['get']('CommentsEditing'),_0x260166=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3301c3,'change:state',(_0x1b24f2,_0x261137,_0x587cb8)=>{_0x5f395a['isThreadsLoadingPaused']='connected'!==_0x587cb8;});}),this['listenTo'](_0x3301c3,'change:state',(_0xa80f3e,_0x3be147,_0x269b6d)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x269b6d);}),_0x260166['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class ft extends _0x1c2520{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x1c2520{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x16cf84];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x1b966e){super(_0x1b966e);const _0x239895=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x239895);}async['init'](){const _0x14b45c=this['editor']['plugins']['get'](l),_0x260016=_0x14b45c['serverHistory'],_0x5b1713=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x260016,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x14b45c['sessionId']});const _0x8ee361=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x140ae1=await tt['isBundleUploaded'](_0x5b1713['connection'],_0x8ee361);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x4d2917})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x4d2917)),'updateRevisions':async _0x5a4854=>{await this['_waitForServiceReady']();const _0x34c641=this['_revisionTracker']['currentRevision'];if(_0x140ae1&&0x1===_0x5a4854['length']&&_0x5a4854[0x0]['id']===_0x34c641['id'])return _0x5a4854;for(const _0x20fc86 of _0x5a4854)_0x20fc86['id']===_0x34c641['id']&&(_0x20fc86['isEmptyCurrent']=_0x20fc86['fromVersion']===_0x20fc86['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x5a4854,this['_lastRequestId'])['then'](_0x195f53=>(this['_lastRequestId']=_0x195f53,_0x5a4854))['catch'](_0x29ae20=>{if(st(_0x29ae20)||'400'===_0x29ae20['code']&&void 0x0!==_0x29ae20['data']['wrongRequestId']){for(const _0x4d1ca7 of _0x5a4854){!this['_revisionTracker']['repository']['getRevision'](_0x4d1ca7['id'])||this['_revisionTracker']['_bufferUpdate'](_0x4d1ca7['id'],_0x4d1ca7,!0x1);}if(st(_0x29ae20))throw _0x29ae20;return _0x5a4854;}throw _0x29ae20;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x359097,{revisionsData:_0x186b8d,requestId:_0x3bfc8d})=>{Math['max'](..._0x186b8d['map'](_0x4db51d=>_0x4db51d['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x186b8d,_0x3bfc8d);}):this['_handleRevisionsUpdate'](_0x186b8d,_0x3bfc8d);});const {revisions:_0x6ea220,requestId:_0xfab339}=await this['_revisionHistoryService']['connect'](_0x5b1713['connection']);_0x5b1713['addToReconnectionStack'](this),this['_lastRequestId']=_0xfab339,await this['_fetchMissingUsers'](_0x6ea220);for(const _0x25bb6f of _0x6ea220)this['_revisionTracker']['addRevisionData'](_0x25bb6f);this['listenTo'](_0x14b45c,'change:_isConnected',(_0x3a20b0,_0x14d78d,_0x53f876)=>{_0x53f876&&(this['_oldOffset']=_0x14b45c['_offset'],_0x3a20b0['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x5b1713,'state',_0x8e6ce7=>_0x8e6ce7===te['CONNECTED']);}async['reconnect'](){const _0x2c1443=this['editor']['plugins']['get'](n),_0x3d0b52=this['editor']['plugins']['get'](l),_0xa5a8f4=async()=>{const _0x206c4b=this['_revisionTracker']['currentRevision'],_0x2a3009=_0x206c4b['id'],_0x1ae53c=_0x2a3009!==_0x3d0b52['sessionId'];if(_0x1ae53c){const _0x26bf2a=_0x3d0b52['_offset']-this['_oldOffset'],_0x1a9955=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x206c4b['toVersion']+_0x26bf2a!==_0x1a9955){const _0x5bb637=_0x206c4b['fromVersion']+_0x26bf2a,_0x3575bd=this['editor']['plugins']['get'](_0x16cf84),_0x1892ca=this['_revisionTracker']['buildRevisionData']({'revision':_0x206c4b,'from':_0x5bb637,'to':_0x1a9955});_0x1892ca['id']=_0x206c4b['id'];const _0x2d42d2=_0x1892ca['authorsIds']['map'](_0x2fe6b5=>_0x3575bd['getUser'](_0x2fe6b5));_0x206c4b['_update']({..._0x1892ca,'authors':_0x2d42d2},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x206c4b['id'],_0x1892ca,!0x0);}this['_revisionTracker']['_startingVersion']=_0x1a9955,(_0x206c4b['toVersion']===_0x206c4b['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x2a3009)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x2a3009),this['_revisionTracker']['_createCurrentRevision'](_0x1a9955));}const {revisions:_0x2ca698,requestId:_0x5a8df8}=await this['_revisionHistoryService']['reconnect'](_0x2c1443['connection'],this['_lastRequestId']);_0x1ae53c&&_0x2ca698['length']>0x0?_0x3d0b52['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x2ca698),this['_handleRevisionsUpdate'](_0x2ca698,_0x5a8df8),this['_revisionTracker']['sendBufferedUpdates']());};return _0x3d0b52['_isConnected']?_0xa5a8f4():new Promise((_0x508f80,_0x2d775b)=>{_0x3d0b52['once']('change:_isConnected',()=>{_0xa5a8f4()['then'](_0x508f80)['catch'](_0x2d775b);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5d4797=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x16f267=>{_0x16f267['off'](),_0x5d4797();});});}['_getLatestVersionFromServerOperations'](){const _0x46d0e4=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1b276d of _0x46d0e4)if('marker'!==_0x1b276d['type']||_0x1b276d['affectsData'])return _0x1b276d['baseVersion']+0x1;}['_getLatestVersion'](){const _0x565b48=this['editor']['plugins']['get'](l);return new Promise(_0x585db0=>{_0x565b48['_isPendingUpdate']?_0x565b48['once']('change:_isPendingUpdate',()=>{_0x585db0(this['_getLatestVersionFromServerOperations']());}):_0x585db0(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0xa40a87,_0x5a2b79){const _0xa3debf=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x5a2b79;for(const _0x1c7b75 of _0xa40a87){const _0x5f235f=_0xa3debf['getRevision'](_0x1c7b75['id']);if(_0x5f235f){if((_0x1c7b75['fromVersion']||_0x1c7b75['toVersion'])&&(_0x1c7b75['diffData']=null),_0x5f235f===this['_revisionTracker']['currentRevision']){const _0x258b22=Math['max'](_0x5f235f['toVersion'],_0x1c7b75['toVersion']),_0xa57b39=Math['max'](_0x5f235f['fromVersion'],_0x1c7b75['fromVersion']);let _0x5be8e4;_0x5f235f['toVersion']===_0x1c7b75['toVersion']&&_0x5f235f['fromVersion']===_0x1c7b75['fromVersion']?(_0x5be8e4=!0x0,this['_preventResendingRevisionData'](_0x1c7b75)):_0x1c7b75['toVersion']===_0x258b22&&_0x1c7b75['fromVersion']===_0xa57b39?_0x5be8e4=!0x1:(_0x5f235f['toVersion']===_0x258b22&&_0x5f235f['fromVersion']===_0xa57b39||this['_fixRevision']({'revision':_0x5f235f,'from':_0xa57b39,'to':_0x258b22}),_0x5be8e4=!0x0),_0x5be8e4&&(delete _0x1c7b75['fromVersion'],delete _0x1c7b75['toVersion'],delete _0x1c7b75['diffData'],delete _0x1c7b75['createdAt'],delete _0x1c7b75['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x1c7b75),this['_preventResendingRevisionData'](_0x1c7b75);}else this['_revisionTracker']['addRevisionData'](_0x1c7b75);}const _0x9cc0ff=_0xa3debf['getRevisions']();_0x9cc0ff['reverse']();for(let _0x44470f=0x0;_0x44470f<_0x9cc0ff['length']-0x1;_0x44470f++){const _0x5224ac=_0x9cc0ff[_0x44470f],_0x189c31=_0x9cc0ff[_0x44470f+0x1];if(_0x5224ac['fromVersion']<_0x189c31['toVersion']){const _0x221c2a=_0x189c31['toVersion'],_0x4dd1f2=Math['max'](_0x221c2a,_0x5224ac['toVersion']);this['_fixRevision']({'revision':_0x5224ac,'from':_0x221c2a,'to':_0x4dd1f2});}}}['_fixRevision']({revision:_0x263713,from:_0x10b13f,to:_0x2582f9}={}){const _0x17cc18=this['editor']['plugins']['get'](_0x16cf84),_0x5367ee=this['_revisionTracker']['buildRevisionData']({'revision':_0x263713,'from':_0x10b13f,'to':_0x2582f9});_0x5367ee['authors']=_0x5367ee['authorsIds']['map'](_0x3dd5e5=>_0x17cc18['getUser'](_0x3dd5e5)),_0x263713['_update'](_0x5367ee);}['_preventResendingRevisionData'](_0x12b52e){const _0x3e9da0={};_0x3e9da0['id']=_0x12b52e['id'];for(const _0x3a4b84 of Object['keys'](_0x12b52e))'id'!==_0x3a4b84&&(_0x3e9da0[_0x3a4b84]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x3e9da0['id'],_0x3e9da0,!0x0);}async['_fetchMissingUsers'](_0x336293){const _0xe017e2=this['editor']['plugins']['get'](_0x16cf84),{connection:_0x3c1cb5}=this['editor']['plugins']['get'](n),_0x33414e=new Set();for(const _0x128ce1 of _0x336293){for(const _0xe2ca2a of _0x128ce1['authorsIds'])_0xbf1383(_0xe2ca2a);_0x128ce1['creatorId']&&_0xbf1383(_0x128ce1['creatorId']);}if(0x0===_0x33414e['size'])return;const _0x2bf180=await lt['getMany'](_0x3c1cb5,Array['from'](_0x33414e));for(const _0x53df69 of _0x2bf180)_0xe017e2['getUser'](_0x53df69['id'])||_0xe017e2['addUser'](_0x53df69);function _0xbf1383(_0x96ea36){_0xe017e2['getUser'](_0x96ea36)||_0x33414e['add'](_0x96ea36);}}}function st(_0x425f99){return _0x425f99['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x425f99['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x425f99['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x1c2520{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x97363b{['_collapseAt'];constructor(_0x32c070,_0x10ff24=0x6){super(_0x32c070);const _0x28ac97=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x10ff24,this['bind']('isHidden')['to'](this,'usersCount',_0x2ec924=>_0x2ec924<_0x10ff24),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x28ac97['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x28ac97['to']('usersCount',_0x4a7977=>'+'+(_0x4a7977-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x97363b{['items'];['keystrokes'];constructor(_0x26a514){super(_0x26a514);const _0x378cbc=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x5fd7b6(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x378cbc['if']('hasPopup'),'aria-expanded':_0x378cbc['to']('isExpanded',_0x4881ab=>this['hasPopup']&&String(_0x4881ab)),'aria-label':_0x378cbc['to']('hasPopup',_0x2c8d4a=>V(_0x26a514,_0x2c8d4a?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x378cbc['to']('hasPopup',_0x4a5664=>!!_0x4a5664&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x378cbc['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x378cbc['to'](_0x4dc23d=>{const _0x139ddf=_0x4dc23d,_0x1fcc20=document['querySelector']('.ck-presence-list__dropdown-list'),_0x5e2902=document['querySelector']('.ck-balloon-panel_with-arrow');_0x1fcc20?.['contains'](_0x139ddf['relatedTarget'])||_0x5e2902?.['contains'](_0x139ddf['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x1431e7,_0x2df9ae,_0x186d03)=>{this['element']&&(_0x186d03?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x97363b{['counterView'];['inlineListView'];constructor(_0x35b306,_0x26324f=0x6){super(_0x35b306);const _0x199642=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x26324f),this['inlineListView']=new is(_0x35b306),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x7181b6 of this['inlineListView']['items'])_0x7181b6['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',_0x199642['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x97363b{['listWrapperView'];constructor(_0x3be39e,_0x6c059b){super(_0x3be39e);const _0x5435de=this['bindTemplate'];this['listWrapperView']=new pt(_0x3be39e,_0x6c059b),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':V(_0x3be39e,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x5435de['to'](_0x5b02b3=>{const _0x583f70=_0x5b02b3,_0x10b1a7=document['querySelector']('.ck-presence-list__list'),_0x304b0e=document['querySelector']('.ck-balloon-panel_with-arrow');_0x10b1a7?.['contains'](_0x583f70['relatedTarget'])||_0x304b0e?.['contains'](_0x583f70['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0x4e2138{constructor(_0x3a6b0a,_0x53e47d){super(_0x3a6b0a);const _0xe08a37=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x53e47d?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0xe08a37['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0xe08a37['to']('role'),'aria-label':_0xe08a37['to']('ariaLabel'),'aria-labelledby':_0xe08a37['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0xca9fbc['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5dba0f=this['element'];_0x5dba0f&&(this['_isScrollable']=Math['max'](_0x5dba0f['scrollHeight'],_0x5dba0f['clientHeight'])>0.8*window['innerHeight']);}}class j extends rt{['userView'];constructor(_0x50d88b,_0xca9083,_0x3ba45f){super(_0x50d88b);const _0x2bd5b9=this['bindTemplate'];this['userView']=new ct(_0x50d88b,_0xca9083);const _0x51b5a7={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0xca9083['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0xca9083['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0xca9083['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x3ba45f&&(_0x51b5a7['tag']='button',_0x51b5a7['on']={'click':_0x2bd5b9['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x51b5a7);}['focus'](){this['element']['focus']();}}class A extends _0x97363b{['userView'];['markerView'];constructor(_0x711d5,_0x8ffad0,_0x3c0dc1){super(_0x711d5);const _0x5810ef=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x711d5,_0x8ffad0),this['markerView']=new at(_0x711d5,_0x8ffad0);const _0x3c5f93=new ot(_0x711d5);_0x3c5f93['template']['tag']='span',_0x3c5f93['text']=_0x8ffad0['name'];const _0x3bbb8c={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5810ef['to']('isFocusable',_0x34d06d=>!!_0x34d06d&&0x0),'aria-labelledby':_0x3c5f93['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5810ef['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5810ef['to']('hasTooltip',_0x3fd178=>!_0x3fd178),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x3c5f93]};_0x3c0dc1&&(_0x3bbb8c['tag']='button',_0x3bbb8c['on']={'click':_0x5810ef['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3bbb8c);}}class at extends _0x97363b{constructor(_0x2d1bf2,_0x56e93f){super(_0x2d1bf2),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x56e93f['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x59b06d{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x296499){super(_0x296499),this['context']['config']['define']('presenceList',x);const _0x1c56cd=_0x296499['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x1c56cd)throw new _0x1e7226('presencelist-collapseat-invalid-format',this);if(_0x1c56cd<0x1)throw new _0x1e7226('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x1ad15d(),this['balloonPanelView']=new _0x21440a(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x5705e4 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x5705e4);this['listenTo'](this['_allConnectedUsers'],'add',(_0x4bdf7e,_0x4c37d7)=>{this['_handleUserAdd'](_0x4c37d7);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1edfdf,_0x18ead1)=>{this['_handleUserRemove'](_0x18ead1);});}['_createView'](){const _0x472207=this['context'],_0x601428=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x11f496=this['balloonPanelView'];if(!_0x1e927f(_0x472207['config']['get']('presenceList.container')))throw new _0x1e7226('presencelist-missing-container',this);return _0x601428['counterView']['bind']('usersCount')['to'](this),_0x601428['bind']('isCollapsed')['to'](this,'usersCount',_0x2b8317=>{const {collapseAt:_0x43945b}=_0x472207['config']['get']('presenceList'),_0x32fcb7=_0x2b8317>=_0x43945b;if(_0x32fcb7&&!_0x601428['inlineListView']['items']['find'](_0xfa8f61=>_0xfa8f61 instanceof b)){const _0x1cc384=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x1cc384&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x601428['inlineListView']['items']['add'](_0x601428['counterView']);}return _0x32fcb7||this['hideDropdown'](),_0x32fcb7;}),_0x601428['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x1e2697=>{const _0x4b9fb9=_0x472207['config']['get']('presenceList'),_0x3a1007=new A(_0x472207['locale'],_0x1e2697,!!_0x4b9fb9['onClick']);return _0x3a1007['bind']('hasTooltip')['to'](_0x601428,'isCollapsed',_0xd244a3=>!_0xd244a3),_0x3a1007['bind']('isFocusable')['to'](_0x601428,'isCollapsed',_0x553d25=>!_0x553d25),_0x4b9fb9['onClick']&&this['listenTo'](_0x3a1007,'execute',()=>{this['view']['isCollapsed']||_0x4b9fb9['onClick'](_0x1e2697,_0x3a1007['element']);}),_0x3a1007;}),this['listenTo'](_0x601428['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x601428['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x601428['inlineListView']['keystrokes']['set']('Enter',(_0x2a5c32,_0x23f9ed)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x23f9ed());}),_0x601428['render'](),_0x11f496['render'](),_0x1b8fa0({'emitter':_0x601428,'activator':()=>_0x11f496['isVisible'],'contextElements':[_0x11f496['element'],_0x601428['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x472207['config']['get']('presenceList.container')['appendChild'](_0x601428['element']),this['_bodyCollection']=new _0x7881da(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x601428;}['_handleUserAdd'](_0x380e3a){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x380e3a['isMe'])return;const _0x19c46a=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x19c46a-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x152e48=_0x380e3a['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x380e3a,_0x152e48);}['_handleUserRemove'](_0x4b7c41){this['usersCount']--;const {collapseAt:_0x181b2a}=this['context']['config']['get']('presenceList'),_0x4f3557=this['usersCount']>=_0x181b2a;if(this['currentDisplayedUsers']['get'](_0x4b7c41['id']))this['currentDisplayedUsers']['remove'](_0x4b7c41['id']);else{if(_0x4f3557&&this['currentDisplayedUsers']['length']+0x1===_0x181b2a-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x4f3557?0x1:0x0)<this['usersCount']){for(const _0x15bac7 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x15bac7['id'])&&(this['currentDisplayedUsers']['add'](_0x15bac7,Math['min'](this['currentDisplayedUsers']['length']-(_0x4f3557?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x4f3557?0x1:0x0)===_0x181b2a-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x5650fa=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x5650fa['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x3d14f0}=this['presenceDropdownView'];_0x3d14f0['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x481d4b=>{if(!_0x5650fa['displayMe']&&_0x481d4b['isMe'])return null;const _0x2b37aa=new j(this['context']['locale'],_0x481d4b,!!_0x5650fa['onClick']);return _0x5650fa['onClick']&&this['listenTo'](_0x2b37aa,'execute',()=>{_0x5650fa['onClick'](_0x481d4b,_0x2b37aa['element']);}),_0x2b37aa;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x3d14f0['focus'](),_0x3d14f0['checkIfScrollable']();const _0x50e1cb=(_0x1cd1da,_0x1e64e1)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x1e64e1();};_0x3d14f0['keystrokes']['set']('Esc',_0x50e1cb),_0x3d14f0['keystrokes']['set']('Shift+Tab',_0x50e1cb),_0x3d14f0['keystrokes']['set']('Tab',(_0x6700e3,_0x3a90c8)=>{!function(_0x340a8a){const _0x4e6604=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x17c53a=>_0x17c53a+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x4cab4a=[...document['body']['querySelectorAll'](_0x4e6604)]['filter'](_0x34d6c1=>_0x34d6c1===document['activeElement']||_0x34d6c1['offsetWidth']+_0x34d6c1['offsetHeight']>0x0)['sort']((_0x5c9853,_0x28e7ee)=>(_0x5c9853['tabIndex']||0x0)-(_0x28e7ee['tabIndex']||0x0)),_0x2bb968=_0x4cab4a['indexOf'](_0x340a8a),_0x48235c=_0x4cab4a[(_0x2bb968+0x1)%_0x4cab4a['length']];_0x48235c&&_0x48235c['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3a90c8();}),_0x3d14f0['focusTracker']['add'](this['view']['element']),_0x3d14f0['focusTracker']['on']('change:isFocused',(_0x1219d5,_0x33b986,_0x30dc7a)=>{_0x30dc7a||this['hideDropdown']();});}['hideDropdown'](){this['presenceDropdownView']&&(this['view']['inlineListView']['isExpanded']=!0x1,this['balloonPanelView']['unpin'](),this['balloonPanelView']['content']['remove'](this['presenceDropdownView']),this['presenceDropdownView']['destroy'](),this['presenceDropdownView']=void 0x0);}['destroy'](){super['destroy'](),this['view']&&this['view']['isRendered']&&this['view']['destroy'](),this['_bodyCollection']&&(this['_bodyCollection']['detachFromDom'](),this['_bodyCollection']['destroy'](),this['_bodyCollection']=null);}}class gt extends _0x59b06d{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,gt as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,mt as RealTimeCollaborativeRevisionHistory,ft as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
23
+ import{ContextPlugin as _0xd3e8aa,Plugin as _0x25e6f2,PendingActions as _0x53b958,Context as _0x5e153d}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x407ddd,CKEditorError as _0x30f693,Collection as _0xb4bb92,global as _0x44b0ca,version as nt,uid as _0x25094b,KeystrokeHandler as _0x553934}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x45abe3,View as _0x57df8e,ListView as _0x11ceb4,ListItemView as et,LabelView as it,BalloonPanelView as _0x4ba438,clickOutsideHandler as _0x2c85ae,BodyCollection as _0x2b3595}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x5c8a09,History as _0xb38147,NoOperation as _0x444f10,InsertOperation as _0x121a73,MarkerOperation as _0x37d9f5,RootAttributeOperation as _0x40624e,transformOperationSets as _0x417964,OperationFactory as _0x2b0580}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x36ce39,CollaborativeEditingService as _0x47837b,User as ct,CommentsService as _0x3f87de,TrackChangesService as tt,RevisionHistoryService as _0xbde25a,EditorService as _0x9c7fbf}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x31dbe9,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x32c2dc}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x3d55c6}from'es-toolkit/compat';class n extends _0xd3e8aa{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x45abe3];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x8ab8ae){super(_0x8ab8ae),this['set']('state',_0x36ce39['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x407ddd())();}['init'](){const _0x3025a2=this['context'],_0xd20496=_0x3025a2['plugins']['get']('CloudServices'),_0x531fd6=_0x3025a2['plugins']['get'](_0x45abe3);if(!_0xd20496['token'])throw new _0x30f693('websocketgateway-missing-token',this);if(!_0xd20496['webSocketUrl'])throw new _0x30f693('websocketgateway-missing-websocket-url',this);return this['_domEmitter']['listenTo'](window,'offline',()=>this['_isBrowserOffline']=!0x0),this['_domEmitter']['listenTo'](window,'online',()=>this['_isBrowserOffline']=!0x1),this['context']['config']['define']('cloudServices.connectionTimeout',0xa),this['context']['config']['define']('cloudServices.requestTimeout',0x14),n['WebSocketGateway']['connect'](_0xd20496['token'],_0xd20496['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x189c10=>{if(this['connection']=_0x189c10,this['bind']('state')['to'](_0x189c10,'state',this,'_isBrowserOffline',(_0x5ddad5,_0x6b9eb2)=>('connected'!==_0x5ddad5&&(this['_shouldPluginsReconnect']=!0x0),_0x6b9eb2||_0x5ddad5!==_0x36ce39['CONNECTED']?_0x36ce39['DISCONNECTED']:this['state']==_0x36ce39['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x36ce39['CONNECTING']):_0x36ce39['CONNECTED'])),this['connection']['on']('error',(_0x358490,_0xe14b4b)=>{if('limitExceeded'!==_0xe14b4b['code'])throw console['error'](_0xe14b4b),new _0x30f693('cloudservices-init',null,{'originalError':_0xe14b4b});_0x531fd6['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'});}),!_0x189c10['me'])return new Promise(_0x306c80=>_0x189c10['on']('change:me',_0x306c80));})['catch'](_0x4e8a6c=>{throw console['error'](_0x4e8a6c),new _0x30f693('cloudservices-init',null,{'originalError':_0x4e8a6c});});}['addToReconnectionStack'](_0x11870b){if('function'!=typeof _0x11870b['reconnect'])throw new _0x30f693('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x11870b))throw new _0x30f693('websocketgateway-plugin-already-registered',this,{'name':_0x11870b['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x11870b);}['removeFromReconnectionStack'](_0x392f71){this['_reconnectionStack']['delete'](_0x392f71);}['isInReconnectionStack'](_0xcd5c9e){return this['_reconnectionStack']['has'](_0xcd5c9e);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x1c571b=>_0x1c571b['reconnect']())))['then'](()=>this['state']=_0x36ce39['CONNECTED'])['catch'](_0x5b3f3d=>{throw console['error'](_0x5b3f3d),new _0x30f693('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x36ce39['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0xd3e8aa{['channelSessions'];['channelConnectedUsers'];['allConnectedUsers'];['_registeredSessions'];['_uniqueUsersCount'];['_users'];static get['pluginName'](){return'Sessions';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[n,_0x31dbe9];}constructor(_0x42c1da){super(_0x42c1da),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0xb4bb92(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x31dbe9);}['init'](){const _0x558251=this['context']['plugins']['get'](n);this['listenTo'](_0x558251,'change:state',(_0x5cbd43,_0x2ba6de,_0x4fbc5c)=>{if('connected'!==_0x4fbc5c)this['channelSessions']['forEach'](_0x449d8c=>_0x449d8c['clear']()),this['channelConnectedUsers']['forEach'](_0x2cc509=>_0x2cc509['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0xa25a4e,_0x3e2881]of this['_registeredSessions'])for(const _0x416414 of _0x3e2881)this['_handleSessionAdd'](_0xa25a4e,_0x416414);}}),this['_createUser'](_0x558251['connection']['me'],!0x0);}['register'](_0x2e1f1e,_0x2b98d8){if(this['_registeredSessions']['has'](_0x2e1f1e))throw new _0x30f693('sessions-register-already-registered',null,{'channelId':_0x2e1f1e});this['_registeredSessions']['set'](_0x2e1f1e,_0x2b98d8),this['channelSessions']['set'](_0x2e1f1e,new _0xb4bb92()),this['channelConnectedUsers']['set'](_0x2e1f1e,new _0xb4bb92()),this['listenTo'](_0x2b98d8,'add',(_0x4b2ac3,_0x3a959b)=>this['_handleSessionAdd'](_0x2e1f1e,_0x3a959b)),this['listenTo'](_0x2b98d8,'remove',(_0x7da0a2,_0x2f9c1d)=>this['_handleSessionRemove'](_0x2e1f1e,_0x2f9c1d));for(const _0x5e0df4 of _0x2b98d8)this['_handleSessionAdd'](_0x2e1f1e,_0x5e0df4);}['unregister'](_0x45be40){if(!this['_registeredSessions']['has'](_0x45be40))throw new _0x30f693('sessions-unregister-not-exist',null,{'channelId':_0x45be40});const _0xc2cbf8=this['_registeredSessions']['get'](_0x45be40);this['stopListening'](_0xc2cbf8);for(const _0x4180e4 of _0xc2cbf8)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x45be40,_0x4180e4);this['_registeredSessions']['delete'](_0x45be40),this['channelSessions']['delete'](_0x45be40),this['channelConnectedUsers']['delete'](_0x45be40);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x3c15e5){for(const _0x439d68 of this['channelSessions']['values']())for(const _0x4c3274 of _0x439d68)if(_0x4c3274['id']===_0x3c15e5)return _0x4c3274['user'];}['getUserSessions'](_0x1836d4,_0x15397d){const _0x3b0aa6=_0x15397d?[this['channelSessions']['get'](_0x15397d)]:this['channelSessions']['values'](),_0xbf6b69=new Set();for(const _0x2baebc of _0x3b0aa6)for(const _0x463b2b of _0x2baebc)_0x463b2b['user']['id']===_0x1836d4['id']&&_0xbf6b69['add'](_0x463b2b['id']);return _0xbf6b69;}['getUserRole'](_0x5b765f){for(const _0x1f4c53 of this['channelSessions']['values']())for(const _0x58694f of _0x1f4c53)if(_0x58694f['user']===_0x5b765f)return _0x58694f['role'];}['_handleSessionAdd'](_0x5eae77,_0x474035){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x5d58d3=_0x474035['user'],_0xe8062c=this['_users']['getUser'](_0x5d58d3['id'])||this['_createUser'](_0x5d58d3),_0x4ad183=Object['assign']({},_0x474035,{'user':_0xe8062c});if(this['channelSessions']['get'](_0x5eae77)['add'](_0x4ad183),!_0x5d58d3['hiddenInPresenceList']){const _0x33d572=this['channelConnectedUsers']['get'](_0x5eae77);_0x33d572['has'](_0xe8062c['id'])||_0x33d572['add'](_0xe8062c),this['allConnectedUsers']['has'](_0xe8062c['id'])||_0x5d58d3['hiddenInPresenceList']||this['allConnectedUsers']['add'](_0xe8062c,_0xe8062c['isMe']?0x0:void 0x0);}this['fire']('sessionAdd:'+_0x5eae77,{'channelId':_0x5eae77,'session':_0x4ad183});}['_handleSessionRemove'](_0x2cf462,_0x54cd52){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x71417e=this['channelConnectedUsers']['get'](_0x2cf462),_0x5c9368=_0x54cd52['user'];_0x5c9368['id']&&(this['channelSessions']['get'](_0x2cf462)['remove'](_0x54cd52['id']),_0x71417e['has'](_0x5c9368['id'])&&!this['getUserSessions'](_0x5c9368,_0x2cf462)['size']&&_0x71417e['remove'](_0x5c9368['id']),this['allConnectedUsers']['get'](_0x5c9368['id'])&&!this['getUserSessions'](_0x5c9368)['size']&&this['allConnectedUsers']['remove'](_0x5c9368['id']));}['_createUser'](_0x51dab1,_0x339122){const _0x35a41b=this['_users']['addUser'](_0x51dab1);return _0x339122&&this['_users']['defineMe'](_0x51dab1['id']),_0x35a41b['orderNumber']=this['_uniqueUsersCount']++,_0x35a41b;}}class G extends _0x25e6f2{['_domEmitter']=new(_0x407ddd())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x2038ab=this['editor'],_0xcdcb34=_0x2038ab['plugins']['get'](i);_0x2038ab['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0x679b8,{writer:_0x5e4106})=>function(_0x562c6f,_0x581e9c,_0x5990bb,_0x111d69){const _0x5d59c7=_0x562c6f['markerName']['split'](':')[0x2],_0x8f917d=_0x5990bb['getUserBySessionId'](_0x5d59c7);if(!_0x8f917d||_0x5d59c7===_0x5990bb['mySessionId'])return;if(!_0x111d69['model']['schema']['checkChild'](_0x562c6f['markerRange']['start'],'$text'))return;const _0x64411={'class':'ck-user__marker\x20'+_0x8f917d['color']['getMarkerClass'](),'data-name':_0x8f917d['name'],'data-session-id':_0x5d59c7},_0x5e4611=_0x111d69['model']['markers']['get'](_0x562c6f['markerName']),_0x1d3843=_0x5e4611['getStart'](),_0x23834c=_0x1d3843['nodeAfter'],_0x56e9d4=_0x111d69['model']['schema'];if(_0x23834c&&_0x56e9d4['isObject'](_0x23834c)&&_0x56e9d4['isInline'](_0x23834c)&&!_0x111d69['model']['markers']['get']('user:range:'+_0x5d59c7)['getRange']()['isCollapsed'])return;const _0x1dffbd=_0x1d3843['parent'];return _0x111d69['model']['schema']['isLimit'](_0x1dffbd)&&!_0x111d69['model']['hasContent'](_0x1dffbd)&&(_0x64411['contenteditable']=!0x1),function(_0x516784,_0x42382e,_0x3f3f0a){const _0x46b1ad=_0x516784['createUIElement']('span',_0x42382e);return _0x516784['setCustomProperty']('userPositionMarker',!0x0,_0x46b1ad),_0x46b1ad['render']=function(_0x5ce25d){const _0x209313=this['toDomElement'](_0x5ce25d),_0x10bf98=document['createElement']('span');return _0x10bf98['classList']['add']('ck-user__marker-tooltip'),_0x10bf98['setAttribute']('contenteditable','false'),_0x10bf98['setAttribute']('spellcheck','false'),_0x10bf98['textContent']=_0x3f3f0a['name'],_0x209313['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x10bf98['outerHTML']+'⁠',_0x209313['addEventListener']('mouseenter',()=>{_0x209313['classList']['add']('ck-user__marker_hovered');}),_0x209313['addEventListener']('mouseleave',()=>{_0x209313['classList']['remove']('ck-user__marker_hovered');}),_0x209313;},_0x46b1ad['isSimilar']=function(_0xce37c6){return!(!this['getCustomProperty']('userPositionMarker')||!_0xce37c6['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0xce37c6['getAttribute']('data-session-id'));},_0x46b1ad;}(_0x581e9c,_0x64411,_0x8f917d);}(_0x679b8,_0x5e4106,_0xcdcb34,_0x2038ab)}),_0x2038ab['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x4fd11d=>function(_0x38e633,_0x1d70ef){const _0x513fc5=_0x38e633['markerName']['split'](':')[0x2];if(_0x513fc5===_0x1d70ef['mySessionId'])return null;const _0x13174e=_0x1d70ef['getUserBySessionId'](_0x513fc5);if(!_0x13174e)return{'id':_0x513fc5,'classes':[]};return{'id':_0x513fc5,'classes':['ck-user__selection',_0x13174e['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x513fc5},'priority':0x7d0+_0x13174e['orderNumber']};}(_0x4fd11d,_0xcdcb34)}),function(_0x2e0495){const _0x2d78a7=_0x2e0495['model'],_0x32e74d=new Map(),_0x5c359a=_0x2e0495['plugins']['get'](i);_0x2d78a7['markers']['on']('update:user:range',(_0x1c9ac1,_0x4050c4,_0x85db45,_0xf92286)=>{if(!_0xf92286&&_0x32e74d['get'](_0x4050c4['name']))return _0x32e74d['get'](_0x4050c4['name'])['detach'](),void _0x32e74d['delete'](_0x4050c4['name']);const _0x214103=_0x4050c4['name']['split'](':')[0x2];if(_0x214103===_0x5c359a['mySessionId'])return;const _0x163c81='user:position:'+_0x214103;_0x2d78a7['markers']['has'](_0x163c81)&&_0x2e0495['editing']['reconvertMarker'](_0x163c81),_0x4050c4['on']('change:range',(_0x3d7c12,_0x37652a,_0xa0262a)=>{if('$graveyard'!=_0x37652a['root']['rootName']&&'$graveyard'==_0x4050c4['getRange']()['root']['rootName']&&!_0x32e74d['has'](_0x4050c4['name'])){const _0xf7a943=_0x2d78a7['schema']['getNearestSelectionRange'](_0xa0262a['deletionPosition']);if(_0xf7a943){const _0x5cff03=_0x5c8a09['fromRange'](_0xf7a943);_0x32e74d['set'](_0x4050c4['name'],_0x5cff03),_0x5cff03['on']('change:range',(_0x53e8ed,_0x10b747,_0x120bb1)=>{if('$graveyard'==_0x5cff03['root']['rootName']){const _0x317993=_0x2d78a7['schema']['getNearestSelectionRange'](_0x120bb1['deletionPosition']);_0x317993?(_0x5cff03['start']=_0x317993['start'],_0x5cff03['end']=_0x317993['end']):(_0x32e74d['delete'](_0x4050c4['name']),_0x5cff03['detach']());}});}}});}),_0x2d78a7['document']['on']('change',()=>{_0x32e74d['size']>0x0&&_0x2d78a7['enqueueChange']({'isUndoable':!0x1},_0x646cf9=>{for(const [_0x3090b4,_0x3ab27d]of _0x32e74d)'$graveyard'==_0x2d78a7['markers']['get'](_0x3090b4)['getRange']()['root']['rootName']&&(te(_0x3090b4['split'](':')[0x2],_0x3ab27d['toRange'](),_0x2d78a7,_0x646cf9),_0x3ab27d['detach']());_0x32e74d['clear']();});});}(_0x2038ab),this['_domEmitter']['listenTo'](_0x44b0ca['document'],'keydown',(_0x26cde0,{key:_0x669b6c})=>{'Escape'===_0x669b6c&&function(_0x3308fe){_0x3308fe['editing']['view']['change'](_0x54b80f=>{for(const _0x420879 of _0x3308fe['model']['markers']){if(!_0x420879['name']['startsWith']('user:position'))continue;const _0x11e37a=_0x3308fe['editing']['mapper']['markerNameToElements'](_0x420879['name']);if(_0x11e37a){for(const _0x261ad6 of _0x11e37a)_0x54b80f['removeClass']('ck-user__marker_hovered',_0x261ad6);}}});}(_0x2038ab);},{'useCapture':!0x0});}['afterInit'](){const _0x35ce90=this['editor'],_0x2c1651=_0x35ce90['commands']['get']('undo');_0x2c1651&&_0x35ce90['model']['on']('applyOperation',(_0x330e78,_0x3b3911)=>{const _0x3fb5b0=_0x3b3911[0x0];if(!_0x3fb5b0['isDocumentOperation'])return;if('marker'!=_0x3fb5b0['type']||!_0x3fb5b0['name']['startsWith']('user:'))return;const _0x2b1dcd=_0x3fb5b0['batch'];_0x2c1651['_createdBatches']['has'](_0x2b1dcd)&&(_0x3fb5b0['newRange']=_0x3fb5b0['oldRange']?_0x35ce90['model']['createRange'](_0x3fb5b0['oldRange']['start'],_0x3fb5b0['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x108284=this['editor'],_0x4860eb=_0x108284['model']['document'],_0x5bd8fe=_0x108284['plugins']['get'](i);_0x108284['model']['enqueueChange']({'isUndoable':!0x1},_0x4cfd09=>{const _0x477c50='user:range:'+_0x5bd8fe['mySessionId'],_0x1dedbe='user:position:'+_0x5bd8fe['mySessionId'],_0x1f8bf6=_0x108284['model']['markers']['has'](_0x477c50);_0x108284['editing']['view']['hasDomSelection']?te(_0x5bd8fe['mySessionId'],_0x4860eb['selection']['getFirstRange'](),_0x108284['model'],_0x4cfd09):_0x1f8bf6&&(_0x4cfd09['removeMarker'](_0x477c50),_0x4cfd09['removeMarker'](_0x1dedbe));});}}function te(_0x52e566,_0x210384,_0x55d0b8,_0x20ef5c){const _0x41791f='user:range:'+_0x52e566,_0x1cd1d5='user:position:'+_0x52e566,_0x13b80c=_0x210384['getContainedElement']();let _0x116e00=_0x210384['start'];if(_0x13b80c&&_0x13b80c['is']('element','tableCell')){const _0xb82334=function(_0x3c87d8,_0x3196f1){for(const _0x3fa61b of _0x3c87d8['getPositions']())if(_0x3196f1['schema']['checkChild'](_0x3fa61b,'$text'))return _0x3fa61b;}(_0x210384,_0x55d0b8);_0xb82334&&(_0x116e00=_0xb82334,_0x210384=_0x20ef5c['createRange'](_0x116e00));}const _0x333b6c=_0x20ef5c['createRange'](_0x116e00);_0x55d0b8['markers']['has'](_0x41791f)?(_0x20ef5c['updateMarker'](_0x41791f,{'range':_0x210384}),_0x20ef5c['updateMarker'](_0x1cd1d5,{'range':_0x333b6c})):(_0x20ef5c['addMarker'](_0x41791f,{'range':_0x210384,'usingOperation':!0x0}),_0x20ef5c['addMarker'](_0x1cd1d5,{'range':_0x333b6c,'usingOperation':!0x0}));}function $(_0x2676c0,_0x3070dc,_0x41a2af){const _0x5004bf=_0x2676c0['t'],t=_0x2676c0['t'];switch(_0x3070dc){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 _0x5004bf({'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'},_0x41a2af);default:return'';}}let Q=0x1;class l extends _0x25e6f2{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0x47837b)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,G,_0x53b958,_0x31dbe9,_0x45abe3];}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 _0x3b3df5=this['serverHistory']['getOperations']();for(let _0x419a39=_0x3b3df5['length']-0x1;_0x419a39>=0x0;_0x419a39--){const _0x229b0e=_0x3b3df5[_0x419a39];if(!this['_disconnectionOperations']['has'](_0x229b0e))return _0x229b0e['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0xffd400){if(super(_0xffd400),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0xb38147(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x30f693('collaboration-missing-channelid',this);const _0x4afe76=_0xffd400['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x4afe76,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x32c2dc(),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 Z(this['_disconnectionOperations']);}['init'](){const _0x3aeced=this['editor'],_0x1eb7e9=_0x3aeced['plugins']['get'](_0x31dbe9),_0x2128a7=_0x3aeced['plugins']['get'](n);this['listenTo'](_0x1eb7e9,'getOperationAuthor',(_0x180056,_0x13357c)=>{const _0xf40e79=_0x13357c[0x0];_0xf40e79['_authorId']&&(_0x180056['return']=_0x1eb7e9['getUser'](_0xf40e79['_authorId']),_0x180056['stop']()),null===_0xf40e79['_authorId']&&(_0x180056['return']=null,_0x180056['stop']());},{'priority':'high'}),this['listenTo'](_0x3aeced['model']['document']['selection'],'change:range',(_0x272c82,_0x9f1e74)=>{_0x9f1e74['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x3aeced['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x3aeced['model']['on']('applyOperation',(_0x53f354,_0x511a33)=>{const _0x154dfb=_0x511a33[0x0];_0x154dfb['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x154dfb),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x2128a7,'state',this,'_hasSynchronizationProblem',(_0x5687de,_0x51486d)=>'connected'===_0x5687de&&!_0x51486d),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x3aeced['disableReadOnlyMode']('rtc-offline'):_0x3aeced['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x3aeced['disableReadOnlyMode']('rtc-offline'):_0x3aeced['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x177f6b=this['editor']['plugins']['get'](i),_0x1f0142=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x177f6b['unregister'](this['_channelId']);const _0x340177=await this['_service']['reconnect'](_0x1f0142['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x340177)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x28df99=await this['_service']['getConnectedSessions']();_0x177f6b['register'](this['_channelId'],_0x28df99),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x2e9b4f){if(function(_0x1a7bf8){return'404'===_0x1a7bf8['code'];}(_0x2e9b4f)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x2847e9){return'409'===_0x2847e9['code'];}(_0x2e9b4f)){const _0x59c754=$(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'](_0x59c754);}else{if(!(_0x2e9b4f instanceof X))throw _0x2e9b4f;this['_handleReconnectionError']();}}}}['destroy'](){const _0x44fe19=this['editor']['plugins']['get'](n),_0x54aed2=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x54aed2['channelSessions']['has'](this['_channelId'])&&_0x54aed2['unregister'](this['_channelId']),_0x44fe19['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x2e3533){if(this['sessionId']!==_0x2e3533['sessionId']&&this['_lastSyncedOperationId']!==_0x2e3533['lastOperationId'])throw new X();return this['sessionId']=_0x2e3533['sessionId'],this['_handleServerResponse']([],{..._0x2e3533,'wereChangesApplied':!0x1,'data':_0x2e3533['data']},'reconnect');}async['_connectService'](_0x4630d3,_0x122ced=!0x1){const {connection:_0x39b277}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x39b277,this['_channelId'])['then'](_0xa2a8f3=>this['_initSessionsHandling'](_0xa2a8f3))['catch'](_0x105240=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x105240);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x49fafa,_0x330dea)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x330dea);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x5ddcd5=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x4630d3);this['_isPendingUpdate']=!0x0;const _0x484f8a=await this['_service']['connect'](_0x39b277,this['_compressOperations'](_0x4630d3),_0x5ddcd5);if(this['sessionId']=_0x484f8a['sessionId'],_0x122ced){if(!_0x484f8a['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x484f8a['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x4630d3,_0x484f8a,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x484f8a,_0x4630d3);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x44587c=this['editor']['plugins']['get'](i),_0x510d26=this['editor']['plugins']['get'](G),_0xb81b3d=_0x44587c['channelSessions']['get'](this['_channelId']);_0xb81b3d&&_0xb81b3d['length']>0x1?_0x510d26['createUserMarkerOperations']():this['listenTo'](_0x44587c,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x44587c['channelSessions']['get'](this['_channelId'])['length']&&_0x510d26['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x516509,_0x180f14,_0xafbb62,_0x2b48ae){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x180f14){const _0x55499a=this['_decompressOperations'](_0xafbb62,_0x2b48ae);await this['_fetchMissingUsers'](_0x55499a),this['_handleExternalOperations'](_0x55499a,_0x180f14,_0xafbb62['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x3555ec}=this['editor'];let _0x5b4e86;try{_0x5b4e86=await this['_service']['getDocumentDetails']();}catch{const _0x15fc11=$(_0x3555ec,'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'](_0x15fc11);}const _0x37d50b=_0x5b4e86['currentDocumentSession']||_0x5b4e86['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x37d50b['lastOperationId']){const _0x4be4c1=$(_0x3555ec,'The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');return void this['_handleReconnectionError'](_0x4be4c1);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x260e24){const _0x56b06c=this['editor']['plugins']['get'](i);this['listenTo'](_0x56b06c,'sessionAdd:'+this['_channelId'],(_0x5ccb8f,{session:_0x3228af})=>{if(_0x3228af['id']===_0x56b06c['mySessionId']){_0x5ccb8f['off']();const _0x4f6a5e=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x3515e1=_0x3228af['permissions'];_0x4f6a5e&&_0x4f6a5e['isEnabled']&&(_0x3515e1=_0x3515e1['filter'](_0x27d1fa=>'document:write'!==_0x27d1fa)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x3515e1,this['_channelId']);}}),_0x56b06c['register'](this['_channelId'],_0x260e24);}['_initThrowingOnDataSet'](){const _0x54bbae=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x532f64)=>{if(!_0x532f64[_0x532f64['length']-0x1]['suppressErrorInCollaboration'])throw new _0x30f693('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x54bbae['apply'](this['editor']['data'],_0x532f64);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x4505c2,[_0x3c1915])=>{if(this['_document']['version'])throw new _0x30f693('realtimecollaborationclient-init-document-already-initialized',this);_0x4505c2['stop'](),this['_setPendingAction']();const _0x3322df=this['editor']['config']['get']('rootsAttributes'),_0x4aa84b=this['_getOperationsFromInitData'](_0x3c1915,_0x3322df);0x0==_0x4aa84b['length']&&_0x4aa84b['push'](new _0x444f10(0x0)),_0x4505c2['return']=this['_connectService'](_0x4aa84b)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x80d16a=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x80d16a))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x185c45,[_0x266f08,_0x279ba6])=>{_0x185c45['stop']();const _0x311487=this['editor']['model']['document']['getRoot'](_0x266f08);if(!this['_knownRootNames']['has'](_0x266f08)){const _0x45e683=_0x279ba6&&_0x279ba6['data']?_0x279ba6['data']:'',_0x4b0979=_0x279ba6&&_0x279ba6['attributes']?_0x279ba6['attributes']:{};await this['_loadRoot'](_0x266f08,_0x45e683,_0x4b0979);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x311487['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x311487);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x3582ef){const _0x391e75=this['editor']['plugins']['get'](_0x31dbe9),{connection:_0x421c1c}=this['editor']['plugins']['get'](n),_0xc36a28=new Set();for(const _0x13c1bf of _0x3582ef){const _0x256f87=_0x13c1bf['_authorId'];_0x256f87&&!_0x391e75['getUser'](_0x256f87)&&_0xc36a28['add'](_0x256f87);}if(0x0===_0xc36a28['size'])return;const _0x5693d8=await ct['getMany'](_0x421c1c,Array['from'](_0xc36a28));for(const _0x90e0bd of _0x5693d8)_0x391e75['getUser'](_0x90e0bd['id'])||_0x391e75['addUser'](_0x90e0bd);}['_getOperationsFromInitData'](_0x242b7b,_0x4adf96={}){const _0x39af80=this['editor']['model'],_0x4fc861=[];let _0x1db366=0x0;const _0x1ac473='string'==typeof _0x242b7b?{'main':_0x242b7b}:_0x242b7b;for(const _0x630d81 of Object['keys'](_0x1ac473)){if(!this['_document']['roots']['has'](_0x630d81))throw new _0x30f693('realtimecollaborationclient-init-non-existent-root',this);const _0x5144fe=this['editor']['data']['parse'](_0x1ac473[_0x630d81]),_0x3bd865=this['_document']['getRoot'](_0x630d81),_0x530d97=new _0x121a73(_0x39af80['createPositionAt'](_0x3bd865,0x0),_0x5144fe,_0x1db366++);_0x4fc861['push'](_0x530d97);for(const [_0x41f3d2,_0x1b4bcd]of _0x5144fe['markers']){const _0x586cfe=_0x39af80['createRange'](_0x39af80['createPositionFromPath'](_0x3bd865,_0x1b4bcd['start']['path']['slice']()),_0x39af80['createPositionFromPath'](_0x3bd865,_0x1b4bcd['end']['path']['slice']())),_0x2d962b=new _0x37d9f5(_0x41f3d2,null,_0x586cfe,_0x39af80['markers'],!0x0,_0x1db366++);_0x4fc861['push'](_0x2d962b);}}if(_0x4adf96)for(const [_0x2a7af8,_0x3a7f8a]of Object['entries'](_0x4adf96)){const _0x2b8c69=_0x39af80['document']['getRoot'](_0x2a7af8);if(!_0x2b8c69)throw new _0x30f693('multi-root-editor-root-attributes-no-root',null);for(const [_0x58cc0b,_0x4deb8c]of Object['entries'](_0x3a7f8a))if(null!==_0x4deb8c){const _0x5177a3=new _0x40624e(_0x2b8c69,_0x58cc0b,null,_0x4deb8c,_0x1db366++);_0x4fc861['push'](_0x5177a3);}}return _0x4fc861;}async['_loadRoot'](_0x1980c5,_0x5e136e,_0x28306d){this['_getOperationsFromInitData']({[_0x1980c5]:_0x5e136e},{[_0x1980c5]:_0x28306d})['forEach']((_0x7074f9,_0x433c41)=>{_0x7074f9['baseVersion']=this['_document']['version']+_0x433c41,_0x7074f9['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x7074f9);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x5f5c1e,_0x46442d){let _0x2b2a91;this['_offset']=_0x5f5c1e['offset'];const _0x138205=_0x5f5c1e['wereChangesApplied']&&!_0x5f5c1e['initData'],_0xfc0a85=_0x138205?0x0:_0x5f5c1e['data']['baseVersion'];if(_0x46442d['forEach'](_0x1c3b8c=>{_0x1c3b8c['_isInit']=!0x0,_0x1c3b8c['createdAt']=_0x5f5c1e['sessionCreatedAt'],_0x1c3b8c['_authorId']=null;}),_0x138205)_0x2b2a91=_0x46442d,this['_applyOperationsSet'](_0x2b2a91,_0x138205);else{if(_0x5f5c1e['initData']){const _0x5c86e8=this['_getOperationsFromInitData'](_0x5f5c1e['initData']);this['_document']['history']['version']=-_0x5c86e8['length'],_0x5c86e8['forEach'](_0x283441=>{_0x283441['baseVersion']-=_0x5c86e8['length'],_0x283441['createdAt']=_0x5f5c1e['sessionCreatedAt'],_0x283441['_isInit']=!0x0,_0x283441['_authorId']=null;}),this['_applyOperationsSet'](_0x5c86e8,!0x0),this['serverHistory']['version']=-_0x5c86e8['length']+this['_offset'],this['_updateServerHistory'](_0x5c86e8);}this['_document']['history']['version']=_0xfc0a85,_0x2b2a91=this['_decompressOperations'](_0x5f5c1e['data'],_0x5f5c1e['metadata']),await this['_fetchMissingUsers'](_0x2b2a91),this['_applyOperationsSet'](_0x2b2a91,_0x138205);}_0x5f5c1e['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2b2a91,_0x5f5c1e['lastOperationId']),this['_lastSyncedOperationId']=_0x5f5c1e['lastOperationId']),this['serverHistory']['version']=_0xfc0a85+this['_offset'],this['_updateServerHistory'](_0x2b2a91),_0x46442d['filter'](_0x14eeb2=>{const _0x19b234=this['_getAffectedRoot'](_0x14eeb2);return _0x19b234&&!this['_knownRootNames']['has'](_0x19b234);})['forEach']((_0x345f7a,_0x37ae72)=>{_0x345f7a['baseVersion']=this['_document']['version']+_0x37ae72,this['_saveOperationInBuffer'](_0x345f7a);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4a48f8,_0x305c2a){const _0x5128f7=_0x305c2a&&_0x305c2a['message'];if(_0x5128f7&&_0x5128f7['startsWith']('realtimecollaborationclient'))throw _0x305c2a;const _0x15601d=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x15601d['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x30f693(_0x4a48f8,this['editor'],_0x5128f7?{'originalError':_0x5128f7}:void 0x0);}['_saveOperationInBuffer'](_0xb213c){this['_knownOperations']['has'](_0xb213c)||(this['_knownOperations']['add'](_0xb213c),this['_bufferedOperations']['push'](_0xb213c),this['_pendingAction']||'marker'==_0xb213c['type']&&!_0xb213c['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x3ced10=!0x1){!_0x3ced10&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x131c27=>{_0x131c27&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x38a765=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x20d53b){return _0x20d53b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x20d53b['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x20d53b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x38a765)||this['_crash'](_0x38a765['message'],_0x38a765);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x4a9f3d=>{this['on']('change:_isPendingUpdate',()=>{_0x4a9f3d();});});}async['_sendBufferedOperations'](){const _0x55134d=this['editor']['plugins']['get'](G);if(this['_shouldSendSelectionUpdate']()&&(_0x55134d['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x405449=[...this['_bufferedOperations']];for(const _0x3eb494 of _0x405449)_0x3eb494['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x3eb494);const _0x2de3b8=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x405449),_0x516656=Q++,_0x5d269f=this['_compressOperations'](_0x405449),_0x572466=await this['_service']['sendOperations'](_0x5d269f,_0x5d269f['baseVersion'],_0x2de3b8);try{return await this['_handleServerResponse'](_0x405449,_0x572466,_0x516656);}catch(_0x315e78){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x315e78);}}async['_handleServerResponse'](_0x3179e7,_0x4a1221,_0x4d85cd){if('error'in _0x4a1221)throw _0x4a1221['error'];let _0x4174cd=!0x1;if(_0x4a1221['wereChangesApplied']){_0x4a1221['lastOperationId']&&(this['_lastSyncedOperationId']=_0x4a1221['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x18e395=>!_0x3179e7['includes'](_0x18e395));for(const _0xc10254 of _0x3179e7)_0xc10254['createdAt']='lastOperationAcceptedAt'in _0x4a1221&&_0x4a1221['lastOperationAcceptedAt']||void 0x0;Y(_0x3179e7,_0x4a1221['version']-_0x3179e7['length']),this['_updateServerHistory'](_0x3179e7);const _0x34abc2=_0x3179e7['filter'](_0x59cf53=>{if(!_0x59cf53['_isInit'])return!0x1;const _0x218197=this['_getAffectedRoot'](_0x59cf53);return _0x218197&&!this['_knownRootNames']['has'](_0x218197);});Y(_0x34abc2,this['_document']['version']),this['_applyOperationsSet'](_0x34abc2),_0x4174cd=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x2880d8=this['_decompressOperations'](_0x4a1221['data'],_0x4a1221['metadata'])['filter'](_0x25ac29=>_0x25ac29['baseVersion']>=this['_lastServerVersion']);_0x2880d8['forEach'](_0x587aa2=>this['_addKnownRoot'](_0x587aa2)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x51b191=>!_0x51b191['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x51b191))),this['_bufferedOperations']['length']&&Y(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x2880d8),_0x4174cd=this['_handleExternalOperations'](_0x2880d8,_0x4a1221['version'],_0x4a1221['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x4174cd?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x2b2b42,_0x4ea9ce,_0x19503e){try{const _0x2882f5={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x4e2eff,operationsB:_0x59d65b,originalOperations:_0x1d31e7}=_0x417964(_0x2b2b42,this['_bufferedOperations'],_0x2882f5);Y(_0x4e2eff,this['_document']['version']),Y(_0x59d65b,_0x4ea9ce);for(const _0x4d61eb of _0x4e2eff){const _0x45609b=_0x1d31e7['get'](_0x4d61eb);_0x4d61eb['_authorId']=_0x45609b?_0x45609b['_authorId']:null;}_0x19503e&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2b2b42,_0x19503e),this['_lastSyncedOperationId']=_0x19503e),this['_bufferedOperations']=[..._0x59d65b],this['_applyOperationsSet'](_0x4e2eff),this['_updateServerHistory'](_0x2b2b42);}catch(_0x482c10){return console['error'](_0x482c10),!0x1;}return!0x0;}['_applyOperationsSet'](_0x18c0dc,_0x314442=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x4d2094=>{for(const _0x53341a of _0x18c0dc)this['_knownOperations']['add'](_0x53341a),this['_addKnownRoot'](_0x53341a),_0x4d2094['batch']['addOperation'](_0x53341a),this['editor']['model']['applyOperation'](_0x53341a);});}['_addKnownRoot'](_0x5a81dc){const _0x16077e=this['_getAffectedRoot'](_0x5a81dc);_0x16077e&&this['_knownRootNames']['add'](_0x16077e);}['_getAffectedRoot'](_0x56a9e4){let _0x3a48b4,_0x39da59;switch(_0x56a9e4['type']){case'insert':_0x3a48b4=_0x56a9e4['position']['root'];break;case'marker':if(_0x39da59=_0x56a9e4['newRange'],!_0x39da59)return null;_0x3a48b4=_0x39da59['root'];break;case'addRootAttribute':_0x3a48b4=_0x56a9e4['root'];break;case'addRoot':_0x3a48b4=_0x56a9e4['affectedSelectable'];break;case'move':_0x3a48b4=_0x56a9e4['targetPosition']['root'];break;default:return null;}return _0x3a48b4['rootName'];}['_updateServerHistory'](_0x4c6087){_0x4c6087['forEach'](_0x5c6207=>{const _0x508929=_0x5c6207['clone']();_0x508929['_authorId']=_0x5c6207['_authorId'],_0x508929['_isInit']=!!_0x5c6207['_isInit'],_0x508929['createdAt']=_0x5c6207['createdAt'],_0x508929['baseVersion']+=this['_offset'],_0x5c6207['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x508929),this['serverHistory']['addOperation'](_0x508929);});}['_handleReconnectionError'](_0x236c22){const _0x57121e=this['editor']['plugins']['get']('Notification'),_0x2b1e30=this['editor']['locale'];_0x236c22||(_0x236c22=$(_0x2b1e30,'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.')),_0x57121e['showWarning'](_0x236c22,{'title':$(_0x2b1e30,'Synchronization\x20issue'),'namespace':'real-time-collaboration'}),this['_hasSynchronizationProblem']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_bufferedOperations']=[],this['editor']['plugins']['get'](n)['disconnect']();}['_setPendingAction'](){this['_pendingAction']||(this['_pendingAction']=this['editor']['plugins']['get'](_0x53b958)['add']($(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x53b958)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x3a8898){const _0x3f1997=_0x3a8898['map'](_0x5e293e=>_0x5e293e['toJSON']());return this['_compressor']['compress'](_0x3f1997);}['_decompressOperations'](_0x3f37d5,_0x3dad06){return this['_compressor']['decompress'](_0x3f37d5)['map']((_0x2668f0,_0x516be1)=>{const _0x53a56f='init'==_0x3dad06[_0x516be1]['type'];if('InsertOperation'==_0x2668f0['__className']){const _0x18be89=_0x2668f0['position']['root'];!this['_document']['getRoot'](_0x18be89)&&(this['_document']['createRoot']('$root',_0x18be89)['_isAttached']=!0x1);}const _0x140a3e=_0x2b0580['fromJSON'](_0x2668f0,this['_document']);return _0x140a3e['wasUndone']=_0x2668f0['wasUndone'],_0x140a3e['_isInit']=_0x53a56f,_0x140a3e['_authorId']=_0x53a56f?null:_0x3dad06[_0x516be1]['userId'],_0x140a3e['_isDisconnection']='cs:removeUser'===_0x3dad06[_0x516be1]['type'],_0x140a3e['createdAt']=_0x3dad06[_0x516be1]['createdAt'],_0x140a3e;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0xcb5f66=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0xcb5f66&&_0xcb5f66['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class X extends Error{}function Y(_0x568dc4,_0x3cc55a){for(const _0x14ee1c of _0x568dc4)_0x14ee1c['baseVersion']=_0x3cc55a++;}class Z{['_ignoredOperations'];['_operationToId'];constructor(_0xce9941){this['_ignoredOperations']=_0xce9941,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0xcba047){let _0x5beb65=_0xcba047['length'];for(;_0x5beb65--;){const _0x13c842=_0xcba047[_0x5beb65];if(!this['_ignoredOperations']['has'](_0x13c842)){if(!this['_operationToId']['has'](_0x13c842)){const _0x84890=_0x25094b()['slice'](0x1,0x12);this['_operationToId']['set'](_0x13c842,_0x84890);}return this['_operationToId']['get'](_0x13c842);}}}['setIdForTheLastOperation'](_0x3b4a9a,_0x6b391f){if(!_0x6b391f)return;let _0x38e1df=_0x3b4a9a['length'];for(;_0x38e1df--;){const _0x1d3d63=_0x3b4a9a[_0x38e1df];this['_ignoredOperations']['has'](_0x1d3d63)||this['_operationToId']['set'](_0x1d3d63,_0x6b391f);}}}class a extends _0x25e6f2{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0xd3e8aa{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x3f87de)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x31dbe9];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x438042){super(_0x438042),this['_services']=new Map();}async['init'](){const _0x26e3fd=this['context'],_0x8ac9ab=_0x26e3fd['plugins']['get']('CommentsRepository');if(_0x26e3fd['plugins']['get'](n)['addToReconnectionStack'](this),_0x8ac9ab['adapter']={'addCommentThread':async({channelId:_0x32b8fb,threadId:_0x5767e9,comments:_0x5cb43b,resolvedAt:_0x35a4ec,resolvedBy:_0x5a68d2,context:_0x5edbd8,attributes:_0x589aef})=>{const _0x3398df=await this['_getService'](_0x32b8fb)['addCommentThread']({'commentThreadId':_0x5767e9,'comments':_0x5cb43b['map'](_0x2ed691=>function(_0x31288e,_0x18cd45,_0x29c149){return{'commentThreadId':_0x29c149,'commentId':_0x31288e['commentId'],'userId':_0x31288e['authorId'],'content':_0x31288e['content'],'documentId':_0x18cd45,'createdAt':_0x31288e['createdAt'],'attributes':_0x31288e['attributes']||{}};}(_0x2ed691,_0x32b8fb,_0x5767e9)),'resolvedAt':_0x35a4ec,'resolvedBy':_0x5a68d2,'context':_0x5edbd8,'attributes':_0x589aef})['catch'](at);return{'threadId':_0x3398df['commentThreadId'],'comments':_0x3398df['comments']};},'getCommentThread':async({channelId:_0x4a2bf1,threadId:_0x205f40})=>{const _0xcd86f8=await this['_getService'](_0x4a2bf1)['getCommentThread'](_0x205f40)['catch'](F)['catch'](at);return _0xcd86f8?_0xcd86f8['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0xcd86f8]),{'threadId':_0xcd86f8['commentThreadId'],'comments':_0xcd86f8['comments']['map'](S),'context':_0xcd86f8['context'],'resolvedAt':_0xcd86f8['resolvedAt'],'resolvedBy':_0xcd86f8['resolvedBy'],'attributes':_0xcd86f8['attributes']||{}}):null;},'updateCommentThread':async({channelId:_0x3cc539,threadId:_0x21e9d2,context:_0x6f087d,unlinkedAt:_0x3c7ccd,attributes:_0x16c534})=>this['_getService'](_0x3cc539)['updateCommentThread']({'commentThreadId':_0x21e9d2,'context':_0x6f087d,'attributes':_0x16c534,'unlinkedAt':_0x3c7ccd})['catch'](F)['catch'](at),'resolveCommentThread':async({channelId:_0x3e696a,threadId:_0x643f19})=>{const _0x51523c=await this['_getService'](_0x3e696a)['resolveCommentThread'](_0x643f19)['catch'](F)['catch'](at);return{'threadId':_0x51523c['commentThreadId'],'resolvedAt':_0x51523c['resolvedAt'],'resolvedBy':_0x51523c['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3cd763,threadId:_0x4e2a35})=>this['_getService'](_0x3cd763)['reopenCommentThread'](_0x4e2a35)['catch'](F)['catch'](at),'removeCommentThread':({channelId:_0xfa297f,threadId:_0x1c65e3})=>this['_getService'](_0xfa297f)['removeCommentThread'](_0x1c65e3)['catch'](F)['catch'](at),'addComment':({channelId:_0xf06df1,threadId:_0x4ac1a9,commentId:_0x1285f6,content:_0x3d69fe,attributes:_0xed5e17})=>this['_getService'](_0xf06df1)['addComment'](_0x4ac1a9,_0x1285f6,_0x3d69fe,_0xed5e17)['catch'](at),'updateComment':({channelId:_0x27a0ee,threadId:_0x5baa3c,commentId:_0x1390ab,content:_0xc3f26f,attributes:_0x16e5b9})=>this['_getService'](_0x27a0ee)['updateComment'](_0x5baa3c,_0x1390ab,_0xc3f26f,_0x16e5b9)['catch'](F)['catch'](at),'removeComment':({channelId:_0x2e2ecd,threadId:_0x29690d,commentId:_0x6b0a7e})=>this['_getService'](_0x2e2ecd)['removeComment'](_0x29690d,_0x6b0a7e)['catch'](F)['catch'](at)},_0x26e3fd instanceof _0x5e153d){const _0x2b581d=_0x26e3fd['config']['get']('collaboration.channelId'),_0x28b7ea=_0x26e3fd['plugins']['get'](i);await this['_setUpService'](_0x2b581d);const _0x51806b=await this['_services']['get'](_0x2b581d)['getConnectedSessions']();this['listenTo'](_0x28b7ea,'sessionAdd:'+_0x2b581d,(_0x560507,{session:_0x2ef81d})=>{_0x2ef81d['id']===_0x28b7ea['mySessionId']&&(_0x560507['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x2ef81d['permissions'],_0x2b581d));}),_0x28b7ea['register'](_0x2b581d,_0x51806b);}}async['_setUpService'](_0x4b6698){if(this['_services']['has'](_0x4b6698))throw new _0x30f693('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4b6698});const _0x4046c0=this['context']['plugins']['get']('CommentsRepository'),_0x559654=new s['CommentsService'](_0x4b6698);this['_services']['set'](_0x4b6698,_0x559654),this['listenTo'](_0x559654,'commentThreadAdded',(_0xbf7a28,_0x216199)=>{const {commentThreadId:_0x4a853d,documentId:_0x214beb,context:_0x1cd0c0,attributes:_0x54c541,resolvedAt:_0x2b7c40,resolvedBy:_0x2b120c,comments:_0x17d59d}=_0x216199;_0x4046c0['getCommentThread'](_0x4a853d)||_0x4046c0['addCommentThread']({'threadId':_0x4a853d,'channelId':_0x214beb,'comments':_0x17d59d?_0x17d59d['map'](S):[],'context':_0x1cd0c0,'attributes':_0x54c541,'resolvedAt':_0x2b7c40,'resolvedBy':_0x2b120c,'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadUpdated',(_0x3c40b6,{commentThreadId:_0x1480a9,documentId:_0x1e4df3,context:_0xf4dc9,unlinkedAt:_0x4277a7,attributes:_0x36d2fc})=>{_0x4046c0['getCommentThread'](_0x1480a9)&&_0x4046c0['updateCommentThread']({'threadId':_0x1480a9,'channelId':_0x1e4df3,'context':_0xf4dc9,'unlinkedAt':_0x4277a7,'attributes':_0x36d2fc,'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadResolved',(_0x30b8c4,{commentThreadId:_0x2f4bc6,resolvedBy:_0xfebd65,resolvedAt:_0x1c09f1})=>{const _0x554a4e=_0x4046c0['getCommentThread'](_0x2f4bc6);_0x554a4e&&_0x554a4e['resolve']({'resolvedBy':_0xfebd65,'resolvedAt':_0x1c09f1,'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadReopened',(_0x191ff4,{commentThreadId:_0x243049})=>{const _0x26e2fd=_0x4046c0['getCommentThread'](_0x243049);_0x26e2fd&&_0x26e2fd['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentThreadRemoved',(_0xac9ae8,{commentThreadId:_0x463188})=>{const _0x47fae4=_0x4046c0['getCommentThread'](_0x463188);_0x47fae4&&_0x47fae4['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentAdded',(_0x5c4287,_0x222913)=>{const _0x308584=_0x222913['commentThreadId'],_0x221c35=_0x4046c0['getCommentThread'](_0x308584);_0x221c35&&_0x221c35['addComment']({...S(_0x222913),'isFromAdapter':!0x0});}),this['listenTo'](_0x559654,'commentUpdated',(_0x34a174,{commentThreadId:_0x28d150,commentId:_0x3a69f6,content:_0x168c68,attributes:_0x2d3b3f})=>{const _0x3e14ab=_0x4046c0['getCommentThread'](_0x28d150);if(_0x3e14ab){const _0x49c148=_0x3e14ab['getComment'](_0x3a69f6);_0x49c148&&_0x49c148['update']({'content':_0x168c68,'attributes':_0x2d3b3f,'isFromAdapter':!0x0});}}),this['listenTo'](_0x559654,'commentRemoved',(_0x17e89b,{commentThreadId:_0x4b819f,commentId:_0x1691b8})=>{const _0x4a741e=_0x4046c0['getCommentThread'](_0x4b819f);if(_0x4a741e){const _0x224f39=_0x4a741e['getComment'](_0x1691b8);_0x224f39&&_0x224f39['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4b6698);}['destroy'](){if(this['context']instanceof _0x5e153d){const _0x382479=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x382479);}}['_terminateService'](_0x350c5f){if(!this['_services']['has'](_0x350c5f))throw new _0x30f693('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x350c5f});this['_getService'](_0x350c5f)['disconnect'](),this['_services']['delete'](_0x350c5f);}async['reconnect'](){for(const _0x522da9 of this['_services']['keys']())await this['_connectService'](_0x522da9);if(this['context']instanceof _0x5e153d){const _0x3540c3=this['context']['config']['get']('collaboration.channelId'),_0x4c53e1=this['context']['plugins']['get'](i);_0x4c53e1['unregister'](_0x3540c3);const _0xc0a60=await this['_services']['get'](_0x3540c3)['getConnectedSessions']();_0x4c53e1['register'](_0x3540c3,_0xc0a60);}}async['_connectService'](_0x3d7ca7){const {connection:_0x216c90}=this['context']['plugins']['get'](n),_0x43b4b4=this['context']['plugins']['get']('CommentsRepository'),_0x203b37=this['_services']['get'](_0x3d7ca7),_0x58cb1e=await _0x203b37['connect'](_0x216c90);await this['_fetchMissingUsersForThreads'](_0x58cb1e);const _0x1f7b9f=new Set(Array['from'](_0x43b4b4['getCommentThreads']({'channelId':_0x3d7ca7}),_0x225c70=>_0x225c70['id']));for(const _0x3ed929 of _0x58cb1e)_0x3ed929['deletedAt']||_0x1f7b9f['delete'](_0x3ed929['commentThreadId']);for(const _0x930f8 of _0x1f7b9f)_0x43b4b4['getCommentThread'](_0x930f8)['remove']({'isFromAdapter':!0x0});for(const _0x39dccd of _0x58cb1e){let _0x460667=_0x43b4b4['getCommentThread'](_0x39dccd['commentThreadId']);const {commentThreadId:_0x34097d,context:_0x5f52fe,attributes:_0x384d55,resolvedBy:_0x3e60c1,resolvedAt:_0x40296c,unlinkedAt:_0x387a31,deletedAt:_0x1f29cd}=_0x39dccd;if(_0x1f29cd)continue;_0x460667||(_0x460667=_0x43b4b4['addCommentThread']({'channelId':_0x3d7ca7,'threadId':_0x34097d,'context':_0x5f52fe,'attributes':_0x384d55||{},'resolvedBy':_0x3e60c1,'resolvedAt':_0x40296c,'unlinkedAt':_0x387a31,'isFromAdapter':!0x0}));const _0x4b77cb=new Set(Array['from'](_0x460667['comments'],_0x4e2981=>_0x4e2981['id']));for(const _0x1f33f2 of _0x39dccd['comments'])_0x4b77cb['delete'](_0x1f33f2['commentId']);for(const _0x211cd5 of _0x4b77cb)_0x460667['getComment'](_0x211cd5)['remove']({'isFromAdapter':!0x0});for(const _0x7f06fa of _0x39dccd['comments']){const _0x40dfc5=_0x460667['getComment'](_0x7f06fa['commentId']);_0x40dfc5?_0x40dfc5['content']!==_0x7f06fa['content']&&_0x40dfc5['update']({'content':_0x7f06fa['content'],'isFromAdapter':!0x0}):_0x460667['addComment'](Object['assign'](S(_0x7f06fa),{'isFromAdapter':!0x0}));}}}['_getService'](_0xf9fe84){if(!this['_services']['has'](_0xf9fe84))throw new _0x30f693('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xf9fe84});return this['_services']['get'](_0xf9fe84);}async['_fetchMissingUsersForThreads'](_0x3f4348){const _0x3fbc3a=this['context']['plugins']['get'](_0x31dbe9),{connection:_0x1e6b57}=this['context']['plugins']['get'](n),_0x20399c=new Set();for(const {resolvedBy:_0x536270,comments:_0x5b5ef1}of _0x3f4348){_0x536270&&!_0x3fbc3a['getUser'](_0x536270)&&_0x20399c['add'](_0x536270);for(const {userId:_0x5544a6}of _0x5b5ef1)_0x3fbc3a['getUser'](_0x5544a6)||_0x20399c['add'](_0x5544a6);}if(0x0===_0x20399c['size'])return;const _0x16b6df=await ct['getMany'](_0x1e6b57,Array['from'](_0x20399c));for(const _0x2af7ec of _0x16b6df)_0x3fbc3a['getUser'](_0x2af7ec['id'])||_0x3fbc3a['addUser'](_0x2af7ec);}}async function F(_0x22d904){if('404'!==_0x22d904['code'])throw _0x22d904;}function at(_0xa2d506){if((_0x43c7d7=_0xa2d506)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x43c7d7['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x43c7d7['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x43c7d7;throw _0xa2d506;}function S(_0x560fd5){return{'threadId':_0x560fd5['commentThreadId'],'commentId':_0x560fd5['commentId'],'content':_0x560fd5['content'],'createdAt':_0x560fd5['createdAt'],'authorId':_0x560fd5['userId'],'attributes':_0x560fd5['attributes']||{}};}class m extends _0x25e6f2{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>tt)());['_bufferedRequests'];['_trackChangesService'];static get['requires'](){return[s,'TrackChangesEditing',n];}static get['pluginName'](){return'CloudServicesTrackChangesAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x9ae782){super(_0x9ae782);const _0x4bda1f=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x4bda1f);}['init'](){const _0x553083=this['editor']['plugins']['get'](n),_0x4986f4=this['editor']['plugins']['get']('TrackChangesEditing');return _0x4986f4['adapter']={'getSuggestion':async _0x11f6f0=>{await this['_waitForServiceReady']();const _0xe2d58f=await this['_trackChangesService']['get'](_0x11f6f0)['catch'](k);return await this['_fetchMissingUsersForThreads']([_0xe2d58f]),_0xe2d58f;},'addSuggestion':async({id:_0x21180a,type:_0x535b25,data:_0x4320c6,originalSuggestionId:_0x5bda73,attributes:_0x229ccb})=>{await this['_waitForServiceReady']();const _0x28f6be={'id':_0x21180a,'type':_0x535b25,'data':_0x4320c6,'originalSuggestionId':_0x5bda73,'attributes':_0x229ccb},_0x216eb7=await this['_trackChangesService']['add'](_0x21180a,_0x535b25,_0x4320c6,_0x5bda73,_0x229ccb)['catch'](_0x419652=>{if(ht(_0x419652))return new Promise(_0x3d2cd9=>{this['_bufferedRequests']['set'](_0x21180a,{'resolve':_0x3d2cd9,'suggestionData':_0x28f6be});});throw _0x419652;});return this['_bufferedRequests']['delete'](_0x21180a),_0x216eb7;},'updateSuggestion':async(_0x1337b5,_0x253e66)=>{if(await this['_waitForServiceReady'](),'open'!==_0x253e66['state'])return this['_trackChangesService']['update'](_0x1337b5,_0x253e66)['catch'](k);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x3631d3,_0x5a79e8)=>{_0x4986f4['hasSuggestion'](_0x5a79e8['id'])&&(_0x4986f4['getSuggestion'](_0x5a79e8['id'])['attributes']=_0x5a79e8['attributes']);}),this['_trackChangesService']['connect'](_0x553083['connection'])['then'](_0x2bc027=>(_0x553083['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x2bc027)['then'](()=>{for(const _0x2524dc of _0x2bc027){_0x4986f4['addSuggestionData'](_0x2524dc)['_saved']=!0x0;}})));}async['reconnect'](){const _0x5573c4=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x1756df}=this['editor']['plugins']['get'](n),_0x282bf3=await this['_trackChangesService']['connect'](_0x1756df);await this['_fetchMissingUsersForThreads'](_0x282bf3);for(const {suggestionData:_0x903966,resolve:_0x5e00b6}of this['_bufferedRequests']['values']()){let _0x2092e2=_0x282bf3['find'](_0x267af2=>_0x267af2['id']===_0x903966['id']);_0x2092e2||(_0x2092e2=await this['_trackChangesService']['add'](_0x903966['id'],_0x903966['type'],_0x903966['data'],_0x903966['originalSuggestionId'])),_0x5e00b6(_0x2092e2);}for(const _0x2a5972 of _0x282bf3)_0x5573c4['hasSuggestion'](_0x2a5972['id'])||_0x5573c4['addSuggestionData'](_0x2a5972);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x51976e=>{this['listenTo'](this['_trackChangesService'],'connected',_0x562d03=>{_0x562d03['off'](),_0x51976e();});});}async['_fetchMissingUsersForThreads'](_0x4d2c1f){const _0x1d8ad2=this['editor']['plugins']['get'](_0x31dbe9),{connection:_0x2970cc}=this['editor']['plugins']['get'](n),_0x3f71b0=new Set();for(const {authorId:_0x944054}of _0x4d2c1f)_0x1d8ad2['getUser'](_0x944054)||_0x3f71b0['add'](_0x944054);if(0x0===_0x3f71b0['size'])return;const _0x27556e=await ct['getMany'](_0x2970cc,Array['from'](_0x3f71b0));for(const _0x25a647 of _0x27556e)_0x1d8ad2['getUser'](_0x25a647['id'])||_0x1d8ad2['addUser'](_0x25a647);}}function k(_0x5cbc7d){if(ht(_0x5cbc7d))return new Promise(()=>{});throw _0x5cbc7d;}function ht(_0xaa1c46){return _0xaa1c46['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xaa1c46['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x25e6f2{static get['requires'](){return['Comments',s,a,n];}static get['pluginName'](){return'RealTimeCollaborativeComments';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x3468ab=this['editor']['plugins']['get'](n),_0x387b0f=this['editor']['plugins']['get']('CommentsEditing'),_0x550146=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x3468ab,'change:state',(_0xe6b296,_0x38cb01,_0x5bc166)=>{_0x387b0f['isThreadsLoadingPaused']='connected'!==_0x5bc166;});}),this['listenTo'](_0x3468ab,'change:state',(_0x3507c4,_0x3d014b,_0x4461b1)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x4461b1);}),_0x550146['_setUpService'](this['editor']['config']['get']('collaboration.channelId'));}['destroy'](){this['editor']['plugins']['get'](s)['_terminateService'](this['editor']['config']['get']('collaboration.channelId')),super['destroy']();}}class lt extends _0x25e6f2{static get['requires'](){return[g,m,'TrackChanges'];}static get['pluginName'](){return'RealTimeCollaborativeTrackChanges';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class c extends _0x25e6f2{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0xbde25a)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x31dbe9];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x109caa){super(_0x109caa);const _0x3e73e6=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x3e73e6);}async['init'](){const _0x5b5bb7=this['editor']['plugins']['get'](l),_0x47bdd8=_0x5b5bb7['serverHistory'],_0x3f51a3=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x47bdd8,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x5b5bb7['sessionId']});const _0x5f4711=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x55dc8a=await _0x9c7fbf['isBundleUploaded'](_0x3f51a3['connection'],_0x5f4711);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x1f364c})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x1f364c)),'updateRevisions':async _0x548b14=>{await this['_waitForServiceReady']();const _0x5c2dd9=this['_revisionTracker']['currentRevision'];if(_0x55dc8a&&0x1===_0x548b14['length']&&_0x548b14[0x0]['id']===_0x5c2dd9['id'])return _0x548b14;for(const _0x42c44d of _0x548b14)_0x42c44d['id']===_0x5c2dd9['id']&&(_0x42c44d['isEmptyCurrent']=_0x42c44d['fromVersion']===_0x42c44d['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x548b14,this['_lastRequestId'])['then'](_0x5808fd=>(this['_lastRequestId']=_0x5808fd,_0x548b14))['catch'](_0x3dfde3=>{if(q(_0x3dfde3)||'400'===_0x3dfde3['code']&&void 0x0!==_0x3dfde3['data']['wrongRequestId']){for(const _0x1ae0f7 of _0x548b14){!this['_revisionTracker']['repository']['getRevision'](_0x1ae0f7['id'])||this['_revisionTracker']['_bufferUpdate'](_0x1ae0f7['id'],_0x1ae0f7,!0x1);}if(q(_0x3dfde3))throw _0x3dfde3;return _0x548b14;}throw _0x3dfde3;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x248be5,{revisionsData:_0x1c2330,requestId:_0x25b666})=>{Math['max'](..._0x1c2330['map'](_0x14e5cb=>_0x14e5cb['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x1c2330,_0x25b666);}):this['_handleRevisionsUpdate'](_0x1c2330,_0x25b666);});const {revisions:_0x13d796,requestId:_0x36017e}=await this['_revisionHistoryService']['connect'](_0x3f51a3['connection']);_0x3f51a3['addToReconnectionStack'](this),this['_lastRequestId']=_0x36017e,await this['_fetchMissingUsers'](_0x13d796);for(const _0x3737e2 of _0x13d796)this['_revisionTracker']['addRevisionData'](_0x3737e2);this['listenTo'](_0x5b5bb7,'change:_isConnected',(_0x477cb5,_0x2a485c,_0x3acce6)=>{_0x3acce6&&(this['_oldOffset']=_0x5b5bb7['_offset'],_0x477cb5['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x3f51a3,'state',_0x2059e1=>_0x2059e1===_0x36ce39['CONNECTED']);}async['reconnect'](){const _0x3e87aa=this['editor']['plugins']['get'](n),_0x584678=this['editor']['plugins']['get'](l),_0x161c54=async()=>{const _0x3eadda=this['_revisionTracker']['currentRevision'],_0x1d137f=_0x3eadda['id'],_0x4bf3bf=_0x1d137f!==_0x584678['sessionId'];if(_0x4bf3bf){const _0x2069f4=_0x584678['_offset']-this['_oldOffset'],_0x29293f=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x3eadda['toVersion']+_0x2069f4!==_0x29293f){const _0x5faf31=_0x3eadda['fromVersion']+_0x2069f4,_0x538ac5=this['editor']['plugins']['get'](_0x31dbe9),_0x458181=this['_revisionTracker']['buildRevisionData']({'revision':_0x3eadda,'from':_0x5faf31,'to':_0x29293f});_0x458181['id']=_0x3eadda['id'];const _0x13897e=_0x458181['authorsIds']['map'](_0x1b9ce3=>_0x538ac5['getUser'](_0x1b9ce3));_0x3eadda['_update']({..._0x458181,'authors':_0x13897e},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x3eadda['id'],_0x458181,!0x0);}this['_revisionTracker']['_startingVersion']=_0x29293f,(_0x3eadda['toVersion']===_0x3eadda['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x1d137f)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x1d137f),this['_revisionTracker']['_createCurrentRevision'](_0x29293f));}const {revisions:_0x315384,requestId:_0x38457b}=await this['_revisionHistoryService']['reconnect'](_0x3e87aa['connection'],this['_lastRequestId']);_0x4bf3bf&&_0x315384['length']>0x0?_0x584678['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x315384),this['_handleRevisionsUpdate'](_0x315384,_0x38457b),this['_revisionTracker']['sendBufferedUpdates']());};return _0x584678['_isConnected']?_0x161c54():new Promise((_0x4c5675,_0x885f4f)=>{_0x584678['once']('change:_isConnected',()=>{_0x161c54()['then'](_0x4c5675)['catch'](_0x885f4f);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5ee1e6=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0xb6243e=>{_0xb6243e['off'](),_0x5ee1e6();});});}['_getLatestVersionFromServerOperations'](){const _0x24e2ff=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x2660e5 of _0x24e2ff)if('marker'!==_0x2660e5['type']||_0x2660e5['affectsData'])return _0x2660e5['baseVersion']+0x1;}['_getLatestVersion'](){const _0x939813=this['editor']['plugins']['get'](l);return new Promise(_0xb7b4d8=>{_0x939813['_isPendingUpdate']?_0x939813['once']('change:_isPendingUpdate',()=>{_0xb7b4d8(this['_getLatestVersionFromServerOperations']());}):_0xb7b4d8(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x26c684,_0x3f90fb){const _0x5745dd=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x3f90fb;for(const _0x12a9c0 of _0x26c684){const _0x43a35f=_0x5745dd['getRevision'](_0x12a9c0['id']);if(_0x43a35f){if((_0x12a9c0['fromVersion']||_0x12a9c0['toVersion'])&&(_0x12a9c0['diffData']=null),_0x43a35f===this['_revisionTracker']['currentRevision']){const _0x21e08f=Math['max'](_0x43a35f['toVersion'],_0x12a9c0['toVersion']),_0x105aca=Math['max'](_0x43a35f['fromVersion'],_0x12a9c0['fromVersion']);let _0x2613b6;_0x43a35f['toVersion']===_0x12a9c0['toVersion']&&_0x43a35f['fromVersion']===_0x12a9c0['fromVersion']?(_0x2613b6=!0x0,this['_preventResendingRevisionData'](_0x12a9c0)):_0x12a9c0['toVersion']===_0x21e08f&&_0x12a9c0['fromVersion']===_0x105aca?_0x2613b6=!0x1:(_0x43a35f['toVersion']===_0x21e08f&&_0x43a35f['fromVersion']===_0x105aca||this['_fixRevision']({'revision':_0x43a35f,'from':_0x105aca,'to':_0x21e08f}),_0x2613b6=!0x0),_0x2613b6&&(delete _0x12a9c0['fromVersion'],delete _0x12a9c0['toVersion'],delete _0x12a9c0['diffData'],delete _0x12a9c0['createdAt'],delete _0x12a9c0['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x12a9c0),this['_preventResendingRevisionData'](_0x12a9c0);}else this['_revisionTracker']['addRevisionData'](_0x12a9c0);}const _0x976de7=_0x5745dd['getRevisions']();_0x976de7['reverse']();for(let _0x1c26c6=0x0;_0x1c26c6<_0x976de7['length']-0x1;_0x1c26c6++){const _0x2b6d8c=_0x976de7[_0x1c26c6],_0x4f12a0=_0x976de7[_0x1c26c6+0x1];if(_0x2b6d8c['fromVersion']<_0x4f12a0['toVersion']){const _0x5a1326=_0x4f12a0['toVersion'],_0x30fd17=Math['max'](_0x5a1326,_0x2b6d8c['toVersion']);this['_fixRevision']({'revision':_0x2b6d8c,'from':_0x5a1326,'to':_0x30fd17});}}}['_fixRevision']({revision:_0x26520b,from:_0x51ad3b,to:_0x5e08c2}={}){const _0x15cc2c=this['editor']['plugins']['get'](_0x31dbe9),_0x167ee0=this['_revisionTracker']['buildRevisionData']({'revision':_0x26520b,'from':_0x51ad3b,'to':_0x5e08c2});_0x167ee0['authors']=_0x167ee0['authorsIds']['map'](_0x468a43=>_0x15cc2c['getUser'](_0x468a43)),_0x26520b['_update'](_0x167ee0);}['_preventResendingRevisionData'](_0x5419c9){const _0x4e5425={};_0x4e5425['id']=_0x5419c9['id'];for(const _0x890383 of Object['keys'](_0x5419c9))'id'!==_0x890383&&(_0x4e5425[_0x890383]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x4e5425['id'],_0x4e5425,!0x0);}async['_fetchMissingUsers'](_0x226dc6){const _0x2c7316=this['editor']['plugins']['get'](_0x31dbe9),{connection:_0x149203}=this['editor']['plugins']['get'](n),_0x10f01c=new Set();for(const _0x216a69 of _0x226dc6){for(const _0x37fb6a of _0x216a69['authorsIds'])_0x167891(_0x37fb6a);_0x216a69['creatorId']&&_0x167891(_0x216a69['creatorId']);}if(0x0===_0x10f01c['size'])return;const _0x2e82d0=await ct['getMany'](_0x149203,Array['from'](_0x10f01c));for(const _0x58bcc9 of _0x2e82d0)_0x2c7316['getUser'](_0x58bcc9['id'])||_0x2c7316['addUser'](_0x58bcc9);function _0x167891(_0x45938c){_0x2c7316['getUser'](_0x45938c)||_0x10f01c['add'](_0x45938c);}}}function q(_0x18502b){return _0x18502b['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x18502b['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x18502b['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x25e6f2{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class b extends _0x57df8e{['_collapseAt'];constructor(_0x38e3ec,_0x247069=0x6){super(_0x38e3ec);const _0x2ccaf1=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x247069,this['bind']('isHidden')['to'](this,'usersCount',_0x151bc8=>_0x151bc8<_0x247069),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x2ccaf1['if']('isHidden','ck-presence-list__counter--hidden')],'role':'listitem'},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter']},'children':[{'tag':'div','attributes':{'class':['ck','ck-presence-list__users-counter__text']},'children':[{'text':_0x2ccaf1['to']('usersCount',_0x1fa742=>'+'+(_0x1fa742-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x57df8e{['items'];['keystrokes'];constructor(_0x37d30e){super(_0x37d30e);const _0x51406c=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x553934(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x51406c['if']('hasPopup'),'aria-expanded':_0x51406c['to']('isExpanded',_0x2d5acd=>this['hasPopup']&&String(_0x2d5acd)),'aria-label':_0x51406c['to']('hasPopup',_0xe41e97=>$(_0x37d30e,_0xe41e97?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x51406c['to']('hasPopup',_0x3f68d8=>!!_0x3f68d8&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x51406c['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x51406c['to'](_0x42c4a5=>{const _0x8d4033=_0x42c4a5,_0x3174aa=document['querySelector']('.ck-presence-list__dropdown-list'),_0x1a9c93=document['querySelector']('.ck-balloon-panel_with-arrow');_0x3174aa?.['contains'](_0x8d4033['relatedTarget'])||_0x1a9c93?.['contains'](_0x8d4033['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x560989,_0x4d6d3b,_0x2b6ee7)=>{this['element']&&(_0x2b6ee7?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class v extends _0x57df8e{['counterView'];['inlineListView'];constructor(_0x3c05c2,_0x3013c6=0x6){super(_0x3c05c2);const _0xbf089b=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x3013c6),this['inlineListView']=new is(_0x3c05c2),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x2d372e of this['inlineListView']['items'])_0x2d372e['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',_0xbf089b['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0x57df8e{['listWrapperView'];constructor(_0x45f14c,_0x3761c1){super(_0x45f14c);const _0x318c8c=this['bindTemplate'];this['listWrapperView']=new ut(_0x45f14c,_0x3761c1),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':$(_0x45f14c,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x318c8c['to'](_0x4e7993=>{const _0xc00a5d=_0x4e7993,_0x41c18f=document['querySelector']('.ck-presence-list__list'),_0x4cceb5=document['querySelector']('.ck-balloon-panel_with-arrow');_0x41c18f?.['contains'](_0xc00a5d['relatedTarget'])||_0x4cceb5?.['contains'](_0xc00a5d['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x11ceb4{constructor(_0x2dea4c,_0x11a822){super(_0x2dea4c);const _0x50bbb6=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x11a822?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x50bbb6['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x50bbb6['to']('role'),'aria-label':_0x50bbb6['to']('ariaLabel'),'aria-labelledby':_0x50bbb6['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x44b0ca['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x576dc5=this['element'];_0x576dc5&&(this['_isScrollable']=Math['max'](_0x576dc5['scrollHeight'],_0x576dc5['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x3c17c8,_0x14e040,_0xc0ed91){super(_0x3c17c8);const _0x136911=this['bindTemplate'];this['userView']=new st(_0x3c17c8,_0x14e040);const _0x400a6c={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x14e040['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x14e040['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x14e040['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0xc0ed91&&(_0x400a6c['tag']='button',_0x400a6c['on']={'click':_0x136911['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x400a6c);}['focus'](){this['element']['focus']();}}class A extends _0x57df8e{['userView'];['markerView'];constructor(_0x203725,_0x44aba2,_0x3da50f){super(_0x203725);const _0x5c8e88=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x203725,_0x44aba2),this['markerView']=new ot(_0x203725,_0x44aba2);const _0x555c13=new it(_0x203725);_0x555c13['template']['tag']='span',_0x555c13['text']=_0x44aba2['name'];const _0xe2ff12={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x5c8e88['to']('isFocusable',_0x2397a8=>!!_0x2397a8&&0x0),'aria-labelledby':_0x555c13['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x5c8e88['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x5c8e88['to']('hasTooltip',_0xbb1444=>!_0xbb1444),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x555c13]};_0x3da50f&&(_0xe2ff12['tag']='button',_0xe2ff12['on']={'click':_0x5c8e88['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0xe2ff12);}}class ot extends _0x57df8e{constructor(_0xf51a62,_0x840914){super(_0xf51a62),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x840914['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0xd3e8aa{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3b5ce4){super(_0x3b5ce4),this['context']['config']['define']('presenceList',x);const _0x2819c5=_0x3b5ce4['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x2819c5)throw new _0x30f693('presencelist-collapseat-invalid-format',this);if(_0x2819c5<0x1)throw new _0x30f693('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0xb4bb92(),this['balloonPanelView']=new _0x4ba438(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x104ca8 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x104ca8);this['listenTo'](this['_allConnectedUsers'],'add',(_0x172a8f,_0x13c685)=>{this['_handleUserAdd'](_0x13c685);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x1078d8,_0x5a42e0)=>{this['_handleUserRemove'](_0x5a42e0);});}['_createView'](){const _0x1ba3c3=this['context'],_0x4866ed=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4560ce=this['balloonPanelView'];if(!_0x3d55c6(_0x1ba3c3['config']['get']('presenceList.container')))throw new _0x30f693('presencelist-missing-container',this);return _0x4866ed['counterView']['bind']('usersCount')['to'](this),_0x4866ed['bind']('isCollapsed')['to'](this,'usersCount',_0xec40d=>{const {collapseAt:_0x1fba3a}=_0x1ba3c3['config']['get']('presenceList'),_0x1658ee=_0xec40d>=_0x1fba3a;if(_0x1658ee&&!_0x4866ed['inlineListView']['items']['find'](_0x15cdc0=>_0x15cdc0 instanceof b)){const _0x326108=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x326108&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x4866ed['inlineListView']['items']['add'](_0x4866ed['counterView']);}return _0x1658ee||this['hideDropdown'](),_0x1658ee;}),_0x4866ed['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xee2111=>{const _0x5d1fd6=_0x1ba3c3['config']['get']('presenceList'),_0x757bc5=new A(_0x1ba3c3['locale'],_0xee2111,!!_0x5d1fd6['onClick']);return _0x757bc5['bind']('hasTooltip')['to'](_0x4866ed,'isCollapsed',_0x33b23a=>!_0x33b23a),_0x757bc5['bind']('isFocusable')['to'](_0x4866ed,'isCollapsed',_0x3e5019=>!_0x3e5019),_0x5d1fd6['onClick']&&this['listenTo'](_0x757bc5,'execute',()=>{this['view']['isCollapsed']||_0x5d1fd6['onClick'](_0xee2111,_0x757bc5['element']);}),_0x757bc5;}),this['listenTo'](_0x4866ed['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x4866ed['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x4866ed['inlineListView']['keystrokes']['set']('Enter',(_0x4f1e44,_0x672cce)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x672cce());}),_0x4866ed['render'](),_0x4560ce['render'](),_0x2c85ae({'emitter':_0x4866ed,'activator':()=>_0x4560ce['isVisible'],'contextElements':[_0x4560ce['element'],_0x4866ed['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1ba3c3['config']['get']('presenceList.container')['appendChild'](_0x4866ed['element']),this['_bodyCollection']=new _0x2b3595(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x4866ed;}['_handleUserAdd'](_0x311b7d){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x311b7d['isMe'])return;const _0x2e2db7=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x2e2db7-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x1ce863=_0x311b7d['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x311b7d,_0x1ce863);}['_handleUserRemove'](_0x13a4e5){this['usersCount']--;const {collapseAt:_0x4b84e6}=this['context']['config']['get']('presenceList'),_0xa33863=this['usersCount']>=_0x4b84e6;if(this['currentDisplayedUsers']['get'](_0x13a4e5['id']))this['currentDisplayedUsers']['remove'](_0x13a4e5['id']);else{if(_0xa33863&&this['currentDisplayedUsers']['length']+0x1===_0x4b84e6-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0xa33863?0x1:0x0)<this['usersCount']){for(const _0x404129 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x404129['id'])&&(this['currentDisplayedUsers']['add'](_0x404129,Math['min'](this['currentDisplayedUsers']['length']-(_0xa33863?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0xa33863?0x1:0x0)===_0x4b84e6-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x4f0829=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x4f0829['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x30c6d0}=this['presenceDropdownView'];_0x30c6d0['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x453096=>{if(!_0x4f0829['displayMe']&&_0x453096['isMe'])return null;const _0x43fc8d=new j(this['context']['locale'],_0x453096,!!_0x4f0829['onClick']);return _0x4f0829['onClick']&&this['listenTo'](_0x43fc8d,'execute',()=>{_0x4f0829['onClick'](_0x453096,_0x43fc8d['element']);}),_0x43fc8d;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x30c6d0['focus'](),_0x30c6d0['checkIfScrollable']();const _0x32e31a=(_0x44a3d9,_0x31d81c)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x31d81c();};_0x30c6d0['keystrokes']['set']('Esc',_0x32e31a),_0x30c6d0['keystrokes']['set']('Shift+Tab',_0x32e31a),_0x30c6d0['keystrokes']['set']('Tab',(_0x2f23fc,_0x1def47)=>{!function(_0x6068d){const _0xa3f8bd=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x30f71a=>_0x30f71a+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x3ae25a=[...document['body']['querySelectorAll'](_0xa3f8bd)]['filter'](_0x173fa7=>_0x173fa7===document['activeElement']||_0x173fa7['offsetWidth']+_0x173fa7['offsetHeight']>0x0)['sort']((_0x3dc78d,_0x135f8e)=>(_0x3dc78d['tabIndex']||0x0)-(_0x135f8e['tabIndex']||0x0)),_0x5c3430=_0x3ae25a['indexOf'](_0x6068d),_0x3f0a3a=_0x3ae25a[(_0x5c3430+0x1)%_0x3ae25a['length']];_0x3f0a3a&&_0x3f0a3a['focus']();}(this['view']['element']),this['hideDropdown'](),_0x1def47();}),_0x30c6d0['focusTracker']['add'](this['view']['element']),_0x30c6d0['focusTracker']['on']('change:isFocused',(_0x443c4c,_0x2c6750,_0x14f63d)=>{_0x14f63d||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 ft extends _0xd3e8aa{static get['requires'](){return[i,r];}static get['pluginName'](){return'PresenceList';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{s as CloudServicesCommentsAdapter,c as CloudServicesRevisionHistoryAdapter,m as CloudServicesTrackChangesAdapter,ft as PresenceList,r as PresenceListUI,l as RealTimeCollaborationClient,g as RealTimeCollaborativeComments,a as RealTimeCollaborativeEditing,dt as RealTimeCollaborativeRevisionHistory,lt as RealTimeCollaborativeTrackChanges,i as Sessions,n as WebSocketGateway};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export default{'af':{'dictionary':{'CONNECTED_USERS':['',''],'PENDING_ACTION_SENDING_DATA':'','Synchronization\x20issue':'','Connected\x20users\x20list\x20dropdown\x20menu':'','Connected\x20users\x20list':'','Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'','The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20document\x20details\x20could\x20not\x20be\x20taken\x20during\x20the\x20reconnection.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20last\x20saved\x20version\x20of\x20the\x20document\x20does\x20not\x20match\x20the\x20local\x20version.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':'','The\x20local\x20document\x20and\x20server\x20document\x20differ\x20and\x20merging\x20them\x20can\x20cause\x20unexpected\x20behavior.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.':''},'getPluralForm':_0x10a09b=>0x1!=_0x10a09b}};
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':_0x7de178=>0x1!=_0x7de178}};