@ckeditor/ckeditor5-real-time-collaboration 46.0.1-alpha.0 → 46.0.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 _0x130049,Plugin as _0x1c1c75,PendingActions as _0x3e497c,Context as _0x50669c}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x565636,CKEditorError as _0x3433e1,Collection as _0x450339,global as _0x965aaf,version as nt,uid as _0x286086,KeystrokeHandler as _0x1ecd8b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x3d2676,View as _0x12ac9c,ListView as _0xf50aa7,ListItemView as rt,LabelView as ot,BalloonPanelView as _0x173b11,clickOutsideHandler as _0x38afdf,BodyCollection as _0x35c9fd}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x326534,History as _0x3222ca,NoOperation as _0x19ea49,InsertOperation as _0x5e6500,MarkerOperation as _0x52ce9c,RootAttributeOperation as _0x37f6e8,transformOperationSets as _0x206da2,OperationFactory as _0x4696bc}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as ht,WEB_SOCKET_GATEWAY_STATES as te,CollaborativeEditingService as _0x3de961,User as lt,CommentsService as _0x4ebefe,TrackChangesService as et,RevisionHistoryService as it,EditorService as tt}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x55636d,UserView as ct}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x4b7b19}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x5c7686}from'es-toolkit/compat';class n extends _0x130049{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
- ((()=>ht)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x3d2676];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x32aa49){super(_0x32aa49),this['set']('state',te['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x565636())();}['init'](){const _0x16b4f8=this['context'],_0x349cb2=_0x16b4f8['plugins']['get']('CloudServices'),_0x1914c1=_0x16b4f8['plugins']['get'](_0x3d2676);if(!_0x349cb2['token'])throw new _0x3433e1('websocketgateway-missing-token',this);if(!_0x349cb2['webSocketUrl'])throw new _0x3433e1('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'](_0x349cb2['token'],_0x349cb2['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x2a113c=>{if(this['connection']=_0x2a113c,this['bind']('state')['to'](_0x2a113c,'state',this,'_isBrowserOffline',(_0x456ab5,_0x40468b)=>('connected'!==_0x456ab5&&(this['_shouldPluginsReconnect']=!0x0),_0x40468b||_0x456ab5!==te['CONNECTED']?te['DISCONNECTED']:this['state']==te['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),te['CONNECTING']):te['CONNECTED'])),this['connection']['on']('error',(_0x22915c,_0x4e8479)=>{if('limitExceeded'!==_0x4e8479['code'])throw console['error'](_0x4e8479),new _0x3433e1('cloudservices-init',null,{'originalError':_0x4e8479});_0x1914c1['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'});}),!_0x2a113c['me'])return new Promise(_0x434f53=>_0x2a113c['on']('change:me',_0x434f53));})['catch'](_0x52ee06=>{throw console['error'](_0x52ee06),new _0x3433e1('cloudservices-init',null,{'originalError':_0x52ee06});});}['addToReconnectionStack'](_0xcefb6c){if('function'!=typeof _0xcefb6c['reconnect'])throw new _0x3433e1('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0xcefb6c))throw new _0x3433e1('websocketgateway-plugin-already-registered',this,{'name':_0xcefb6c['constructor']['pluginName']});this['_reconnectionStack']['add'](_0xcefb6c);}['removeFromReconnectionStack'](_0xfbb070){this['_reconnectionStack']['delete'](_0xfbb070);}['isInReconnectionStack'](_0x3e0ae0){return this['_reconnectionStack']['has'](_0x3e0ae0);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x36275d=>_0x36275d['reconnect']())))['then'](()=>this['state']=te['CONNECTED'])['catch'](_0x294a54=>{throw console['error'](_0x294a54),new _0x3433e1('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 _0x130049{['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,_0x55636d];}constructor(_0x41d001){super(_0x41d001),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x450339(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x55636d);}['init'](){const _0x345ace=this['context']['plugins']['get'](n);this['listenTo'](_0x345ace,'change:state',(_0x3cd853,_0x261e8f,_0x1ae3b0)=>{if('connected'!==_0x1ae3b0)this['channelSessions']['forEach'](_0x54e59b=>_0x54e59b['clear']()),this['channelConnectedUsers']['forEach'](_0x4a369c=>_0x4a369c['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x2fb2b0,_0x102084]of this['_registeredSessions'])for(const _0x42c85d of _0x102084)this['_handleSessionAdd'](_0x2fb2b0,_0x42c85d);}}),this['_createUser'](_0x345ace['connection']['me'],!0x0);}['register'](_0x36aa4e,_0x481e21){if(this['_registeredSessions']['has'](_0x36aa4e))throw new _0x3433e1('sessions-register-already-registered',null,{'channelId':_0x36aa4e});this['_registeredSessions']['set'](_0x36aa4e,_0x481e21),this['channelSessions']['set'](_0x36aa4e,new _0x450339()),this['channelConnectedUsers']['set'](_0x36aa4e,new _0x450339()),this['listenTo'](_0x481e21,'add',(_0x46ff02,_0x45e1b1)=>this['_handleSessionAdd'](_0x36aa4e,_0x45e1b1)),this['listenTo'](_0x481e21,'remove',(_0x26cda6,_0xb964ca)=>this['_handleSessionRemove'](_0x36aa4e,_0xb964ca));for(const _0x58010b of _0x481e21)this['_handleSessionAdd'](_0x36aa4e,_0x58010b);}['unregister'](_0x1b389f){if(!this['_registeredSessions']['has'](_0x1b389f))throw new _0x3433e1('sessions-unregister-not-exist',null,{'channelId':_0x1b389f});const _0x54fceb=this['_registeredSessions']['get'](_0x1b389f);this['stopListening'](_0x54fceb);for(const _0x29412f of _0x54fceb)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x1b389f,_0x29412f);this['_registeredSessions']['delete'](_0x1b389f),this['channelSessions']['delete'](_0x1b389f),this['channelConnectedUsers']['delete'](_0x1b389f);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x4f59ba){for(const _0xf87bee of this['channelSessions']['values']())for(const _0x21b066 of _0xf87bee)if(_0x21b066['id']===_0x4f59ba)return _0x21b066['user'];}['getUserSessions'](_0x5ef819,_0x1ad260){const _0x2029fb=_0x1ad260?[this['channelSessions']['get'](_0x1ad260)]:this['channelSessions']['values'](),_0x2da084=new Set();for(const _0x3021ff of _0x2029fb)for(const _0x107d92 of _0x3021ff)_0x107d92['user']['id']===_0x5ef819['id']&&_0x2da084['add'](_0x107d92['id']);return _0x2da084;}['getUserRole'](_0x4624b7){for(const _0xc92f88 of this['channelSessions']['values']())for(const _0x3996f8 of _0xc92f88)if(_0x3996f8['user']===_0x4624b7)return _0x3996f8['role'];}['_handleSessionAdd'](_0x173210,_0x1b86fe){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x149c26=_0x1b86fe['user'],_0x29456e=this['_users']['getUser'](_0x149c26['id'])||this['_createUser'](_0x149c26),_0x314670=Object['assign']({},_0x1b86fe,{'user':_0x29456e});this['channelSessions']['get'](_0x173210)['add'](_0x314670);const _0x2488ea=this['channelConnectedUsers']['get'](_0x173210);_0x2488ea['has'](_0x29456e['id'])||_0x2488ea['add'](_0x29456e),this['allConnectedUsers']['has'](_0x29456e['id'])||this['allConnectedUsers']['add'](_0x29456e,_0x29456e['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x173210,{'channelId':_0x173210,'session':_0x314670});}['_handleSessionRemove'](_0x19ed91,_0x29f0e6){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x276d23=this['channelConnectedUsers']['get'](_0x19ed91),_0x2046db=_0x29f0e6['user'];_0x2046db['id']&&(this['channelSessions']['get'](_0x19ed91)['remove'](_0x29f0e6['id']),_0x276d23['has'](_0x2046db['id'])&&!this['getUserSessions'](_0x2046db,_0x19ed91)['size']&&_0x276d23['remove'](_0x2046db['id']),this['allConnectedUsers']['get'](_0x2046db['id'])&&!this['getUserSessions'](_0x2046db)['size']&&this['allConnectedUsers']['remove'](_0x2046db['id']));}['_createUser'](_0x38f996,_0x2acef7){const _0x351107=this['_users']['addUser'](_0x38f996);return _0x2acef7&&this['_users']['defineMe'](_0x38f996['id']),_0x351107['orderNumber']=this['_uniqueUsersCount']++,_0x351107;}}class V extends _0x1c1c75{['_domEmitter']=new(_0x565636())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x590866=this['editor'],_0x70117d=_0x590866['plugins']['get'](i);_0x590866['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0xb20514,{writer:_0x1d164a})=>function(_0x15ca7c,_0x17198e,_0x6816cc,_0x257165){const _0x44cd1b=_0x15ca7c['markerName']['split'](':')[0x2],_0x4fd019=_0x6816cc['getUserBySessionId'](_0x44cd1b);if(!_0x4fd019||_0x44cd1b===_0x6816cc['mySessionId'])return;if(!_0x257165['model']['schema']['checkChild'](_0x15ca7c['markerRange']['start'],'$text'))return;const _0xf4a205={'class':'ck-user__marker\x20'+_0x4fd019['color']['getMarkerClass'](),'data-name':_0x4fd019['name'],'data-session-id':_0x44cd1b},_0x23e0a5=_0x257165['model']['markers']['get'](_0x15ca7c['markerName']),_0x3571a6=_0x23e0a5['getStart'](),_0x50ecc5=_0x3571a6['nodeAfter'],_0x2d07f4=_0x257165['model']['schema'];if(_0x50ecc5&&_0x2d07f4['isObject'](_0x50ecc5)&&_0x2d07f4['isInline'](_0x50ecc5)&&!_0x257165['model']['markers']['get']('user:range:'+_0x44cd1b)['getRange']()['isCollapsed'])return;const _0x5f2e8f=_0x3571a6['parent'];return _0x257165['model']['schema']['isLimit'](_0x5f2e8f)&&!_0x257165['model']['hasContent'](_0x5f2e8f)&&(_0xf4a205['contenteditable']=!0x1),function(_0x30c3b9,_0x562489,_0x2f9211){const _0x53f63f=_0x30c3b9['createUIElement']('span',_0x562489);return _0x30c3b9['setCustomProperty']('userPositionMarker',!0x0,_0x53f63f),_0x53f63f['render']=function(_0x127645){const _0x42bd9d=this['toDomElement'](_0x127645),_0xfd7ca1=document['createElement']('span');return _0xfd7ca1['classList']['add']('ck-user__marker-tooltip'),_0xfd7ca1['setAttribute']('contenteditable','false'),_0xfd7ca1['setAttribute']('spellcheck','false'),_0xfd7ca1['textContent']=_0x2f9211['name'],_0x42bd9d['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0xfd7ca1['outerHTML']+'⁠',_0x42bd9d['addEventListener']('mouseenter',()=>{_0x42bd9d['classList']['add']('ck-user__marker_hovered');}),_0x42bd9d['addEventListener']('mouseleave',()=>{_0x42bd9d['classList']['remove']('ck-user__marker_hovered');}),_0x42bd9d;},_0x53f63f['isSimilar']=function(_0x118e9b){return!(!this['getCustomProperty']('userPositionMarker')||!_0x118e9b['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x118e9b['getAttribute']('data-session-id'));},_0x53f63f;}(_0x17198e,_0xf4a205,_0x4fd019);}(_0xb20514,_0x1d164a,_0x70117d,_0x590866)}),_0x590866['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x24a144=>function(_0x132593,_0x556f81){const _0x107d67=_0x132593['markerName']['split'](':')[0x2];if(_0x107d67===_0x556f81['mySessionId'])return null;const _0x13a9ba=_0x556f81['getUserBySessionId'](_0x107d67);if(!_0x13a9ba)return{'id':_0x107d67,'classes':[]};return{'id':_0x107d67,'classes':['ck-user__selection',_0x13a9ba['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x107d67},'priority':0x7d0+_0x13a9ba['orderNumber']};}(_0x24a144,_0x70117d)}),function(_0x4ddaf9){const _0x413a28=_0x4ddaf9['model'],_0x47c572=new Map(),_0x1f841f=_0x4ddaf9['plugins']['get'](i);_0x413a28['markers']['on']('update:user:range',(_0x1db112,_0x36a839,_0x2395d8,_0x14d3e2)=>{if(!_0x14d3e2&&_0x47c572['get'](_0x36a839['name']))return _0x47c572['get'](_0x36a839['name'])['detach'](),void _0x47c572['delete'](_0x36a839['name']);const _0x26c4fb=_0x36a839['name']['split'](':')[0x2];if(_0x26c4fb===_0x1f841f['mySessionId'])return;const _0x14a2eb='user:position:'+_0x26c4fb;_0x413a28['markers']['has'](_0x14a2eb)&&_0x4ddaf9['editing']['reconvertMarker'](_0x14a2eb),_0x36a839['on']('change:range',(_0xe08c79,_0x55f153,_0x105286)=>{if('$graveyard'!=_0x55f153['root']['rootName']&&'$graveyard'==_0x36a839['getRange']()['root']['rootName']&&!_0x47c572['has'](_0x36a839['name'])){const _0x43a5ec=_0x413a28['schema']['getNearestSelectionRange'](_0x105286['deletionPosition']);if(_0x43a5ec){const _0x47acc8=_0x326534['fromRange'](_0x43a5ec);_0x47c572['set'](_0x36a839['name'],_0x47acc8),_0x47acc8['on']('change:range',(_0x5ae406,_0xfbc65e,_0x33816f)=>{if('$graveyard'==_0x47acc8['root']['rootName']){const _0x1297dc=_0x413a28['schema']['getNearestSelectionRange'](_0x33816f['deletionPosition']);_0x1297dc?(_0x47acc8['start']=_0x1297dc['start'],_0x47acc8['end']=_0x1297dc['end']):(_0x47c572['delete'](_0x36a839['name']),_0x47acc8['detach']());}});}}});}),_0x413a28['document']['on']('change',()=>{_0x47c572['size']>0x0&&_0x413a28['enqueueChange']({'isUndoable':!0x1},_0x2339d3=>{for(const [_0x14a5c5,_0x3b754c]of _0x47c572)'$graveyard'==_0x413a28['markers']['get'](_0x14a5c5)['getRange']()['root']['rootName']&&(Z(_0x14a5c5['split'](':')[0x2],_0x3b754c['toRange'](),_0x413a28,_0x2339d3),_0x3b754c['detach']());_0x47c572['clear']();});});}(_0x590866),this['_domEmitter']['listenTo'](_0x965aaf['document'],'keydown',(_0x240c87,{key:_0x21f262})=>{'Escape'===_0x21f262&&function(_0x32b86b){_0x32b86b['editing']['view']['change'](_0x1e3739=>{for(const _0x4ade16 of _0x32b86b['model']['markers']){if(!_0x4ade16['name']['startsWith']('user:position'))continue;const _0x23dc55=_0x32b86b['editing']['mapper']['markerNameToElements'](_0x4ade16['name']);if(_0x23dc55){for(const _0x15a0ae of _0x23dc55)_0x1e3739['removeClass']('ck-user__marker_hovered',_0x15a0ae);}}});}(_0x590866);},{'useCapture':!0x0});}['afterInit'](){const _0x3e7eff=this['editor'],_0xaaa745=_0x3e7eff['commands']['get']('undo');_0xaaa745&&_0x3e7eff['model']['on']('applyOperation',(_0x23e2ed,_0x2b921d)=>{const _0x5773ba=_0x2b921d[0x0];if(!_0x5773ba['isDocumentOperation'])return;if('marker'!=_0x5773ba['type']||!_0x5773ba['name']['startsWith']('user:'))return;const _0x4101ca=_0x5773ba['batch'];_0xaaa745['_createdBatches']['has'](_0x4101ca)&&(_0x5773ba['newRange']=_0x5773ba['oldRange']?_0x3e7eff['model']['createRange'](_0x5773ba['oldRange']['start'],_0x5773ba['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x193071=this['editor'],_0x46fdbf=_0x193071['model']['document'],_0x166868=_0x193071['plugins']['get'](i);_0x193071['model']['enqueueChange']({'isUndoable':!0x1},_0x25e2f4=>{const _0x29874c='user:range:'+_0x166868['mySessionId'],_0x4daf91='user:position:'+_0x166868['mySessionId'],_0x4eff8e=_0x193071['model']['markers']['has'](_0x29874c);_0x193071['editing']['view']['hasDomSelection']?Z(_0x166868['mySessionId'],_0x46fdbf['selection']['getFirstRange'](),_0x193071['model'],_0x25e2f4):_0x4eff8e&&(_0x25e2f4['removeMarker'](_0x29874c),_0x25e2f4['removeMarker'](_0x4daf91));});}}function Z(_0x463ad1,_0xd10565,_0x1eacc5,_0xea45b4){const _0x4def12='user:range:'+_0x463ad1,_0x19fc99='user:position:'+_0x463ad1,_0x5e7cfa=_0xd10565['getContainedElement']();let _0x5d8237=_0xd10565['start'];if(_0x5e7cfa&&_0x5e7cfa['is']('element','tableCell')){const _0x446f19=function(_0x4107c8,_0x15ea47){for(const _0x3aca7d of _0x4107c8['getPositions']())if(_0x15ea47['schema']['checkChild'](_0x3aca7d,'$text'))return _0x3aca7d;}(_0xd10565,_0x1eacc5);_0x446f19&&(_0x5d8237=_0x446f19,_0xd10565=_0xea45b4['createRange'](_0x5d8237));}const _0x4d3735=_0xea45b4['createRange'](_0x5d8237);_0x1eacc5['markers']['has'](_0x4def12)?(_0xea45b4['updateMarker'](_0x4def12,{'range':_0xd10565}),_0xea45b4['updateMarker'](_0x19fc99,{'range':_0x4d3735})):(_0xea45b4['addMarker'](_0x4def12,{'range':_0xd10565,'usingOperation':!0x0}),_0xea45b4['addMarker'](_0x19fc99,{'range':_0x4d3735,'usingOperation':!0x0}));}function W(_0x433e20,_0x4b5f91,_0x1c9628){const _0x3c8d26=_0x433e20['t'],t=_0x433e20['t'];switch(_0x4b5f91){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 _0x3c8d26({'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'},_0x1c9628);default:return'';}}let G=0x1;class l extends _0x1c1c75{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
- ((()=>_0x3de961)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,V,_0x3e497c,_0x55636d,_0x3d2676];}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 _0x23b817=this['serverHistory']['getOperations']();for(let _0x33d5a1=_0x23b817['length']-0x1;_0x33d5a1>=0x0;_0x33d5a1--){const _0x4f3014=_0x23b817[_0x33d5a1];if(!this['_disconnectionOperations']['has'](_0x4f3014))return _0x4f3014['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x5d7b5f){if(super(_0x5d7b5f),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x3222ca(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x3433e1('collaboration-missing-channelid',this);const _0x2bb824=_0x5d7b5f['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x2bb824,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x4b7b19(),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 _0x1ad305=this['editor'],_0x2bf38a=_0x1ad305['plugins']['get'](_0x55636d),_0x3992b4=_0x1ad305['plugins']['get'](n);this['listenTo'](_0x2bf38a,'getOperationAuthor',(_0x5ccd29,_0x516fb5)=>{const _0x35a671=_0x516fb5[0x0];_0x35a671['_authorId']&&(_0x5ccd29['return']=_0x2bf38a['getUser'](_0x35a671['_authorId']),_0x5ccd29['stop']()),null===_0x35a671['_authorId']&&(_0x5ccd29['return']=null,_0x5ccd29['stop']());},{'priority':'high'}),this['listenTo'](_0x1ad305['model']['document']['selection'],'change:range',(_0x4da2bd,_0x52399e)=>{_0x52399e['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x1ad305['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x1ad305['model']['on']('applyOperation',(_0x2e89de,_0x4a0e6e)=>{const _0x128818=_0x4a0e6e[0x0];_0x128818['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x128818),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x3992b4,'state',this,'_hasSynchronizationProblem',(_0x2ec80a,_0x51ba6b)=>'connected'===_0x2ec80a&&!_0x51ba6b),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x1ad305['disableReadOnlyMode']('rtc-offline'):_0x1ad305['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x1ad305['disableReadOnlyMode']('rtc-offline'):_0x1ad305['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x50b492=this['editor']['plugins']['get'](i),_0x1f3e7a=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x50b492['unregister'](this['_channelId']);const _0xd036c2=await this['_service']['reconnect'](_0x1f3e7a['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0xd036c2)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3ae8d5=await this['_service']['getConnectedSessions']();_0x50b492['register'](this['_channelId'],_0x3ae8d5),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x3cb7f){if(function(_0x1315e3){return'404'===_0x1315e3['code'];}(_0x3cb7f)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x1e58d4){return'409'===_0x1e58d4['code'];}(_0x3cb7f)){const _0xd2e81f=W(this['editor']['locale'],'The\x20document\x20cannot\x20be\x20connected\x20back\x20to\x20the\x20server.\x20To\x20not\x20lose\x20your\x20content\x20save\x20it\x20locally\x20and\x20refresh\x20the\x20editor.');this['_handleReconnectionError'](_0xd2e81f);}else{if(!(_0x3cb7f instanceof $))throw _0x3cb7f;this['_handleReconnectionError']();}}}}['destroy'](){const _0x6b4086=this['editor']['plugins']['get'](n),_0xaaec91=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0xaaec91['channelSessions']['has'](this['_channelId'])&&_0xaaec91['unregister'](this['_channelId']),_0x6b4086['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x857154){if(this['sessionId']!==_0x857154['sessionId']&&this['_lastSyncedOperationId']!==_0x857154['lastOperationId'])throw new $();return this['sessionId']=_0x857154['sessionId'],this['_handleServerResponse']([],{..._0x857154,'wereChangesApplied':!0x1,'data':_0x857154['data']},'reconnect');}async['_connectService'](_0x2b5299,_0x53e06f=!0x1){const {connection:_0x8d5588}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x8d5588,this['_channelId'])['then'](_0x835b28=>this['_initSessionsHandling'](_0x835b28))['catch'](_0x5c5ba8=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x5c5ba8);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0xd12c53,_0x141f44)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x141f44);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x301581=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x2b5299);this['_isPendingUpdate']=!0x0;const _0x3090c0=await this['_service']['connect'](_0x8d5588,this['_compressOperations'](_0x2b5299),_0x301581);if(this['sessionId']=_0x3090c0['sessionId'],_0x53e06f){if(!_0x3090c0['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x3090c0['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x2b5299,_0x3090c0,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x3090c0,_0x2b5299);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3caac1=this['editor']['plugins']['get'](i),_0x2f805c=this['editor']['plugins']['get'](V),_0x1508b4=_0x3caac1['channelSessions']['get'](this['_channelId']);_0x1508b4&&_0x1508b4['length']>0x1?_0x2f805c['createUserMarkerOperations']():this['listenTo'](_0x3caac1,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3caac1['channelSessions']['get'](this['_channelId'])['length']&&_0x2f805c['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0xea5a3a,_0x516360,_0x316295,_0x396c88){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x516360){const _0xbc6459=this['_decompressOperations'](_0x316295,_0x396c88);await this['_fetchMissingUsers'](_0xbc6459),this['_handleExternalOperations'](_0xbc6459,_0x516360,_0x316295['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x1249d2}=this['editor'];let _0x308ca0;try{_0x308ca0=await this['_service']['getDocumentDetails']();}catch{const _0x1b10b6=W(_0x1249d2,'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'](_0x1b10b6);}const _0x385946=_0x308ca0['currentDocumentSession']||_0x308ca0['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x385946['lastOperationId']){const _0x42b1cc=W(_0x1249d2,'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'](_0x42b1cc);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0xef904f){const _0x394633=this['editor']['plugins']['get'](i);this['listenTo'](_0x394633,'sessionAdd:'+this['_channelId'],(_0x3eeb1f,{session:_0x3b347f})=>{if(_0x3b347f['id']===_0x394633['mySessionId']){_0x3eeb1f['off']();const _0x3a6325=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x297691=_0x3b347f['permissions'];_0x3a6325&&_0x3a6325['isEnabled']&&(_0x297691=_0x297691['filter'](_0x2a1310=>'document:write'!==_0x2a1310)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x297691,this['_channelId']);}}),_0x394633['register'](this['_channelId'],_0xef904f);}['_initThrowingOnDataSet'](){const _0xd06918=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5c93fe)=>{if(!_0x5c93fe[_0x5c93fe['length']-0x1]['suppressErrorInCollaboration'])throw new _0x3433e1('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0xd06918['apply'](this['editor']['data'],_0x5c93fe);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x2e91e9,[_0x104eaf])=>{if(this['_document']['version'])throw new _0x3433e1('realtimecollaborationclient-init-document-already-initialized',this);_0x2e91e9['stop'](),this['_setPendingAction']();const _0x2c8680=this['editor']['config']['get']('rootsAttributes'),_0x5c1880=this['_getOperationsFromInitData'](_0x104eaf,_0x2c8680);0x0==_0x5c1880['length']&&_0x5c1880['push'](new _0x19ea49(0x0)),_0x2e91e9['return']=this['_connectService'](_0x5c1880)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2f5471=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2f5471))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x2ac8af,[_0x43b239,_0x260831])=>{_0x2ac8af['stop']();const _0x287ff2=this['editor']['model']['document']['getRoot'](_0x43b239);if(!this['_knownRootNames']['has'](_0x43b239)){const _0xe43983=_0x260831&&_0x260831['data']?_0x260831['data']:'',_0x23075b=_0x260831&&_0x260831['attributes']?_0x260831['attributes']:{};await this['_loadRoot'](_0x43b239,_0xe43983,_0x23075b);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x287ff2['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x287ff2);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x53796e){const _0x593747=this['editor']['plugins']['get'](_0x55636d),{connection:_0x15c1b7}=this['editor']['plugins']['get'](n),_0x536df0=new Set();for(const _0x307360 of _0x53796e){const _0x3ba262=_0x307360['_authorId'];_0x3ba262&&!_0x593747['getUser'](_0x3ba262)&&_0x536df0['add'](_0x3ba262);}if(0x0===_0x536df0['size'])return;const _0x232c7e=await lt['getMany'](_0x15c1b7,Array['from'](_0x536df0));for(const _0x4e05c4 of _0x232c7e)_0x593747['getUser'](_0x4e05c4['id'])||_0x593747['addUser'](_0x4e05c4);}['_getOperationsFromInitData'](_0x2b0d81,_0x5a2ba6={}){const _0x2882e9=this['editor']['model'],_0x51eb05=[];let _0x40b951=0x0;const _0x4a4ce9='string'==typeof _0x2b0d81?{'main':_0x2b0d81}:_0x2b0d81;for(const _0x4d4d72 of Object['keys'](_0x4a4ce9)){if(!this['_document']['roots']['has'](_0x4d4d72))throw new _0x3433e1('realtimecollaborationclient-init-non-existent-root',this);const _0x1922e1=this['editor']['data']['parse'](_0x4a4ce9[_0x4d4d72]),_0x1a03be=this['_document']['getRoot'](_0x4d4d72),_0x570b0f=new _0x5e6500(_0x2882e9['createPositionAt'](_0x1a03be,0x0),_0x1922e1,_0x40b951++);_0x51eb05['push'](_0x570b0f);for(const [_0xfb71ee,_0x16b4ee]of _0x1922e1['markers']){const _0x28aecf=_0x2882e9['createRange'](_0x2882e9['createPositionFromPath'](_0x1a03be,_0x16b4ee['start']['path']['slice']()),_0x2882e9['createPositionFromPath'](_0x1a03be,_0x16b4ee['end']['path']['slice']())),_0x1517ae=new _0x52ce9c(_0xfb71ee,null,_0x28aecf,_0x2882e9['markers'],!0x0,_0x40b951++);_0x51eb05['push'](_0x1517ae);}}if(_0x5a2ba6)for(const [_0x42ee3c,_0x5706a7]of Object['entries'](_0x5a2ba6)){const _0x122bdb=_0x2882e9['document']['getRoot'](_0x42ee3c);if(!_0x122bdb)throw new _0x3433e1('multi-root-editor-root-attributes-no-root',null);for(const [_0x453a00,_0x35bad0]of Object['entries'](_0x5706a7))if(null!==_0x35bad0){const _0xd78ea1=new _0x37f6e8(_0x122bdb,_0x453a00,null,_0x35bad0,_0x40b951++);_0x51eb05['push'](_0xd78ea1);}}return _0x51eb05;}async['_loadRoot'](_0x2c59cb,_0x3bb5e4,_0x58b631){this['_getOperationsFromInitData']({[_0x2c59cb]:_0x3bb5e4},{[_0x2c59cb]:_0x58b631})['forEach']((_0x11d65a,_0x1c5011)=>{_0x11d65a['baseVersion']=this['_document']['version']+_0x1c5011,_0x11d65a['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x11d65a);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1b8776,_0x1ab60b){let _0x2fd24e;this['_offset']=_0x1b8776['offset'];const _0x1dd244=_0x1b8776['wereChangesApplied']&&!_0x1b8776['initData'],_0x18f445=_0x1dd244?0x0:_0x1b8776['data']['baseVersion'];if(_0x1ab60b['forEach'](_0x48a8be=>{_0x48a8be['_isInit']=!0x0,_0x48a8be['createdAt']=_0x1b8776['sessionCreatedAt'],_0x48a8be['_authorId']=null;}),_0x1dd244)_0x2fd24e=_0x1ab60b,this['_applyOperationsSet'](_0x2fd24e,_0x1dd244);else{if(_0x1b8776['initData']){const _0x1b99df=this['_getOperationsFromInitData'](_0x1b8776['initData']);this['_document']['history']['version']=-_0x1b99df['length'],_0x1b99df['forEach'](_0x4a1459=>{_0x4a1459['baseVersion']-=_0x1b99df['length'],_0x4a1459['createdAt']=_0x1b8776['sessionCreatedAt'],_0x4a1459['_isInit']=!0x0,_0x4a1459['_authorId']=null;}),this['_applyOperationsSet'](_0x1b99df,!0x0),this['serverHistory']['version']=-_0x1b99df['length']+this['_offset'],this['_updateServerHistory'](_0x1b99df);}this['_document']['history']['version']=_0x18f445,_0x2fd24e=this['_decompressOperations'](_0x1b8776['data'],_0x1b8776['metadata']),await this['_fetchMissingUsers'](_0x2fd24e),this['_applyOperationsSet'](_0x2fd24e,_0x1dd244);}_0x1b8776['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x2fd24e,_0x1b8776['lastOperationId']),this['_lastSyncedOperationId']=_0x1b8776['lastOperationId']),this['serverHistory']['version']=_0x18f445+this['_offset'],this['_updateServerHistory'](_0x2fd24e),_0x1ab60b['filter'](_0x4a1b55=>{const _0x4c09c2=this['_getAffectedRoot'](_0x4a1b55);return _0x4c09c2&&!this['_knownRootNames']['has'](_0x4c09c2);})['forEach']((_0x31f935,_0x199641)=>{_0x31f935['baseVersion']=this['_document']['version']+_0x199641,this['_saveOperationInBuffer'](_0x31f935);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x499a43,_0x51ec8b){const _0x515acf=_0x51ec8b&&_0x51ec8b['message'];if(_0x515acf&&_0x515acf['startsWith']('realtimecollaborationclient'))throw _0x51ec8b;const _0x1b695a=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x1b695a['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x3433e1(_0x499a43,this['editor'],_0x515acf?{'originalError':_0x515acf}:void 0x0);}['_saveOperationInBuffer'](_0x4e8d4f){this['_knownOperations']['has'](_0x4e8d4f)||(this['_knownOperations']['add'](_0x4e8d4f),this['_bufferedOperations']['push'](_0x4e8d4f),this['_pendingAction']||'marker'==_0x4e8d4f['type']&&!_0x4e8d4f['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x408d7c=!0x1){!_0x408d7c&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x1929ee=>{_0x1929ee&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x5707ac=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0xe2fefd){return _0xe2fefd['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0xe2fefd['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0xe2fefd['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x5707ac)||this['_crash'](_0x5707ac['message'],_0x5707ac);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x44209b=>{this['on']('change:_isPendingUpdate',()=>{_0x44209b();});});}async['_sendBufferedOperations'](){const _0x167f84=this['editor']['plugins']['get'](V);if(this['_shouldSendSelectionUpdate']()&&(_0x167f84['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0xc7429c=[...this['_bufferedOperations']];for(const _0x1343c6 of _0xc7429c)_0x1343c6['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x1343c6);const _0x36ed45=this['_operationIdentifier']['getIdOfTheLastOperation'](_0xc7429c),_0x58e826=G++,_0x481053=this['_compressOperations'](_0xc7429c),_0x162184=await this['_service']['sendOperations'](_0x481053,_0x481053['baseVersion'],_0x36ed45);try{return await this['_handleServerResponse'](_0xc7429c,_0x162184,_0x58e826);}catch(_0x28889d){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x28889d);}}async['_handleServerResponse'](_0x18fd2a,_0x26e9b5,_0x3c4d8b){if('error'in _0x26e9b5)throw _0x26e9b5['error'];let _0x11432d=!0x1;if(_0x26e9b5['wereChangesApplied']){_0x26e9b5['lastOperationId']&&(this['_lastSyncedOperationId']=_0x26e9b5['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x414a92=>!_0x18fd2a['includes'](_0x414a92));for(const _0x1fba2c of _0x18fd2a)_0x1fba2c['createdAt']='lastOperationAcceptedAt'in _0x26e9b5&&_0x26e9b5['lastOperationAcceptedAt']||void 0x0;K(_0x18fd2a,_0x26e9b5['version']-_0x18fd2a['length']),this['_updateServerHistory'](_0x18fd2a);const _0x4bf625=_0x18fd2a['filter'](_0x548a2a=>{if(!_0x548a2a['_isInit'])return!0x1;const _0x1d01ee=this['_getAffectedRoot'](_0x548a2a);return _0x1d01ee&&!this['_knownRootNames']['has'](_0x1d01ee);});K(_0x4bf625,this['_document']['version']),this['_applyOperationsSet'](_0x4bf625),_0x11432d=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x252734=this['_decompressOperations'](_0x26e9b5['data'],_0x26e9b5['metadata'])['filter'](_0x145440=>_0x145440['baseVersion']>=this['_lastServerVersion']);_0x252734['forEach'](_0x1db7f9=>this['_addKnownRoot'](_0x1db7f9)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x2ef853=>!_0x2ef853['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x2ef853))),this['_bufferedOperations']['length']&&K(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x252734),_0x11432d=this['_handleExternalOperations'](_0x252734,_0x26e9b5['version'],_0x26e9b5['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x11432d?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x173406,_0x23d7c5,_0x411656){try{const _0x568862={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x159655,operationsB:_0x5864f7,originalOperations:_0xd6a45a}=_0x206da2(_0x173406,this['_bufferedOperations'],_0x568862);K(_0x159655,this['_document']['version']),K(_0x5864f7,_0x23d7c5);for(const _0x30a787 of _0x159655){const _0x59e0bd=_0xd6a45a['get'](_0x30a787);_0x30a787['_authorId']=_0x59e0bd?_0x59e0bd['_authorId']:null;}_0x411656&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x173406,_0x411656),this['_lastSyncedOperationId']=_0x411656),this['_bufferedOperations']=[..._0x5864f7],this['_applyOperationsSet'](_0x159655),this['_updateServerHistory'](_0x173406);}catch(_0xfbfd51){return console['error'](_0xfbfd51),!0x1;}return!0x0;}['_applyOperationsSet'](_0x2b8e4c,_0x5e06b7=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x27eefe=>{for(const _0x274879 of _0x2b8e4c)this['_knownOperations']['add'](_0x274879),this['_addKnownRoot'](_0x274879),_0x27eefe['batch']['addOperation'](_0x274879),this['editor']['model']['applyOperation'](_0x274879);});}['_addKnownRoot'](_0x8b9f21){const _0x2dcf58=this['_getAffectedRoot'](_0x8b9f21);_0x2dcf58&&this['_knownRootNames']['add'](_0x2dcf58);}['_getAffectedRoot'](_0xef841e){let _0x44c06e,_0x22044a;switch(_0xef841e['type']){case'insert':_0x44c06e=_0xef841e['position']['root'];break;case'marker':if(_0x22044a=_0xef841e['newRange'],!_0x22044a)return null;_0x44c06e=_0x22044a['root'];break;case'addRootAttribute':_0x44c06e=_0xef841e['root'];break;case'addRoot':_0x44c06e=_0xef841e['affectedSelectable'];break;case'move':_0x44c06e=_0xef841e['targetPosition']['root'];break;default:return null;}return _0x44c06e['rootName'];}['_updateServerHistory'](_0x63bdc0){_0x63bdc0['forEach'](_0x226e7c=>{const _0x268f83=_0x226e7c['clone']();_0x268f83['_authorId']=_0x226e7c['_authorId'],_0x268f83['_isInit']=!!_0x226e7c['_isInit'],_0x268f83['createdAt']=_0x226e7c['createdAt'],_0x268f83['baseVersion']+=this['_offset'],_0x226e7c['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x268f83),this['serverHistory']['addOperation'](_0x268f83);});}['_handleReconnectionError'](_0x4e618f){const _0x483aec=this['editor']['plugins']['get']('Notification'),_0x4f7486=this['editor']['locale'];_0x4e618f||(_0x4e618f=W(_0x4f7486,'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.')),_0x483aec['showWarning'](_0x4e618f,{'title':W(_0x4f7486,'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'](_0x3e497c)['add'](W(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3e497c)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0x4559de){const _0x4acf58=_0x4559de['map'](_0x31da56=>_0x31da56['toJSON']());return this['_compressor']['compress'](_0x4acf58);}['_decompressOperations'](_0x37e85c,_0x1ea0e5){return this['_compressor']['decompress'](_0x37e85c)['map']((_0x145f3a,_0x9c3a0a)=>{const _0x45d9c1='init'==_0x1ea0e5[_0x9c3a0a]['type'];if('InsertOperation'==_0x145f3a['__className']){const _0x37394c=_0x145f3a['position']['root'];!this['_document']['getRoot'](_0x37394c)&&(this['_document']['createRoot']('$root',_0x37394c)['_isAttached']=!0x1);}const _0x1b31df=_0x4696bc['fromJSON'](_0x145f3a,this['_document']);return _0x1b31df['wasUndone']=_0x145f3a['wasUndone'],_0x1b31df['_isInit']=_0x45d9c1,_0x1b31df['_authorId']=_0x45d9c1?null:_0x1ea0e5[_0x9c3a0a]['userId'],_0x1b31df['_isDisconnection']='cs:removeUser'===_0x1ea0e5[_0x9c3a0a]['type'],_0x1b31df['createdAt']=_0x1ea0e5[_0x9c3a0a]['createdAt'],_0x1b31df;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x513cef=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x513cef&&_0x513cef['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class $ extends Error{}function K(_0x1f38fc,_0x37b95a){for(const _0x3c6ab5 of _0x1f38fc)_0x3c6ab5['baseVersion']=_0x37b95a++;}class J{['_ignoredOperations'];['_operationToId'];constructor(_0x1c4879){this['_ignoredOperations']=_0x1c4879,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x342e2f){let _0x43f882=_0x342e2f['length'];for(;_0x43f882--;){const _0x10d8e1=_0x342e2f[_0x43f882];if(!this['_ignoredOperations']['has'](_0x10d8e1)){if(!this['_operationToId']['has'](_0x10d8e1)){const _0x2727c4=_0x286086()['slice'](0x1,0x12);this['_operationToId']['set'](_0x10d8e1,_0x2727c4);}return this['_operationToId']['get'](_0x10d8e1);}}}['setIdForTheLastOperation'](_0x381d5f,_0x160e67){if(!_0x160e67)return;let _0x26f62a=_0x381d5f['length'];for(;_0x26f62a--;){const _0x4abd28=_0x381d5f[_0x26f62a];this['_ignoredOperations']['has'](_0x4abd28)||this['_operationToId']['set'](_0x4abd28,_0x160e67);}}}class a extends _0x1c1c75{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x130049{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
- ((()=>_0x4ebefe)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x55636d];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4788bf){super(_0x4788bf),this['_services']=new Map();}async['init'](){const _0x4eeb30=this['context'],_0x3077a2=_0x4eeb30['plugins']['get']('CommentsRepository');if(_0x4eeb30['plugins']['get'](n)['addToReconnectionStack'](this),_0x3077a2['adapter']={'addCommentThread':async({channelId:_0x38a342,threadId:_0x132d27,comments:_0x594f45,resolvedAt:_0x389244,resolvedBy:_0x1be5ac,context:_0x791e63,attributes:_0x5e507a})=>{const _0x35719d=await this['_getService'](_0x38a342)['addCommentThread']({'commentThreadId':_0x132d27,'comments':_0x594f45['map'](_0x1cc590=>function(_0x154395,_0x17663b,_0x2b1ca3){return{'commentThreadId':_0x2b1ca3,'commentId':_0x154395['commentId'],'userId':_0x154395['authorId'],'content':_0x154395['content'],'documentId':_0x17663b,'createdAt':_0x154395['createdAt'],'attributes':_0x154395['attributes']||{}};}(_0x1cc590,_0x38a342,_0x132d27)),'resolvedAt':_0x389244,'resolvedBy':_0x1be5ac,'context':_0x791e63,'attributes':_0x5e507a})['catch'](dt);return{'threadId':_0x35719d['commentThreadId'],'comments':_0x35719d['comments']};},'getCommentThread':async({channelId:_0x27707c,threadId:_0x2017ca})=>{const _0x4862d1=await this['_getService'](_0x27707c)['getCommentThread'](_0x2017ca)['catch'](dt);return _0x4862d1['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x4862d1]),{'threadId':_0x4862d1['commentThreadId'],'comments':_0x4862d1['comments']['map'](p),'context':_0x4862d1['context'],'resolvedAt':_0x4862d1['resolvedAt'],'resolvedBy':_0x4862d1['resolvedBy'],'attributes':_0x4862d1['attributes']||{}});},'updateCommentThread':async({channelId:_0x516bf7,threadId:_0x4005cd,context:_0x2e3cca,unlinkedAt:_0x246a01,attributes:_0x1fdc63})=>this['_getService'](_0x516bf7)['updateCommentThread']({'commentThreadId':_0x4005cd,'context':_0x2e3cca,'attributes':_0x1fdc63,'unlinkedAt':_0x246a01})['catch'](v)['catch'](dt),'resolveCommentThread':async({channelId:_0xd13d36,threadId:_0x193e5a})=>{const _0xcf7b5b=await this['_getService'](_0xd13d36)['resolveCommentThread'](_0x193e5a)['catch'](v)['catch'](dt);return{'threadId':_0xcf7b5b['commentThreadId'],'resolvedAt':_0xcf7b5b['resolvedAt'],'resolvedBy':_0xcf7b5b['resolvedBy']};},'reopenCommentThread':async({channelId:_0x107d73,threadId:_0x77758b})=>this['_getService'](_0x107d73)['reopenCommentThread'](_0x77758b)['catch'](v)['catch'](dt),'removeCommentThread':({channelId:_0x25fe0a,threadId:_0x544142})=>this['_getService'](_0x25fe0a)['removeCommentThread'](_0x544142)['catch'](v)['catch'](dt),'addComment':({channelId:_0x573d7a,threadId:_0x29225e,commentId:_0x1b1cc0,content:_0x1cf35d,attributes:_0x1b24d9})=>this['_getService'](_0x573d7a)['addComment'](_0x29225e,_0x1b1cc0,_0x1cf35d,_0x1b24d9)['catch'](dt),'updateComment':({channelId:_0x31d6e5,threadId:_0x19bf12,commentId:_0x3e8073,content:_0x5ee631,attributes:_0x236b86})=>this['_getService'](_0x31d6e5)['updateComment'](_0x19bf12,_0x3e8073,_0x5ee631,_0x236b86)['catch'](v)['catch'](dt),'removeComment':({channelId:_0x4ce298,threadId:_0x2021fa,commentId:_0x25972e})=>this['_getService'](_0x4ce298)['removeComment'](_0x2021fa,_0x25972e)['catch'](v)['catch'](dt)},_0x4eeb30 instanceof _0x50669c){const _0x502fbd=_0x4eeb30['config']['get']('collaboration.channelId'),_0x2aec19=_0x4eeb30['plugins']['get'](i);await this['_setUpService'](_0x502fbd);const _0x160a76=await this['_services']['get'](_0x502fbd)['getConnectedSessions']();this['listenTo'](_0x2aec19,'sessionAdd:'+_0x502fbd,(_0x499f14,{session:_0x4d7c09})=>{_0x4d7c09['id']===_0x2aec19['mySessionId']&&(_0x499f14['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x4d7c09['permissions'],_0x502fbd));}),_0x2aec19['register'](_0x502fbd,_0x160a76);}}async['_setUpService'](_0x48ba0f){if(this['_services']['has'](_0x48ba0f))throw new _0x3433e1('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x48ba0f});const _0x34d707=this['context']['plugins']['get']('CommentsRepository'),_0x23b7a3=new s['CommentsService'](_0x48ba0f);this['_services']['set'](_0x48ba0f,_0x23b7a3),this['listenTo'](_0x23b7a3,'commentThreadAdded',(_0x4eb9cc,_0xfe510e)=>{const {commentThreadId:_0x28e4fb,documentId:_0x11516d,context:_0x5a080c,attributes:_0x32027c,resolvedAt:_0x2d2062,resolvedBy:_0x26b6e0,comments:_0x8424c8}=_0xfe510e;_0x34d707['getCommentThread'](_0x28e4fb)||_0x34d707['addCommentThread']({'threadId':_0x28e4fb,'channelId':_0x11516d,'comments':_0x8424c8?_0x8424c8['map'](p):[],'context':_0x5a080c,'attributes':_0x32027c,'resolvedAt':_0x2d2062,'resolvedBy':_0x26b6e0,'isFromAdapter':!0x0});}),this['listenTo'](_0x23b7a3,'commentThreadUpdated',(_0x2cfdbd,{commentThreadId:_0x1bb7fd,documentId:_0x55de9f,context:_0x351736,unlinkedAt:_0xf94779,attributes:_0x22b679})=>{_0x34d707['getCommentThread'](_0x1bb7fd)&&_0x34d707['updateCommentThread']({'threadId':_0x1bb7fd,'channelId':_0x55de9f,'context':_0x351736,'unlinkedAt':_0xf94779,'attributes':_0x22b679,'isFromAdapter':!0x0});}),this['listenTo'](_0x23b7a3,'commentThreadResolved',(_0x4ea5cf,{commentThreadId:_0x5e79c6,resolvedBy:_0x15ea16,resolvedAt:_0x5de820})=>{const _0x4d98b6=_0x34d707['getCommentThread'](_0x5e79c6);_0x4d98b6&&_0x4d98b6['resolve']({'resolvedBy':_0x15ea16,'resolvedAt':_0x5de820,'isFromAdapter':!0x0});}),this['listenTo'](_0x23b7a3,'commentThreadReopened',(_0x4ae834,{commentThreadId:_0x340f38})=>{const _0x36d466=_0x34d707['getCommentThread'](_0x340f38);_0x36d466&&_0x36d466['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x23b7a3,'commentThreadRemoved',(_0x34a06f,{commentThreadId:_0x255bc4})=>{const _0x635096=_0x34d707['getCommentThread'](_0x255bc4);_0x635096&&_0x635096['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x23b7a3,'commentAdded',(_0x2eb8b9,_0x3423b2)=>{const _0x1d76ff=_0x3423b2['commentThreadId'],_0x288052=_0x34d707['getCommentThread'](_0x1d76ff);_0x288052&&_0x288052['addComment']({...p(_0x3423b2),'isFromAdapter':!0x0});}),this['listenTo'](_0x23b7a3,'commentUpdated',(_0x2581c9,{commentThreadId:_0x537a59,commentId:_0x211191,content:_0x100b59,attributes:_0x1a1f15})=>{const _0x3672ac=_0x34d707['getCommentThread'](_0x537a59);if(_0x3672ac){const _0x5711dc=_0x3672ac['getComment'](_0x211191);_0x5711dc&&_0x5711dc['update']({'content':_0x100b59,'attributes':_0x1a1f15,'isFromAdapter':!0x0});}}),this['listenTo'](_0x23b7a3,'commentRemoved',(_0x1d20a8,{commentThreadId:_0x25e9b3,commentId:_0x3fc748})=>{const _0x16624f=_0x34d707['getCommentThread'](_0x25e9b3);if(_0x16624f){const _0x38f83d=_0x16624f['getComment'](_0x3fc748);_0x38f83d&&_0x38f83d['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x48ba0f);}['destroy'](){if(this['context']instanceof _0x50669c){const _0x380d16=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x380d16);}}['_terminateService'](_0x295db3){if(!this['_services']['has'](_0x295db3))throw new _0x3433e1('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x295db3});this['_getService'](_0x295db3)['disconnect'](),this['_services']['delete'](_0x295db3);}async['reconnect'](){for(const _0x274acf of this['_services']['keys']())await this['_connectService'](_0x274acf);if(this['context']instanceof _0x50669c){const _0x3626c6=this['context']['config']['get']('collaboration.channelId'),_0x3750bb=this['context']['plugins']['get'](i);_0x3750bb['unregister'](_0x3626c6);const _0x510808=await this['_services']['get'](_0x3626c6)['getConnectedSessions']();_0x3750bb['register'](_0x3626c6,_0x510808);}}async['_connectService'](_0x39129b){const {connection:_0x5c96aa}=this['context']['plugins']['get'](n),_0x5e4a8c=this['context']['plugins']['get']('CommentsRepository'),_0x55cc59=this['_services']['get'](_0x39129b),_0x3759b3=await _0x55cc59['connect'](_0x5c96aa);await this['_fetchMissingUsersForThreads'](_0x3759b3);const _0x150abd=new Set(Array['from'](_0x5e4a8c['getCommentThreads']({'channelId':_0x39129b}),_0x1e17d9=>_0x1e17d9['id']));for(const _0xa000fb of _0x3759b3)_0xa000fb['deletedAt']||_0x150abd['delete'](_0xa000fb['commentThreadId']);for(const _0x851f15 of _0x150abd)_0x5e4a8c['getCommentThread'](_0x851f15)['remove']({'isFromAdapter':!0x0});for(const _0x111ed7 of _0x3759b3){let _0x20c3a3=_0x5e4a8c['getCommentThread'](_0x111ed7['commentThreadId']);const {commentThreadId:_0x598fd5,context:_0x54a038,attributes:_0x24d8cc,resolvedBy:_0x57c195,resolvedAt:_0x443f5d,unlinkedAt:_0x12d7c0,deletedAt:_0x3653b4}=_0x111ed7;if(_0x3653b4)continue;_0x20c3a3||(_0x20c3a3=_0x5e4a8c['addCommentThread']({'channelId':_0x39129b,'threadId':_0x598fd5,'context':_0x54a038,'attributes':_0x24d8cc||{},'resolvedBy':_0x57c195,'resolvedAt':_0x443f5d,'unlinkedAt':_0x12d7c0,'isFromAdapter':!0x0}));const _0x46213a=new Set(Array['from'](_0x20c3a3['comments'],_0x16d747=>_0x16d747['id']));for(const _0x5c1117 of _0x111ed7['comments'])_0x46213a['delete'](_0x5c1117['commentId']);for(const _0x44a8f6 of _0x46213a)_0x20c3a3['getComment'](_0x44a8f6)['remove']({'isFromAdapter':!0x0});for(const _0x53b737 of _0x111ed7['comments']){const _0x495dbe=_0x20c3a3['getComment'](_0x53b737['commentId']);_0x495dbe?_0x495dbe['content']!==_0x53b737['content']&&_0x495dbe['update']({'content':_0x53b737['content'],'isFromAdapter':!0x0}):_0x20c3a3['addComment'](Object['assign'](p(_0x53b737),{'isFromAdapter':!0x0}));}}}['_getService'](_0xbe9c9d){if(!this['_services']['has'](_0xbe9c9d))throw new _0x3433e1('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0xbe9c9d});return this['_services']['get'](_0xbe9c9d);}async['_fetchMissingUsersForThreads'](_0x4e8d4d){const _0x19d742=this['context']['plugins']['get'](_0x55636d),{connection:_0x1e2aab}=this['context']['plugins']['get'](n),_0x2b5065=new Set();for(const {resolvedBy:_0x268fb3,comments:_0x10d631}of _0x4e8d4d){_0x268fb3&&!_0x19d742['getUser'](_0x268fb3)&&_0x2b5065['add'](_0x268fb3);for(const {userId:_0x516ca8}of _0x10d631)_0x19d742['getUser'](_0x516ca8)||_0x2b5065['add'](_0x516ca8);}if(0x0===_0x2b5065['size'])return;const _0x53d64d=await lt['getMany'](_0x1e2aab,Array['from'](_0x2b5065));for(const _0x32513d of _0x53d64d)_0x19d742['getUser'](_0x32513d['id'])||_0x19d742['addUser'](_0x32513d);}}async function v(_0x3b5822){if('404'!==_0x3b5822['code'])throw _0x3b5822;}function dt(_0x4572c0){if((_0x5104f5=_0x4572c0)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x5104f5['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5104f5['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x5104f5;throw _0x4572c0;}function p(_0x440057){return{'threadId':_0x440057['commentThreadId'],'commentId':_0x440057['commentId'],'content':_0x440057['content'],'createdAt':_0x440057['createdAt'],'authorId':_0x440057['userId'],'attributes':_0x440057['attributes']||{}};}class m extends _0x1c1c75{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(_0x5f2a72){super(_0x5f2a72);const _0x2053f2=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x2053f2);}['init'](){const _0x3acb74=this['editor']['plugins']['get'](n),_0x5a66a1=this['editor']['plugins']['get']('TrackChangesEditing');return _0x5a66a1['adapter']={'getSuggestion':async _0x4aaea0=>{await this['_waitForServiceReady']();const _0xa73cfb=await this['_trackChangesService']['get'](_0x4aaea0)['catch'](A);return await this['_fetchMissingUsersForThreads']([_0xa73cfb]),_0xa73cfb;},'addSuggestion':async({id:_0x1d76d2,type:_0x1aab28,data:_0x170bed,originalSuggestionId:_0x47107f,attributes:_0x30acaa})=>{await this['_waitForServiceReady']();const _0xe7cb88={'id':_0x1d76d2,'type':_0x1aab28,'data':_0x170bed,'originalSuggestionId':_0x47107f,'attributes':_0x30acaa},_0x5697c6=await this['_trackChangesService']['add'](_0x1d76d2,_0x1aab28,_0x170bed,_0x47107f,_0x30acaa)['catch'](_0xcec085=>{if(ut(_0xcec085))return new Promise(_0x3edfd8=>{this['_bufferedRequests']['set'](_0x1d76d2,{'resolve':_0x3edfd8,'suggestionData':_0xe7cb88});});throw _0xcec085;});return this['_bufferedRequests']['delete'](_0x1d76d2),_0x5697c6;},'updateSuggestion':async(_0x4e1ea2,_0x27ad4e)=>{if(await this['_waitForServiceReady'](),'open'!==_0x27ad4e['state'])return this['_trackChangesService']['update'](_0x4e1ea2,_0x27ad4e)['catch'](A);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x13e9ea,_0x1b05c1)=>{_0x5a66a1['hasSuggestion'](_0x1b05c1['id'])&&(_0x5a66a1['getSuggestion'](_0x1b05c1['id'])['attributes']=_0x1b05c1['attributes']);}),this['_trackChangesService']['connect'](_0x3acb74['connection'])['then'](_0x358eee=>(_0x3acb74['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x358eee)['then'](()=>{for(const _0x48ae86 of _0x358eee){_0x5a66a1['addSuggestionData'](_0x48ae86)['_saved']=!0x0;}})));}async['reconnect'](){const _0x3d4abc=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x187732}=this['editor']['plugins']['get'](n),_0x3a8c59=await this['_trackChangesService']['connect'](_0x187732);await this['_fetchMissingUsersForThreads'](_0x3a8c59);for(const {suggestionData:_0x2a4c16,resolve:_0x584673}of this['_bufferedRequests']['values']()){let _0x236131=_0x3a8c59['find'](_0x94292d=>_0x94292d['id']===_0x2a4c16['id']);_0x236131||(_0x236131=await this['_trackChangesService']['add'](_0x2a4c16['id'],_0x2a4c16['type'],_0x2a4c16['data'],_0x2a4c16['originalSuggestionId'])),_0x584673(_0x236131);}for(const _0x5697e4 of _0x3a8c59)_0x3d4abc['hasSuggestion'](_0x5697e4['id'])||_0x3d4abc['addSuggestionData'](_0x5697e4);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x37832e=>{this['listenTo'](this['_trackChangesService'],'connected',_0x1e27d0=>{_0x1e27d0['off'](),_0x37832e();});});}async['_fetchMissingUsersForThreads'](_0x1f10f9){const _0x1c9cd6=this['editor']['plugins']['get'](_0x55636d),{connection:_0x5b7cfe}=this['editor']['plugins']['get'](n),_0x53b173=new Set();for(const {authorId:_0x104f77}of _0x1f10f9)_0x1c9cd6['getUser'](_0x104f77)||_0x53b173['add'](_0x104f77);if(0x0===_0x53b173['size'])return;const _0x5e04f3=await lt['getMany'](_0x5b7cfe,Array['from'](_0x53b173));for(const _0xc5ce59 of _0x5e04f3)_0x1c9cd6['getUser'](_0xc5ce59['id'])||_0x1c9cd6['addUser'](_0xc5ce59);}}function A(_0x517cfb){if(ut(_0x517cfb))return new Promise(()=>{});throw _0x517cfb;}function ut(_0x1122a3){return _0x1122a3['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1122a3['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x1c1c75{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 _0x4b26fc=this['editor']['plugins']['get'](n),_0x55d7be=this['editor']['plugins']['get']('CommentsEditing'),_0x42b76d=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x4b26fc,'change:state',(_0x5a7752,_0xd6f15e,_0x490eeb)=>{_0x55d7be['isThreadsLoadingPaused']='connected'!==_0x490eeb;});}),this['listenTo'](_0x4b26fc,'change:state',(_0x4a0e84,_0x2e81df,_0x56ac5b)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x56ac5b);}),_0x42b76d['_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 _0x1c1c75{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 _0x1c1c75{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
- ((()=>it)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x55636d];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x107335){super(_0x107335);const _0xec8672=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0xec8672);}async['init'](){const _0x35e612=this['editor']['plugins']['get'](l),_0x1351f6=_0x35e612['serverHistory'],_0x4050f6=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x1351f6,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x35e612['sessionId']});const _0x52f877=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x1b81c3=await tt['isBundleUploaded'](_0x4050f6['connection'],_0x52f877);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x583588})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x583588)),'updateRevisions':async _0x16bb82=>{await this['_waitForServiceReady']();const _0x1c4193=this['_revisionTracker']['currentRevision'];if(_0x1b81c3&&0x1===_0x16bb82['length']&&_0x16bb82[0x0]['id']===_0x1c4193['id'])return _0x16bb82;for(const _0x5eae18 of _0x16bb82)_0x5eae18['id']===_0x1c4193['id']&&(_0x5eae18['isEmptyCurrent']=_0x5eae18['fromVersion']===_0x5eae18['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x16bb82,this['_lastRequestId'])['then'](_0x548af9=>(this['_lastRequestId']=_0x548af9,_0x16bb82))['catch'](_0x4d3b41=>{if(st(_0x4d3b41)||'400'===_0x4d3b41['code']&&void 0x0!==_0x4d3b41['data']['wrongRequestId']){for(const _0x2e221e of _0x16bb82){!this['_revisionTracker']['repository']['getRevision'](_0x2e221e['id'])||this['_revisionTracker']['_bufferUpdate'](_0x2e221e['id'],_0x2e221e,!0x1);}if(st(_0x4d3b41))throw _0x4d3b41;return _0x16bb82;}throw _0x4d3b41;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x36e9cc,{revisionsData:_0x326489,requestId:_0x36ccdb})=>{Math['max'](..._0x326489['map'](_0x2f1b4b=>_0x2f1b4b['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x326489,_0x36ccdb);}):this['_handleRevisionsUpdate'](_0x326489,_0x36ccdb);});const {revisions:_0x57b5a3,requestId:_0x248b4e}=await this['_revisionHistoryService']['connect'](_0x4050f6['connection']);_0x4050f6['addToReconnectionStack'](this),this['_lastRequestId']=_0x248b4e,await this['_fetchMissingUsers'](_0x57b5a3);for(const _0x2c59e1 of _0x57b5a3)this['_revisionTracker']['addRevisionData'](_0x2c59e1);this['listenTo'](_0x35e612,'change:_isConnected',(_0x588826,_0x2b8a74,_0x399de5)=>{_0x399de5&&(this['_oldOffset']=_0x35e612['_offset'],_0x588826['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x4050f6,'state',_0x58a709=>_0x58a709===te['CONNECTED']);}async['reconnect'](){const _0x3d7ff5=this['editor']['plugins']['get'](n),_0x51ea33=this['editor']['plugins']['get'](l),_0x2f94e2=async()=>{const _0x71d6a1=this['_revisionTracker']['currentRevision'],_0x5ac6dc=_0x71d6a1['id'],_0xb03446=_0x5ac6dc!==_0x51ea33['sessionId'];if(_0xb03446){const _0x11fdf1=_0x51ea33['_offset']-this['_oldOffset'],_0x3a02f9=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x71d6a1['toVersion']+_0x11fdf1!==_0x3a02f9){const _0x554421=_0x71d6a1['fromVersion']+_0x11fdf1,_0x207d66=this['editor']['plugins']['get'](_0x55636d),_0xf3d764=this['_revisionTracker']['buildRevisionData']({'revision':_0x71d6a1,'from':_0x554421,'to':_0x3a02f9});_0xf3d764['id']=_0x71d6a1['id'];const _0x4aac29=_0xf3d764['authorsIds']['map'](_0x478db4=>_0x207d66['getUser'](_0x478db4));_0x71d6a1['_update']({..._0xf3d764,'authors':_0x4aac29},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x71d6a1['id'],_0xf3d764,!0x0);}this['_revisionTracker']['_startingVersion']=_0x3a02f9,(_0x71d6a1['toVersion']===_0x71d6a1['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x5ac6dc)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x5ac6dc),this['_revisionTracker']['_createCurrentRevision'](_0x3a02f9));}const {revisions:_0x2b98cf,requestId:_0x18718e}=await this['_revisionHistoryService']['reconnect'](_0x3d7ff5['connection'],this['_lastRequestId']);_0xb03446&&_0x2b98cf['length']>0x0?_0x51ea33['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x2b98cf),this['_handleRevisionsUpdate'](_0x2b98cf,_0x18718e),this['_revisionTracker']['sendBufferedUpdates']());};return _0x51ea33['_isConnected']?_0x2f94e2():new Promise((_0x50e521,_0xb2fe0)=>{_0x51ea33['once']('change:_isConnected',()=>{_0x2f94e2()['then'](_0x50e521)['catch'](_0xb2fe0);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x5db177=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3199b0=>{_0x3199b0['off'](),_0x5db177();});});}['_getLatestVersionFromServerOperations'](){const _0x2f6b8b=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x1aaf9a of _0x2f6b8b)if('marker'!==_0x1aaf9a['type']||_0x1aaf9a['affectsData'])return _0x1aaf9a['baseVersion']+0x1;}['_getLatestVersion'](){const _0x1c8e41=this['editor']['plugins']['get'](l);return new Promise(_0x278e9b=>{_0x1c8e41['_isPendingUpdate']?_0x1c8e41['once']('change:_isPendingUpdate',()=>{_0x278e9b(this['_getLatestVersionFromServerOperations']());}):_0x278e9b(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0xefbf8e,_0x497890){const _0x25c095=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x497890;for(const _0x2c8773 of _0xefbf8e){const _0x4f8a48=_0x25c095['getRevision'](_0x2c8773['id']);if(_0x4f8a48){if((_0x2c8773['fromVersion']||_0x2c8773['toVersion'])&&(_0x2c8773['diffData']=null),_0x4f8a48===this['_revisionTracker']['currentRevision']){const _0x3ae643=Math['max'](_0x4f8a48['toVersion'],_0x2c8773['toVersion']),_0x5944f5=Math['max'](_0x4f8a48['fromVersion'],_0x2c8773['fromVersion']);let _0x4a81d7;_0x4f8a48['toVersion']===_0x2c8773['toVersion']&&_0x4f8a48['fromVersion']===_0x2c8773['fromVersion']?(_0x4a81d7=!0x0,this['_preventResendingRevisionData'](_0x2c8773)):_0x2c8773['toVersion']===_0x3ae643&&_0x2c8773['fromVersion']===_0x5944f5?_0x4a81d7=!0x1:(_0x4f8a48['toVersion']===_0x3ae643&&_0x4f8a48['fromVersion']===_0x5944f5||this['_fixRevision']({'revision':_0x4f8a48,'from':_0x5944f5,'to':_0x3ae643}),_0x4a81d7=!0x0),_0x4a81d7&&(delete _0x2c8773['fromVersion'],delete _0x2c8773['toVersion'],delete _0x2c8773['diffData'],delete _0x2c8773['createdAt'],delete _0x2c8773['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x2c8773),this['_preventResendingRevisionData'](_0x2c8773);}else this['_revisionTracker']['addRevisionData'](_0x2c8773);}const _0x3c10ed=_0x25c095['getRevisions']();_0x3c10ed['reverse']();for(let _0x5e0870=0x0;_0x5e0870<_0x3c10ed['length']-0x1;_0x5e0870++){const _0x2e5d02=_0x3c10ed[_0x5e0870],_0x417ada=_0x3c10ed[_0x5e0870+0x1];if(_0x2e5d02['fromVersion']<_0x417ada['toVersion']){const _0x5cc740=_0x417ada['toVersion'],_0x39599b=Math['max'](_0x5cc740,_0x2e5d02['toVersion']);this['_fixRevision']({'revision':_0x2e5d02,'from':_0x5cc740,'to':_0x39599b});}}}['_fixRevision']({revision:_0x881f1f,from:_0x49f9e8,to:_0x4a1125}={}){const _0x29460e=this['editor']['plugins']['get'](_0x55636d),_0x14fe26=this['_revisionTracker']['buildRevisionData']({'revision':_0x881f1f,'from':_0x49f9e8,'to':_0x4a1125});_0x14fe26['authors']=_0x14fe26['authorsIds']['map'](_0x446da2=>_0x29460e['getUser'](_0x446da2)),_0x881f1f['_update'](_0x14fe26);}['_preventResendingRevisionData'](_0x520b5f){const _0x392b8a={};_0x392b8a['id']=_0x520b5f['id'];for(const _0x341388 of Object['keys'](_0x520b5f))'id'!==_0x341388&&(_0x392b8a[_0x341388]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0x392b8a['id'],_0x392b8a,!0x0);}async['_fetchMissingUsers'](_0x5e7f05){const _0xa34544=this['editor']['plugins']['get'](_0x55636d),{connection:_0x28868d}=this['editor']['plugins']['get'](n),_0x310c4c=new Set();for(const _0x5e323b of _0x5e7f05){for(const _0x451740 of _0x5e323b['authorsIds'])_0x100727(_0x451740);_0x5e323b['creatorId']&&_0x100727(_0x5e323b['creatorId']);}if(0x0===_0x310c4c['size'])return;const _0x3d9abc=await lt['getMany'](_0x28868d,Array['from'](_0x310c4c));for(const _0x2e65f2 of _0x3d9abc)_0xa34544['getUser'](_0x2e65f2['id'])||_0xa34544['addUser'](_0x2e65f2);function _0x100727(_0x2519a1){_0xa34544['getUser'](_0x2519a1)||_0x310c4c['add'](_0x2519a1);}}}function st(_0x1855e0){return _0x1855e0['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x1855e0['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x1855e0['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class mt extends _0x1c1c75{static get['requires'](){return['RevisionHistory',c,a];}static get['pluginName'](){return'RealTimeCollaborativeRevisionHistory';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class y extends _0x12ac9c{['_collapseAt'];constructor(_0x20e219,_0x514c75=0x6){super(_0x20e219);const _0x2f7cd5=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x514c75,this['bind']('isHidden')['to'](this,'usersCount',_0x22fa7a=>_0x22fa7a<_0x514c75),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x2f7cd5['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':_0x2f7cd5['to']('usersCount',_0x8af9b9=>'+'+(_0x8af9b9-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0x12ac9c{['items'];['keystrokes'];constructor(_0x3e0831){super(_0x3e0831);const _0x58e768=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x1ecd8b(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x58e768['if']('hasPopup'),'aria-expanded':_0x58e768['to']('isExpanded',_0x5580d8=>this['hasPopup']&&String(_0x5580d8)),'aria-label':_0x58e768['to']('hasPopup',_0x4c9107=>W(_0x3e0831,_0x4c9107?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x58e768['to']('hasPopup',_0x3296dd=>!!_0x3296dd&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x58e768['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x58e768['to'](_0x175ac9=>{const _0x1d8480=_0x175ac9,_0x294c77=document['querySelector']('.ck-presence-list__dropdown-list'),_0x35c848=document['querySelector']('.ck-balloon-panel_with-arrow');_0x294c77?.['contains'](_0x1d8480['relatedTarget'])||_0x35c848?.['contains'](_0x1d8480['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0xbaad9b,_0x45ba05,_0x4015c3)=>{this['element']&&(_0x4015c3?this['element']['setAttribute']('aria-expanded',String(this['isExpanded'])):this['element']['removeAttribute']('aria-expanded'));});}['focus'](){this['element']['focus']();}['render'](){super['render'](),this['keystrokes']['listenTo'](this['element']);}}class k extends _0x12ac9c{['counterView'];['inlineListView'];constructor(_0x329d77,_0x46da77=0x6){super(_0x329d77);const _0x2701a9=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new y(this['locale'],_0x46da77),this['inlineListView']=new is(_0x329d77),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0xb42ed2 of this['inlineListView']['items'])_0xb42ed2['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',_0x2701a9['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class C extends _0x12ac9c{['listWrapperView'];constructor(_0x2a831d,_0x5bb2d1){super(_0x2a831d);const _0x8ec87f=this['bindTemplate'];this['listWrapperView']=new pt(_0x2a831d,_0x5bb2d1),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':W(_0x2a831d,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x8ec87f['to'](_0x4a9922=>{const _0x2b6824=_0x4a9922,_0x5cfb5f=document['querySelector']('.ck-presence-list__list'),_0x278013=document['querySelector']('.ck-balloon-panel_with-arrow');_0x5cfb5f?.['contains'](_0x2b6824['relatedTarget'])||_0x278013?.['contains'](_0x2b6824['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class pt extends _0xf50aa7{constructor(_0x520cd7,_0x48aa55){super(_0x520cd7);const _0x26d313=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x48aa55?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x26d313['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x26d313['to']('role'),'aria-label':_0x26d313['to']('ariaLabel'),'aria-labelledby':_0x26d313['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x965aaf['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x5ae588=this['element'];_0x5ae588&&(this['_isScrollable']=Math['max'](_0x5ae588['scrollHeight'],_0x5ae588['clientHeight'])>0.8*window['innerHeight']);}}class P extends rt{['userView'];constructor(_0x468994,_0x1b983c,_0x37f94f){super(_0x468994);const _0x2696ae=this['bindTemplate'];this['userView']=new ct(_0x468994,_0x1b983c);const _0x29f06d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x1b983c['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x1b983c['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1b983c['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x37f94f&&(_0x29f06d['tag']='button',_0x29f06d['on']={'click':_0x2696ae['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x29f06d);}['focus'](){this['element']['focus']();}}class _ extends _0x12ac9c{['userView'];['markerView'];constructor(_0x225035,_0x4c090b,_0x45ad83){super(_0x225035);const _0x182733=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new ct(_0x225035,_0x4c090b),this['markerView']=new at(_0x225035,_0x4c090b);const _0x489b69=new ot(_0x225035);_0x489b69['template']['tag']='span',_0x489b69['text']=_0x4c090b['name'];const _0x20762c={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x182733['to']('isFocusable',_0x1a0795=>!!_0x1a0795&&0x0),'aria-labelledby':_0x489b69['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x182733['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x182733['to']('hasTooltip',_0x293ea0=>!_0x293ea0),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x489b69]};_0x45ad83&&(_0x20762c['tag']='button',_0x20762c['on']={'click':_0x182733['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x20762c);}}class at extends _0x12ac9c{constructor(_0x5c1da9,_0x45af99){super(_0x5c1da9),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x45af99['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const U={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x130049{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x12b1c6){super(_0x12b1c6),this['context']['config']['define']('presenceList',U);const _0x4d0234=_0x12b1c6['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x4d0234)throw new _0x3433e1('presencelist-collapseat-invalid-format',this);if(_0x4d0234<0x1)throw new _0x3433e1('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x450339(),this['balloonPanelView']=new _0x173b11(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x389da5 of this['_allConnectedUsers'])this['_handleUserAdd'](_0x389da5);this['listenTo'](this['_allConnectedUsers'],'add',(_0x56698a,_0x29fa46)=>{this['_handleUserAdd'](_0x29fa46);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x5b789e,_0x5f4b19)=>{this['_handleUserRemove'](_0x5f4b19);});}['_createView'](){const _0x375f11=this['context'],_0x22e5ed=new k(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x4db135=this['balloonPanelView'];if(!_0x5c7686(_0x375f11['config']['get']('presenceList.container')))throw new _0x3433e1('presencelist-missing-container',this);return _0x22e5ed['counterView']['bind']('usersCount')['to'](this),_0x22e5ed['bind']('isCollapsed')['to'](this,'usersCount',_0x368782=>{const {collapseAt:_0x483a98}=_0x375f11['config']['get']('presenceList'),_0x1c6e66=_0x368782>=_0x483a98;if(_0x1c6e66&&!_0x22e5ed['inlineListView']['items']['find'](_0x456bb4=>_0x456bb4 instanceof y)){const _0x308c85=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x308c85&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x22e5ed['inlineListView']['items']['add'](_0x22e5ed['counterView']);}return _0x1c6e66||this['hideDropdown'](),_0x1c6e66;}),_0x22e5ed['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0xe2f48=>{const _0x27257f=_0x375f11['config']['get']('presenceList'),_0x3c499a=new _(_0x375f11['locale'],_0xe2f48,!!_0x27257f['onClick']);return _0x3c499a['bind']('hasTooltip')['to'](_0x22e5ed,'isCollapsed',_0x3bd145=>!_0x3bd145),_0x3c499a['bind']('isFocusable')['to'](_0x22e5ed,'isCollapsed',_0x277a3b=>!_0x277a3b),_0x27257f['onClick']&&this['listenTo'](_0x3c499a,'execute',()=>{this['view']['isCollapsed']||_0x27257f['onClick'](_0xe2f48,_0x3c499a['element']);}),_0x3c499a;}),this['listenTo'](_0x22e5ed['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x22e5ed['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x22e5ed['inlineListView']['keystrokes']['set']('Enter',(_0xcff2ab,_0x5a7a81)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x5a7a81());}),_0x22e5ed['render'](),_0x4db135['render'](),_0x38afdf({'emitter':_0x22e5ed,'activator':()=>_0x4db135['isVisible'],'contextElements':[_0x4db135['element'],_0x22e5ed['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x375f11['config']['get']('presenceList.container')['appendChild'](_0x22e5ed['element']),this['_bodyCollection']=new _0x35c9fd(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x22e5ed;}['_handleUserAdd'](_0x2ee2c9){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x2ee2c9['isMe'])return;const _0x4610eb=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x4610eb-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0x445189=_0x2ee2c9['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x2ee2c9,_0x445189);}['_handleUserRemove'](_0x3a31b0){this['usersCount']--;const {collapseAt:_0x15a416}=this['context']['config']['get']('presenceList'),_0x412029=this['usersCount']>=_0x15a416;if(this['currentDisplayedUsers']['get'](_0x3a31b0['id']))this['currentDisplayedUsers']['remove'](_0x3a31b0['id']);else{if(_0x412029&&this['currentDisplayedUsers']['length']+0x1===_0x15a416-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x412029?0x1:0x0)<this['usersCount']){for(const _0x54012e of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x54012e['id'])&&(this['currentDisplayedUsers']['add'](_0x54012e,Math['min'](this['currentDisplayedUsers']['length']-(_0x412029?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x412029?0x1:0x0)===_0x15a416-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x39ef64=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new C(this['context']['locale'],!!_0x39ef64['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x3a82f9}=this['presenceDropdownView'];_0x3a82f9['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x4d20ec=>{if(!_0x39ef64['displayMe']&&_0x4d20ec['isMe'])return null;const _0x44b8fc=new P(this['context']['locale'],_0x4d20ec,!!_0x39ef64['onClick']);return _0x39ef64['onClick']&&this['listenTo'](_0x44b8fc,'execute',()=>{_0x39ef64['onClick'](_0x4d20ec,_0x44b8fc['element']);}),_0x44b8fc;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x3a82f9['focus'](),_0x3a82f9['checkIfScrollable']();const _0x5d496d=(_0x10c271,_0x11cb9e)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0x11cb9e();};_0x3a82f9['keystrokes']['set']('Esc',_0x5d496d),_0x3a82f9['keystrokes']['set']('Shift+Tab',_0x5d496d),_0x3a82f9['keystrokes']['set']('Tab',(_0x492172,_0xdf7858)=>{!function(_0x1a63f1){const _0xe1b5d4=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x3a5b87=>_0x3a5b87+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0xcd7ee0=[...document['body']['querySelectorAll'](_0xe1b5d4)]['filter'](_0x5350d7=>_0x5350d7===document['activeElement']||_0x5350d7['offsetWidth']+_0x5350d7['offsetHeight']>0x0)['sort']((_0x53f0b7,_0x1b5382)=>(_0x53f0b7['tabIndex']||0x0)-(_0x1b5382['tabIndex']||0x0)),_0x4a55ec=_0xcd7ee0['indexOf'](_0x1a63f1),_0x3dc4d2=_0xcd7ee0[(_0x4a55ec+0x1)%_0xcd7ee0['length']];_0x3dc4d2&&_0x3dc4d2['focus']();}(this['view']['element']),this['hideDropdown'](),_0xdf7858();}),_0x3a82f9['focusTracker']['add'](this['view']['element']),_0x3a82f9['focusTracker']['on']('change:isFocused',(_0x604688,_0x4ed91a,_0x2844b1)=>{_0x2844b1||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 _0x130049{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 _0x13341e,Plugin as _0x5646ee,PendingActions as _0x3ad957,Context as _0x113706}from'@ckeditor/ckeditor5-core/dist/index.js';import{DomEmitterMixin as _0x13df65,CKEditorError as _0x2c9c89,Collection as _0x5a7f2a,global as _0x24b4b2,version as nt,uid as _0x3f1013,KeystrokeHandler as _0x2a54a2}from'@ckeditor/ckeditor5-utils/dist/index.js';import{Notification as _0x398e75,View as _0xcfa12d,ListView as _0x42b975,ListItemView as et,LabelView as it,BalloonPanelView as _0x142816,clickOutsideHandler as _0x33d711,BodyCollection as _0x39c268}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ModelLiveRange as _0x44b6f7,History as _0x272180,NoOperation as _0x73bafe,InsertOperation as _0x38092f,MarkerOperation as _0x46ffd6,RootAttributeOperation as _0x5c8512,transformOperationSets as _0x3dce07,OperationFactory as _0xf26799}from'@ckeditor/ckeditor5-engine/dist/index.js';import{WebSocketGateway as rt,WEB_SOCKET_GATEWAY_STATES as _0x43ade7,CollaborativeEditingService as _0xe6012e,User as ct,CommentsService as _0x144d71,TrackChangesService as _0x3ad8a1,RevisionHistoryService as _0x4b290b,EditorService as _0x58ca67}from'@ckeditor/ckeditor-cloud-services-collaboration/dist/index.js';import{Users as _0x492d3c,UserView as st}from'ckeditor5-collaboration/dist/index.js';import{Compressor as _0x1faead}from'@ckeditor/ckeditor5-operations-compressor/dist/index.js';import{isElement as _0x555b4d}from'es-toolkit/compat';class n extends _0x13341e{static ['WebSocketGateway']=/* #__PURE__ -- @preserve */
24
+ ((()=>rt)());static ['initialReconnectionInterval']=0x3e8;['connection'];['_reconnectionStack'];['_shouldPluginsReconnect'];['_domEmitter'];static get['requires'](){return['CloudServices',_0x398e75];}static get['pluginName'](){return'WebSocketGateway';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3cc12f){super(_0x3cc12f),this['set']('state',_0x43ade7['CONNECTED']),this['set']('_isBrowserOffline',!0x1),this['_reconnectionStack']=new Set(),this['_shouldPluginsReconnect']=!0x1,this['_domEmitter']=new(_0x13df65())();}['init'](){const _0x4f846f=this['context'],_0x1e1b2b=_0x4f846f['plugins']['get']('CloudServices'),_0x23f4fa=_0x4f846f['plugins']['get'](_0x398e75);if(!_0x1e1b2b['token'])throw new _0x2c9c89('websocketgateway-missing-token',this);if(!_0x1e1b2b['webSocketUrl'])throw new _0x2c9c89('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'](_0x1e1b2b['token'],_0x1e1b2b['webSocketUrl'],{'timeout':0x3e8*this['context']['config']['get']('cloudServices.connectionTimeout'),'requestTimeout':0x3e8*this['context']['config']['get']('cloudServices.requestTimeout')})['then'](_0x4f9b47=>{if(this['connection']=_0x4f9b47,this['bind']('state')['to'](_0x4f9b47,'state',this,'_isBrowserOffline',(_0x526713,_0x293b6d)=>('connected'!==_0x526713&&(this['_shouldPluginsReconnect']=!0x0),_0x293b6d||_0x526713!==_0x43ade7['CONNECTED']?_0x43ade7['DISCONNECTED']:this['state']==_0x43ade7['DISCONNECTED']&&this['_shouldPluginsReconnect']?(this['_shouldPluginsReconnect']=!0x1,this['_reconnect'](),_0x43ade7['CONNECTING']):_0x43ade7['CONNECTED'])),this['connection']['on']('error',(_0x3071f7,_0x4d62b0)=>{if('limitExceeded'!==_0x4d62b0['code'])throw console['error'](_0x4d62b0),new _0x2c9c89('cloudservices-init',null,{'originalError':_0x4d62b0});_0x23f4fa['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'});}),!_0x4f9b47['me'])return new Promise(_0x537e76=>_0x4f9b47['on']('change:me',_0x537e76));})['catch'](_0x5b4a4f=>{throw console['error'](_0x5b4a4f),new _0x2c9c89('cloudservices-init',null,{'originalError':_0x5b4a4f});});}['addToReconnectionStack'](_0x5c2c3c){if('function'!=typeof _0x5c2c3c['reconnect'])throw new _0x2c9c89('websocketgateway-invalid-plugin-interface',this);if(this['isInReconnectionStack'](_0x5c2c3c))throw new _0x2c9c89('websocketgateway-plugin-already-registered',this,{'name':_0x5c2c3c['constructor']['pluginName']});this['_reconnectionStack']['add'](_0x5c2c3c);}['removeFromReconnectionStack'](_0x2a519d){this['_reconnectionStack']['delete'](_0x2a519d);}['isInReconnectionStack'](_0x282a4e){return this['_reconnectionStack']['has'](_0x282a4e);}['_reconnect'](){return this['connection']['reconnect']()['then'](()=>Promise['all'](Array['from'](this['_reconnectionStack'],_0x33d892=>_0x33d892['reconnect']())))['then'](()=>this['state']=_0x43ade7['CONNECTED'])['catch'](_0x101652=>{throw console['error'](_0x101652),new _0x2c9c89('cloudservices-reconnection-error',this['context']);});}['disconnect'](){this['connection']&&this['connection']['disconnect'](),this['state']=_0x43ade7['DISCONNECTED'],this['_domEmitter']['stopListening']();}['destroy'](){this['disconnect'](),super['destroy']();}}class i extends _0x13341e{['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,_0x492d3c];}constructor(_0x192c10){super(_0x192c10),this['channelSessions']=new Map(),this['channelConnectedUsers']=new Map(),this['allConnectedUsers']=new _0x5a7f2a(),this['_registeredSessions']=new Map(),this['_uniqueUsersCount']=0x0,this['_users']=this['context']['plugins']['get'](_0x492d3c);}['init'](){const _0x5844a3=this['context']['plugins']['get'](n);this['listenTo'](_0x5844a3,'change:state',(_0x2d8d4d,_0xc40cc0,_0x3f5f0f)=>{if('connected'!==_0x3f5f0f)this['channelSessions']['forEach'](_0xe2faa8=>_0xe2faa8['clear']()),this['channelConnectedUsers']['forEach'](_0x1fd40f=>_0x1fd40f['clear']()),this['allConnectedUsers']['clear']();else{for(const [_0x267055,_0x35702c]of this['_registeredSessions'])for(const _0x388ed3 of _0x35702c)this['_handleSessionAdd'](_0x267055,_0x388ed3);}}),this['_createUser'](_0x5844a3['connection']['me'],!0x0);}['register'](_0x575f15,_0x2ca38f){if(this['_registeredSessions']['has'](_0x575f15))throw new _0x2c9c89('sessions-register-already-registered',null,{'channelId':_0x575f15});this['_registeredSessions']['set'](_0x575f15,_0x2ca38f),this['channelSessions']['set'](_0x575f15,new _0x5a7f2a()),this['channelConnectedUsers']['set'](_0x575f15,new _0x5a7f2a()),this['listenTo'](_0x2ca38f,'add',(_0x44ed5a,_0x503a3a)=>this['_handleSessionAdd'](_0x575f15,_0x503a3a)),this['listenTo'](_0x2ca38f,'remove',(_0x48ad1a,_0x1fdef4)=>this['_handleSessionRemove'](_0x575f15,_0x1fdef4));for(const _0x541d51 of _0x2ca38f)this['_handleSessionAdd'](_0x575f15,_0x541d51);}['unregister'](_0x451b5c){if(!this['_registeredSessions']['has'](_0x451b5c))throw new _0x2c9c89('sessions-unregister-not-exist',null,{'channelId':_0x451b5c});const _0x1cf26e=this['_registeredSessions']['get'](_0x451b5c);this['stopListening'](_0x1cf26e);for(const _0x99fcb8 of _0x1cf26e)'connected'===this['context']['plugins']['get'](n)['state']&&this['_handleSessionRemove'](_0x451b5c,_0x99fcb8);this['_registeredSessions']['delete'](_0x451b5c),this['channelSessions']['delete'](_0x451b5c),this['channelConnectedUsers']['delete'](_0x451b5c);}get['mySessionId'](){return this['context']['plugins']['get'](n)['connection']['sessionId'];}['getUserBySessionId'](_0x27b50f){for(const _0x5ed33d of this['channelSessions']['values']())for(const _0xc19751 of _0x5ed33d)if(_0xc19751['id']===_0x27b50f)return _0xc19751['user'];}['getUserSessions'](_0x214ee9,_0x2d7460){const _0x53cfd9=_0x2d7460?[this['channelSessions']['get'](_0x2d7460)]:this['channelSessions']['values'](),_0x3808ee=new Set();for(const _0x26c94f of _0x53cfd9)for(const _0x305b6d of _0x26c94f)_0x305b6d['user']['id']===_0x214ee9['id']&&_0x3808ee['add'](_0x305b6d['id']);return _0x3808ee;}['getUserRole'](_0x5e2890){for(const _0x559b74 of this['channelSessions']['values']())for(const _0x12ccc6 of _0x559b74)if(_0x12ccc6['user']===_0x5e2890)return _0x12ccc6['role'];}['_handleSessionAdd'](_0x407d4e,_0x237433){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x5f16a=_0x237433['user'],_0x4c29f0=this['_users']['getUser'](_0x5f16a['id'])||this['_createUser'](_0x5f16a),_0x1978a0=Object['assign']({},_0x237433,{'user':_0x4c29f0});this['channelSessions']['get'](_0x407d4e)['add'](_0x1978a0);const _0xb669f7=this['channelConnectedUsers']['get'](_0x407d4e);_0xb669f7['has'](_0x4c29f0['id'])||_0xb669f7['add'](_0x4c29f0),this['allConnectedUsers']['has'](_0x4c29f0['id'])||this['allConnectedUsers']['add'](_0x4c29f0,_0x4c29f0['isMe']?0x0:void 0x0),this['fire']('sessionAdd:'+_0x407d4e,{'channelId':_0x407d4e,'session':_0x1978a0});}['_handleSessionRemove'](_0x148aba,_0xe56583){if('connected'!==this['context']['plugins']['get'](n)['state'])return;const _0x5dd307=this['channelConnectedUsers']['get'](_0x148aba),_0x40bf11=_0xe56583['user'];_0x40bf11['id']&&(this['channelSessions']['get'](_0x148aba)['remove'](_0xe56583['id']),_0x5dd307['has'](_0x40bf11['id'])&&!this['getUserSessions'](_0x40bf11,_0x148aba)['size']&&_0x5dd307['remove'](_0x40bf11['id']),this['allConnectedUsers']['get'](_0x40bf11['id'])&&!this['getUserSessions'](_0x40bf11)['size']&&this['allConnectedUsers']['remove'](_0x40bf11['id']));}['_createUser'](_0x253e1a,_0x5e46c3){const _0x341332=this['_users']['addUser'](_0x253e1a);return _0x5e46c3&&this['_users']['defineMe'](_0x253e1a['id']),_0x341332['orderNumber']=this['_uniqueUsersCount']++,_0x341332;}}class $ extends _0x5646ee{['_domEmitter']=new(_0x13df65())();static get['requires'](){return[i];}static get['pluginName'](){return'UserMarkers';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x4b3d32=this['editor'],_0x47d06e=_0x4b3d32['plugins']['get'](i);_0x4b3d32['conversion']['for']('editingDowncast')['markerToElement']({'model':'user:position','view':(_0xb7fc,{writer:_0x11cb3e})=>function(_0x143773,_0x491400,_0x5867bc,_0x3fc8c6){const _0x586da4=_0x143773['markerName']['split'](':')[0x2],_0x3f06b3=_0x5867bc['getUserBySessionId'](_0x586da4);if(!_0x3f06b3||_0x586da4===_0x5867bc['mySessionId'])return;if(!_0x3fc8c6['model']['schema']['checkChild'](_0x143773['markerRange']['start'],'$text'))return;const _0xa98c5f={'class':'ck-user__marker\x20'+_0x3f06b3['color']['getMarkerClass'](),'data-name':_0x3f06b3['name'],'data-session-id':_0x586da4},_0x39c1de=_0x3fc8c6['model']['markers']['get'](_0x143773['markerName']),_0x31cca4=_0x39c1de['getStart'](),_0x37d275=_0x31cca4['nodeAfter'],_0x150f05=_0x3fc8c6['model']['schema'];if(_0x37d275&&_0x150f05['isObject'](_0x37d275)&&_0x150f05['isInline'](_0x37d275)&&!_0x3fc8c6['model']['markers']['get']('user:range:'+_0x586da4)['getRange']()['isCollapsed'])return;const _0x21c5ae=_0x31cca4['parent'];return _0x3fc8c6['model']['schema']['isLimit'](_0x21c5ae)&&!_0x3fc8c6['model']['hasContent'](_0x21c5ae)&&(_0xa98c5f['contenteditable']=!0x1),function(_0x2d3c40,_0x591dfe,_0x47b649){const _0x29391c=_0x2d3c40['createUIElement']('span',_0x591dfe);return _0x2d3c40['setCustomProperty']('userPositionMarker',!0x0,_0x29391c),_0x29391c['render']=function(_0x30e5e6){const _0x47f966=this['toDomElement'](_0x30e5e6),_0x433e23=document['createElement']('span');return _0x433e23['classList']['add']('ck-user__marker-tooltip'),_0x433e23['setAttribute']('contenteditable','false'),_0x433e23['setAttribute']('spellcheck','false'),_0x433e23['textContent']=_0x47b649['name'],_0x47f966['innerHTML']='⁠<span\x20class=\x22ck-user__marker-line\x22\x20contenteditable=\x22false\x22><span\x20class=\x22ck-user__marker-dot\x22></span></span>'+_0x433e23['outerHTML']+'⁠',_0x47f966['addEventListener']('mouseenter',()=>{_0x47f966['classList']['add']('ck-user__marker_hovered');}),_0x47f966['addEventListener']('mouseleave',()=>{_0x47f966['classList']['remove']('ck-user__marker_hovered');}),_0x47f966;},_0x29391c['isSimilar']=function(_0x3a16d3){return!(!this['getCustomProperty']('userPositionMarker')||!_0x3a16d3['getCustomProperty']('userPositionMarker')||this['getAttribute']('data-session-id')!=_0x3a16d3['getAttribute']('data-session-id'));},_0x29391c;}(_0x491400,_0xa98c5f,_0x3f06b3);}(_0xb7fc,_0x11cb3e,_0x47d06e,_0x4b3d32)}),_0x4b3d32['conversion']['for']('editingDowncast')['markerToHighlight']({'model':'user:range','view':_0x27b4e2=>function(_0x5359c2,_0x1c089d){const _0x4e71aa=_0x5359c2['markerName']['split'](':')[0x2];if(_0x4e71aa===_0x1c089d['mySessionId'])return null;const _0x2f11cd=_0x1c089d['getUserBySessionId'](_0x4e71aa);if(!_0x2f11cd)return{'id':_0x4e71aa,'classes':[]};return{'id':_0x4e71aa,'classes':['ck-user__selection',_0x2f11cd['color']['getSelectionClass']()],'attributes':{'data-session-id':_0x4e71aa},'priority':0x7d0+_0x2f11cd['orderNumber']};}(_0x27b4e2,_0x47d06e)}),function(_0x29a1b4){const _0x1514b5=_0x29a1b4['model'],_0x133955=new Map(),_0xfa0a7f=_0x29a1b4['plugins']['get'](i);_0x1514b5['markers']['on']('update:user:range',(_0x39307c,_0x161156,_0x3fcfee,_0x1c5d07)=>{if(!_0x1c5d07&&_0x133955['get'](_0x161156['name']))return _0x133955['get'](_0x161156['name'])['detach'](),void _0x133955['delete'](_0x161156['name']);const _0x4603af=_0x161156['name']['split'](':')[0x2];if(_0x4603af===_0xfa0a7f['mySessionId'])return;const _0x432cfd='user:position:'+_0x4603af;_0x1514b5['markers']['has'](_0x432cfd)&&_0x29a1b4['editing']['reconvertMarker'](_0x432cfd),_0x161156['on']('change:range',(_0x5f5356,_0x567016,_0x412d48)=>{if('$graveyard'!=_0x567016['root']['rootName']&&'$graveyard'==_0x161156['getRange']()['root']['rootName']&&!_0x133955['has'](_0x161156['name'])){const _0x2974c9=_0x1514b5['schema']['getNearestSelectionRange'](_0x412d48['deletionPosition']);if(_0x2974c9){const _0x58e178=_0x44b6f7['fromRange'](_0x2974c9);_0x133955['set'](_0x161156['name'],_0x58e178),_0x58e178['on']('change:range',(_0x3cfe1b,_0x399527,_0x2c1438)=>{if('$graveyard'==_0x58e178['root']['rootName']){const _0x1e4dcb=_0x1514b5['schema']['getNearestSelectionRange'](_0x2c1438['deletionPosition']);_0x1e4dcb?(_0x58e178['start']=_0x1e4dcb['start'],_0x58e178['end']=_0x1e4dcb['end']):(_0x133955['delete'](_0x161156['name']),_0x58e178['detach']());}});}}});}),_0x1514b5['document']['on']('change',()=>{_0x133955['size']>0x0&&_0x1514b5['enqueueChange']({'isUndoable':!0x1},_0x18a3c4=>{for(const [_0x2fc445,_0x1baf90]of _0x133955)'$graveyard'==_0x1514b5['markers']['get'](_0x2fc445)['getRange']()['root']['rootName']&&(te(_0x2fc445['split'](':')[0x2],_0x1baf90['toRange'](),_0x1514b5,_0x18a3c4),_0x1baf90['detach']());_0x133955['clear']();});});}(_0x4b3d32),this['_domEmitter']['listenTo'](_0x24b4b2['document'],'keydown',(_0x19710f,{key:_0x19aa81})=>{'Escape'===_0x19aa81&&function(_0x34775b){_0x34775b['editing']['view']['change'](_0x484352=>{for(const _0x3a25e1 of _0x34775b['model']['markers']){if(!_0x3a25e1['name']['startsWith']('user:position'))continue;const _0x31479c=_0x34775b['editing']['mapper']['markerNameToElements'](_0x3a25e1['name']);if(_0x31479c){for(const _0x4daac0 of _0x31479c)_0x484352['removeClass']('ck-user__marker_hovered',_0x4daac0);}}});}(_0x4b3d32);},{'useCapture':!0x0});}['afterInit'](){const _0x283c38=this['editor'],_0x230848=_0x283c38['commands']['get']('undo');_0x230848&&_0x283c38['model']['on']('applyOperation',(_0x3ab2d9,_0x48a8ca)=>{const _0x3bcef2=_0x48a8ca[0x0];if(!_0x3bcef2['isDocumentOperation'])return;if('marker'!=_0x3bcef2['type']||!_0x3bcef2['name']['startsWith']('user:'))return;const _0xc6a8b4=_0x3bcef2['batch'];_0x230848['_createdBatches']['has'](_0xc6a8b4)&&(_0x3bcef2['newRange']=_0x3bcef2['oldRange']?_0x283c38['model']['createRange'](_0x3bcef2['oldRange']['start'],_0x3bcef2['oldRange']['end']):null);},{'priority':'highest'});}['destroy'](){return this['_domEmitter']['stopListening'](),super['destroy']();}['createUserMarkerOperations'](){const _0x47ad27=this['editor'],_0x3b8db9=_0x47ad27['model']['document'],_0x16556b=_0x47ad27['plugins']['get'](i);_0x47ad27['model']['enqueueChange']({'isUndoable':!0x1},_0x51dd02=>{const _0x158b64='user:range:'+_0x16556b['mySessionId'],_0x1edafd='user:position:'+_0x16556b['mySessionId'],_0x36ab83=_0x47ad27['model']['markers']['has'](_0x158b64);_0x47ad27['editing']['view']['hasDomSelection']?te(_0x16556b['mySessionId'],_0x3b8db9['selection']['getFirstRange'](),_0x47ad27['model'],_0x51dd02):_0x36ab83&&(_0x51dd02['removeMarker'](_0x158b64),_0x51dd02['removeMarker'](_0x1edafd));});}}function te(_0x45571e,_0x386ad5,_0x3fbf3f,_0x331e75){const _0x2d231b='user:range:'+_0x45571e,_0x578142='user:position:'+_0x45571e,_0x3c01e2=_0x386ad5['getContainedElement']();let _0x2b2fc8=_0x386ad5['start'];if(_0x3c01e2&&_0x3c01e2['is']('element','tableCell')){const _0x1fcd07=function(_0x58866e,_0x1bc0fe){for(const _0x2c465a of _0x58866e['getPositions']())if(_0x1bc0fe['schema']['checkChild'](_0x2c465a,'$text'))return _0x2c465a;}(_0x386ad5,_0x3fbf3f);_0x1fcd07&&(_0x2b2fc8=_0x1fcd07,_0x386ad5=_0x331e75['createRange'](_0x2b2fc8));}const _0x5e944d=_0x331e75['createRange'](_0x2b2fc8);_0x3fbf3f['markers']['has'](_0x2d231b)?(_0x331e75['updateMarker'](_0x2d231b,{'range':_0x386ad5}),_0x331e75['updateMarker'](_0x578142,{'range':_0x5e944d})):(_0x331e75['addMarker'](_0x2d231b,{'range':_0x386ad5,'usingOperation':!0x0}),_0x331e75['addMarker'](_0x578142,{'range':_0x5e944d,'usingOperation':!0x0}));}function K(_0xbdce80,_0x569f10,_0x42fde3){const _0x3b2c86=_0xbdce80['t'],t=_0xbdce80['t'];switch(_0x569f10){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 _0x3b2c86({'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'},_0x42fde3);default:return'';}}let X=0x1;class l extends _0x5646ee{static ['CollaborativeEditingService']=/* #__PURE__ -- @preserve */
25
+ ((()=>_0xe6012e)());['_offset'];['sessionId'];['serverHistory'];['_channelId'];['_service'];['_document'];['_compressor'];['_bufferedOperations'];['_knownOperations'];['_knownRootNames'];['_pendingAction'];['_hasSelectionChanged'];['_sendBufferedOperationsDelayId'];['_baseBufferDelay'];['_currentBufferDelay'];['_lastSyncedOperationId'];['_disconnectionOperations'];['_operationIdentifier'];static get['requires'](){return[n,i,$,_0x3ad957,_0x492d3c,_0x398e75];}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 _0x7c22e5=this['serverHistory']['getOperations']();for(let _0x1af50e=_0x7c22e5['length']-0x1;_0x1af50e>=0x0;_0x1af50e--){const _0x1ce06f=_0x7c22e5[_0x1af50e];if(!this['_disconnectionOperations']['has'](_0x1ce06f))return _0x1ce06f['baseVersion']+0x1-this['_offset'];}return 0x0;}constructor(_0x23f30f){if(super(_0x23f30f),this['_offset']=0x0,this['sessionId']=null,this['serverHistory']=new _0x272180(),this['editor']['config']['define']('collaboration',{}),this['_channelId']=this['editor']['config']['get']('collaboration.channelId'),!this['_channelId'])throw new _0x2c9c89('collaboration-missing-channelid',this);const _0x22ea69=_0x23f30f['config']['get']('cloudServices.bundleVersion')||nt;this['_service']=new l['CollaborativeEditingService'](_0x22ea69,this['_channelId']),this['_document']=this['editor']['model']['document'],this['_compressor']=new _0x1faead(),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 tt(this['_disconnectionOperations']);}['init'](){const _0x5cb831=this['editor'],_0x579b4c=_0x5cb831['plugins']['get'](_0x492d3c),_0x531c7c=_0x5cb831['plugins']['get'](n);this['listenTo'](_0x579b4c,'getOperationAuthor',(_0x25ca11,_0x239a40)=>{const _0x53ef2c=_0x239a40[0x0];_0x53ef2c['_authorId']&&(_0x25ca11['return']=_0x579b4c['getUser'](_0x53ef2c['_authorId']),_0x25ca11['stop']()),null===_0x53ef2c['_authorId']&&(_0x25ca11['return']=null,_0x25ca11['stop']());},{'priority':'high'}),this['listenTo'](_0x5cb831['model']['document']['selection'],'change:range',(_0x53cbd4,_0x5d5da0)=>{_0x5d5da0['directChange']&&this['_refreshUserSelectionMarkers']();}),this['listenTo'](_0x5cb831['editing']['view'],'change:hasDomSelection',()=>{this['_refreshUserSelectionMarkers']();}),this['_initThrowingOnDataSet'](),_0x5cb831['model']['on']('applyOperation',(_0x14573e,_0x36ef36)=>{const _0x234d23=_0x36ef36[0x0];_0x234d23['isDocumentOperation']&&(this['_saveOperationInBuffer'](_0x234d23),this['_shouldSendUpdate']()&&this['_sendBufferedOperationsDelayed']());}),this['_setUpDataInit'](),this['bind']('_isEditingAllowed')['to'](_0x531c7c,'state',this,'_hasSynchronizationProblem',(_0x2e2eca,_0x338530)=>'connected'===_0x2e2eca&&!_0x338530),this['on']('change:_isEditingAllowed',()=>{this['_isEditingAllowed']?_0x5cb831['disableReadOnlyMode']('rtc-offline'):_0x5cb831['enableReadOnlyMode']('rtc-offline');}),this['_isEditingAllowed']?_0x5cb831['disableReadOnlyMode']('rtc-offline'):_0x5cb831['enableReadOnlyMode']('rtc-offline'),this['set']('_isConnected',!0x1);}async['reconnect'](){const _0x1848b0=this['editor']['plugins']['get'](i),_0x4e3f5f=this['editor']['plugins']['get'](n);try{this['_isPendingUpdate']=!0x0,_0x1848b0['unregister'](this['_channelId']);const _0x396269=await this['_service']['reconnect'](_0x4e3f5f['connection'],this['lastSyncVersion']);await this['_handleReconnectionResponse'](_0x396269)&&(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());const _0x3dd5b7=await this['_service']['getConnectedSessions']();_0x1848b0['register'](this['_channelId'],_0x3dd5b7),this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}catch(_0x228773){if(function(_0x1fb2b9){return'404'===_0x1fb2b9['code'];}(_0x228773)&&this['sessionId'])await this['_connectAfterSessionHasBeenFlushed']();else{if(function(_0x3fa00b){return'409'===_0x3fa00b['code'];}(_0x228773)){const _0x55b97a=K(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'](_0x55b97a);}else{if(!(_0x228773 instanceof Y))throw _0x228773;this['_handleReconnectionError']();}}}}['destroy'](){const _0x1bfe56=this['editor']['plugins']['get'](n),_0x449568=this['editor']['plugins']['get'](i);this['editor']['enableReadOnlyMode']('rtc-destroyed'),_0x449568['channelSessions']['has'](this['_channelId'])&&_0x449568['unregister'](this['_channelId']),_0x1bfe56['removeFromReconnectionStack'](this),this['_disconnectService'](),super['destroy']();}async['_handleReconnectionResponse'](_0x422c77){if(this['sessionId']!==_0x422c77['sessionId']&&this['_lastSyncedOperationId']!==_0x422c77['lastOperationId'])throw new Y();return this['sessionId']=_0x422c77['sessionId'],this['_handleServerResponse']([],{..._0x422c77,'wereChangesApplied':!0x1,'data':_0x422c77['data']},'reconnect');}async['_connectService'](_0x8ec66,_0xe528c1=!0x1){const {connection:_0x438cfd}=this['editor']['plugins']['get'](n);l['CollaborativeEditingService']['getConnectedSessions'](_0x438cfd,this['_channelId'])['then'](_0x46cbe4=>this['_initSessionsHandling'](_0x46cbe4))['catch'](_0x1a8c50=>{this['_crash']('realtimecollaborationclient-init-session-connection-error',_0x1a8c50);}),this['listenTo'](this['_service'],'operationsReceived',this['_handleReceivedOperations']['bind'](this)),this['listenTo'](this['_service'],'error',(_0x1e07c9,_0x19528a)=>{this['_crash']('realtimecollaborationclient-init-service-internal-error',_0x19528a);}),this['listenTo'](this['_service'],'disconnected',()=>{this['_isConnected']=!0x1;});const _0x48f283=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x8ec66);this['_isPendingUpdate']=!0x0;const _0x28be6d=await this['_service']['connect'](_0x438cfd,this['_compressOperations'](_0x8ec66),_0x48f283);if(this['sessionId']=_0x28be6d['sessionId'],_0xe528c1){if(!_0x28be6d['wereChangesApplied'])return void this['_handleReconnectionError']();this['_isPendingUpdate']=!0x1,this['_clearPendingAction'](),this['serverHistory']['reset'](),this['_offset']=_0x28be6d['offset'],this['serverHistory']['version']=this['_offset'],await this['_handleServerResponse'](_0x8ec66,_0x28be6d,'reconnection:\x20flushed\x20session');}else await this['_handleInitialConnectionData'](_0x28be6d,_0x8ec66);this['_handleSendingSelectionMarkers'](),this['_isConnected']=!0x0;}['_handleSendingSelectionMarkers'](){const _0x3add6e=this['editor']['plugins']['get'](i),_0x7c1bd=this['editor']['plugins']['get']($),_0x23ab7e=_0x3add6e['channelSessions']['get'](this['_channelId']);_0x23ab7e&&_0x23ab7e['length']>0x1?_0x7c1bd['createUserMarkerOperations']():this['listenTo'](_0x3add6e,'sessionAdd:'+this['_channelId'],()=>{0x2===_0x3add6e['channelSessions']['get'](this['_channelId'])['length']&&_0x7c1bd['createUserMarkerOperations']();});}async['_handleReceivedOperations'](_0x4ed299,_0x7b5df0,_0x23634a,_0x5b51c9){if(!this['_isPendingUpdate']&&this['_document']['version']==_0x7b5df0){const _0x4b93d0=this['_decompressOperations'](_0x23634a,_0x5b51c9);await this['_fetchMissingUsers'](_0x4b93d0),this['_handleExternalOperations'](_0x4b93d0,_0x7b5df0,_0x23634a['lastOperationId'])||this['_crash']('realtimecollaborationclient-init-service-incorrect-server-operation');}}async['_connectAfterSessionHasBeenFlushed'](){this['_disconnectService']();const {locale:_0x5ada75}=this['editor'];let _0x17c809;try{_0x17c809=await this['_service']['getDocumentDetails']();}catch{const _0x54c5b4=K(_0x5ada75,'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'](_0x54c5b4);}const _0x398314=_0x17c809['currentDocumentSession']||_0x17c809['lastDocumentSession'];if(this['_lastSyncedOperationId']!==_0x398314['lastOperationId']){const _0x3390bc=K(_0x5ada75,'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'](_0x3390bc);}await this['_connectService'](this['editor']['model']['document']['history']['getOperations'](),!0x0);}['_disconnectService'](){this['_service']['disconnect'](),this['_bufferedOperations']=[],clearTimeout(this['_sendBufferedOperationsDelayId']),this['stopListening'](this['_service']);}['_initSessionsHandling'](_0x27826d){const _0x10ee5f=this['editor']['plugins']['get'](i);this['listenTo'](_0x10ee5f,'sessionAdd:'+this['_channelId'],(_0x39a3c9,{session:_0x56ff45})=>{if(_0x56ff45['id']===_0x10ee5f['mySessionId']){_0x39a3c9['off']();const _0x4c83d4=this['editor']['plugins']['has']('CommentsOnly')&&this['editor']['plugins']['get']('CommentsOnly');let _0x12b361=_0x56ff45['permissions'];_0x4c83d4&&_0x4c83d4['isEnabled']&&(_0x12b361=_0x12b361['filter'](_0xa7ef19=>'document:write'!==_0xa7ef19)),this['editor']['plugins']['get']('Permissions')['setPermissions'](_0x12b361,this['_channelId']);}}),_0x10ee5f['register'](this['_channelId'],_0x27826d);}['_initThrowingOnDataSet'](){const _0x145d66=this['editor']['data']['set'];this['editor']['data']['set']=(..._0x5a9055)=>{if(!_0x5a9055[_0x5a9055['length']-0x1]['suppressErrorInCollaboration'])throw new _0x2c9c89('realtimecollaborationclient-editor-setdata-and-editor-data-set-are-forbidden-in-real-time-collaboration',this);_0x145d66['apply'](this['editor']['data'],_0x5a9055);};}['_setUpDataInit'](){this['editor']['data']['on']('init',(_0x20367a,[_0x3ba8e1])=>{if(this['_document']['version'])throw new _0x2c9c89('realtimecollaborationclient-init-document-already-initialized',this);_0x20367a['stop'](),this['_setPendingAction']();const _0x1516a5=this['editor']['config']['get']('rootsAttributes'),_0x133a98=this['_getOperationsFromInitData'](_0x3ba8e1,_0x1516a5);0x0==_0x133a98['length']&&_0x133a98['push'](new _0x73bafe(0x0)),_0x20367a['return']=this['_connectService'](_0x133a98)['then'](()=>{this['editor']['plugins']['get'](n)['addToReconnectionStack'](this),this['editor']['data']['fire']('ready');})['catch'](_0x2f83e4=>this['_crash']('realtimecollaborationclient-init-connection-failed',_0x2f83e4))['finally'](()=>this['_clearPendingAction']());},{'priority':'high'}),this['editor']['on']('loadRoot',async(_0x4e8955,[_0x8b908,_0x556762])=>{_0x4e8955['stop']();const _0x424151=this['editor']['model']['document']['getRoot'](_0x8b908);if(!this['_knownRootNames']['has'](_0x8b908)){const _0x5e4fad=_0x556762&&_0x556762['data']?_0x556762['data']:'',_0x51bcbe=_0x556762&&_0x556762['attributes']?_0x556762['attributes']:{};await this['_loadRoot'](_0x8b908,_0x5e4fad,_0x51bcbe);}this['editor']['model']['enqueueChange']({'isUndoable':!0x1},()=>{_0x424151['_isLoaded']=!0x0,this['editor']['model']['document']['differ']['_bufferRootLoad'](_0x424151);});},{'priority':'high'});}async['_fetchMissingUsers'](_0x88fc6a){const _0x303481=this['editor']['plugins']['get'](_0x492d3c),{connection:_0x17e713}=this['editor']['plugins']['get'](n),_0x531849=new Set();for(const _0x3cb4f5 of _0x88fc6a){const _0x42a6ba=_0x3cb4f5['_authorId'];_0x42a6ba&&!_0x303481['getUser'](_0x42a6ba)&&_0x531849['add'](_0x42a6ba);}if(0x0===_0x531849['size'])return;const _0x54d100=await ct['getMany'](_0x17e713,Array['from'](_0x531849));for(const _0x34f9ba of _0x54d100)_0x303481['getUser'](_0x34f9ba['id'])||_0x303481['addUser'](_0x34f9ba);}['_getOperationsFromInitData'](_0x1985aa,_0x39838e={}){const _0x4ffa7c=this['editor']['model'],_0x1445b6=[];let _0x263c05=0x0;const _0x12a243='string'==typeof _0x1985aa?{'main':_0x1985aa}:_0x1985aa;for(const _0x343604 of Object['keys'](_0x12a243)){if(!this['_document']['roots']['has'](_0x343604))throw new _0x2c9c89('realtimecollaborationclient-init-non-existent-root',this);const _0x2d9afd=this['editor']['data']['parse'](_0x12a243[_0x343604]),_0x4c4058=this['_document']['getRoot'](_0x343604),_0x5b7f53=new _0x38092f(_0x4ffa7c['createPositionAt'](_0x4c4058,0x0),_0x2d9afd,_0x263c05++);_0x1445b6['push'](_0x5b7f53);for(const [_0x4a6ea2,_0x1c3caa]of _0x2d9afd['markers']){const _0x5a42fc=_0x4ffa7c['createRange'](_0x4ffa7c['createPositionFromPath'](_0x4c4058,_0x1c3caa['start']['path']['slice']()),_0x4ffa7c['createPositionFromPath'](_0x4c4058,_0x1c3caa['end']['path']['slice']())),_0x442249=new _0x46ffd6(_0x4a6ea2,null,_0x5a42fc,_0x4ffa7c['markers'],!0x0,_0x263c05++);_0x1445b6['push'](_0x442249);}}if(_0x39838e)for(const [_0x12cd3d,_0x1dbac3]of Object['entries'](_0x39838e)){const _0x44e1c1=_0x4ffa7c['document']['getRoot'](_0x12cd3d);if(!_0x44e1c1)throw new _0x2c9c89('multi-root-editor-root-attributes-no-root',null);for(const [_0x21215c,_0x6c00ed]of Object['entries'](_0x1dbac3))if(null!==_0x6c00ed){const _0x61a0b8=new _0x5c8512(_0x44e1c1,_0x21215c,null,_0x6c00ed,_0x263c05++);_0x1445b6['push'](_0x61a0b8);}}return _0x1445b6;}async['_loadRoot'](_0x2bb7b0,_0x253c8b,_0x5f2538){this['_getOperationsFromInitData']({[_0x2bb7b0]:_0x253c8b},{[_0x2bb7b0]:_0x5f2538})['forEach']((_0x587ced,_0x5120b6)=>{_0x587ced['baseVersion']=this['_document']['version']+_0x5120b6,_0x587ced['_isInit']=!0x0,this['_saveOperationInBuffer'](_0x587ced);}),this['_sendBufferedOperationsDelayed'](),await this['_waitUntilSynced']();}async['_handleInitialConnectionData'](_0x1e6571,_0x7d4a88){let _0x247006;this['_offset']=_0x1e6571['offset'];const _0x185468=_0x1e6571['wereChangesApplied']&&!_0x1e6571['initData'],_0x130a8e=_0x185468?0x0:_0x1e6571['data']['baseVersion'];if(_0x7d4a88['forEach'](_0x55019f=>{_0x55019f['_isInit']=!0x0,_0x55019f['createdAt']=_0x1e6571['sessionCreatedAt'],_0x55019f['_authorId']=null;}),_0x185468)_0x247006=_0x7d4a88,this['_applyOperationsSet'](_0x247006,_0x185468);else{if(_0x1e6571['initData']){const _0x406dd3=this['_getOperationsFromInitData'](_0x1e6571['initData']);this['_document']['history']['version']=-_0x406dd3['length'],_0x406dd3['forEach'](_0x1ca636=>{_0x1ca636['baseVersion']-=_0x406dd3['length'],_0x1ca636['createdAt']=_0x1e6571['sessionCreatedAt'],_0x1ca636['_isInit']=!0x0,_0x1ca636['_authorId']=null;}),this['_applyOperationsSet'](_0x406dd3,!0x0),this['serverHistory']['version']=-_0x406dd3['length']+this['_offset'],this['_updateServerHistory'](_0x406dd3);}this['_document']['history']['version']=_0x130a8e,_0x247006=this['_decompressOperations'](_0x1e6571['data'],_0x1e6571['metadata']),await this['_fetchMissingUsers'](_0x247006),this['_applyOperationsSet'](_0x247006,_0x185468);}_0x1e6571['lastOperationId']&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x247006,_0x1e6571['lastOperationId']),this['_lastSyncedOperationId']=_0x1e6571['lastOperationId']),this['serverHistory']['version']=_0x130a8e+this['_offset'],this['_updateServerHistory'](_0x247006),_0x7d4a88['filter'](_0x47faab=>{const _0x4b1e1d=this['_getAffectedRoot'](_0x47faab);return _0x4b1e1d&&!this['_knownRootNames']['has'](_0x4b1e1d);})['forEach']((_0x2bdf77,_0x4c2b9d)=>{_0x2bdf77['baseVersion']=this['_document']['version']+_0x4c2b9d,this['_saveOperationInBuffer'](_0x2bdf77);}),this['_shouldSendUpdate']()?(this['_currentBufferDelay']=0x0,this['_sendBufferedOperationsDelayed'](!0x0),await this['_waitUntilSynced']()):(this['_isPendingUpdate']=!0x1,this['_clearPendingAction']());}['_crash'](_0x4cfc19,_0x431a80){const _0x1fe686=_0x431a80&&_0x431a80['message'];if(_0x1fe686&&_0x1fe686['startsWith']('realtimecollaborationclient'))throw _0x431a80;const _0x51ab57=this['editor']['plugins']['get'](n);throw this['_isPendingUpdate']=!0x0,_0x51ab57['disconnect'](),this['editor']['enableReadOnlyMode']('realtimecollaborationclient-error'),new _0x2c9c89(_0x4cfc19,this['editor'],_0x1fe686?{'originalError':_0x1fe686}:void 0x0);}['_saveOperationInBuffer'](_0x527b2f){this['_knownOperations']['has'](_0x527b2f)||(this['_knownOperations']['add'](_0x527b2f),this['_bufferedOperations']['push'](_0x527b2f),this['_pendingAction']||'marker'==_0x527b2f['type']&&!_0x527b2f['affectsData']||this['_setPendingAction']());}['_sendBufferedOperationsDelayed'](_0x47fa49=!0x1){!_0x47fa49&&this['_isPendingUpdate']||(this['_isPendingUpdate']=!0x0,clearTimeout(this['_sendBufferedOperationsDelayId']),this['_sendBufferedOperationsDelayId']=setTimeout(()=>{this['_sendBufferedOperations']()['then'](_0x2508f7=>{_0x2508f7&&(this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1);})['catch'](_0x4c5858=>{this['_clearPendingAction'](),this['_isPendingUpdate']=!0x1,function(_0x2bfbf8){return _0x2bfbf8['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2bfbf8['message']['startsWith']('cloud-services-internal-error:\x20Collaborative\x20Editing\x20Service\x20is\x20not\x20connected.')||_0x2bfbf8['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}(_0x4c5858)||this['_crash'](_0x4c5858['message'],_0x4c5858);});},this['_currentBufferDelay']));}['_waitUntilSynced'](){return new Promise(_0x52361b=>{this['on']('change:_isPendingUpdate',()=>{_0x52361b();});});}async['_sendBufferedOperations'](){const _0x2a2197=this['editor']['plugins']['get']($);if(this['_shouldSendSelectionUpdate']()&&(_0x2a2197['createUserMarkerOperations'](),this['_hasSelectionChanged']=!0x1),!this['_shouldSendUpdate']())return!0x0;const _0x1725d6=[...this['_bufferedOperations']];for(const _0x2502de of _0x1725d6)_0x2502de['wasUndone']=this['_document']['history']['isUndoneOperation'](_0x2502de);const _0x2a5346=this['_operationIdentifier']['getIdOfTheLastOperation'](_0x1725d6),_0x3d9355=X++,_0x2846e4=this['_compressOperations'](_0x1725d6),_0x934bd7=await this['_service']['sendOperations'](_0x2846e4,_0x2846e4['baseVersion'],_0x2a5346);try{return await this['_handleServerResponse'](_0x1725d6,_0x934bd7,_0x3d9355);}catch(_0x298132){return this['_crash']('realtimecollaborationclient-sendbufferedoperations',_0x298132);}}async['_handleServerResponse'](_0x550661,_0x438eb9,_0x2f4e98){if('error'in _0x438eb9)throw _0x438eb9['error'];let _0x40bc4c=!0x1;if(_0x438eb9['wereChangesApplied']){_0x438eb9['lastOperationId']&&(this['_lastSyncedOperationId']=_0x438eb9['lastOperationId']),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x18895f=>!_0x550661['includes'](_0x18895f));for(const _0x4383f8 of _0x550661)_0x4383f8['createdAt']='lastOperationAcceptedAt'in _0x438eb9&&_0x438eb9['lastOperationAcceptedAt']||void 0x0;Z(_0x550661,_0x438eb9['version']-_0x550661['length']),this['_updateServerHistory'](_0x550661);const _0x7b145d=_0x550661['filter'](_0x1fbe3f=>{if(!_0x1fbe3f['_isInit'])return!0x1;const _0x1157d4=this['_getAffectedRoot'](_0x1fbe3f);return _0x1157d4&&!this['_knownRootNames']['has'](_0x1157d4);});Z(_0x7b145d,this['_document']['version']),this['_applyOperationsSet'](_0x7b145d),_0x40bc4c=!0x0,this['_currentBufferDelay']=this['_baseBufferDelay'];}else{const _0x447787=this['_decompressOperations'](_0x438eb9['data'],_0x438eb9['metadata'])['filter'](_0x527c0c=>_0x527c0c['baseVersion']>=this['_lastServerVersion']);_0x447787['forEach'](_0xc56b11=>this['_addKnownRoot'](_0xc56b11)),this['_bufferedOperations']=this['_bufferedOperations']['filter'](_0x5a9068=>!_0x5a9068['_isInit']||!this['_knownRootNames']['has'](this['_getAffectedRoot'](_0x5a9068))),this['_bufferedOperations']['length']&&Z(this['_bufferedOperations'],this['_bufferedOperations'][0x0]['baseVersion']),await this['_fetchMissingUsers'](_0x447787),_0x40bc4c=this['_handleExternalOperations'](_0x447787,_0x438eb9['version'],_0x438eb9['lastOperationId']),this['_currentBufferDelay']=Math['round'](this['_currentBufferDelay']/0x2);}return _0x40bc4c?!this['_shouldSendUpdate']()||(this['_sendBufferedOperationsDelayed'](!0x0),!0x1):this['_crash']('realtimecollaborationclient-handleserverresponse');}['_handleExternalOperations'](_0x25542f,_0x41b69c,_0x1fb8c7){try{const _0x5c8409={'document':this['_document'],'useRelations':!0x1,'padWithNoOps':!0x0},{operationsA:_0x480194,operationsB:_0xefe9d7,originalOperations:_0x931c06}=_0x3dce07(_0x25542f,this['_bufferedOperations'],_0x5c8409);Z(_0x480194,this['_document']['version']),Z(_0xefe9d7,_0x41b69c);for(const _0x5e7cf5 of _0x480194){const _0x451416=_0x931c06['get'](_0x5e7cf5);_0x5e7cf5['_authorId']=_0x451416?_0x451416['_authorId']:null;}_0x1fb8c7&&(this['_operationIdentifier']['setIdForTheLastOperation'](_0x25542f,_0x1fb8c7),this['_lastSyncedOperationId']=_0x1fb8c7),this['_bufferedOperations']=[..._0xefe9d7],this['_applyOperationsSet'](_0x480194),this['_updateServerHistory'](_0x25542f);}catch(_0x7abf){return console['error'](_0x7abf),!0x1;}return!0x0;}['_applyOperationsSet'](_0x4ba3ac,_0x297f82=!0x1){this['editor']['model']['enqueueChange']({'isUndoable':!0x1,'isLocal':!0x1},_0x179ca0=>{for(const _0x40a192 of _0x4ba3ac)this['_knownOperations']['add'](_0x40a192),this['_addKnownRoot'](_0x40a192),_0x179ca0['batch']['addOperation'](_0x40a192),this['editor']['model']['applyOperation'](_0x40a192);});}['_addKnownRoot'](_0x39ddad){const _0x4c8057=this['_getAffectedRoot'](_0x39ddad);_0x4c8057&&this['_knownRootNames']['add'](_0x4c8057);}['_getAffectedRoot'](_0x194cd1){let _0x9a8a0,_0x3cc47a;switch(_0x194cd1['type']){case'insert':_0x9a8a0=_0x194cd1['position']['root'];break;case'marker':if(_0x3cc47a=_0x194cd1['newRange'],!_0x3cc47a)return null;_0x9a8a0=_0x3cc47a['root'];break;case'addRootAttribute':_0x9a8a0=_0x194cd1['root'];break;case'addRoot':_0x9a8a0=_0x194cd1['affectedSelectable'];break;case'move':_0x9a8a0=_0x194cd1['targetPosition']['root'];break;default:return null;}return _0x9a8a0['rootName'];}['_updateServerHistory'](_0x1abffc){_0x1abffc['forEach'](_0x2ac8c5=>{const _0x3a4a63=_0x2ac8c5['clone']();_0x3a4a63['_authorId']=_0x2ac8c5['_authorId'],_0x3a4a63['_isInit']=!!_0x2ac8c5['_isInit'],_0x3a4a63['createdAt']=_0x2ac8c5['createdAt'],_0x3a4a63['baseVersion']+=this['_offset'],_0x2ac8c5['_isDisconnection']&&this['_disconnectionOperations']['add'](_0x3a4a63),this['serverHistory']['addOperation'](_0x3a4a63);});}['_handleReconnectionError'](_0x603683){const _0x517024=this['editor']['plugins']['get']('Notification'),_0x9ccd2a=this['editor']['locale'];_0x603683||(_0x603683=K(_0x9ccd2a,'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.')),_0x517024['showWarning'](_0x603683,{'title':K(_0x9ccd2a,'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'](_0x3ad957)['add'](K(this['editor']['locale'],'PENDING_ACTION_SENDING_DATA')));}['_clearPendingAction'](){this['_pendingAction']&&(this['editor']['plugins']['get'](_0x3ad957)['remove'](this['_pendingAction']),this['_pendingAction']=null);}['_compressOperations'](_0xd4ed44){const _0x5994b1=_0xd4ed44['map'](_0x5c88a3=>_0x5c88a3['toJSON']());return this['_compressor']['compress'](_0x5994b1);}['_decompressOperations'](_0x24a0fe,_0x3a354c){return this['_compressor']['decompress'](_0x24a0fe)['map']((_0x433b7e,_0x59cb83)=>{const _0x3fab99='init'==_0x3a354c[_0x59cb83]['type'];if('InsertOperation'==_0x433b7e['__className']){const _0x32a463=_0x433b7e['position']['root'];!this['_document']['getRoot'](_0x32a463)&&(this['_document']['createRoot']('$root',_0x32a463)['_isAttached']=!0x1);}const _0x53a2ea=_0xf26799['fromJSON'](_0x433b7e,this['_document']);return _0x53a2ea['wasUndone']=_0x433b7e['wasUndone'],_0x53a2ea['_isInit']=_0x3fab99,_0x53a2ea['_authorId']=_0x3fab99?null:_0x3a354c[_0x59cb83]['userId'],_0x53a2ea['_isDisconnection']='cs:removeUser'===_0x3a354c[_0x59cb83]['type'],_0x53a2ea['createdAt']=_0x3a354c[_0x59cb83]['createdAt'],_0x53a2ea;});}['_refreshUserSelectionMarkers'](){this['_hasSelectionChanged']=!0x0,this['_shouldSendSelectionUpdate']()?this['_sendBufferedOperationsDelayed']():this['_hasSelectionChanged']=!0x1;}['_shouldSendSelectionUpdate'](){const _0x212a92=this['editor']['plugins']['get'](i)['channelSessions']['get'](this['_channelId']);return!this['editor']['isReadOnly']&&!!_0x212a92&&_0x212a92['length']>0x1&&this['_hasSelectionChanged'];}['_shouldSendUpdate'](){return this['_bufferedOperations']['length']>0x0||this['_shouldSendSelectionUpdate']();}}class Y extends Error{}function Z(_0x271e83,_0x276c85){for(const _0x98c5af of _0x271e83)_0x98c5af['baseVersion']=_0x276c85++;}class tt{['_ignoredOperations'];['_operationToId'];constructor(_0x3b5ca1){this['_ignoredOperations']=_0x3b5ca1,this['_operationToId']=new WeakMap();}['getIdOfTheLastOperation'](_0x288944){let _0xd1a490=_0x288944['length'];for(;_0xd1a490--;){const _0x1ede0d=_0x288944[_0xd1a490];if(!this['_ignoredOperations']['has'](_0x1ede0d)){if(!this['_operationToId']['has'](_0x1ede0d)){const _0x50ca93=_0x3f1013()['slice'](0x1,0x12);this['_operationToId']['set'](_0x1ede0d,_0x50ca93);}return this['_operationToId']['get'](_0x1ede0d);}}}['setIdForTheLastOperation'](_0x5981a7,_0x29174d){if(!_0x29174d)return;let _0x126ac5=_0x5981a7['length'];for(;_0x126ac5--;){const _0x4c3820=_0x5981a7[_0x126ac5];this['_ignoredOperations']['has'](_0x4c3820)||this['_operationToId']['set'](_0x4c3820,_0x29174d);}}}class a extends _0x5646ee{static get['requires'](){return[l];}static get['pluginName'](){return'RealTimeCollaborativeEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}class s extends _0x13341e{static ['CommentsService']=/* #__PURE__ -- @preserve */
26
+ ((()=>_0x144d71)());['_services'];static get['requires'](){return[n,'CommentsRepository',i,_0x492d3c];}static get['pluginName'](){return'CloudServicesCommentsAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50b2e9){super(_0x50b2e9),this['_services']=new Map();}async['init'](){const _0x3615bc=this['context'],_0x55e221=_0x3615bc['plugins']['get']('CommentsRepository');if(_0x3615bc['plugins']['get'](n)['addToReconnectionStack'](this),_0x55e221['adapter']={'addCommentThread':async({channelId:_0x484156,threadId:_0x2f6027,comments:_0x2a440f,resolvedAt:_0x208467,resolvedBy:_0x58b736,context:_0x43cd82,attributes:_0x25d76b})=>{const _0x22e759=await this['_getService'](_0x484156)['addCommentThread']({'commentThreadId':_0x2f6027,'comments':_0x2a440f['map'](_0x20e893=>function(_0x158a32,_0xab7abb,_0x224f2b){return{'commentThreadId':_0x224f2b,'commentId':_0x158a32['commentId'],'userId':_0x158a32['authorId'],'content':_0x158a32['content'],'documentId':_0xab7abb,'createdAt':_0x158a32['createdAt'],'attributes':_0x158a32['attributes']||{}};}(_0x20e893,_0x484156,_0x2f6027)),'resolvedAt':_0x208467,'resolvedBy':_0x58b736,'context':_0x43cd82,'attributes':_0x25d76b})['catch'](at);return{'threadId':_0x22e759['commentThreadId'],'comments':_0x22e759['comments']};},'getCommentThread':async({channelId:_0x2a30bd,threadId:_0x200fdc})=>{const _0x53d9e9=await this['_getService'](_0x2a30bd)['getCommentThread'](_0x200fdc)['catch'](at);return _0x53d9e9['deletedAt']?null:(await this['_fetchMissingUsersForThreads']([_0x53d9e9]),{'threadId':_0x53d9e9['commentThreadId'],'comments':_0x53d9e9['comments']['map'](U),'context':_0x53d9e9['context'],'resolvedAt':_0x53d9e9['resolvedAt'],'resolvedBy':_0x53d9e9['resolvedBy'],'attributes':_0x53d9e9['attributes']||{}});},'updateCommentThread':async({channelId:_0x5d6f69,threadId:_0x28354c,context:_0x4095eb,unlinkedAt:_0xe0df87,attributes:_0x5ec33e})=>this['_getService'](_0x5d6f69)['updateCommentThread']({'commentThreadId':_0x28354c,'context':_0x4095eb,'attributes':_0x5ec33e,'unlinkedAt':_0xe0df87})['catch'](B)['catch'](at),'resolveCommentThread':async({channelId:_0x2f77e2,threadId:_0x5b4b41})=>{const _0x2512ba=await this['_getService'](_0x2f77e2)['resolveCommentThread'](_0x5b4b41)['catch'](B)['catch'](at);return{'threadId':_0x2512ba['commentThreadId'],'resolvedAt':_0x2512ba['resolvedAt'],'resolvedBy':_0x2512ba['resolvedBy']};},'reopenCommentThread':async({channelId:_0x3de176,threadId:_0x6603a7})=>this['_getService'](_0x3de176)['reopenCommentThread'](_0x6603a7)['catch'](B)['catch'](at),'removeCommentThread':({channelId:_0x4447a7,threadId:_0x3a618d})=>this['_getService'](_0x4447a7)['removeCommentThread'](_0x3a618d)['catch'](B)['catch'](at),'addComment':({channelId:_0x2fdb3c,threadId:_0xa283f8,commentId:_0x45939c,content:_0x764ae6,attributes:_0x2efbf8})=>this['_getService'](_0x2fdb3c)['addComment'](_0xa283f8,_0x45939c,_0x764ae6,_0x2efbf8)['catch'](at),'updateComment':({channelId:_0x598e12,threadId:_0x3d05fc,commentId:_0x4fd2c2,content:_0x1c8adf,attributes:_0x54b6c0})=>this['_getService'](_0x598e12)['updateComment'](_0x3d05fc,_0x4fd2c2,_0x1c8adf,_0x54b6c0)['catch'](B)['catch'](at),'removeComment':({channelId:_0x584f93,threadId:_0x5f4409,commentId:_0x49f6db})=>this['_getService'](_0x584f93)['removeComment'](_0x5f4409,_0x49f6db)['catch'](B)['catch'](at)},_0x3615bc instanceof _0x113706){const _0x18b1af=_0x3615bc['config']['get']('collaboration.channelId'),_0x5ea6dd=_0x3615bc['plugins']['get'](i);await this['_setUpService'](_0x18b1af);const _0x3eedc3=await this['_services']['get'](_0x18b1af)['getConnectedSessions']();this['listenTo'](_0x5ea6dd,'sessionAdd:'+_0x18b1af,(_0x3d76ed,{session:_0x407612})=>{_0x407612['id']===_0x5ea6dd['mySessionId']&&(_0x3d76ed['off'](),this['context']['plugins']['get']('Permissions')['setPermissions'](_0x407612['permissions'],_0x18b1af));}),_0x5ea6dd['register'](_0x18b1af,_0x3eedc3);}}async['_setUpService'](_0x4fb4de){if(this['_services']['has'](_0x4fb4de))throw new _0x2c9c89('cloudservicescommentsadapter-connect-already-connected',null,{'channelId':_0x4fb4de});const _0x26e204=this['context']['plugins']['get']('CommentsRepository'),_0x55d300=new s['CommentsService'](_0x4fb4de);this['_services']['set'](_0x4fb4de,_0x55d300),this['listenTo'](_0x55d300,'commentThreadAdded',(_0x9b377e,_0x2cc57a)=>{const {commentThreadId:_0x42854b,documentId:_0xced600,context:_0x8d5251,attributes:_0x65d8ca,resolvedAt:_0x324f26,resolvedBy:_0x2a9d2b,comments:_0x2575b1}=_0x2cc57a;_0x26e204['getCommentThread'](_0x42854b)||_0x26e204['addCommentThread']({'threadId':_0x42854b,'channelId':_0xced600,'comments':_0x2575b1?_0x2575b1['map'](U):[],'context':_0x8d5251,'attributes':_0x65d8ca,'resolvedAt':_0x324f26,'resolvedBy':_0x2a9d2b,'isFromAdapter':!0x0});}),this['listenTo'](_0x55d300,'commentThreadUpdated',(_0xfb21f3,{commentThreadId:_0x5d2732,documentId:_0x5e4b41,context:_0x348b09,unlinkedAt:_0xd9d05d,attributes:_0x189d73})=>{_0x26e204['getCommentThread'](_0x5d2732)&&_0x26e204['updateCommentThread']({'threadId':_0x5d2732,'channelId':_0x5e4b41,'context':_0x348b09,'unlinkedAt':_0xd9d05d,'attributes':_0x189d73,'isFromAdapter':!0x0});}),this['listenTo'](_0x55d300,'commentThreadResolved',(_0x4ef3ed,{commentThreadId:_0x2712d2,resolvedBy:_0x4a7c7a,resolvedAt:_0x36807a})=>{const _0x31b805=_0x26e204['getCommentThread'](_0x2712d2);_0x31b805&&_0x31b805['resolve']({'resolvedBy':_0x4a7c7a,'resolvedAt':_0x36807a,'isFromAdapter':!0x0});}),this['listenTo'](_0x55d300,'commentThreadReopened',(_0x264e78,{commentThreadId:_0x5e0ad4})=>{const _0x5257ee=_0x26e204['getCommentThread'](_0x5e0ad4);_0x5257ee&&_0x5257ee['reopen']({'isFromAdapter':!0x0});}),this['listenTo'](_0x55d300,'commentThreadRemoved',(_0x2bb879,{commentThreadId:_0x5eebfc})=>{const _0x408370=_0x26e204['getCommentThread'](_0x5eebfc);_0x408370&&_0x408370['remove']({'isFromAdapter':!0x0});}),this['listenTo'](_0x55d300,'commentAdded',(_0x20ca92,_0x30d046)=>{const _0x53b0b6=_0x30d046['commentThreadId'],_0x1410ff=_0x26e204['getCommentThread'](_0x53b0b6);_0x1410ff&&_0x1410ff['addComment']({...U(_0x30d046),'isFromAdapter':!0x0});}),this['listenTo'](_0x55d300,'commentUpdated',(_0x44a34e,{commentThreadId:_0x13bc9c,commentId:_0xe3f66e,content:_0x1396f8,attributes:_0x3e127b})=>{const _0x215acd=_0x26e204['getCommentThread'](_0x13bc9c);if(_0x215acd){const _0x2b520b=_0x215acd['getComment'](_0xe3f66e);_0x2b520b&&_0x2b520b['update']({'content':_0x1396f8,'attributes':_0x3e127b,'isFromAdapter':!0x0});}}),this['listenTo'](_0x55d300,'commentRemoved',(_0x1bd4b8,{commentThreadId:_0x13cce2,commentId:_0x5ab353})=>{const _0x360e90=_0x26e204['getCommentThread'](_0x13cce2);if(_0x360e90){const _0xf86a68=_0x360e90['getComment'](_0x5ab353);_0xf86a68&&_0xf86a68['remove']({'isFromAdapter':!0x0});}}),await this['_connectService'](_0x4fb4de);}['destroy'](){if(this['context']instanceof _0x113706){const _0x58175e=this['context']['config']['get']('collaboration.channelId');this['_terminateService'](_0x58175e);}}['_terminateService'](_0x10b95a){if(!this['_services']['has'](_0x10b95a))throw new _0x2c9c89('cloudservicescommentsadapter-disconnect-not-exist',null,{'channelId':_0x10b95a});this['_getService'](_0x10b95a)['disconnect'](),this['_services']['delete'](_0x10b95a);}async['reconnect'](){for(const _0x2fdb7f of this['_services']['keys']())await this['_connectService'](_0x2fdb7f);if(this['context']instanceof _0x113706){const _0xc6b90=this['context']['config']['get']('collaboration.channelId'),_0x1aea23=this['context']['plugins']['get'](i);_0x1aea23['unregister'](_0xc6b90);const _0x551afd=await this['_services']['get'](_0xc6b90)['getConnectedSessions']();_0x1aea23['register'](_0xc6b90,_0x551afd);}}async['_connectService'](_0x1e5f8c){const {connection:_0x440832}=this['context']['plugins']['get'](n),_0x12465f=this['context']['plugins']['get']('CommentsRepository'),_0x2a6155=this['_services']['get'](_0x1e5f8c),_0x30274e=await _0x2a6155['connect'](_0x440832);await this['_fetchMissingUsersForThreads'](_0x30274e);const _0x5de678=new Set(Array['from'](_0x12465f['getCommentThreads']({'channelId':_0x1e5f8c}),_0x111b59=>_0x111b59['id']));for(const _0x1051ed of _0x30274e)_0x1051ed['deletedAt']||_0x5de678['delete'](_0x1051ed['commentThreadId']);for(const _0x40eb73 of _0x5de678)_0x12465f['getCommentThread'](_0x40eb73)['remove']({'isFromAdapter':!0x0});for(const _0x55abb4 of _0x30274e){let _0x39aa26=_0x12465f['getCommentThread'](_0x55abb4['commentThreadId']);const {commentThreadId:_0x204c8e,context:_0x529858,attributes:_0x56ae61,resolvedBy:_0x50c477,resolvedAt:_0x4dcd5a,unlinkedAt:_0x2a0aa9,deletedAt:_0x2f6dd8}=_0x55abb4;if(_0x2f6dd8)continue;_0x39aa26||(_0x39aa26=_0x12465f['addCommentThread']({'channelId':_0x1e5f8c,'threadId':_0x204c8e,'context':_0x529858,'attributes':_0x56ae61||{},'resolvedBy':_0x50c477,'resolvedAt':_0x4dcd5a,'unlinkedAt':_0x2a0aa9,'isFromAdapter':!0x0}));const _0x2c3893=new Set(Array['from'](_0x39aa26['comments'],_0x599b07=>_0x599b07['id']));for(const _0x379f6c of _0x55abb4['comments'])_0x2c3893['delete'](_0x379f6c['commentId']);for(const _0x50b946 of _0x2c3893)_0x39aa26['getComment'](_0x50b946)['remove']({'isFromAdapter':!0x0});for(const _0x894b10 of _0x55abb4['comments']){const _0x3776ed=_0x39aa26['getComment'](_0x894b10['commentId']);_0x3776ed?_0x3776ed['content']!==_0x894b10['content']&&_0x3776ed['update']({'content':_0x894b10['content'],'isFromAdapter':!0x0}):_0x39aa26['addComment'](Object['assign'](U(_0x894b10),{'isFromAdapter':!0x0}));}}}['_getService'](_0x11ca35){if(!this['_services']['has'](_0x11ca35))throw new _0x2c9c89('cloudservicescommentsadapter-service-not-exist',null,{'channelId':_0x11ca35});return this['_services']['get'](_0x11ca35);}async['_fetchMissingUsersForThreads'](_0x573499){const _0x40017e=this['context']['plugins']['get'](_0x492d3c),{connection:_0x21e648}=this['context']['plugins']['get'](n),_0x54b251=new Set();for(const {resolvedBy:_0x5079ad,comments:_0x22b5ab}of _0x573499){_0x5079ad&&!_0x40017e['getUser'](_0x5079ad)&&_0x54b251['add'](_0x5079ad);for(const {userId:_0x3746e0}of _0x22b5ab)_0x40017e['getUser'](_0x3746e0)||_0x54b251['add'](_0x3746e0);}if(0x0===_0x54b251['size'])return;const _0x456969=await ct['getMany'](_0x21e648,Array['from'](_0x54b251));for(const _0x544179 of _0x456969)_0x40017e['getUser'](_0x544179['id'])||_0x40017e['addUser'](_0x544179);}}async function B(_0x254c63){if('404'!==_0x254c63['code'])throw _0x254c63;}function at(_0x4c73ad){if((_0x2f2aaf=_0x4c73ad)['message']['startsWith']('cloud-services-internal-error:\x20Comments\x20Service\x20is\x20not\x20connected.')||_0x2f2aaf['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x2f2aaf['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.'))return new Promise(()=>{});var _0x2f2aaf;throw _0x4c73ad;}function U(_0x4df9f9){return{'threadId':_0x4df9f9['commentThreadId'],'commentId':_0x4df9f9['commentId'],'content':_0x4df9f9['content'],'createdAt':_0x4df9f9['createdAt'],'authorId':_0x4df9f9['userId'],'attributes':_0x4df9f9['attributes']||{}};}class m extends _0x5646ee{static ['TrackChangesService']=/* #__PURE__ -- @preserve */
27
+ ((()=>_0x3ad8a1)());['_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(_0x2b627a){super(_0x2b627a);const _0x54cec7=this['editor']['config']['get']('collaboration.channelId');this['_bufferedRequests']=new Map(),this['_trackChangesService']=new m['TrackChangesService'](_0x54cec7);}['init'](){const _0x5c8803=this['editor']['plugins']['get'](n),_0xa6d820=this['editor']['plugins']['get']('TrackChangesEditing');return _0xa6d820['adapter']={'getSuggestion':async _0x36e22f=>{await this['_waitForServiceReady']();const _0x564a09=await this['_trackChangesService']['get'](_0x36e22f)['catch'](C);return await this['_fetchMissingUsersForThreads']([_0x564a09]),_0x564a09;},'addSuggestion':async({id:_0x1b44ab,type:_0x4ecaeb,data:_0x49354c,originalSuggestionId:_0x329240,attributes:_0x42cf85})=>{await this['_waitForServiceReady']();const _0x1b274f={'id':_0x1b44ab,'type':_0x4ecaeb,'data':_0x49354c,'originalSuggestionId':_0x329240,'attributes':_0x42cf85},_0x51fd27=await this['_trackChangesService']['add'](_0x1b44ab,_0x4ecaeb,_0x49354c,_0x329240,_0x42cf85)['catch'](_0xb5bb5a=>{if(ht(_0xb5bb5a))return new Promise(_0x4fcba5=>{this['_bufferedRequests']['set'](_0x1b44ab,{'resolve':_0x4fcba5,'suggestionData':_0x1b274f});});throw _0xb5bb5a;});return this['_bufferedRequests']['delete'](_0x1b44ab),_0x51fd27;},'updateSuggestion':async(_0x686b6b,_0x31f95f)=>{if(await this['_waitForServiceReady'](),'open'!==_0x31f95f['state'])return this['_trackChangesService']['update'](_0x686b6b,_0x31f95f)['catch'](C);}},this['listenTo'](this['_trackChangesService'],'suggestionUpdated',(_0x58c217,_0x12e438)=>{_0xa6d820['hasSuggestion'](_0x12e438['id'])&&(_0xa6d820['getSuggestion'](_0x12e438['id'])['attributes']=_0x12e438['attributes']);}),this['_trackChangesService']['connect'](_0x5c8803['connection'])['then'](_0x438dba=>(_0x5c8803['addToReconnectionStack'](this),this['_fetchMissingUsersForThreads'](_0x438dba)['then'](()=>{for(const _0x252b55 of _0x438dba){_0xa6d820['addSuggestionData'](_0x252b55)['_saved']=!0x0;}})));}async['reconnect'](){const _0x4c2fa1=this['editor']['plugins']['get']('TrackChangesEditing'),{connection:_0x53a349}=this['editor']['plugins']['get'](n),_0x49dde6=await this['_trackChangesService']['connect'](_0x53a349);await this['_fetchMissingUsersForThreads'](_0x49dde6);for(const {suggestionData:_0x40cc64,resolve:_0x4df959}of this['_bufferedRequests']['values']()){let _0x2a1b34=_0x49dde6['find'](_0x42e95f=>_0x42e95f['id']===_0x40cc64['id']);_0x2a1b34||(_0x2a1b34=await this['_trackChangesService']['add'](_0x40cc64['id'],_0x40cc64['type'],_0x40cc64['data'],_0x40cc64['originalSuggestionId'])),_0x4df959(_0x2a1b34);}for(const _0x589f4f of _0x49dde6)_0x4c2fa1['hasSuggestion'](_0x589f4f['id'])||_0x4c2fa1['addSuggestionData'](_0x589f4f);}async['_waitForServiceReady'](){this['_trackChangesService']['isConnected']||await new Promise(_0x526fe8=>{this['listenTo'](this['_trackChangesService'],'connected',_0xc82373=>{_0xc82373['off'](),_0x526fe8();});});}async['_fetchMissingUsersForThreads'](_0x3f73d9){const _0x4965b3=this['editor']['plugins']['get'](_0x492d3c),{connection:_0x49f6fd}=this['editor']['plugins']['get'](n),_0x4ccd1b=new Set();for(const {authorId:_0x41c60e}of _0x3f73d9)_0x4965b3['getUser'](_0x41c60e)||_0x4ccd1b['add'](_0x41c60e);if(0x0===_0x4ccd1b['size'])return;const _0x2a2c93=await ct['getMany'](_0x49f6fd,Array['from'](_0x4ccd1b));for(const _0x3b3ddf of _0x2a2c93)_0x4965b3['getUser'](_0x3b3ddf['id'])||_0x4965b3['addUser'](_0x3b3ddf);}}function C(_0x6a029){if(ht(_0x6a029))return new Promise(()=>{});throw _0x6a029;}function ht(_0x924d15){return _0x924d15['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x924d15['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class g extends _0x5646ee{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 _0x382d82=this['editor']['plugins']['get'](n),_0x5b8fc7=this['editor']['plugins']['get']('CommentsEditing'),_0x36ec9b=this['editor']['plugins']['get'](s);return this['editor']['data']['once']('ready',()=>{this['listenTo'](_0x382d82,'change:state',(_0x4ce3e2,_0x17afc1,_0x48bc8e)=>{_0x5b8fc7['isThreadsLoadingPaused']='connected'!==_0x48bc8e;});}),this['listenTo'](_0x382d82,'change:state',(_0xd6fe71,_0x3ad133,_0x4e717d)=>{this['editor']['plugins']['get']('CommentsRepository')['switchReadOnly']('connected'!==_0x4e717d);}),_0x36ec9b['_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 _0x5646ee{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 _0x5646ee{static ['RevisionHistoryService']=/* #__PURE__ -- @preserve */
28
+ ((()=>_0x4b290b)());['_lastRequestId'];['_revisionTracker'];['_revisionHistoryService'];['_oldOffset'];static get['requires'](){return[n,l,'RevisionHistory',i,_0x492d3c];}static get['pluginName'](){return'CloudServicesRevisionHistoryAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4d4725){super(_0x4d4725);const _0x26638a=this['editor']['config']['get']('collaboration.channelId');this['_lastRequestId']=null,this['_revisionTracker']=this['editor']['plugins']['get']('RevisionTracker'),this['_revisionHistoryService']=new c['RevisionHistoryService'](_0x26638a);}async['init'](){const _0x185e1d=this['editor']['plugins']['get'](l),_0x2810f0=_0x185e1d['serverHistory'],_0x56d5a7=this['editor']['plugins']['get'](n);this['_revisionTracker']['setSource']({'history':_0x2810f0,'getLatestVersion':()=>this['_getLatestVersion'](),'getCurrentRevisionId':()=>_0x185e1d['sessionId']});const _0x21bf68=this['editor']['config']['get']('cloudServices.bundleVersion')||nt,_0x59422b=await _0x58ca67['isBundleUploaded'](_0x56d5a7['connection'],_0x21bf68);this['editor']['plugins']['get']('RevisionHistory')['adapter']={'getRevision':async({revisionId:_0x277dd2})=>(await this['_waitForServiceReady'](),await this['_revisionHistoryService']['getRevision'](_0x277dd2)),'updateRevisions':async _0x3721a1=>{await this['_waitForServiceReady']();const _0x26047c=this['_revisionTracker']['currentRevision'];if(_0x59422b&&0x1===_0x3721a1['length']&&_0x3721a1[0x0]['id']===_0x26047c['id'])return _0x3721a1;for(const _0x335f14 of _0x3721a1)_0x335f14['id']===_0x26047c['id']&&(_0x335f14['isEmptyCurrent']=_0x335f14['fromVersion']===_0x335f14['toVersion']);return this['_revisionHistoryService']['updateRevisions'](_0x3721a1,this['_lastRequestId'])['then'](_0x1ea9d5=>(this['_lastRequestId']=_0x1ea9d5,_0x3721a1))['catch'](_0x56e6b6=>{if(P(_0x56e6b6)||'400'===_0x56e6b6['code']&&void 0x0!==_0x56e6b6['data']['wrongRequestId']){for(const _0x453250 of _0x3721a1){!this['_revisionTracker']['repository']['getRevision'](_0x453250['id'])||this['_revisionTracker']['_bufferUpdate'](_0x453250['id'],_0x453250,!0x1);}if(P(_0x56e6b6))throw _0x56e6b6;return _0x3721a1;}throw _0x56e6b6;});}},this['listenTo'](this['_revisionHistoryService'],'revisionsUpdated',(_0x35f93d,{revisionsData:_0x5a7dc6,requestId:_0x35b8ef})=>{Math['max'](..._0x5a7dc6['map'](_0x54275b=>_0x54275b['toVersion']))>this['_getLatestVersionFromServerOperations']()-0x1?this['_getLatestVersion']()['then'](()=>{this['_handleRevisionsUpdate'](_0x5a7dc6,_0x35b8ef);}):this['_handleRevisionsUpdate'](_0x5a7dc6,_0x35b8ef);});const {revisions:_0x341e3d,requestId:_0x1bcb4d}=await this['_revisionHistoryService']['connect'](_0x56d5a7['connection']);_0x56d5a7['addToReconnectionStack'](this),this['_lastRequestId']=_0x1bcb4d,await this['_fetchMissingUsers'](_0x341e3d);for(const _0x5c9920 of _0x341e3d)this['_revisionTracker']['addRevisionData'](_0x5c9920);this['listenTo'](_0x185e1d,'change:_isConnected',(_0xa5af02,_0x3b15cd,_0x485d6e)=>{_0x485d6e&&(this['_oldOffset']=_0x185e1d['_offset'],_0xa5af02['off']());}),this['_revisionTracker']['bind']('isEnabled')['to'](_0x56d5a7,'state',_0x180a0a=>_0x180a0a===_0x43ade7['CONNECTED']);}async['reconnect'](){const _0x43b945=this['editor']['plugins']['get'](n),_0x5163cd=this['editor']['plugins']['get'](l),_0x454b21=async()=>{const _0x44f9d4=this['_revisionTracker']['currentRevision'],_0x343eb5=_0x44f9d4['id'],_0x12b363=_0x343eb5!==_0x5163cd['sessionId'];if(_0x12b363){const _0x279778=_0x5163cd['_offset']-this['_oldOffset'],_0xbe7fda=this['_getLatestVersionFromServerOperations']();this['_revisionTracker']['_revisionDataBuilder']['reInit']();if(_0x44f9d4['toVersion']+_0x279778!==_0xbe7fda){const _0x1d03cc=_0x44f9d4['fromVersion']+_0x279778,_0x45e401=this['editor']['plugins']['get'](_0x492d3c),_0x9cbada=this['_revisionTracker']['buildRevisionData']({'revision':_0x44f9d4,'from':_0x1d03cc,'to':_0xbe7fda});_0x9cbada['id']=_0x44f9d4['id'];const _0x4e8449=_0x9cbada['authorsIds']['map'](_0x2fdef2=>_0x45e401['getUser'](_0x2fdef2));_0x44f9d4['_update']({..._0x9cbada,'authors':_0x4e8449},!0x0),this['_revisionTracker']['_bufferUpdate'](_0x44f9d4['id'],_0x9cbada,!0x0);}this['_revisionTracker']['_startingVersion']=_0xbe7fda,(_0x44f9d4['toVersion']===_0x44f9d4['fromVersion']&&!this['_revisionTracker']['_bufferedUpdates']['has'](_0x343eb5)&&this['_revisionTracker']['repository']['_revisions']['remove'](_0x343eb5),this['_revisionTracker']['_createCurrentRevision'](_0xbe7fda));}const {revisions:_0x38e827,requestId:_0x4e418b}=await this['_revisionHistoryService']['reconnect'](_0x43b945['connection'],this['_lastRequestId']);_0x12b363&&_0x38e827['length']>0x0?_0x5163cd['_handleReconnectionError']():(await this['_fetchMissingUsers'](_0x38e827),this['_handleRevisionsUpdate'](_0x38e827,_0x4e418b),this['_revisionTracker']['sendBufferedUpdates']());};return _0x5163cd['_isConnected']?_0x454b21():new Promise((_0x54285f,_0x3c5fef)=>{_0x5163cd['once']('change:_isConnected',()=>{_0x454b21()['then'](_0x54285f)['catch'](_0x3c5fef);});});}['destroy'](){super['destroy']();}async['_waitForServiceReady'](){this['_revisionHistoryService']['isConnected']||await new Promise(_0x3fd5e4=>{this['listenTo'](this['_revisionHistoryService'],'connected',_0x3ad5bd=>{_0x3ad5bd['off'](),_0x3fd5e4();});});}['_getLatestVersionFromServerOperations'](){const _0x5c016a=this['editor']['plugins']['get'](l)['serverHistory']['getOperations']()['reverse']();for(const _0x3c774d of _0x5c016a)if('marker'!==_0x3c774d['type']||_0x3c774d['affectsData'])return _0x3c774d['baseVersion']+0x1;}['_getLatestVersion'](){const _0x57bcb2=this['editor']['plugins']['get'](l);return new Promise(_0x42c40c=>{_0x57bcb2['_isPendingUpdate']?_0x57bcb2['once']('change:_isPendingUpdate',()=>{_0x42c40c(this['_getLatestVersionFromServerOperations']());}):_0x42c40c(this['_getLatestVersionFromServerOperations']());});}['_handleRevisionsUpdate'](_0x48001d,_0x2fb64a){const _0xd2f568=this['_revisionTracker']['repository'];this['_lastRequestId']=_0x2fb64a;for(const _0x518208 of _0x48001d){const _0x2d0c58=_0xd2f568['getRevision'](_0x518208['id']);if(_0x2d0c58){if((_0x518208['fromVersion']||_0x518208['toVersion'])&&(_0x518208['diffData']=null),_0x2d0c58===this['_revisionTracker']['currentRevision']){const _0x34d10d=Math['max'](_0x2d0c58['toVersion'],_0x518208['toVersion']),_0xc90b5d=Math['max'](_0x2d0c58['fromVersion'],_0x518208['fromVersion']);let _0x39c401;_0x2d0c58['toVersion']===_0x518208['toVersion']&&_0x2d0c58['fromVersion']===_0x518208['fromVersion']?(_0x39c401=!0x0,this['_preventResendingRevisionData'](_0x518208)):_0x518208['toVersion']===_0x34d10d&&_0x518208['fromVersion']===_0xc90b5d?_0x39c401=!0x1:(_0x2d0c58['toVersion']===_0x34d10d&&_0x2d0c58['fromVersion']===_0xc90b5d||this['_fixRevision']({'revision':_0x2d0c58,'from':_0xc90b5d,'to':_0x34d10d}),_0x39c401=!0x0),_0x39c401&&(delete _0x518208['fromVersion'],delete _0x518208['toVersion'],delete _0x518208['diffData'],delete _0x518208['createdAt'],delete _0x518208['authorsIds']);}this['_revisionTracker']['setRevisionData'](_0x518208),this['_preventResendingRevisionData'](_0x518208);}else this['_revisionTracker']['addRevisionData'](_0x518208);}const _0x36d379=_0xd2f568['getRevisions']();_0x36d379['reverse']();for(let _0x5cd2cc=0x0;_0x5cd2cc<_0x36d379['length']-0x1;_0x5cd2cc++){const _0x16630d=_0x36d379[_0x5cd2cc],_0x568470=_0x36d379[_0x5cd2cc+0x1];if(_0x16630d['fromVersion']<_0x568470['toVersion']){const _0x10ac7b=_0x568470['toVersion'],_0xf8112a=Math['max'](_0x10ac7b,_0x16630d['toVersion']);this['_fixRevision']({'revision':_0x16630d,'from':_0x10ac7b,'to':_0xf8112a});}}}['_fixRevision']({revision:_0x401263,from:_0x19d23f,to:_0x593351}={}){const _0x23b1bc=this['editor']['plugins']['get'](_0x492d3c),_0x52b41b=this['_revisionTracker']['buildRevisionData']({'revision':_0x401263,'from':_0x19d23f,'to':_0x593351});_0x52b41b['authors']=_0x52b41b['authorsIds']['map'](_0x499e37=>_0x23b1bc['getUser'](_0x499e37)),_0x401263['_update'](_0x52b41b);}['_preventResendingRevisionData'](_0x33d4e2){const _0xbc0336={};_0xbc0336['id']=_0x33d4e2['id'];for(const _0x1d269d of Object['keys'](_0x33d4e2))'id'!==_0x1d269d&&(_0xbc0336[_0x1d269d]=void 0x0);this['_revisionTracker']['_bufferUpdate'](_0xbc0336['id'],_0xbc0336,!0x0);}async['_fetchMissingUsers'](_0x4bac73){const _0x4eb5b1=this['editor']['plugins']['get'](_0x492d3c),{connection:_0xf7976b}=this['editor']['plugins']['get'](n),_0x1167df=new Set();for(const _0x129c45 of _0x4bac73){for(const _0x4c85db of _0x129c45['authorsIds'])_0x123b8c(_0x4c85db);_0x129c45['creatorId']&&_0x123b8c(_0x129c45['creatorId']);}if(0x0===_0x1167df['size'])return;const _0x4f52e2=await ct['getMany'](_0xf7976b,Array['from'](_0x1167df));for(const _0x571eab of _0x4f52e2)_0x4eb5b1['getUser'](_0x571eab['id'])||_0x4eb5b1['addUser'](_0x571eab);function _0x123b8c(_0x8b6c2a){_0x4eb5b1['getUser'](_0x8b6c2a)||_0x1167df['add'](_0x8b6c2a);}}}function P(_0x5e50bb){return _0x5e50bb['message']['startsWith']('cloud-services-internal-error:\x20Revision\x20History\x20Service\x20is\x20not\x20connected.')||_0x5e50bb['message']['startsWith']('cloud-services-internal-error:\x20Not\x20connected.')||_0x5e50bb['message']['startsWith']('cloud-services-internal-error:\x20Request\x20timeout.');}class dt extends _0x5646ee{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 _0xcfa12d{['_collapseAt'];constructor(_0x554815,_0x5078fb=0x6){super(_0x554815);const _0x1c8bcf=this['bindTemplate'];this['set']('isHidden',!0x0),this['set']('usersCount',0x0),this['_collapseAt']=_0x5078fb,this['bind']('isHidden')['to'](this,'usersCount',_0x2b899b=>_0x2b899b<_0x5078fb),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item',_0x1c8bcf['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':_0x1c8bcf['to']('usersCount',_0x10eba4=>'+'+(_0x10eba4-this['_collapseAt']+0x2)['toString']())}]}]}]});}}class is extends _0xcfa12d{['items'];['keystrokes'];constructor(_0x4d1a93){super(_0x4d1a93);const _0x267a32=this['bindTemplate'];this['items']=this['createCollection'](),this['keystrokes']=new _0x2a54a2(),this['set']({'hasPopup':!0x1,'isExpanded':!0x1}),this['setTemplate']({'tag':'div','attributes':{'aria-haspopup':_0x267a32['if']('hasPopup'),'aria-expanded':_0x267a32['to']('isExpanded',_0x2fd2f3=>this['hasPopup']&&String(_0x2fd2f3)),'aria-label':_0x267a32['to']('hasPopup',_0x4965a3=>K(_0x4d1a93,_0x4965a3?'Collapsed\x20connected\x20users\x20list\x20(press\x20ENTER\x20to\x20open\x20it)':'Connected\x20users\x20list')),'role':'list','tabindex':_0x267a32['to']('hasPopup',_0x21fd14=>!!_0x21fd14&&0x0),'class':['ck','ck-presence-list__list']},'children':this['items'],'on':{'mouseenter':_0x267a32['to'](()=>this['fire']('presencelist:show')),'mouseleave':_0x267a32['to'](_0x5509e8=>{const _0x41aee6=_0x5509e8,_0x61d2e8=document['querySelector']('.ck-presence-list__dropdown-list'),_0x202b5f=document['querySelector']('.ck-balloon-panel_with-arrow');_0x61d2e8?.['contains'](_0x41aee6['relatedTarget'])||_0x202b5f?.['contains'](_0x41aee6['relatedTarget'])||this['fire']('presencelist:hide');})}}),this['on']('change:hasPopup',(_0x8dadf3,_0x2e1fe9,_0xa985d)=>{this['element']&&(_0xa985d?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 _0xcfa12d{['counterView'];['inlineListView'];constructor(_0x54fea6,_0x246290=0x6){super(_0x54fea6);const _0x3ef419=this['bindTemplate'];this['set']('isCollapsed',!0x0),this['counterView']=new b(this['locale'],_0x246290),this['inlineListView']=new is(_0x54fea6),this['inlineListView']['bind']('hasPopup')['to'](this,'isCollapsed'),this['listenTo'](this['inlineListView']['items'],'change',()=>{for(const _0x549f9d of this['inlineListView']['items'])_0x549f9d['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',_0x3ef419['if']('isCollapsed','ck-presence-list--collapsed')]},'children':[this['inlineListView']]});}}class L extends _0xcfa12d{['listWrapperView'];constructor(_0x17e673,_0x3ebfe7){super(_0x17e673);const _0x9c3817=this['bindTemplate'];this['listWrapperView']=new ut(_0x17e673,_0x3ebfe7),this['setTemplate']({'tag':'div','attributes':{'tabindex':-0x1,'role':'application','class':['ck','ck-presence-list__dropdown-list'],'aria-label':K(_0x17e673,'Connected\x20users\x20list\x20dropdown\x20menu')},'children':[this['listWrapperView']],'on':{'mouseleave':_0x9c3817['to'](_0x228935=>{const _0x1a0628=_0x228935,_0x40d903=document['querySelector']('.ck-presence-list__list'),_0x48a951=document['querySelector']('.ck-balloon-panel_with-arrow');_0x40d903?.['contains'](_0x1a0628['relatedTarget'])||_0x48a951?.['contains'](_0x1a0628['relatedTarget'])||this['fire']('presencelist:hide');})}});}}class ut extends _0x42b975{constructor(_0x401630,_0x289890){super(_0x401630);const _0x217abe=this['bindTemplate'];this['set']('_isScrollable',!0x1),this['setTemplate']({'tag':_0x289890?'div':'ul','attributes':{'class':['ck','ck-reset','ck-list','ck-presence-list__dropdown-list-wrapper',_0x217abe['if']('_isScrollable','ck-presence-list__dropdown-list-wrapper_scrollable')],'role':_0x217abe['to']('role'),'aria-label':_0x217abe['to']('ariaLabel'),'aria-labelledby':_0x217abe['to']('ariaLabelledBy')},'children':this['items']}),this['listenTo'](_0x24b4b2['window'],'resize',()=>this['checkIfScrollable']()),this['items']['on']('change',()=>this['checkIfScrollable']());}['render'](){super['render'](),this['checkIfScrollable']();}['checkIfScrollable'](){const _0x7acca2=this['element'];_0x7acca2&&(this['_isScrollable']=Math['max'](_0x7acca2['scrollHeight'],_0x7acca2['clientHeight'])>0.8*window['innerHeight']);}}class j extends et{['userView'];constructor(_0x5c057d,_0x1fcf3d,_0x1346a7){super(_0x5c057d);const _0x40b6e2=this['bindTemplate'];this['userView']=new st(_0x5c057d,_0x1fcf3d);const _0x2b105d={'tag':'li','attributes':{'class':['ck','ck-presence-list__dropdown-list-item'],'tabindex':-0x1,'role':'presentation','aria-label':_0x1fcf3d['name']},'children':[this['userView'],{'tag':'span','attributes':{'class':['ck','ck-user__full-name']},'children':[{'text':_0x1fcf3d['name']}]},{'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x1fcf3d['color']['getBackgroundColorClass']()],'aria-hidden':'true'}}]};_0x1346a7&&(_0x2b105d['tag']='button',_0x2b105d['on']={'click':_0x40b6e2['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x2b105d);}['focus'](){this['element']['focus']();}}class A extends _0xcfa12d{['userView'];['markerView'];constructor(_0x4b3e07,_0xbb4582,_0x202698){super(_0x4b3e07);const _0x2bca23=this['bindTemplate'];this['set']('isFocusable',!0x1),this['set']('hasTooltip',!0x0),this['set']('tooltipPosition',''),this['userView']=new st(_0x4b3e07,_0xbb4582),this['markerView']=new ot(_0x4b3e07,_0xbb4582);const _0x4bc224=new it(_0x4b3e07);_0x4bc224['template']['tag']='span',_0x4bc224['text']=_0xbb4582['name'];const _0x3d953b={'tag':'div','attributes':{'class':['ck','ck-presence-list__list-item'],'role':'listitem','tabindex':_0x2bca23['to']('isFocusable',_0x42c580=>!!_0x42c580&&0x0),'aria-labelledby':_0x4bc224['id'],'data-cke-tooltip-text':this['userView']['name'],'data-cke-tooltip-position':_0x2bca23['to']('tooltipPosition'),'data-cke-tooltip-disabled':_0x2bca23['to']('hasTooltip',_0x3a754e=>!_0x3a754e),'data-cke-tooltip-class':'ck-presence-list__list-item__tooltip'},'children':[this['userView'],this['markerView'],_0x4bc224]};_0x202698&&(_0x3d953b['tag']='button',_0x3d953b['on']={'click':_0x2bca23['to'](()=>this['fire']('execute'))}),this['setTemplate'](_0x3d953b);}}class ot extends _0xcfa12d{constructor(_0x365c49,_0x182b53){super(_0x365c49),this['setTemplate']({'tag':'span','attributes':{'class':['ck','ck-presence-list__marker',_0x182b53['color']['getBackgroundColorClass']()],'aria-hidden':'true'}});}}const x={'collapseAt':0x6,'displayMe':!0x0};class r extends _0x13341e{['currentDisplayedUsers'];['balloonPanelView'];['view'];['presenceDropdownView'];['_bodyCollection']=null;static get['pluginName'](){return'PresenceListUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x7fbe73){super(_0x7fbe73),this['context']['config']['define']('presenceList',x);const _0x585ab7=_0x7fbe73['config']['get']('presenceList.collapseAt');if('number'!=typeof _0x585ab7)throw new _0x2c9c89('presencelist-collapseat-invalid-format',this);if(_0x585ab7<0x1)throw new _0x2c9c89('presencelist-collapseat-invalid-format',this);this['_allConnectedUsers']=this['context']['plugins']['get'](i)['allConnectedUsers'],this['set']('usersCount',0x0),this['currentDisplayedUsers']=new _0x5a7f2a(),this['balloonPanelView']=new _0x142816(),this['balloonPanelView']['class']='ck\x20ck-presence-list__balloon',this['view']=this['_createView'](),this['presenceDropdownView']=void 0x0;}static get['requires'](){return[i];}['init'](){for(const _0x3260de of this['_allConnectedUsers'])this['_handleUserAdd'](_0x3260de);this['listenTo'](this['_allConnectedUsers'],'add',(_0x5bdd57,_0x58ae3e)=>{this['_handleUserAdd'](_0x58ae3e);}),this['listenTo'](this['_allConnectedUsers'],'remove',(_0x331354,_0x527226)=>{this['_handleUserRemove'](_0x527226);});}['_createView'](){const _0x1079b7=this['context'],_0x8eb0f0=new v(this['context']['locale'],this['context']['config']['get']('presenceList.collapseAt')),_0x3b85fe=this['balloonPanelView'];if(!_0x555b4d(_0x1079b7['config']['get']('presenceList.container')))throw new _0x2c9c89('presencelist-missing-container',this);return _0x8eb0f0['counterView']['bind']('usersCount')['to'](this),_0x8eb0f0['bind']('isCollapsed')['to'](this,'usersCount',_0x9a7c8c=>{const {collapseAt:_0x5a84b4}=_0x1079b7['config']['get']('presenceList'),_0x7a8025=_0x9a7c8c>=_0x5a84b4;if(_0x7a8025&&!_0x8eb0f0['inlineListView']['items']['find'](_0xf299c4=>_0xf299c4 instanceof b)){const _0x2a05a0=this['context']['config']['get']('presenceList.collapseAt')-0x1;this['currentDisplayedUsers']['length']==_0x2a05a0&&this['currentDisplayedUsers']['length']>0x1&&this['currentDisplayedUsers']['remove'](this['currentDisplayedUsers']['length']-0x1),_0x8eb0f0['inlineListView']['items']['add'](_0x8eb0f0['counterView']);}return _0x7a8025||this['hideDropdown'](),_0x7a8025;}),_0x8eb0f0['inlineListView']['items']['bindTo'](this['currentDisplayedUsers'])['using'](_0x406c1c=>{const _0x1671ed=_0x1079b7['config']['get']('presenceList'),_0x390fc2=new A(_0x1079b7['locale'],_0x406c1c,!!_0x1671ed['onClick']);return _0x390fc2['bind']('hasTooltip')['to'](_0x8eb0f0,'isCollapsed',_0x44dba3=>!_0x44dba3),_0x390fc2['bind']('isFocusable')['to'](_0x8eb0f0,'isCollapsed',_0x3c10b1=>!_0x3c10b1),_0x1671ed['onClick']&&this['listenTo'](_0x390fc2,'execute',()=>{this['view']['isCollapsed']||_0x1671ed['onClick'](_0x406c1c,_0x390fc2['element']);}),_0x390fc2;}),this['listenTo'](_0x8eb0f0['inlineListView'],'presencelist:show',()=>{this['view']['isCollapsed']&&this['showDropdown']();}),this['listenTo'](_0x8eb0f0['inlineListView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();}),_0x8eb0f0['inlineListView']['keystrokes']['set']('Enter',(_0x59dcd0,_0x320eca)=>{this['view']['isCollapsed']&&(this['showDropdown'](),_0x320eca());}),_0x8eb0f0['render'](),_0x3b85fe['render'](),_0x33d711({'emitter':_0x8eb0f0,'activator':()=>_0x3b85fe['isVisible'],'contextElements':[_0x3b85fe['element'],_0x8eb0f0['inlineListView']['element']],'callback':()=>this['hideDropdown']()}),_0x1079b7['config']['get']('presenceList.container')['appendChild'](_0x8eb0f0['element']),this['_bodyCollection']=new _0x39c268(this['context']['locale']),this['_bodyCollection']['attachToDom'](),this['_bodyCollection']['add'](this['balloonPanelView']),_0x8eb0f0;}['_handleUserAdd'](_0x529a8a){if(!this['context']['config']['get']('presenceList.displayMe')&&_0x529a8a['isMe'])return;const _0x48687c=this['context']['config']['get']('presenceList.collapseAt')-0x1;for(this['usersCount']++;this['currentDisplayedUsers']['length']>=_0x48687c-(this['view']['isCollapsed']?0x1:0x0)&&this['currentDisplayedUsers']['length']>0x1;)this['currentDisplayedUsers']['remove'](0x1);const _0xd6c14f=_0x529a8a['isMe']?0x0:this['currentDisplayedUsers']['length'];this['currentDisplayedUsers']['add'](_0x529a8a,_0xd6c14f);}['_handleUserRemove'](_0x122039){this['usersCount']--;const {collapseAt:_0x57d45d}=this['context']['config']['get']('presenceList'),_0x30bbde=this['usersCount']>=_0x57d45d;if(this['currentDisplayedUsers']['get'](_0x122039['id']))this['currentDisplayedUsers']['remove'](_0x122039['id']);else{if(_0x30bbde&&this['currentDisplayedUsers']['length']+0x1===_0x57d45d-0x1)return;}if(this['currentDisplayedUsers']['length']+(_0x30bbde?0x1:0x0)<this['usersCount']){for(const _0x48f442 of Array['from'](this['_allConnectedUsers'])['reverse']())if(!this['currentDisplayedUsers']['get'](_0x48f442['id'])&&(this['currentDisplayedUsers']['add'](_0x48f442,Math['min'](this['currentDisplayedUsers']['length']-(_0x30bbde?0x1:0x0),0x1)),this['currentDisplayedUsers']['length']+(_0x30bbde?0x1:0x0)===_0x57d45d-0x1))return;}}['showDropdown'](){if(this['presenceDropdownView'])return;const _0x1b3b81=this['context']['config']['get']('presenceList');this['presenceDropdownView']=new L(this['context']['locale'],!!_0x1b3b81['onClick']),this['view']['inlineListView']['isExpanded']=!0x0,this['listenTo'](this['presenceDropdownView'],'presencelist:hide',()=>{this['presenceDropdownView']&&this['hideDropdown']();});const {listWrapperView:_0x44e312}=this['presenceDropdownView'];_0x44e312['items']['bindTo'](this['_allConnectedUsers'])['using'](_0x5844eb=>{if(!_0x1b3b81['displayMe']&&_0x5844eb['isMe'])return null;const _0x52dad7=new j(this['context']['locale'],_0x5844eb,!!_0x1b3b81['onClick']);return _0x1b3b81['onClick']&&this['listenTo'](_0x52dad7,'execute',()=>{_0x1b3b81['onClick'](_0x5844eb,_0x52dad7['element']);}),_0x52dad7;}),this['balloonPanelView']['content']['add'](this['presenceDropdownView']),this['balloonPanelView']['pin']({'target':this['view']['inlineListView']['element']}),_0x44e312['focus'](),_0x44e312['checkIfScrollable']();const _0x55cdcd=(_0x5ed85e,_0xc653d8)=>{this['hideDropdown'](),this['view']['inlineListView']['focus'](),_0xc653d8();};_0x44e312['keystrokes']['set']('Esc',_0x55cdcd),_0x44e312['keystrokes']['set']('Shift+Tab',_0x55cdcd),_0x44e312['keystrokes']['set']('Tab',(_0x3be272,_0x3b6f8e)=>{!function(_0x12cc5a){const _0x96f543=['a','button','input','select','textarea','[tabindex]','[contenteditable]']['map'](_0x155e8b=>_0x155e8b+':not([disabled]):not([tabindex=\x22-1\x22])')['join'](','),_0x42d85f=[...document['body']['querySelectorAll'](_0x96f543)]['filter'](_0xf7b836=>_0xf7b836===document['activeElement']||_0xf7b836['offsetWidth']+_0xf7b836['offsetHeight']>0x0)['sort']((_0x3b3db3,_0x1b707a)=>(_0x3b3db3['tabIndex']||0x0)-(_0x1b707a['tabIndex']||0x0)),_0x374c23=_0x42d85f['indexOf'](_0x12cc5a),_0x577cc6=_0x42d85f[(_0x374c23+0x1)%_0x42d85f['length']];_0x577cc6&&_0x577cc6['focus']();}(this['view']['element']),this['hideDropdown'](),_0x3b6f8e();}),_0x44e312['focusTracker']['add'](this['view']['element']),_0x44e312['focusTracker']['on']('change:isFocused',(_0x4c9ca3,_0x45e6b5,_0x153b60)=>{_0x153b60||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 _0x13341e{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':_0x3a897d=>0x1!=_0x3a897d}};
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':_0x27003f=>0x1!=_0x27003f}};