UNPKG

@ckeditor/ckeditor5-track-changes

Version:

CKEditor 5 track changes plugin.

23 lines • 13.7 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x57f1(){const _0x3cbbff=['_handleRenameSuggestionDescription','function','_handleCustomCallbackDescription','_addDescriptionItems','subType','isEqual','addContainer','registerAttributeLabel','77MzRmbr','*Remove\x20format:*\x20%0','getDescriptions','1FKgWqH','replace','4674kguuSg','matchingCallback','type','previousSibling','_locale','add','item','format','label','2390418KxqMbq','*Change\x20to:*\x20%0','join','registerDescriptionCallback','map','_itemLabelsCallbacks','nodeAfter','quantity','start','Container','_customCallbacks','EmptyContainer','removeEmptyContainer','_schema','end','newValue','normal','elementEnd','removeContainer','*Set\x20format:*\x20%0','length','remove','registerElementLabel','getWalker','*Merge:*\x20%0','attribute','addFormat','_handleAttributeSuggestionDescription','checkChild','$1\x20$2','indexOf','isInContent','282172bdQjlh','addObject','*Remove:*\x20%0','skip','name','isObject','softBreak','element','removeObject','ELEMENT_SPACE','pop','get','*Insert:*\x20%0','push','addEmptyContainer','*Split:*\x20%0','elementStart','$textProxy','has','_attributeLabels','deletion','1382890WGbodD','text','304360mbWBBs','1675TMUsoU','set','Object','insertion','_resolveDescriptionItems','key','171yRVLVV','removeFormat','getFirstRange','isEmpty','REPLACE_TEXT','1814351RyaGiH','_itemLabels','nextSibling','getItemLabel','_handleInsertRemoveSuggestionDescription','943042voDVUr','match','$text','data'];_0x57f1=function(){return _0x3cbbff;};return _0x57f1();}const _0x3e0932=_0x32cf;function _0x32cf(_0x17b20c,_0x5d31fa){const _0x57f109=_0x57f1();return _0x32cf=function(_0x32cf63,_0x18eb32){_0x32cf63=_0x32cf63-0xf9;let _0x5a8872=_0x57f109[_0x32cf63];return _0x5a8872;},_0x32cf(_0x17b20c,_0x5d31fa);}(function(_0x333758,_0x33898d){const _0x3da422=_0x32cf,_0x38ff7c=_0x333758();while(!![]){try{const _0x26067a=-parseInt(_0x3da422(0x14e))/0x1*(-parseInt(_0x3da422(0x13f))/0x2)+-parseInt(_0x3da422(0x159))/0x3+parseInt(_0x3da422(0x117))/0x4+-parseInt(_0x3da422(0x12f))/0x5*(-parseInt(_0x3da422(0x150))/0x6)+parseInt(_0x3da422(0x13a))/0x7+parseInt(_0x3da422(0x12e))/0x8*(-parseInt(_0x3da422(0x135))/0x9)+-parseInt(_0x3da422(0x12c))/0xa*(-parseInt(_0x3da422(0x14b))/0xb);if(_0x26067a===_0x33898d)break;else _0x38ff7c['push'](_0x38ff7c['shift']());}catch(_0x2ac1a3){_0x38ff7c['push'](_0x38ff7c['shift']());}}}(_0x57f1,0x7ca78));import{getTranslation as _0x47b805}from'./utils/common-translations.js';import{priorities as _0x52d72d,insertToPriorityArray as _0x1b5024}from'ckeditor5/src/utils.js';import{renameAttributeKey as _0x4e2202}from'./trackchangesediting.js';export default class f{[_0x3e0932(0x101)];[_0x3e0932(0x13b)];[_0x3e0932(0xfc)];[_0x3e0932(0x12a)];[_0x3e0932(0x104)];[_0x3e0932(0x154)];constructor(_0x5213b0,_0x59545f){const _0x15b13b=_0x3e0932;this[_0x15b13b(0x101)]=[],this[_0x15b13b(0x13b)]=new Map(),this[_0x15b13b(0xfc)]=[],this[_0x15b13b(0x12a)]=new Map(),this[_0x15b13b(0x104)]=_0x5213b0,this[_0x15b13b(0x154)]=_0x59545f;}[_0x3e0932(0x14d)](_0x4dd8d2){const _0x418547=_0x3e0932,_0x4a1359=[],_0x1f325b=new Set(),_0x30848f=new Set();for(let _0x559cd7=0x0;_0x559cd7<_0x4dd8d2[_0x418547(0x10b)];_0x559cd7++){const _0x4f46ad=_0x4dd8d2[_0x559cd7];if(!_0x4f46ad[_0x418547(0x116)])continue;const _0x2de5a6=this[_0x418547(0x145)](_0x4f46ad);if(_0x2de5a6){if(null!=_0x4f46ad[_0x418547(0x147)]){if(_0x1f325b[_0x418547(0x129)](_0x4f46ad[_0x418547(0x147)]))continue;_0x1f325b[_0x418547(0x155)](_0x4f46ad[_0x418547(0x147)]);}_0x4a1359[_0x418547(0x124)](_0x2de5a6);}else{if(_0x418547(0x110)!=_0x4f46ad[_0x418547(0x152)])_0x418547(0x132)!=_0x4f46ad[_0x418547(0x152)]&&_0x418547(0x12b)!=_0x4f46ad[_0x418547(0x152)]||this[_0x418547(0x13e)](_0x4a1359,_0x4f46ad,_0x4dd8d2[_0x559cd7+0x1]);else{const _0x243634=_0x4f46ad[_0x418547(0x142)][_0x418547(0x134)];if(_0x30848f[_0x418547(0x129)](_0x243634))continue;_0x30848f[_0x418547(0x155)](_0x4f46ad[_0x418547(0x142)][_0x418547(0x134)]),_0x243634==_0x4e2202?this[_0x418547(0x143)](_0x4a1359,_0x4f46ad):this[_0x418547(0x112)](_0x4a1359,_0x4f46ad);}}}return this[_0x418547(0x133)](_0x4a1359);}[_0x3e0932(0xfa)](_0xfa1fa0){const _0xe4adde=_0x3e0932;this[_0xe4adde(0x101)][_0xe4adde(0x124)](_0xfa1fa0);}[_0x3e0932(0x10d)](_0x5596e0,_0x7b630e,_0x3873e9=_0x52d72d[_0x3e0932(0x107)]){const _0x4e0743=_0x3e0932;_0x4e0743(0x144)==typeof _0x5596e0?_0x1b5024(this[_0x4e0743(0xfc)],{'matchingCallback':_0x5596e0,'label':_0x7b630e,'priority':_0x3873e9}):this[_0x4e0743(0x13b)][_0x4e0743(0x130)](_0x5596e0,_0x7b630e);}[_0x3e0932(0x14a)](_0x5a44ee,_0x5c75e8){const _0x152a13=_0x3e0932;this[_0x152a13(0x12a)][_0x152a13(0x130)](_0x5a44ee,_0x5c75e8);}[_0x3e0932(0x13d)](_0x970224,_0x68ea6c=0x1){const _0x303bbb=_0x3e0932;let _0x1f63bb;for(const _0x57f5af of this[_0x303bbb(0xfc)])if(_0x57f5af[_0x303bbb(0x151)](_0x970224)){_0x1f63bb=_0x57f5af[_0x303bbb(0x158)];break;}return _0x1f63bb||(_0x1f63bb=this[_0x303bbb(0x13b)][_0x303bbb(0x122)](_0x970224[_0x303bbb(0x11b)])),_0x1f63bb?_0x1f63bb(_0x68ea6c):0x1!==_0x68ea6c?_0x68ea6c+'\x20'+_0x970224[_0x303bbb(0x11b)]+'s':''+_0x970224[_0x303bbb(0x11b)];}[_0x3e0932(0x146)](_0x348f59,_0x539601){const _0x3f49ab=_0x3e0932,_0x424e68=_0x539601[_0x3f49ab(0x137)]()[_0x3f49ab(0x10e)](),_0x27b286=_0x3f49ab(0x132)==_0x539601[_0x3f49ab(0x152)]?_0x3f49ab(0x155):_0x3f49ab(0x10c);for(const _0x318bcc of _0x424e68){const _0x2f6bc1=_0x318bcc[_0x3f49ab(0x156)],_0x5f49f7=_0x348f59[_0x348f59[_0x3f49ab(0x10b)]-0x1];if(_0x2f6bc1['is'](_0x3f49ab(0x128)))_0x5f49f7&&_0x5f49f7[_0x3f49ab(0x152)][_0x3f49ab(0x115)](_0x3f49ab(0x100))>-0x1&&_0x348f59[_0x3f49ab(0x121)](),_0x5f49f7&&_0x3f49ab(0x12d)==_0x5f49f7[_0x3f49ab(0x152)]?_0x5f49f7[_0x27b286]+=_0x2f6bc1[_0x3f49ab(0x142)]:_0x348f59[_0x3f49ab(0x124)]({'type':_0x3f49ab(0x12d),'add':_0x3f49ab(0x155)==_0x27b286?_0x2f6bc1[_0x3f49ab(0x142)]:'','remove':_0x3f49ab(0x10c)==_0x27b286?_0x2f6bc1[_0x3f49ab(0x142)]:''});else{if(this[_0x3f49ab(0x104)][_0x3f49ab(0x11c)](_0x2f6bc1)){const _0x4c0ffc=_0x2f6bc1;if(_0x5f49f7&&_0x5f49f7[_0x3f49ab(0x152)][_0x3f49ab(0x115)](_0x3f49ab(0x100))>-0x1&&_0x348f59[_0x3f49ab(0x121)](),_0x3f49ab(0x108)==_0x318bcc[_0x3f49ab(0x152)])continue;_0x5f49f7&&_0x5f49f7[_0x3f49ab(0x152)]==_0x27b286+_0x3f49ab(0x131)&&_0x5f49f7[_0x3f49ab(0x11e)][_0x3f49ab(0x11b)]==_0x4c0ffc[_0x3f49ab(0x11b)]?_0x5f49f7[_0x3f49ab(0xfe)]++:_0x348f59[_0x3f49ab(0x124)]({'type':_0x27b286+_0x3f49ab(0x131),'element':_0x4c0ffc,'quantity':0x1}),_0x424e68[_0x3f49ab(0x11a)](_0x2e5d82=>!(_0x3f49ab(0x108)==_0x2e5d82[_0x3f49ab(0x152)]&&_0x2e5d82[_0x3f49ab(0x156)]==_0x2f6bc1));}else{if(this[_0x3f49ab(0x104)][_0x3f49ab(0x113)](_0x2f6bc1,_0x3f49ab(0x141))||_0x2f6bc1['is'](_0x3f49ab(0x11e),_0x3f49ab(0x11d))){const _0x3a0c87=_0x2f6bc1;if(_0x3f49ab(0x155)==_0x27b286&&_0x3f49ab(0x127)==_0x318bcc[_0x3f49ab(0x152)]||_0x3f49ab(0x10c)==_0x27b286&&_0x3f49ab(0x108)==_0x318bcc[_0x3f49ab(0x152)])continue;if(_0x5f49f7&&-0x1==_0x5f49f7[_0x3f49ab(0x152)][_0x3f49ab(0x115)](_0x3f49ab(0x100))){_0x3f49ab(0x12d)==_0x5f49f7[_0x3f49ab(0x152)]&&(_0x5f49f7[_0x27b286]+='\x0a');continue;}let _0x3a1eec;if(_0x3a1eec=_0x3f49ab(0x155)==_0x27b286?_0x3a0c87[_0x3f49ab(0x13c)]&&!this[_0x3f49ab(0x104)][_0x3f49ab(0x11c)](_0x3a0c87[_0x3f49ab(0x13c)])?_0x3a0c87[_0x3f49ab(0x13c)]:null:_0x3a0c87[_0x3f49ab(0x153)]&&!this[_0x3f49ab(0x104)][_0x3f49ab(0x11c)](_0x3a0c87[_0x3f49ab(0x153)])?_0x3a0c87[_0x3f49ab(0x153)]:null,_0x3a0c87[_0x3f49ab(0x138)]||_0x3a1eec&&_0x3a1eec[_0x3f49ab(0x138)]){const _0x4a3eae=_0x3a1eec&&_0x3a1eec[_0x3f49ab(0x138)]?_0x3a1eec:_0x3a0c87;_0x5f49f7&&_0x5f49f7[_0x3f49ab(0x152)]==_0x27b286+_0x3f49ab(0x102)&&_0x5f49f7[_0x3f49ab(0x11e)][_0x3f49ab(0x11b)]==_0x4a3eae[_0x3f49ab(0x11b)]?_0x5f49f7[_0x3f49ab(0xfe)]++:_0x348f59[_0x3f49ab(0x124)]({'type':_0x27b286+_0x3f49ab(0x102),'element':_0x4a3eae,'quantity':0x1});}else _0x348f59[_0x3f49ab(0x124)]({'type':_0x27b286+_0x3f49ab(0x100),'element':_0x3a0c87});}}}}}[_0x3e0932(0x133)](_0x421c10){const _0x2999cf=_0x3e0932,_0x457090=this[_0x2999cf(0x154)],_0x32998e=[],_0x251fc0=[],_0x277cbd=[];for(const _0x42f34e of _0x421c10)switch(_0x42f34e[_0x2999cf(0x152)]){case _0x2999cf(0x12d):if(_0x42f34e[_0x2999cf(0x155)]=_0x42f34e[_0x2999cf(0x155)][_0x2999cf(0x14f)](/(\S)\u000A+(\S)/g,_0x2999cf(0x114))[_0x2999cf(0x14f)](/\u000A/g,''),_0x42f34e[_0x2999cf(0x10c)]=_0x42f34e[_0x2999cf(0x10c)][_0x2999cf(0x14f)](/(\S)\u000A+(\S)/g,_0x2999cf(0x114))[_0x2999cf(0x14f)](/\u000A/g,''),''!=_0x42f34e[_0x2999cf(0x155)]&&''!=_0x42f34e[_0x2999cf(0x10c)]){_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x14f),'content':_0x47b805(_0x457090,_0x2999cf(0x139),['\x22'+_0x42f34e[_0x2999cf(0x10c)]+'\x22','\x22'+_0x42f34e[_0x2999cf(0x155)]+'\x22'])});continue;}if(null!=_0x42f34e[_0x2999cf(0x155)][_0x2999cf(0x140)](/^ +$/)){_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x132),'content':_0x47b805(_0x457090,_0x2999cf(0x123),_0x47b805(_0x457090,_0x2999cf(0x120),_0x42f34e[_0x2999cf(0x155)][_0x2999cf(0x10b)]))});continue;}if(null!=_0x42f34e[_0x2999cf(0x10c)][_0x2999cf(0x140)](/^ +$/)){_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x12b),'content':_0x47b805(_0x457090,_0x2999cf(0x119),_0x47b805(_0x457090,_0x2999cf(0x120),_0x42f34e[_0x2999cf(0x10c)][_0x2999cf(0x10b)]))});continue;}if(''!=_0x42f34e[_0x2999cf(0x155)]){_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x132),'content':_0x47b805(_0x457090,_0x2999cf(0x123),'\x22'+_0x42f34e[_0x2999cf(0x155)]+'\x22')});continue;}_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x12b),'content':_0x47b805(_0x457090,_0x2999cf(0x119),'\x22'+_0x42f34e[_0x2999cf(0x10c)]+'\x22')});continue;case _0x2999cf(0x125):case _0x2999cf(0x118):_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x132),'content':_0x47b805(_0x457090,_0x2999cf(0x123),this[_0x2999cf(0x13d)](_0x42f34e[_0x2999cf(0x11e)],_0x42f34e[_0x2999cf(0xfe)]))});continue;case _0x2999cf(0x103):case _0x2999cf(0x11f):_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x12b),'content':_0x47b805(_0x457090,_0x2999cf(0x119),this[_0x2999cf(0x13d)](_0x42f34e[_0x2999cf(0x11e)],_0x42f34e[_0x2999cf(0xfe)]))});continue;case _0x2999cf(0x149):_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x132),'content':_0x47b805(_0x457090,_0x2999cf(0x126),this[_0x2999cf(0x13d)](_0x42f34e[_0x2999cf(0x11e)],_0x42f34e[_0x2999cf(0xfe)]))});continue;case _0x2999cf(0x109):_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x12b),'content':_0x47b805(_0x457090,_0x2999cf(0x10f),this[_0x2999cf(0x13d)](_0x42f34e[_0x2999cf(0x11e)],_0x42f34e[_0x2999cf(0xfe)]))});continue;case _0x2999cf(0x111):_0x251fc0[_0x2999cf(0x124)](_0x42f34e[_0x2999cf(0x134)]);continue;case _0x2999cf(0x136):_0x277cbd[_0x2999cf(0x124)](_0x42f34e[_0x2999cf(0x134)]);continue;default:_0x32998e[_0x2999cf(0x124)](_0x42f34e);}if(_0x251fc0[_0x2999cf(0x10b)]){const _0x47b599=_0x251fc0[_0x2999cf(0xfb)](_0x5f3b82=>this[_0x2999cf(0x12a)][_0x2999cf(0x129)](_0x5f3b82)?this[_0x2999cf(0x12a)][_0x2999cf(0x122)](_0x5f3b82):_0x5f3b82)[_0x2999cf(0xf9)](',\x20');_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x157),'content':_0x47b805(this[_0x2999cf(0x154)],_0x2999cf(0x10a),_0x47b599)});}if(_0x277cbd[_0x2999cf(0x10b)]){const _0x43ca5c=_0x277cbd[_0x2999cf(0xfb)](_0x2c904d=>this[_0x2999cf(0x12a)][_0x2999cf(0x129)](_0x2c904d)?this[_0x2999cf(0x12a)][_0x2999cf(0x122)](_0x2c904d):_0x2c904d)[_0x2999cf(0xf9)](',\x20');_0x32998e[_0x2999cf(0x124)]({'type':_0x2999cf(0x157),'content':_0x47b805(this[_0x2999cf(0x154)],_0x2999cf(0x14c),_0x43ca5c)});}return _0x32998e;}[_0x3e0932(0x145)](_0x31a033){const _0x3d3c5e=_0x3e0932;for(const _0x445b8d of this[_0x3d3c5e(0x101)]){const _0x201b85=_0x445b8d(_0x31a033);if(_0x201b85&&_0x3d3c5e(0x152)in _0x201b85)return _0x201b85;}}[_0x3e0932(0x112)](_0xfb0ebe,_0x5e7012){const _0x53432b=_0x3e0932,_0xbf79d6=_0x5e7012[_0x53432b(0x142)],_0x517b3f=void 0x0===_0xbf79d6[_0x53432b(0x106)]?_0x53432b(0x136):_0x53432b(0x111);_0xfb0ebe[_0x53432b(0x124)]({'type':_0x517b3f,'key':_0xbf79d6[_0x53432b(0x134)]});}[_0x3e0932(0x143)](_0x42e785,_0x4e8f3c){const _0x18bd61=_0x3e0932;_0x42e785[_0x18bd61(0x124)]({'type':_0x18bd61(0x157),'content':_0x47b805(this[_0x18bd61(0x154)],_0x18bd61(0x15a),this[_0x18bd61(0x13d)](_0x4e8f3c[_0x18bd61(0x137)]()[_0x18bd61(0xff)][_0x18bd61(0xfd)],0x1))});}[_0x3e0932(0x13e)](_0x310b6e,_0x2b593e,_0x2b8f30){const _0xf976c=_0x3e0932;if(this[_0xf976c(0x146)](_0x310b6e,_0x2b593e),_0x2b8f30&&_0x2b8f30[_0xf976c(0x137)]()&&!_0x2b593e[_0xf976c(0x137)]()[_0xf976c(0x105)][_0xf976c(0x148)](_0x2b8f30[_0xf976c(0x137)]()[_0xf976c(0xff)])){const _0x33c303=_0x310b6e[_0x310b6e[_0xf976c(0x10b)]-0x1],_0x10108f=_0xf976c(0x132)==_0x2b593e[_0xf976c(0x152)]?_0xf976c(0x155):_0xf976c(0x10c);_0x33c303&&_0xf976c(0x12d)==_0x33c303[_0xf976c(0x152)]&&(_0x33c303[_0x10108f]+='\x0a');}}}