@ckeditor/ckeditor5-comments
Version:
Collaborative comments feature for CKEditor 5.
23 lines • 7.18 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 _0x943745=_0x3db3;function _0x3db3(_0x515abf,_0xfed556){const _0x1d139f=_0x1d13();return _0x3db3=function(_0x3db3b7,_0x457311){_0x3db3b7=_0x3db3b7-0x1e9;let _0x21af73=_0x1d139f[_0x3db3b7];return _0x21af73;},_0x3db3(_0x515abf,_0xfed556);}(function(_0x5f16e4,_0xeed3e6){const _0x1ce6bf=_0x3db3,_0x2454b6=_0x5f16e4();while(!![]){try{const _0x5aaa8b=parseInt(_0x1ce6bf(0x1ff))/0x1+-parseInt(_0x1ce6bf(0x221))/0x2*(parseInt(_0x1ce6bf(0x1e9))/0x3)+parseInt(_0x1ce6bf(0x21c))/0x4+parseInt(_0x1ce6bf(0x20e))/0x5*(parseInt(_0x1ce6bf(0x1f3))/0x6)+-parseInt(_0x1ce6bf(0x1fd))/0x7+-parseInt(_0x1ce6bf(0x225))/0x8*(parseInt(_0x1ce6bf(0x226))/0x9)+parseInt(_0x1ce6bf(0x203))/0xa*(-parseInt(_0x1ce6bf(0x21d))/0xb);if(_0x5aaa8b===_0xeed3e6)break;else _0x2454b6['push'](_0x2454b6['shift']());}catch(_0x19ce4e){_0x2454b6['push'](_0x2454b6['shift']());}}}(_0x1d13,0x46329));import{Plugin as _0x4b877b}from'ckeditor5/src/core.js';import{CKEditorError as _0x5baccb}from'ckeditor5/src/utils.js';import{debounce as _0x48c87a}from'es-toolkit/compat';import{Annotations as _0x28ef97}from'./annotations.js';function _0x1d13(){const _0x288fcf=['pluginName','getRanges','3518095rvmqZf','sort','537866LPgsVI','annotation','requires','view','38260dYsuYp','focusTracker','remove','isEqual','isCollapsed','set','element','function','EditorAnnotations','refresh','cancel','5ERYtyQ','innerView','map','editor','add','fire','containsRange','uiUpdate','document','directChange','has','editing','refreshSelectedViews','_editorAnnotationsData','1712760iNrmLd','1617pNevEW','from','collection','plugins','5806hyPKQB','isOfficialPlugin','get','change:isFocused','40MwXDLD','75582GtGcZH','getByInnerView','model','delete','39oOkNpa','init','_editorAnnotations','registerAnnotation','push','_dataCollectors','addSourceCollector','range','blur','editorannotations-invalid-source-callback','2797254JlhYxL','update','hasDomSelection','selection','listenTo','isPremiumPlugin','getOrderedSelectedAnnotations','change:range'];_0x1d13=function(){return _0x288fcf;};return _0x1d13();}export class EditorAnnotations extends _0x4b877b{[_0x943745(0x1ee)];[_0x943745(0x1eb)];static get[_0x943745(0x201)](){return[_0x28ef97];}static get[_0x943745(0x1fb)](){const _0x5c32cc=_0x943745;return _0x5c32cc(0x20b);}static get[_0x943745(0x222)](){return!0x0;}static get[_0x943745(0x1f8)](){return!0x0;}constructor(_0x5412c8){const _0x44fbda=_0x943745;super(_0x5412c8),this[_0x44fbda(0x1ee)]=new Set(),this[_0x44fbda(0x1eb)]=new Set();}[_0x943745(0x1ea)](){const _0x4f8cc1=_0x943745,_0x4ec683=this[_0x4f8cc1(0x211)],_0x5f4e1a=_0x4ec683[_0x4f8cc1(0x228)][_0x4f8cc1(0x216)][_0x4f8cc1(0x1f6)],_0x1ebfbe=_0x48c87a(()=>this[_0x4f8cc1(0x21a)](),0xa);_0x5f4e1a['on'](_0x4f8cc1(0x1fa),(_0x56caf6,_0x181c2b)=>{const _0x28263b=_0x4f8cc1;_0x181c2b[_0x28263b(0x217)]&&(_0x1ebfbe[_0x28263b(0x20d)](),this[_0x28263b(0x21a)]());}),this[_0x4f8cc1(0x1f7)](_0x4ec683[_0x4f8cc1(0x219)][_0x4f8cc1(0x202)][_0x4f8cc1(0x216)],_0x4f8cc1(0x224),(_0x4d6864,_0x5e7a3e,_0x45f554)=>{_0x45f554&&_0x1ebfbe();}),this[_0x4f8cc1(0x1f7)](_0x4ec683['ui'][_0x4f8cc1(0x204)],_0x4f8cc1(0x224),(_0x2e6b23,_0x408b1c,_0x4d9dfc)=>{const _0x6ca8fe=_0x4f8cc1;_0x4d9dfc||this[_0x6ca8fe(0x213)](_0x6ca8fe(0x1f1),{'isAnnotationTracked':_0x292e49=>this[_0x6ca8fe(0x21b)][_0x6ca8fe(0x218)](_0x292e49[_0x6ca8fe(0x20f)])});}),this[_0x4f8cc1(0x1f7)](this[_0x4f8cc1(0x211)]['ui'],_0x4f8cc1(0x1f4),()=>this[_0x4f8cc1(0x213)](_0x4f8cc1(0x215)));}[_0x943745(0x1ec)](_0x4a9ff8){const _0x2feb88=_0x943745;if(this[_0x2feb88(0x1eb)][_0x2feb88(0x218)](_0x4a9ff8[_0x2feb88(0x202)]))return;this[_0x2feb88(0x1eb)][_0x2feb88(0x212)](_0x4a9ff8[_0x2feb88(0x202)]),this[_0x2feb88(0x211)]['ui'][_0x2feb88(0x204)][_0x2feb88(0x212)](_0x4a9ff8[_0x2feb88(0x202)][_0x2feb88(0x209)]);const _0x1778c8=this[_0x2feb88(0x211)][_0x2feb88(0x220)][_0x2feb88(0x223)](_0x28ef97);this[_0x2feb88(0x1f7)](_0x1778c8[_0x2feb88(0x21f)],_0x2feb88(0x205),(_0x5e935,_0x1e7f07)=>{const _0x397e27=_0x2feb88;this[_0x397e27(0x211)]['ui'][_0x397e27(0x204)][_0x397e27(0x205)](_0x1e7f07[_0x397e27(0x202)][_0x397e27(0x209)]),this[_0x397e27(0x1eb)][_0x397e27(0x229)](_0x1e7f07[_0x397e27(0x202)]);});}[_0x943745(0x1f5)](){const _0x4cf0b1=_0x943745;return this[_0x4cf0b1(0x211)][_0x4cf0b1(0x219)][_0x4cf0b1(0x202)][_0x4cf0b1(0x1f5)];}[_0x943745(0x1ef)](_0x4522d2){const _0x11f6be=_0x943745;if(_0x11f6be(0x20a)!=typeof _0x4522d2)throw new _0x5baccb(_0x11f6be(0x1f2));this[_0x11f6be(0x1ee)][_0x11f6be(0x212)](_0x4522d2);}[_0x943745(0x21a)](){const _0x2a0da6=_0x943745;this[_0x2a0da6(0x213)](_0x2a0da6(0x20c));}[_0x943745(0x1f9)]({activeAnnotation:_0x43e09f,annotations:_0x4b2ca1}){const _0x42f8b9=_0x943745,_0x2c9579=[],_0x342ec2=this[_0x42f8b9(0x211)][_0x42f8b9(0x228)][_0x42f8b9(0x216)][_0x42f8b9(0x1f6)],_0x49c47f=Array[_0x42f8b9(0x21e)](_0x342ec2[_0x42f8b9(0x1fc)]());for(const [_0x3c1b63,_0x43438f]of this[_0x42f8b9(0x21b)]){const _0x51c11e=_0x377a4a(_0x43438f),_0x50ebf0=_0x4b2ca1[_0x42f8b9(0x227)](_0x3c1b63);_0x51c11e&&_0x50ebf0&&_0x2c9579[_0x42f8b9(0x1ed)]({'annotation':_0x50ebf0,'range':_0x51c11e});}function _0x377a4a(_0x375c4c){const _0x2542f0=_0x42f8b9;for(const _0x36d0e2 of _0x375c4c)for(const _0x55589f of _0x49c47f)if(_0x36d0e2[_0x2542f0(0x214)](_0x55589f,!_0x342ec2[_0x2542f0(0x207)]))return _0x36d0e2;return null;}return _0x2c9579[_0x42f8b9(0x1fe)]((_0x3c7d0b,_0x1c85a3)=>{const _0x1ccbcb=_0x42f8b9,_0x2112ea=_0x3c7d0b[_0x1ccbcb(0x1f0)],_0x4e4220=_0x1c85a3[_0x1ccbcb(0x1f0)];if(!_0x2112ea[_0x1ccbcb(0x206)](_0x4e4220)){if(_0x2112ea[_0x1ccbcb(0x214)](_0x4e4220,!0x0))return 0x1;if(_0x4e4220[_0x1ccbcb(0x214)](_0x2112ea,!0x0))return-0x1;}return _0x3c7d0b[_0x1ccbcb(0x200)]==_0x43e09f?-0x1:_0x1c85a3[_0x1ccbcb(0x200)]==_0x43e09f?0x1:0x0;})[_0x42f8b9(0x210)](_0x20da1e=>_0x20da1e[_0x42f8b9(0x200)]);}get[_0x943745(0x21b)](){const _0x2c46cc=_0x943745,_0x56f32c=new Map();for(const _0x5e991d of Array[_0x2c46cc(0x21e)](this[_0x2c46cc(0x1ee)]))for(const [_0x3e4444,_0x5216c6]of _0x5e991d())_0x56f32c[_0x2c46cc(0x208)](_0x3e4444,_0x5216c6);return _0x56f32c;}}