UNPKG

@ckeditor/ckeditor5-real-time-collaboration

Version:

A set of CKEditor 5 features enabling real-time collaboration within the editor using CKEditor Cloud Services.

23 lines 8.81 kB
/* * 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 _0x2582b2=_0x41e1;(function(_0x222c91,_0xfc097){const _0x2ec63d=_0x41e1,_0xde3cba=_0x222c91();while(!![]){try{const _0x4517a8=parseInt(_0x2ec63d(0x18d))/0x1*(parseInt(_0x2ec63d(0x197))/0x2)+parseInt(_0x2ec63d(0x15e))/0x3*(-parseInt(_0x2ec63d(0x17b))/0x4)+parseInt(_0x2ec63d(0x174))/0x5*(parseInt(_0x2ec63d(0x195))/0x6)+-parseInt(_0x2ec63d(0x186))/0x7+parseInt(_0x2ec63d(0x18b))/0x8+parseInt(_0x2ec63d(0x178))/0x9+parseInt(_0x2ec63d(0x18c))/0xa;if(_0x4517a8===_0xfc097)break;else _0xde3cba['push'](_0xde3cba['shift']());}catch(_0x3895d9){_0xde3cba['push'](_0xde3cba['shift']());}}}(_0x2a53,0x7de69));import{ContextPlugin as _0x5a52ee}from'ckeditor5/src/core.js';import{Collection as _0x535383,CKEditorError as _0x15687e}from'ckeditor5/src/utils.js';import{WebSocketGateway as _0x373ef1}from'./websocketgateway.js';import{Users as _0x36d5a6}from'ckeditor5-collaboration/src/collaboration-core.js';function _0x41e1(_0x14131a,_0x2c4569){const _0x2a539c=_0x2a53();return _0x41e1=function(_0x41e1c8,_0x378a11){_0x41e1c8=_0x41e1c8-0x15e;let _0x40a4b6=_0x2a539c[_0x41e1c8];return _0x40a4b6;},_0x41e1(_0x14131a,_0x2c4569);}export class Sessions extends _0x5a52ee{[_0x2582b2(0x184)];[_0x2582b2(0x18e)];[_0x2582b2(0x16f)];[_0x2582b2(0x163)];[_0x2582b2(0x192)];[_0x2582b2(0x16e)];static get[_0x2582b2(0x183)](){const _0x4985e5=_0x2582b2;return _0x4985e5(0x168);}static get[_0x2582b2(0x17f)](){return!0x0;}static get[_0x2582b2(0x167)](){return!0x0;}static get[_0x2582b2(0x166)](){return[_0x373ef1,_0x36d5a6];}constructor(_0x5bca55){const _0x3f5a6a=_0x2582b2;super(_0x5bca55),this[_0x3f5a6a(0x184)]=new Map(),this[_0x3f5a6a(0x18e)]=new Map(),this[_0x3f5a6a(0x16f)]=new _0x535383(),this[_0x3f5a6a(0x163)]=new Map(),this[_0x3f5a6a(0x192)]=0x0,this[_0x3f5a6a(0x16e)]=this[_0x3f5a6a(0x19b)][_0x3f5a6a(0x175)][_0x3f5a6a(0x17a)](_0x36d5a6);}[_0x2582b2(0x160)](){const _0x30f0ff=_0x2582b2,_0x356777=this[_0x30f0ff(0x19b)][_0x30f0ff(0x175)][_0x30f0ff(0x17a)](_0x373ef1);this[_0x30f0ff(0x165)](_0x356777,_0x30f0ff(0x170),(_0x2990ad,_0x3ddcd0,_0x19ab85)=>{const _0x168a4d=_0x30f0ff;if(_0x168a4d(0x17c)!==_0x19ab85)this[_0x168a4d(0x184)][_0x168a4d(0x193)](_0x40df63=>_0x40df63[_0x168a4d(0x18a)]()),this[_0x168a4d(0x18e)][_0x168a4d(0x193)](_0x3ebe8f=>_0x3ebe8f[_0x168a4d(0x18a)]()),this[_0x168a4d(0x16f)][_0x168a4d(0x18a)]();else{for(const [_0x3172d0,_0x77f91d]of this[_0x168a4d(0x163)])for(const _0x3fa93c of _0x77f91d)this[_0x168a4d(0x171)](_0x3172d0,_0x3fa93c);}}),this[_0x30f0ff(0x199)](_0x356777[_0x30f0ff(0x172)]['me'],!0x0);}[_0x2582b2(0x194)](_0x4afbdc,_0x4288a0){const _0x5b03be=_0x2582b2;if(this[_0x5b03be(0x163)][_0x5b03be(0x177)](_0x4afbdc))throw new _0x15687e(_0x5b03be(0x173),null,{'channelId':_0x4afbdc});this[_0x5b03be(0x163)][_0x5b03be(0x189)](_0x4afbdc,_0x4288a0),this[_0x5b03be(0x184)][_0x5b03be(0x189)](_0x4afbdc,new _0x535383()),this[_0x5b03be(0x18e)][_0x5b03be(0x189)](_0x4afbdc,new _0x535383()),this[_0x5b03be(0x165)](_0x4288a0,_0x5b03be(0x164),(_0xcec897,_0x2d6ddb)=>this[_0x5b03be(0x171)](_0x4afbdc,_0x2d6ddb)),this[_0x5b03be(0x165)](_0x4288a0,_0x5b03be(0x17d),(_0x4ebcbd,_0x31c64f)=>this[_0x5b03be(0x19a)](_0x4afbdc,_0x31c64f));for(const _0x2d566b of _0x4288a0)this[_0x5b03be(0x171)](_0x4afbdc,_0x2d566b);}[_0x2582b2(0x196)](_0x4ebba2){const _0x224a15=_0x2582b2;if(!this[_0x224a15(0x163)][_0x224a15(0x177)](_0x4ebba2))throw new _0x15687e(_0x224a15(0x188),null,{'channelId':_0x4ebba2});const _0x3ab4cb=this[_0x224a15(0x163)][_0x224a15(0x17a)](_0x4ebba2);this[_0x224a15(0x16a)](_0x3ab4cb);for(const _0x57fcd8 of _0x3ab4cb)_0x224a15(0x17c)===this[_0x224a15(0x19b)][_0x224a15(0x175)][_0x224a15(0x17a)](_0x373ef1)[_0x224a15(0x198)]&&this[_0x224a15(0x19a)](_0x4ebba2,_0x57fcd8);this[_0x224a15(0x163)][_0x224a15(0x18f)](_0x4ebba2),this[_0x224a15(0x184)][_0x224a15(0x18f)](_0x4ebba2),this[_0x224a15(0x18e)][_0x224a15(0x18f)](_0x4ebba2);}get[_0x2582b2(0x179)](){const _0x3fd3a8=_0x2582b2;return this[_0x3fd3a8(0x19b)][_0x3fd3a8(0x175)][_0x3fd3a8(0x17a)](_0x373ef1)[_0x3fd3a8(0x172)][_0x3fd3a8(0x191)];}[_0x2582b2(0x169)](_0x3fe7f2){const _0x540d16=_0x2582b2;for(const _0x184730 of this[_0x540d16(0x184)][_0x540d16(0x16d)]())for(const _0x30991b of _0x184730)if(_0x30991b['id']===_0x3fe7f2)return _0x30991b[_0x540d16(0x190)];}[_0x2582b2(0x181)](_0x172753,_0x3d308b){const _0x1a3b5d=_0x2582b2,_0x28ed71=_0x3d308b?[this[_0x1a3b5d(0x184)][_0x1a3b5d(0x17a)](_0x3d308b)]:this[_0x1a3b5d(0x184)][_0x1a3b5d(0x16d)](),_0x55c8e3=new Set();for(const _0x24c496 of _0x28ed71)for(const _0x5e663 of _0x24c496)_0x5e663[_0x1a3b5d(0x190)]['id']===_0x172753['id']&&_0x55c8e3[_0x1a3b5d(0x164)](_0x5e663['id']);return _0x55c8e3;}[_0x2582b2(0x187)](_0x598403){const _0xc1e375=_0x2582b2;for(const _0x18df73 of this[_0xc1e375(0x184)][_0xc1e375(0x16d)]())for(const _0x3e8946 of _0x18df73)if(_0x3e8946[_0xc1e375(0x190)]===_0x598403)return _0x3e8946[_0xc1e375(0x176)];}[_0x2582b2(0x171)](_0x529de3,_0x425b4b){const _0x365c17=_0x2582b2;if(_0x365c17(0x17c)!==this[_0x365c17(0x19b)][_0x365c17(0x175)][_0x365c17(0x17a)](_0x373ef1)[_0x365c17(0x198)])return;const _0x208129=_0x425b4b[_0x365c17(0x190)],_0x3134cf=this[_0x365c17(0x16e)][_0x365c17(0x161)](_0x208129['id'])||this[_0x365c17(0x199)](_0x208129),_0x457a34=Object[_0x365c17(0x15f)]({},_0x425b4b,{'user':_0x3134cf});this[_0x365c17(0x184)][_0x365c17(0x17a)](_0x529de3)[_0x365c17(0x164)](_0x457a34);const _0x59f742=this[_0x365c17(0x18e)][_0x365c17(0x17a)](_0x529de3);_0x59f742[_0x365c17(0x177)](_0x3134cf['id'])||_0x59f742[_0x365c17(0x164)](_0x3134cf),this[_0x365c17(0x16f)][_0x365c17(0x177)](_0x3134cf['id'])||this[_0x365c17(0x16f)][_0x365c17(0x164)](_0x3134cf,_0x3134cf[_0x365c17(0x17e)]?0x0:void 0x0),this[_0x365c17(0x182)](_0x365c17(0x16b)+_0x529de3,{'channelId':_0x529de3,'session':_0x457a34});}[_0x2582b2(0x19a)](_0x5dcb86,_0x508060){const _0x34b311=_0x2582b2;if(_0x34b311(0x17c)!==this[_0x34b311(0x19b)][_0x34b311(0x175)][_0x34b311(0x17a)](_0x373ef1)[_0x34b311(0x198)])return;const _0x5e339c=this[_0x34b311(0x18e)][_0x34b311(0x17a)](_0x5dcb86),_0x44c7ed=_0x508060[_0x34b311(0x190)];_0x44c7ed['id']&&(this[_0x34b311(0x184)][_0x34b311(0x17a)](_0x5dcb86)[_0x34b311(0x17d)](_0x508060['id']),_0x5e339c[_0x34b311(0x177)](_0x44c7ed['id'])&&!this[_0x34b311(0x181)](_0x44c7ed,_0x5dcb86)[_0x34b311(0x162)]&&_0x5e339c[_0x34b311(0x17d)](_0x44c7ed['id']),this[_0x34b311(0x16f)][_0x34b311(0x17a)](_0x44c7ed['id'])&&!this[_0x34b311(0x181)](_0x44c7ed)[_0x34b311(0x162)]&&this[_0x34b311(0x16f)][_0x34b311(0x17d)](_0x44c7ed['id']));}[_0x2582b2(0x199)](_0x4cf44e,_0xed3b9e){const _0x19e837=_0x2582b2,_0x44d81f=this[_0x19e837(0x16e)][_0x19e837(0x185)](_0x4cf44e);return _0xed3b9e&&this[_0x19e837(0x16e)][_0x19e837(0x180)](_0x4cf44e['id']),_0x44d81f[_0x19e837(0x16c)]=this[_0x19e837(0x192)]++,_0x44d81f;}}function _0x2a53(){const _0x165ae2=['remove','isMe','isOfficialPlugin','defineMe','getUserSessions','fire','pluginName','channelSessions','addUser','2705920KRPYvG','getUserRole','sessions-unregister-not-exist','set','clear','440576fCdfER','2203740YIDepG','212453vRxTYr','channelConnectedUsers','delete','user','sessionId','_uniqueUsersCount','forEach','register','516rTSBgN','unregister','2tLJCwA','state','_createUser','_handleSessionRemove','context','888270FDUHDG','assign','init','getUser','size','_registeredSessions','add','listenTo','requires','isPremiumPlugin','Sessions','getUserBySessionId','stopListening','sessionAdd:','orderNumber','values','_users','allConnectedUsers','change:state','_handleSessionAdd','connection','sessions-register-already-registered','32320XdrwXg','plugins','role','has','1390824KADVBa','mySessionId','get','4meVvuw','connected'];_0x2a53=function(){return _0x165ae2;};return _0x2a53();}