@ckeditor/ckeditor5-source-editing-enhanced 48.3.0-alpha.4 → 48.3.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Command as _0xbd5af7,PendingActions as _0x1f6891,Plugin as _0x114674}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x42a12e,env as _0x387b18,formatHtml as _0x4321e8,uid as _0x1535af}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x38bce4}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x1cb0f7,MenuBarMenuListItemButtonView as _0x13f3d2,View as _0x2df3b2}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x1d359c,crosshairCursor as _0x5aa68b,drawSelection as _0x3690e6,dropCursor as _0x287a6e,highlightActiveLine as _0xb847c4,highlightActiveLineGutter as _0xebf907,highlightSpecialChars as _0x411329,keymap as _0x36b440,lineNumbers as _0x997a78,rectangularSelection as _0x3d3ca7}from'@codemirror/view';import{Compartment as _0x26c320,Transaction as _0xea69dd}from'@codemirror/state';import{bracketMatching as _0x3ea946,defaultHighlightStyle as _0x32f59e,foldGutter as _0x3ada4d,foldKeymap as _0x4b74c9,indentOnInput as _0x40e3d9,syntaxHighlighting as _0x45bb1b}from'@codemirror/language';import{defaultKeymap as _0x4ca695,history as _0x497364,historyKeymap as _0x3c1ec9,indentLess as _0x11cd2e,indentMore as _0xbada7f,redo as _0x508d7b,toggleTabFocusMode as _0x3e79e9,undo as _0xa64217}from'@codemirror/commands';import{autocompletion as _0x4e431a,closeBrackets as _0x27d40c,closeBracketsKeymap as _0x2491b0,completionKeymap as _0x221438}from'@codemirror/autocomplete';import{html as _0xb7cfad}from'@codemirror/lang-html';import{markdown as _0x4d323a}from'@codemirror/lang-markdown';import{oneDark as _0x2e4ffa}from'@codemirror/theme-one-dark';function Q(_0x1826bd,_0x25198b){const t=_0x1826bd['t'];switch(_0x25198b){case'Edit\x20source\x20modal\x20label':return t({'string':'Edit\x20source','id':'Edit\x20source\x20modal\x20label'});case'Source':return t('Source');case'Source\x20Editing\x20Enhanced':return t('Source\x20Editing\x20Enhanced');case'Copy\x20line\x20down':return t('Copy\x20line\x20down');case'Copy\x20line\x20up':return t('Copy\x20line\x20up');case'Delete\x20line':return t('Delete\x20line');case'Indent\x20less':return t('Indent\x20less');case'Indent\x20more':return t('Indent\x20more');case'Fold\x20all':return t('Fold\x20all');case'Fold\x20code\x20(current\x20level)':return t('Fold\x20code\x20(current\x20level)');case'Move\x20line\x20down':return t('Move\x20line\x20down');case'Move\x20line\x20up':return t('Move\x20line\x20up');case'Redo\x20(keystroke)':return t({'id':'Redo\x20(keystroke)','string':'Redo'});case'Select\x20line':return t('Select\x20line');case'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode':return t('Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode');case'Toggle\x20block\x20comment':return t('Toggle\x20block\x20comment');case'Toggle\x20comment':return t('Toggle\x20comment');case'Undo\x20(keystroke)':return t({'id':'Undo\x20(keystroke)','string':'Undo'});case'Unfold\x20all':return t('Unfold\x20all');case'Unfold\x20code\x20(current\x20level)':return t('Unfold\x20code\x20(current\x20level)');case'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.':return t('Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.');case'Cancel':return t('Cancel');case'Save':return t('Save');default:return _0x25198b;}}function B(_0x391400){const _0x352f01=_0x391400['editing']['view']['document']['roots'],_0x3c2e4a=_0x352f01['length'];if(0x0===_0x3c2e4a)throw new _0x42a12e('source-editing-enhanced-editor-no-root',_0x391400);return 0x1===_0x3c2e4a?_0x352f01['first']['rootName']:Array['from'](_0x391400['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x1127f8){return J(_0x1127f8['replace'](/^[\n\s]*/g,''))?_0x1127f8['replace'](/\s+/g,''):_0x1127f8;}function J(_0x48af97){return _0x48af97['startsWith']('<');}function X(_0x56399b){const _0x2946a2=[_0x1d359c['lineWrapping'],_0x4e431a(),_0x3ea946(),_0x27d40c(),_0x5aa68b(),_0x3690e6(),_0x287a6e(),_0x997a78(),_0x3ada4d(),_0xb847c4(),_0xebf907(),_0x411329(),_0x497364(),_0x40e3d9(),_0x3d3ca7(),_0x45bb1b(_0x32f59e,{'fallback':!0x0})],_0x1cb70b=new _0x26c320();_0x2946a2['push'](_0x1cb70b['of'](_0x1d359c['editable']['of'](!0x0))),'html'===_0x56399b['syntaxLanguage']?_0x2946a2['push'](_0xb7cfad()):_0x2946a2['push'](_0x4d323a());const _0x525e47=(_0x490877=_0x56399b['theme'])&&'default'!==_0x490877?'dark'===_0x490877?_0x2e4ffa:_0x490877:null;var _0x490877;_0x525e47&&_0x2946a2['push'](_0x525e47),_0x2946a2['push'](_0x36b440['of']([..._0x2491b0,..._0x4ca695,..._0x3c1ec9,..._0x4b74c9,..._0x221438,{'key':'Tab','run':_0xbada7f,'shift':_0x11cd2e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x508d7b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x508d7b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0xa64217,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x42cf06=new _0x1d359c({'extensions':_0x2946a2,'parent':_0x56399b['parent']});return _0x3e79e9(_0x42cf06),{'focus':()=>{_0x42cf06['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x42cf06['focus']();},'getData':()=>_0x42cf06['state']['doc']['toString'](),'setData':_0x369654=>{_0x42cf06['dispatch']({'changes':{'from':0x0,'to':_0x42cf06['state']['doc']['length'],'insert':_0x369654},'annotations':_0xea69dd['addToHistory']['of'](!0x1)});},'setReadOnly':_0x3a351b=>{_0x42cf06['dispatch']({'effects':[_0x1cb70b['reconfigure'](_0x1d359c['editable']['of'](!_0x3a351b))]});},'destroy':()=>{_0x42cf06['destroy']();},'instance':_0x42cf06};}var Z=class extends _0x2df3b2{['_codeEditorApi']=null;['_options'];constructor(_0x1d31f2,_0x419a42){super(_0x1d31f2),this['_options']=_0x419a42,this['set']('isReadOnly',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-code-editor'],'tabindex':-0x1}});}['render'](){super['render'](),this['_codeEditorApi']=X({'parent':this['element'],'syntaxLanguage':this['_options']['syntaxLanguage'],'theme':this['_options']['theme']}),this['on']('change:isReadOnly',(_0x55b10a,_0x2c72f4,_0x3b64c6)=>{this['setReadOnly'](_0x3b64c6);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x34f12e){this['_codeEditorApi']['setData'](_0x34f12e);}['setReadOnly'](_0x50bb33){this['_codeEditorApi']['setReadOnly'](_0x50bb33);}};const G='SourceEditingEnhancedMode';var W=class extends _0xbd5af7{constructor(_0x17726b){super(_0x17726b),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x1f6891)['on']('change:hasAny',(_0x4c6e37,_0x22e4ce,_0x262799)=>{_0x262799?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x3711fc=this['editor'];for(const _0x58c875 of _0x3711fc['commands']['names']())['replaceSource','editSource']['includes'](_0x58c875)||_0x3711fc['commands']['get'](_0x58c875)['forceDisabled'](G);}['_enableCommands'](){const _0x461f8f=this['editor'];for(const _0x1162f4 of _0x461f8f['commands']['commands']())_0x1162f4['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0x3b7e54=this['editor'],_0x10c5e9=_0x3b7e54['locale'],_0x284036=_0x3b7e54['plugins']['get']('Dialog'),_0x153c81=B(_0x3b7e54),_0x4401ef=J(_0x60dfbb=_0x3b7e54['data']['get']({'rootName':_0x153c81}))?_0x4321e8(_0x60dfbb):_0x60dfbb;var _0x60dfbb;const _0x271b08=new Z(_0x10c5e9,{'syntaxLanguage':_0x3b7e54['plugins']['has']('Markdown')?'markdown':'html','theme':_0x3b7e54['config']['get']('sourceEditingEnhanced.theme')});let _0x3e371e=!0x0;const _0x26b4d2=_0x1d1d1a=>{if(_0x3e371e&&Y(_0x271b08['getData']())!==Y(_0x4401ef))return window['confirm'](Q(_0x10c5e9,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x1d1d1a['stop']();};_0x284036['show']({'id':'sourceEditingEnhanced','title':Q(_0x10c5e9,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x271b08,'actionButtons':[{'label':Q(_0x10c5e9,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x284036['hide']();}},{'label':Q(_0x10c5e9,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x3a9d3d=Y(_0x271b08['getData']())!==Y(_0x4401ef);_0x3a9d3d&&_0x3b7e54['execute']('replaceSource',_0x271b08['getData']()),_0x3e371e=!0x1,_0x284036['hide'](),_0x3a9d3d&&'editables'in _0x3b7e54['ui']['view']&&_0x3b7e54['ui']['view']['editables'][_0x153c81]['element']['focus']();},'onCreate':_0x3872e5=>{_0x3872e5['set']('isEnabled',!_0x3b7e54['isReadOnly']),_0x3872e5['bind']('isEnabled')['to'](_0x3b7e54,'isReadOnly',this,'isEnabled',(_0x59529a,_0x3ed902)=>!_0x59529a&&_0x3ed902);}}],'onHide':()=>{this['_enableCommands'](),_0x284036['off']('hide',_0x26b4d2),_0x271b08['destroy']();},'onShow':()=>{_0x271b08['bind']('isReadOnly')['to'](_0x3b7e54,'isReadOnly',this,'isEnabled',(_0x295caf,_0x23c668)=>_0x295caf||!_0x23c668),_0x271b08['setData'](_0x4401ef),_0x271b08['focus'](),_0x284036['on']('hide',_0x26b4d2,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x114674{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x1f6891];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0xd59e90=this['editor'],_0x2f3a91=_0xd59e90['locale'],_0xbc557f=new W(_0xd59e90);_0xd59e90['commands']['add']('editSource',_0xbc557f),_0xd59e90['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0xe38762=this['_createButton'](_0x1cb0f7,_0xbc557f);return _0xe38762['set']({'label':Q(_0x2f3a91,'Source'),'icon':_0x38bce4,'tooltip':Q(_0x2f3a91,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0xe38762;}),_0xd59e90['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x5b67c2=this['_createButton'](_0x13f3d2,_0xbc557f,!0x0);return _0x5b67c2['set']({'label':Q(_0x2f3a91,'Edit\x20source\x20modal\x20label'),'icon':_0x38bce4,'role':'menuitemcheckbox'}),_0x5b67c2;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0x470ee5){const _0x3fc867='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x3a62e8=0x78e28,_0x422b42=window['Date']['now'](),_0x4aa526=_0x470ee5['editor'],_0x2d36a2=new window['Promise'](_0x2b32a0=>{_0x4aa526['once']('ready',_0x2b32a0);}),_0x2a443f={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x41b409=_0x4aa526['config']['get']('licenseKey');async function _0x4540e3(){let _0x42e414,_0x259cdf=null,_0x55a5ca=null;try{return'GPL'==_0x41b409?'NotAllowed':(_0x42e414=_0x5e95ff(),_0x42e414?(_0x42e414['usageEndpoint']&&(_0x55a5ca=_0x3999c1(_0x42e414['usageEndpoint'],_0x42e414['jti'])),await _0x4dae89()?_0x54b8a9()?_0x3eef97()?'Expired':_0xf646bb()?('evaluation'==_0x42e414['licenseType']&&(_0x259cdf=_0xb8a742('EvaluationLimit')),await _0xb56afa()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3eef97(){const _0x4f5016=['evaluation','trial']['includes'](_0x42e414['licenseType'])?_0x422b42/0x3e8:0xe10*_0x3a62e8;return _0x42e414['exp']<_0x4f5016;}function _0x54b8a9(){const _0x3f3ee4=_0x42e414['features'];return!!_0x3f3ee4&&(!!_0x3f3ee4['includes']('*')||!!_0x3f3ee4['includes']('SEE'));}function _0xf646bb(){const _0x3a0aa5=_0x42e414['licensedHosts'];if(!_0x3a0aa5||0x0==_0x3a0aa5['length'])return!0x0;const {hostname:_0x244542}=new URL(window['location']['href']);if(_0x3a0aa5['includes'](_0x244542))return!0x0;const _0x239be5=_0x244542['split']('.');return _0x3a0aa5['filter'](_0x404621=>_0x404621['includes']('*'))['map'](_0x267d39=>_0x267d39['split']('.'))['filter'](_0x17b311=>_0x17b311['length']<=_0x239be5['length'])['map'](_0x4ac016=>Array(_0x239be5['length']-_0x4ac016['length'])['fill']('*'===_0x4ac016[0x0]?'*':'')['concat'](_0x4ac016))['some'](_0x34b503=>_0x239be5['every']((_0x5aa6ba,_0x5e7a2d)=>_0x34b503[_0x5e7a2d]===_0x5aa6ba||'*'===_0x34b503[_0x5e7a2d]));}function _0xb56afa(){return _0x259cdf&&_0x55a5ca?new window['Promise']((_0x17f1c6,_0x2a4dc6)=>{_0x259cdf['then'](_0x17f1c6,_0x2a4dc6),_0x55a5ca['then'](_0x2d170e=>{'Valid'!=_0x2d170e&&_0x17f1c6(_0x2d170e);},_0x2a4dc6);}):_0x259cdf||_0x55a5ca||'Valid';}}function _0x3999c1(_0x46c2ef,_0xa825be){return new window['Promise'](_0x351546=>{if(_0x470e17())return _0x351546('Valid');_0x27f76f(),_0x4aa526['decorate']('_sendUsageRequest');let _0x67352=!0x1;const _0x47143f=_0x1535af();function _0x2da748(_0x1b795e){return!!_0x1b795e&&('object'==typeof _0x1b795e||'function'==typeof _0x1b795e)&&'function'==typeof _0x1b795e['then']&&'function'==typeof _0x1b795e['catch'];}function _0x395348(_0x17730d){_0x1f36d7(_0x17730d)['then'](_0x324e3f=>_0x324e3f&&'ok'==_0x324e3f['status']?_0x2da84b(_0x5f1fd7(_0x47143f+_0xa825be))!=_0x324e3f['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x337715=>(_0x5e81c3(),_0x337715),()=>{const _0x46d588=_0x54d362();return null==_0x46d588?(_0x5e81c3(),'Valid'):_0x422b42-_0x46d588>0x240c8400?'UsageLimit':'Valid';})['then'](_0x351546)['catch'](()=>{_0x351546('UsageLimit');});const _0x28a1b5=0x36ee80;function _0x5e81c3(){const _0x3aeace='llct-'+_0x2da84b(_0x5f1fd7(_0x46c2ef)),_0x896b9=_0x37e317(_0x2da84b(window['Math']['ceil'](_0x422b42/_0x28a1b5)));window['localStorage']['setItem'](_0x3aeace,_0x896b9);}function _0x54d362(){const _0x22cafb='llct-'+_0x2da84b(_0x5f1fd7(_0x46c2ef)),_0xd700f=window['localStorage']['getItem'](_0x22cafb);return _0xd700f?window['parseInt'](_0x37e317(_0xd700f),0x10)*_0x28a1b5:null;}function _0x1f36d7(_0x465252){return new window['Promise']((_0xfff638,_0x2c3eee)=>{_0x465252['then'](_0xfff638,_0x2c3eee),window['setTimeout'](_0x2c3eee,0x1d4c0);});}}_0x4aa526['on']('_sendUsageRequest',(_0x39096f,_0x42a258)=>{if(_0x42a258[0x0]!=_0x46c2ef)return _0x351546('UsageLimit');_0x42a258[0x1]={..._0x42a258[0x1],'requestId':_0x47143f};},{'priority':'high'}),_0x4aa526['on']('_sendUsageRequest',_0x543865=>{_0x2da748(_0x543865['return'])&&(_0x67352=!0x0,_0x395348(_0x543865['return']));},{'priority':'low'}),_0x2d36a2['then'](()=>{_0x67352||_0x351546('UsageLimit');});});function _0x470e17(){return'auto'==_0x4aa526['editing']['view']['_overlayModeHint'];}function _0x27f76f(){_0x4aa526['editing']['view']['_overlayModeHint']='auto';}}function _0xb8a742(_0x3b3380){const _0x8e4c72=[new window['Promise'](_0x5a7228=>setTimeout(_0x5a7228,0x93ecc)),_0x2d36a2['then'](()=>new window['Promise'](_0x30ae74=>{let _0x4da146=0x0;_0x4aa526['model']['on']('applyOperation',(_0x35b0db,_0x24e6d2)=>{_0x24e6d2[0x0]['isDocumentOperation']&&_0x4da146++,0x5e8==_0x4da146&&(_0x30ae74(),_0x35b0db['off']());});}))];return window['Promise']['race'](_0x8e4c72)['then'](()=>_0x3b3380);}async function _0x247da9(){await _0x2d36a2,_0x4aa526['model']['change']=_0x42d214,_0x4aa526['model']['enqueueChange']=_0x42d214,_0x4aa526['enableReadOnlyMode']('model');}function _0x3ad1b0(_0x39b851){const _0x4f3684=_0x4750f7();_0x4aa526[_0x4f3684]='sourceEditingEnhancedLicenseKey'+_0x39b851,'Valid'!=_0x39b851&&_0x247da9();}function _0x4750f7(){const _0x130319=window['String'](window['performance']['now']())['replace']('.','');let _0x265cb4='N';for(let _0x58faa7=0x0;_0x58faa7<_0x130319['length'];_0x58faa7+=0x2){let _0x319f39=window['parseInt'](_0x130319['substring'](_0x58faa7,_0x58faa7+0x2));_0x319f39>=0x3e&&(_0x319f39-=0x3e),_0x265cb4+=_0x3fc867[_0x319f39];}return _0x265cb4;}function _0x5e95ff(){const _0x5d3a87=_0x41b409['split']('.');if(0x3!=_0x5d3a87['length'])return null;return _0x33d29e(_0x5d3a87[0x1]);function _0x33d29e(_0x167e07){const _0x351ab9=_0x5848ef(_0x167e07);return _0x351ab9&&_0xd0208f()?_0x351ab9:null;function _0xd0208f(){const _0xc33196=_0x351ab9['jti'],_0x45ebba=window['parseInt'](_0xc33196['substring'](_0xc33196['length']-0x8),0x10),_0x2e5be8={..._0x351ab9,'jti':_0xc33196['substring'](0x0,_0xc33196['length']-0x8)};return delete _0x2e5be8['vc'],_0x5f1fd7(_0x2e5be8)==_0x45ebba;}}}async function _0x4dae89(){let _0x39ae6e=!0x0;try{const [_0x102f9e,_0x4c2011,_0x3fdef9]=_0x41b409['split']('.');return _0x383b4c(_0x102f9e),await _0x272208(_0x102f9e,_0x4c2011,_0x3fdef9),_0x39ae6e;}catch{return!0x1;}function _0x383b4c(_0x5b12c2){const _0x396b43=_0x5848ef(_0x5b12c2);_0x396b43&&'ES256'==_0x396b43['alg']||(_0x39ae6e=!0x1);}async function _0x272208(_0x5ac059,_0x2ed131,_0x471de7){const _0x22af17=window['Uint8Array']['from'](_0x9df472(_0x471de7),_0x20e318=>_0x20e318['charCodeAt'](0x0)),_0x4784e9=new window['TextEncoder']()['encode'](_0x5ac059+'.'+_0x2ed131),_0x5f1d79=window['crypto']['subtle'];if(!_0x5f1d79)return;const _0x3b2868=await _0x5f1d79['importKey']('jwk',_0x2a443f,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x5f1d79['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3b2868,_0x22af17,_0x4784e9)||(_0x39ae6e=!0x1);}}function _0x5848ef(_0x356b68){return _0x356b68['startsWith']('ey')?JSON['parse'](_0x9df472(_0x356b68)):null;}function _0x9df472(_0xfa41d){return window['atob'](_0xfa41d['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5f1fd7(_0x25131b){let _0x5aba72=0x1505;function _0xb75522(_0x1a739f){for(let _0xc226a2=0x0;_0xc226a2<_0x1a739f['length'];_0xc226a2++){const _0x3bc0fc=_0x1a739f['charCodeAt'](_0xc226a2);_0x5aba72=(_0x5aba72<<0x5)+_0x5aba72+_0x3bc0fc,_0x5aba72&=_0x5aba72;}}function _0x2e623f(_0x3e2e15){Array['isArray'](_0x3e2e15)?_0x3e2e15['forEach'](_0x2e623f):_0x3e2e15&&'object'==typeof _0x3e2e15?Object['entries'](_0x3e2e15)['sort']()['forEach'](([_0x3f75dc,_0x4b6a4a])=>{_0xb75522(_0x3f75dc),_0x2e623f(_0x4b6a4a);}):_0xb75522(window['String'](_0x3e2e15));}return _0x2e623f(_0x25131b),_0x5aba72>>>0x0;}function _0x2da84b(_0x11ec92){return _0x11ec92['toString'](0x10)['padStart'](0x8,'0');}function _0x37e317(_0x382c66){return _0x382c66['split']('')['reverse']()['join']('');}function _0x42d214(){}_0x3ad1b0(await _0x4540e3());}(this);}['_createButton'](_0x54e00a,_0x5d3580,_0x5c9147=!0x1){const _0x2778ac=new _0x54e00a(this['editor']['locale']);return _0x2778ac['set']({'withText':_0x5c9147,'isToggleable':!0x1}),_0x2778ac['bind']('isEnabled')['to'](_0x5d3580,'isEnabled'),this['listenTo'](_0x2778ac,'execute',()=>_0x5d3580['execute']()),_0x2778ac;}['_registerKeybindings'](){const _0x274f91=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x274f91,'Source\x20Editing\x20Enhanced')});const _0x28dbe6=_0x387b18['isMac']||_0x387b18['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x274f91,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x274f91,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x274f91,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x274f91,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x274f91,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x274f91,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x274f91,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x28dbe6?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x274f91,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x274f91,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x274f91,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x274f91,'Select\x20line'),'keystroke':_0x28dbe6?'Ctrl!+L':'Alt+L'},{'label':Q(_0x274f91,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x28dbe6?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x274f91,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x274f91,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x274f91,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x274f91,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x274f91,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x28dbe6?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0xbd5af7{constructor(_0x5391be){super(_0x5391be),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x1b306f,_0x31dd39){const _0x4a0210=this['editor'],_0x3478ba=_0x31dd39?.['rootName']??B(_0x4a0210);_0x4a0210['data']['set']({[_0x3478ba]:_0x1b306f},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x114674{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x3b8cd9){super(_0x3b8cd9),_0x3b8cd9['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}['init'](){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1e6155=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1d9e24;for(const _0x3a396c in _0x1e6155){const _0x2601a8=_0x3a396c,_0x46d4ce=_0x1e6155[_0x2601a8];if('sourceEditingEnhancedLicenseKeyValid'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyInvalid'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyExpired'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x46d4ce||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x46d4ce){delete _0x1e6155[_0x2601a8],_0x1d9e24=_0x46d4ce,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x1d9e24&&_0x1e6155['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x1d9e24&&_0x1e6155['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x1d9e24&&_0x1e6155['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x1d9e24&&_0x1e6155['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x1d9e24&&_0x1e6155['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x1d9e24&&_0x1e6155['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0x11c61f=this['editor'],_0x12c337=_0x11c61f['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x12c337&&_0x11c61f['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x42a12e('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x12c337&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x567bd9=>_0x11c61f['plugins']['has'](_0x567bd9))&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20at\x20least\x20one\x20of\x20the\x20collaboration\x20features.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20collaboration\x20features.'),_0x11c61f['plugins']['has']('RestrictedEditingModeEditing')&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20restricted\x20editing\x20feature.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20enhanced\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20restricted\x20editing\x20feature.');}};export{W as EditSourceCommand,ee as ReplaceSourceCommand,te as SourceEditingEnhanced};
23
+ import{Command as _0x4e4c57,PendingActions as _0x20b0cc,Plugin as _0x3e0f24}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x5c0d9c,env as _0x345c76,formatHtml as _0x2164e3,uid as _0x297b7f}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x21fcba}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0xfec814,MenuBarMenuListItemButtonView as _0x595db2,View as _0x2acbcc}from'@ckeditor/ckeditor5-ui';import{EditorView as _0xe8f632,crosshairCursor as _0x20df4c,drawSelection as _0x397fb8,dropCursor as _0x54ac4d,highlightActiveLine as _0x38fb63,highlightActiveLineGutter as _0x4d6014,highlightSpecialChars as _0x56ce1b,keymap as _0x5b0c6d,lineNumbers as _0x569343,rectangularSelection as _0xe9271b}from'@codemirror/view';import{Compartment as _0x3bbbd5,Transaction as _0x447b1d}from'@codemirror/state';import{bracketMatching as _0x17c82d,defaultHighlightStyle as _0xc085de,foldGutter as _0x2428d8,foldKeymap as _0x342175,indentOnInput as _0x88c300,syntaxHighlighting as _0x3b47ac}from'@codemirror/language';import{defaultKeymap as _0x2d23e3,history as _0x489f9,historyKeymap as _0x43d5d4,indentLess as _0x405305,indentMore as _0x469866,redo as _0x26d796,toggleTabFocusMode as _0x46c137,undo as _0x5d2288}from'@codemirror/commands';import{autocompletion as _0x4e760f,closeBrackets as _0x52cf32,closeBracketsKeymap as _0x20a02c,completionKeymap as _0x308c9d}from'@codemirror/autocomplete';import{html as _0xde4482}from'@codemirror/lang-html';import{markdown as _0x2756b8}from'@codemirror/lang-markdown';import{oneDark as _0x53d88c}from'@codemirror/theme-one-dark';function Q(_0x648cf1,_0x48bdfd){const t=_0x648cf1['t'];switch(_0x48bdfd){case'Edit\x20source\x20modal\x20label':return t({'string':'Edit\x20source','id':'Edit\x20source\x20modal\x20label'});case'Source':return t('Source');case'Source\x20Editing\x20Enhanced':return t('Source\x20Editing\x20Enhanced');case'Copy\x20line\x20down':return t('Copy\x20line\x20down');case'Copy\x20line\x20up':return t('Copy\x20line\x20up');case'Delete\x20line':return t('Delete\x20line');case'Indent\x20less':return t('Indent\x20less');case'Indent\x20more':return t('Indent\x20more');case'Fold\x20all':return t('Fold\x20all');case'Fold\x20code\x20(current\x20level)':return t('Fold\x20code\x20(current\x20level)');case'Move\x20line\x20down':return t('Move\x20line\x20down');case'Move\x20line\x20up':return t('Move\x20line\x20up');case'Redo\x20(keystroke)':return t({'id':'Redo\x20(keystroke)','string':'Redo'});case'Select\x20line':return t('Select\x20line');case'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode':return t('Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode');case'Toggle\x20block\x20comment':return t('Toggle\x20block\x20comment');case'Toggle\x20comment':return t('Toggle\x20comment');case'Undo\x20(keystroke)':return t({'id':'Undo\x20(keystroke)','string':'Undo'});case'Unfold\x20all':return t('Unfold\x20all');case'Unfold\x20code\x20(current\x20level)':return t('Unfold\x20code\x20(current\x20level)');case'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.':return t('Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.');case'Cancel':return t('Cancel');case'Save':return t('Save');default:return _0x48bdfd;}}function B(_0x3c2a87){const _0x5eb070=_0x3c2a87['editing']['view']['document']['roots'],_0x1f96bc=_0x5eb070['length'];if(0x0===_0x1f96bc)throw new _0x5c0d9c('source-editing-enhanced-editor-no-root',_0x3c2a87);return 0x1===_0x1f96bc?_0x5eb070['first']['rootName']:Array['from'](_0x3c2a87['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x333cdc){return J(_0x333cdc['replace'](/^[\n\s]*/g,''))?_0x333cdc['replace'](/\s+/g,''):_0x333cdc;}function J(_0x5c4f41){return _0x5c4f41['startsWith']('<');}function X(_0x5edee3){const _0x88d166=[_0xe8f632['lineWrapping'],_0x4e760f(),_0x17c82d(),_0x52cf32(),_0x20df4c(),_0x397fb8(),_0x54ac4d(),_0x569343(),_0x2428d8(),_0x38fb63(),_0x4d6014(),_0x56ce1b(),_0x489f9(),_0x88c300(),_0xe9271b(),_0x3b47ac(_0xc085de,{'fallback':!0x0})],_0x134b21=new _0x3bbbd5();_0x88d166['push'](_0x134b21['of'](_0xe8f632['editable']['of'](!0x0))),'html'===_0x5edee3['syntaxLanguage']?_0x88d166['push'](_0xde4482()):_0x88d166['push'](_0x2756b8());const _0x3e0fd6=(_0x2d01b4=_0x5edee3['theme'])&&'default'!==_0x2d01b4?'dark'===_0x2d01b4?_0x53d88c:_0x2d01b4:null;var _0x2d01b4;_0x3e0fd6&&_0x88d166['push'](_0x3e0fd6),_0x88d166['push'](_0x5b0c6d['of']([..._0x20a02c,..._0x2d23e3,..._0x43d5d4,..._0x342175,..._0x308c9d,{'key':'Tab','run':_0x469866,'shift':_0x405305,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x26d796,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x26d796,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x5d2288,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x3549f0=new _0xe8f632({'extensions':_0x88d166,'parent':_0x5edee3['parent']});return _0x46c137(_0x3549f0),{'focus':()=>{_0x3549f0['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x3549f0['focus']();},'getData':()=>_0x3549f0['state']['doc']['toString'](),'setData':_0x5b1e89=>{_0x3549f0['dispatch']({'changes':{'from':0x0,'to':_0x3549f0['state']['doc']['length'],'insert':_0x5b1e89},'annotations':_0x447b1d['addToHistory']['of'](!0x1)});},'setReadOnly':_0x540f1f=>{_0x3549f0['dispatch']({'effects':[_0x134b21['reconfigure'](_0xe8f632['editable']['of'](!_0x540f1f))]});},'destroy':()=>{_0x3549f0['destroy']();},'instance':_0x3549f0};}var Z=class extends _0x2acbcc{['_codeEditorApi']=null;['_options'];constructor(_0x5a1be2,_0x1b8625){super(_0x5a1be2),this['_options']=_0x1b8625,this['set']('isReadOnly',!0x1),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-code-editor'],'tabindex':-0x1}});}['render'](){super['render'](),this['_codeEditorApi']=X({'parent':this['element'],'syntaxLanguage':this['_options']['syntaxLanguage'],'theme':this['_options']['theme']}),this['on']('change:isReadOnly',(_0xf0cf3e,_0x2fc268,_0x3b7bc2)=>{this['setReadOnly'](_0x3b7bc2);});}['destroy'](){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}['getData'](){return this['_codeEditorApi']['getData']();}['setData'](_0x3991c7){this['_codeEditorApi']['setData'](_0x3991c7);}['setReadOnly'](_0x5ec212){this['_codeEditorApi']['setReadOnly'](_0x5ec212);}};const G='SourceEditingEnhancedMode';var W=class extends _0x4e4c57{constructor(_0x4518f3){super(_0x4518f3),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x20b0cc)['on']('change:hasAny',(_0x37217a,_0x16e7e3,_0x34ae52)=>{_0x34ae52?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x2ed2f=this['editor'];for(const _0x2098c4 of _0x2ed2f['commands']['names']())['replaceSource','editSource']['includes'](_0x2098c4)||_0x2ed2f['commands']['get'](_0x2098c4)['forceDisabled'](G);}['_enableCommands'](){const _0x256a52=this['editor'];for(const _0x3e5e62 of _0x256a52['commands']['commands']())_0x3e5e62['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}['execute'](){const _0x34cd6e=this['editor'],_0x3018ff=_0x34cd6e['locale'],_0x3be23f=_0x34cd6e['plugins']['get']('Dialog'),_0x3f9a6d=B(_0x34cd6e),_0x258d25=J(_0x45a6c8=_0x34cd6e['data']['get']({'rootName':_0x3f9a6d}))?_0x2164e3(_0x45a6c8):_0x45a6c8;var _0x45a6c8;const _0x3e7f04=new Z(_0x3018ff,{'syntaxLanguage':_0x34cd6e['plugins']['has']('Markdown')?'markdown':'html','theme':_0x34cd6e['config']['get']('sourceEditingEnhanced.theme')});let _0x434866=!0x0;const _0x37d3ff=_0x1bd5da=>{if(_0x434866&&Y(_0x3e7f04['getData']())!==Y(_0x258d25))return window['confirm'](Q(_0x3018ff,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x1bd5da['stop']();};_0x3be23f['show']({'id':'sourceEditingEnhanced','title':Q(_0x3018ff,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x3e7f04,'actionButtons':[{'label':Q(_0x3018ff,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x3be23f['hide']();}},{'label':Q(_0x3018ff,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x3dafaa=Y(_0x3e7f04['getData']())!==Y(_0x258d25);_0x3dafaa&&_0x34cd6e['execute']('replaceSource',_0x3e7f04['getData']()),_0x434866=!0x1,_0x3be23f['hide'](),_0x3dafaa&&'editables'in _0x34cd6e['ui']['view']&&_0x34cd6e['ui']['view']['editables'][_0x3f9a6d]['element']['focus']();},'onCreate':_0x358164=>{_0x358164['set']('isEnabled',!_0x34cd6e['isReadOnly']),_0x358164['bind']('isEnabled')['to'](_0x34cd6e,'isReadOnly',this,'isEnabled',(_0xb07f6c,_0x4ffb8b)=>!_0xb07f6c&&_0x4ffb8b);}}],'onHide':()=>{this['_enableCommands'](),_0x3be23f['off']('hide',_0x37d3ff),_0x3e7f04['destroy']();},'onShow':()=>{_0x3e7f04['bind']('isReadOnly')['to'](_0x34cd6e,'isReadOnly',this,'isEnabled',(_0x524f0f,_0x2ce5ff)=>_0x524f0f||!_0x2ce5ff),_0x3e7f04['setData'](_0x258d25),_0x3e7f04['focus'](),_0x3be23f['on']('hide',_0x37d3ff,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x3e0f24{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get['requires'](){return[_0x20b0cc];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const _0x247784=this['editor'],_0x4b7bca=_0x247784['locale'],_0x4a870e=new W(_0x247784);_0x247784['commands']['add']('editSource',_0x4a870e),_0x247784['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x232f49=this['_createButton'](_0xfec814,_0x4a870e);return _0x232f49['set']({'label':Q(_0x4b7bca,'Source'),'icon':_0x21fcba,'tooltip':Q(_0x4b7bca,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x232f49;}),_0x247784['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x28c466=this['_createButton'](_0x595db2,_0x4a870e,!0x0);return _0x28c466['set']({'label':Q(_0x4b7bca,'Edit\x20source\x20modal\x20label'),'icon':_0x21fcba,'role':'menuitemcheckbox'}),_0x28c466;}),this['_registerKeybindings']();}['afterInit'](){!async function(_0x4e4fa3){const _0x5bec60='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x318f2f=0x78e58,_0x563e85=window['Date']['now'](),_0x591844=_0x4e4fa3['editor'],_0x281b48=new window['Promise'](_0x3e67dc=>{_0x591844['once']('ready',_0x3e67dc);}),_0x9f32b6={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0xe5729=_0x591844['config']['get']('licenseKey');async function _0x6bec03(){let _0x58a034,_0x4c4b68=null,_0x2c701a=null;try{return'GPL'==_0xe5729?'NotAllowed':(_0x58a034=_0x3e729f(),_0x58a034?(_0x58a034['usageEndpoint']&&(_0x2c701a=_0x1f95a3(_0x58a034['usageEndpoint'],_0x58a034['jti'])),await _0x2119d2()?_0x446d3b()?_0x54c030()?'Expired':_0x5983cd()?('evaluation'==_0x58a034['licenseType']&&(_0x4c4b68=_0x46baf3('EvaluationLimit')),await _0x31e858()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x54c030(){const _0x35397b=['evaluation','trial']['includes'](_0x58a034['licenseType'])?_0x563e85/0x3e8:0xe10*_0x318f2f;return _0x58a034['exp']<_0x35397b;}function _0x446d3b(){const _0x27de8c=_0x58a034['features'];return!!_0x27de8c&&(!!_0x27de8c['includes']('*')||!!_0x27de8c['includes']('SEE'));}function _0x5983cd(){const _0x425e02=_0x58a034['licensedHosts'];if(!_0x425e02||0x0==_0x425e02['length'])return!0x0;const {hostname:_0x163912}=new URL(window['location']['href']);if(_0x425e02['includes'](_0x163912))return!0x0;const _0x4f7d7c=_0x163912['split']('.');return _0x425e02['filter'](_0x68d40c=>_0x68d40c['includes']('*'))['map'](_0x1b13a8=>_0x1b13a8['split']('.'))['filter'](_0x377fef=>_0x377fef['length']<=_0x4f7d7c['length'])['map'](_0xfe1819=>Array(_0x4f7d7c['length']-_0xfe1819['length'])['fill']('*'===_0xfe1819[0x0]?'*':'')['concat'](_0xfe1819))['some'](_0x4cb038=>_0x4f7d7c['every']((_0xbb74b4,_0x381c3c)=>_0x4cb038[_0x381c3c]===_0xbb74b4||'*'===_0x4cb038[_0x381c3c]));}function _0x31e858(){return _0x4c4b68&&_0x2c701a?new window['Promise']((_0x8de61a,_0x22eb3d)=>{_0x4c4b68['then'](_0x8de61a,_0x22eb3d),_0x2c701a['then'](_0x12406b=>{'Valid'!=_0x12406b&&_0x8de61a(_0x12406b);},_0x22eb3d);}):_0x4c4b68||_0x2c701a||'Valid';}}function _0x1f95a3(_0x46c692,_0x45442d){return new window['Promise'](_0x164fe2=>{if(_0x16294c())return _0x164fe2('Valid');_0x5a2064(),_0x591844['decorate']('_sendUsageRequest');let _0x4be23f=!0x1;const _0x24c53d=_0x297b7f();function _0x3dfc1b(_0x4f2120){return!!_0x4f2120&&('object'==typeof _0x4f2120||'function'==typeof _0x4f2120)&&'function'==typeof _0x4f2120['then']&&'function'==typeof _0x4f2120['catch'];}function _0xca6bbd(_0x257dd7){_0x51df3f(_0x257dd7)['then'](_0x367098=>_0x367098&&'ok'==_0x367098['status']?_0x1a1385(_0x48b4cf(_0x24c53d+_0x45442d))!=_0x367098['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x34e46d=>(_0x10d576(),_0x34e46d),()=>{const _0x26fc76=_0x3d8440();return null==_0x26fc76?(_0x10d576(),'Valid'):_0x563e85-_0x26fc76>0x240c8400?'UsageLimit':'Valid';})['then'](_0x164fe2)['catch'](()=>{_0x164fe2('UsageLimit');});const _0x52f109=0x36ee80;function _0x10d576(){const _0x26309a='llct-'+_0x1a1385(_0x48b4cf(_0x46c692)),_0x2d3043=_0x135643(_0x1a1385(window['Math']['ceil'](_0x563e85/_0x52f109)));window['localStorage']['setItem'](_0x26309a,_0x2d3043);}function _0x3d8440(){const _0x67fde2='llct-'+_0x1a1385(_0x48b4cf(_0x46c692)),_0x11b9d7=window['localStorage']['getItem'](_0x67fde2);return _0x11b9d7?window['parseInt'](_0x135643(_0x11b9d7),0x10)*_0x52f109:null;}function _0x51df3f(_0x4746ba){return new window['Promise']((_0x112593,_0x552c64)=>{_0x4746ba['then'](_0x112593,_0x552c64),window['setTimeout'](_0x552c64,0x1d4c0);});}}_0x591844['on']('_sendUsageRequest',(_0x1b09e2,_0x2da653)=>{if(_0x2da653[0x0]!=_0x46c692)return _0x164fe2('UsageLimit');_0x2da653[0x1]={..._0x2da653[0x1],'requestId':_0x24c53d};},{'priority':'high'}),_0x591844['on']('_sendUsageRequest',_0x216480=>{_0x3dfc1b(_0x216480['return'])&&(_0x4be23f=!0x0,_0xca6bbd(_0x216480['return']));},{'priority':'low'}),_0x281b48['then'](()=>{_0x4be23f||_0x164fe2('UsageLimit');});});function _0x16294c(){return'auto'==_0x591844['editing']['view']['_overlayModeHint'];}function _0x5a2064(){_0x591844['editing']['view']['_overlayModeHint']='auto';}}function _0x46baf3(_0x5e072b){const _0x2c4542=[new window['Promise'](_0x3d1417=>setTimeout(_0x3d1417,0x93ecc)),_0x281b48['then'](()=>new window['Promise'](_0x4e3f29=>{let _0x53434e=0x0;_0x591844['model']['on']('applyOperation',(_0xadedb9,_0x1817d5)=>{_0x1817d5[0x0]['isDocumentOperation']&&_0x53434e++,0x5e8==_0x53434e&&(_0x4e3f29(),_0xadedb9['off']());});}))];return window['Promise']['race'](_0x2c4542)['then'](()=>_0x5e072b);}async function _0x269afa(){await _0x281b48,_0x591844['model']['change']=_0x1e7318,_0x591844['model']['enqueueChange']=_0x1e7318,_0x591844['enableReadOnlyMode']('model');}function _0x496f2e(_0x232a36){const _0x2bded4=_0x1aed26();_0x591844[_0x2bded4]='sourceEditingEnhancedLicenseKey'+_0x232a36,'Valid'!=_0x232a36&&_0x269afa();}function _0x1aed26(){const _0x7217c5=window['String'](window['performance']['now']())['replace']('.','');let _0x3800b3='N';for(let _0x3a0a7a=0x0;_0x3a0a7a<_0x7217c5['length'];_0x3a0a7a+=0x2){let _0x509d9b=window['parseInt'](_0x7217c5['substring'](_0x3a0a7a,_0x3a0a7a+0x2));_0x509d9b>=0x3e&&(_0x509d9b-=0x3e),_0x3800b3+=_0x5bec60[_0x509d9b];}return _0x3800b3;}function _0x3e729f(){const _0x239e7f=_0xe5729['split']('.');if(0x3!=_0x239e7f['length'])return null;return _0x1928da(_0x239e7f[0x1]);function _0x1928da(_0xd9f706){const _0x20e625=_0x1cad40(_0xd9f706);return _0x20e625&&_0x2b133e()?_0x20e625:null;function _0x2b133e(){const _0xbb328f=_0x20e625['jti'],_0x19d719=window['parseInt'](_0xbb328f['substring'](_0xbb328f['length']-0x8),0x10),_0x25ab69={..._0x20e625,'jti':_0xbb328f['substring'](0x0,_0xbb328f['length']-0x8)};return delete _0x25ab69['vc'],_0x48b4cf(_0x25ab69)==_0x19d719;}}}async function _0x2119d2(){let _0x5d9cdc=!0x0;try{const [_0x3f9e03,_0x592d7b,_0x2cd211]=_0xe5729['split']('.');return _0x55bd66(_0x3f9e03),await _0x2507e6(_0x3f9e03,_0x592d7b,_0x2cd211),_0x5d9cdc;}catch{return!0x1;}function _0x55bd66(_0xd166b0){const _0x222c13=_0x1cad40(_0xd166b0);_0x222c13&&'ES256'==_0x222c13['alg']||(_0x5d9cdc=!0x1);}async function _0x2507e6(_0x18c725,_0x334b6,_0x20bb45){const _0x2a75c0=window['Uint8Array']['from'](_0x21b04e(_0x20bb45),_0x3b375d=>_0x3b375d['charCodeAt'](0x0)),_0x529b1f=new window['TextEncoder']()['encode'](_0x18c725+'.'+_0x334b6),_0x67dbd8=window['crypto']['subtle'];if(!_0x67dbd8)return;const _0x3227c3=await _0x67dbd8['importKey']('jwk',_0x9f32b6,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x67dbd8['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3227c3,_0x2a75c0,_0x529b1f)||(_0x5d9cdc=!0x1);}}function _0x1cad40(_0x42f38e){return _0x42f38e['startsWith']('ey')?JSON['parse'](_0x21b04e(_0x42f38e)):null;}function _0x21b04e(_0xeada8d){return window['atob'](_0xeada8d['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x48b4cf(_0x3ae016){let _0x1d7592=0x1505;function _0x3655f2(_0xd4fe3a){for(let _0x43a3b8=0x0;_0x43a3b8<_0xd4fe3a['length'];_0x43a3b8++){const _0x1a2571=_0xd4fe3a['charCodeAt'](_0x43a3b8);_0x1d7592=(_0x1d7592<<0x5)+_0x1d7592+_0x1a2571,_0x1d7592&=_0x1d7592;}}function _0x3cbc4d(_0x4c44bc){Array['isArray'](_0x4c44bc)?_0x4c44bc['forEach'](_0x3cbc4d):_0x4c44bc&&'object'==typeof _0x4c44bc?Object['entries'](_0x4c44bc)['sort']()['forEach'](([_0x4b7d01,_0x83edaa])=>{_0x3655f2(_0x4b7d01),_0x3cbc4d(_0x83edaa);}):_0x3655f2(window['String'](_0x4c44bc));}return _0x3cbc4d(_0x3ae016),_0x1d7592>>>0x0;}function _0x1a1385(_0x142b74){return _0x142b74['toString'](0x10)['padStart'](0x8,'0');}function _0x135643(_0x3bb843){return _0x3bb843['split']('')['reverse']()['join']('');}function _0x1e7318(){}_0x496f2e(await _0x6bec03());}(this);}['_createButton'](_0x1a08d6,_0x428396,_0x48533a=!0x1){const _0x3e697a=new _0x1a08d6(this['editor']['locale']);return _0x3e697a['set']({'withText':_0x48533a,'isToggleable':!0x1}),_0x3e697a['bind']('isEnabled')['to'](_0x428396,'isEnabled'),this['listenTo'](_0x3e697a,'execute',()=>_0x428396['execute']()),_0x3e697a;}['_registerKeybindings'](){const _0x140c76=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x140c76,'Source\x20Editing\x20Enhanced')});const _0x5ec74=_0x345c76['isMac']||_0x345c76['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x140c76,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x140c76,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x140c76,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x140c76,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x140c76,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x140c76,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x140c76,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x5ec74?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x140c76,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x140c76,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x140c76,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x140c76,'Select\x20line'),'keystroke':_0x5ec74?'Ctrl!+L':'Alt+L'},{'label':Q(_0x140c76,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x5ec74?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x140c76,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x140c76,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x140c76,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x140c76,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x140c76,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x5ec74?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x4e4c57{constructor(_0x5e2acf){super(_0x5e2acf),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}['execute'](_0x534244,_0x24e8bc){const _0x1d866b=this['editor'],_0x12e487=_0x24e8bc?.['rootName']??B(_0x1d866b);_0x1d866b['data']['set']({[_0x12e487]:_0x534244},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x3e0f24{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[$];}constructor(_0x445628){super(_0x445628),_0x445628['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}['init'](){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x56066a=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1feede;for(const _0x472052 in _0x56066a){const _0x2d9e0c=_0x472052,_0x5928f3=_0x56066a[_0x2d9e0c];if('sourceEditingEnhancedLicenseKeyValid'==_0x5928f3||'sourceEditingEnhancedLicenseKeyInvalid'==_0x5928f3||'sourceEditingEnhancedLicenseKeyExpired'==_0x5928f3||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x5928f3||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x5928f3||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x5928f3||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x5928f3){delete _0x56066a[_0x2d9e0c],_0x1feede=_0x5928f3,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x1feede&&_0x56066a['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x1feede&&_0x56066a['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x1feede&&_0x56066a['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x1feede&&_0x56066a['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x1feede&&_0x56066a['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x1feede&&_0x56066a['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_checkCompatibility'](){const _0xefd472=this['editor'],_0x3341c3=_0xefd472['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x3341c3&&_0xefd472['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x5c0d9c('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x3341c3&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x457785=>_0xefd472['plugins']['has'](_0x457785))&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20at\x20least\x20one\x20of\x20the\x20collaboration\x20features.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20collaboration\x20features.'),_0xefd472['plugins']['has']('RestrictedEditingModeEditing')&&console['warn']('You\x20initialized\x20the\x20editor\x20with\x20the\x20source\x20editing\x20enhanced\x20feature\x20and\x20restricted\x20editing\x20feature.\x20Please\x20be\x20advised\x20that\x20the\x20source\x20editing\x20enhanced\x20feature\x20may\x20not\x20work,\x20and\x20be\x20careful\x20when\x20editing\x20document\x20source\x20that\x20contains\x20markers\x20created\x20by\x20the\x20restricted\x20editing\x20feature.');}};export{W as EditSourceCommand,ee as ReplaceSourceCommand,te as SourceEditingEnhanced};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-source-editing-enhanced",
3
- "version": "48.3.0-alpha.4",
3
+ "version": "48.3.0-alpha.6",
4
4
  "description": "Source editing enhanced feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -25,11 +25,11 @@
25
25
  "dist/translations/*.umd.js"
26
26
  ],
27
27
  "dependencies": {
28
- "@ckeditor/ckeditor5-core": "48.3.0-alpha.4",
29
- "@ckeditor/ckeditor5-engine": "48.3.0-alpha.4",
30
- "@ckeditor/ckeditor5-icons": "48.3.0-alpha.4",
31
- "@ckeditor/ckeditor5-ui": "48.3.0-alpha.4",
32
- "@ckeditor/ckeditor5-utils": "48.3.0-alpha.4",
28
+ "@ckeditor/ckeditor5-core": "48.3.0-alpha.6",
29
+ "@ckeditor/ckeditor5-engine": "48.3.0-alpha.6",
30
+ "@ckeditor/ckeditor5-icons": "48.3.0-alpha.6",
31
+ "@ckeditor/ckeditor5-ui": "48.3.0-alpha.6",
32
+ "@ckeditor/ckeditor5-utils": "48.3.0-alpha.6",
33
33
  "@codemirror/autocomplete": "^6.7.1",
34
34
  "@codemirror/commands": "6.8.1",
35
35
  "@codemirror/lang-html": "^6.0.0",