@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 • 14 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 _0x5a94ed=_0x237f;(function(_0x4aaa15,_0xa1001f){const _0x56c438=_0x237f,_0x2ed560=_0x4aaa15();while(!![]){try{const _0x3883f4=parseInt(_0x56c438(0x16f))/0x1+-parseInt(_0x56c438(0x173))/0x2*(-parseInt(_0x56c438(0x132))/0x3)+parseInt(_0x56c438(0x16a))/0x4+parseInt(_0x56c438(0x136))/0x5+-parseInt(_0x56c438(0x15a))/0x6+parseInt(_0x56c438(0x131))/0x7+-parseInt(_0x56c438(0x18c))/0x8;if(_0x3883f4===_0xa1001f)break;else _0x2ed560['push'](_0x2ed560['shift']());}catch(_0x27575d){_0x2ed560['push'](_0x2ed560['shift']());}}}(_0x3d91,0x81e66));function _0x3d91(){const _0x320070=['isMe','focusTracker','set','Shift+Tab','[tabindex]','change:isFocused','hasTooltip','plugins','checkIfScrollable','hideDropdown','config','input','presencelist-missing-container','appendChild','presencelist:hide','_bodyCollection','class','locale','join','button','init','2858040eEHgyc','pin','attachToDom','content','element','isOfficialPlugin','presenceList.displayMe','requires','bind','inlineListView','focus','activeElement','[contenteditable]','Enter','showDropdown','counterView','2323932bJDQqn','onClick','_handleUserRemove','isPremiumPlugin','detachFromDom','861854KznbUT','view','bindTo','currentDisplayedUsers','243438iZyBZu','min','using','_allConnectedUsers','select','_createView','context','remove','isRendered','ck\x20ck-presence-list__balloon','offsetWidth','querySelectorAll',':not([disabled]):not([tabindex=\x22-1\x22])','offsetHeight','isExpanded','indexOf','presencelist:show','map','textarea','find','reverse','pluginName','Tab','tabIndex','body','17824752OzwMwD','keystrokes','presencelist-collapseat-invalid-format','items','length','presenceList','presenceList.collapseAt','balloonPanelView','presenceList.container','unpin','execute','usersCount','number','displayMe','6521144GqJZZh','3WJRLcD','render','from','define','3701780mPeYCz','listenTo','isFocusable','allConnectedUsers','presenceDropdownView','sort','filter','isVisible','PresenceListUI','get','destroy','_handleUserAdd','isCollapsed','Esc','add'];_0x3d91=function(){return _0x320070;};return _0x3d91();}import{ContextPlugin as _0x3a201e}from'ckeditor5/src/core.js';import{CKEditorError as _0x4543fe,Collection as _0x5c43ca}from'ckeditor5/src/utils.js';import{clickOutsideHandler as _0x3c9181,BalloonPanelView as _0x12da93,BodyCollection as _0x3427db}from'ckeditor5/src/ui.js';import{isElement as _0x1cf68f}from'es-toolkit/compat';import{Sessions as _0x3ec4f4}from'../realtimecollaborativeediting/sessions.js';import{PresenceListView as _0x2beefc}from'./view/presencelistview.js';import{PresenceCounterView as _0x8ecefa}from'./view/presencecounterview.js';import{PresenceDropdownListView as _0x5be0f9}from'./view/presencedropdownlistview.js';import{PresenceDropdownListItemView as _0x1b9e6e}from'./view/presencedropdownlistitemview.js';import{PresenceInlineListItemView as _0x51580a}from'./view/presenceinlinelistitemview.js';function _0x237f(_0x56c9cc,_0x3d4d13){const _0x3d91f8=_0x3d91();return _0x237f=function(_0x237fe0,_0x5c5c0d){_0x237fe0=_0x237fe0-0x12b;let _0x2ef037=_0x3d91f8[_0x237fe0];return _0x2ef037;},_0x237f(_0x56c9cc,_0x3d4d13);}const x={'collapseAt':0x6,'displayMe':!0x0};export class PresenceListUI extends _0x3a201e{[_0x5a94ed(0x172)];[_0x5a94ed(0x193)];[_0x5a94ed(0x170)];[_0x5a94ed(0x13a)];[_0x5a94ed(0x154)]=null;static get[_0x5a94ed(0x188)](){const _0x4cc74d=_0x5a94ed;return _0x4cc74d(0x13e);}static get[_0x5a94ed(0x15f)](){return!0x0;}static get[_0x5a94ed(0x16d)](){return!0x0;}constructor(_0x496612){const _0x20a33a=_0x5a94ed;super(_0x496612),this[_0x20a33a(0x179)][_0x20a33a(0x14f)][_0x20a33a(0x135)](_0x20a33a(0x191),x);const _0xca3724=_0x496612[_0x20a33a(0x14f)][_0x20a33a(0x13f)](_0x20a33a(0x192));if(_0x20a33a(0x12f)!=typeof _0xca3724)throw new _0x4543fe(_0x20a33a(0x18e),this);if(_0xca3724<0x1)throw new _0x4543fe(_0x20a33a(0x18e),this);this[_0x20a33a(0x176)]=this[_0x20a33a(0x179)][_0x20a33a(0x14c)][_0x20a33a(0x13f)](_0x3ec4f4)[_0x20a33a(0x139)],this[_0x20a33a(0x147)](_0x20a33a(0x12e),0x0),this[_0x20a33a(0x172)]=new _0x5c43ca(),this[_0x20a33a(0x193)]=new _0x12da93(),this[_0x20a33a(0x193)][_0x20a33a(0x155)]=_0x20a33a(0x17c),this[_0x20a33a(0x170)]=this[_0x20a33a(0x178)](),this[_0x20a33a(0x13a)]=void 0x0;}static get[_0x5a94ed(0x161)](){return[_0x3ec4f4];}[_0x5a94ed(0x159)](){const _0x414107=_0x5a94ed;for(const _0x143247 of this[_0x414107(0x176)])this[_0x414107(0x141)](_0x143247);this[_0x414107(0x137)](this[_0x414107(0x176)],_0x414107(0x144),(_0x1b188e,_0xccdaa9)=>{const _0x4344e2=_0x414107;this[_0x4344e2(0x141)](_0xccdaa9);}),this[_0x414107(0x137)](this[_0x414107(0x176)],_0x414107(0x17a),(_0x462f45,_0x12d2ad)=>{const _0x303967=_0x414107;this[_0x303967(0x16c)](_0x12d2ad);});}[_0x5a94ed(0x178)](){const _0x271c4f=_0x5a94ed,_0x58829f=this[_0x271c4f(0x179)],_0x5d463c=new _0x2beefc(this[_0x271c4f(0x179)][_0x271c4f(0x156)],this[_0x271c4f(0x179)][_0x271c4f(0x14f)][_0x271c4f(0x13f)](_0x271c4f(0x192))),_0x2bdaec=this[_0x271c4f(0x193)];if(!_0x1cf68f(_0x58829f[_0x271c4f(0x14f)][_0x271c4f(0x13f)](_0x271c4f(0x12b))))throw new _0x4543fe(_0x271c4f(0x151),this);return _0x5d463c[_0x271c4f(0x169)][_0x271c4f(0x162)](_0x271c4f(0x12e))['to'](this),_0x5d463c[_0x271c4f(0x162)](_0x271c4f(0x142))['to'](this,_0x271c4f(0x12e),_0x38a657=>{const _0x35b879=_0x271c4f,{collapseAt:_0x24a27c}=_0x58829f[_0x35b879(0x14f)][_0x35b879(0x13f)](_0x35b879(0x191)),_0x7b91fa=_0x38a657>=_0x24a27c;if(_0x7b91fa&&!_0x5d463c[_0x35b879(0x163)][_0x35b879(0x18f)][_0x35b879(0x186)](_0x290a69=>_0x290a69 instanceof _0x8ecefa)){const _0x5614cf=this[_0x35b879(0x179)][_0x35b879(0x14f)][_0x35b879(0x13f)](_0x35b879(0x192))-0x1;this[_0x35b879(0x172)][_0x35b879(0x190)]==_0x5614cf&&this[_0x35b879(0x172)][_0x35b879(0x190)]>0x1&&this[_0x35b879(0x172)][_0x35b879(0x17a)](this[_0x35b879(0x172)][_0x35b879(0x190)]-0x1),_0x5d463c[_0x35b879(0x163)][_0x35b879(0x18f)][_0x35b879(0x144)](_0x5d463c[_0x35b879(0x169)]);}return _0x7b91fa||this[_0x35b879(0x14e)](),_0x7b91fa;}),_0x5d463c[_0x271c4f(0x163)][_0x271c4f(0x18f)][_0x271c4f(0x171)](this[_0x271c4f(0x172)])[_0x271c4f(0x175)](_0x5f1d16=>{const _0x50f53f=_0x271c4f,_0x4228eb=_0x58829f[_0x50f53f(0x14f)][_0x50f53f(0x13f)](_0x50f53f(0x191)),_0x4b6904=new _0x51580a(_0x58829f[_0x50f53f(0x156)],_0x5f1d16,!!_0x4228eb[_0x50f53f(0x16b)]);return _0x4b6904[_0x50f53f(0x162)](_0x50f53f(0x14b))['to'](_0x5d463c,_0x50f53f(0x142),_0x150ce9=>!_0x150ce9),_0x4b6904[_0x50f53f(0x162)](_0x50f53f(0x138))['to'](_0x5d463c,_0x50f53f(0x142),_0x2c89c5=>!_0x2c89c5),_0x4228eb[_0x50f53f(0x16b)]&&this[_0x50f53f(0x137)](_0x4b6904,_0x50f53f(0x12d),()=>{const _0x52232b=_0x50f53f;this[_0x52232b(0x170)][_0x52232b(0x142)]||_0x4228eb[_0x52232b(0x16b)](_0x5f1d16,_0x4b6904[_0x52232b(0x15e)]);}),_0x4b6904;}),this[_0x271c4f(0x137)](_0x5d463c[_0x271c4f(0x163)],_0x271c4f(0x183),()=>{const _0x26f0db=_0x271c4f;this[_0x26f0db(0x170)][_0x26f0db(0x142)]&&this[_0x26f0db(0x168)]();}),this[_0x271c4f(0x137)](_0x5d463c[_0x271c4f(0x163)],_0x271c4f(0x153),()=>{const _0x46e314=_0x271c4f;this[_0x46e314(0x13a)]&&this[_0x46e314(0x14e)]();}),_0x5d463c[_0x271c4f(0x163)][_0x271c4f(0x18d)][_0x271c4f(0x147)](_0x271c4f(0x167),(_0x47a2d1,_0x3917e8)=>{const _0x278da3=_0x271c4f;this[_0x278da3(0x170)][_0x278da3(0x142)]&&(this[_0x278da3(0x168)](),_0x3917e8());}),_0x5d463c[_0x271c4f(0x133)](),_0x2bdaec[_0x271c4f(0x133)](),_0x3c9181({'emitter':_0x5d463c,'activator':()=>_0x2bdaec[_0x271c4f(0x13d)],'contextElements':[_0x2bdaec[_0x271c4f(0x15e)],_0x5d463c[_0x271c4f(0x163)][_0x271c4f(0x15e)]],'callback':()=>this[_0x271c4f(0x14e)]()}),_0x58829f[_0x271c4f(0x14f)][_0x271c4f(0x13f)](_0x271c4f(0x12b))[_0x271c4f(0x152)](_0x5d463c[_0x271c4f(0x15e)]),this[_0x271c4f(0x154)]=new _0x3427db(this[_0x271c4f(0x179)][_0x271c4f(0x156)]),this[_0x271c4f(0x154)][_0x271c4f(0x15c)](),this[_0x271c4f(0x154)][_0x271c4f(0x144)](this[_0x271c4f(0x193)]),_0x5d463c;}[_0x5a94ed(0x141)](_0x431c2c){const _0x43cc5e=_0x5a94ed;if(!this[_0x43cc5e(0x179)][_0x43cc5e(0x14f)][_0x43cc5e(0x13f)](_0x43cc5e(0x160))&&_0x431c2c[_0x43cc5e(0x145)])return;const _0x19df86=this[_0x43cc5e(0x179)][_0x43cc5e(0x14f)][_0x43cc5e(0x13f)](_0x43cc5e(0x192))-0x1;for(this[_0x43cc5e(0x12e)]++;this[_0x43cc5e(0x172)][_0x43cc5e(0x190)]>=_0x19df86-(this[_0x43cc5e(0x170)][_0x43cc5e(0x142)]?0x1:0x0)&&this[_0x43cc5e(0x172)][_0x43cc5e(0x190)]>0x1;)this[_0x43cc5e(0x172)][_0x43cc5e(0x17a)](0x1);const _0x56efce=_0x431c2c[_0x43cc5e(0x145)]?0x0:this[_0x43cc5e(0x172)][_0x43cc5e(0x190)];this[_0x43cc5e(0x172)][_0x43cc5e(0x144)](_0x431c2c,_0x56efce);}[_0x5a94ed(0x16c)](_0xeb06c8){const _0x2b352d=_0x5a94ed;this[_0x2b352d(0x12e)]--;const {collapseAt:_0xe6452d}=this[_0x2b352d(0x179)][_0x2b352d(0x14f)][_0x2b352d(0x13f)](_0x2b352d(0x191)),_0x29307e=this[_0x2b352d(0x12e)]>=_0xe6452d;if(this[_0x2b352d(0x172)][_0x2b352d(0x13f)](_0xeb06c8['id']))this[_0x2b352d(0x172)][_0x2b352d(0x17a)](_0xeb06c8['id']);else{if(_0x29307e&&this[_0x2b352d(0x172)][_0x2b352d(0x190)]+0x1===_0xe6452d-0x1)return;}if(this[_0x2b352d(0x172)][_0x2b352d(0x190)]+(_0x29307e?0x1:0x0)<this[_0x2b352d(0x12e)]){for(const _0x29d1f5 of Array[_0x2b352d(0x134)](this[_0x2b352d(0x176)])[_0x2b352d(0x187)]())if(!this[_0x2b352d(0x172)][_0x2b352d(0x13f)](_0x29d1f5['id'])&&(this[_0x2b352d(0x172)][_0x2b352d(0x144)](_0x29d1f5,Math[_0x2b352d(0x174)](this[_0x2b352d(0x172)][_0x2b352d(0x190)]-(_0x29307e?0x1:0x0),0x1)),this[_0x2b352d(0x172)][_0x2b352d(0x190)]+(_0x29307e?0x1:0x0)===_0xe6452d-0x1))return;}}[_0x5a94ed(0x168)](){const _0xd9c357=_0x5a94ed;if(this[_0xd9c357(0x13a)])return;const _0x237669=this[_0xd9c357(0x179)][_0xd9c357(0x14f)][_0xd9c357(0x13f)](_0xd9c357(0x191));this[_0xd9c357(0x13a)]=new _0x5be0f9(this[_0xd9c357(0x179)][_0xd9c357(0x156)],!!_0x237669[_0xd9c357(0x16b)]),this[_0xd9c357(0x170)][_0xd9c357(0x163)][_0xd9c357(0x181)]=!0x0,this[_0xd9c357(0x137)](this[_0xd9c357(0x13a)],_0xd9c357(0x153),()=>{const _0x213ebd=_0xd9c357;this[_0x213ebd(0x13a)]&&this[_0x213ebd(0x14e)]();});const {listWrapperView:_0x4fc367}=this[_0xd9c357(0x13a)];_0x4fc367[_0xd9c357(0x18f)][_0xd9c357(0x171)](this[_0xd9c357(0x176)])[_0xd9c357(0x175)](_0x5b0fa3=>{const _0x364aa5=_0xd9c357;if(!_0x237669[_0x364aa5(0x130)]&&_0x5b0fa3[_0x364aa5(0x145)])return null;const _0x47ccb9=new _0x1b9e6e(this[_0x364aa5(0x179)][_0x364aa5(0x156)],_0x5b0fa3,!!_0x237669[_0x364aa5(0x16b)]);return _0x237669[_0x364aa5(0x16b)]&&this[_0x364aa5(0x137)](_0x47ccb9,_0x364aa5(0x12d),()=>{const _0x338455=_0x364aa5;_0x237669[_0x338455(0x16b)](_0x5b0fa3,_0x47ccb9[_0x338455(0x15e)]);}),_0x47ccb9;}),this[_0xd9c357(0x193)][_0xd9c357(0x15d)][_0xd9c357(0x144)](this[_0xd9c357(0x13a)]),this[_0xd9c357(0x193)][_0xd9c357(0x15b)]({'target':this[_0xd9c357(0x170)][_0xd9c357(0x163)][_0xd9c357(0x15e)]}),_0x4fc367[_0xd9c357(0x164)](),_0x4fc367[_0xd9c357(0x14d)]();const _0x19665d=(_0x5ae5a3,_0xac4e7b)=>{const _0x42094a=_0xd9c357;this[_0x42094a(0x14e)](),this[_0x42094a(0x170)][_0x42094a(0x163)][_0x42094a(0x164)](),_0xac4e7b();};_0x4fc367[_0xd9c357(0x18d)][_0xd9c357(0x147)](_0xd9c357(0x143),_0x19665d),_0x4fc367[_0xd9c357(0x18d)][_0xd9c357(0x147)](_0xd9c357(0x148),_0x19665d),_0x4fc367[_0xd9c357(0x18d)][_0xd9c357(0x147)](_0xd9c357(0x189),(_0x202785,_0x22b718)=>{const _0x25c98a=_0xd9c357;!function(_0x1a5b0c){const _0x5a3d78=_0x237f,_0x41bff7=['a',_0x5a3d78(0x158),_0x5a3d78(0x150),_0x5a3d78(0x177),_0x5a3d78(0x185),_0x5a3d78(0x149),_0x5a3d78(0x166)][_0x5a3d78(0x184)](_0x54ba11=>_0x54ba11+_0x5a3d78(0x17f))[_0x5a3d78(0x157)](','),_0x3e2a5e=[...document[_0x5a3d78(0x18b)][_0x5a3d78(0x17e)](_0x41bff7)][_0x5a3d78(0x13c)](_0x59ae16=>_0x59ae16===document[_0x5a3d78(0x165)]||_0x59ae16[_0x5a3d78(0x17d)]+_0x59ae16[_0x5a3d78(0x180)]>0x0)[_0x5a3d78(0x13b)]((_0x2aef68,_0x17c6ae)=>(_0x2aef68[_0x5a3d78(0x18a)]||0x0)-(_0x17c6ae[_0x5a3d78(0x18a)]||0x0)),_0x5af5c6=_0x3e2a5e[_0x5a3d78(0x182)](_0x1a5b0c),_0x2fa6f5=_0x3e2a5e[(_0x5af5c6+0x1)%_0x3e2a5e[_0x5a3d78(0x190)]];_0x2fa6f5&&_0x2fa6f5[_0x5a3d78(0x164)]();}(this[_0x25c98a(0x170)][_0x25c98a(0x15e)]),this[_0x25c98a(0x14e)](),_0x22b718();}),_0x4fc367[_0xd9c357(0x146)][_0xd9c357(0x144)](this[_0xd9c357(0x170)][_0xd9c357(0x15e)]),_0x4fc367[_0xd9c357(0x146)]['on'](_0xd9c357(0x14a),(_0x4752d7,_0x1718e0,_0x531eb5)=>{const _0x253715=_0xd9c357;_0x531eb5||this[_0x253715(0x14e)]();});}[_0x5a94ed(0x14e)](){const _0x295744=_0x5a94ed;this[_0x295744(0x13a)]&&(this[_0x295744(0x170)][_0x295744(0x163)][_0x295744(0x181)]=!0x1,this[_0x295744(0x193)][_0x295744(0x12c)](),this[_0x295744(0x193)][_0x295744(0x15d)][_0x295744(0x17a)](this[_0x295744(0x13a)]),this[_0x295744(0x13a)][_0x295744(0x140)](),this[_0x295744(0x13a)]=void 0x0);}[_0x5a94ed(0x140)](){const _0x4e8a88=_0x5a94ed;super[_0x4e8a88(0x140)](),this[_0x4e8a88(0x170)]&&this[_0x4e8a88(0x170)][_0x4e8a88(0x17b)]&&this[_0x4e8a88(0x170)][_0x4e8a88(0x140)](),this[_0x4e8a88(0x154)]&&(this[_0x4e8a88(0x154)][_0x4e8a88(0x16e)](),this[_0x4e8a88(0x154)][_0x4e8a88(0x140)](),this[_0x4e8a88(0x154)]=null);}}