@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 12.9 kB
JavaScript
/*
* Copyright (c) 2003-2026, 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
function _0x30bf(){const _0x210455=['object','_sidebarItemViewToAnnotation','container','refresh','sidebar.container','destroy','_alignAfterItem','add','_alignToTargetRect','_annotations','set','_getMaxAvailableTop','length','last','locale','_createSidebarView','560741iIASrb','_recalculateBuffer','_getItemBefore','_detachFromContainer','change:targetRect','render','delete','pluginName','rearrange','stopListening','sidebar.preventScrollOutOfView','setContainer','getSidebarItemView','listenTo','2480608dSynuW','isOfficialPlugin','2271606ErrcfA','_lastItem','isActive','minHeight','target','1541772fJsovg','_setItemTop','sidebar-attachtocontainer-missing-container','define','init','bottom','430922pEVrtG','_attachToContainer','max','updateHeight','1378868MFYiCi','context','appendChild','_getTargetTop','targetRect','_destroySidebarItemView','remove','Sidebar','bind','config','unbind','_getItemAfter','_alignForTopChange','change:_lastItem','view','clear','change:top','addAnnotation','isPremiumPlugin','_recalculate','sidebar-setcontainer-invalid-element','_spaceBetweenItems','get','height','push','_updateLastItem','content','change:bottom','15IPqaLc','_alignForBottomChange','element','7sOfZtv','isAnimationDisabled','getIndex','_alignBeforeItem','list','class','_annotationToSidebarItemView','_activeAnnotation','2706369cLURtl','top','nodeType','_targetTop'];_0x30bf=function(){return _0x210455;};return _0x30bf();}function _0x4152(_0x4c70fc,_0x5a4895){const _0x30bfd9=_0x30bf();return _0x4152=function(_0x41529a,_0x3fa2d1){_0x41529a=_0x41529a-0xb7;let _0x2dd273=_0x30bfd9[_0x41529a];return _0x2dd273;},_0x4152(_0x4c70fc,_0x5a4895);}const _0x947f69=_0x4152;(function(_0x5f11e7,_0x1d4185){const _0x277c9a=_0x4152,_0x429a23=_0x5f11e7();while(!![]){try{const _0x36be3a=-parseInt(_0x277c9a(0xf8))/0x1+-parseInt(_0x277c9a(0xb9))/0x2+parseInt(_0x277c9a(0xe4))/0x3+parseInt(_0x277c9a(0xbd))/0x4*(parseInt(_0x277c9a(0xd9))/0x5)+-parseInt(_0x277c9a(0x108))/0x6*(parseInt(_0x277c9a(0xdc))/0x7)+-parseInt(_0x277c9a(0x106))/0x8+parseInt(_0x277c9a(0x10d))/0x9;if(_0x36be3a===_0x1d4185)break;else _0x429a23['push'](_0x429a23['shift']());}catch(_0x1803f3){_0x429a23['push'](_0x429a23['shift']());}}}(_0x30bf,0x9ce8f));import{ContextPlugin as _0xc647c5}from'ckeditor5/src/core.js';import{Rect as _0x543ca8,CKEditorError as _0x21d4bd}from'ckeditor5/src/utils.js';import{AnnotationsSidebarView as _0x57efce}from'./view/sidebarview.js';import{AnnotationsSidebarItemView as _0x143b2f}from'./view/sidebaritemview.js';export class Sidebar extends _0xc647c5{[_0x947f69(0xcb)];[_0x947f69(0xe3)];[_0x947f69(0xf1)];[_0x947f69(0xd2)];[_0x947f69(0xe9)];[_0x947f69(0xe2)];[_0x947f69(0xf9)];static get[_0x947f69(0xff)](){const _0x1a523b=_0x947f69;return _0x1a523b(0xc4);}static get[_0x947f69(0x107)](){return!0x0;}static get[_0x947f69(0xcf)](){return!0x0;}constructor(_0x3c4b10){const _0x1fe444=_0x947f69;super(_0x3c4b10),this[_0x1fe444(0xf2)](_0x1fe444(0x109),void 0x0),this[_0x1fe444(0xcb)]=this[_0x1fe444(0xf7)](),this[_0x1fe444(0xf2)](_0x1fe444(0xea),null),this[_0x1fe444(0xd2)]=0x19,this[_0x1fe444(0xe9)]=new Map(),this[_0x1fe444(0xe2)]=new Map(),this[_0x1fe444(0xbe)][_0x1fe444(0xc6)][_0x1fe444(0x110)](_0x1fe444(0x102),!0x1),this[_0x1fe444(0xf1)]=null,this[_0x1fe444(0xe3)]=null,this[_0x1fe444(0xf9)]=[];}[_0x947f69(0xb7)](){const _0x4a4ab4=_0x947f69,_0x77625b=this[_0x4a4ab4(0xbe)][_0x4a4ab4(0xc6)][_0x4a4ab4(0xd3)](_0x4a4ab4(0xec));_0x77625b&&this[_0x4a4ab4(0x103)](_0x77625b);}[_0x947f69(0x103)](_0x1e8447){const _0x4b89aa=_0x947f69;if(!g(_0x1e8447))throw new _0x21d4bd(_0x4b89aa(0xd1));this[_0x4b89aa(0xea)]=_0x1e8447;}[_0x947f69(0xba)]({viewClass:_0x107349='',spaceBetweenItems:_0x5ce337=0x19}={}){const _0x34e2ea=_0x947f69;if(!g(this[_0x34e2ea(0xea)]))throw new _0x21d4bd(_0x34e2ea(0x10f),this);this[_0x34e2ea(0xea)][_0x34e2ea(0xbf)](this[_0x34e2ea(0xcb)][_0x34e2ea(0xdb)]),this[_0x34e2ea(0xcb)][_0x34e2ea(0xe1)]=_0x107349,this[_0x34e2ea(0xd2)]=_0x5ce337;}[_0x947f69(0x100)]({removedAnnotation:_0x2e25b7,previousAnnotation:_0x3d5e7f,nextAnnotation:_0x544c23}){const _0x17ae96=_0x947f69,_0x2ee2db=this[_0x17ae96(0x104)](_0x2e25b7);this[_0x17ae96(0xcb)][_0x17ae96(0xe0)][_0x17ae96(0xc3)](_0x2ee2db),this[_0x17ae96(0xc2)](_0x2e25b7),_0x3d5e7f&&this[_0x17ae96(0xf0)](this[_0x17ae96(0x104)](_0x3d5e7f)),_0x544c23&&this[_0x17ae96(0xf0)](this[_0x17ae96(0x104)](_0x544c23)),this[_0x17ae96(0xd6)]();}[_0x947f69(0xeb)]({blurredAnnotation:_0x42b95e,activatedAnnotation:_0x8d21d9,disableAnimationOnActivatedAnnotation:_0x5af29f}){const _0x4d7f67=_0x947f69;if(this[_0x4d7f67(0xe3)]=_0x8d21d9,_0x42b95e){_0x42b95e[_0x4d7f67(0x10a)]=!0x1;const _0x223df2=this[_0x4d7f67(0x104)](_0x42b95e);_0x223df2&&_0x5af29f&&(_0x223df2[_0x4d7f67(0xdd)]=!0x1);}if(_0x8d21d9){const _0x2897a9=this[_0x4d7f67(0x104)](_0x8d21d9);_0x2897a9&&(_0x8d21d9[_0x4d7f67(0x10a)]=!0x0,_0x5af29f&&(_0x2897a9[_0x4d7f67(0xdd)]=!0x0,_0x2897a9[_0x4d7f67(0xe5)]+=0x1),this[_0x4d7f67(0xf0)](_0x2897a9));}}[_0x947f69(0xfb)](_0x119149){const _0x2585e3=_0x947f69;if(this[_0x2585e3(0xcb)][_0x2585e3(0xdb)][_0x2585e3(0xc3)](),_0x119149){for(const _0xe50a6b of _0x119149)this[_0x2585e3(0xc2)](_0xe50a6b);}this[_0x2585e3(0xcb)][_0x2585e3(0xe0)][_0x2585e3(0xcc)](),this[_0x2585e3(0xcb)][_0x2585e3(0xe1)]='',this[_0x2585e3(0x109)]=null;}[_0x947f69(0xce)](_0x368b2d,_0xe4efa7){const _0x37eb56=_0x947f69;_0xe4efa7||(_0xe4efa7=_0x368b2d[_0x37eb56(0xcb)]);const _0x1472d1=new _0x143b2f(this[_0x37eb56(0xbe)][_0x37eb56(0xf6)]);this[_0x37eb56(0xe9)][_0x37eb56(0xf2)](_0x1472d1,_0x368b2d),this[_0x37eb56(0xe2)][_0x37eb56(0xf2)](_0x368b2d,_0x1472d1),_0x1472d1[_0x37eb56(0xd7)][_0x37eb56(0xef)](_0xe4efa7),this[_0x37eb56(0x105)](_0x368b2d[_0x37eb56(0xcb)],_0x37eb56(0xfc),(_0x3ce970,_0x1c1975,_0x5e91fc)=>{const _0x5a9f3b=_0x37eb56,_0x35cc33=this[_0x5a9f3b(0xc0)](_0x368b2d,_0x5e91fc);_0x1472d1[_0x5a9f3b(0xe7)]!=_0x35cc33&&(_0x1472d1[_0x5a9f3b(0xe7)]=_0x35cc33,this[_0x5a9f3b(0x10e)](_0x1472d1,_0x35cc33));}),this[_0x37eb56(0x105)](_0x1472d1,_0x37eb56(0xcd),()=>{const _0x3aaf45=_0x37eb56;this[_0x3aaf45(0xd0)](_0x1472d1,_0x3aaf45(0xe5));}),this[_0x37eb56(0x105)](_0x1472d1,_0x37eb56(0xd8),()=>{const _0x11ec77=_0x37eb56;this[_0x11ec77(0xd0)](_0x1472d1,_0x11ec77(0xb8));}),this[_0x37eb56(0xf0)](_0x1472d1);const _0x2879f5=this[_0x37eb56(0xfa)](_0x1472d1);if(_0x2879f5)this[_0x37eb56(0xee)](_0x2879f5,_0x1472d1)||this[_0x37eb56(0xf0)](_0x1472d1);else this[_0x37eb56(0xf0)](_0x1472d1);return this[_0x37eb56(0xd6)](),this[_0x37eb56(0xcb)][_0x37eb56(0xe0)][_0x37eb56(0xef)](_0x1472d1),_0x1472d1;}[_0x947f69(0xc9)](_0x3d551f){const _0x3cbe7f=_0x947f69;if(!_0x3d551f[_0x3cbe7f(0xd7)][_0x3cbe7f(0xf4)])return;const _0x3701ce=this[_0x3cbe7f(0xfa)](_0x3d551f);if(!_0x3701ce)return;const _0x175193=this[_0x3cbe7f(0xe9)][_0x3cbe7f(0xd3)](_0x3701ce),_0x198c8a=this[_0x3cbe7f(0xe3)];_0x198c8a&&_0x198c8a===_0x175193?this[_0x3cbe7f(0xee)](_0x3701ce,_0x3d551f):this[_0x3cbe7f(0xdf)](_0x3d551f,_0x3701ce);}[_0x947f69(0xda)](_0x1ae7f3){const _0xd2aa2e=_0x947f69;if(!_0x1ae7f3[_0xd2aa2e(0xd7)][_0xd2aa2e(0xf4)])return;const _0x4fcc01=this[_0xd2aa2e(0xc8)](_0x1ae7f3);if(!_0x4fcc01)return;const _0x39f7ac=this[_0xd2aa2e(0xe9)][_0xd2aa2e(0xd3)](_0x4fcc01),_0x3e1700=this[_0xd2aa2e(0xbe)][_0xd2aa2e(0xc6)][_0xd2aa2e(0xd3)](_0xd2aa2e(0x102)),_0x582255=this[_0xd2aa2e(0xe3)];_0x582255&&_0x582255===_0x39f7ac&&_0x3e1700?(this[_0xd2aa2e(0xdf)](_0x4fcc01,_0x1ae7f3),this[_0xd2aa2e(0xee)](_0x1ae7f3,_0x4fcc01)):_0x582255&&_0x582255===_0x39f7ac?this[_0xd2aa2e(0xdf)](_0x4fcc01,_0x1ae7f3):this[_0xd2aa2e(0xee)](_0x1ae7f3,_0x4fcc01);}[_0x947f69(0xd0)](_0x5b1428,_0x27f706){const _0x1b9dae=_0x947f69;0x0===this[_0x1b9dae(0xf9)][_0x1b9dae(0xf4)]&&setTimeout(()=>{const _0x34fb7a=_0x1b9dae;for(const {sidebarItemView:_0x40358d,changedProp:_0x459db2}of this[_0x34fb7a(0xf9)])_0x34fb7a(0xe5)===_0x459db2?this[_0x34fb7a(0xc9)](_0x40358d):this[_0x34fb7a(0xda)](_0x40358d);this[_0x34fb7a(0xf9)]=[];},0xa),this[_0x1b9dae(0xf9)][_0x1b9dae(0xd5)]({'sidebarItemView':_0x5b1428,'changedProp':_0x27f706});}[_0x947f69(0x104)](_0x22077b){const _0x598154=_0x947f69;return this[_0x598154(0xe2)][_0x598154(0xd3)](_0x22077b);}[_0x947f69(0xed)](){const _0x3347a4=_0x947f69;this[_0x3347a4(0x101)](),this[_0x3347a4(0xcb)][_0x3347a4(0xed)]();}[_0x947f69(0xc2)](_0x743f5e){const _0x6cfb86=_0x947f69,_0x5aff22=this[_0x6cfb86(0x104)](_0x743f5e);this[_0x6cfb86(0x101)](_0x5aff22),this[_0x6cfb86(0x101)](_0x743f5e[_0x6cfb86(0xcb)]),_0x5aff22[_0x6cfb86(0xed)](),this[_0x6cfb86(0xe2)][_0x6cfb86(0xfe)](_0x743f5e),this[_0x6cfb86(0xe9)][_0x6cfb86(0xfe)](_0x5aff22);}[_0x947f69(0xf7)](){const _0x4d6f63=_0x947f69,_0x34ad79=new _0x57efce(this[_0x4d6f63(0xbe)][_0x4d6f63(0xf6)]);return _0x34ad79[_0x4d6f63(0xfd)](),this['on'](_0x4d6f63(0xca),(_0x4fcac9,_0x44f11a,_0x3d8627,_0x4e6164)=>{const _0x204e0a=_0x4d6f63;_0x4e6164&&_0x34ad79[_0x204e0a(0xc7)](_0x204e0a(0x10b)),_0x3d8627?_0x34ad79[_0x204e0a(0xc5)](_0x204e0a(0x10b))['to'](_0x3d8627,_0x204e0a(0xb8)):_0x34ad79[_0x204e0a(0x10b)]=null;}),_0x34ad79;}[_0x947f69(0xd6)](){const _0x336781=_0x947f69;this[_0x336781(0x109)]=this[_0x336781(0xf1)]?.[_0x336781(0xf5)]?this[_0x336781(0x104)](this[_0x336781(0xf1)][_0x336781(0xf5)]):null;}[_0x947f69(0xfa)](_0x3472fc){const _0x1952e2=_0x947f69,_0x286949=this[_0x1952e2(0xe9)][_0x1952e2(0xd3)](_0x3472fc),_0x2f777f=_0x286949&&this[_0x1952e2(0xf1)]?.[_0x1952e2(0xd3)](this[_0x1952e2(0xf1)][_0x1952e2(0xde)](_0x286949)-0x1);return _0x2f777f&&this[_0x1952e2(0x104)](_0x2f777f)||null;}[_0x947f69(0xc8)](_0x38d04c){const _0x5ce815=_0x947f69,_0x1c2847=this[_0x5ce815(0xe9)][_0x5ce815(0xd3)](_0x38d04c),_0x5e95a4=_0x1c2847&&this[_0x5ce815(0xf1)]?.[_0x5ce815(0xd3)](this[_0x5ce815(0xf1)][_0x5ce815(0xde)](_0x1c2847)+0x1);return _0x5e95a4&&this[_0x5ce815(0x104)](_0x5e95a4)||null;}[_0x947f69(0xdf)](_0x383fb7,_0x39e484){const _0x431fef=_0x947f69;_0x383fb7[_0x431fef(0xbc)]();const _0x56964f=G(_0x39e484[_0x431fef(0xb8)]+this[_0x431fef(0xd2)],_0x383fb7[_0x431fef(0xe5)]);return!!_0x56964f&&(this[_0x431fef(0x10e)](_0x39e484,_0x39e484[_0x431fef(0xe5)]-_0x56964f),!0x0);}[_0x947f69(0xee)](_0x89e994,_0x16f776){const _0x2d6fcc=_0x947f69;_0x89e994[_0x2d6fcc(0xbc)]();const _0x238814=G(_0x89e994[_0x2d6fcc(0xb8)]+this[_0x2d6fcc(0xd2)],_0x16f776[_0x2d6fcc(0xe5)]);return!!_0x238814&&(this[_0x2d6fcc(0x10e)](_0x16f776,_0x16f776[_0x2d6fcc(0xe5)]+_0x238814,!0x1),!0x0);}[_0x947f69(0xf0)](_0x58567e){const _0xa7ecf0=_0x947f69,_0x30ba88=this[_0xa7ecf0(0xe9)][_0xa7ecf0(0xd3)](_0x58567e);if(!_0x30ba88||!_0x30ba88[_0xa7ecf0(0x10c)]||!_0x30ba88[_0xa7ecf0(0xc1)])return;const _0x17bcfe=this[_0xa7ecf0(0xc0)](_0x30ba88,_0x30ba88[_0xa7ecf0(0xc1)]);this[_0xa7ecf0(0x10e)](_0x58567e,_0x17bcfe);}[_0x947f69(0xc0)](_0x4b6975,_0x548f93){const _0x52c7fb=_0x947f69;if(null===_0x548f93)return 0x0;if(_0x4b6975[_0x52c7fb(0x10c)]instanceof _0x543ca8)return _0x548f93[_0x52c7fb(0xe5)];{const _0x33693a=new _0x543ca8(this[_0x52c7fb(0xcb)][_0x52c7fb(0xdb)])[_0x52c7fb(0xe5)];return _0x548f93[_0x52c7fb(0xe5)]-_0x33693a;}}[_0x947f69(0x10e)](_0x1d723c,_0x5c0ae8,_0x439c49=this[_0x947f69(0xbe)][_0x947f69(0xc6)][_0x947f69(0xd3)](_0x947f69(0x102))){const _0x3e529c=_0x947f69;_0x439c49&&(_0x5c0ae8=Math[_0x3e529c(0xbb)](_0x5c0ae8,this[_0x3e529c(0xf3)](_0x1d723c))),_0x1d723c[_0x3e529c(0xe5)]=_0x5c0ae8;}[_0x947f69(0xf3)](_0x42d6e1){const _0x21d21d=_0x947f69;let _0x32e0cc=this[_0x21d21d(0xfa)](_0x42d6e1),_0x55175c=0x0;for(;_0x32e0cc;)_0x32e0cc[_0x21d21d(0xbc)](),_0x55175c+=this[_0x21d21d(0xd2)]+_0x32e0cc[_0x21d21d(0xd4)],_0x32e0cc=this[_0x21d21d(0xfa)](_0x32e0cc);return _0x55175c;}}function G(_0x375594,_0x19e98a){const _0x5213d6=_0x947f69;return Math[_0x5213d6(0xbb)](_0x375594-_0x19e98a,0x0);}function g(_0x17e4de){const _0x2dba68=_0x947f69;return null!==_0x17e4de&&_0x2dba68(0xe8)==typeof _0x17e4de&&0x1===_0x17e4de[_0x2dba68(0xe6)];}