@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 13.2 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 _0x5771a7=_0x4df2;(function(_0x3c6746,_0x300282){const _0x184b27=_0x4df2,_0x26ec68=_0x3c6746();while(!![]){try{const _0x5510f5=-parseInt(_0x184b27(0x21a))/0x1+parseInt(_0x184b27(0x1f5))/0x2+parseInt(_0x184b27(0x21b))/0x3*(-parseInt(_0x184b27(0x1ec))/0x4)+parseInt(_0x184b27(0x207))/0x5*(-parseInt(_0x184b27(0x1fd))/0x6)+parseInt(_0x184b27(0x21c))/0x7+parseInt(_0x184b27(0x1f9))/0x8+parseInt(_0x184b27(0x20a))/0x9*(parseInt(_0x184b27(0x1de))/0xa);if(_0x5510f5===_0x300282)break;else _0x26ec68['push'](_0x26ec68['shift']());}catch(_0x2d8908){_0x26ec68['push'](_0x26ec68['shift']());}}}(_0x2fd3,0xbece4));import{ContextPlugin as _0x324b4e}from'ckeditor5/src/core.js';import{Rect as _0x2011ee,CKEditorError as _0x23c467}from'ckeditor5/src/utils.js';import{AnnotationsSidebarView as _0x450e64}from'./view/sidebarview.js';function _0x2fd3(){const _0x2ae2a8=['view','target','change:bottom','_updateLastItem','addAnnotation','isActive','remove','_recalculate','height','_setItemTop','_getTargetTop','sidebar-attachtocontainer-missing-container','_detachFromContainer','max','appendChild','destroy','_alignAfterItem','getSidebarItemView','20IomWqJ','sidebar-setcontainer-invalid-element','delete','_alignForBottomChange','updateHeight','refresh','bottom','bind','_sidebarItemViewToAnnotation','config','length','unbind','stopListening','change:top','76uTnKgx','_createSidebarView','locale','_spaceBetweenItems','push','_alignToTargetRect','_getItemBefore','rearrange','render','2284000dvopvS','_getItemAfter','last','getIndex','9954472DaYKEh','_attachToContainer','context','define','6GxeSxf','_targetTop','isAnimationDisabled','change:_lastItem','_annotationToSidebarItemView','set','Sidebar','clear','pluginName','_alignForTopChange','4374385klhRxq','object','class','1211913tITqQD','minHeight','_lastItem','top','listenTo','isPremiumPlugin','_destroySidebarItemView','_activeAnnotation','element','nodeType','get','_getMaxAvailableTop','list','_recalculateBuffer','sidebar.container','init','748965gBGnPz','114831xIwzmr','3339154SpTiOd','isOfficialPlugin','sidebar.preventScrollOutOfView','_annotations','_alignBeforeItem','change:targetRect','container','content','targetRect','add','setContainer'];_0x2fd3=function(){return _0x2ae2a8;};return _0x2fd3();}function _0x4df2(_0x1c80c5,_0x2698a8){const _0x2fd35c=_0x2fd3();return _0x4df2=function(_0x4df2b5,_0x3d30ca){_0x4df2b5=_0x4df2b5-0x1d7;let _0x59e7e0=_0x2fd35c[_0x4df2b5];return _0x59e7e0;},_0x4df2(_0x1c80c5,_0x2698a8);}import{AnnotationsSidebarItemView as _0x337e48}from'./view/sidebaritemview.js';export class Sidebar extends _0x324b4e{[_0x5771a7(0x227)];[_0x5771a7(0x211)];[_0x5771a7(0x21f)];[_0x5771a7(0x1ef)];[_0x5771a7(0x1e6)];[_0x5771a7(0x201)];[_0x5771a7(0x217)];static get[_0x5771a7(0x205)](){const _0xdf85b0=_0x5771a7;return _0xdf85b0(0x203);}static get[_0x5771a7(0x21d)](){return!0x0;}static get[_0x5771a7(0x20f)](){return!0x0;}constructor(_0x455bfd){const _0xdf4afc=_0x5771a7;super(_0x455bfd),this[_0xdf4afc(0x202)](_0xdf4afc(0x20c),void 0x0),this[_0xdf4afc(0x227)]=this[_0xdf4afc(0x1ed)](),this[_0xdf4afc(0x202)](_0xdf4afc(0x222),null),this[_0xdf4afc(0x1ef)]=0x19,this[_0xdf4afc(0x1e6)]=new Map(),this[_0xdf4afc(0x201)]=new Map(),this[_0xdf4afc(0x1fb)][_0xdf4afc(0x1e7)][_0xdf4afc(0x1fc)](_0xdf4afc(0x21e),!0x1),this[_0xdf4afc(0x21f)]=null,this[_0xdf4afc(0x211)]=null,this[_0xdf4afc(0x217)]=[];}[_0x5771a7(0x219)](){const _0x2b6ffe=_0x5771a7,_0xf46f70=this[_0x2b6ffe(0x1fb)][_0x2b6ffe(0x1e7)][_0x2b6ffe(0x214)](_0x2b6ffe(0x218));_0xf46f70&&this[_0x2b6ffe(0x226)](_0xf46f70);}[_0x5771a7(0x226)](_0x546223){const _0x4e44b9=_0x5771a7;if(!g(_0x546223))throw new _0x23c467(_0x4e44b9(0x1df));this[_0x4e44b9(0x222)]=_0x546223;}[_0x5771a7(0x1fa)]({viewClass:_0x558d4b='',spaceBetweenItems:_0x59a0ec=0x19}={}){const _0x5e8318=_0x5771a7;if(!g(this[_0x5e8318(0x222)]))throw new _0x23c467(_0x5e8318(0x1d7),this);this[_0x5e8318(0x222)][_0x5e8318(0x1da)](this[_0x5e8318(0x227)][_0x5e8318(0x212)]),this[_0x5e8318(0x227)][_0x5e8318(0x209)]=_0x558d4b,this[_0x5e8318(0x1ef)]=_0x59a0ec;}[_0x5771a7(0x1f3)]({removedAnnotation:_0x227c89,previousAnnotation:_0x909150,nextAnnotation:_0x510b87}){const _0x494ab6=_0x5771a7,_0x23788c=this[_0x494ab6(0x1dd)](_0x227c89);this[_0x494ab6(0x227)][_0x494ab6(0x216)][_0x494ab6(0x22d)](_0x23788c),this[_0x494ab6(0x210)](_0x227c89),_0x909150&&this[_0x494ab6(0x1f1)](this[_0x494ab6(0x1dd)](_0x909150)),_0x510b87&&this[_0x494ab6(0x1f1)](this[_0x494ab6(0x1dd)](_0x510b87)),this[_0x494ab6(0x22a)]();}[_0x5771a7(0x1e3)]({blurredAnnotation:_0x3615ea,activatedAnnotation:_0x59f4b4,disableAnimationOnActivatedAnnotation:_0x13ee2b}){const _0x27be3f=_0x5771a7;if(this[_0x27be3f(0x211)]=_0x59f4b4,_0x3615ea){_0x3615ea[_0x27be3f(0x22c)]=!0x1;const _0x38cc94=this[_0x27be3f(0x1dd)](_0x3615ea);_0x38cc94&&_0x13ee2b&&(_0x38cc94[_0x27be3f(0x1ff)]=!0x1);}if(_0x59f4b4){const _0x434b2a=this[_0x27be3f(0x1dd)](_0x59f4b4);_0x434b2a&&(_0x59f4b4[_0x27be3f(0x22c)]=!0x0,_0x13ee2b&&(_0x434b2a[_0x27be3f(0x1ff)]=!0x0,_0x434b2a[_0x27be3f(0x20d)]+=0x1),this[_0x27be3f(0x1f1)](_0x434b2a));}}[_0x5771a7(0x1d8)](_0x26eac8){const _0x1b4ef9=_0x5771a7;if(this[_0x1b4ef9(0x227)][_0x1b4ef9(0x212)][_0x1b4ef9(0x22d)](),_0x26eac8){for(const _0x4764cf of _0x26eac8)this[_0x1b4ef9(0x210)](_0x4764cf);}this[_0x1b4ef9(0x227)][_0x1b4ef9(0x216)][_0x1b4ef9(0x204)](),this[_0x1b4ef9(0x227)][_0x1b4ef9(0x209)]='',this[_0x1b4ef9(0x20c)]=null;}[_0x5771a7(0x22b)](_0x4c463c,_0x1c033c){const _0x2f844d=_0x5771a7;_0x1c033c||(_0x1c033c=_0x4c463c[_0x2f844d(0x227)]);const _0x4b3a08=new _0x337e48(this[_0x2f844d(0x1fb)][_0x2f844d(0x1ee)]);this[_0x2f844d(0x1e6)][_0x2f844d(0x202)](_0x4b3a08,_0x4c463c),this[_0x2f844d(0x201)][_0x2f844d(0x202)](_0x4c463c,_0x4b3a08),_0x4b3a08[_0x2f844d(0x223)][_0x2f844d(0x225)](_0x1c033c),this[_0x2f844d(0x20e)](_0x4c463c[_0x2f844d(0x227)],_0x2f844d(0x221),(_0x237246,_0x19a54d,_0x2e920c)=>{const _0x101edf=_0x2f844d,_0x28dce8=this[_0x101edf(0x231)](_0x4c463c,_0x2e920c);_0x4b3a08[_0x101edf(0x1fe)]!=_0x28dce8&&(_0x4b3a08[_0x101edf(0x1fe)]=_0x28dce8,this[_0x101edf(0x230)](_0x4b3a08,_0x28dce8));}),this[_0x2f844d(0x20e)](_0x4b3a08,_0x2f844d(0x1eb),()=>{const _0x2dec59=_0x2f844d;this[_0x2dec59(0x22e)](_0x4b3a08,_0x2dec59(0x20d));}),this[_0x2f844d(0x20e)](_0x4b3a08,_0x2f844d(0x229),()=>{const _0x511cd5=_0x2f844d;this[_0x511cd5(0x22e)](_0x4b3a08,_0x511cd5(0x1e4));}),this[_0x2f844d(0x1f1)](_0x4b3a08);const _0x4aa18d=this[_0x2f844d(0x1f2)](_0x4b3a08);if(_0x4aa18d)this[_0x2f844d(0x1dc)](_0x4aa18d,_0x4b3a08)||this[_0x2f844d(0x1f1)](_0x4b3a08);else this[_0x2f844d(0x1f1)](_0x4b3a08);return this[_0x2f844d(0x22a)](),this[_0x2f844d(0x227)][_0x2f844d(0x216)][_0x2f844d(0x225)](_0x4b3a08),_0x4b3a08;}[_0x5771a7(0x206)](_0x108a72){const _0x52487f=_0x5771a7;if(!_0x108a72[_0x52487f(0x223)][_0x52487f(0x1e8)])return;const _0xa19589=this[_0x52487f(0x1f2)](_0x108a72);if(!_0xa19589)return;const _0x5b042f=this[_0x52487f(0x1e6)][_0x52487f(0x214)](_0xa19589),_0xa37968=this[_0x52487f(0x211)];_0xa37968&&_0xa37968===_0x5b042f?this[_0x52487f(0x1dc)](_0xa19589,_0x108a72):this[_0x52487f(0x220)](_0x108a72,_0xa19589);}[_0x5771a7(0x1e1)](_0x183e38){const _0x341736=_0x5771a7;if(!_0x183e38[_0x341736(0x223)][_0x341736(0x1e8)])return;const _0x33196f=this[_0x341736(0x1f6)](_0x183e38);if(!_0x33196f)return;const _0x20e5e4=this[_0x341736(0x1e6)][_0x341736(0x214)](_0x33196f),_0x301a86=this[_0x341736(0x1fb)][_0x341736(0x1e7)][_0x341736(0x214)](_0x341736(0x21e)),_0x25d07=this[_0x341736(0x211)];_0x25d07&&_0x25d07===_0x20e5e4&&_0x301a86?(this[_0x341736(0x220)](_0x33196f,_0x183e38),this[_0x341736(0x1dc)](_0x183e38,_0x33196f)):_0x25d07&&_0x25d07===_0x20e5e4?this[_0x341736(0x220)](_0x33196f,_0x183e38):this[_0x341736(0x1dc)](_0x183e38,_0x33196f);}[_0x5771a7(0x22e)](_0x1f5008,_0x52b81b){const _0x148942=_0x5771a7;0x0===this[_0x148942(0x217)][_0x148942(0x1e8)]&&setTimeout(()=>{const _0x229e3e=_0x148942;for(const {sidebarItemView:_0x364d7e,changedProp:_0x41a481}of this[_0x229e3e(0x217)])_0x229e3e(0x20d)===_0x41a481?this[_0x229e3e(0x206)](_0x364d7e):this[_0x229e3e(0x1e1)](_0x364d7e);this[_0x229e3e(0x217)]=[];},0xa),this[_0x148942(0x217)][_0x148942(0x1f0)]({'sidebarItemView':_0x1f5008,'changedProp':_0x52b81b});}[_0x5771a7(0x1dd)](_0x424626){const _0x438349=_0x5771a7;return this[_0x438349(0x201)][_0x438349(0x214)](_0x424626);}[_0x5771a7(0x1db)](){const _0x27c01b=_0x5771a7;this[_0x27c01b(0x1ea)](),this[_0x27c01b(0x227)][_0x27c01b(0x1db)]();}[_0x5771a7(0x210)](_0x2db853){const _0x27c1aa=_0x5771a7,_0x53471c=this[_0x27c1aa(0x1dd)](_0x2db853);this[_0x27c1aa(0x1ea)](_0x53471c),this[_0x27c1aa(0x1ea)](_0x2db853[_0x27c1aa(0x227)]),_0x53471c[_0x27c1aa(0x1db)](),this[_0x27c1aa(0x201)][_0x27c1aa(0x1e0)](_0x2db853),this[_0x27c1aa(0x1e6)][_0x27c1aa(0x1e0)](_0x53471c);}[_0x5771a7(0x1ed)](){const _0x3f051f=_0x5771a7,_0x42cdf6=new _0x450e64(this[_0x3f051f(0x1fb)][_0x3f051f(0x1ee)]);return _0x42cdf6[_0x3f051f(0x1f4)](),this['on'](_0x3f051f(0x200),(_0x16645c,_0x307edf,_0x56d655,_0x2ddf85)=>{const _0x5481f8=_0x3f051f;_0x2ddf85&&_0x42cdf6[_0x5481f8(0x1e9)](_0x5481f8(0x20b)),_0x56d655?_0x42cdf6[_0x5481f8(0x1e5)](_0x5481f8(0x20b))['to'](_0x56d655,_0x5481f8(0x1e4)):_0x42cdf6[_0x5481f8(0x20b)]=null;}),_0x42cdf6;}[_0x5771a7(0x22a)](){const _0x2c3bbf=_0x5771a7;this[_0x2c3bbf(0x20c)]=this[_0x2c3bbf(0x21f)]?.[_0x2c3bbf(0x1f7)]?this[_0x2c3bbf(0x1dd)](this[_0x2c3bbf(0x21f)][_0x2c3bbf(0x1f7)]):null;}[_0x5771a7(0x1f2)](_0x1fc6e6){const _0x557a6b=_0x5771a7,_0x207a9a=this[_0x557a6b(0x1e6)][_0x557a6b(0x214)](_0x1fc6e6),_0x3b0856=_0x207a9a&&this[_0x557a6b(0x21f)]?.[_0x557a6b(0x214)](this[_0x557a6b(0x21f)][_0x557a6b(0x1f8)](_0x207a9a)-0x1);return _0x3b0856&&this[_0x557a6b(0x1dd)](_0x3b0856)||null;}[_0x5771a7(0x1f6)](_0x2fc6cf){const _0x1ae597=_0x5771a7,_0x337e63=this[_0x1ae597(0x1e6)][_0x1ae597(0x214)](_0x2fc6cf),_0x433362=_0x337e63&&this[_0x1ae597(0x21f)]?.[_0x1ae597(0x214)](this[_0x1ae597(0x21f)][_0x1ae597(0x1f8)](_0x337e63)+0x1);return _0x433362&&this[_0x1ae597(0x1dd)](_0x433362)||null;}[_0x5771a7(0x220)](_0x5a09e0,_0x1f495e){const _0x13b705=_0x5771a7;_0x5a09e0[_0x13b705(0x1e2)]();const _0x48395a=G(_0x1f495e[_0x13b705(0x1e4)]+this[_0x13b705(0x1ef)],_0x5a09e0[_0x13b705(0x20d)]);return!!_0x48395a&&(this[_0x13b705(0x230)](_0x1f495e,_0x1f495e[_0x13b705(0x20d)]-_0x48395a),!0x0);}[_0x5771a7(0x1dc)](_0x2b75bb,_0x2f97a2){const _0x3394a8=_0x5771a7;_0x2b75bb[_0x3394a8(0x1e2)]();const _0x1b1173=G(_0x2b75bb[_0x3394a8(0x1e4)]+this[_0x3394a8(0x1ef)],_0x2f97a2[_0x3394a8(0x20d)]);return!!_0x1b1173&&(this[_0x3394a8(0x230)](_0x2f97a2,_0x2f97a2[_0x3394a8(0x20d)]+_0x1b1173,!0x1),!0x0);}[_0x5771a7(0x1f1)](_0x3aecea){const _0x8130b7=_0x5771a7,_0x392787=this[_0x8130b7(0x1e6)][_0x8130b7(0x214)](_0x3aecea);if(!_0x392787||!_0x392787[_0x8130b7(0x228)]||!_0x392787[_0x8130b7(0x224)])return;const _0x4aa8f0=this[_0x8130b7(0x231)](_0x392787,_0x392787[_0x8130b7(0x224)]);this[_0x8130b7(0x230)](_0x3aecea,_0x4aa8f0);}[_0x5771a7(0x231)](_0x2593bd,_0x2f5966){const _0x3fe984=_0x5771a7;if(null===_0x2f5966)return 0x0;if(_0x2593bd[_0x3fe984(0x228)]instanceof _0x2011ee)return _0x2f5966[_0x3fe984(0x20d)];{const _0x46cca5=new _0x2011ee(this[_0x3fe984(0x227)][_0x3fe984(0x212)])[_0x3fe984(0x20d)];return _0x2f5966[_0x3fe984(0x20d)]-_0x46cca5;}}[_0x5771a7(0x230)](_0x43b656,_0x6799d0,_0x1e3b28=this[_0x5771a7(0x1fb)][_0x5771a7(0x1e7)][_0x5771a7(0x214)](_0x5771a7(0x21e))){const _0x1408d3=_0x5771a7;_0x1e3b28&&(_0x6799d0=Math[_0x1408d3(0x1d9)](_0x6799d0,this[_0x1408d3(0x215)](_0x43b656))),_0x43b656[_0x1408d3(0x20d)]=_0x6799d0;}[_0x5771a7(0x215)](_0x267205){const _0xfe9c66=_0x5771a7;let _0x1a2f1b=this[_0xfe9c66(0x1f2)](_0x267205),_0x556f1a=0x0;for(;_0x1a2f1b;)_0x1a2f1b[_0xfe9c66(0x1e2)](),_0x556f1a+=this[_0xfe9c66(0x1ef)]+_0x1a2f1b[_0xfe9c66(0x22f)],_0x1a2f1b=this[_0xfe9c66(0x1f2)](_0x1a2f1b);return _0x556f1a;}}function G(_0x2db27e,_0x201a46){const _0x590cb0=_0x5771a7;return Math[_0x590cb0(0x1d9)](_0x2db27e-_0x201a46,0x0);}function g(_0x3ac85f){const _0xaf07bb=_0x5771a7;return null!==_0x3ac85f&&_0xaf07bb(0x208)==typeof _0x3ac85f&&0x1===_0x3ac85f[_0xaf07bb(0x213)];}