@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 15.6 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 _0x4ccb82=_0x4022;(function(_0xfb329c,_0x39e70c){const _0x5119d1=_0x4022,_0x10fa89=_0xfb329c();while(!![]){try{const _0xc5a832=parseInt(_0x5119d1(0x23f))/0x1+parseInt(_0x5119d1(0x201))/0x2*(-parseInt(_0x5119d1(0x21e))/0x3)+-parseInt(_0x5119d1(0x1f4))/0x4*(-parseInt(_0x5119d1(0x21a))/0x5)+-parseInt(_0x5119d1(0x233))/0x6+parseInt(_0x5119d1(0x22d))/0x7*(-parseInt(_0x5119d1(0x227))/0x8)+-parseInt(_0x5119d1(0x24a))/0x9+-parseInt(_0x5119d1(0x232))/0xa*(parseInt(_0x5119d1(0x211))/0xb);if(_0xc5a832===_0x39e70c)break;else _0x10fa89['push'](_0x10fa89['shift']());}catch(_0x447396){_0x10fa89['push'](_0x10fa89['shift']());}}}(_0xcfb7,0x81802));import{ContextPlugin as _0xf7d903,Context as _0x4214cf}from'ckeditor5/src/core.js';import _0x208e67 from'./annotationsuis.js';import _0x2c45d from'./sidebar.js';function _0x4022(_0x1143a0,_0x2bcb36){const _0xcfb74d=_0xcfb7();return _0x4022=function(_0x402256,_0x3a7015){_0x402256=_0x402256-0x1dc;let _0x59b6fe=_0xcfb74d[_0x402256];return _0x59b6fe;},_0x4022(_0x1143a0,_0x2bcb36);}function _0xcfb7(){const _0x1dabc3=['addEventListener','set:container','24gpfdRu','narrowsidebar-detach-not-attached','keyCode','unpin','hasDomSelection','focus','off','annotationType','stopListening','308032KHRGFm','high','add','isOfficialPlugin','activeAnnotation','view','7igbumh','resize','detachFromDom','northArrowSouthEast','bodyCollection','90TNZUYy','103908GABcRw','isPremiumPlugin','narrowsidebar-attach-already-attached','southArrowNorth','locale','blur','from','destroy','pluginName','_detachFromContainer','stop','refresh','781984SXJXgC','_domEmitter','ck-sidebar--narrow','_editorAnnotations','type','register','context','set','esc','defaultPositions','_hideBalloon','691137dLWcDi','_setSelectedAnnotations','_annotationToNarrowView','rearrange','southArrowNorthWest','listenTo','change:container','editors','getOrderedSelectedAnnotations','detach','focusableElements','contains','create','delete','getByView','init','_attachToContainer','requires','clear','refreshPositioning','length','remove','low','execute','bind','includes','removeEventListener','_selectedAnnotations','_attachListeners','northArrowSouth','find','_showBalloon','northArrowSouthWest','NarrowSidebar','attach','uiUpdate','preventDefault','attachToDom','ready','3669284eqZoCw','keydown','preventClosingBalloon','number','_refreshPositioning','setActiveAnnotation','_annotations','_detachListeners','annotations','isAttached','narrowSidebar','mousedown','getSidebarItemView','114290jkzGAH','change:height','_updateBalloonPosition','values','get','_integrateWithEditorAnnotations','Esc','content','has','first','addAnnotation','isDirty','balloonPanelView','cancel','pin','southArrowNorthEast','707784PtgSJE','EditorAnnotations','isVisible','_destroyEditorAnnotationsIntegration','_manuallyClosedAnnotationViews','plugins','_refreshPositioningDebounced','stopPropagation','target','5yoQwjD','element'];_0xcfb7=function(){return _0x1dabc3;};return _0xcfb7();}import _0x45e9eb from'./view/annotationcounterbuttonview.js';import{BalloonPanelView as _0x4bedfb,BodyCollection as _0x390e58}from'ckeditor5/src/ui.js';import{CKEditorError as _0x432b03,DomEmitterMixin as _0x3c8dae,keyCodes as _0x5bf5be,Collection as _0x33984e}from'ckeditor5/src/utils.js';import'../../theme/sidebar-narrow.css';import{debounce as _0x1261a5}from'lodash-es';export default class n extends _0xf7d903{static get[_0x4ccb82(0x1de)](){return[_0x2c45d,_0x208e67];}static get[_0x4ccb82(0x23b)](){const _0x260cf1=_0x4ccb82;return _0x260cf1(0x1ee);}static get[_0x4ccb82(0x22a)](){return!0x0;}static get[_0x4ccb82(0x234)](){return!0x0;}constructor(_0x1ac8c5){const _0x1df57e=_0x4ccb82;super(_0x1ac8c5),this[_0x1df57e(0x1fd)]=!0x1,this[_0x1df57e(0x215)]=new Set(),this[_0x1df57e(0x240)]=Object[_0x1df57e(0x256)](_0x3c8dae),this[_0x1df57e(0x24c)]=new Map(),this[_0x1df57e(0x246)](_0x1df57e(0x22b),null),this[_0x1df57e(0x1fc)]=null,this[_0x1df57e(0x1e8)]=[],this[_0x1df57e(0x242)]=new _0x33984e(),this[_0x1df57e(0x217)]=_0x1261a5(()=>{const _0x344e22=_0x1df57e;this[_0x344e22(0x1f8)]();},0xfa,{'leading':!0x1});}[_0x4ccb82(0x1dc)](){const _0x3d2677=_0x4ccb82;this[_0x3d2677(0x245)][_0x3d2677(0x216)][_0x3d2677(0x205)](_0x208e67)[_0x3d2677(0x244)](_0x3d2677(0x1fe),this),this[_0x3d2677(0x231)]=new _0x390e58(this[_0x3d2677(0x245)][_0x3d2677(0x237)]),this[_0x3d2677(0x20d)]=new _0x4bedfb(this[_0x3d2677(0x245)][_0x3d2677(0x237)]),this[_0x3d2677(0x231)][_0x3d2677(0x1f2)](),this[_0x3d2677(0x231)][_0x3d2677(0x229)](this[_0x3d2677(0x20d)]);}[_0x4ccb82(0x1ef)](_0x589c3c){const _0x57eb78=_0x4ccb82;this[_0x57eb78(0x1fc)]=_0x589c3c;const _0x160d9d=this[_0x57eb78(0x245)][_0x57eb78(0x216)][_0x57eb78(0x205)](_0x2c45d),_0x383694=this[_0x57eb78(0x20d)];if(_0x160d9d[_0x57eb78(0x1fa)]=_0x589c3c,this[_0x57eb78(0x1fd)])throw new _0x432b03(_0x57eb78(0x235),this);this[_0x57eb78(0x1fd)]=!0x0,this[_0x57eb78(0x24f)](_0x160d9d,_0x57eb78(0x21d),()=>{const _0x577fbe=_0x57eb78;this[_0x577fbe(0x253)](),this[_0x577fbe(0x24f)](_0x160d9d,_0x577fbe(0x250),_0x171fa3=>{const _0x2d8e55=_0x577fbe;_0x171fa3[_0x2d8e55(0x224)](),this[_0x2d8e55(0x1ef)](_0x589c3c);});}),_0x160d9d[_0x57eb78(0x1dd)]({'viewClass':_0x57eb78(0x241),'spaceBetweenItems':0x5});const _0x439080=_0x3ce795=>{const _0x49f22a=_0x57eb78,_0x492521=new _0x45e9eb(this[_0x49f22a(0x245)][_0x49f22a(0x237)]);_0x160d9d[_0x49f22a(0x20b)](_0x3ce795,_0x492521),this[_0x49f22a(0x24c)][_0x49f22a(0x246)](_0x3ce795,_0x492521),_0x492521[_0x49f22a(0x1e5)](_0x49f22a(0x20c),_0x49f22a(0x225),_0x49f22a(0x1f7))['to'](_0x3ce795[_0x49f22a(0x22c)],_0x49f22a(0x20c),_0x49f22a(0x243),_0x49f22a(0x1e1)),_0x492521['on'](_0x49f22a(0x1e4),()=>{const _0x4cddc9=_0x49f22a;this[_0x4cddc9(0x215)][_0x4cddc9(0x1df)](),_0x383694[_0x4cddc9(0x208)][_0x4cddc9(0x20a)]!==_0x3ce795[_0x4cddc9(0x22c)]?(this[_0x4cddc9(0x1ec)](_0x3ce795),_0x3ce795[_0x4cddc9(0x22c)][_0x4cddc9(0x21b)][_0x4cddc9(0x223)](),this[_0x4cddc9(0x1f9)](_0x3ce795)):this[_0x4cddc9(0x1f9)](null);});};for(const _0x31cd13 of _0x589c3c)_0x439080(_0x31cd13);this[_0x57eb78(0x24f)](_0x589c3c,_0x57eb78(0x229),(_0x1ff383,_0xa6eec6)=>{_0x439080(_0xa6eec6);}),this[_0x57eb78(0x24f)](_0x589c3c,_0x57eb78(0x1e2),(_0x26afa8,_0x3efd09,_0x519731)=>{const _0x2032c3=_0x57eb78;this[_0x2032c3(0x24c)][_0x2032c3(0x205)](_0x3efd09)[_0x2032c3(0x23a)](),this[_0x2032c3(0x24c)][_0x2032c3(0x257)](_0x3efd09),_0x160d9d[_0x2032c3(0x24d)]({'removedAnnotation':_0x3efd09,'previousAnnotation':_0x589c3c[_0x2032c3(0x205)](_0x519731-0x1),'nextAnnotation':_0x589c3c[_0x2032c3(0x205)](_0x519731+0x1)}),_0x3efd09===this[_0x2032c3(0x22b)]&&this[_0x2032c3(0x1f9)](null);},{'priority':_0x57eb78(0x1e3)}),this[_0x57eb78(0x24f)](_0x589c3c,_0x57eb78(0x223),(_0xbade07,_0x4b1598)=>{const _0xa6aef7=_0x57eb78;this[_0xa6aef7(0x1f9)](_0x4b1598);}),this[_0x57eb78(0x24f)](_0x589c3c,_0x57eb78(0x238),()=>{const _0x303216=_0x57eb78;this[_0x303216(0x1f9)](null);}),this[_0x57eb78(0x240)][_0x57eb78(0x24f)](document,_0x57eb78(0x1f5),(_0x31f6d1,_0x2a4bd9)=>{const _0x4863a0=_0x57eb78;_0x2a4bd9[_0x4863a0(0x220)]===_0x5bf5be[_0x4863a0(0x247)]&&_0x383694[_0x4863a0(0x213)]&&(this[_0x4863a0(0x215)][_0x4863a0(0x229)](_0x383694[_0x4863a0(0x208)][_0x4863a0(0x20a)]),this[_0x4863a0(0x249)](),_0x2a4bd9[_0x4863a0(0x218)](),_0x2a4bd9[_0x4863a0(0x1f1)]());}),this[_0x57eb78(0x240)][_0x57eb78(0x24f)](document,_0x57eb78(0x1ff),(_0xdc1265,_0x41eceb)=>{const _0x838d17=_0x57eb78,_0x51e787=_0x41eceb[_0x838d17(0x219)];_0x383694[_0x838d17(0x213)]&&_0x383694[_0x838d17(0x21b)][_0x838d17(0x255)](_0x51e787)||_0x160d9d[_0x838d17(0x22c)][_0x838d17(0x21b)][_0x838d17(0x255)](_0x51e787)||_0xdc1265[_0x838d17(0x1f6)]||this[_0x838d17(0x22b)]&&this[_0x838d17(0x22b)][_0x838d17(0x254)][_0x838d17(0x1eb)](_0x14fba6=>_0x14fba6[_0x838d17(0x255)](_0x51e787))||(this[_0x838d17(0x215)][_0x838d17(0x1df)](),this[_0x838d17(0x249)](),this[_0x838d17(0x1f9)](null));});const _0x276b1c=this[_0x57eb78(0x245)]instanceof _0x4214cf?this[_0x57eb78(0x245)][_0x57eb78(0x251)]:new _0x33984e([this[_0x57eb78(0x245)]]);for(const _0x295b55 of _0x276b1c)this[_0x57eb78(0x206)](_0x295b55);this[_0x57eb78(0x24f)](_0x276b1c,_0x57eb78(0x229),(_0xd9b2d,_0xf7540d)=>{const _0x179a23=_0x57eb78;this[_0x179a23(0x24f)](_0xf7540d,_0x179a23(0x1f3),()=>{const _0x38683a=_0x179a23;this[_0x38683a(0x206)](_0xf7540d);});}),this[_0x57eb78(0x24f)](_0x276b1c,_0x57eb78(0x1e2),(_0x3c9f98,_0x5f50a8)=>{const _0x2f67bd=_0x57eb78;_0x5f50a8[_0x2f67bd(0x216)][_0x2f67bd(0x209)](_0x2f67bd(0x212))&&this[_0x2f67bd(0x214)](_0x5f50a8[_0x2f67bd(0x216)][_0x2f67bd(0x205)](_0x2f67bd(0x212)));}),window[_0x57eb78(0x21c)](_0x57eb78(0x22e),this[_0x57eb78(0x217)]),this[_0x57eb78(0x1f8)]();}[_0x4ccb82(0x1f9)](_0xa48c31){const _0x7978fd=_0x4ccb82;if(_0xa48c31===this[_0x7978fd(0x22b)])return;const _0x25f289=this[_0x7978fd(0x245)][_0x7978fd(0x216)][_0x7978fd(0x205)](_0x2c45d);if(_0x25f289[_0x7978fd(0x23e)]({'blurredAnnotation':this[_0x7978fd(0x22b)],'activatedAnnotation':_0xa48c31,'disableAnimationOnActivatedAnnotation':!0x0}),_0xa48c31)_0x25f289[_0x7978fd(0x200)](_0xa48c31)?this[_0x7978fd(0x1ec)](_0xa48c31):this[_0x7978fd(0x249)]();else this[_0x7978fd(0x249)]();this[_0x7978fd(0x22b)]=_0xa48c31;}[_0x4ccb82(0x253)](){const _0x56de98=_0x4ccb82;if(!this[_0x56de98(0x1fd)])throw new _0x432b03(_0x56de98(0x21f),this);this[_0x56de98(0x1f9)](null);const _0x427bfb=this[_0x56de98(0x245)][_0x56de98(0x216)][_0x56de98(0x205)](_0x2c45d);this[_0x56de98(0x249)](),Array[_0x56de98(0x239)](this[_0x56de98(0x24c)][_0x56de98(0x204)](),_0x1c22a5=>_0x1c22a5[_0x56de98(0x23a)]()),this[_0x56de98(0x24c)][_0x56de98(0x1df)](),_0x427bfb[_0x56de98(0x23c)](this[_0x56de98(0x1fc)]),this[_0x56de98(0x226)](),this[_0x56de98(0x240)][_0x56de98(0x226)](),this[_0x56de98(0x245)]instanceof _0x4214cf&&this[_0x56de98(0x226)](this[_0x56de98(0x245)][_0x56de98(0x251)]);for(const _0x3fca10 of Array[_0x56de98(0x239)](this[_0x56de98(0x242)]))this[_0x56de98(0x214)](_0x3fca10);window[_0x56de98(0x1e7)](_0x56de98(0x22e),this[_0x56de98(0x217)]),this[_0x56de98(0x217)][_0x56de98(0x20e)](),this[_0x56de98(0x1e8)]=[],this[_0x56de98(0x1fd)]=!0x1,this[_0x56de98(0x1fc)]=null;}[_0x4ccb82(0x23a)](){const _0x4f6d85=_0x4ccb82;this[_0x4f6d85(0x1fd)]&&this[_0x4f6d85(0x253)](),this[_0x4f6d85(0x231)][_0x4f6d85(0x22f)]();}[_0x4ccb82(0x206)](_0x2b52ac){const _0x4fdc58=_0x4ccb82;if(!_0x2b52ac[_0x4fdc58(0x216)][_0x4fdc58(0x209)](_0x4fdc58(0x212)))return;const _0x51cb8b=_0x2b52ac[_0x4fdc58(0x216)][_0x4fdc58(0x205)](_0x4fdc58(0x212)),_0x382a80=this[_0x4fdc58(0x245)][_0x4fdc58(0x216)][_0x4fdc58(0x205)](_0x2c45d),_0x2da955=this[_0x4fdc58(0x1fc)],_0x1ee490=this[_0x4fdc58(0x20d)],_0x45eb66=()=>{const _0x79675d=_0x4fdc58,_0x282f67=_0x51cb8b[_0x79675d(0x252)]({'annotations':this[_0x79675d(0x1fc)],'activeAnnotation':this[_0x79675d(0x22b)]});this[_0x79675d(0x24b)](_0x282f67),this[_0x79675d(0x1f9)](_0x282f67[0x0]||null);};this[_0x4fdc58(0x24f)](_0x51cb8b,_0x4fdc58(0x23e),_0x45eb66),this[_0x4fdc58(0x24f)](_0x51cb8b,_0x4fdc58(0x238),(_0x2572ec,{isAnnotationTracked:_0x19685f})=>{const _0x4bba49=_0x4fdc58;this[_0x4bba49(0x22b)]&&_0x19685f(this[_0x4bba49(0x22b)])&&(this[_0x4bba49(0x24b)]([]),this[_0x4bba49(0x1f9)](null));}),this[_0x4fdc58(0x24f)](_0x51cb8b,_0x4fdc58(0x1f0),()=>{const _0x11c138=_0x4fdc58;this[_0x11c138(0x217)]();}),this[_0x4fdc58(0x24f)](_0x2da955,_0x4fdc58(0x238),_0x56d7db=>{const _0x55acb6=_0x4fdc58;_0x51cb8b[_0x55acb6(0x222)]()&&_0x56d7db[_0x55acb6(0x23d)]();},{'priority':_0x4fdc58(0x228)}),this[_0x4fdc58(0x24f)](this[_0x4fdc58(0x240)],_0x4fdc58(0x1ff),(_0x4b7578,_0x504f0b)=>{const _0x2fc694=_0x4fdc58,_0xa0f61f=_0x504f0b[_0x2fc694(0x219)];_0x1ee490[_0x2fc694(0x213)]&&_0x1ee490[_0x2fc694(0x21b)][_0x2fc694(0x255)](_0xa0f61f)||_0x382a80[_0x2fc694(0x22c)][_0x2fc694(0x21b)][_0x2fc694(0x255)](_0xa0f61f)||this[_0x2fc694(0x22b)]&&_0x51cb8b[_0x2fc694(0x222)]()&&(_0x45eb66(),_0x4b7578[_0x2fc694(0x1f6)]=!0x0);},{'priority':_0x4fdc58(0x228)}),this[_0x4fdc58(0x242)][_0x4fdc58(0x229)](_0x51cb8b);}[_0x4ccb82(0x214)](_0x43cb80){const _0x3dad90=_0x4ccb82;_0x43cb80&&(this[_0x3dad90(0x226)](_0x43cb80),this[_0x3dad90(0x242)][_0x3dad90(0x1e2)](_0x43cb80));}[_0x4ccb82(0x24b)](_0xa3579e){const _0x47a5c7=_0x4ccb82;for(const _0x116f91 of this[_0x47a5c7(0x1e8)])_0xa3579e[_0x47a5c7(0x1e6)](_0x116f91)||this[_0x47a5c7(0x215)][_0x47a5c7(0x257)](_0x116f91[_0x47a5c7(0x22c)]);this[_0x47a5c7(0x1e8)]=_0xa3579e;}[_0x4ccb82(0x1f8)](){const _0x2af66b=_0x4ccb82,_0x1677d4=this[_0x2af66b(0x20d)];this[_0x2af66b(0x1fc)][_0x2af66b(0x1e0)](),_0x1677d4[_0x2af66b(0x213)]&&this[_0x2af66b(0x203)]();}[_0x4ccb82(0x1ec)](_0x1dc79d){const _0x489363=_0x4ccb82;if(this[_0x489363(0x215)][_0x489363(0x209)](_0x1dc79d[_0x489363(0x22c)]))return;const _0x34af64=this[_0x489363(0x20d)][_0x489363(0x208)][_0x489363(0x20a)];_0x34af64!==_0x1dc79d[_0x489363(0x22c)]?(_0x34af64&&this[_0x489363(0x1fb)](_0x34af64),this[_0x489363(0x1e9)](_0x1dc79d[_0x489363(0x22c)]),this[_0x489363(0x20d)][_0x489363(0x208)][_0x489363(0x1df)](),this[_0x489363(0x20d)][_0x489363(0x208)][_0x489363(0x229)](_0x1dc79d[_0x489363(0x22c)]),this[_0x489363(0x203)]()):this[_0x489363(0x203)]();}[_0x4ccb82(0x203)](){const _0x52b18a=_0x4ccb82,_0x1bb61b=this[_0x52b18a(0x20d)][_0x52b18a(0x208)][_0x52b18a(0x20a)],_0xd1bdeb=_0x1bb61b&&this[_0x52b18a(0x1fc)][_0x52b18a(0x258)](_0x1bb61b);if(!_0xd1bdeb||!this[_0x52b18a(0x24c)][_0x52b18a(0x209)](_0xd1bdeb))return;const _0xd7b80c=this[_0x52b18a(0x24c)][_0x52b18a(0x205)](_0xd1bdeb)[_0x52b18a(0x21b)],_0x21f954=(function(){const _0x242b84=_0x52b18a,_0x1335c0=_0x4bedfb[_0x242b84(0x248)];return[_0x1335c0[_0x242b84(0x210)],_0x1335c0[_0x242b84(0x230)],_0x1335c0[_0x242b84(0x236)],_0x1335c0[_0x242b84(0x1ea)],_0x1335c0[_0x242b84(0x24e)],_0x1335c0[_0x242b84(0x1ed)]];}());this[_0x52b18a(0x20d)][_0x52b18a(0x20f)]({'target':_0xd7b80c,'positions':_0x21f954});}[_0x4ccb82(0x249)](){const _0x191e98=_0x4ccb82,_0x75ed07=this[_0x191e98(0x20d)],_0x220fbd=_0x75ed07[_0x191e98(0x208)][_0x191e98(0x20a)];_0x220fbd&&(this[_0x191e98(0x1fb)](_0x220fbd),_0x75ed07[_0x191e98(0x221)](),_0x75ed07[_0x191e98(0x208)][_0x191e98(0x1df)]());}[_0x4ccb82(0x1e9)](_0x51405e){const _0x57ec22=_0x4ccb82;this[_0x57ec22(0x24f)](_0x51405e,_0x57ec22(0x202),()=>this[_0x57ec22(0x203)]()),this[_0x57ec22(0x24f)](_0x51405e,_0x57ec22(0x207),(_0xafbe71,_0x4971c8)=>{const _0x4ad95d=_0x57ec22;this[_0x4ad95d(0x215)][_0x4ad95d(0x229)](_0x51405e),this[_0x4ad95d(0x249)](),_0x4971c8();});}[_0x4ccb82(0x1fb)](_0x1f3b6c){const _0xa41d10=_0x4ccb82;this[_0xa41d10(0x226)](_0x1f3b6c);}}