UNPKG

@ckeditor/ckeditor5-comments

Version:

Collaborative comments feature for CKEditor 5.

23 lines • 12.8 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 _0x32c621=_0x4d4f;function _0x1425(){const _0xaf4c52=['add','element','setContainer','target','length','_alignForTopChange','_getTargetTop','_detachFromContainer','sidebar.container','listenTo','2lSOGdH','container','6785272lNZisM','_getItemBefore','sidebar.preventScrollOutOfView','822114gbedNl','clear','_setItemTop','updateHeight','object','1009290MGfDyL','init','bottom','targetRect','Sidebar','change:targetRect','change:bottom','bind','getSidebarItemView','top','sidebar-setcontainer-invalid-element','nodeType','_annotations','pluginName','_alignAfterItem','_annotationToSidebarItemView','_alignToTargetRect','isOfficialPlugin','_getMaxAvailableTop','_recalculateBuffer','isPremiumPlugin','331570nZpRcg','delete','config','minHeight','_updateLastItem','getIndex','render','_destroySidebarItemView','class','set','content','remove','_recalculate','get','sidebar-attachtocontainer-missing-container','_lastItem','rearrange','_alignForBottomChange','change:_lastItem','1684332fRmglB','stopListening','push','_spaceBetweenItems','refresh','isAnimationDisabled','locale','_targetTop','_createSidebarView','_sidebarItemViewToAnnotation','max','371884fHUpIw','_activeAnnotation','isActive','_getItemAfter','unbind','_alignBeforeItem','addAnnotation','height','destroy','appendChild','context','1561952yqdGAo','define','last','_attachToContainer','view','change:top','list'];_0x1425=function(){return _0xaf4c52;};return _0x1425();}(function(_0xaff2c1,_0x55abcd){const _0x5dd26=_0x4d4f,_0x41b8a6=_0xaff2c1();while(!![]){try{const _0x2b2ce8=-parseInt(_0x5dd26(0xb0))/0x1*(parseInt(_0x5dd26(0x94))/0x2)+-parseInt(_0x5dd26(0xba))/0x3+parseInt(_0x5dd26(0x89))/0x4+parseInt(_0x5dd26(0x76))/0x5+-parseInt(_0x5dd26(0xb5))/0x6+-parseInt(_0x5dd26(0x9f))/0x7+parseInt(_0x5dd26(0xb2))/0x8;if(_0x2b2ce8===_0x55abcd)break;else _0x41b8a6['push'](_0x41b8a6['shift']());}catch(_0x57bceb){_0x41b8a6['push'](_0x41b8a6['shift']());}}}(_0x1425,0x4134f));import{ContextPlugin as _0x52e659}from'ckeditor5/src/core.js';import{Rect as _0x440383,CKEditorError as _0x49c393}from'ckeditor5/src/utils.js';import{AnnotationsSidebarView as _0x32595e}from'./view/sidebarview.js';function _0x4d4f(_0xa39a0b,_0x7a4926){const _0x1425b8=_0x1425();return _0x4d4f=function(_0x4d4fa8,_0x127718){_0x4d4fa8=_0x4d4fa8-0x71;let _0x10b9b4=_0x1425b8[_0x4d4fa8];return _0x10b9b4;},_0x4d4f(_0xa39a0b,_0x7a4926);}import{AnnotationsSidebarItemView as _0x1b5a98}from'./view/sidebaritemview.js';export class Sidebar extends _0x52e659{[_0x32c621(0xa3)];[_0x32c621(0x95)];[_0x32c621(0xc6)];[_0x32c621(0x8c)];[_0x32c621(0x92)];[_0x32c621(0xc9)];[_0x32c621(0x74)];static get[_0x32c621(0xc7)](){const _0x8b43c1=_0x32c621;return _0x8b43c1(0xbe);}static get[_0x32c621(0x72)](){return!0x0;}static get[_0x32c621(0x75)](){return!0x0;}constructor(_0x30f79a){const _0x455972=_0x32c621;super(_0x30f79a),this[_0x455972(0x7f)](_0x455972(0x85),void 0x0),this[_0x455972(0xa3)]=this[_0x455972(0x91)](),this[_0x455972(0x7f)](_0x455972(0xb1),null),this[_0x455972(0x8c)]=0x19,this[_0x455972(0x92)]=new Map(),this[_0x455972(0xc9)]=new Map(),this[_0x455972(0x9e)][_0x455972(0x78)][_0x455972(0xa0)](_0x455972(0xb4),!0x1),this[_0x455972(0xc6)]=null,this[_0x455972(0x95)]=null,this[_0x455972(0x74)]=[];}[_0x32c621(0xbb)](){const _0x262ee3=_0x32c621,_0x337f0b=this[_0x262ee3(0x9e)][_0x262ee3(0x78)][_0x262ee3(0x83)](_0x262ee3(0xae));_0x337f0b&&this[_0x262ee3(0xa8)](_0x337f0b);}[_0x32c621(0xa8)](_0x438a3c){const _0x21f1b1=_0x32c621;if(!g(_0x438a3c))throw new _0x49c393(_0x21f1b1(0xc4));this[_0x21f1b1(0xb1)]=_0x438a3c;}[_0x32c621(0xa2)]({viewClass:_0x5139bb='',spaceBetweenItems:_0x4fcee6=0x19}={}){const _0xb2c66c=_0x32c621;if(!g(this[_0xb2c66c(0xb1)]))throw new _0x49c393(_0xb2c66c(0x84),this);this[_0xb2c66c(0xb1)][_0xb2c66c(0x9d)](this[_0xb2c66c(0xa3)][_0xb2c66c(0xa7)]),this[_0xb2c66c(0xa3)][_0xb2c66c(0x7e)]=_0x5139bb,this[_0xb2c66c(0x8c)]=_0x4fcee6;}[_0x32c621(0x86)]({removedAnnotation:_0x2d60a4,previousAnnotation:_0x4d7c89,nextAnnotation:_0x57b0f7}){const _0x381585=_0x32c621,_0x1d89ec=this[_0x381585(0xc2)](_0x2d60a4);this[_0x381585(0xa3)][_0x381585(0xa5)][_0x381585(0x81)](_0x1d89ec),this[_0x381585(0x7d)](_0x2d60a4),_0x4d7c89&&this[_0x381585(0x71)](this[_0x381585(0xc2)](_0x4d7c89)),_0x57b0f7&&this[_0x381585(0x71)](this[_0x381585(0xc2)](_0x57b0f7)),this[_0x381585(0x7a)]();}[_0x32c621(0x8d)]({blurredAnnotation:_0x3b7ed9,activatedAnnotation:_0x5a1ddd,disableAnimationOnActivatedAnnotation:_0x71a426}){const _0x34188d=_0x32c621;if(this[_0x34188d(0x95)]=_0x5a1ddd,_0x3b7ed9){_0x3b7ed9[_0x34188d(0x96)]=!0x1;const _0x16c68a=this[_0x34188d(0xc2)](_0x3b7ed9);_0x16c68a&&_0x71a426&&(_0x16c68a[_0x34188d(0x8e)]=!0x1);}if(_0x5a1ddd){const _0x24e18e=this[_0x34188d(0xc2)](_0x5a1ddd);_0x24e18e&&(_0x5a1ddd[_0x34188d(0x96)]=!0x0,_0x71a426&&(_0x24e18e[_0x34188d(0x8e)]=!0x0,_0x24e18e[_0x34188d(0xc3)]+=0x1),this[_0x34188d(0x71)](_0x24e18e));}}[_0x32c621(0xad)](_0x1a5222){const _0x1f6390=_0x32c621;if(this[_0x1f6390(0xa3)][_0x1f6390(0xa7)][_0x1f6390(0x81)](),_0x1a5222){for(const _0x516703 of _0x1a5222)this[_0x1f6390(0x7d)](_0x516703);}this[_0x1f6390(0xa3)][_0x1f6390(0xa5)][_0x1f6390(0xb6)](),this[_0x1f6390(0xa3)][_0x1f6390(0x7e)]='',this[_0x1f6390(0x85)]=null;}[_0x32c621(0x9a)](_0x10434f,_0x1058f3){const _0x2d4689=_0x32c621;_0x1058f3||(_0x1058f3=_0x10434f[_0x2d4689(0xa3)]);const _0x10f117=new _0x1b5a98(this[_0x2d4689(0x9e)][_0x2d4689(0x8f)]);this[_0x2d4689(0x92)][_0x2d4689(0x7f)](_0x10f117,_0x10434f),this[_0x2d4689(0xc9)][_0x2d4689(0x7f)](_0x10434f,_0x10f117),_0x10f117[_0x2d4689(0x80)][_0x2d4689(0xa6)](_0x1058f3),this[_0x2d4689(0xaf)](_0x10434f[_0x2d4689(0xa3)],_0x2d4689(0xbf),(_0x296b4c,_0x2ec1a4,_0x352043)=>{const _0x36a4d8=_0x2d4689,_0x2cad46=this[_0x36a4d8(0xac)](_0x10434f,_0x352043);_0x10f117[_0x36a4d8(0x90)]!=_0x2cad46&&(_0x10f117[_0x36a4d8(0x90)]=_0x2cad46,this[_0x36a4d8(0xb7)](_0x10f117,_0x2cad46));}),this[_0x2d4689(0xaf)](_0x10f117,_0x2d4689(0xa4),()=>{const _0x373b8b=_0x2d4689;this[_0x373b8b(0x82)](_0x10f117,_0x373b8b(0xc3));}),this[_0x2d4689(0xaf)](_0x10f117,_0x2d4689(0xc0),()=>{const _0x56305c=_0x2d4689;this[_0x56305c(0x82)](_0x10f117,_0x56305c(0xbc));}),this[_0x2d4689(0x71)](_0x10f117);const _0x1cc3f8=this[_0x2d4689(0xb3)](_0x10f117);if(_0x1cc3f8)this[_0x2d4689(0xc8)](_0x1cc3f8,_0x10f117)||this[_0x2d4689(0x71)](_0x10f117);else this[_0x2d4689(0x71)](_0x10f117);return this[_0x2d4689(0x7a)](),this[_0x2d4689(0xa3)][_0x2d4689(0xa5)][_0x2d4689(0xa6)](_0x10f117),_0x10f117;}[_0x32c621(0xab)](_0x231881){const _0x1fa1c6=_0x32c621;if(!_0x231881[_0x1fa1c6(0x80)][_0x1fa1c6(0xaa)])return;const _0x5098a2=this[_0x1fa1c6(0xb3)](_0x231881);if(!_0x5098a2)return;const _0x3ec2b4=this[_0x1fa1c6(0x92)][_0x1fa1c6(0x83)](_0x5098a2),_0x410628=this[_0x1fa1c6(0x95)];_0x410628&&_0x410628===_0x3ec2b4?this[_0x1fa1c6(0xc8)](_0x5098a2,_0x231881):this[_0x1fa1c6(0x99)](_0x231881,_0x5098a2);}[_0x32c621(0x87)](_0x37ade2){const _0x169003=_0x32c621;if(!_0x37ade2[_0x169003(0x80)][_0x169003(0xaa)])return;const _0x549416=this[_0x169003(0x97)](_0x37ade2);if(!_0x549416)return;const _0x16face=this[_0x169003(0x92)][_0x169003(0x83)](_0x549416),_0x3d73ff=this[_0x169003(0x9e)][_0x169003(0x78)][_0x169003(0x83)](_0x169003(0xb4)),_0x3c2609=this[_0x169003(0x95)];_0x3c2609&&_0x3c2609===_0x16face&&_0x3d73ff?(this[_0x169003(0x99)](_0x549416,_0x37ade2),this[_0x169003(0xc8)](_0x37ade2,_0x549416)):_0x3c2609&&_0x3c2609===_0x16face?this[_0x169003(0x99)](_0x549416,_0x37ade2):this[_0x169003(0xc8)](_0x37ade2,_0x549416);}[_0x32c621(0x82)](_0x10f1ef,_0x4c0b4f){const _0x469abe=_0x32c621;0x0===this[_0x469abe(0x74)][_0x469abe(0xaa)]&&setTimeout(()=>{const _0x2e0ef9=_0x469abe;for(const {sidebarItemView:_0x4588ab,changedProp:_0x55e3f3}of this[_0x2e0ef9(0x74)])_0x2e0ef9(0xc3)===_0x55e3f3?this[_0x2e0ef9(0xab)](_0x4588ab):this[_0x2e0ef9(0x87)](_0x4588ab);this[_0x2e0ef9(0x74)]=[];},0xa),this[_0x469abe(0x74)][_0x469abe(0x8b)]({'sidebarItemView':_0x10f1ef,'changedProp':_0x4c0b4f});}[_0x32c621(0xc2)](_0x5a2264){const _0x166046=_0x32c621;return this[_0x166046(0xc9)][_0x166046(0x83)](_0x5a2264);}[_0x32c621(0x9c)](){const _0x56d33d=_0x32c621;this[_0x56d33d(0x8a)](),this[_0x56d33d(0xa3)][_0x56d33d(0x9c)]();}[_0x32c621(0x7d)](_0x456009){const _0x51f81d=_0x32c621,_0x1f10ba=this[_0x51f81d(0xc2)](_0x456009);this[_0x51f81d(0x8a)](_0x1f10ba),this[_0x51f81d(0x8a)](_0x456009[_0x51f81d(0xa3)]),_0x1f10ba[_0x51f81d(0x9c)](),this[_0x51f81d(0xc9)][_0x51f81d(0x77)](_0x456009),this[_0x51f81d(0x92)][_0x51f81d(0x77)](_0x1f10ba);}[_0x32c621(0x91)](){const _0x34ea40=_0x32c621,_0x10cd7a=new _0x32595e(this[_0x34ea40(0x9e)][_0x34ea40(0x8f)]);return _0x10cd7a[_0x34ea40(0x7c)](),this['on'](_0x34ea40(0x88),(_0x15fbd1,_0x47e975,_0x20b9e5,_0x5d94c4)=>{const _0x2fef28=_0x34ea40;_0x5d94c4&&_0x10cd7a[_0x2fef28(0x98)](_0x2fef28(0x79)),_0x20b9e5?_0x10cd7a[_0x2fef28(0xc1)](_0x2fef28(0x79))['to'](_0x20b9e5,_0x2fef28(0xbc)):_0x10cd7a[_0x2fef28(0x79)]=null;}),_0x10cd7a;}[_0x32c621(0x7a)](){const _0x103409=_0x32c621;this[_0x103409(0x85)]=this[_0x103409(0xc6)]?.[_0x103409(0xa1)]?this[_0x103409(0xc2)](this[_0x103409(0xc6)][_0x103409(0xa1)]):null;}[_0x32c621(0xb3)](_0x4babfc){const _0x10de12=_0x32c621,_0xe898c2=this[_0x10de12(0x92)][_0x10de12(0x83)](_0x4babfc),_0x10602b=_0xe898c2&&this[_0x10de12(0xc6)]?.[_0x10de12(0x83)](this[_0x10de12(0xc6)][_0x10de12(0x7b)](_0xe898c2)-0x1);return _0x10602b&&this[_0x10de12(0xc2)](_0x10602b)||null;}[_0x32c621(0x97)](_0x3bf1fa){const _0xbdfd9e=_0x32c621,_0x2b9496=this[_0xbdfd9e(0x92)][_0xbdfd9e(0x83)](_0x3bf1fa),_0x2f432f=_0x2b9496&&this[_0xbdfd9e(0xc6)]?.[_0xbdfd9e(0x83)](this[_0xbdfd9e(0xc6)][_0xbdfd9e(0x7b)](_0x2b9496)+0x1);return _0x2f432f&&this[_0xbdfd9e(0xc2)](_0x2f432f)||null;}[_0x32c621(0x99)](_0x2c6526,_0x3495f7){const _0x220c94=_0x32c621;_0x2c6526[_0x220c94(0xb8)]();const _0x376399=G(_0x3495f7[_0x220c94(0xbc)]+this[_0x220c94(0x8c)],_0x2c6526[_0x220c94(0xc3)]);return!!_0x376399&&(this[_0x220c94(0xb7)](_0x3495f7,_0x3495f7[_0x220c94(0xc3)]-_0x376399),!0x0);}[_0x32c621(0xc8)](_0x37d607,_0xb175ca){const _0xc2d44d=_0x32c621;_0x37d607[_0xc2d44d(0xb8)]();const _0x32f8c5=G(_0x37d607[_0xc2d44d(0xbc)]+this[_0xc2d44d(0x8c)],_0xb175ca[_0xc2d44d(0xc3)]);return!!_0x32f8c5&&(this[_0xc2d44d(0xb7)](_0xb175ca,_0xb175ca[_0xc2d44d(0xc3)]+_0x32f8c5,!0x1),!0x0);}[_0x32c621(0x71)](_0x224e45){const _0x19d090=_0x32c621,_0xe86df6=this[_0x19d090(0x92)][_0x19d090(0x83)](_0x224e45);if(!_0xe86df6||!_0xe86df6[_0x19d090(0xa9)]||!_0xe86df6[_0x19d090(0xbd)])return;const _0x2397da=this[_0x19d090(0xac)](_0xe86df6,_0xe86df6[_0x19d090(0xbd)]);this[_0x19d090(0xb7)](_0x224e45,_0x2397da);}[_0x32c621(0xac)](_0x3019bb,_0x4613f7){const _0xf2c181=_0x32c621;if(null===_0x4613f7)return 0x0;if(_0x3019bb[_0xf2c181(0xa9)]instanceof _0x440383)return _0x4613f7[_0xf2c181(0xc3)];{const _0x2d1888=new _0x440383(this[_0xf2c181(0xa3)][_0xf2c181(0xa7)])[_0xf2c181(0xc3)];return _0x4613f7[_0xf2c181(0xc3)]-_0x2d1888;}}[_0x32c621(0xb7)](_0x5bb614,_0x24998d,_0x4a8c45=this[_0x32c621(0x9e)][_0x32c621(0x78)][_0x32c621(0x83)](_0x32c621(0xb4))){const _0x3b7562=_0x32c621;_0x4a8c45&&(_0x24998d=Math[_0x3b7562(0x93)](_0x24998d,this[_0x3b7562(0x73)](_0x5bb614))),_0x5bb614[_0x3b7562(0xc3)]=_0x24998d;}[_0x32c621(0x73)](_0x374368){const _0x4e3d41=_0x32c621;let _0x16de02=this[_0x4e3d41(0xb3)](_0x374368),_0xc5b24b=0x0;for(;_0x16de02;)_0x16de02[_0x4e3d41(0xb8)](),_0xc5b24b+=this[_0x4e3d41(0x8c)]+_0x16de02[_0x4e3d41(0x9b)],_0x16de02=this[_0x4e3d41(0xb3)](_0x16de02);return _0xc5b24b;}}function G(_0x1fe996,_0x1642e1){const _0x5b7624=_0x32c621;return Math[_0x5b7624(0x93)](_0x1fe996-_0x1642e1,0x0);}function g(_0x16bfb6){const _0x4770aa=_0x32c621;return null!==_0x16bfb6&&_0x4770aa(0xb9)==typeof _0x16bfb6&&0x1===_0x16bfb6[_0x4770aa(0xc5)];}