@ckeditor/ckeditor5-document-outline 48.4.0-alpha.3 → 48.4.0-alpha.4
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.
- package/dist/index.js +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Command as _0x1a3ebd,Plugin as _0xf39157}from'@ckeditor/ckeditor5-core';import{debounce as _0x42ec32,throttle as _0x4c0244}from'es-toolkit/compat';import{ModelText as _0x239efa,ModelTreeWalker as _0x31393b}from'@ckeditor/ckeditor5-engine';import{CKEditorError as _0x327d2d,Rect as _0x5a27c1,diff as _0x5c9b06,diffToChanges as _0x38dbed,global as _0x394acc,priorities as _0x5513d7,scrollAncestorsToShowTarget as _0x16a6f6,uid as _0xe15622}from'@ckeditor/ckeditor5-utils';import{ButtonView as _0x6cdfc7,MenuBarMenuListItemButtonView as _0x2b33b0,View as _0x37b0d5}from'@ckeditor/ckeditor5-ui';import{Widget as _0x491d2f,toWidget as _0xcdc0a1}from'@ckeditor/ckeditor5-widget';import{IconTableOfContents as _0x147e6d}from'@ckeditor/ckeditor5-icons';function b(_0x34b2a0){let _0xf2839a='';for(const _0x4d4123 of _0x34b2a0['getChildren']())_0x4d4123 instanceof _0x239efa&&(_0xf2839a+=_0x4d4123['data']);return _0xf2839a;}var I=class extends _0xf39157{static get['pluginName'](){return'DocumentOutlineUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_headingNames']=[];init(){const _0x447f63=this['editor'];this['_headingNames']=this['_getHeadingNames']();let _0x300aea=[];_0x447f63['model']['document']['on']('change',_0x42ec32(()=>{const _0x1b4768=_0x300aea;_0x300aea=this['_getOutlineDefinitions']();const _0x3978e2=_0x38dbed(_0x5c9b06(_0x1b4768,_0x300aea,(_0x34cc0a,_0x4c6165)=>_0x34cc0a['level']===_0x4c6165['level']&&_0x34cc0a['text']===_0x4c6165['text']&&_0x34cc0a['modelElement']===_0x4c6165['modelElement']),_0x300aea),_0x54957d=this['_getActiveHeading'](),_0x258c6c=_0x300aea['findIndex'](_0x58ba1a=>_0x58ba1a['modelElement']===_0x54957d);_0x3978e2['length']&&this['fire']('change',{'outlineDefinitions':_0x300aea,'activeItemIndex':_0x258c6c,'outlineChanges':_0x3978e2}),this['fire']('activeItemIndex',{'index':_0x258c6c});},0xfa,{'leading':!0x0,'trailing':!0x0}));}afterInit(){this['_headingNames']['length']||this['_deriveHeadingElementsFromConversion']();}_getOutlineDefinitions(){const _0x35a0b4=this['editor'],_0x5c44ae=[],_0x218259=this['_headingNames'];for(const _0x3e73b1 of _0x35a0b4['model']['document']['getRootNames']())_0x122244(_0x35a0b4['model']['document']['getRoot'](_0x3e73b1));function _0x122244(_0x1cdfbb){for(const _0x2bfa4e of _0x1cdfbb['getChildren']())_0x2bfa4e['is']('element')&&(_0x218259['includes'](_0x2bfa4e['name'])&&_0x5c44ae['push']({'level':_0x218259['indexOf'](_0x2bfa4e['name'])+0x1,'text':b(_0x2bfa4e),'modelElement':_0x2bfa4e}),_0x122244(_0x2bfa4e));}return _0x5c44ae;}_getActiveHeading(){const _0xec7718=new _0x31393b({'direction':'backward','startPosition':this['editor']['model']['document']['selection']['getFirstPosition']()});for(const _0x3e9088 of _0xec7718)if(_0x3e9088['item']['is']('element')&&this['_headingNames']['includes'](_0x3e9088['item']['name']))return _0x3e9088['item'];}_getHeadingNames(){const _0x29006a=this['editor']['config']['get']('documentOutline.headings');return _0x29006a||function(_0x2794be){const _0x29ad8e=_0x2794be['config']['get']('heading.options');return _0x29ad8e?_0x29ad8e['reduce']((_0x44507d,_0x5eda72)=>('paragraph'!==_0x5eda72['model']&&_0x44507d['push'](_0x5eda72['model']),_0x44507d),[]):_0x2794be['plugins']['has']('GeneralHtmlSupport')?['htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']:[];}(this['editor']);}_deriveHeadingElementsFromConversion(){const _0x5b16f8=this['editor'],_0x201a11=['h1','h2','h3','h4','h5','h6'],_0x43e582=[];for(const _0x281e20 of _0x201a11){const _0x3465fb=_0x5b16f8['editing']['view']['domConverter']['domToView'](document['createElement'](_0x281e20)),_0x4a2a28=_0x5b16f8['data']['toModel'](_0x3465fb)['getChild'](0x0);_0x4a2a28?.['is']('element')&&_0x43e582['push'](_0x4a2a28['name']);}this['_headingNames']=_0x43e582;}};function L(_0x4139ae,_0x51bcd7){const t=_0x4139ae['t'];switch(_0x51bcd7){case'Empty\x20heading':return t('Empty\x20heading');case'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.':return t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.');case'No\x20headings\x20were\x20found\x20in\x20the\x20document.':return t('No\x20headings\x20were\x20found\x20in\x20the\x20document.');case'Table\x20of\x20contents':return t('Table\x20of\x20contents');default:return _0x51bcd7;}}var C=class extends _0x37b0d5{constructor(_0x87bd8,_0x434424=!0x1){super(_0x87bd8);const _0x232387=this['bindTemplate'],_0x2c805e=_0x434424?'['+L(_0x87bd8,'Empty\x20heading')+']':'';this['set']('text',''),this['set']('level',0x1),this['set']('isActive',!0x1),this['bind']('isEmpty')['to'](this,'text',_0x29f226=>!_0x29f226),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline__item',_0x232387['to']('level',_0x287bb6=>'ck-document-outline__item_level-'+_0x287bb6),_0x232387['if']('isActive','ck-document-outline__item_active'),_0x232387['if']('isEmpty','ck-document-outline__item_empty')],'title':_0x232387['to']('text')},'children':[{'text':_0x232387['to']('text',_0x11b3c8=>_0x11b3c8||_0x2c805e)}],'on':{'click':_0x232387['to']('click')}});}},_=class extends _0x37b0d5{items;documentOutlineContainer;showEmptyHeadingText;constructor(_0xe33d3d,_0x4fb16c=!0x1,_0x31d83e){super(_0xe33d3d),this['showEmptyHeadingText']=_0x4fb16c,this['set']('activeItemIndex',-0x1),this['documentOutlineContainer']=_0x31d83e,this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x57de02,_0x582b8a,_0x4b50f7,_0x4a83b9)=>{this['_setActiveItem'](_0x4a83b9,_0x4b50f7);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0xe33d3d['contentLanguageDirection'],'data-document-outline-empty-placeholder':L(_0xe33d3d,'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0x1c7f39){_0x1c7f39['forEach'](_0x5357d4=>{'insert'==_0x5357d4['type']?this['_insertItem'](_0x5357d4['index'],..._0x5357d4['values']):'delete'==_0x5357d4['type']&&this['_deleteItem'](_0x5357d4['index'],_0x5357d4['howMany']);});}_setActiveItem(_0x341777,_0x26fd4e){if(-0x1!==_0x341777){const _0x26758d=this['items']['get'](_0x341777);_0x26758d&&(_0x26758d['isActive']=!0x1);}-0x1!==_0x26fd4e&&(this['items']['get'](_0x26fd4e)['isActive']=!0x0,this['_scrollToItem'](_0x26fd4e));}_insertItem(_0x24c2b2,..._0x3133a3){const _0x1ff0bd=_0x3133a3['map']((_0x3d6312,_0x1afd2d)=>{const _0x4a6d99=new C(this['locale'],this['showEmptyHeadingText']);return _0x4a6d99['text']=_0x3d6312['text'],_0x4a6d99['level']=_0x3d6312['level'],_0x24c2b2+_0x1afd2d===this['activeItemIndex']&&(_0x4a6d99['isActive']=!0x0),_0x4a6d99;});this['items']['addMany'](_0x1ff0bd,_0x24c2b2);}_deleteItem(_0x90a012,_0x5edfeb){do{this['items']['remove'](_0x90a012);}while(--_0x5edfeb);}_handleItemClick(_0x4116ba){const _0x1fa1c5=this['items']['getIndex'](_0x4116ba['source']);this['fire']('itemSelected',_0x1fa1c5);}_scrollToItem(_0x5b1e56){_0x16a6f6(this['items']['get'](_0x5b1e56)['element'],0x14,this['documentOutlineContainer']);}destroy(){super['destroy'](),this['element']['remove']();}},x=class extends _0xf39157{['view'];_currentOutlineDefinitions;_updateActiveDefinitionFromViewportThrottled;static get['pluginName'](){return'DocumentOutlineUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x522f52){super(_0x522f52),this['view']=new _(_0x522f52['locale'],this['editor']['config']['get']('documentOutline.showEmptyHeadings'),this['editor']['config']['get']('documentOutline.container')),this['_currentOutlineDefinitions']=[],this['_updateActiveDefinitionFromViewportThrottled']=_0x4c0244(this['_updateActiveDefinitionOnViewportChange']['bind'](this),0x64);}init(){const _0x1b15a3=this['editor'],_0x42bedb=_0x1b15a3['plugins']['get']('DocumentOutlineUtils');let _0x28dc51=!0x1;if(this['view']['render'](),this['editor']['ui']['focusTracker']['add'](this['view']['element']),!_0x1b15a3['config']['get']('documentOutline.container'))throw new _0x327d2d('document-outline-container-not-provided',{'editor':_0x1b15a3});_0x1b15a3['config']['get']('documentOutline.container')['appendChild'](this['view']['element']),_0x42bedb['on']('change',this['_handleOutlineChange']['bind'](this)),_0x42bedb['on']('activeItemIndex',(_0x4fa544,{index:_0x2a5816})=>this['_setActiveViewItem'](_0x2a5816)),this['view']['on']('itemSelected',(_0x4d4837,_0x442983)=>{_0x28dc51=!0x0,this['_handleItemSelected'](_0x442983);}),this['view']['listenTo'](_0x394acc['document'],'scroll',()=>{_0x28dc51?_0x28dc51=!0x1:this['_updateActiveDefinitionFromViewportThrottled']();},{'useCapture':!0x0}),this['view']['listenTo'](_0x394acc['window'],'resize',this['_updateActiveDefinitionFromViewportThrottled'],{'useCapture':!0x0});}afterInit(){!async function(_0x5baf89){const _0x1b7bb9='aWxlPG0A3CDdHBsZEqwULojOrgMXVTRvu1bI2487ptzJKQeihfNkYS9n6y5mcF',_0x42ec8f=0x79170,_0x22c71d=window['Date']['now'](),_0x3ba9eb=_0x5baf89['editor'],_0x1c8e6e=new window['Promise'](_0x2c52e6=>{_0x3ba9eb['once']('ready',_0x2c52e6);}),_0xd394b9={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x38366f=_0x3ba9eb['config']['get']('licenseKey');async function _0x20fd6e(){let _0x4b08b0,_0x32c47e=null,_0x254d37=null;try{return'GPL'==_0x38366f?'NotAllowed':(_0x4b08b0=_0x526470(),_0x4b08b0?(_0x4b08b0['usageEndpoint']&&(_0x254d37=_0x4249ef(_0x4b08b0['usageEndpoint'],_0x4b08b0['jti'])),await _0x4f647f()?_0x3060cf()?_0x391ab8()?'Expired':_0x2518c2()?('evaluation'==_0x4b08b0['licenseType']&&(_0x32c47e=_0x54d14c('EvaluationLimit')),await _0x325cab()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x391ab8(){const _0x7b135e=['evaluation','trial']['includes'](_0x4b08b0['licenseType'])?_0x22c71d/0x3e8:0xe10*_0x42ec8f;return _0x4b08b0['exp']<_0x7b135e;}function _0x3060cf(){const _0xc7719d=_0x4b08b0['features'];return!!_0xc7719d&&(!!_0xc7719d['includes']('*')||(!!_0xc7719d['includes']('DO')||(!!_0xc7719d['includes']('PP')||!(!_0xc7719d['includes']('TRILIUM')||!_0x4f61a1()))));}function _0x2518c2(){const _0x50e891=_0x4b08b0['licensedHosts'];if(!_0x50e891||0x0==_0x50e891['length'])return!0x0;const {hostname:_0x440c8f}=new URL(window['location']['href']);if(_0x50e891['includes'](_0x440c8f))return!0x0;const _0x537616=_0x440c8f['split']('.');return _0x50e891['filter'](_0x41f352=>_0x41f352['includes']('*'))['map'](_0x3b653a=>_0x3b653a['split']('.'))['filter'](_0x141468=>_0x141468['length']<=_0x537616['length'])['map'](_0x4f23c8=>Array(_0x537616['length']-_0x4f23c8['length'])['fill']('*'===_0x4f23c8[0x0]?'*':'')['concat'](_0x4f23c8))['some'](_0x332843=>_0x537616['every']((_0x585bd2,_0x468c70)=>_0x332843[_0x468c70]===_0x585bd2||'*'===_0x332843[_0x468c70]));}function _0x325cab(){return _0x32c47e&&_0x254d37?new window['Promise']((_0x2bd3b3,_0xca6515)=>{_0x32c47e['then'](_0x2bd3b3,_0xca6515),_0x254d37['then'](_0x4f41fc=>{'Valid'!=_0x4f41fc&&_0x2bd3b3(_0x4f41fc);},_0xca6515);}):_0x32c47e||_0x254d37||'Valid';}}function _0x4249ef(_0x14d5ba,_0x1ab9c2){return new window['Promise'](_0x1a6eb3=>{if(_0x40d4cb())return _0x1a6eb3('Valid');_0x2e981e(),_0x3ba9eb['decorate']('_sendUsageRequest');let _0x2e86fe=!0x1;const _0x219c09=_0xe15622();function _0x1e0e45(_0x21828d){return!!_0x21828d&&('object'==typeof _0x21828d||'function'==typeof _0x21828d)&&'function'==typeof _0x21828d['then']&&'function'==typeof _0x21828d['catch'];}function _0x4c0841(_0x41d9d5){_0x66f87f(_0x41d9d5)['then'](_0x395877=>_0x395877&&'ok'==_0x395877['status']?_0x37d6b1(_0x1d0ea3(_0x219c09+_0x1ab9c2))!=_0x395877['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x497c94=>(_0x1ed666(),_0x497c94),()=>{const _0x42da9f=_0x560efa();return null==_0x42da9f?(_0x1ed666(),'Valid'):_0x22c71d-_0x42da9f>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1a6eb3)['catch'](()=>{_0x1a6eb3('UsageLimit');});const _0x2f0efb=0x36ee80;function _0x1ed666(){const _0x3a3bb3='llct-'+_0x37d6b1(_0x1d0ea3(_0x14d5ba)),_0x1bc88d=_0x69f48a(_0x37d6b1(window['Math']['ceil'](_0x22c71d/_0x2f0efb)));window['localStorage']['setItem'](_0x3a3bb3,_0x1bc88d);}function _0x560efa(){const _0x267d3f='llct-'+_0x37d6b1(_0x1d0ea3(_0x14d5ba)),_0x472184=window['localStorage']['getItem'](_0x267d3f);return _0x472184?window['parseInt'](_0x69f48a(_0x472184),0x10)*_0x2f0efb:null;}function _0x66f87f(_0x97d175){return new window['Promise']((_0x43b8bb,_0x51766c)=>{_0x97d175['then'](_0x43b8bb,_0x51766c),window['setTimeout'](_0x51766c,0x1d4c0);});}}_0x3ba9eb['on']('_sendUsageRequest',(_0x1e0c1a,_0x562ee2)=>{if(_0x562ee2[0x0]!=_0x14d5ba)return _0x1a6eb3('UsageLimit');_0x562ee2[0x1]={..._0x562ee2[0x1],'requestId':_0x219c09};},{'priority':'high'}),_0x3ba9eb['on']('_sendUsageRequest',_0xcf5930=>{_0x1e0e45(_0xcf5930['return'])&&(_0x2e86fe=!0x0,_0x4c0841(_0xcf5930['return']));},{'priority':'low'}),_0x1c8e6e['then'](()=>{_0x2e86fe||_0x1a6eb3('UsageLimit');});});function _0x40d4cb(){return'auto'==_0x3ba9eb['editing']['view']['_overlayModeHint'];}function _0x2e981e(){_0x3ba9eb['editing']['view']['_overlayModeHint']='auto';}}function _0x54d14c(_0x2265f9){const _0x1c5d4a=[new window['Promise'](_0x5ac012=>setTimeout(_0x5ac012,0x93ecc)),_0x1c8e6e['then'](()=>new window['Promise'](_0x24d208=>{let _0x19301c=0x0;_0x3ba9eb['model']['on']('applyOperation',(_0x54238a,_0x5037c3)=>{_0x5037c3[0x0]['isDocumentOperation']&&_0x19301c++,0x5e8==_0x19301c&&(_0x24d208(),_0x54238a['off']());});}))];return window['Promise']['race'](_0x1c5d4a)['then'](()=>_0x2265f9);}async function _0x3e50e4(){await _0x1c8e6e,_0x3ba9eb['model']['change']=_0x20def2,_0x3ba9eb['model']['enqueueChange']=_0x20def2,_0x3ba9eb['enableReadOnlyMode']('model');}function _0x4f61a1(){return window['glob']&&window['glob']['triliumVersion'];}function _0x11ee0c(_0x2b68bf){const _0x384392=_0x5e9ee9();_0x3ba9eb[_0x384392]='documentOutlineLicenseKey'+_0x2b68bf,'Valid'!=_0x2b68bf&&_0x3e50e4();}function _0x5e9ee9(){const _0x47ea43=window['String'](window['performance']['now']())['replace']('.','');let _0x862bb3='a';for(let _0x5a42f0=0x0;_0x5a42f0<_0x47ea43['length'];_0x5a42f0+=0x2){let _0x3cd78b=window['parseInt'](_0x47ea43['substring'](_0x5a42f0,_0x5a42f0+0x2));_0x3cd78b>=0x3e&&(_0x3cd78b-=0x3e),_0x862bb3+=_0x1b7bb9[_0x3cd78b];}return _0x862bb3;}function _0x526470(){const _0x5f5d21=_0x38366f['split']('.');if(0x3!=_0x5f5d21['length'])return null;return _0x57aca6(_0x5f5d21[0x1]);function _0x57aca6(_0x23f8ee){const _0x290434=_0x531b8f(_0x23f8ee);return _0x290434&&_0x541ed4()?_0x290434:null;function _0x541ed4(){const _0x263ef8=_0x290434['jti'],_0x335361=window['parseInt'](_0x263ef8['substring'](_0x263ef8['length']-0x8),0x10),_0x2c6955={..._0x290434,'jti':_0x263ef8['substring'](0x0,_0x263ef8['length']-0x8)};return delete _0x2c6955['vc'],_0x1d0ea3(_0x2c6955)==_0x335361;}}}async function _0x4f647f(){let _0xf84926=!0x0;try{const [_0x153584,_0x11022b,_0x56aca6]=_0x38366f['split']('.');return _0x6ff7b4(_0x153584),await _0x1370d2(_0x153584,_0x11022b,_0x56aca6),_0xf84926;}catch{return!0x1;}function _0x6ff7b4(_0x5c825a){const _0xaa62dd=_0x531b8f(_0x5c825a);_0xaa62dd&&'ES256'==_0xaa62dd['alg']||(_0xf84926=!0x1);}async function _0x1370d2(_0x401097,_0x44586c,_0x4f177a){const _0x5ba4ec=window['Uint8Array']['from'](_0xc24b14(_0x4f177a),_0x4c3781=>_0x4c3781['charCodeAt'](0x0)),_0x1bee3a=new window['TextEncoder']()['encode'](_0x401097+'.'+_0x44586c),_0x3e3691=window['crypto']['subtle'];if(!_0x3e3691)return;const _0x457a10=await _0x3e3691['importKey']('jwk',_0xd394b9,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3e3691['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x457a10,_0x5ba4ec,_0x1bee3a)||(_0xf84926=!0x1);}}function _0x531b8f(_0x34c453){return _0x34c453['startsWith']('ey')?JSON['parse'](_0xc24b14(_0x34c453)):null;}function _0xc24b14(_0x1ad096){return window['atob'](_0x1ad096['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x1d0ea3(_0x2518c4){let _0x1b4df6=0x1505;function _0x168732(_0x291ffa){for(let _0x2f71b4=0x0;_0x2f71b4<_0x291ffa['length'];_0x2f71b4++){const _0x28cc4d=_0x291ffa['charCodeAt'](_0x2f71b4);_0x1b4df6=(_0x1b4df6<<0x5)+_0x1b4df6+_0x28cc4d,_0x1b4df6&=_0x1b4df6;}}function _0x38e884(_0x42322c){Array['isArray'](_0x42322c)?_0x42322c['forEach'](_0x38e884):_0x42322c&&'object'==typeof _0x42322c?Object['entries'](_0x42322c)['sort']()['forEach'](([_0x33e195,_0x51acb2])=>{_0x168732(_0x33e195),_0x38e884(_0x51acb2);}):_0x168732(window['String'](_0x42322c));}return _0x38e884(_0x2518c4),_0x1b4df6>>>0x0;}function _0x37d6b1(_0x4df279){return _0x4df279['toString'](0x10)['padStart'](0x8,'0');}function _0x69f48a(_0x9d93db){return _0x9d93db['split']('')['reverse']()['join']('');}function _0x20def2(){}_0x11ee0c(await _0x20fd6e());}(this);}destroy(){super['destroy'](),this['view']['destroy'](),this['_updateActiveDefinitionFromViewportThrottled']['cancel']();}_handleOutlineChange(_0x88e85b,{outlineDefinitions:_0x1321fa,outlineChanges:_0x2c1dc4}){this['_currentOutlineDefinitions']=_0x1321fa,this['view']['sync'](_0x2c1dc4);}_setActiveViewItem(_0x367f66){this['_currentOutlineDefinitions']['length']&&this['_currentOutlineDefinitions'][_0x367f66]&&(this['view']['activeItemIndex']=_0x367f66);}_handleItemSelected(_0x46147f){const _0x31d47d=this['_currentOutlineDefinitions'][_0x46147f]['modelElement'];this['editor']['model']['change'](_0x3b5431=>{_0x3b5431['setSelection'](_0x31d47d,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0}),this['editor']['editing']['view']['focus'](),this['_setActiveViewItem'](_0x46147f);}_updateActiveDefinitionOnViewportChange(){const _0x1ef42a=this['editor'];let _0x5c0eb1;for(const _0x420edf of _0x1ef42a['model']['document']['getRootNames']()){const _0x5e217e=_0x1ef42a['editing']['view']['getDomRoot'](_0x420edf),_0xd3cf3=_0x5e217e&&new _0x5a27c1(_0x5e217e)['getVisible']();if(_0xd3cf3){const _0x4747a4=new _0x5a27c1(_0x394acc['window'])['getIntersection'](_0xd3cf3);_0x4747a4&&(_0x5c0eb1=_0x4747a4['top']+0.25*_0x4747a4['height']);}}if(void 0x0===_0x5c0eb1)return;const _0x438e13=k(_0x1ef42a['editing'],this['_currentOutlineDefinitions'],_0x5c0eb1);_0x438e13?this['_setActiveViewItem'](this['_currentOutlineDefinitions']['indexOf'](_0x438e13)):this['_setActiveViewItem'](-0x1);}};function k(_0x1e3769,_0x131e24,_0x4562d4,_0x3971b0=0x0,_0x194820=_0x131e24['length']-0x1){const _0x5daefd=Math['floor'](_0x3971b0+(_0x194820-_0x3971b0)/0x2);if(_0x194820>=_0x3971b0){const _0x18712b=_0x131e24[_0x5daefd],_0x98b3e=_0x1e3769['mapper']['toViewElement'](_0x18712b['modelElement']);return _0x98b3e?new _0x5a27c1(_0x1e3769['view']['domConverter']['mapViewToDom'](_0x98b3e))['bottom']>_0x4562d4?k(_0x1e3769,_0x131e24,_0x4562d4,_0x3971b0,_0x5daefd-0x1):k(_0x1e3769,_0x131e24,_0x4562d4,_0x5daefd+0x1,_0x194820):null;}return _0x5daefd<0x0?null:_0x131e24[_0x5daefd];}var E=class extends _0xf39157{['licenseKey'];_licenseKeyCheckInterval;static get requires(){return[I,x];}static get['pluginName'](){return'DocumentOutline';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x462ee7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x542360;for(const _0x1ed455 in _0x462ee7){const _0x5a745b=_0x1ed455,_0x2d756a=_0x462ee7[_0x5a745b];if('documentOutlineLicenseKeyValid'==_0x2d756a||'documentOutlineLicenseKeyInvalid'==_0x2d756a||'documentOutlineLicenseKeyExpired'==_0x2d756a||'documentOutlineLicenseKeyDomainLimit'==_0x2d756a||'documentOutlineLicenseKeyNotAllowed'==_0x2d756a||'documentOutlineLicenseKeyEvaluationLimit'==_0x2d756a||'documentOutlineLicenseKeyUsageLimit'==_0x2d756a){delete _0x462ee7[_0x5a745b],_0x542360=_0x2d756a,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'documentOutlineLicenseKeyInvalid'==_0x542360&&_0x462ee7['_showLicenseError']('invalid'),'documentOutlineLicenseKeyExpired'==_0x542360&&_0x462ee7['_showLicenseError']('expired'),'documentOutlineLicenseKeyDomainLimit'==_0x542360&&_0x462ee7['_showLicenseError']('domainLimit'),'documentOutlineLicenseKeyNotAllowed'==_0x542360&&_0x462ee7['_showLicenseError']('featureNotAllowed','DocumentOutline'),'documentOutlineLicenseKeyEvaluationLimit'==_0x542360&&_0x462ee7['_showLicenseError']('evaluationLimit'),'documentOutlineLicenseKeyUsageLimit'==_0x542360&&_0x462ee7['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},K=class extends _0x1a3ebd{execute(){this['editor']['model']['change'](_0xad4cf5=>{this['editor']['model']['insertObject'](_0xad4cf5['createElement']('tableOfContents'));});}['refresh'](){const _0x4ca8f7=this['editor']['model'],_0xcc944b=_0x4ca8f7['document']['selection']['getFirstPosition']();this['isEnabled']=null!==(_0xcc944b&&_0x4ca8f7['schema']['findAllowedParent'](_0xcc944b,'tableOfContents'));}},A=class extends _0xf39157{static get['pluginName'](){return'HeadingId';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){const _0x104610=this['editor'];if(_0x104610['config']['get']('headingId.modelAttributeName'))return;const {viewNames:_0x5de183,modelNames:_0x57427a}=function(_0x5246ac){const _0x514bdd=new Set(['h1','h2','h3','h4','h5','h6']),_0x33787c=new Set(['heading1','heading2','heading3','heading4','heading5','heading6','htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']);if(!_0x5246ac)return{'viewNames':_0x514bdd,'modelNames':_0x33787c};for(const _0x12fe2e of _0x5246ac){if('paragraph'===_0x12fe2e['model'])continue;const _0xd1da0f='string'==typeof _0x12fe2e['view']?_0x12fe2e['view']:_0x12fe2e['view']['name'];_0x514bdd['add'](_0xd1da0f),_0x33787c['add'](_0x12fe2e['model']);}return{'viewNames':_0x514bdd,'modelNames':_0x33787c};}(this['editor']['config']['get']('heading.options'));for(const _0x5c6c11 of _0x5de183)this['_customUpcastHeadingsConversion'](_0x5c6c11);for(const _0x151c8b of _0x57427a)this['_customDataDowncastHeadingsConversion'](_0x151c8b),_0x104610['model']['schema']['isRegistered'](_0x151c8b)&&_0x104610['model']['schema']['extend'](_0x151c8b,{'allowAttributes':'headingId'});this['_registerHeadingIdAttributePostfixer'](_0x57427a);}_customUpcastHeadingsConversion(_0x4cd6fa){this['editor']['conversion']['for']('upcast')['add'](_0x44f8e9=>_0x44f8e9['on']('element:'+_0x4cd6fa,(_0x346fef,_0x4e1b8a,_0x349e96)=>{const {consumable:_0xd79103,writer:_0x541b2f}=_0x349e96,_0x35b897=_0x4e1b8a['viewItem']['getAttribute']('id'),_0x81a7dd=_0x4e1b8a['modelRange']?.['getContainedElement']();if(_0x81a7dd)return _0x35b897&&_0x35b897['length']||_0x81a7dd['hasAttribute']('headingId')?void(_0xd79103['consume'](_0x4e1b8a['viewItem'],{'attributes':['id']})&&_0x541b2f['setAttribute']('headingId',_0x35b897,_0x81a7dd)):(_0xd79103['consume'](_0x4e1b8a['viewItem'],{'attributes':['id']}),void _0x541b2f['setAttribute']('headingId',_0xe15622(),_0x81a7dd));},{'priority':_0x5513d7['get']('low')+0.5}));}_customDataDowncastHeadingsConversion(_0x4d6d87){this['editor']['conversion']['for']('downcast')['add'](_0x21bc83=>_0x21bc83['on']('attribute:headingId:'+_0x4d6d87,(_0x3e40ff,_0x39c51e,_0x54e96d)=>{if(!_0x54e96d['consumable']['consume'](_0x39c51e['item'],_0x3e40ff['name']))return;const _0x455130=_0x39c51e['item']['getAttribute']('headingId'),_0x4d083d=_0x54e96d['mapper']['toViewElement'](_0x39c51e['item']);_0x54e96d['writer']['setAttribute']('id',_0x455130,_0x4d083d);}));}_registerHeadingIdAttributePostfixer(_0x1fde5c){const _0x1a44f9=this['editor'],_0x40b947=new Set(),_0x57d9c0=new Set();function _0x5c04ec(_0x1c4c66,_0x205e1e){const _0x3ad3dc=_0xe15622();return _0x57d9c0['add'](_0x3ad3dc),_0x1c4c66['setAttribute']('headingId',_0x3ad3dc,_0x205e1e),_0x3ad3dc;}function _0x201145(_0x3fdd90,_0x37d9e0){_0x3fdd90['removeAttribute']('headingId',_0x37d9e0);}_0x1a44f9['model']['document']['registerPostFixer'](_0x201b75=>{const _0x4f70f4=_0x1a44f9['model']['document']['differ']['getChanges']();let _0x2534cd=!0x1;for(const _0x255903 of _0x4f70f4)if('insert'==_0x255903['type']&&_0x255903['name']){if(_0x1fde5c['has'](_0x255903['name'])){const _0x40d42c=_0x255903['attributes']['get']('headingId');'string'==typeof _0x40d42c?_0x40b947['has'](_0x40d42c)?(_0x5c04ec(_0x201b75,_0x255903['position']['nodeAfter']),_0x2534cd=!0x0):_0x57d9c0['add'](_0x40d42c):(_0x5c04ec(_0x201b75,_0x255903['position']['nodeAfter']),_0x2534cd=!0x0);}else'string'==typeof _0x255903['attributes']['get']('headingId')&&(_0x201145(_0x201b75,_0x255903['position']['nodeAfter']),_0x2534cd=!0x0);}else{if('remove'==_0x255903['type']){const _0x27c00e=_0x255903['attributes']['get']('headingId');'string'==typeof _0x27c00e&&_0x40b947['delete'](_0x27c00e);}}return _0x2534cd;}),_0x1a44f9['model']['document']['on']('change',()=>{_0x57d9c0['forEach'](_0x5440cc=>_0x40b947['add'](_0x5440cc)),_0x57d9c0['clear']();});}},N=class extends _0xf39157{static get['pluginName'](){return'TableOfContentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x491d2f,I,A];}_currentOutlineDefinitions;_tableOfContentsElements;_headingIdModelAttributeName;constructor(_0x187a66){super(_0x187a66),this['_currentOutlineDefinitions']=[],this['_tableOfContentsElements']=new Set(),this['_headingIdModelAttributeName']='headingId';}init(){const _0x2ab2b4=this['editor'],_0x47a90f=_0x2ab2b4['editing']['view']['document'];_0x2ab2b4['config']['get']('headingId.modelAttributeName')&&(this['_headingIdModelAttributeName']=_0x2ab2b4['config']['get']('headingId.modelAttributeName')),this['listenTo'](_0x47a90f,'click',(_0x506eba,_0x3a01be)=>{if(!_0x3a01be['target'])return;const _0x2a9346=_0x3a01be['target']['getCustomProperty']('tableOfContentsHeadingIndex');Number['isInteger'](_0x2a9346)&&(_0x3a01be['domEvent']['preventDefault'](),_0x506eba['stop'](),this['_handleScrollToHeading'](_0x2a9346));},{'priority':'high','context':'$capture'}),this['_defineSchema'](),this['_defineConverters'](),_0x2ab2b4['commands']['add']('insertTableOfContents',new K(_0x2ab2b4));const _0x4e6bce=_0x2ab2b4['config']['get']('tableOfContents.headings');_0x4e6bce&&_0x4e6bce['length']?this['listenTo'](_0x2ab2b4['model']['document'],'change:data',()=>{this['_currentOutlineDefinitions']=this['_getOutlineDefinitions'](_0x4e6bce),this['_updateTableOfContentsElements']();}):_0x2ab2b4['plugins']['get']('DocumentOutlineUtils')['on']('change',(_0x25ccc1,_0xf5e364)=>{this['_currentOutlineDefinitions']=_0xf5e364['outlineDefinitions'],this['_updateTableOfContentsElements']();}),this['listenTo'](_0x2ab2b4['model']['document'],'change',()=>{this['_trackNewToCElements']();});}afterInit(){!async function(_0x2b6979){const _0x5272e3='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x3943e5=0x79170,_0x70bc3=window['Date']['now'](),_0x2aca04=_0x2b6979['editor'],_0x374292=new window['Promise'](_0x99b0a4=>{_0x2aca04['once']('ready',_0x99b0a4);}),_0x20b942={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x275e42=_0x2aca04['config']['get']('licenseKey');async function _0x46bd66(){let _0x25784c,_0x272db2=null,_0x5a5fec=null;try{return'GPL'==_0x275e42?'NotAllowed':(_0x25784c=_0x423998(),_0x25784c?(_0x25784c['usageEndpoint']&&(_0x5a5fec=_0x41a0e3(_0x25784c['usageEndpoint'],_0x25784c['jti'])),await _0x4150d3()?_0x1b828e()?_0x30627f()?'Expired':_0x46400b()?('evaluation'==_0x25784c['licenseType']&&(_0x272db2=_0x1702f3('EvaluationLimit')),await _0x745836()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x30627f(){const _0x1d4747=['evaluation','trial']['includes'](_0x25784c['licenseType'])?_0x70bc3/0x3e8:0xe10*_0x3943e5;return _0x25784c['exp']<_0x1d4747;}function _0x1b828e(){const _0x28bf86=_0x25784c['features'];return!!_0x28bf86&&(!!_0x28bf86['includes']('*')||(!!_0x28bf86['includes']('TOC')||(!!_0x28bf86['includes']('PP')||!(!_0x28bf86['includes']('TRILIUM')||!_0x54642f()))));}function _0x46400b(){const _0x3869ab=_0x25784c['licensedHosts'];if(!_0x3869ab||0x0==_0x3869ab['length'])return!0x0;const {hostname:_0x698676}=new URL(window['location']['href']);if(_0x3869ab['includes'](_0x698676))return!0x0;const _0x1f40ac=_0x698676['split']('.');return _0x3869ab['filter'](_0x17db38=>_0x17db38['includes']('*'))['map'](_0x3ea447=>_0x3ea447['split']('.'))['filter'](_0x21b2b9=>_0x21b2b9['length']<=_0x1f40ac['length'])['map'](_0x1314d2=>Array(_0x1f40ac['length']-_0x1314d2['length'])['fill']('*'===_0x1314d2[0x0]?'*':'')['concat'](_0x1314d2))['some'](_0x5f323b=>_0x1f40ac['every']((_0x3930d8,_0x525cfb)=>_0x5f323b[_0x525cfb]===_0x3930d8||'*'===_0x5f323b[_0x525cfb]));}function _0x745836(){return _0x272db2&&_0x5a5fec?new window['Promise']((_0x32d143,_0x464e2f)=>{_0x272db2['then'](_0x32d143,_0x464e2f),_0x5a5fec['then'](_0x5f573f=>{'Valid'!=_0x5f573f&&_0x32d143(_0x5f573f);},_0x464e2f);}):_0x272db2||_0x5a5fec||'Valid';}}function _0x41a0e3(_0x21aae8,_0x528278){return new window['Promise'](_0x38c523=>{if(_0x33f0d2())return _0x38c523('Valid');_0x1f42e5(),_0x2aca04['decorate']('_sendUsageRequest');let _0x2912a2=!0x1;const _0x272a18=_0xe15622();function _0x16d7fc(_0x240c71){return!!_0x240c71&&('object'==typeof _0x240c71||'function'==typeof _0x240c71)&&'function'==typeof _0x240c71['then']&&'function'==typeof _0x240c71['catch'];}function _0x19984d(_0x5091d1){_0x5280cd(_0x5091d1)['then'](_0x59a2a2=>_0x59a2a2&&'ok'==_0x59a2a2['status']?_0x1be3a5(_0x2c4e7e(_0x272a18+_0x528278))!=_0x59a2a2['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x40da56=>(_0x34fbd8(),_0x40da56),()=>{const _0x19a9da=_0x1e7ea9();return null==_0x19a9da?(_0x34fbd8(),'Valid'):_0x70bc3-_0x19a9da>0x240c8400?'UsageLimit':'Valid';})['then'](_0x38c523)['catch'](()=>{_0x38c523('UsageLimit');});const _0x4972e9=0x36ee80;function _0x34fbd8(){const _0x41ddd4='llct-'+_0x1be3a5(_0x2c4e7e(_0x21aae8)),_0x24afd6=_0x3e413c(_0x1be3a5(window['Math']['ceil'](_0x70bc3/_0x4972e9)));window['localStorage']['setItem'](_0x41ddd4,_0x24afd6);}function _0x1e7ea9(){const _0x388d96='llct-'+_0x1be3a5(_0x2c4e7e(_0x21aae8)),_0x317da8=window['localStorage']['getItem'](_0x388d96);return _0x317da8?window['parseInt'](_0x3e413c(_0x317da8),0x10)*_0x4972e9:null;}function _0x5280cd(_0x760ce7){return new window['Promise']((_0x4d1566,_0x471470)=>{_0x760ce7['then'](_0x4d1566,_0x471470),window['setTimeout'](_0x471470,0x1d4c0);});}}_0x2aca04['on']('_sendUsageRequest',(_0x1c66f1,_0x192b11)=>{if(_0x192b11[0x0]!=_0x21aae8)return _0x38c523('UsageLimit');_0x192b11[0x1]={..._0x192b11[0x1],'requestId':_0x272a18};},{'priority':'high'}),_0x2aca04['on']('_sendUsageRequest',_0x572ae1=>{_0x16d7fc(_0x572ae1['return'])&&(_0x2912a2=!0x0,_0x19984d(_0x572ae1['return']));},{'priority':'low'}),_0x374292['then'](()=>{_0x2912a2||_0x38c523('UsageLimit');});});function _0x33f0d2(){return'auto'==_0x2aca04['editing']['view']['_overlayModeHint'];}function _0x1f42e5(){_0x2aca04['editing']['view']['_overlayModeHint']='auto';}}function _0x1702f3(_0x2bfb12){const _0x171daa=[new window['Promise'](_0x4ac9bd=>setTimeout(_0x4ac9bd,0x93ecc)),_0x374292['then'](()=>new window['Promise'](_0x1c4c4d=>{let _0x386b81=0x0;_0x2aca04['model']['on']('applyOperation',(_0x582d3e,_0x1933c6)=>{_0x1933c6[0x0]['isDocumentOperation']&&_0x386b81++,0x5e8==_0x386b81&&(_0x1c4c4d(),_0x582d3e['off']());});}))];return window['Promise']['race'](_0x171daa)['then'](()=>_0x2bfb12);}async function _0x3d2c19(){await _0x374292,_0x2aca04['model']['change']=_0x5ceb88,_0x2aca04['model']['enqueueChange']=_0x5ceb88,_0x2aca04['enableReadOnlyMode']('model');}function _0x54642f(){return window['glob']&&window['glob']['triliumVersion'];}function _0x1de40b(_0x124dca){const _0x46f24e=_0x37e869();_0x2aca04[_0x46f24e]='tableOfContentsLicenseKey'+_0x124dca,'Valid'!=_0x124dca&&_0x3d2c19();}function _0x37e869(){const _0x45142d=window['String'](window['performance']['now']())['replace']('.','');let _0x17ad76='m';for(let _0x2e24df=0x0;_0x2e24df<_0x45142d['length'];_0x2e24df+=0x2){let _0x50e926=window['parseInt'](_0x45142d['substring'](_0x2e24df,_0x2e24df+0x2));_0x50e926>=0x3e&&(_0x50e926-=0x3e),_0x17ad76+=_0x5272e3[_0x50e926];}return _0x17ad76;}function _0x423998(){const _0x500743=_0x275e42['split']('.');if(0x3!=_0x500743['length'])return null;return _0x289abc(_0x500743[0x1]);function _0x289abc(_0x38afd6){const _0x3cea68=_0x349ac9(_0x38afd6);return _0x3cea68&&_0x2db631()?_0x3cea68:null;function _0x2db631(){const _0x275ee6=_0x3cea68['jti'],_0x3215c6=window['parseInt'](_0x275ee6['substring'](_0x275ee6['length']-0x8),0x10),_0xf6fa54={..._0x3cea68,'jti':_0x275ee6['substring'](0x0,_0x275ee6['length']-0x8)};return delete _0xf6fa54['vc'],_0x2c4e7e(_0xf6fa54)==_0x3215c6;}}}async function _0x4150d3(){let _0x3e7746=!0x0;try{const [_0x40460,_0x3386db,_0x527504]=_0x275e42['split']('.');return _0x2b0540(_0x40460),await _0x4156ae(_0x40460,_0x3386db,_0x527504),_0x3e7746;}catch{return!0x1;}function _0x2b0540(_0x44c074){const _0xea2eac=_0x349ac9(_0x44c074);_0xea2eac&&'ES256'==_0xea2eac['alg']||(_0x3e7746=!0x1);}async function _0x4156ae(_0x1e1488,_0x4db5bf,_0x466aac){const _0x50ab5e=window['Uint8Array']['from'](_0x39d016(_0x466aac),_0x130cda=>_0x130cda['charCodeAt'](0x0)),_0x2dedb2=new window['TextEncoder']()['encode'](_0x1e1488+'.'+_0x4db5bf),_0x2c8e79=window['crypto']['subtle'];if(!_0x2c8e79)return;const _0xea13bc=await _0x2c8e79['importKey']('jwk',_0x20b942,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2c8e79['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0xea13bc,_0x50ab5e,_0x2dedb2)||(_0x3e7746=!0x1);}}function _0x349ac9(_0x2f3fb4){return _0x2f3fb4['startsWith']('ey')?JSON['parse'](_0x39d016(_0x2f3fb4)):null;}function _0x39d016(_0x1cb20a){return window['atob'](_0x1cb20a['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x2c4e7e(_0x18587b){let _0x462cab=0x1505;function _0x323dbb(_0x39489f){for(let _0x5a7c14=0x0;_0x5a7c14<_0x39489f['length'];_0x5a7c14++){const _0x2fd942=_0x39489f['charCodeAt'](_0x5a7c14);_0x462cab=(_0x462cab<<0x5)+_0x462cab+_0x2fd942,_0x462cab&=_0x462cab;}}function _0x2d02d3(_0x5e38c1){Array['isArray'](_0x5e38c1)?_0x5e38c1['forEach'](_0x2d02d3):_0x5e38c1&&'object'==typeof _0x5e38c1?Object['entries'](_0x5e38c1)['sort']()['forEach'](([_0x57592a,_0x2ba8c1])=>{_0x323dbb(_0x57592a),_0x2d02d3(_0x2ba8c1);}):_0x323dbb(window['String'](_0x5e38c1));}return _0x2d02d3(_0x18587b),_0x462cab>>>0x0;}function _0x1be3a5(_0xacaf0c){return _0xacaf0c['toString'](0x10)['padStart'](0x8,'0');}function _0x3e413c(_0x22e36a){return _0x22e36a['split']('')['reverse']()['join']('');}function _0x5ceb88(){}_0x1de40b(await _0x46bd66());}(this);}_updateTableOfContentsElements(){this['_tableOfContentsElements']['forEach'](_0x58db4a=>{'$graveyard'!==_0x58db4a['rootName']&&this['editor']['editing']['reconvertItem'](_0x58db4a);});}_trackNewToCElements(){for(const _0x7592c4 of this['editor']['model']['document']['differ']['getChanges']({'includeChangesInGraveyard':!0x0})){if('insert'!==_0x7592c4['type']||'tableOfContents'!==_0x7592c4['name'])return;this['_tableOfContentsElements']['add'](_0x7592c4['position']['nodeAfter']);}}_getOutlineDefinitions(_0x123d00){const _0x56ffef=this['editor'],_0x61969b=[];for(const _0xf0baae of _0x56ffef['model']['document']['getRootNames']())_0x22dbd8(_0x56ffef['model']['document']['getRoot'](_0xf0baae));function _0x22dbd8(_0x226099){for(const _0x2c7edf of _0x226099['getChildren']())_0x2c7edf['is']('element')&&(_0x123d00['includes'](_0x2c7edf['name'])&&_0x61969b['push']({'level':_0x123d00['indexOf'](_0x2c7edf['name'])+0x1,'text':b(_0x2c7edf),'modelElement':_0x2c7edf}),_0x22dbd8(_0x2c7edf));}return _0x61969b;}['_defineSchema'](){this['editor']['model']['schema']['register']('tableOfContents',{'inheritAllFrom':'$blockObject'});}_defineConverters(){const _0x57374e=this['editor']['conversion'];_0x57374e['for']('upcast')['elementToElement']({'model':'tableOfContents','view':{'name':'div','classes':'table-of-contents'}}),_0x57374e['for']('dataDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x21f455,{writer:_0x5e96ff})=>this['_createTableOfContents'](_0x5e96ff,!0x0)}),_0x57374e['for']('editingDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x206f7f,{writer:_0x9b9b84})=>(this['_tableOfContentsElements']['add'](_0x206f7f),_0xcdc0a1(this['_createTableOfContents'](_0x9b9b84),_0x9b9b84,{'label':L(this['editor']['locale'],'Table\x20of\x20contents')}))}),this['editor']['data']['registerRawContentMatcher']({'name':'div','classes':'table-of-contents'}),this['editor']['editing']['mapper']['on']('viewToModelPosition',this['_redirectMapper'](),{'priority':'high'});}_createTableOfContents(_0x2cd3dc,_0x461547=!0x1){const {locale:_0x6e0fa2}=this['editor'],_0x32def9=_0x2cd3dc['createContainerElement']('div',{'class':'table-of-contents'+(0x0===this['_currentOutlineDefinitions']['length']?'\x20table-of-contents_empty':''),...!_0x461547&&{'data-table-of-contents-label':L(_0x6e0fa2,'Table\x20of\x20contents')}});0x0===this['_currentOutlineDefinitions']['length']&&!0x1===_0x461547&&_0x2cd3dc['insert'](_0x2cd3dc['createPositionAt'](_0x32def9,'end'),_0x2cd3dc['createContainerElement']('p',{'class':'table-of-contents__placeholder'},[_0x2cd3dc['createText'](L(_0x6e0fa2,'No\x20headings\x20were\x20found\x20in\x20the\x20document.'))]));const _0x146944=_0x461547?'':'['+L(_0x6e0fa2,'Empty\x20heading')+']';let _0x3cec00=_0x32def9;return this['_currentOutlineDefinitions']['forEach']((_0x60487f,_0x13a54c,_0x5d3cea)=>{const _0x302697=this['editor']['model']['hasContent'](_0x60487f['modelElement'],{'ignoreWhitespaces':!0x0}),_0x13ab6e=_0x302697?_0x60487f['text']:_0x146944,_0x23571e=_0x60487f['modelElement']['getAttribute'](this['_headingIdModelAttributeName']),_0x5c31ea=_0x2cd3dc['createContainerElement']('a',{'href':'#'+_0x23571e,...!_0x461547&&{'tabindex':'-1'}},[_0x2cd3dc['createText'](_0x13ab6e)]),_0x79d6d2=this['editor']['config']['get']('documentOutline.showEmptyHeadings');_0x2cd3dc['setCustomProperty']('tableOfContentsHeadingIndex',_0x13a54c,_0x5c31ea);const _0x41ec50=_0x2cd3dc['createContainerElement']('li',null,[_0x302697||!_0x461547&&_0x79d6d2?_0x5c31ea:_0x2cd3dc['createText']('')]),_0x3d77d8=_0x13a54c?_0x5d3cea[_0x13a54c-0x1]['level']:0x0,_0x5c6718=Math['abs'](_0x60487f['level']-_0x3d77d8);if(_0x60487f['level']>_0x3d77d8){const _0x3cde67=H(_0x41ec50,_0x5c6718,_0x2cd3dc);_0x2cd3dc['insert'](_0x2cd3dc['createPositionAt'](_0x3cec00,'end'),_0x3cde67);}else{const _0x310380=function(_0x117d9a,_0x14de63){return _0x117d9a['getAncestors']({'includeSelf':!0x0,'parentFirst':!0x0})['filter'](_0x32fb25=>_0x32fb25['is']('element','ol'))[_0x14de63];}(_0x3cec00,_0x5c6718);_0x2cd3dc['insert'](_0x2cd3dc['createPositionAt'](_0x310380,'end'),_0x41ec50);}_0x3cec00=_0x41ec50;}),_0x32def9;}['_handleScrollToHeading'](_0x168fc9){const _0x28ef20=this['_currentOutlineDefinitions'][_0x168fc9]['modelElement'];this['editor']['model']['change'](_0x1b21cb=>{_0x1b21cb['setSelection'](_0x28ef20,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0});}_redirectMapper(){return(_0x10ff9f,_0x42bfb9)=>{const _0x34bd8c=_0x42bfb9['mapper'],_0x4ef94b=_0x34bd8c['findMappedViewAncestor'](_0x42bfb9['viewPosition']),_0x585ca0=_0x34bd8c['toModelElement'](_0x4ef94b);_0x585ca0['is']('element','tableOfContents')&&(_0x42bfb9['modelPosition']=this['editor']['model']['createPositionAt'](_0x585ca0,0x0),_0x10ff9f['stop']());};}};function H(_0x205e19,_0x26233d,_0x4d28a9){return 0x1===_0x26233d?_0x4d28a9['createContainerElement']('ol',null,[_0x205e19]):_0x4d28a9['createContainerElement']('ol',null,[_0x4d28a9['createContainerElement']('li',null,[H(_0x205e19,_0x26233d-0x1,_0x4d28a9)])]);}var P=class extends _0xf39157{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'TableOfContentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x571572=this['editor'];_0x571572['ui']['componentFactory']['add']('tableOfContents',()=>{const _0x4d92e7=this['_createButton'](_0x6cdfc7);return _0x4d92e7['tooltip']=!0x0,_0x4d92e7;}),_0x571572['ui']['componentFactory']['add']('menuBar:tableOfContents',()=>this['_createButton'](_0x2b33b0)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x990bff=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x648b84;for(const _0x127c16 in _0x990bff){const _0x2bcf3a=_0x127c16,_0x79aec5=_0x990bff[_0x2bcf3a];if('tableOfContentsLicenseKeyValid'==_0x79aec5||'tableOfContentsLicenseKeyInvalid'==_0x79aec5||'tableOfContentsLicenseKeyExpired'==_0x79aec5||'tableOfContentsLicenseKeyDomainLimit'==_0x79aec5||'tableOfContentsLicenseKeyNotAllowed'==_0x79aec5||'tableOfContentsLicenseKeyEvaluationLimit'==_0x79aec5||'tableOfContentsLicenseKeyUsageLimit'==_0x79aec5){delete _0x990bff[_0x2bcf3a],_0x648b84=_0x79aec5,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'tableOfContentsLicenseKeyInvalid'==_0x648b84&&_0x990bff['_showLicenseError']('invalid'),'tableOfContentsLicenseKeyExpired'==_0x648b84&&_0x990bff['_showLicenseError']('expired'),'tableOfContentsLicenseKeyDomainLimit'==_0x648b84&&_0x990bff['_showLicenseError']('domainLimit'),'tableOfContentsLicenseKeyNotAllowed'==_0x648b84&&_0x990bff['_showLicenseError']('featureNotAllowed','TableOfContents'),'tableOfContentsLicenseKeyEvaluationLimit'==_0x648b84&&_0x990bff['_showLicenseError']('evaluationLimit'),'tableOfContentsLicenseKeyUsageLimit'==_0x648b84&&_0x990bff['_showLicenseError']('usageLimit');},0x3e8);}_createButton(_0xf12ccf){const _0x3e253a=this['editor'],_0x6c3afb=_0x3e253a['locale'],_0x5e3a73=_0x3e253a['commands']['get']('insertTableOfContents'),_0x4b04cc=new _0xf12ccf(_0x6c3afb);return _0x4b04cc['set']({'label':L(_0x6c3afb,'Table\x20of\x20contents'),'icon':_0x147e6d}),_0x4b04cc['bind']('isEnabled')['to'](_0x5e3a73,'isEnabled'),this['listenTo'](_0x4b04cc,'execute',()=>{_0x3e253a['execute']('insertTableOfContents'),_0x3e253a['editing']['view']['focus']();}),_0x4b04cc;}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},U=class extends _0xf39157{static get requires(){return[N,P];}static get['pluginName'](){return'TableOfContents';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{E as DocumentOutline,x as DocumentOutlineUI,I as DocumentOutlineUtils,A as HeadingId,U as TableOfContents,K as TableOfContentsCommand,N as TableOfContentsEditing,P as TableOfContentsUI};
|
|
23
|
+
import{Command as _0x4212ad,Plugin as _0x46849d}from'@ckeditor/ckeditor5-core';import{debounce as _0x8cfe28,throttle as _0xb00966}from'es-toolkit/compat';import{ModelText as _0x3991b8,ModelTreeWalker as _0x14b713}from'@ckeditor/ckeditor5-engine';import{CKEditorError as _0x1ef8f0,Rect as _0x3cdf13,diff as _0x4d7bca,diffToChanges as _0x2d6124,global as _0x17ceae,priorities as _0x3e5f03,scrollAncestorsToShowTarget as _0x377a0c,uid as _0x4825ff}from'@ckeditor/ckeditor5-utils';import{ButtonView as _0x42782b,MenuBarMenuListItemButtonView as _0x2a8364,View as _0x2669a2}from'@ckeditor/ckeditor5-ui';import{Widget as _0x52e186,toWidget as _0x5c6364}from'@ckeditor/ckeditor5-widget';import{IconTableOfContents as _0x2c0899}from'@ckeditor/ckeditor5-icons';function b(_0x2e1d59){let _0x1acf03='';for(const _0x403a46 of _0x2e1d59['getChildren']())_0x403a46 instanceof _0x3991b8&&(_0x1acf03+=_0x403a46['data']);return _0x1acf03;}var I=class extends _0x46849d{static get['pluginName'](){return'DocumentOutlineUtils';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['_headingNames']=[];init(){const _0xf6cf98=this['editor'];this['_headingNames']=this['_getHeadingNames']();let _0x365617=[];_0xf6cf98['model']['document']['on']('change',_0x8cfe28(()=>{const _0x3292bf=_0x365617;_0x365617=this['_getOutlineDefinitions']();const _0x496d74=_0x2d6124(_0x4d7bca(_0x3292bf,_0x365617,(_0x3f79a2,_0x3d6379)=>_0x3f79a2['level']===_0x3d6379['level']&&_0x3f79a2['text']===_0x3d6379['text']&&_0x3f79a2['modelElement']===_0x3d6379['modelElement']),_0x365617),_0x5ba848=this['_getActiveHeading'](),_0x16b1c4=_0x365617['findIndex'](_0x4d820f=>_0x4d820f['modelElement']===_0x5ba848);_0x496d74['length']&&this['fire']('change',{'outlineDefinitions':_0x365617,'activeItemIndex':_0x16b1c4,'outlineChanges':_0x496d74}),this['fire']('activeItemIndex',{'index':_0x16b1c4});},0xfa,{'leading':!0x0,'trailing':!0x0}));}afterInit(){this['_headingNames']['length']||this['_deriveHeadingElementsFromConversion']();}_getOutlineDefinitions(){const _0x53c4cf=this['editor'],_0x573708=[],_0x212279=this['_headingNames'];for(const _0x45d6cc of _0x53c4cf['model']['document']['getRootNames']())_0x1c4edf(_0x53c4cf['model']['document']['getRoot'](_0x45d6cc));function _0x1c4edf(_0xf3513a){for(const _0x413e4b of _0xf3513a['getChildren']())_0x413e4b['is']('element')&&(_0x212279['includes'](_0x413e4b['name'])&&_0x573708['push']({'level':_0x212279['indexOf'](_0x413e4b['name'])+0x1,'text':b(_0x413e4b),'modelElement':_0x413e4b}),_0x1c4edf(_0x413e4b));}return _0x573708;}_getActiveHeading(){const _0x2ce4a9=new _0x14b713({'direction':'backward','startPosition':this['editor']['model']['document']['selection']['getFirstPosition']()});for(const _0x3c62c7 of _0x2ce4a9)if(_0x3c62c7['item']['is']('element')&&this['_headingNames']['includes'](_0x3c62c7['item']['name']))return _0x3c62c7['item'];}_getHeadingNames(){const _0x12f6bf=this['editor']['config']['get']('documentOutline.headings');return _0x12f6bf||function(_0x2abf9e){const _0x74a33=_0x2abf9e['config']['get']('heading.options');return _0x74a33?_0x74a33['reduce']((_0xd78954,_0x33625c)=>('paragraph'!==_0x33625c['model']&&_0xd78954['push'](_0x33625c['model']),_0xd78954),[]):_0x2abf9e['plugins']['has']('GeneralHtmlSupport')?['htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']:[];}(this['editor']);}_deriveHeadingElementsFromConversion(){const _0x4e4486=this['editor'],_0x37de77=['h1','h2','h3','h4','h5','h6'],_0x195755=[];for(const _0x25dbed of _0x37de77){const _0xcb0c7e=_0x4e4486['editing']['view']['domConverter']['domToView'](document['createElement'](_0x25dbed)),_0x1b8244=_0x4e4486['data']['toModel'](_0xcb0c7e)['getChild'](0x0);_0x1b8244?.['is']('element')&&_0x195755['push'](_0x1b8244['name']);}this['_headingNames']=_0x195755;}};function L(_0x5b2f96,_0x1b42eb){const t=_0x5b2f96['t'];switch(_0x1b42eb){case'Empty\x20heading':return t('Empty\x20heading');case'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.':return t('Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.');case'No\x20headings\x20were\x20found\x20in\x20the\x20document.':return t('No\x20headings\x20were\x20found\x20in\x20the\x20document.');case'Table\x20of\x20contents':return t('Table\x20of\x20contents');default:return _0x1b42eb;}}var C=class extends _0x2669a2{constructor(_0x15aefc,_0x49f714=!0x1){super(_0x15aefc);const _0x82d358=this['bindTemplate'],_0x37494b=_0x49f714?'['+L(_0x15aefc,'Empty\x20heading')+']':'';this['set']('text',''),this['set']('level',0x1),this['set']('isActive',!0x1),this['bind']('isEmpty')['to'](this,'text',_0xacd2c0=>!_0xacd2c0),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline__item',_0x82d358['to']('level',_0x8833bb=>'ck-document-outline__item_level-'+_0x8833bb),_0x82d358['if']('isActive','ck-document-outline__item_active'),_0x82d358['if']('isEmpty','ck-document-outline__item_empty')],'title':_0x82d358['to']('text')},'children':[{'text':_0x82d358['to']('text',_0x3460e7=>_0x3460e7||_0x37494b)}],'on':{'click':_0x82d358['to']('click')}});}},_=class extends _0x2669a2{items;documentOutlineContainer;showEmptyHeadingText;constructor(_0x18b9af,_0x3cbf76=!0x1,_0x30f503){super(_0x18b9af),this['showEmptyHeadingText']=_0x3cbf76,this['set']('activeItemIndex',-0x1),this['documentOutlineContainer']=_0x30f503,this['items']=this['createCollection'](),this['items']['delegate']('click')['to'](this),this['on']('click',this['_handleItemClick']['bind'](this)),this['on']('change:activeItemIndex',(_0x3b8b79,_0x1fda4e,_0x29fe82,_0x787a17)=>{this['_setActiveItem'](_0x787a17,_0x29fe82);}),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset','ck-document-outline'],'dir':_0x18b9af['contentLanguageDirection'],'data-document-outline-empty-placeholder':L(_0x18b9af,'Editor\x20headings\x20will\x20appear\x20here\x20as\x20you\x20type.'),'tabindex':-0x1},'children':this['items']});}['sync'](_0x529ce5){_0x529ce5['forEach'](_0x5d8326=>{'insert'==_0x5d8326['type']?this['_insertItem'](_0x5d8326['index'],..._0x5d8326['values']):'delete'==_0x5d8326['type']&&this['_deleteItem'](_0x5d8326['index'],_0x5d8326['howMany']);});}_setActiveItem(_0x3f4303,_0x2a9564){if(-0x1!==_0x3f4303){const _0x1f4726=this['items']['get'](_0x3f4303);_0x1f4726&&(_0x1f4726['isActive']=!0x1);}-0x1!==_0x2a9564&&(this['items']['get'](_0x2a9564)['isActive']=!0x0,this['_scrollToItem'](_0x2a9564));}_insertItem(_0x5a70b6,..._0x54e5b6){const _0x477f7e=_0x54e5b6['map']((_0x22e0a4,_0x842861)=>{const _0xcf507a=new C(this['locale'],this['showEmptyHeadingText']);return _0xcf507a['text']=_0x22e0a4['text'],_0xcf507a['level']=_0x22e0a4['level'],_0x5a70b6+_0x842861===this['activeItemIndex']&&(_0xcf507a['isActive']=!0x0),_0xcf507a;});this['items']['addMany'](_0x477f7e,_0x5a70b6);}_deleteItem(_0x2652db,_0x37bb9d){do{this['items']['remove'](_0x2652db);}while(--_0x37bb9d);}_handleItemClick(_0x27fd22){const _0x57aa11=this['items']['getIndex'](_0x27fd22['source']);this['fire']('itemSelected',_0x57aa11);}_scrollToItem(_0x5f06cc){_0x377a0c(this['items']['get'](_0x5f06cc)['element'],0x14,this['documentOutlineContainer']);}destroy(){super['destroy'](),this['element']['remove']();}},x=class extends _0x46849d{['view'];_currentOutlineDefinitions;_updateActiveDefinitionFromViewportThrottled;static get['pluginName'](){return'DocumentOutlineUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3ee6c7){super(_0x3ee6c7),this['view']=new _(_0x3ee6c7['locale'],this['editor']['config']['get']('documentOutline.showEmptyHeadings'),this['editor']['config']['get']('documentOutline.container')),this['_currentOutlineDefinitions']=[],this['_updateActiveDefinitionFromViewportThrottled']=_0xb00966(this['_updateActiveDefinitionOnViewportChange']['bind'](this),0x64);}init(){const _0x2f7d36=this['editor'],_0x5787d7=_0x2f7d36['plugins']['get']('DocumentOutlineUtils');let _0xde28d3=!0x1;if(this['view']['render'](),this['editor']['ui']['focusTracker']['add'](this['view']['element']),!_0x2f7d36['config']['get']('documentOutline.container'))throw new _0x1ef8f0('document-outline-container-not-provided',{'editor':_0x2f7d36});_0x2f7d36['config']['get']('documentOutline.container')['appendChild'](this['view']['element']),_0x5787d7['on']('change',this['_handleOutlineChange']['bind'](this)),_0x5787d7['on']('activeItemIndex',(_0x1b928f,{index:_0x48a7b4})=>this['_setActiveViewItem'](_0x48a7b4)),this['view']['on']('itemSelected',(_0x2da188,_0x20b0ad)=>{_0xde28d3=!0x0,this['_handleItemSelected'](_0x20b0ad);}),this['view']['listenTo'](_0x17ceae['document'],'scroll',()=>{_0xde28d3?_0xde28d3=!0x1:this['_updateActiveDefinitionFromViewportThrottled']();},{'useCapture':!0x0}),this['view']['listenTo'](_0x17ceae['window'],'resize',this['_updateActiveDefinitionFromViewportThrottled'],{'useCapture':!0x0});}afterInit(){!async function(_0x3011ca){const _0x402008='aWxlPG0A3CDdHBsZEqwULojOrgMXVTRvu1bI2487ptzJKQeihfNkYS9n6y5mcF',_0x1882ce=0x79188,_0xd1a166=window['Date']['now'](),_0x5bc08f=_0x3011ca['editor'],_0x4a5127=new window['Promise'](_0x881652=>{_0x5bc08f['once']('ready',_0x881652);}),_0x4713f3={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x3ae4ee=_0x5bc08f['config']['get']('licenseKey');async function _0x169183(){let _0x1778d1,_0x416424=null,_0x27af45=null;try{return'GPL'==_0x3ae4ee?'NotAllowed':(_0x1778d1=_0x383064(),_0x1778d1?(_0x1778d1['usageEndpoint']&&(_0x27af45=_0x5e93d5(_0x1778d1['usageEndpoint'],_0x1778d1['jti'])),await _0x68b081()?_0x27c5e8()?_0x2f0ec0()?'Expired':_0x3bc9db()?('evaluation'==_0x1778d1['licenseType']&&(_0x416424=_0x197b4f('EvaluationLimit')),await _0x3cc37c()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2f0ec0(){const _0x36e25b=['evaluation','trial']['includes'](_0x1778d1['licenseType'])?_0xd1a166/0x3e8:0xe10*_0x1882ce;return _0x1778d1['exp']<_0x36e25b;}function _0x27c5e8(){const _0x39f427=_0x1778d1['features'];return!!_0x39f427&&(!!_0x39f427['includes']('*')||(!!_0x39f427['includes']('DO')||(!!_0x39f427['includes']('PP')||!(!_0x39f427['includes']('TRILIUM')||!_0x6a3253()))));}function _0x3bc9db(){const _0x93ea6e=_0x1778d1['licensedHosts'];if(!_0x93ea6e||0x0==_0x93ea6e['length'])return!0x0;const {hostname:_0x1dcdf4}=new URL(window['location']['href']);if(_0x93ea6e['includes'](_0x1dcdf4))return!0x0;const _0x287e7c=_0x1dcdf4['split']('.');return _0x93ea6e['filter'](_0x1ce5fd=>_0x1ce5fd['includes']('*'))['map'](_0xf10204=>_0xf10204['split']('.'))['filter'](_0x62eb39=>_0x62eb39['length']<=_0x287e7c['length'])['map'](_0x3ab2bc=>Array(_0x287e7c['length']-_0x3ab2bc['length'])['fill']('*'===_0x3ab2bc[0x0]?'*':'')['concat'](_0x3ab2bc))['some'](_0x3b6ee0=>_0x287e7c['every']((_0x4b149a,_0x2e55cf)=>_0x3b6ee0[_0x2e55cf]===_0x4b149a||'*'===_0x3b6ee0[_0x2e55cf]));}function _0x3cc37c(){return _0x416424&&_0x27af45?new window['Promise']((_0x1e4e9c,_0x4d5dfa)=>{_0x416424['then'](_0x1e4e9c,_0x4d5dfa),_0x27af45['then'](_0x111049=>{'Valid'!=_0x111049&&_0x1e4e9c(_0x111049);},_0x4d5dfa);}):_0x416424||_0x27af45||'Valid';}}function _0x5e93d5(_0x53973b,_0x3b0963){return new window['Promise'](_0x5f1e9e=>{if(_0x23c1e5())return _0x5f1e9e('Valid');_0x4c0bb0(),_0x5bc08f['decorate']('_sendUsageRequest');let _0x46d472=!0x1;const _0x4d5e83=_0x4825ff();function _0x1384e2(_0x25b92e){return!!_0x25b92e&&('object'==typeof _0x25b92e||'function'==typeof _0x25b92e)&&'function'==typeof _0x25b92e['then']&&'function'==typeof _0x25b92e['catch'];}function _0x37ca48(_0x579f45){_0x30d1f5(_0x579f45)['then'](_0x179109=>_0x179109&&'ok'==_0x179109['status']?_0x1fc046(_0x9c8835(_0x4d5e83+_0x3b0963))!=_0x179109['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x2705b3=>(_0x30c7d1(),_0x2705b3),()=>{const _0x175ea3=_0x5e5def();return null==_0x175ea3?(_0x30c7d1(),'Valid'):_0xd1a166-_0x175ea3>0x240c8400?'UsageLimit':'Valid';})['then'](_0x5f1e9e)['catch'](()=>{_0x5f1e9e('UsageLimit');});const _0x366723=0x36ee80;function _0x30c7d1(){const _0xd90491='llct-'+_0x1fc046(_0x9c8835(_0x53973b)),_0x52148e=_0x5a251e(_0x1fc046(window['Math']['ceil'](_0xd1a166/_0x366723)));window['localStorage']['setItem'](_0xd90491,_0x52148e);}function _0x5e5def(){const _0x19890f='llct-'+_0x1fc046(_0x9c8835(_0x53973b)),_0x242b28=window['localStorage']['getItem'](_0x19890f);return _0x242b28?window['parseInt'](_0x5a251e(_0x242b28),0x10)*_0x366723:null;}function _0x30d1f5(_0x46dc8){return new window['Promise']((_0xc64714,_0x156291)=>{_0x46dc8['then'](_0xc64714,_0x156291),window['setTimeout'](_0x156291,0x1d4c0);});}}_0x5bc08f['on']('_sendUsageRequest',(_0x551fcd,_0x39ee44)=>{if(_0x39ee44[0x0]!=_0x53973b)return _0x5f1e9e('UsageLimit');_0x39ee44[0x1]={..._0x39ee44[0x1],'requestId':_0x4d5e83};},{'priority':'high'}),_0x5bc08f['on']('_sendUsageRequest',_0x2e7a95=>{_0x1384e2(_0x2e7a95['return'])&&(_0x46d472=!0x0,_0x37ca48(_0x2e7a95['return']));},{'priority':'low'}),_0x4a5127['then'](()=>{_0x46d472||_0x5f1e9e('UsageLimit');});});function _0x23c1e5(){return'auto'==_0x5bc08f['editing']['view']['_overlayModeHint'];}function _0x4c0bb0(){_0x5bc08f['editing']['view']['_overlayModeHint']='auto';}}function _0x197b4f(_0x5c961e){const _0x432495=[new window['Promise'](_0x597717=>setTimeout(_0x597717,0x93ecc)),_0x4a5127['then'](()=>new window['Promise'](_0x3eb5cb=>{let _0xac9e5f=0x0;_0x5bc08f['model']['on']('applyOperation',(_0x57b850,_0x45c844)=>{_0x45c844[0x0]['isDocumentOperation']&&_0xac9e5f++,0x5e8==_0xac9e5f&&(_0x3eb5cb(),_0x57b850['off']());});}))];return window['Promise']['race'](_0x432495)['then'](()=>_0x5c961e);}async function _0x58af72(){await _0x4a5127,_0x5bc08f['model']['change']=_0x1eb08a,_0x5bc08f['model']['enqueueChange']=_0x1eb08a,_0x5bc08f['enableReadOnlyMode']('model');}function _0x6a3253(){return window['glob']&&window['glob']['triliumVersion'];}function _0x2026e2(_0x3c0018){const _0x21d71c=_0x538e79();_0x5bc08f[_0x21d71c]='documentOutlineLicenseKey'+_0x3c0018,'Valid'!=_0x3c0018&&_0x58af72();}function _0x538e79(){const _0x200d66=window['String'](window['performance']['now']())['replace']('.','');let _0x3ea296='a';for(let _0x1d3fdf=0x0;_0x1d3fdf<_0x200d66['length'];_0x1d3fdf+=0x2){let _0x54c889=window['parseInt'](_0x200d66['substring'](_0x1d3fdf,_0x1d3fdf+0x2));_0x54c889>=0x3e&&(_0x54c889-=0x3e),_0x3ea296+=_0x402008[_0x54c889];}return _0x3ea296;}function _0x383064(){const _0x2df15b=_0x3ae4ee['split']('.');if(0x3!=_0x2df15b['length'])return null;return _0x499d7e(_0x2df15b[0x1]);function _0x499d7e(_0x2ebf17){const _0x274d83=_0x1d52ca(_0x2ebf17);return _0x274d83&&_0x284f23()?_0x274d83:null;function _0x284f23(){const _0x18fab5=_0x274d83['jti'],_0x2d571=window['parseInt'](_0x18fab5['substring'](_0x18fab5['length']-0x8),0x10),_0x37c8a7={..._0x274d83,'jti':_0x18fab5['substring'](0x0,_0x18fab5['length']-0x8)};return delete _0x37c8a7['vc'],_0x9c8835(_0x37c8a7)==_0x2d571;}}}async function _0x68b081(){let _0x141a7c=!0x0;try{const [_0x3d935b,_0x419a9e,_0x410c0c]=_0x3ae4ee['split']('.');return _0x412e0a(_0x3d935b),await _0x4072f1(_0x3d935b,_0x419a9e,_0x410c0c),_0x141a7c;}catch{return!0x1;}function _0x412e0a(_0x29c7e7){const _0x55f328=_0x1d52ca(_0x29c7e7);_0x55f328&&'ES256'==_0x55f328['alg']||(_0x141a7c=!0x1);}async function _0x4072f1(_0x2cc14b,_0x1748ae,_0xfbe014){const _0x48a676=window['Uint8Array']['from'](_0x2f667d(_0xfbe014),_0x3cddf7=>_0x3cddf7['charCodeAt'](0x0)),_0x57450d=new window['TextEncoder']()['encode'](_0x2cc14b+'.'+_0x1748ae),_0x3bfb84=window['crypto']['subtle'];if(!_0x3bfb84)return;const _0x18ef41=await _0x3bfb84['importKey']('jwk',_0x4713f3,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x3bfb84['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x18ef41,_0x48a676,_0x57450d)||(_0x141a7c=!0x1);}}function _0x1d52ca(_0x294419){return _0x294419['startsWith']('ey')?JSON['parse'](_0x2f667d(_0x294419)):null;}function _0x2f667d(_0xafd2b9){return window['atob'](_0xafd2b9['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x9c8835(_0x3cac32){let _0x3b93d2=0x1505;function _0x47afe6(_0x5e2a71){for(let _0x1c0e4e=0x0;_0x1c0e4e<_0x5e2a71['length'];_0x1c0e4e++){const _0x13b82c=_0x5e2a71['charCodeAt'](_0x1c0e4e);_0x3b93d2=(_0x3b93d2<<0x5)+_0x3b93d2+_0x13b82c,_0x3b93d2&=_0x3b93d2;}}function _0x53bcd2(_0x18b528){Array['isArray'](_0x18b528)?_0x18b528['forEach'](_0x53bcd2):_0x18b528&&'object'==typeof _0x18b528?Object['entries'](_0x18b528)['sort']()['forEach'](([_0x195aeb,_0x89b1d8])=>{_0x47afe6(_0x195aeb),_0x53bcd2(_0x89b1d8);}):_0x47afe6(window['String'](_0x18b528));}return _0x53bcd2(_0x3cac32),_0x3b93d2>>>0x0;}function _0x1fc046(_0x3fbf27){return _0x3fbf27['toString'](0x10)['padStart'](0x8,'0');}function _0x5a251e(_0x598c45){return _0x598c45['split']('')['reverse']()['join']('');}function _0x1eb08a(){}_0x2026e2(await _0x169183());}(this);}destroy(){super['destroy'](),this['view']['destroy'](),this['_updateActiveDefinitionFromViewportThrottled']['cancel']();}_handleOutlineChange(_0x57fca1,{outlineDefinitions:_0x1817db,outlineChanges:_0x528a5c}){this['_currentOutlineDefinitions']=_0x1817db,this['view']['sync'](_0x528a5c);}_setActiveViewItem(_0x58ea96){this['_currentOutlineDefinitions']['length']&&this['_currentOutlineDefinitions'][_0x58ea96]&&(this['view']['activeItemIndex']=_0x58ea96);}_handleItemSelected(_0x556ee1){const _0x542791=this['_currentOutlineDefinitions'][_0x556ee1]['modelElement'];this['editor']['model']['change'](_0x185f97=>{_0x185f97['setSelection'](_0x542791,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0}),this['editor']['editing']['view']['focus'](),this['_setActiveViewItem'](_0x556ee1);}_updateActiveDefinitionOnViewportChange(){const _0x27a154=this['editor'];let _0x1417bc;for(const _0x5c484e of _0x27a154['model']['document']['getRootNames']()){const _0x325f6b=_0x27a154['editing']['view']['getDomRoot'](_0x5c484e),_0x4e35bf=_0x325f6b&&new _0x3cdf13(_0x325f6b)['getVisible']();if(_0x4e35bf){const _0x42eb75=new _0x3cdf13(_0x17ceae['window'])['getIntersection'](_0x4e35bf);_0x42eb75&&(_0x1417bc=_0x42eb75['top']+0.25*_0x42eb75['height']);}}if(void 0x0===_0x1417bc)return;const _0x3a1fa6=k(_0x27a154['editing'],this['_currentOutlineDefinitions'],_0x1417bc);_0x3a1fa6?this['_setActiveViewItem'](this['_currentOutlineDefinitions']['indexOf'](_0x3a1fa6)):this['_setActiveViewItem'](-0x1);}};function k(_0x3da674,_0x59b50f,_0x36c47e,_0x5d05cd=0x0,_0x2dc204=_0x59b50f['length']-0x1){const _0x4fdba8=Math['floor'](_0x5d05cd+(_0x2dc204-_0x5d05cd)/0x2);if(_0x2dc204>=_0x5d05cd){const _0x368d44=_0x59b50f[_0x4fdba8],_0x349157=_0x3da674['mapper']['toViewElement'](_0x368d44['modelElement']);return _0x349157?new _0x3cdf13(_0x3da674['view']['domConverter']['mapViewToDom'](_0x349157))['bottom']>_0x36c47e?k(_0x3da674,_0x59b50f,_0x36c47e,_0x5d05cd,_0x4fdba8-0x1):k(_0x3da674,_0x59b50f,_0x36c47e,_0x4fdba8+0x1,_0x2dc204):null;}return _0x4fdba8<0x0?null:_0x59b50f[_0x4fdba8];}var E=class extends _0x46849d{['licenseKey'];_licenseKeyCheckInterval;static get requires(){return[I,x];}static get['pluginName'](){return'DocumentOutline';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x370aa7=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x10fc91;for(const _0x3a98f1 in _0x370aa7){const _0x5de1d2=_0x3a98f1,_0x133c3c=_0x370aa7[_0x5de1d2];if('documentOutlineLicenseKeyValid'==_0x133c3c||'documentOutlineLicenseKeyInvalid'==_0x133c3c||'documentOutlineLicenseKeyExpired'==_0x133c3c||'documentOutlineLicenseKeyDomainLimit'==_0x133c3c||'documentOutlineLicenseKeyNotAllowed'==_0x133c3c||'documentOutlineLicenseKeyEvaluationLimit'==_0x133c3c||'documentOutlineLicenseKeyUsageLimit'==_0x133c3c){delete _0x370aa7[_0x5de1d2],_0x10fc91=_0x133c3c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'documentOutlineLicenseKeyInvalid'==_0x10fc91&&_0x370aa7['_showLicenseError']('invalid'),'documentOutlineLicenseKeyExpired'==_0x10fc91&&_0x370aa7['_showLicenseError']('expired'),'documentOutlineLicenseKeyDomainLimit'==_0x10fc91&&_0x370aa7['_showLicenseError']('domainLimit'),'documentOutlineLicenseKeyNotAllowed'==_0x10fc91&&_0x370aa7['_showLicenseError']('featureNotAllowed','DocumentOutline'),'documentOutlineLicenseKeyEvaluationLimit'==_0x10fc91&&_0x370aa7['_showLicenseError']('evaluationLimit'),'documentOutlineLicenseKeyUsageLimit'==_0x10fc91&&_0x370aa7['_showLicenseError']('usageLimit');},0x3e8);}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},K=class extends _0x4212ad{execute(){this['editor']['model']['change'](_0x278964=>{this['editor']['model']['insertObject'](_0x278964['createElement']('tableOfContents'));});}['refresh'](){const _0x59fabb=this['editor']['model'],_0x49ee1b=_0x59fabb['document']['selection']['getFirstPosition']();this['isEnabled']=null!==(_0x49ee1b&&_0x59fabb['schema']['findAllowedParent'](_0x49ee1b,'tableOfContents'));}},A=class extends _0x46849d{static get['pluginName'](){return'HeadingId';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}afterInit(){const _0x182cfa=this['editor'];if(_0x182cfa['config']['get']('headingId.modelAttributeName'))return;const {viewNames:_0x4d90a6,modelNames:_0x43cbd6}=function(_0x253072){const _0x25f041=new Set(['h1','h2','h3','h4','h5','h6']),_0x5a1720=new Set(['heading1','heading2','heading3','heading4','heading5','heading6','htmlH1','htmlH2','htmlH3','htmlH4','htmlH5','htmlH6']);if(!_0x253072)return{'viewNames':_0x25f041,'modelNames':_0x5a1720};for(const _0x4ad5af of _0x253072){if('paragraph'===_0x4ad5af['model'])continue;const _0x2e2819='string'==typeof _0x4ad5af['view']?_0x4ad5af['view']:_0x4ad5af['view']['name'];_0x25f041['add'](_0x2e2819),_0x5a1720['add'](_0x4ad5af['model']);}return{'viewNames':_0x25f041,'modelNames':_0x5a1720};}(this['editor']['config']['get']('heading.options'));for(const _0x58ff2c of _0x4d90a6)this['_customUpcastHeadingsConversion'](_0x58ff2c);for(const _0x152343 of _0x43cbd6)this['_customDataDowncastHeadingsConversion'](_0x152343),_0x182cfa['model']['schema']['isRegistered'](_0x152343)&&_0x182cfa['model']['schema']['extend'](_0x152343,{'allowAttributes':'headingId'});this['_registerHeadingIdAttributePostfixer'](_0x43cbd6);}_customUpcastHeadingsConversion(_0x5ea984){this['editor']['conversion']['for']('upcast')['add'](_0x2fd8e0=>_0x2fd8e0['on']('element:'+_0x5ea984,(_0x6421fe,_0x34363a,_0x398d21)=>{const {consumable:_0x37a47e,writer:_0x4e9404}=_0x398d21,_0x1208a7=_0x34363a['viewItem']['getAttribute']('id'),_0x26dea0=_0x34363a['modelRange']?.['getContainedElement']();if(_0x26dea0)return _0x1208a7&&_0x1208a7['length']||_0x26dea0['hasAttribute']('headingId')?void(_0x37a47e['consume'](_0x34363a['viewItem'],{'attributes':['id']})&&_0x4e9404['setAttribute']('headingId',_0x1208a7,_0x26dea0)):(_0x37a47e['consume'](_0x34363a['viewItem'],{'attributes':['id']}),void _0x4e9404['setAttribute']('headingId',_0x4825ff(),_0x26dea0));},{'priority':_0x3e5f03['get']('low')+0.5}));}_customDataDowncastHeadingsConversion(_0x26b882){this['editor']['conversion']['for']('downcast')['add'](_0xa444e5=>_0xa444e5['on']('attribute:headingId:'+_0x26b882,(_0x49f0a9,_0x20e559,_0x126fb3)=>{if(!_0x126fb3['consumable']['consume'](_0x20e559['item'],_0x49f0a9['name']))return;const _0x49e0c4=_0x20e559['item']['getAttribute']('headingId'),_0x4c949c=_0x126fb3['mapper']['toViewElement'](_0x20e559['item']);_0x126fb3['writer']['setAttribute']('id',_0x49e0c4,_0x4c949c);}));}_registerHeadingIdAttributePostfixer(_0xd14d37){const _0x2237c0=this['editor'],_0x195ace=new Set(),_0x1724ca=new Set();function _0x1f7a8a(_0x278bbb,_0x4f5e8a){const _0x133062=_0x4825ff();return _0x1724ca['add'](_0x133062),_0x278bbb['setAttribute']('headingId',_0x133062,_0x4f5e8a),_0x133062;}function _0xa51f08(_0x49001f,_0x15c14a){_0x49001f['removeAttribute']('headingId',_0x15c14a);}_0x2237c0['model']['document']['registerPostFixer'](_0xd0ac51=>{const _0x541ac9=_0x2237c0['model']['document']['differ']['getChanges']();let _0x599807=!0x1;for(const _0x3ad94e of _0x541ac9)if('insert'==_0x3ad94e['type']&&_0x3ad94e['name']){if(_0xd14d37['has'](_0x3ad94e['name'])){const _0x4ecdc9=_0x3ad94e['attributes']['get']('headingId');'string'==typeof _0x4ecdc9?_0x195ace['has'](_0x4ecdc9)?(_0x1f7a8a(_0xd0ac51,_0x3ad94e['position']['nodeAfter']),_0x599807=!0x0):_0x1724ca['add'](_0x4ecdc9):(_0x1f7a8a(_0xd0ac51,_0x3ad94e['position']['nodeAfter']),_0x599807=!0x0);}else'string'==typeof _0x3ad94e['attributes']['get']('headingId')&&(_0xa51f08(_0xd0ac51,_0x3ad94e['position']['nodeAfter']),_0x599807=!0x0);}else{if('remove'==_0x3ad94e['type']){const _0x202834=_0x3ad94e['attributes']['get']('headingId');'string'==typeof _0x202834&&_0x195ace['delete'](_0x202834);}}return _0x599807;}),_0x2237c0['model']['document']['on']('change',()=>{_0x1724ca['forEach'](_0x1d89e3=>_0x195ace['add'](_0x1d89e3)),_0x1724ca['clear']();});}},N=class extends _0x46849d{static get['pluginName'](){return'TableOfContentsEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[_0x52e186,I,A];}_currentOutlineDefinitions;_tableOfContentsElements;_headingIdModelAttributeName;constructor(_0x663a8f){super(_0x663a8f),this['_currentOutlineDefinitions']=[],this['_tableOfContentsElements']=new Set(),this['_headingIdModelAttributeName']='headingId';}init(){const _0xaf046=this['editor'],_0x113335=_0xaf046['editing']['view']['document'];_0xaf046['config']['get']('headingId.modelAttributeName')&&(this['_headingIdModelAttributeName']=_0xaf046['config']['get']('headingId.modelAttributeName')),this['listenTo'](_0x113335,'click',(_0x4e201a,_0x1ee5d9)=>{if(!_0x1ee5d9['target'])return;const _0x4d23d1=_0x1ee5d9['target']['getCustomProperty']('tableOfContentsHeadingIndex');Number['isInteger'](_0x4d23d1)&&(_0x1ee5d9['domEvent']['preventDefault'](),_0x4e201a['stop'](),this['_handleScrollToHeading'](_0x4d23d1));},{'priority':'high','context':'$capture'}),this['_defineSchema'](),this['_defineConverters'](),_0xaf046['commands']['add']('insertTableOfContents',new K(_0xaf046));const _0x325c2d=_0xaf046['config']['get']('tableOfContents.headings');_0x325c2d&&_0x325c2d['length']?this['listenTo'](_0xaf046['model']['document'],'change:data',()=>{this['_currentOutlineDefinitions']=this['_getOutlineDefinitions'](_0x325c2d),this['_updateTableOfContentsElements']();}):_0xaf046['plugins']['get']('DocumentOutlineUtils')['on']('change',(_0x2ece3d,_0x2babde)=>{this['_currentOutlineDefinitions']=_0x2babde['outlineDefinitions'],this['_updateTableOfContentsElements']();}),this['listenTo'](_0xaf046['model']['document'],'change',()=>{this['_trackNewToCElements']();});}afterInit(){!async function(_0x1645ac){const _0x291d8b='mr4z2yakM3x0phtD7jBw1T6qRfeUuZcOLNKVgQSPE9iGIHoXlJW8YsCb5AndFv',_0x388abb=0x79188,_0x28ebcc=window['Date']['now'](),_0xda90dd=_0x1645ac['editor'],_0x3eda98=new window['Promise'](_0xe8f98e=>{_0xda90dd['once']('ready',_0xe8f98e);}),_0x1667c4={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x193e31=_0xda90dd['config']['get']('licenseKey');async function _0x53403d(){let _0xdbb6c4,_0x521740=null,_0x49c15a=null;try{return'GPL'==_0x193e31?'NotAllowed':(_0xdbb6c4=_0x3b4b87(),_0xdbb6c4?(_0xdbb6c4['usageEndpoint']&&(_0x49c15a=_0xd94442(_0xdbb6c4['usageEndpoint'],_0xdbb6c4['jti'])),await _0x41649a()?_0x573ddd()?_0x3d08a3()?'Expired':_0x39b0ca()?('evaluation'==_0xdbb6c4['licenseType']&&(_0x521740=_0x574759('EvaluationLimit')),await _0x366d86()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3d08a3(){const _0x5b0998=['evaluation','trial']['includes'](_0xdbb6c4['licenseType'])?_0x28ebcc/0x3e8:0xe10*_0x388abb;return _0xdbb6c4['exp']<_0x5b0998;}function _0x573ddd(){const _0x4f35bd=_0xdbb6c4['features'];return!!_0x4f35bd&&(!!_0x4f35bd['includes']('*')||(!!_0x4f35bd['includes']('TOC')||(!!_0x4f35bd['includes']('PP')||!(!_0x4f35bd['includes']('TRILIUM')||!_0x5eadcc()))));}function _0x39b0ca(){const _0x13dfbd=_0xdbb6c4['licensedHosts'];if(!_0x13dfbd||0x0==_0x13dfbd['length'])return!0x0;const {hostname:_0x1afed3}=new URL(window['location']['href']);if(_0x13dfbd['includes'](_0x1afed3))return!0x0;const _0x2cfd83=_0x1afed3['split']('.');return _0x13dfbd['filter'](_0x1fc022=>_0x1fc022['includes']('*'))['map'](_0x33cfa2=>_0x33cfa2['split']('.'))['filter'](_0x3d0cab=>_0x3d0cab['length']<=_0x2cfd83['length'])['map'](_0x14b7bf=>Array(_0x2cfd83['length']-_0x14b7bf['length'])['fill']('*'===_0x14b7bf[0x0]?'*':'')['concat'](_0x14b7bf))['some'](_0x5a92e1=>_0x2cfd83['every']((_0x1e132d,_0x219f45)=>_0x5a92e1[_0x219f45]===_0x1e132d||'*'===_0x5a92e1[_0x219f45]));}function _0x366d86(){return _0x521740&&_0x49c15a?new window['Promise']((_0x347b7e,_0x5b4f04)=>{_0x521740['then'](_0x347b7e,_0x5b4f04),_0x49c15a['then'](_0x2f37cc=>{'Valid'!=_0x2f37cc&&_0x347b7e(_0x2f37cc);},_0x5b4f04);}):_0x521740||_0x49c15a||'Valid';}}function _0xd94442(_0x53963a,_0x84e785){return new window['Promise'](_0x403cdf=>{if(_0x2d098e())return _0x403cdf('Valid');_0x25542f(),_0xda90dd['decorate']('_sendUsageRequest');let _0x297b7e=!0x1;const _0x34cc38=_0x4825ff();function _0x6292bc(_0x1e7d70){return!!_0x1e7d70&&('object'==typeof _0x1e7d70||'function'==typeof _0x1e7d70)&&'function'==typeof _0x1e7d70['then']&&'function'==typeof _0x1e7d70['catch'];}function _0x15ab73(_0x22b1cc){_0x3dd461(_0x22b1cc)['then'](_0x181e4c=>_0x181e4c&&'ok'==_0x181e4c['status']?_0x4fd09d(_0x5af10a(_0x34cc38+_0x84e785))!=_0x181e4c['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x4a4728=>(_0x305ff4(),_0x4a4728),()=>{const _0x42d72b=_0x5a7751();return null==_0x42d72b?(_0x305ff4(),'Valid'):_0x28ebcc-_0x42d72b>0x240c8400?'UsageLimit':'Valid';})['then'](_0x403cdf)['catch'](()=>{_0x403cdf('UsageLimit');});const _0x2e647f=0x36ee80;function _0x305ff4(){const _0x1872af='llct-'+_0x4fd09d(_0x5af10a(_0x53963a)),_0x30dab1=_0x23943b(_0x4fd09d(window['Math']['ceil'](_0x28ebcc/_0x2e647f)));window['localStorage']['setItem'](_0x1872af,_0x30dab1);}function _0x5a7751(){const _0x5b21e3='llct-'+_0x4fd09d(_0x5af10a(_0x53963a)),_0x45b814=window['localStorage']['getItem'](_0x5b21e3);return _0x45b814?window['parseInt'](_0x23943b(_0x45b814),0x10)*_0x2e647f:null;}function _0x3dd461(_0xad31b7){return new window['Promise']((_0x4b5b68,_0x43c3e9)=>{_0xad31b7['then'](_0x4b5b68,_0x43c3e9),window['setTimeout'](_0x43c3e9,0x1d4c0);});}}_0xda90dd['on']('_sendUsageRequest',(_0x4f5c17,_0x5087cd)=>{if(_0x5087cd[0x0]!=_0x53963a)return _0x403cdf('UsageLimit');_0x5087cd[0x1]={..._0x5087cd[0x1],'requestId':_0x34cc38};},{'priority':'high'}),_0xda90dd['on']('_sendUsageRequest',_0x3b9c7e=>{_0x6292bc(_0x3b9c7e['return'])&&(_0x297b7e=!0x0,_0x15ab73(_0x3b9c7e['return']));},{'priority':'low'}),_0x3eda98['then'](()=>{_0x297b7e||_0x403cdf('UsageLimit');});});function _0x2d098e(){return'auto'==_0xda90dd['editing']['view']['_overlayModeHint'];}function _0x25542f(){_0xda90dd['editing']['view']['_overlayModeHint']='auto';}}function _0x574759(_0x318c19){const _0x226ca1=[new window['Promise'](_0x5a8cdb=>setTimeout(_0x5a8cdb,0x93ecc)),_0x3eda98['then'](()=>new window['Promise'](_0x1fd370=>{let _0x259f5c=0x0;_0xda90dd['model']['on']('applyOperation',(_0x139fa7,_0x35df02)=>{_0x35df02[0x0]['isDocumentOperation']&&_0x259f5c++,0x5e8==_0x259f5c&&(_0x1fd370(),_0x139fa7['off']());});}))];return window['Promise']['race'](_0x226ca1)['then'](()=>_0x318c19);}async function _0x2a25e4(){await _0x3eda98,_0xda90dd['model']['change']=_0x2aad25,_0xda90dd['model']['enqueueChange']=_0x2aad25,_0xda90dd['enableReadOnlyMode']('model');}function _0x5eadcc(){return window['glob']&&window['glob']['triliumVersion'];}function _0x393087(_0x54e4ef){const _0x2c4722=_0x4bb753();_0xda90dd[_0x2c4722]='tableOfContentsLicenseKey'+_0x54e4ef,'Valid'!=_0x54e4ef&&_0x2a25e4();}function _0x4bb753(){const _0x5e2b70=window['String'](window['performance']['now']())['replace']('.','');let _0x53f22f='m';for(let _0xa38c31=0x0;_0xa38c31<_0x5e2b70['length'];_0xa38c31+=0x2){let _0x2e7238=window['parseInt'](_0x5e2b70['substring'](_0xa38c31,_0xa38c31+0x2));_0x2e7238>=0x3e&&(_0x2e7238-=0x3e),_0x53f22f+=_0x291d8b[_0x2e7238];}return _0x53f22f;}function _0x3b4b87(){const _0x866e5=_0x193e31['split']('.');if(0x3!=_0x866e5['length'])return null;return _0x9f8476(_0x866e5[0x1]);function _0x9f8476(_0x2807f2){const _0x140911=_0x4da445(_0x2807f2);return _0x140911&&_0x2c4ccd()?_0x140911:null;function _0x2c4ccd(){const _0x27427c=_0x140911['jti'],_0x135574=window['parseInt'](_0x27427c['substring'](_0x27427c['length']-0x8),0x10),_0x649d10={..._0x140911,'jti':_0x27427c['substring'](0x0,_0x27427c['length']-0x8)};return delete _0x649d10['vc'],_0x5af10a(_0x649d10)==_0x135574;}}}async function _0x41649a(){let _0xe59886=!0x0;try{const [_0x31145a,_0x6d33eb,_0x4977a1]=_0x193e31['split']('.');return _0x2d8c20(_0x31145a),await _0x3e5611(_0x31145a,_0x6d33eb,_0x4977a1),_0xe59886;}catch{return!0x1;}function _0x2d8c20(_0x56a147){const _0x2d1f3e=_0x4da445(_0x56a147);_0x2d1f3e&&'ES256'==_0x2d1f3e['alg']||(_0xe59886=!0x1);}async function _0x3e5611(_0x3b5ab3,_0x3105c3,_0xc92d8f){const _0x19efb3=window['Uint8Array']['from'](_0x5909dc(_0xc92d8f),_0x5e9c7e=>_0x5e9c7e['charCodeAt'](0x0)),_0x5f349a=new window['TextEncoder']()['encode'](_0x3b5ab3+'.'+_0x3105c3),_0x4772f6=window['crypto']['subtle'];if(!_0x4772f6)return;const _0x4fe6b0=await _0x4772f6['importKey']('jwk',_0x1667c4,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x4772f6['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x4fe6b0,_0x19efb3,_0x5f349a)||(_0xe59886=!0x1);}}function _0x4da445(_0x2ed9a5){return _0x2ed9a5['startsWith']('ey')?JSON['parse'](_0x5909dc(_0x2ed9a5)):null;}function _0x5909dc(_0x49b181){return window['atob'](_0x49b181['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5af10a(_0x39a5a8){let _0x274db9=0x1505;function _0xbc6a4b(_0xdc8dc3){for(let _0x27e8b5=0x0;_0x27e8b5<_0xdc8dc3['length'];_0x27e8b5++){const _0x414890=_0xdc8dc3['charCodeAt'](_0x27e8b5);_0x274db9=(_0x274db9<<0x5)+_0x274db9+_0x414890,_0x274db9&=_0x274db9;}}function _0x3bc3e3(_0x3e8430){Array['isArray'](_0x3e8430)?_0x3e8430['forEach'](_0x3bc3e3):_0x3e8430&&'object'==typeof _0x3e8430?Object['entries'](_0x3e8430)['sort']()['forEach'](([_0x4ec193,_0x9b5d54])=>{_0xbc6a4b(_0x4ec193),_0x3bc3e3(_0x9b5d54);}):_0xbc6a4b(window['String'](_0x3e8430));}return _0x3bc3e3(_0x39a5a8),_0x274db9>>>0x0;}function _0x4fd09d(_0x3c4ad5){return _0x3c4ad5['toString'](0x10)['padStart'](0x8,'0');}function _0x23943b(_0x507f21){return _0x507f21['split']('')['reverse']()['join']('');}function _0x2aad25(){}_0x393087(await _0x53403d());}(this);}_updateTableOfContentsElements(){this['_tableOfContentsElements']['forEach'](_0x5cc55e=>{'$graveyard'!==_0x5cc55e['rootName']&&this['editor']['editing']['reconvertItem'](_0x5cc55e);});}_trackNewToCElements(){for(const _0x6ed749 of this['editor']['model']['document']['differ']['getChanges']({'includeChangesInGraveyard':!0x0})){if('insert'!==_0x6ed749['type']||'tableOfContents'!==_0x6ed749['name'])return;this['_tableOfContentsElements']['add'](_0x6ed749['position']['nodeAfter']);}}_getOutlineDefinitions(_0x280f96){const _0x29288c=this['editor'],_0x1d4ee5=[];for(const _0x184d92 of _0x29288c['model']['document']['getRootNames']())_0x29cb78(_0x29288c['model']['document']['getRoot'](_0x184d92));function _0x29cb78(_0xa6bda){for(const _0x3cf563 of _0xa6bda['getChildren']())_0x3cf563['is']('element')&&(_0x280f96['includes'](_0x3cf563['name'])&&_0x1d4ee5['push']({'level':_0x280f96['indexOf'](_0x3cf563['name'])+0x1,'text':b(_0x3cf563),'modelElement':_0x3cf563}),_0x29cb78(_0x3cf563));}return _0x1d4ee5;}['_defineSchema'](){this['editor']['model']['schema']['register']('tableOfContents',{'inheritAllFrom':'$blockObject'});}_defineConverters(){const _0x2882a2=this['editor']['conversion'];_0x2882a2['for']('upcast')['elementToElement']({'model':'tableOfContents','view':{'name':'div','classes':'table-of-contents'}}),_0x2882a2['for']('dataDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x5283ef,{writer:_0x2e9345})=>this['_createTableOfContents'](_0x2e9345,!0x0)}),_0x2882a2['for']('editingDowncast')['elementToStructure']({'model':'tableOfContents','view':(_0x4f3e06,{writer:_0x540d00})=>(this['_tableOfContentsElements']['add'](_0x4f3e06),_0x5c6364(this['_createTableOfContents'](_0x540d00),_0x540d00,{'label':L(this['editor']['locale'],'Table\x20of\x20contents')}))}),this['editor']['data']['registerRawContentMatcher']({'name':'div','classes':'table-of-contents'}),this['editor']['editing']['mapper']['on']('viewToModelPosition',this['_redirectMapper'](),{'priority':'high'});}_createTableOfContents(_0xe3969b,_0x4aec53=!0x1){const {locale:_0x5e95c0}=this['editor'],_0x370e3f=_0xe3969b['createContainerElement']('div',{'class':'table-of-contents'+(0x0===this['_currentOutlineDefinitions']['length']?'\x20table-of-contents_empty':''),...!_0x4aec53&&{'data-table-of-contents-label':L(_0x5e95c0,'Table\x20of\x20contents')}});0x0===this['_currentOutlineDefinitions']['length']&&!0x1===_0x4aec53&&_0xe3969b['insert'](_0xe3969b['createPositionAt'](_0x370e3f,'end'),_0xe3969b['createContainerElement']('p',{'class':'table-of-contents__placeholder'},[_0xe3969b['createText'](L(_0x5e95c0,'No\x20headings\x20were\x20found\x20in\x20the\x20document.'))]));const _0x1c5d8b=_0x4aec53?'':'['+L(_0x5e95c0,'Empty\x20heading')+']';let _0x97eb=_0x370e3f;return this['_currentOutlineDefinitions']['forEach']((_0x5b770f,_0xaf2d7c,_0x38e5a5)=>{const _0x2a5da8=this['editor']['model']['hasContent'](_0x5b770f['modelElement'],{'ignoreWhitespaces':!0x0}),_0x305fea=_0x2a5da8?_0x5b770f['text']:_0x1c5d8b,_0x320027=_0x5b770f['modelElement']['getAttribute'](this['_headingIdModelAttributeName']),_0x56dbd4=_0xe3969b['createContainerElement']('a',{'href':'#'+_0x320027,...!_0x4aec53&&{'tabindex':'-1'}},[_0xe3969b['createText'](_0x305fea)]),_0x23ac1d=this['editor']['config']['get']('documentOutline.showEmptyHeadings');_0xe3969b['setCustomProperty']('tableOfContentsHeadingIndex',_0xaf2d7c,_0x56dbd4);const _0x4e40d9=_0xe3969b['createContainerElement']('li',null,[_0x2a5da8||!_0x4aec53&&_0x23ac1d?_0x56dbd4:_0xe3969b['createText']('')]),_0x207131=_0xaf2d7c?_0x38e5a5[_0xaf2d7c-0x1]['level']:0x0,_0x59608c=Math['abs'](_0x5b770f['level']-_0x207131);if(_0x5b770f['level']>_0x207131){const _0x2ddc79=H(_0x4e40d9,_0x59608c,_0xe3969b);_0xe3969b['insert'](_0xe3969b['createPositionAt'](_0x97eb,'end'),_0x2ddc79);}else{const _0x437dc5=function(_0x4611a5,_0x196ab2){return _0x4611a5['getAncestors']({'includeSelf':!0x0,'parentFirst':!0x0})['filter'](_0x32aa0d=>_0x32aa0d['is']('element','ol'))[_0x196ab2];}(_0x97eb,_0x59608c);_0xe3969b['insert'](_0xe3969b['createPositionAt'](_0x437dc5,'end'),_0x4e40d9);}_0x97eb=_0x4e40d9;}),_0x370e3f;}['_handleScrollToHeading'](_0x4b1b23){const _0x2d7b90=this['_currentOutlineDefinitions'][_0x4b1b23]['modelElement'];this['editor']['model']['change'](_0x57a155=>{_0x57a155['setSelection'](_0x2d7b90,0x0);}),this['editor']['editing']['view']['scrollToTheSelection']({'alignToTop':!0x0,'forceScroll':!0x0});}_redirectMapper(){return(_0x439779,_0x221663)=>{const _0x334a2e=_0x221663['mapper'],_0x271166=_0x334a2e['findMappedViewAncestor'](_0x221663['viewPosition']),_0x167169=_0x334a2e['toModelElement'](_0x271166);_0x167169['is']('element','tableOfContents')&&(_0x221663['modelPosition']=this['editor']['model']['createPositionAt'](_0x167169,0x0),_0x439779['stop']());};}};function H(_0x59d670,_0x2395f9,_0x48ac42){return 0x1===_0x2395f9?_0x48ac42['createContainerElement']('ol',null,[_0x59d670]):_0x48ac42['createContainerElement']('ol',null,[_0x48ac42['createContainerElement']('li',null,[H(_0x59d670,_0x2395f9-0x1,_0x48ac42)])]);}var P=class extends _0x46849d{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'TableOfContentsUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x2630ed=this['editor'];_0x2630ed['ui']['componentFactory']['add']('tableOfContents',()=>{const _0x1a24e8=this['_createButton'](_0x42782b);return _0x1a24e8['tooltip']=!0x0,_0x1a24e8;}),_0x2630ed['ui']['componentFactory']['add']('menuBar:tableOfContents',()=>this['_createButton'](_0x2a8364)),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2f11a0=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x225709;for(const _0x547cf2 in _0x2f11a0){const _0x1afde5=_0x547cf2,_0x48caac=_0x2f11a0[_0x1afde5];if('tableOfContentsLicenseKeyValid'==_0x48caac||'tableOfContentsLicenseKeyInvalid'==_0x48caac||'tableOfContentsLicenseKeyExpired'==_0x48caac||'tableOfContentsLicenseKeyDomainLimit'==_0x48caac||'tableOfContentsLicenseKeyNotAllowed'==_0x48caac||'tableOfContentsLicenseKeyEvaluationLimit'==_0x48caac||'tableOfContentsLicenseKeyUsageLimit'==_0x48caac){delete _0x2f11a0[_0x1afde5],_0x225709=_0x48caac,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'tableOfContentsLicenseKeyInvalid'==_0x225709&&_0x2f11a0['_showLicenseError']('invalid'),'tableOfContentsLicenseKeyExpired'==_0x225709&&_0x2f11a0['_showLicenseError']('expired'),'tableOfContentsLicenseKeyDomainLimit'==_0x225709&&_0x2f11a0['_showLicenseError']('domainLimit'),'tableOfContentsLicenseKeyNotAllowed'==_0x225709&&_0x2f11a0['_showLicenseError']('featureNotAllowed','TableOfContents'),'tableOfContentsLicenseKeyEvaluationLimit'==_0x225709&&_0x2f11a0['_showLicenseError']('evaluationLimit'),'tableOfContentsLicenseKeyUsageLimit'==_0x225709&&_0x2f11a0['_showLicenseError']('usageLimit');},0x3e8);}_createButton(_0x5ce0c6){const _0x23e27b=this['editor'],_0x2a2b25=_0x23e27b['locale'],_0x54814b=_0x23e27b['commands']['get']('insertTableOfContents'),_0xa0c3e6=new _0x5ce0c6(_0x2a2b25);return _0xa0c3e6['set']({'label':L(_0x2a2b25,'Table\x20of\x20contents'),'icon':_0x2c0899}),_0xa0c3e6['bind']('isEnabled')['to'](_0x54814b,'isEnabled'),this['listenTo'](_0xa0c3e6,'execute',()=>{_0x23e27b['execute']('insertTableOfContents'),_0x23e27b['editing']['view']['focus']();}),_0xa0c3e6;}destroy(){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}},U=class extends _0x46849d{static get requires(){return[N,P];}static get['pluginName'](){return'TableOfContents';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}};export{E as DocumentOutline,x as DocumentOutlineUI,I as DocumentOutlineUtils,A as HeadingId,U as TableOfContents,K as TableOfContentsCommand,N as TableOfContentsEditing,P as TableOfContentsUI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-document-outline",
|
|
3
|
-
"version": "48.4.0-alpha.
|
|
3
|
+
"version": "48.4.0-alpha.4",
|
|
4
4
|
"description": "Document outline feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"./package.json": "./package.json"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ckeditor/ckeditor5-core": "48.4.0-alpha.
|
|
25
|
-
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.
|
|
26
|
-
"@ckeditor/ckeditor5-heading": "48.4.0-alpha.
|
|
27
|
-
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-widget": "48.4.0-alpha.
|
|
24
|
+
"@ckeditor/ckeditor5-core": "48.4.0-alpha.4",
|
|
25
|
+
"@ckeditor/ckeditor5-engine": "48.4.0-alpha.4",
|
|
26
|
+
"@ckeditor/ckeditor5-heading": "48.4.0-alpha.4",
|
|
27
|
+
"@ckeditor/ckeditor5-icons": "48.4.0-alpha.4",
|
|
28
|
+
"@ckeditor/ckeditor5-ui": "48.4.0-alpha.4",
|
|
29
|
+
"@ckeditor/ckeditor5-utils": "48.4.0-alpha.4",
|
|
30
|
+
"@ckeditor/ckeditor5-widget": "48.4.0-alpha.4",
|
|
31
31
|
"es-toolkit": "1.45.1"
|
|
32
32
|
},
|
|
33
33
|
"files": [
|