UNPKG

@ckeditor/ckeditor5-export-word

Version:

Export to Word feature for CKEditor 5.

23 lines 7.07 kB
/* * Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved. * * * * * +---------------------------------------------------------------------------------+ * | | * | Hello stranger! | * | | * | | * | What you're currently looking at is the source code of a legally protected, | * | proprietary software. Any attempts to deobfuscate / disassemble this code | * | are forbidden and will result in legal consequences. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ const _0x49a001=_0xb11a;function _0xb11a(_0x53a1c5,_0xc894d8){const _0x945068=_0x9450();return _0xb11a=function(_0xb11aa7,_0x44f828){_0xb11aa7=_0xb11aa7-0x11f;let _0x2b774e=_0x945068[_0xb11aa7];return _0x2b774e;},_0xb11a(_0x53a1c5,_0xc894d8);}function _0x9450(){const _0x57572c=['status','Word\x20document\x20export\x20failed','stylesheets','version','pending','URL','12924bEMbAc','Word\x20document\x20export\x20successful','application/json','execute','href','margin_top','value','showWarning','1830540heAavA','isBusy','</div>','then','document.docx','fetch','announce','orientation','application/docx','format','48wuwukx','553514pDtlUh','fileName','suggestions','ariaLiveAnnouncer','download','function','assertive','isEnabled','locale','ExportWord','dataCallback','plugins','config','remove','margin_left','476VjZWNm','125515yNifSo','createObjectURL','footer','margin_right','Notification','affectsData','options','finally','Word\x20document\x20export\x20started','click','auto_pagination','https://docx-converter.cke-cs.com/v2/convert/html-docx','export-word-v1-api-is-deprecated','501452qbVCqJ','createElement','converterUrl','845628eSoNGE','252783eJAnmU','EDITOR_STYLES','catch','contentLanguageDirection','comments','_token','POST','_downloadFile','stringify','<div\x20class=\x22ck-content\x22\x20dir=\x22','https://docx-converter.cke-cs.com/v1/convert','get','margin_bottom','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.','token','blob','refresh','data','header','editor','converterOptions','set'];_0x9450=function(){return _0x57572c;};return _0x9450();}(function(_0x33f8cb,_0x1c7284){const _0x4998c9=_0xb11a,_0x227cdb=_0x33f8cb();while(!![]){try{const _0x33b3cc=parseInt(_0x4998c9(0x166))/0x1+parseInt(_0x4998c9(0x149))/0x2+parseInt(_0x4998c9(0x136))/0x3*(-parseInt(_0x4998c9(0x158))/0x4)+parseInt(_0x4998c9(0x159))/0x5+-parseInt(_0x4998c9(0x13e))/0x6+parseInt(_0x4998c9(0x169))/0x7+-parseInt(_0x4998c9(0x148))/0x8*(-parseInt(_0x4998c9(0x16a))/0x9);if(_0x33b3cc===_0x1c7284)break;else _0x227cdb['push'](_0x227cdb['shift']());}catch(_0x2da352){_0x227cdb['push'](_0x227cdb['shift']());}}}(_0x9450,0x431d0));import{Command as _0x427803}from'ckeditor5/src/core.js';import{logWarning as _0x57e99a,collectStylesheets as _0x1460ee}from'ckeditor5/src/utils.js';import{getConverterOptions as _0x4c28d4,getConverterOptionsV2 as _0x30155a}from'./utils.js';import{getTranslation as _0x10f6d5}from'./utils/common-translations.js';const p=[_0x49a001(0x145),_0x49a001(0x13b),_0x49a001(0x15c),_0x49a001(0x126),_0x49a001(0x157),_0x49a001(0x147),_0x49a001(0x12c),_0x49a001(0x15b),_0x49a001(0x16e),_0x49a001(0x14b)];export class ExportWordCommand extends _0x427803{constructor(_0x7d9afd){const _0x3edb61=_0x49a001;super(_0x7d9afd),this[_0x3edb61(0x12f)](_0x3edb61(0x13f),!0x1),this[_0x3edb61(0x15e)]=!0x1;}[_0x49a001(0x12a)](){const _0x164417=_0x49a001;this[_0x164417(0x150)]=!this[_0x164417(0x13f)],this[_0x164417(0x13c)]=this[_0x164417(0x13f)]?_0x164417(0x134):void 0x0;}[_0x49a001(0x139)](_0x29eb10={}){const _0x231bb3=_0x49a001,_0x429b35=this[_0x231bb3(0x12d)],_0x2b8489=_0x29eb10[_0x231bb3(0x133)]||0x2,_0x2673c5=0x1===_0x2b8489,_0x2c4fac=_0x29eb10[_0x231bb3(0x168)]||(_0x2673c5?_0x231bb3(0x124):_0x231bb3(0x164)),_0x38af07=_0x29eb10[_0x231bb3(0x12e)]||{},_0x251e27=_0x429b35[_0x231bb3(0x154)][_0x231bb3(0x125)](_0x231bb3(0x152)),_0x11cb6a=_0x29eb10[_0x231bb3(0x128)]||_0x251e27[_0x231bb3(0x11f)],_0xb2503c=!0x0===_0x38af07[_0x231bb3(0x163)],_0x130bb2=_0x29eb10[_0x231bb3(0x153)]||(_0x42c42f=>_0x42c42f[_0x231bb3(0x12b)][_0x231bb3(0x125)]({'pagination':_0xb2503c}));return 0x2===_0x2b8489&&function(_0x17d56a){for(const _0xf61895 of p)if(void 0x0!==_0x17d56a[_0xf61895])return!0x0;return!0x1;}(_0x38af07)&&_0x57e99a(_0x231bb3(0x165)),this[_0x231bb3(0x13f)]=!0x0,this[_0x231bb3(0x12a)](),_0x1460ee(_0x29eb10[_0x231bb3(0x132)]||[_0x231bb3(0x16b)])[_0x231bb3(0x141)](async _0x3b7d51=>{const _0x49234c=_0x231bb3;_0x429b35['ui'][_0x49234c(0x14c)][_0x49234c(0x144)](_0x10f6d5(_0x429b35[_0x49234c(0x151)],_0x49234c(0x161)));const _0x5da170=await _0x130bb2(_0x429b35),_0xaf8e32={'html':_0x49234c(0x123)+_0x429b35[_0x49234c(0x151)][_0x49234c(0x16d)]+'\x22>'+_0x5da170+_0x49234c(0x140),'css':_0x3b7d51,[_0x2673c5?_0x49234c(0x15f):_0x49234c(0x155)]:{..._0x38af07,..._0x2673c5?_0x4c28d4(_0x429b35,_0x38af07):_0x30155a(_0x429b35,_0x38af07)}},_0x40416c={'method':_0x49234c(0x120),'headers':{'Content-Type':_0x49234c(0x138),'Accept':_0x49234c(0x146),..._0x11cb6a?{'Authorization':_0x11cb6a[_0x49234c(0x13c)]}:null},'body':JSON[_0x49234c(0x122)](_0xaf8e32)};return window[_0x49234c(0x143)](_0x2c4fac,_0x40416c)[_0x49234c(0x141)](_0x3057b9=>{const _0x23e02f=_0x49234c;if(0xc8!==_0x3057b9[_0x23e02f(0x130)])throw _0x3057b9;return _0x3057b9[_0x23e02f(0x129)]();})[_0x49234c(0x141)](_0x242fdf=>{const _0x4fbf32=_0x49234c;_0x429b35['ui'][_0x4fbf32(0x14c)][_0x4fbf32(0x144)](_0x10f6d5(_0x429b35[_0x4fbf32(0x151)],_0x4fbf32(0x137)));const _0x407235=_0x4fbf32(0x14e)==typeof _0x29eb10[_0x4fbf32(0x14a)]?_0x29eb10[_0x4fbf32(0x14a)]():_0x29eb10[_0x4fbf32(0x14a)];this[_0x4fbf32(0x121)](_0x242fdf,_0x407235||_0x4fbf32(0x142));});})[_0x231bb3(0x16c)](_0x315008=>{const _0x492ce9=_0x231bb3,_0x523656=_0x429b35[_0x492ce9(0x154)][_0x492ce9(0x125)](_0x492ce9(0x15d));throw _0x429b35['ui'][_0x492ce9(0x14c)][_0x492ce9(0x144)](_0x10f6d5(_0x429b35[_0x492ce9(0x151)],_0x492ce9(0x131)),{'politeness':_0x492ce9(0x14f)}),_0x523656[_0x492ce9(0x13d)](_0x10f6d5(_0x429b35[_0x492ce9(0x151)],_0x492ce9(0x127))),_0x315008;})[_0x231bb3(0x160)](()=>{const _0x3b0081=_0x231bb3;this[_0x3b0081(0x13f)]=!0x1,this[_0x3b0081(0x12a)]();});}[_0x49a001(0x121)](_0x4f8398,_0x39b205){const _0x5b8ceb=_0x49a001,_0x1877da=document[_0x5b8ceb(0x167)]('a');_0x1877da[_0x5b8ceb(0x13a)]=window[_0x5b8ceb(0x135)][_0x5b8ceb(0x15a)](_0x4f8398),_0x1877da[_0x5b8ceb(0x14d)]=_0x39b205,_0x1877da[_0x5b8ceb(0x162)](),_0x1877da[_0x5b8ceb(0x156)]();}}