@ckeditor/ckeditor5-real-time-collaboration
Version:
A set of CKEditor 5 features enabling real-time collaboration within the editor using CKEditor Cloud Services.
24 lines • 8.47 kB
JavaScript
/*
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
const _0xfe61dd=_0x5377;function _0xe5ed(){const _0x45ed7d=['8664HlKUrX','_bufferedRequests','catch','14KIwxIi','289371vBlmAn','isOfficialPlugin','originalSuggestionId','size','config','editor','isPremiumPlugin','12EHYoeb','7423fkYxrG','pluginName','CloudServicesTrackChangesAdapter','connected','from','addSuggestionData','then','30VXNTxm','getMany','addToReconnectionStack','connect','state','6wSzcWX','TrackChangesService','reconnect','find','_waitForServiceReady','requires','getUser','addUser','plugins','342175bRJejE','suggestionUpdated','init','_saved','connection','collaboration.channelId','cloud-services-internal-error:\x20Request\x20timeout.','1498MoqSmv','data','values','_trackChangesService','attributes','hasSuggestion','open','3055261voHwQq','getSuggestion','4nDOkdq','listenTo','type','off','adapter','add','cloud-services-internal-error:\x20Not\x20connected.','update','set','get','6125717ZNRgtx','_fetchMissingUsersForThreads','message','delete','isConnected','385209IFyIXq','20GVtNDf','TrackChangesEditing','startsWith'];_0xe5ed=function(){return _0x45ed7d;};return _0xe5ed();}(function(_0x2db035,_0x1bf7df){const _0x349356=_0x5377,_0x53ebc2=_0x2db035();while(!![]){try{const _0x4515f9=-parseInt(_0x349356(0x1ec))/0x1*(-parseInt(_0x349356(0x221))/0x2)+parseInt(_0x349356(0x1e4))/0x3*(parseInt(_0x349356(0x211))/0x4)+parseInt(_0x349356(0x201))/0x5*(-parseInt(_0x349356(0x1f8))/0x6)+-parseInt(_0x349356(0x208))/0x7*(parseInt(_0x349356(0x1e0))/0x8)+parseInt(_0x349356(0x220))/0x9*(parseInt(_0x349356(0x1f3))/0xa)+parseInt(_0x349356(0x20f))/0xb*(-parseInt(_0x349356(0x1eb))/0xc)+parseInt(_0x349356(0x21b))/0xd*(parseInt(_0x349356(0x1e3))/0xe);if(_0x4515f9===_0x1bf7df)break;else _0x53ebc2['push'](_0x53ebc2['shift']());}catch(_0x52631d){_0x53ebc2['push'](_0x53ebc2['shift']());}}}(_0xe5ed,0x2ef5f));import{Plugin as _0x35fda2}from'ckeditor5/src/core.js';import{User as _0x3dea37,TrackChangesService as _0x5efca1}from'@ckeditor/ckeditor-cloud-services-collaboration/src/services.js';import{WebSocketGateway as _0x282535}from'../realtimecollaborativeediting/websocketgateway.js';import{CloudServicesCommentsAdapter as _0x1fc70f}from'../realtimecollaborativecomments/cloudservicescommentsadapter.js';import{Users as _0x5a0446}from'ckeditor5-collaboration/src/collaboration-core.js';class m extends _0x35fda2{static [_0xfe61dd(0x1f9)]=/* #__PURE__ -- @preserve */
((()=>_0x5efca1)());[_0xfe61dd(0x1e1)];[_0xfe61dd(0x20b)];static get[_0xfe61dd(0x1fd)](){const _0x2c159f=_0xfe61dd;return[_0x1fc70f,_0x2c159f(0x222),_0x282535];}static get[_0xfe61dd(0x1ed)](){const _0x591809=_0xfe61dd;return _0x591809(0x1ee);}static get[_0xfe61dd(0x1e5)](){return!0x0;}static get[_0xfe61dd(0x1ea)](){return!0x0;}constructor(_0x2440e9){const _0x14853a=_0xfe61dd;super(_0x2440e9);const _0x23ec8a=this[_0x14853a(0x1e9)][_0x14853a(0x1e8)][_0x14853a(0x21a)](_0x14853a(0x206));this[_0x14853a(0x1e1)]=new Map(),this[_0x14853a(0x20b)]=new m[(_0x14853a(0x1f9))](_0x23ec8a);}[_0xfe61dd(0x203)](){const _0x3d7872=_0xfe61dd,_0x4a9252=this[_0x3d7872(0x1e9)][_0x3d7872(0x200)][_0x3d7872(0x21a)](_0x282535),_0x5f4f09=this[_0x3d7872(0x1e9)][_0x3d7872(0x200)][_0x3d7872(0x21a)](_0x3d7872(0x222));return _0x5f4f09[_0x3d7872(0x215)]={'getSuggestion':async _0x2ce2cc=>{const _0x4b546d=_0x3d7872;await this[_0x4b546d(0x1fc)]();const _0x572229=await this[_0x4b546d(0x20b)][_0x4b546d(0x21a)](_0x2ce2cc)[_0x4b546d(0x1e2)](k);return await this[_0x4b546d(0x21c)]([_0x572229]),_0x572229;},'addSuggestion':async({id:_0x5a6e76,type:_0x630ada,data:_0x5d9602,originalSuggestionId:_0x52e46a,attributes:_0x457e8d})=>{const _0x11fc31=_0x3d7872;await this[_0x11fc31(0x1fc)]();const _0x4c8c4f={'id':_0x5a6e76,'type':_0x630ada,'data':_0x5d9602,'originalSuggestionId':_0x52e46a,'attributes':_0x457e8d},_0x51cced=await this[_0x11fc31(0x20b)][_0x11fc31(0x216)](_0x5a6e76,_0x630ada,_0x5d9602,_0x52e46a,_0x457e8d)[_0x11fc31(0x1e2)](_0x588326=>{if(q(_0x588326))return new Promise(_0x116f73=>{const _0x5ad824=_0x5377;this[_0x5ad824(0x1e1)][_0x5ad824(0x219)](_0x5a6e76,{'resolve':_0x116f73,'suggestionData':_0x4c8c4f});});throw _0x588326;});return this[_0x11fc31(0x1e1)][_0x11fc31(0x21e)](_0x5a6e76),_0x51cced;},'updateSuggestion':async(_0x15fd81,_0x5490b5)=>{const _0xee24a0=_0x3d7872;if(await this[_0xee24a0(0x1fc)](),_0xee24a0(0x20e)!==_0x5490b5[_0xee24a0(0x1f7)])return this[_0xee24a0(0x20b)][_0xee24a0(0x218)](_0x15fd81,_0x5490b5)[_0xee24a0(0x1e2)](k);}},this[_0x3d7872(0x212)](this[_0x3d7872(0x20b)],_0x3d7872(0x202),(_0x181e3e,_0x27f161)=>{const _0x45e1a0=_0x3d7872;_0x5f4f09[_0x45e1a0(0x20d)](_0x27f161['id'])&&(_0x5f4f09[_0x45e1a0(0x210)](_0x27f161['id'])[_0x45e1a0(0x20c)]=_0x27f161[_0x45e1a0(0x20c)]);}),this[_0x3d7872(0x20b)][_0x3d7872(0x1f6)](_0x4a9252[_0x3d7872(0x205)])[_0x3d7872(0x1f2)](_0x214f59=>(_0x4a9252[_0x3d7872(0x1f5)](this),this[_0x3d7872(0x21c)](_0x214f59)[_0x3d7872(0x1f2)](()=>{const _0x59d9e5=_0x3d7872;for(const _0x1533b0 of _0x214f59){_0x5f4f09[_0x59d9e5(0x1f1)](_0x1533b0)[_0x59d9e5(0x204)]=!0x0;}})));}async[_0xfe61dd(0x1fa)](){const _0x2f1bd9=_0xfe61dd,_0x2b4e27=this[_0x2f1bd9(0x1e9)][_0x2f1bd9(0x200)][_0x2f1bd9(0x21a)](_0x2f1bd9(0x222)),{connection:_0x330de8}=this[_0x2f1bd9(0x1e9)][_0x2f1bd9(0x200)][_0x2f1bd9(0x21a)](_0x282535),_0x4a8e6d=await this[_0x2f1bd9(0x20b)][_0x2f1bd9(0x1f6)](_0x330de8);await this[_0x2f1bd9(0x21c)](_0x4a8e6d);for(const {suggestionData:_0x406f43,resolve:_0x1285a1}of this[_0x2f1bd9(0x1e1)][_0x2f1bd9(0x20a)]()){let _0x4347be=_0x4a8e6d[_0x2f1bd9(0x1fb)](_0xfd556a=>_0xfd556a['id']===_0x406f43['id']);_0x4347be||(_0x4347be=await this[_0x2f1bd9(0x20b)][_0x2f1bd9(0x216)](_0x406f43['id'],_0x406f43[_0x2f1bd9(0x213)],_0x406f43[_0x2f1bd9(0x209)],_0x406f43[_0x2f1bd9(0x1e6)])),_0x1285a1(_0x4347be);}for(const _0x402d50 of _0x4a8e6d)_0x2b4e27[_0x2f1bd9(0x20d)](_0x402d50['id'])||_0x2b4e27[_0x2f1bd9(0x1f1)](_0x402d50);}async[_0xfe61dd(0x1fc)](){const _0x5092bf=_0xfe61dd;this[_0x5092bf(0x20b)][_0x5092bf(0x21f)]||await new Promise(_0x3673ce=>{const _0x3334be=_0x5092bf;this[_0x3334be(0x212)](this[_0x3334be(0x20b)],_0x3334be(0x1ef),_0x41d22c=>{const _0x4ded2b=_0x3334be;_0x41d22c[_0x4ded2b(0x214)](),_0x3673ce();});});}async[_0xfe61dd(0x21c)](_0xbadd05){const _0x2c7a35=_0xfe61dd,_0x1b36fc=this[_0x2c7a35(0x1e9)][_0x2c7a35(0x200)][_0x2c7a35(0x21a)](_0x5a0446),{connection:_0x41ac65}=this[_0x2c7a35(0x1e9)][_0x2c7a35(0x200)][_0x2c7a35(0x21a)](_0x282535),_0x40021b=new Set();for(const {authorId:_0x3e98be}of _0xbadd05)_0x1b36fc[_0x2c7a35(0x1fe)](_0x3e98be)||_0x40021b[_0x2c7a35(0x216)](_0x3e98be);if(0x0===_0x40021b[_0x2c7a35(0x1e7)])return;const _0x5d69ec=await _0x3dea37[_0x2c7a35(0x1f4)](_0x41ac65,Array[_0x2c7a35(0x1f0)](_0x40021b));for(const _0x5f433c of _0x5d69ec)_0x1b36fc[_0x2c7a35(0x1fe)](_0x5f433c['id'])||_0x1b36fc[_0x2c7a35(0x1ff)](_0x5f433c);}}export{m as CloudServicesTrackChangesAdapter};function k(_0x3b9476){if(q(_0x3b9476))return new Promise(()=>{});throw _0x3b9476;}function _0x5377(_0x50e19f,_0x2f1d21){const _0xe5edc8=_0xe5ed();return _0x5377=function(_0x5377d5,_0x40a265){_0x5377d5=_0x5377d5-0x1e0;let _0x290062=_0xe5edc8[_0x5377d5];return _0x290062;},_0x5377(_0x50e19f,_0x2f1d21);}function q(_0x528c0c){const _0x50196d=_0xfe61dd;return _0x528c0c[_0x50196d(0x21d)][_0x50196d(0x223)](_0x50196d(0x217))||_0x528c0c[_0x50196d(0x21d)][_0x50196d(0x223)](_0x50196d(0x207));}