@ckeditor/ckeditor5-source-editing-enhanced 48.4.0-alpha.3 → 48.4.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 _0xb1fe12,PendingActions as _0x2f5b19,Plugin as _0x4ff81f}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x43b165,env as _0x1d934e,formatHtml as _0x481975,uid as _0xa81394}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x8edc89}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x4b4621,MenuBarMenuListItemButtonView as _0x314047,View as _0x1b2132}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x45dfbc,crosshairCursor as _0x2824e4,drawSelection as _0x51d865,dropCursor as _0x3f57ce,highlightActiveLine as _0x1468d5,highlightActiveLineGutter as _0x1e6358,highlightSpecialChars as _0x54c4fe,keymap as _0xfa00ae,lineNumbers as _0xec3a5e,rectangularSelection as _0x159c68}from'@codemirror/view';import{Compartment as _0xad5413,Transaction as _0x4e28ac}from'@codemirror/state';import{bracketMatching as _0x53e5df,defaultHighlightStyle as _0x1902b5,foldGutter as _0x59ebbf,foldKeymap as _0x13df9d,indentOnInput as _0x4172ca,syntaxHighlighting as _0x48ae4e}from'@codemirror/language';import{defaultKeymap as _0x3c6cf9,history as _0x1d670f,historyKeymap as _0x39cf8b,indentLess as _0x5a89e1,indentMore as _0x22a400,redo as _0x2f083e,toggleTabFocusMode as _0x2c5b73,undo as _0x2b1de4}from'@codemirror/commands';import{autocompletion as _0x2719a1,closeBrackets as _0x191c20,closeBracketsKeymap as _0x52f656,completionKeymap as _0x455e36}from'@codemirror/autocomplete';import{html as _0x42ae81}from'@codemirror/lang-html';import{markdown as _0x438217}from'@codemirror/lang-markdown';import{oneDark as _0x443069}from'@codemirror/theme-one-dark';function Q(_0x41f9b9,_0x5a5385){const t=_0x41f9b9['t'];switch(_0x5a5385){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 _0x5a5385;}}function B(_0x48553b){const _0x53a9a9=_0x48553b['editing']['view']['document']['roots'],_0x466374=_0x53a9a9['length'];if(0x0===_0x466374)throw new _0x43b165('source-editing-enhanced-editor-no-root',_0x48553b);return 0x1===_0x466374?_0x53a9a9['first']['rootName']:Array['from'](_0x48553b['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x4613b4){return J(_0x4613b4['replace'](/^[\n\s]*/g,''))?_0x4613b4['replace'](/\s+/g,''):_0x4613b4;}function J(_0x5cd096){return _0x5cd096['startsWith']('<');}function X(_0x2bbd33){const _0x34ee08=[_0x45dfbc['lineWrapping'],_0x2719a1(),_0x53e5df(),_0x191c20(),_0x2824e4(),_0x51d865(),_0x3f57ce(),_0xec3a5e(),_0x59ebbf(),_0x1468d5(),_0x1e6358(),_0x54c4fe(),_0x1d670f(),_0x4172ca(),_0x159c68(),_0x48ae4e(_0x1902b5,{'fallback':!0x0})],_0x4718e9=new _0xad5413();_0x34ee08['push'](_0x4718e9['of'](_0x45dfbc['editable']['of'](!0x0))),'html'===_0x2bbd33['syntaxLanguage']?_0x34ee08['push'](_0x42ae81()):_0x34ee08['push'](_0x438217());const _0xc9182c=(_0x47e282=_0x2bbd33['theme'])&&'default'!==_0x47e282?'dark'===_0x47e282?_0x443069:_0x47e282:null;var _0x47e282;_0xc9182c&&_0x34ee08['push'](_0xc9182c),_0x34ee08['push'](_0xfa00ae['of']([..._0x52f656,..._0x3c6cf9,..._0x39cf8b,..._0x13df9d,..._0x455e36,{'key':'Tab','run':_0x22a400,'shift':_0x5a89e1,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x2f083e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x2f083e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x2b1de4,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0xc6c92a=new _0x45dfbc({'extensions':_0x34ee08,'parent':_0x2bbd33['parent']});return _0x2c5b73(_0xc6c92a),{'focus':()=>{_0xc6c92a['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0xc6c92a['focus']();},'getData':()=>_0xc6c92a['state']['doc']['toString'](),'setData':_0x4c70e0=>{_0xc6c92a['dispatch']({'changes':{'from':0x0,'to':_0xc6c92a['state']['doc']['length'],'insert':_0x4c70e0},'annotations':_0x4e28ac['addToHistory']['of'](!0x1)});},'setReadOnly':_0x86055f=>{_0xc6c92a['dispatch']({'effects':[_0x4718e9['reconfigure'](_0x45dfbc['editable']['of'](!_0x86055f))]});},'destroy':()=>{_0xc6c92a['destroy']();},'instance':_0xc6c92a};}var Z=class extends _0x1b2132{_codeEditorApi=null;_options;constructor(_0x30bbd5,_0x473d15){super(_0x30bbd5),this['_options']=_0x473d15,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',(_0x26ea05,_0x4220dc,_0x7d7681)=>{this['setReadOnly'](_0x7d7681);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x31a447){this['_codeEditorApi']['setData'](_0x31a447);}setReadOnly(_0x918025){this['_codeEditorApi']['setReadOnly'](_0x918025);}};const G='SourceEditingEnhancedMode';var W=class extends _0xb1fe12{constructor(_0x41bfc3){super(_0x41bfc3),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x2f5b19)['on']('change:hasAny',(_0x511802,_0xf19aa1,_0x2ec002)=>{_0x2ec002?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x42e688=this['editor'];for(const _0x3c5d76 of _0x42e688['commands']['names']())['replaceSource','editSource']['includes'](_0x3c5d76)||_0x42e688['commands']['get'](_0x3c5d76)['forceDisabled'](G);}['_enableCommands'](){const _0x25c37f=this['editor'];for(const _0x103eff of _0x25c37f['commands']['commands']())_0x103eff['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x9f5206=this['editor'],_0x3818c2=_0x9f5206['locale'],_0x5827e2=_0x9f5206['plugins']['get']('Dialog'),_0x1b4804=B(_0x9f5206),_0xad34d1=J(_0x128d1b=_0x9f5206['data']['get']({'rootName':_0x1b4804}))?_0x481975(_0x128d1b):_0x128d1b;var _0x128d1b;const _0x226299=new Z(_0x3818c2,{'syntaxLanguage':_0x9f5206['plugins']['has']('Markdown')?'markdown':'html','theme':_0x9f5206['config']['get']('sourceEditingEnhanced.theme')});let _0x1a6249=!0x0;const _0x36a632=_0x351d73=>{if(_0x1a6249&&Y(_0x226299['getData']())!==Y(_0xad34d1))return window['confirm'](Q(_0x3818c2,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x351d73['stop']();};_0x5827e2['show']({'id':'sourceEditingEnhanced','title':Q(_0x3818c2,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x226299,'actionButtons':[{'label':Q(_0x3818c2,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x5827e2['hide']();}},{'label':Q(_0x3818c2,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x343444=Y(_0x226299['getData']())!==Y(_0xad34d1);_0x343444&&_0x9f5206['execute']('replaceSource',_0x226299['getData']()),_0x1a6249=!0x1,_0x5827e2['hide'](),_0x343444&&'editables'in _0x9f5206['ui']['view']&&_0x9f5206['ui']['view']['editables'][_0x1b4804]['element']['focus']();},'onCreate':_0x332165=>{_0x332165['set']('isEnabled',!_0x9f5206['isReadOnly']),_0x332165['bind']('isEnabled')['to'](_0x9f5206,'isReadOnly',this,'isEnabled',(_0xf2466b,_0x494024)=>!_0xf2466b&&_0x494024);}}],'onHide':()=>{this['_enableCommands'](),_0x5827e2['off']('hide',_0x36a632),_0x226299['destroy']();},'onShow':()=>{_0x226299['bind']('isReadOnly')['to'](_0x9f5206,'isReadOnly',this,'isEnabled',(_0x148e9f,_0x32d978)=>_0x148e9f||!_0x32d978),_0x226299['setData'](_0xad34d1),_0x226299['focus'](),_0x5827e2['on']('hide',_0x36a632,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x4ff81f{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x2f5b19];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x500abd=this['editor'],_0xdc272d=_0x500abd['locale'],_0x3cb311=new W(_0x500abd);_0x500abd['commands']['add']('editSource',_0x3cb311),_0x500abd['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x4e36a7=this['_createButton'](_0x4b4621,_0x3cb311);return _0x4e36a7['set']({'label':Q(_0xdc272d,'Source'),'icon':_0x8edc89,'tooltip':Q(_0xdc272d,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x4e36a7;}),_0x500abd['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x26ea76=this['_createButton'](_0x314047,_0x3cb311,!0x0);return _0x26ea76['set']({'label':Q(_0xdc272d,'Edit\x20source\x20modal\x20label'),'icon':_0x8edc89,'role':'menuitemcheckbox'}),_0x26ea76;}),this['_registerKeybindings']();}afterInit(){!async function(_0x5bf53c){const _0x3eb9c1='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x6ebb07=0x79170,_0x7a522b=window['Date']['now'](),_0xb15747=_0x5bf53c['editor'],_0x3b2a29=new window['Promise'](_0x23921a=>{_0xb15747['once']('ready',_0x23921a);}),_0x5318a9={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x3c6ef1=_0xb15747['config']['get']('licenseKey');async function _0x406140(){let _0x3e6092,_0x53d34c=null,_0x8d9b8a=null;try{return'GPL'==_0x3c6ef1?'NotAllowed':(_0x3e6092=_0x14363c(),_0x3e6092?(_0x3e6092['usageEndpoint']&&(_0x8d9b8a=_0x2c87f3(_0x3e6092['usageEndpoint'],_0x3e6092['jti'])),await _0x1e0f98()?_0x5ed67c()?_0x2a46e1()?'Expired':_0x2489ec()?('evaluation'==_0x3e6092['licenseType']&&(_0x53d34c=_0xe14bf8('EvaluationLimit')),await _0x3bc926()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2a46e1(){const _0x5b164b=['evaluation','trial']['includes'](_0x3e6092['licenseType'])?_0x7a522b/0x3e8:0xe10*_0x6ebb07;return _0x3e6092['exp']<_0x5b164b;}function _0x5ed67c(){const _0x278769=_0x3e6092['features'];return!!_0x278769&&(!!_0x278769['includes']('*')||!!_0x278769['includes']('SEE'));}function _0x2489ec(){const _0x3b7cb4=_0x3e6092['licensedHosts'];if(!_0x3b7cb4||0x0==_0x3b7cb4['length'])return!0x0;const {hostname:_0x368c50}=new URL(window['location']['href']);if(_0x3b7cb4['includes'](_0x368c50))return!0x0;const _0x24e373=_0x368c50['split']('.');return _0x3b7cb4['filter'](_0x54b4df=>_0x54b4df['includes']('*'))['map'](_0x3a95db=>_0x3a95db['split']('.'))['filter'](_0x3edede=>_0x3edede['length']<=_0x24e373['length'])['map'](_0x99cadc=>Array(_0x24e373['length']-_0x99cadc['length'])['fill']('*'===_0x99cadc[0x0]?'*':'')['concat'](_0x99cadc))['some'](_0x35c551=>_0x24e373['every']((_0x3129fb,_0x1eefff)=>_0x35c551[_0x1eefff]===_0x3129fb||'*'===_0x35c551[_0x1eefff]));}function _0x3bc926(){return _0x53d34c&&_0x8d9b8a?new window['Promise']((_0x4d3732,_0x223853)=>{_0x53d34c['then'](_0x4d3732,_0x223853),_0x8d9b8a['then'](_0x8320fb=>{'Valid'!=_0x8320fb&&_0x4d3732(_0x8320fb);},_0x223853);}):_0x53d34c||_0x8d9b8a||'Valid';}}function _0x2c87f3(_0x1e7938,_0x47abe8){return new window['Promise'](_0x1b9ae7=>{if(_0x253d10())return _0x1b9ae7('Valid');_0x73e882(),_0xb15747['decorate']('_sendUsageRequest');let _0x3b661a=!0x1;const _0x34a9e3=_0xa81394();function _0x59cd56(_0x3eb02c){return!!_0x3eb02c&&('object'==typeof _0x3eb02c||'function'==typeof _0x3eb02c)&&'function'==typeof _0x3eb02c['then']&&'function'==typeof _0x3eb02c['catch'];}function _0x1cb33c(_0x58b912){_0x4e9fb5(_0x58b912)['then'](_0x4c5a0a=>_0x4c5a0a&&'ok'==_0x4c5a0a['status']?_0x4c3020(_0x477932(_0x34a9e3+_0x47abe8))!=_0x4c5a0a['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5b5ab4=>(_0x1ac42b(),_0x5b5ab4),()=>{const _0x1122da=_0x1d0f09();return null==_0x1122da?(_0x1ac42b(),'Valid'):_0x7a522b-_0x1122da>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1b9ae7)['catch'](()=>{_0x1b9ae7('UsageLimit');});const _0x1fde71=0x36ee80;function _0x1ac42b(){const _0x240133='llct-'+_0x4c3020(_0x477932(_0x1e7938)),_0x547e04=_0x2d7a37(_0x4c3020(window['Math']['ceil'](_0x7a522b/_0x1fde71)));window['localStorage']['setItem'](_0x240133,_0x547e04);}function _0x1d0f09(){const _0x53d7cb='llct-'+_0x4c3020(_0x477932(_0x1e7938)),_0x430a22=window['localStorage']['getItem'](_0x53d7cb);return _0x430a22?window['parseInt'](_0x2d7a37(_0x430a22),0x10)*_0x1fde71:null;}function _0x4e9fb5(_0xd74084){return new window['Promise']((_0x4a1ef9,_0x57fc2a)=>{_0xd74084['then'](_0x4a1ef9,_0x57fc2a),window['setTimeout'](_0x57fc2a,0x1d4c0);});}}_0xb15747['on']('_sendUsageRequest',(_0x3e8538,_0x3e26b7)=>{if(_0x3e26b7[0x0]!=_0x1e7938)return _0x1b9ae7('UsageLimit');_0x3e26b7[0x1]={..._0x3e26b7[0x1],'requestId':_0x34a9e3};},{'priority':'high'}),_0xb15747['on']('_sendUsageRequest',_0xa9a91e=>{_0x59cd56(_0xa9a91e['return'])&&(_0x3b661a=!0x0,_0x1cb33c(_0xa9a91e['return']));},{'priority':'low'}),_0x3b2a29['then'](()=>{_0x3b661a||_0x1b9ae7('UsageLimit');});});function _0x253d10(){return'auto'==_0xb15747['editing']['view']['_overlayModeHint'];}function _0x73e882(){_0xb15747['editing']['view']['_overlayModeHint']='auto';}}function _0xe14bf8(_0x16e1fa){const _0x114177=[new window['Promise'](_0x1b5f0d=>setTimeout(_0x1b5f0d,0x93ecc)),_0x3b2a29['then'](()=>new window['Promise'](_0x4d7d9a=>{let _0x4a8ba2=0x0;_0xb15747['model']['on']('applyOperation',(_0x2fe776,_0x4c4f41)=>{_0x4c4f41[0x0]['isDocumentOperation']&&_0x4a8ba2++,0x5e8==_0x4a8ba2&&(_0x4d7d9a(),_0x2fe776['off']());});}))];return window['Promise']['race'](_0x114177)['then'](()=>_0x16e1fa);}async function _0x52c695(){await _0x3b2a29,_0xb15747['model']['change']=_0x110d89,_0xb15747['model']['enqueueChange']=_0x110d89,_0xb15747['enableReadOnlyMode']('model');}function _0x5baa3b(_0x56a935){const _0x2e820a=_0x1550a0();_0xb15747[_0x2e820a]='sourceEditingEnhancedLicenseKey'+_0x56a935,'Valid'!=_0x56a935&&_0x52c695();}function _0x1550a0(){const _0x371c8f=window['String'](window['performance']['now']())['replace']('.','');let _0x1d876b='N';for(let _0x1ec819=0x0;_0x1ec819<_0x371c8f['length'];_0x1ec819+=0x2){let _0x3473f4=window['parseInt'](_0x371c8f['substring'](_0x1ec819,_0x1ec819+0x2));_0x3473f4>=0x3e&&(_0x3473f4-=0x3e),_0x1d876b+=_0x3eb9c1[_0x3473f4];}return _0x1d876b;}function _0x14363c(){const _0x2993fc=_0x3c6ef1['split']('.');if(0x3!=_0x2993fc['length'])return null;return _0x20c815(_0x2993fc[0x1]);function _0x20c815(_0x17902b){const _0x4da314=_0x1d9456(_0x17902b);return _0x4da314&&_0x14e339()?_0x4da314:null;function _0x14e339(){const _0x12c736=_0x4da314['jti'],_0x38de6b=window['parseInt'](_0x12c736['substring'](_0x12c736['length']-0x8),0x10),_0x537918={..._0x4da314,'jti':_0x12c736['substring'](0x0,_0x12c736['length']-0x8)};return delete _0x537918['vc'],_0x477932(_0x537918)==_0x38de6b;}}}async function _0x1e0f98(){let _0x37028e=!0x0;try{const [_0x16f1f2,_0x2cffd2,_0xf680e5]=_0x3c6ef1['split']('.');return _0x377cbf(_0x16f1f2),await _0x3bc11b(_0x16f1f2,_0x2cffd2,_0xf680e5),_0x37028e;}catch{return!0x1;}function _0x377cbf(_0x197351){const _0x2cf3f3=_0x1d9456(_0x197351);_0x2cf3f3&&'ES256'==_0x2cf3f3['alg']||(_0x37028e=!0x1);}async function _0x3bc11b(_0x8e6d30,_0x58d9ab,_0xef56d){const _0x35221f=window['Uint8Array']['from'](_0x14b8ee(_0xef56d),_0x5896c5=>_0x5896c5['charCodeAt'](0x0)),_0x5e93a5=new window['TextEncoder']()['encode'](_0x8e6d30+'.'+_0x58d9ab),_0x48121f=window['crypto']['subtle'];if(!_0x48121f)return;const _0x373dba=await _0x48121f['importKey']('jwk',_0x5318a9,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x48121f['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x373dba,_0x35221f,_0x5e93a5)||(_0x37028e=!0x1);}}function _0x1d9456(_0x469345){return _0x469345['startsWith']('ey')?JSON['parse'](_0x14b8ee(_0x469345)):null;}function _0x14b8ee(_0xfa1ca3){return window['atob'](_0xfa1ca3['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x477932(_0x53497d){let _0x18bac4=0x1505;function _0x142789(_0x2f882a){for(let _0x1227cd=0x0;_0x1227cd<_0x2f882a['length'];_0x1227cd++){const _0xda4292=_0x2f882a['charCodeAt'](_0x1227cd);_0x18bac4=(_0x18bac4<<0x5)+_0x18bac4+_0xda4292,_0x18bac4&=_0x18bac4;}}function _0x411876(_0x3fb5d8){Array['isArray'](_0x3fb5d8)?_0x3fb5d8['forEach'](_0x411876):_0x3fb5d8&&'object'==typeof _0x3fb5d8?Object['entries'](_0x3fb5d8)['sort']()['forEach'](([_0x50a3f0,_0x2f83c2])=>{_0x142789(_0x50a3f0),_0x411876(_0x2f83c2);}):_0x142789(window['String'](_0x3fb5d8));}return _0x411876(_0x53497d),_0x18bac4>>>0x0;}function _0x4c3020(_0x3a11eb){return _0x3a11eb['toString'](0x10)['padStart'](0x8,'0');}function _0x2d7a37(_0x34686e){return _0x34686e['split']('')['reverse']()['join']('');}function _0x110d89(){}_0x5baa3b(await _0x406140());}(this);}_createButton(_0x473e67,_0x534275,_0x347cda=!0x1){const _0x4ef536=new _0x473e67(this['editor']['locale']);return _0x4ef536['set']({'withText':_0x347cda,'isToggleable':!0x1}),_0x4ef536['bind']('isEnabled')['to'](_0x534275,'isEnabled'),this['listenTo'](_0x4ef536,'execute',()=>_0x534275['execute']()),_0x4ef536;}_registerKeybindings(){const _0x352805=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x352805,'Source\x20Editing\x20Enhanced')});const _0x9d6d02=_0x1d934e['isMac']||_0x1d934e['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x352805,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x352805,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x352805,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x352805,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x352805,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x352805,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x352805,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x9d6d02?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x352805,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x352805,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x352805,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x352805,'Select\x20line'),'keystroke':_0x9d6d02?'Ctrl!+L':'Alt+L'},{'label':Q(_0x352805,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x9d6d02?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x352805,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x352805,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x352805,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x352805,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x352805,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x9d6d02?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0xb1fe12{constructor(_0x1d833a){super(_0x1d833a),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x5af911,_0x3b3387){const _0x43a6f3=this['editor'],_0x41fc7a=_0x3b3387?.['rootName']??B(_0x43a6f3);_0x43a6f3['data']['set']({[_0x41fc7a]:_0x5af911},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x4ff81f{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x169a74){super(_0x169a74),_0x169a74['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 _0x293abb=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x299a89;for(const _0x2a6b34 in _0x293abb){const _0x50b7f9=_0x2a6b34,_0x375f64=_0x293abb[_0x50b7f9];if('sourceEditingEnhancedLicenseKeyValid'==_0x375f64||'sourceEditingEnhancedLicenseKeyInvalid'==_0x375f64||'sourceEditingEnhancedLicenseKeyExpired'==_0x375f64||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x375f64||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x375f64||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x375f64||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x375f64){delete _0x293abb[_0x50b7f9],_0x299a89=_0x375f64,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x299a89&&_0x293abb['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x299a89&&_0x293abb['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x299a89&&_0x293abb['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x299a89&&_0x293abb['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x299a89&&_0x293abb['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x299a89&&_0x293abb['_showLicenseError']('usageLimit');},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x1657e7=this['editor'],_0x34b525=_0x1657e7['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x34b525&&_0x1657e7['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x43b165('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x34b525&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x317291=>_0x1657e7['plugins']['has'](_0x317291))&&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.'),_0x1657e7['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 _0x197602,PendingActions as _0x5f081f,Plugin as _0x392ff7}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x4e572f,env as _0x27e0ea,formatHtml as _0x218bd9,uid as _0x5214b4}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x42be3a}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x24104b,MenuBarMenuListItemButtonView as _0x4cf236,View as _0x384686}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x5c4fb5,crosshairCursor as _0x235eaf,drawSelection as _0x4b9877,dropCursor as _0x42af7c,highlightActiveLine as _0x1bc76d,highlightActiveLineGutter as _0x286e44,highlightSpecialChars as _0x17557d,keymap as _0x1de7f3,lineNumbers as _0x148e1f,rectangularSelection as _0x28c587}from'@codemirror/view';import{Compartment as _0x38c97f,Transaction as _0x28e39d}from'@codemirror/state';import{bracketMatching as _0x35bc5e,defaultHighlightStyle as _0x171420,foldGutter as _0x385fbb,foldKeymap as _0x2ef4a4,indentOnInput as _0x54cb17,syntaxHighlighting as _0x4f810d}from'@codemirror/language';import{defaultKeymap as _0x2658ec,history as _0x16d876,historyKeymap as _0x10ca1f,indentLess as _0x6af145,indentMore as _0x58ed55,redo as _0x5f077d,toggleTabFocusMode as _0x18a2f9,undo as _0xbea1e2}from'@codemirror/commands';import{autocompletion as _0x22c2ac,closeBrackets as _0x54b491,closeBracketsKeymap as _0x2d17f4,completionKeymap as _0x42c4dc}from'@codemirror/autocomplete';import{html as _0x3138a9}from'@codemirror/lang-html';import{markdown as _0x1b2f0c}from'@codemirror/lang-markdown';import{oneDark as _0x473fe4}from'@codemirror/theme-one-dark';function Q(_0x14d662,_0x24d15d){const t=_0x14d662['t'];switch(_0x24d15d){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 _0x24d15d;}}function B(_0x3cbcda){const _0x1a53f2=_0x3cbcda['editing']['view']['document']['roots'],_0xb05345=_0x1a53f2['length'];if(0x0===_0xb05345)throw new _0x4e572f('source-editing-enhanced-editor-no-root',_0x3cbcda);return 0x1===_0xb05345?_0x1a53f2['first']['rootName']:Array['from'](_0x3cbcda['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x180e52){return J(_0x180e52['replace'](/^[\n\s]*/g,''))?_0x180e52['replace'](/\s+/g,''):_0x180e52;}function J(_0x711714){return _0x711714['startsWith']('<');}function X(_0x3d6882){const _0xb1772e=[_0x5c4fb5['lineWrapping'],_0x22c2ac(),_0x35bc5e(),_0x54b491(),_0x235eaf(),_0x4b9877(),_0x42af7c(),_0x148e1f(),_0x385fbb(),_0x1bc76d(),_0x286e44(),_0x17557d(),_0x16d876(),_0x54cb17(),_0x28c587(),_0x4f810d(_0x171420,{'fallback':!0x0})],_0x39c388=new _0x38c97f();_0xb1772e['push'](_0x39c388['of'](_0x5c4fb5['editable']['of'](!0x0))),'html'===_0x3d6882['syntaxLanguage']?_0xb1772e['push'](_0x3138a9()):_0xb1772e['push'](_0x1b2f0c());const _0x17e0bf=(_0x598923=_0x3d6882['theme'])&&'default'!==_0x598923?'dark'===_0x598923?_0x473fe4:_0x598923:null;var _0x598923;_0x17e0bf&&_0xb1772e['push'](_0x17e0bf),_0xb1772e['push'](_0x1de7f3['of']([..._0x2d17f4,..._0x2658ec,..._0x10ca1f,..._0x2ef4a4,..._0x42c4dc,{'key':'Tab','run':_0x58ed55,'shift':_0x6af145,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x5f077d,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x5f077d,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0xbea1e2,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x406bf5=new _0x5c4fb5({'extensions':_0xb1772e,'parent':_0x3d6882['parent']});return _0x18a2f9(_0x406bf5),{'focus':()=>{_0x406bf5['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x406bf5['focus']();},'getData':()=>_0x406bf5['state']['doc']['toString'](),'setData':_0x3ed8d1=>{_0x406bf5['dispatch']({'changes':{'from':0x0,'to':_0x406bf5['state']['doc']['length'],'insert':_0x3ed8d1},'annotations':_0x28e39d['addToHistory']['of'](!0x1)});},'setReadOnly':_0x54e529=>{_0x406bf5['dispatch']({'effects':[_0x39c388['reconfigure'](_0x5c4fb5['editable']['of'](!_0x54e529))]});},'destroy':()=>{_0x406bf5['destroy']();},'instance':_0x406bf5};}var Z=class extends _0x384686{_codeEditorApi=null;_options;constructor(_0x4aaf62,_0x18954e){super(_0x4aaf62),this['_options']=_0x18954e,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',(_0x3c45cf,_0x721917,_0x19ff24)=>{this['setReadOnly'](_0x19ff24);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x28a0ca){this['_codeEditorApi']['setData'](_0x28a0ca);}setReadOnly(_0x4c57d2){this['_codeEditorApi']['setReadOnly'](_0x4c57d2);}};const G='SourceEditingEnhancedMode';var W=class extends _0x197602{constructor(_0x4685ea){super(_0x4685ea),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x5f081f)['on']('change:hasAny',(_0x332308,_0x1f3f04,_0x1b92b3)=>{_0x1b92b3?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x46c09c=this['editor'];for(const _0x2612db of _0x46c09c['commands']['names']())['replaceSource','editSource']['includes'](_0x2612db)||_0x46c09c['commands']['get'](_0x2612db)['forceDisabled'](G);}['_enableCommands'](){const _0x1a4e62=this['editor'];for(const _0x344159 of _0x1a4e62['commands']['commands']())_0x344159['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x291e01=this['editor'],_0x3d6d7c=_0x291e01['locale'],_0x3a5b89=_0x291e01['plugins']['get']('Dialog'),_0x1ac684=B(_0x291e01),_0x90ddc2=J(_0x489975=_0x291e01['data']['get']({'rootName':_0x1ac684}))?_0x218bd9(_0x489975):_0x489975;var _0x489975;const _0x3f2596=new Z(_0x3d6d7c,{'syntaxLanguage':_0x291e01['plugins']['has']('Markdown')?'markdown':'html','theme':_0x291e01['config']['get']('sourceEditingEnhanced.theme')});let _0x505244=!0x0;const _0x4d4664=_0x1abcd9=>{if(_0x505244&&Y(_0x3f2596['getData']())!==Y(_0x90ddc2))return window['confirm'](Q(_0x3d6d7c,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x1abcd9['stop']();};_0x3a5b89['show']({'id':'sourceEditingEnhanced','title':Q(_0x3d6d7c,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x3f2596,'actionButtons':[{'label':Q(_0x3d6d7c,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x3a5b89['hide']();}},{'label':Q(_0x3d6d7c,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x2975df=Y(_0x3f2596['getData']())!==Y(_0x90ddc2);_0x2975df&&_0x291e01['execute']('replaceSource',_0x3f2596['getData']()),_0x505244=!0x1,_0x3a5b89['hide'](),_0x2975df&&'editables'in _0x291e01['ui']['view']&&_0x291e01['ui']['view']['editables'][_0x1ac684]['element']['focus']();},'onCreate':_0x13eac6=>{_0x13eac6['set']('isEnabled',!_0x291e01['isReadOnly']),_0x13eac6['bind']('isEnabled')['to'](_0x291e01,'isReadOnly',this,'isEnabled',(_0x3c215e,_0x32eccb)=>!_0x3c215e&&_0x32eccb);}}],'onHide':()=>{this['_enableCommands'](),_0x3a5b89['off']('hide',_0x4d4664),_0x3f2596['destroy']();},'onShow':()=>{_0x3f2596['bind']('isReadOnly')['to'](_0x291e01,'isReadOnly',this,'isEnabled',(_0x5589c0,_0x3c0975)=>_0x5589c0||!_0x3c0975),_0x3f2596['setData'](_0x90ddc2),_0x3f2596['focus'](),_0x3a5b89['on']('hide',_0x4d4664,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x392ff7{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x5f081f];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x193890=this['editor'],_0x55278a=_0x193890['locale'],_0x23de0c=new W(_0x193890);_0x193890['commands']['add']('editSource',_0x23de0c),_0x193890['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x2fcb77=this['_createButton'](_0x24104b,_0x23de0c);return _0x2fcb77['set']({'label':Q(_0x55278a,'Source'),'icon':_0x42be3a,'tooltip':Q(_0x55278a,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x2fcb77;}),_0x193890['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x4115d9=this['_createButton'](_0x4cf236,_0x23de0c,!0x0);return _0x4115d9['set']({'label':Q(_0x55278a,'Edit\x20source\x20modal\x20label'),'icon':_0x42be3a,'role':'menuitemcheckbox'}),_0x4115d9;}),this['_registerKeybindings']();}afterInit(){!async function(_0x113c22){const _0x59fad9='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0xd16335=0x791a0,_0x39aa68=window['Date']['now'](),_0x438fd4=_0x113c22['editor'],_0x2dda4f=new window['Promise'](_0xdbed36=>{_0x438fd4['once']('ready',_0xdbed36);}),_0x3f2881={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x17cbdf=_0x438fd4['config']['get']('licenseKey');async function _0x10c24d(){let _0x37d53a,_0x15fc24=null,_0x1ec5de=null;try{return'GPL'==_0x17cbdf?'NotAllowed':(_0x37d53a=_0x4e0b28(),_0x37d53a?(_0x37d53a['usageEndpoint']&&(_0x1ec5de=_0xf02dac(_0x37d53a['usageEndpoint'],_0x37d53a['jti'])),await _0x1f0a8b()?_0x520885()?_0x7064a1()?'Expired':_0x248bee()?('evaluation'==_0x37d53a['licenseType']&&(_0x15fc24=_0x30c41e('EvaluationLimit')),await _0x4476ac()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x7064a1(){const _0x52a0d1=['evaluation','trial']['includes'](_0x37d53a['licenseType'])?_0x39aa68/0x3e8:0xe10*_0xd16335;return _0x37d53a['exp']<_0x52a0d1;}function _0x520885(){const _0x14a976=_0x37d53a['features'];return!!_0x14a976&&(!!_0x14a976['includes']('*')||!!_0x14a976['includes']('SEE'));}function _0x248bee(){const _0x1c8d89=_0x37d53a['licensedHosts'];if(!_0x1c8d89||0x0==_0x1c8d89['length'])return!0x0;const {hostname:_0x766f35}=new URL(window['location']['href']);if(_0x1c8d89['includes'](_0x766f35))return!0x0;const _0x2375ff=_0x766f35['split']('.');return _0x1c8d89['filter'](_0x7953b7=>_0x7953b7['includes']('*'))['map'](_0x1fa833=>_0x1fa833['split']('.'))['filter'](_0x1cb817=>_0x1cb817['length']<=_0x2375ff['length'])['map'](_0x2d6e20=>Array(_0x2375ff['length']-_0x2d6e20['length'])['fill']('*'===_0x2d6e20[0x0]?'*':'')['concat'](_0x2d6e20))['some'](_0x5bac15=>_0x2375ff['every']((_0xa972d3,_0x21ea38)=>_0x5bac15[_0x21ea38]===_0xa972d3||'*'===_0x5bac15[_0x21ea38]));}function _0x4476ac(){return _0x15fc24&&_0x1ec5de?new window['Promise']((_0x493415,_0x4433c3)=>{_0x15fc24['then'](_0x493415,_0x4433c3),_0x1ec5de['then'](_0x44b0ba=>{'Valid'!=_0x44b0ba&&_0x493415(_0x44b0ba);},_0x4433c3);}):_0x15fc24||_0x1ec5de||'Valid';}}function _0xf02dac(_0x5a550b,_0x51d466){return new window['Promise'](_0x3f9f65=>{if(_0x10a0e5())return _0x3f9f65('Valid');_0x2b39ff(),_0x438fd4['decorate']('_sendUsageRequest');let _0x4db7ea=!0x1;const _0x41f56e=_0x5214b4();function _0x20fc14(_0x4e399c){return!!_0x4e399c&&('object'==typeof _0x4e399c||'function'==typeof _0x4e399c)&&'function'==typeof _0x4e399c['then']&&'function'==typeof _0x4e399c['catch'];}function _0x2938c1(_0x554ab1){_0x50beb0(_0x554ab1)['then'](_0xfea411=>_0xfea411&&'ok'==_0xfea411['status']?_0xe7bb2a(_0x3bccd6(_0x41f56e+_0x51d466))!=_0xfea411['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x1d2745=>(_0x4354fe(),_0x1d2745),()=>{const _0x2c7067=_0xde4ea1();return null==_0x2c7067?(_0x4354fe(),'Valid'):_0x39aa68-_0x2c7067>0x240c8400?'UsageLimit':'Valid';})['then'](_0x3f9f65)['catch'](()=>{_0x3f9f65('UsageLimit');});const _0x484420=0x36ee80;function _0x4354fe(){const _0x435068='llct-'+_0xe7bb2a(_0x3bccd6(_0x5a550b)),_0x57d17e=_0x14110d(_0xe7bb2a(window['Math']['ceil'](_0x39aa68/_0x484420)));window['localStorage']['setItem'](_0x435068,_0x57d17e);}function _0xde4ea1(){const _0x5a1bee='llct-'+_0xe7bb2a(_0x3bccd6(_0x5a550b)),_0x12444d=window['localStorage']['getItem'](_0x5a1bee);return _0x12444d?window['parseInt'](_0x14110d(_0x12444d),0x10)*_0x484420:null;}function _0x50beb0(_0x52886e){return new window['Promise']((_0x27b66a,_0x2ba09f)=>{_0x52886e['then'](_0x27b66a,_0x2ba09f),window['setTimeout'](_0x2ba09f,0x1d4c0);});}}_0x438fd4['on']('_sendUsageRequest',(_0x2a4ece,_0x2f5ac3)=>{if(_0x2f5ac3[0x0]!=_0x5a550b)return _0x3f9f65('UsageLimit');_0x2f5ac3[0x1]={..._0x2f5ac3[0x1],'requestId':_0x41f56e};},{'priority':'high'}),_0x438fd4['on']('_sendUsageRequest',_0x5b82b1=>{_0x20fc14(_0x5b82b1['return'])&&(_0x4db7ea=!0x0,_0x2938c1(_0x5b82b1['return']));},{'priority':'low'}),_0x2dda4f['then'](()=>{_0x4db7ea||_0x3f9f65('UsageLimit');});});function _0x10a0e5(){return'auto'==_0x438fd4['editing']['view']['_overlayModeHint'];}function _0x2b39ff(){_0x438fd4['editing']['view']['_overlayModeHint']='auto';}}function _0x30c41e(_0x58532d){const _0x53fc0e=[new window['Promise'](_0x5ef2c7=>setTimeout(_0x5ef2c7,0x93ecc)),_0x2dda4f['then'](()=>new window['Promise'](_0x2007c5=>{let _0x3fd3f4=0x0;_0x438fd4['model']['on']('applyOperation',(_0x3636f4,_0x1e10af)=>{_0x1e10af[0x0]['isDocumentOperation']&&_0x3fd3f4++,0x5e8==_0x3fd3f4&&(_0x2007c5(),_0x3636f4['off']());});}))];return window['Promise']['race'](_0x53fc0e)['then'](()=>_0x58532d);}async function _0x50825c(){await _0x2dda4f,_0x438fd4['model']['change']=_0x4c2151,_0x438fd4['model']['enqueueChange']=_0x4c2151,_0x438fd4['enableReadOnlyMode']('model');}function _0x32579a(_0x4ffd69){const _0x2537c0=_0x377b05();_0x438fd4[_0x2537c0]='sourceEditingEnhancedLicenseKey'+_0x4ffd69,'Valid'!=_0x4ffd69&&_0x50825c();}function _0x377b05(){const _0x580b61=window['String'](window['performance']['now']())['replace']('.','');let _0x32efce='N';for(let _0x25a28e=0x0;_0x25a28e<_0x580b61['length'];_0x25a28e+=0x2){let _0x34943d=window['parseInt'](_0x580b61['substring'](_0x25a28e,_0x25a28e+0x2));_0x34943d>=0x3e&&(_0x34943d-=0x3e),_0x32efce+=_0x59fad9[_0x34943d];}return _0x32efce;}function _0x4e0b28(){const _0xd42747=_0x17cbdf['split']('.');if(0x3!=_0xd42747['length'])return null;return _0x296925(_0xd42747[0x1]);function _0x296925(_0x34aba2){const _0xa79b8b=_0x38924c(_0x34aba2);return _0xa79b8b&&_0x343838()?_0xa79b8b:null;function _0x343838(){const _0x3bf42e=_0xa79b8b['jti'],_0x2c28f1=window['parseInt'](_0x3bf42e['substring'](_0x3bf42e['length']-0x8),0x10),_0x4e9804={..._0xa79b8b,'jti':_0x3bf42e['substring'](0x0,_0x3bf42e['length']-0x8)};return delete _0x4e9804['vc'],_0x3bccd6(_0x4e9804)==_0x2c28f1;}}}async function _0x1f0a8b(){let _0x951f51=!0x0;try{const [_0x5d21ec,_0x221479,_0x21118e]=_0x17cbdf['split']('.');return _0x565d16(_0x5d21ec),await _0x4326ae(_0x5d21ec,_0x221479,_0x21118e),_0x951f51;}catch{return!0x1;}function _0x565d16(_0x2d728d){const _0x32709d=_0x38924c(_0x2d728d);_0x32709d&&'ES256'==_0x32709d['alg']||(_0x951f51=!0x1);}async function _0x4326ae(_0x281967,_0x10cbba,_0x16d7e9){const _0x29e61f=window['Uint8Array']['from'](_0x1a05ed(_0x16d7e9),_0x1ede44=>_0x1ede44['charCodeAt'](0x0)),_0x20a06c=new window['TextEncoder']()['encode'](_0x281967+'.'+_0x10cbba),_0x4e6104=window['crypto']['subtle'];if(!_0x4e6104)return;const _0x435cbd=await _0x4e6104['importKey']('jwk',_0x3f2881,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4e6104['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x435cbd,_0x29e61f,_0x20a06c)||(_0x951f51=!0x1);}}function _0x38924c(_0x41f236){return _0x41f236['startsWith']('ey')?JSON['parse'](_0x1a05ed(_0x41f236)):null;}function _0x1a05ed(_0x2343f1){return window['atob'](_0x2343f1['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x3bccd6(_0x21b243){let _0x477c2c=0x1505;function _0x5bf987(_0x1bb708){for(let _0x5813e1=0x0;_0x5813e1<_0x1bb708['length'];_0x5813e1++){const _0x162f3a=_0x1bb708['charCodeAt'](_0x5813e1);_0x477c2c=(_0x477c2c<<0x5)+_0x477c2c+_0x162f3a,_0x477c2c&=_0x477c2c;}}function _0x4bd6e4(_0x4b0a11){Array['isArray'](_0x4b0a11)?_0x4b0a11['forEach'](_0x4bd6e4):_0x4b0a11&&'object'==typeof _0x4b0a11?Object['entries'](_0x4b0a11)['sort']()['forEach'](([_0x5d8295,_0x396666])=>{_0x5bf987(_0x5d8295),_0x4bd6e4(_0x396666);}):_0x5bf987(window['String'](_0x4b0a11));}return _0x4bd6e4(_0x21b243),_0x477c2c>>>0x0;}function _0xe7bb2a(_0x1b6ee4){return _0x1b6ee4['toString'](0x10)['padStart'](0x8,'0');}function _0x14110d(_0x176bcc){return _0x176bcc['split']('')['reverse']()['join']('');}function _0x4c2151(){}_0x32579a(await _0x10c24d());}(this);}_createButton(_0x506c17,_0x4cd952,_0x1942b7=!0x1){const _0xa1f279=new _0x506c17(this['editor']['locale']);return _0xa1f279['set']({'withText':_0x1942b7,'isToggleable':!0x1}),_0xa1f279['bind']('isEnabled')['to'](_0x4cd952,'isEnabled'),this['listenTo'](_0xa1f279,'execute',()=>_0x4cd952['execute']()),_0xa1f279;}_registerKeybindings(){const _0x45839e=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x45839e,'Source\x20Editing\x20Enhanced')});const _0x130b68=_0x27e0ea['isMac']||_0x27e0ea['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x45839e,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x45839e,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x45839e,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x45839e,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x45839e,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x45839e,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x45839e,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x130b68?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x45839e,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x45839e,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x45839e,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x45839e,'Select\x20line'),'keystroke':_0x130b68?'Ctrl!+L':'Alt+L'},{'label':Q(_0x45839e,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x130b68?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x45839e,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x45839e,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x45839e,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x45839e,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x45839e,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x130b68?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x197602{constructor(_0x475aac){super(_0x475aac),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x54533d,_0x3a4983){const _0x512f5c=this['editor'],_0x487494=_0x3a4983?.['rootName']??B(_0x512f5c);_0x512f5c['data']['set']({[_0x487494]:_0x54533d},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x392ff7{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x11158e){super(_0x11158e),_0x11158e['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 _0x331661=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3bf2dc;for(const _0x376bef in _0x331661){const _0x34a171=_0x376bef,_0x3a72c6=_0x331661[_0x34a171];if('sourceEditingEnhancedLicenseKeyValid'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyInvalid'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyExpired'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3a72c6||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3a72c6){delete _0x331661[_0x34a171],_0x3bf2dc=_0x3a72c6,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x3bf2dc&&_0x331661['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x3bf2dc&&_0x331661['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3bf2dc&&_0x331661['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3bf2dc&&_0x331661['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3bf2dc&&_0x331661['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3bf2dc&&_0x331661['_showLicenseError']('usageLimit');},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x458ba3=this['editor'],_0x3a2bff=_0x458ba3['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x3a2bff&&_0x458ba3['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x4e572f('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x3a2bff&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x17a107=>_0x458ba3['plugins']['has'](_0x17a107))&&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.'),_0x458ba3['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.4.0-alpha.3",
3
+ "version": "48.4.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": "48.4.0-alpha.3",
30
- "@ckeditor/ckeditor5-engine": "48.4.0-alpha.3",
31
- "@ckeditor/ckeditor5-icons": "48.4.0-alpha.3",
32
- "@ckeditor/ckeditor5-ui": "48.4.0-alpha.3",
33
- "@ckeditor/ckeditor5-utils": "48.4.0-alpha.3",
29
+ "@ckeditor/ckeditor5-core": "48.4.0-alpha.5",
30
+ "@ckeditor/ckeditor5-engine": "48.4.0-alpha.5",
31
+ "@ckeditor/ckeditor5-icons": "48.4.0-alpha.5",
32
+ "@ckeditor/ckeditor5-ui": "48.4.0-alpha.5",
33
+ "@ckeditor/ckeditor5-utils": "48.4.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",