@ckeditor/ckeditor5-source-editing-enhanced 49.0.0-alpha.4 → 49.0.0-alpha.5

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 _0x119cd7,PendingActions as _0x22a08c,Plugin as _0x15a87c}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x4ebc5a,env as _0x32e0a3,formatHtml as _0x5709be,uid as _0x71e61b}from'@ckeditor/ckeditor5-utils';import{IconSource as _0xf835ce}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x4a3f71,MenuBarMenuListItemButtonView as _0x561e12,View as _0x514047}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x492f15,crosshairCursor as _0x5b72d5,drawSelection as _0x198eeb,dropCursor as _0x5ae3de,highlightActiveLine as _0x4955c8,highlightActiveLineGutter as _0x55c989,highlightSpecialChars as _0x4d11c5,keymap as _0x11b9c0,lineNumbers as _0x2a0a79,rectangularSelection as _0x5a1293}from'@codemirror/view';import{Compartment as _0x2c5cdb,Transaction as _0xa29599}from'@codemirror/state';import{bracketMatching as _0x51b222,defaultHighlightStyle as _0x31c501,foldGutter as _0x63e159,foldKeymap as _0x1baaf8,indentOnInput as _0x534fa8,syntaxHighlighting as _0x5c226f}from'@codemirror/language';import{defaultKeymap as _0x3d5677,history as _0x37a242,historyKeymap as _0x16ccf9,indentLess as _0x4b9c2c,indentMore as _0x4a4f88,redo as _0x53d86b,toggleTabFocusMode as _0x5d1e29,undo as _0xf2fae2}from'@codemirror/commands';import{autocompletion as _0x2a4d60,closeBrackets as _0x1de736,closeBracketsKeymap as _0x21d4e1,completionKeymap as _0x314f2b}from'@codemirror/autocomplete';import{html as _0x358c96}from'@codemirror/lang-html';import{markdown as _0x430fe9}from'@codemirror/lang-markdown';import{oneDark as _0xb3c72f}from'@codemirror/theme-one-dark';function Q(_0x541e5c,_0xfe935){const t=_0x541e5c['t'];switch(_0xfe935){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 _0xfe935;}}function B(_0x48675a){const _0x5a48be=_0x48675a['editing']['view']['document']['roots'],_0x3d8f50=_0x5a48be['length'];if(0x0===_0x3d8f50)throw new _0x4ebc5a('source-editing-enhanced-editor-no-root',_0x48675a);return 0x1===_0x3d8f50?_0x5a48be['first']['rootName']:Array['from'](_0x48675a['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x4f147c){return J(_0x4f147c['replace'](/^[\n\s]*/g,''))?_0x4f147c['replace'](/\s+/g,''):_0x4f147c;}function J(_0x56e1c7){return _0x56e1c7['startsWith']('<');}function X(_0x119d6e){const _0x435e5c=[_0x492f15['lineWrapping'],_0x2a4d60(),_0x51b222(),_0x1de736(),_0x5b72d5(),_0x198eeb(),_0x5ae3de(),_0x2a0a79(),_0x63e159(),_0x4955c8(),_0x55c989(),_0x4d11c5(),_0x37a242(),_0x534fa8(),_0x5a1293(),_0x5c226f(_0x31c501,{'fallback':!0x0})],_0x19a98f=new _0x2c5cdb();_0x435e5c['push'](_0x19a98f['of'](_0x492f15['editable']['of'](!0x0))),'html'===_0x119d6e['syntaxLanguage']?_0x435e5c['push'](_0x358c96()):_0x435e5c['push'](_0x430fe9());const _0xe111b7=(_0x1cd05a=_0x119d6e['theme'])&&'default'!==_0x1cd05a?'dark'===_0x1cd05a?_0xb3c72f:_0x1cd05a:null;var _0x1cd05a;_0xe111b7&&_0x435e5c['push'](_0xe111b7),_0x435e5c['push'](_0x11b9c0['of']([..._0x21d4e1,..._0x3d5677,..._0x16ccf9,..._0x1baaf8,..._0x314f2b,{'key':'Tab','run':_0x4a4f88,'shift':_0x4b9c2c,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x53d86b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x53d86b,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0xf2fae2,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x4cb562=new _0x492f15({'extensions':_0x435e5c,'parent':_0x119d6e['parent']});return _0x5d1e29(_0x4cb562),{'focus':()=>{_0x4cb562['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x4cb562['focus']();},'getData':()=>_0x4cb562['state']['doc']['toString'](),'setData':_0x3880c8=>{_0x4cb562['dispatch']({'changes':{'from':0x0,'to':_0x4cb562['state']['doc']['length'],'insert':_0x3880c8},'annotations':_0xa29599['addToHistory']['of'](!0x1)});},'setReadOnly':_0x4c01fc=>{_0x4cb562['dispatch']({'effects':[_0x19a98f['reconfigure'](_0x492f15['editable']['of'](!_0x4c01fc))]});},'destroy':()=>{_0x4cb562['destroy']();},'instance':_0x4cb562};}var Z=class extends _0x514047{_codeEditorApi=null;_options;constructor(_0x3b3b10,_0x3dd93a){super(_0x3b3b10),this['_options']=_0x3dd93a,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',(_0x56e0a2,_0x433483,_0x115c24)=>{this['setReadOnly'](_0x115c24);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x4d4187){this['_codeEditorApi']['setData'](_0x4d4187);}setReadOnly(_0xd739cc){this['_codeEditorApi']['setReadOnly'](_0xd739cc);}};const G='SourceEditingEnhancedMode';var W=class extends _0x119cd7{constructor(_0x501100){super(_0x501100),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x22a08c)['on']('change:hasAny',(_0x47c542,_0x26d66a,_0x1b1aa8)=>{_0x1b1aa8?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x458a50=this['editor'];for(const _0x49340f of _0x458a50['commands']['names']())['replaceSource','editSource']['includes'](_0x49340f)||_0x458a50['commands']['get'](_0x49340f)['forceDisabled'](G);}['_enableCommands'](){const _0x5c0c99=this['editor'];for(const _0x19b70f of _0x5c0c99['commands']['commands']())_0x19b70f['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x1e78c2=this['editor'],_0x1c336b=_0x1e78c2['locale'],_0x29a7c2=_0x1e78c2['plugins']['get']('Dialog'),_0x173167=B(_0x1e78c2),_0x357797=_0x1e78c2['data']['get']({'rootName':_0x173167}),_0x13d6d1=J(_0x299f37=_0x357797)?_0x5709be(_0x299f37):_0x299f37;var _0x299f37;const _0x4c9801=new Z(_0x1c336b,{'syntaxLanguage':_0x1e78c2['plugins']['has']('Markdown')?'markdown':'html','theme':_0x1e78c2['config']['get']('sourceEditingEnhanced.theme')});let _0x233c9f=!0x0;const _0x1dd9e7=_0x2e14d2=>{if(!_0x233c9f)return;return Y(_0x4c9801['getData']())!==Y(_0x13d6d1)?window['confirm'](Q(_0x1c336b,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x2e14d2['stop']():void 0x0;};_0x29a7c2['show']({'id':'sourceEditingEnhanced','title':Q(_0x1c336b,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x4c9801,'actionButtons':[{'label':Q(_0x1c336b,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x29a7c2['hide']();}},{'label':Q(_0x1c336b,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x52da99=Y(_0x4c9801['getData']())!==Y(_0x13d6d1);_0x52da99&&_0x1e78c2['execute']('replaceSource',_0x4c9801['getData']()),_0x233c9f=!0x1,_0x29a7c2['hide'](),_0x52da99&&'editables'in _0x1e78c2['ui']['view']&&_0x1e78c2['ui']['view']['editables'][_0x173167]['element']['focus']();},'onCreate':_0x5f4d74=>{_0x5f4d74['set']('isEnabled',!_0x1e78c2['isReadOnly']),_0x5f4d74['bind']('isEnabled')['to'](_0x1e78c2,'isReadOnly',this,'isEnabled',(_0x4bc29d,_0x91d191)=>!_0x4bc29d&&_0x91d191);}}],'onHide':()=>{this['_enableCommands'](),_0x29a7c2['off']('hide',_0x1dd9e7),_0x4c9801['destroy']();},'onShow':()=>{_0x4c9801['bind']('isReadOnly')['to'](_0x1e78c2,'isReadOnly',this,'isEnabled',(_0x5e94d2,_0x8b85ab)=>_0x5e94d2||!_0x8b85ab),_0x4c9801['setData'](_0x13d6d1),_0x4c9801['focus'](),_0x29a7c2['on']('hide',_0x1dd9e7,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x15a87c{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x22a08c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x463c1e=this['editor'],_0x5b96c9=_0x463c1e['locale'],_0x4195e0=new W(_0x463c1e);_0x463c1e['commands']['add']('editSource',_0x4195e0),_0x463c1e['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x4f478c=this['_createButton'](_0x4a3f71,_0x4195e0);return _0x4f478c['set']({'label':Q(_0x5b96c9,'Source'),'icon':_0xf835ce,'tooltip':Q(_0x5b96c9,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x4f478c;}),_0x463c1e['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x532c12=this['_createButton'](_0x561e12,_0x4195e0,!0x0);return _0x532c12['set']({'label':Q(_0x5b96c9,'Edit\x20source\x20modal\x20label'),'icon':_0xf835ce,'role':'menuitemcheckbox'}),_0x532c12;}),this['_registerKeybindings']();}afterInit(){!async function(_0x1f823c){const _0x187c9e='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x3417ea=0x79770,_0x519fde={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x38b966(_0x43b8cf){const _0x1799cf=new window['Promise'](_0x52f9e8=>{_0x43b8cf['once']('ready',_0x52f9e8);}),_0x33646e=window['Date']['now'](),_0x240680=_0x43b8cf['config']['get']('licenseKey');async function _0x4529e2(){let _0x56a932,_0x5f1976=null,_0x641ce3=null;try{return'GPL'==_0x240680?'NotAllowed':(_0x56a932=_0x352fe1(),_0x56a932?(_0x56a932['usageEndpoint']&&(_0x641ce3=_0x20c154(_0x56a932['usageEndpoint'],_0x56a932['jti'])),await _0x5b8449()?_0x4556ce()?_0x3358c5()?'Expired':_0x35a0a7()?('evaluation'==_0x56a932['licenseType']&&(_0x5f1976=_0xc3a3a0('EvaluationLimit')),await _0x54b8a0()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3358c5(){const _0x125cf9=['evaluation','trial']['includes'](_0x56a932['licenseType'])?_0x33646e/0x3e8:0xe10*_0x3417ea;return _0x56a932['exp']<_0x125cf9;}function _0x4556ce(){const _0x4203e6=_0x56a932['features'];return!!_0x4203e6&&(!!_0x4203e6['includes']('*')||!!_0x4203e6['includes']('SEE'));}function _0x35a0a7(){const _0x548822=_0x56a932['licensedHosts'];if(!_0x548822||0x0==_0x548822['length'])return!0x0;const {hostname:_0xd39279}=new URL(window['location']['href']);if(_0x548822['includes'](_0xd39279))return!0x0;const _0x4aac7a=_0xd39279['split']('.');return _0x548822['filter'](_0x2af245=>_0x2af245['includes']('*'))['map'](_0x227efa=>_0x227efa['split']('.'))['filter'](_0x581d56=>_0x581d56['length']<=_0x4aac7a['length'])['map'](_0x284988=>Array(_0x4aac7a['length']-_0x284988['length'])['fill']('*'===_0x284988[0x0]?'*':'')['concat'](_0x284988))['some'](_0xea80dd=>_0x4aac7a['every']((_0x497daa,_0x3e7af7)=>_0xea80dd[_0x3e7af7]===_0x497daa||'*'===_0xea80dd[_0x3e7af7]));}function _0x54b8a0(){return _0x5f1976&&_0x641ce3?new window['Promise']((_0x33788a,_0x3c93bf)=>{_0x5f1976['then'](_0x33788a,_0x3c93bf),_0x641ce3['then'](_0x3afb20=>{'Valid'!=_0x3afb20&&_0x33788a(_0x3afb20);},_0x3c93bf);}):_0x5f1976||_0x641ce3||'Valid';}}function _0x20c154(_0x1b7efd,_0x5877f3){return new window['Promise'](_0x4c1631=>{if(_0x593213())return _0x4c1631('Valid');_0x45722b(),_0x43b8cf['decorate']('_sendUsageRequest');let _0x3ff29f=!0x1;const _0xeef80c=_0x71e61b();function _0x5185a8(_0x5e6446){return!!_0x5e6446&&('object'==typeof _0x5e6446||'function'==typeof _0x5e6446)&&'function'==typeof _0x5e6446['then']&&'function'==typeof _0x5e6446['catch'];}function _0x5d3a1a(_0x5356aa){_0x373743(_0x5356aa)['then'](_0x571cde=>_0x571cde&&'ok'==_0x571cde['status']?_0x535288(_0x157e2a(_0xeef80c+_0x5877f3))!=_0x571cde['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2362b3=>(_0x202493(),_0x2362b3),()=>{const _0x42f6be=_0x2fab94();return null==_0x42f6be?(_0x202493(),'Valid'):_0x33646e-_0x42f6be>0x240c8400?'UsageLimit':'Valid';})['then'](_0x4c1631)['catch'](()=>{_0x4c1631('UsageLimit');});const _0x11ec55=0x36ee80;function _0x202493(){const _0x450fb8='llct-'+_0x535288(_0x157e2a(_0x1b7efd)),_0x5ee42e=_0x4759af(_0x535288(window['Math']['ceil'](_0x33646e/_0x11ec55)));window['localStorage']['setItem'](_0x450fb8,_0x5ee42e);}function _0x2fab94(){const _0x25c11e='llct-'+_0x535288(_0x157e2a(_0x1b7efd)),_0x42a5a8=window['localStorage']['getItem'](_0x25c11e);return _0x42a5a8?window['parseInt'](_0x4759af(_0x42a5a8),0x10)*_0x11ec55:null;}function _0x373743(_0x3618cd){return new window['Promise']((_0x2e6104,_0x43c243)=>{_0x3618cd['then'](_0x2e6104,_0x43c243),window['setTimeout'](_0x43c243,0x1d4c0);});}}_0x43b8cf['on']('_sendUsageRequest',(_0x289fb0,_0x8601e6)=>{if(_0x8601e6[0x0]!=_0x1b7efd)return _0x4c1631('UsageLimit');_0x8601e6[0x1]={..._0x8601e6[0x1],'requestId':_0xeef80c};},{'priority':'high'}),_0x43b8cf['on']('_sendUsageRequest',_0xbd5c3d=>{_0x5185a8(_0xbd5c3d['return'])&&(_0x3ff29f=!0x0,_0x5d3a1a(_0xbd5c3d['return']));},{'priority':'low'}),_0x1799cf['then'](()=>{_0x3ff29f||_0x4c1631('UsageLimit');});});function _0x593213(){return'auto'==_0x43b8cf['editing']['view']['_overlayModeHint'];}function _0x45722b(){_0x43b8cf['editing']['view']['_overlayModeHint']='auto';}}function _0xc3a3a0(_0x4b80e8){const _0x3d9afd=[new window['Promise'](_0x630d2=>setTimeout(_0x630d2,0x93ecc)),_0x1799cf['then'](()=>new window['Promise'](_0x2e934a=>{let _0x5aa56a=0x0;_0x43b8cf['model']['on']('applyOperation',(_0x5ef77e,_0x50af65)=>{_0x50af65[0x0]['isDocumentOperation']&&_0x5aa56a++,0x5e8==_0x5aa56a&&(_0x2e934a(),_0x5ef77e['off']());});}))];return window['Promise']['race'](_0x3d9afd)['then'](()=>_0x4b80e8);}async function _0x165352(){await _0x1799cf,_0x43b8cf['model']['change']=_0x2d6680,_0x43b8cf['model']['enqueueChange']=_0x2d6680,_0x43b8cf['enableReadOnlyMode']('model');}function _0x12c88f(_0x22bf6e){const _0x3c23ad=_0x25d6c5();_0x43b8cf[_0x3c23ad]='sourceEditingEnhancedLicenseKey'+_0x22bf6e,'Valid'!=_0x22bf6e&&_0x165352();}function _0x25d6c5(){const _0x4dc20e=window['String'](window['performance']['now']())['replace']('.','');let _0x46a751='R';for(let _0x21e22a=0x0;_0x21e22a<_0x4dc20e['length'];_0x21e22a+=0x2){let _0x4e30b4=window['parseInt'](_0x4dc20e['substring'](_0x21e22a,_0x21e22a+0x2));_0x4e30b4>=0x3e&&(_0x4e30b4-=0x3e),_0x46a751+=_0x187c9e[_0x4e30b4];}return _0x46a751;}function _0x352fe1(){const _0x590c33=_0x240680['split']('.');if(0x3!=_0x590c33['length'])return null;return _0x28f256(_0x590c33[0x1]);function _0x28f256(_0x104365){const _0x5b044e=_0x232d9c(_0x104365);return _0x5b044e&&_0x504253()?_0x5b044e:null;function _0x504253(){const _0x536000=_0x5b044e['jti'],_0x47abb1=window['parseInt'](_0x536000['substring'](_0x536000['length']-0x8),0x10),_0x2ba1bc={..._0x5b044e,'jti':_0x536000['substring'](0x0,_0x536000['length']-0x8)};return delete _0x2ba1bc['vc'],_0x157e2a(_0x2ba1bc)==_0x47abb1;}}}async function _0x5b8449(){let _0x4e3822=!0x0;try{const [_0x1bbe3c,_0x2b4e05,_0x12044c]=_0x240680['split']('.');return _0x439627(_0x1bbe3c),await _0x35b743(_0x1bbe3c,_0x2b4e05,_0x12044c),_0x4e3822;}catch{return!0x1;}function _0x439627(_0x3a6c2c){const _0x16a9f2=_0x232d9c(_0x3a6c2c);_0x16a9f2&&'ES256'==_0x16a9f2['alg']||(_0x4e3822=!0x1);}async function _0x35b743(_0xf44e54,_0x11f9cf,_0x2404f2){const _0x537519=window['Uint8Array']['from'](_0x3e2611(_0x2404f2),_0x6677fc=>_0x6677fc['charCodeAt'](0x0)),_0x38fdc0=new window['TextEncoder']()['encode'](_0xf44e54+'.'+_0x11f9cf),_0x4353dc=window['crypto']['subtle'];if(!_0x4353dc)return;const _0xcdd0dd=await _0x4353dc['importKey']('jwk',_0x519fde,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4353dc['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xcdd0dd,_0x537519,_0x38fdc0)||(_0x4e3822=!0x1);}}function _0x232d9c(_0x2fd7fd){return _0x2fd7fd['startsWith']('ey')?JSON['parse'](_0x3e2611(_0x2fd7fd)):null;}function _0x3e2611(_0x3d9f62){return window['atob'](_0x3d9f62['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x157e2a(_0x32390d){let _0xe4ea37=0x1505;function _0x296886(_0x525378){for(let _0x4649c2=0x0;_0x4649c2<_0x525378['length'];_0x4649c2++){const _0x1612de=_0x525378['charCodeAt'](_0x4649c2);_0xe4ea37=(_0xe4ea37<<0x5)+_0xe4ea37+_0x1612de,_0xe4ea37&=_0xe4ea37;}}function _0x2c4d8b(_0x4b6b01){Array['isArray'](_0x4b6b01)?_0x4b6b01['forEach'](_0x2c4d8b):_0x4b6b01&&'object'==typeof _0x4b6b01?Object['entries'](_0x4b6b01)['sort']()['forEach'](([_0x2a635f,_0x226be1])=>{_0x296886(_0x2a635f),_0x2c4d8b(_0x226be1);}):_0x296886(window['String'](_0x4b6b01));}return _0x2c4d8b(_0x32390d),_0xe4ea37>>>0x0;}function _0x535288(_0x5116d3){return _0x5116d3['toString'](0x10)['padStart'](0x8,'0');}function _0x4759af(_0x2766bb){return _0x2766bb['split']('')['reverse']()['join']('');}function _0x2d6680(){}_0x12c88f(await _0x4529e2());}_0x38b966(_0x1f823c['editor']);}(this);}_createButton(_0x1739a8,_0x42bd51,_0x89268e=!0x1){const _0x5b2e1d=new _0x1739a8(this['editor']['locale']);return _0x5b2e1d['set']({'withText':_0x89268e,'isToggleable':!0x1}),_0x5b2e1d['bind']('isEnabled')['to'](_0x42bd51,'isEnabled'),this['listenTo'](_0x5b2e1d,'execute',()=>_0x42bd51['execute']()),_0x5b2e1d;}_registerKeybindings(){const _0x520d77=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x520d77,'Source\x20Editing\x20Enhanced')});const _0x1f03b1=_0x32e0a3['isMac']||_0x32e0a3['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x520d77,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x520d77,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x520d77,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x520d77,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x520d77,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x520d77,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x520d77,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x1f03b1?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x520d77,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x520d77,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x520d77,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x520d77,'Select\x20line'),'keystroke':_0x1f03b1?'Ctrl!+L':'Alt+L'},{'label':Q(_0x520d77,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x1f03b1?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x520d77,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x520d77,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x520d77,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x520d77,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x520d77,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x1f03b1?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x119cd7{constructor(_0x372d4d){super(_0x372d4d),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x5ba9ee,_0x5eb0ec){const _0x1c7129=this['editor'],_0x4187c9=_0x5eb0ec?.['rootName']??B(_0x1c7129);_0x1c7129['data']['set']({[_0x4187c9]:_0x5ba9ee},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x15a87c{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x447e70){super(_0x447e70),_0x447e70['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x55aba8=[this['editor']];for(const _0x2941f9 of _0x55aba8){let _0x3e4801;for(const _0x1b2ce5 in _0x2941f9){const _0x163906=_0x1b2ce5,_0x285794=_0x2941f9[_0x163906];if('sourceEditingEnhancedLicenseKeyValid'==_0x285794||'sourceEditingEnhancedLicenseKeyInvalid'==_0x285794||'sourceEditingEnhancedLicenseKeyExpired'==_0x285794||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x285794||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x285794||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x285794||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x285794){delete _0x2941f9[_0x163906],_0x3e4801=_0x285794,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x3e4801&&_0x2941f9['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x3e4801&&_0x2941f9['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3e4801&&_0x2941f9['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3e4801&&_0x2941f9['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3e4801&&_0x2941f9['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3e4801&&_0x2941f9['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x3e1614=this['editor'],_0x40138b=_0x3e1614['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x40138b&&_0x3e1614['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x4ebc5a('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x40138b&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x840f6d=>_0x3e1614['plugins']['has'](_0x840f6d))&&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.'),_0x3e1614['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 _0x210b33,PendingActions as _0x4adf70,Plugin as _0x271ac9}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x11d1a3,env as _0x67a4a9,formatHtml as _0x53a741,uid as _0x370f84}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x21d128}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x33df17,MenuBarMenuListItemButtonView as _0x2363ff,View as _0x256f4e}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x2262fc,crosshairCursor as _0x229ac4,drawSelection as _0x13da17,dropCursor as _0x28e326,highlightActiveLine as _0x105695,highlightActiveLineGutter as _0x1bc4f3,highlightSpecialChars as _0x46180a,keymap as _0x29c6e5,lineNumbers as _0x5e3fd0,rectangularSelection as _0xe2aebb}from'@codemirror/view';import{Compartment as _0x54853e,Transaction as _0x559a0a}from'@codemirror/state';import{bracketMatching as _0x101c29,defaultHighlightStyle as _0xc368e,foldGutter as _0x5e360a,foldKeymap as _0x271493,indentOnInput as _0x563dfb,syntaxHighlighting as _0x500061}from'@codemirror/language';import{defaultKeymap as _0xbac9f5,history as _0x1edf52,historyKeymap as _0xc96341,indentLess as _0x14e655,indentMore as _0x4e5dc0,redo as _0x2702ce,toggleTabFocusMode as _0x4df859,undo as _0x563a94}from'@codemirror/commands';import{autocompletion as _0x455174,closeBrackets as _0x2e71e4,closeBracketsKeymap as _0x4ec2e8,completionKeymap as _0x56be56}from'@codemirror/autocomplete';import{html as _0x4cb09c}from'@codemirror/lang-html';import{markdown as _0x5282c7}from'@codemirror/lang-markdown';import{oneDark as _0x3b2aae}from'@codemirror/theme-one-dark';function Q(_0x456e14,_0x4cc1d4){const t=_0x456e14['t'];switch(_0x4cc1d4){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 _0x4cc1d4;}}function B(_0x5d55d9){const _0x14c33a=_0x5d55d9['editing']['view']['document']['roots'],_0x121066=_0x14c33a['length'];if(0x0===_0x121066)throw new _0x11d1a3('source-editing-enhanced-editor-no-root',_0x5d55d9);return 0x1===_0x121066?_0x14c33a['first']['rootName']:Array['from'](_0x5d55d9['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x5a35d6){return J(_0x5a35d6['replace'](/^[\n\s]*/g,''))?_0x5a35d6['replace'](/\s+/g,''):_0x5a35d6;}function J(_0x53c6a2){return _0x53c6a2['startsWith']('<');}function X(_0x145fff){const _0x47dcf7=[_0x2262fc['lineWrapping'],_0x455174(),_0x101c29(),_0x2e71e4(),_0x229ac4(),_0x13da17(),_0x28e326(),_0x5e3fd0(),_0x5e360a(),_0x105695(),_0x1bc4f3(),_0x46180a(),_0x1edf52(),_0x563dfb(),_0xe2aebb(),_0x500061(_0xc368e,{'fallback':!0x0})],_0xe096f1=new _0x54853e();_0x47dcf7['push'](_0xe096f1['of'](_0x2262fc['editable']['of'](!0x0))),'html'===_0x145fff['syntaxLanguage']?_0x47dcf7['push'](_0x4cb09c()):_0x47dcf7['push'](_0x5282c7());const _0x2755d2=(_0x11d24=_0x145fff['theme'])&&'default'!==_0x11d24?'dark'===_0x11d24?_0x3b2aae:_0x11d24:null;var _0x11d24;_0x2755d2&&_0x47dcf7['push'](_0x2755d2),_0x47dcf7['push'](_0x29c6e5['of']([..._0x4ec2e8,..._0xbac9f5,..._0xc96341,..._0x271493,..._0x56be56,{'key':'Tab','run':_0x4e5dc0,'shift':_0x14e655,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x2702ce,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x2702ce,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x563a94,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x2b182e=new _0x2262fc({'extensions':_0x47dcf7,'parent':_0x145fff['parent']});return _0x4df859(_0x2b182e),{'focus':()=>{_0x2b182e['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x2b182e['focus']();},'getData':()=>_0x2b182e['state']['doc']['toString'](),'setData':_0x1ca23e=>{_0x2b182e['dispatch']({'changes':{'from':0x0,'to':_0x2b182e['state']['doc']['length'],'insert':_0x1ca23e},'annotations':_0x559a0a['addToHistory']['of'](!0x1)});},'setReadOnly':_0x52062e=>{_0x2b182e['dispatch']({'effects':[_0xe096f1['reconfigure'](_0x2262fc['editable']['of'](!_0x52062e))]});},'destroy':()=>{_0x2b182e['destroy']();},'instance':_0x2b182e};}var Z=class extends _0x256f4e{_codeEditorApi=null;_options;constructor(_0x275cac,_0x32e630){super(_0x275cac),this['_options']=_0x32e630,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',(_0x4d8715,_0x4dcd39,_0x1ae530)=>{this['setReadOnly'](_0x1ae530);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x1e7199){this['_codeEditorApi']['setData'](_0x1e7199);}setReadOnly(_0x134f4f){this['_codeEditorApi']['setReadOnly'](_0x134f4f);}};const G='SourceEditingEnhancedMode';var W=class extends _0x210b33{constructor(_0x49a397){super(_0x49a397),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x4adf70)['on']('change:hasAny',(_0x3bdb34,_0x353351,_0x4fa9f0)=>{_0x4fa9f0?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x51163d=this['editor'];for(const _0x2b2831 of _0x51163d['commands']['names']())['replaceSource','editSource']['includes'](_0x2b2831)||_0x51163d['commands']['get'](_0x2b2831)['forceDisabled'](G);}['_enableCommands'](){const _0x2d3b9f=this['editor'];for(const _0x2d248c of _0x2d3b9f['commands']['commands']())_0x2d248c['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x4d4466=this['editor'],_0x33a46d=_0x4d4466['locale'],_0xaef42c=_0x4d4466['plugins']['get']('Dialog'),_0x27820a=B(_0x4d4466),_0x4416a4=_0x4d4466['data']['get']({'rootName':_0x27820a}),_0x520ac4=J(_0x1167b0=_0x4416a4)?_0x53a741(_0x1167b0):_0x1167b0;var _0x1167b0;const _0xda9e70=new Z(_0x33a46d,{'syntaxLanguage':_0x4d4466['plugins']['has']('Markdown')?'markdown':'html','theme':_0x4d4466['config']['get']('sourceEditingEnhanced.theme')});let _0x45b89b=!0x0;const _0x3a99cb=_0x405c65=>{if(!_0x45b89b)return;return Y(_0xda9e70['getData']())!==Y(_0x520ac4)?window['confirm'](Q(_0x33a46d,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x405c65['stop']():void 0x0;};_0xaef42c['show']({'id':'sourceEditingEnhanced','title':Q(_0x33a46d,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0xda9e70,'actionButtons':[{'label':Q(_0x33a46d,'Cancel'),'withText':!0x0,'onExecute':()=>{_0xaef42c['hide']();}},{'label':Q(_0x33a46d,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0xb1a169=Y(_0xda9e70['getData']())!==Y(_0x520ac4);_0xb1a169&&_0x4d4466['execute']('replaceSource',_0xda9e70['getData']()),_0x45b89b=!0x1,_0xaef42c['hide'](),_0xb1a169&&'editables'in _0x4d4466['ui']['view']&&_0x4d4466['ui']['view']['editables'][_0x27820a]['element']['focus']();},'onCreate':_0x398653=>{_0x398653['set']('isEnabled',!_0x4d4466['isReadOnly']),_0x398653['bind']('isEnabled')['to'](_0x4d4466,'isReadOnly',this,'isEnabled',(_0x348e48,_0x4252fa)=>!_0x348e48&&_0x4252fa);}}],'onHide':()=>{this['_enableCommands'](),_0xaef42c['off']('hide',_0x3a99cb),_0xda9e70['destroy']();},'onShow':()=>{_0xda9e70['bind']('isReadOnly')['to'](_0x4d4466,'isReadOnly',this,'isEnabled',(_0x4eb5bf,_0x4a599c)=>_0x4eb5bf||!_0x4a599c),_0xda9e70['setData'](_0x520ac4),_0xda9e70['focus'](),_0xaef42c['on']('hide',_0x3a99cb,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x271ac9{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x4adf70];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5a0d14=this['editor'],_0x1a02b3=_0x5a0d14['locale'],_0x262b52=new W(_0x5a0d14);_0x5a0d14['commands']['add']('editSource',_0x262b52),_0x5a0d14['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x505917=this['_createButton'](_0x33df17,_0x262b52);return _0x505917['set']({'label':Q(_0x1a02b3,'Source'),'icon':_0x21d128,'tooltip':Q(_0x1a02b3,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x505917;}),_0x5a0d14['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x16c7e4=this['_createButton'](_0x2363ff,_0x262b52,!0x0);return _0x16c7e4['set']({'label':Q(_0x1a02b3,'Edit\x20source\x20modal\x20label'),'icon':_0x21d128,'role':'menuitemcheckbox'}),_0x16c7e4;}),this['_registerKeybindings']();}afterInit(){!async function(_0x336216){const _0x3382a6='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x4f2d3f=0x79788,_0x40ff39={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x944fa3(_0x114c7b){const _0x3f0288=new window['Promise'](_0x510978=>{_0x114c7b['once']('ready',_0x510978);}),_0x462306=window['Date']['now'](),_0x56e144=_0x114c7b['config']['get']('licenseKey');async function _0x1579f4(){let _0x4426d3,_0x354ba9=null,_0x4cc833=null;try{return'GPL'==_0x56e144?'NotAllowed':(_0x4426d3=_0x536b19(),_0x4426d3?(_0x4426d3['usageEndpoint']&&(_0x4cc833=_0x677041(_0x4426d3['usageEndpoint'],_0x4426d3['jti'])),await _0x589c41()?_0x1f66cd()?_0x374ab3()?'Expired':_0x47e93e()?('evaluation'==_0x4426d3['licenseType']&&(_0x354ba9=_0xe0ee95('EvaluationLimit')),await _0x1aa5a4()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x374ab3(){const _0x231570=['evaluation','trial']['includes'](_0x4426d3['licenseType'])?_0x462306/0x3e8:0xe10*_0x4f2d3f;return _0x4426d3['exp']<_0x231570;}function _0x1f66cd(){const _0x3a928f=_0x4426d3['features'];return!!_0x3a928f&&(!!_0x3a928f['includes']('*')||!!_0x3a928f['includes']('SEE'));}function _0x47e93e(){const _0x24414e=_0x4426d3['licensedHosts'];if(!_0x24414e||0x0==_0x24414e['length'])return!0x0;const {hostname:_0x5e3118}=new URL(window['location']['href']);if(_0x24414e['includes'](_0x5e3118))return!0x0;const _0x4f1c90=_0x5e3118['split']('.');return _0x24414e['filter'](_0x1fdc0c=>_0x1fdc0c['includes']('*'))['map'](_0x5b11af=>_0x5b11af['split']('.'))['filter'](_0x3667a5=>_0x3667a5['length']<=_0x4f1c90['length'])['map'](_0x246ab4=>Array(_0x4f1c90['length']-_0x246ab4['length'])['fill']('*'===_0x246ab4[0x0]?'*':'')['concat'](_0x246ab4))['some'](_0x20684f=>_0x4f1c90['every']((_0x3d74f2,_0x31e66c)=>_0x20684f[_0x31e66c]===_0x3d74f2||'*'===_0x20684f[_0x31e66c]));}function _0x1aa5a4(){return _0x354ba9&&_0x4cc833?new window['Promise']((_0x5526e5,_0x4182ea)=>{_0x354ba9['then'](_0x5526e5,_0x4182ea),_0x4cc833['then'](_0x163027=>{'Valid'!=_0x163027&&_0x5526e5(_0x163027);},_0x4182ea);}):_0x354ba9||_0x4cc833||'Valid';}}function _0x677041(_0x169d71,_0x33e632){return new window['Promise'](_0x322eaa=>{if(_0x5bb8c3())return _0x322eaa('Valid');_0x283485(),_0x114c7b['decorate']('_sendUsageRequest');let _0x2213ba=!0x1;const _0x4f0702=_0x370f84();function _0xfbbeb6(_0x240f3e){return!!_0x240f3e&&('object'==typeof _0x240f3e||'function'==typeof _0x240f3e)&&'function'==typeof _0x240f3e['then']&&'function'==typeof _0x240f3e['catch'];}function _0x4c10b8(_0x38e3d5){_0x3430bf(_0x38e3d5)['then'](_0x2c28d4=>_0x2c28d4&&'ok'==_0x2c28d4['status']?_0x4abe89(_0x22996c(_0x4f0702+_0x33e632))!=_0x2c28d4['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5183d3=>(_0x261f7f(),_0x5183d3),()=>{const _0x1a90f4=_0x5935e6();return null==_0x1a90f4?(_0x261f7f(),'Valid'):_0x462306-_0x1a90f4>0x240c8400?'UsageLimit':'Valid';})['then'](_0x322eaa)['catch'](()=>{_0x322eaa('UsageLimit');});const _0x436104=0x36ee80;function _0x261f7f(){const _0x21cde5='llct-'+_0x4abe89(_0x22996c(_0x169d71)),_0x280f57=_0x598b50(_0x4abe89(window['Math']['ceil'](_0x462306/_0x436104)));window['localStorage']['setItem'](_0x21cde5,_0x280f57);}function _0x5935e6(){const _0x5cfc47='llct-'+_0x4abe89(_0x22996c(_0x169d71)),_0x16773a=window['localStorage']['getItem'](_0x5cfc47);return _0x16773a?window['parseInt'](_0x598b50(_0x16773a),0x10)*_0x436104:null;}function _0x3430bf(_0x51220e){return new window['Promise']((_0x54fe3a,_0x3babd2)=>{_0x51220e['then'](_0x54fe3a,_0x3babd2),window['setTimeout'](_0x3babd2,0x1d4c0);});}}_0x114c7b['on']('_sendUsageRequest',(_0x505a19,_0x2e992b)=>{if(_0x2e992b[0x0]!=_0x169d71)return _0x322eaa('UsageLimit');_0x2e992b[0x1]={..._0x2e992b[0x1],'requestId':_0x4f0702};},{'priority':'high'}),_0x114c7b['on']('_sendUsageRequest',_0x19f309=>{_0xfbbeb6(_0x19f309['return'])&&(_0x2213ba=!0x0,_0x4c10b8(_0x19f309['return']));},{'priority':'low'}),_0x3f0288['then'](()=>{_0x2213ba||_0x322eaa('UsageLimit');});});function _0x5bb8c3(){return'auto'==_0x114c7b['editing']['view']['_overlayModeHint'];}function _0x283485(){_0x114c7b['editing']['view']['_overlayModeHint']='auto';}}function _0xe0ee95(_0x3e653c){const _0x47f774=[new window['Promise'](_0x2ca6ff=>setTimeout(_0x2ca6ff,0x93ecc)),_0x3f0288['then'](()=>new window['Promise'](_0x29c98f=>{let _0x2a6569=0x0;_0x114c7b['model']['on']('applyOperation',(_0x3f9ab7,_0x4d1440)=>{_0x4d1440[0x0]['isDocumentOperation']&&_0x2a6569++,0x5e8==_0x2a6569&&(_0x29c98f(),_0x3f9ab7['off']());});}))];return window['Promise']['race'](_0x47f774)['then'](()=>_0x3e653c);}async function _0x2f2e18(){await _0x3f0288,_0x114c7b['model']['change']=_0x52ae88,_0x114c7b['model']['enqueueChange']=_0x52ae88,_0x114c7b['enableReadOnlyMode']('model');}function _0x1e6274(_0x3d6904){const _0x1b669a=_0x1293cf();_0x114c7b[_0x1b669a]='sourceEditingEnhancedLicenseKey'+_0x3d6904,'Valid'!=_0x3d6904&&_0x2f2e18();}function _0x1293cf(){const _0x3560f5=window['String'](window['performance']['now']())['replace']('.','');let _0x4b1b18='R';for(let _0x2ef85c=0x0;_0x2ef85c<_0x3560f5['length'];_0x2ef85c+=0x2){let _0xaeac42=window['parseInt'](_0x3560f5['substring'](_0x2ef85c,_0x2ef85c+0x2));_0xaeac42>=0x3e&&(_0xaeac42-=0x3e),_0x4b1b18+=_0x3382a6[_0xaeac42];}return _0x4b1b18;}function _0x536b19(){const _0x2a528e=_0x56e144['split']('.');if(0x3!=_0x2a528e['length'])return null;return _0x10660e(_0x2a528e[0x1]);function _0x10660e(_0xb013c5){const _0x48e583=_0x89dcc6(_0xb013c5);return _0x48e583&&_0x342fe8()?_0x48e583:null;function _0x342fe8(){const _0x5a1a17=_0x48e583['jti'],_0x455345=window['parseInt'](_0x5a1a17['substring'](_0x5a1a17['length']-0x8),0x10),_0x1f07b1={..._0x48e583,'jti':_0x5a1a17['substring'](0x0,_0x5a1a17['length']-0x8)};return delete _0x1f07b1['vc'],_0x22996c(_0x1f07b1)==_0x455345;}}}async function _0x589c41(){let _0x1fa2a6=!0x0;try{const [_0x25ce2f,_0x3e0207,_0x4b0ec1]=_0x56e144['split']('.');return _0x15040b(_0x25ce2f),await _0x12985c(_0x25ce2f,_0x3e0207,_0x4b0ec1),_0x1fa2a6;}catch{return!0x1;}function _0x15040b(_0x3b723f){const _0x33e25e=_0x89dcc6(_0x3b723f);_0x33e25e&&'ES256'==_0x33e25e['alg']||(_0x1fa2a6=!0x1);}async function _0x12985c(_0x55c6b1,_0x1123d0,_0x4bbbf9){const _0x34620d=window['Uint8Array']['from'](_0x4b1d06(_0x4bbbf9),_0x1285a2=>_0x1285a2['charCodeAt'](0x0)),_0xaf7ba2=new window['TextEncoder']()['encode'](_0x55c6b1+'.'+_0x1123d0),_0x2cb4d7=window['crypto']['subtle'];if(!_0x2cb4d7)return;const _0x3f9d7b=await _0x2cb4d7['importKey']('jwk',_0x40ff39,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2cb4d7['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3f9d7b,_0x34620d,_0xaf7ba2)||(_0x1fa2a6=!0x1);}}function _0x89dcc6(_0x393be3){return _0x393be3['startsWith']('ey')?JSON['parse'](_0x4b1d06(_0x393be3)):null;}function _0x4b1d06(_0x46bef2){return window['atob'](_0x46bef2['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x22996c(_0x52fe74){let _0x83c891=0x1505;function _0x270adc(_0x789c8c){for(let _0x21dbde=0x0;_0x21dbde<_0x789c8c['length'];_0x21dbde++){const _0xa0cc2d=_0x789c8c['charCodeAt'](_0x21dbde);_0x83c891=(_0x83c891<<0x5)+_0x83c891+_0xa0cc2d,_0x83c891&=_0x83c891;}}function _0x42b7ba(_0xa3ccf){Array['isArray'](_0xa3ccf)?_0xa3ccf['forEach'](_0x42b7ba):_0xa3ccf&&'object'==typeof _0xa3ccf?Object['entries'](_0xa3ccf)['sort']()['forEach'](([_0xe59781,_0x2598ff])=>{_0x270adc(_0xe59781),_0x42b7ba(_0x2598ff);}):_0x270adc(window['String'](_0xa3ccf));}return _0x42b7ba(_0x52fe74),_0x83c891>>>0x0;}function _0x4abe89(_0x4dc7c0){return _0x4dc7c0['toString'](0x10)['padStart'](0x8,'0');}function _0x598b50(_0x19626f){return _0x19626f['split']('')['reverse']()['join']('');}function _0x52ae88(){}_0x1e6274(await _0x1579f4());}_0x944fa3(_0x336216['editor']);}(this);}_createButton(_0x80f6a6,_0x45a193,_0xad57cf=!0x1){const _0x2c6447=new _0x80f6a6(this['editor']['locale']);return _0x2c6447['set']({'withText':_0xad57cf,'isToggleable':!0x1}),_0x2c6447['bind']('isEnabled')['to'](_0x45a193,'isEnabled'),this['listenTo'](_0x2c6447,'execute',()=>_0x45a193['execute']()),_0x2c6447;}_registerKeybindings(){const _0x185ea8=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x185ea8,'Source\x20Editing\x20Enhanced')});const _0x459527=_0x67a4a9['isMac']||_0x67a4a9['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x185ea8,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x185ea8,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x185ea8,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x185ea8,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x185ea8,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x185ea8,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x185ea8,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x459527?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x185ea8,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x185ea8,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x185ea8,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x185ea8,'Select\x20line'),'keystroke':_0x459527?'Ctrl!+L':'Alt+L'},{'label':Q(_0x185ea8,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x459527?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x185ea8,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x185ea8,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x185ea8,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x185ea8,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x185ea8,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x459527?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x210b33{constructor(_0x1067ec){super(_0x1067ec),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x116ed4,_0x59a1e1){const _0x27dc2b=this['editor'],_0x4cc2ac=_0x59a1e1?.['rootName']??B(_0x27dc2b);_0x27dc2b['data']['set']({[_0x4cc2ac]:_0x116ed4},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x271ac9{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x4cc58d){super(_0x4cc58d),_0x4cc58d['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey'),this['_licenseKeyCheckInterval']=setInterval(()=>{const _0x2d9333=[this['editor']];for(const _0x2d6771 of _0x2d9333){let _0x320f33;for(const _0x3d2f1b in _0x2d6771){const _0x269c87=_0x3d2f1b,_0x3455e8=_0x2d6771[_0x269c87];if('sourceEditingEnhancedLicenseKeyValid'==_0x3455e8||'sourceEditingEnhancedLicenseKeyInvalid'==_0x3455e8||'sourceEditingEnhancedLicenseKeyExpired'==_0x3455e8||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3455e8||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3455e8||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3455e8||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3455e8){delete _0x2d6771[_0x269c87],_0x320f33=_0x3455e8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x320f33&&_0x2d6771['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x320f33&&_0x2d6771['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x320f33&&_0x2d6771['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x320f33&&_0x2d6771['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x320f33&&_0x2d6771['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x320f33&&_0x2d6771['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x236fd9=this['editor'],_0x431e36=_0x236fd9['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x431e36&&_0x236fd9['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x11d1a3('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x431e36&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x541b96=>_0x236fd9['plugins']['has'](_0x541b96))&&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.'),_0x236fd9['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": "49.0.0-alpha.4",
3
+ "version": "49.0.0-alpha.5",
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/)",
@@ -26,11 +26,11 @@
26
26
  "dist/translations/*.umd.js"
27
27
  ],
28
28
  "dependencies": {
29
- "@ckeditor/ckeditor5-core": "49.0.0-alpha.4",
30
- "@ckeditor/ckeditor5-engine": "49.0.0-alpha.4",
31
- "@ckeditor/ckeditor5-icons": "49.0.0-alpha.4",
32
- "@ckeditor/ckeditor5-ui": "49.0.0-alpha.4",
33
- "@ckeditor/ckeditor5-utils": "49.0.0-alpha.4",
29
+ "@ckeditor/ckeditor5-core": "49.0.0-alpha.5",
30
+ "@ckeditor/ckeditor5-engine": "49.0.0-alpha.5",
31
+ "@ckeditor/ckeditor5-icons": "49.0.0-alpha.5",
32
+ "@ckeditor/ckeditor5-ui": "49.0.0-alpha.5",
33
+ "@ckeditor/ckeditor5-utils": "49.0.0-alpha.5",
34
34
  "@codemirror/autocomplete": "^6.7.1",
35
35
  "@codemirror/commands": "6.8.1",
36
36
  "@codemirror/lang-html": "^6.0.0",