@ckeditor/ckeditor5-export-word
Version:
Export to Word feature for CKEditor 5.
23 lines • 7.12 kB
JavaScript
/*
* 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 _0x229427=_0x2a04;(function(_0x52296f,_0x49ae25){const _0x5acd29=_0x2a04,_0x7d3068=_0x52296f();while(!![]){try{const _0x3bff6b=parseInt(_0x5acd29(0x20b))/0x1+-parseInt(_0x5acd29(0x230))/0x2+-parseInt(_0x5acd29(0x207))/0x3+-parseInt(_0x5acd29(0x242))/0x4+parseInt(_0x5acd29(0x1fa))/0x5*(parseInt(_0x5acd29(0x1fe))/0x6)+parseInt(_0x5acd29(0x223))/0x7*(parseInt(_0x5acd29(0x218))/0x8)+parseInt(_0x5acd29(0x215))/0x9*(-parseInt(_0x5acd29(0x243))/0xa);if(_0x3bff6b===_0x49ae25)break;else _0x7d3068['push'](_0x7d3068['shift']());}catch(_0x24b0e4){_0x7d3068['push'](_0x7d3068['shift']());}}}(_0x6aa9,0x9d39a));import{Command as _0x1ce6ff}from'ckeditor5/src/core.js';import{logWarning as _0x21bc48,collectStylesheets as _0x245fd3}from'ckeditor5/src/utils.js';import{getConverterOptions as _0x455c00,getConverterOptionsV2 as _0x437611}from'./utils.js';import{getTranslation as _0x49398e}from'./utils/common-translations.js';const p=[_0x229427(0x21e),_0x229427(0x22c),_0x229427(0x20e),_0x229427(0x239),_0x229427(0x23e),_0x229427(0x1fc),_0x229427(0x231),_0x229427(0x221),_0x229427(0x20d),_0x229427(0x20c)];function _0x2a04(_0xc34942,_0x287ea9){const _0x6aa98c=_0x6aa9();return _0x2a04=function(_0x2a048b,_0x5cd2ef){_0x2a048b=_0x2a048b-0x1f4;let _0x42c616=_0x6aa98c[_0x2a048b];return _0x42c616;},_0x2a04(_0xc34942,_0x287ea9);}function _0x6aa9(){const _0x38d3f0=['dataCallback','application/docx','affectsData','options','2973240JhqDXK','converterOptions','refresh','version','868393IuIeDE','suggestions','comments','margin_right','locale','stringify','get','pending','then','createElement','315891BcQrfM','ariaLiveAnnouncer','</div>','8hcybjQ','token','click','stylesheets','EDITOR_STYLES','fileName','orientation','<div\x20class=\x22ck-content\x22\x20dir=\x22','contentLanguageDirection','footer','finally','8586893PhRGKm','value','announce','Word\x20document\x20export\x20failed','application/json','export-word-v1-api-is-deprecated','An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.','POST','function','margin_top','https://docx-converter.cke-cs.com/v2/convert/html-docx','config','remove','946714HNxJbG','header','href','isEnabled','editor','catch','data','isBusy','status','margin_bottom','auto_pagination','createObjectURL','converterUrl','set','margin_left','execute','Word\x20document\x20export\x20successful','blob','3005140FNAUFm','10lozrdB','ExportWord','fetch','_downloadFile','URL','Word\x20document\x20export\x20started','assertive','https://docx-converter.cke-cs.com/v1/convert','5sUoOQy','download','format','Notification','4798338tSMGfs','plugins','showWarning','_token','document.docx'];_0x6aa9=function(){return _0x38d3f0;};return _0x6aa9();}export class ExportWordCommand extends _0x1ce6ff{constructor(_0x5325d1){const _0x5cbbd7=_0x229427;super(_0x5325d1),this[_0x5cbbd7(0x23d)](_0x5cbbd7(0x237),!0x1),this[_0x5cbbd7(0x205)]=!0x1;}[_0x229427(0x209)](){const _0x2b2267=_0x229427;this[_0x2b2267(0x233)]=!this[_0x2b2267(0x237)],this[_0x2b2267(0x224)]=this[_0x2b2267(0x237)]?_0x2b2267(0x212):void 0x0;}[_0x229427(0x23f)](_0x2ddca3={}){const _0x4bba06=_0x229427,_0x26b259=this[_0x4bba06(0x234)],_0x300671=_0x2ddca3[_0x4bba06(0x20a)]||0x2,_0x52ecba=0x1===_0x300671,_0x245aaf=_0x2ddca3[_0x4bba06(0x23c)]||(_0x52ecba?_0x4bba06(0x1f9):_0x4bba06(0x22d)),_0x278dbc=_0x2ddca3[_0x4bba06(0x208)]||{},_0x533035=_0x26b259[_0x4bba06(0x1ff)][_0x4bba06(0x211)](_0x4bba06(0x244)),_0x30b9fc=_0x2ddca3[_0x4bba06(0x219)]||_0x533035[_0x4bba06(0x201)],_0x2333a2=!0x0===_0x278dbc[_0x4bba06(0x23a)],_0x2ec2d0=_0x2ddca3[_0x4bba06(0x203)]||(_0x5d9cbd=>_0x5d9cbd[_0x4bba06(0x236)][_0x4bba06(0x211)]({'pagination':_0x2333a2}));return 0x2===_0x300671&&function(_0xac20ad){for(const _0x2bb33d of p)if(void 0x0!==_0xac20ad[_0x2bb33d])return!0x0;return!0x1;}(_0x278dbc)&&_0x21bc48(_0x4bba06(0x228)),this[_0x4bba06(0x237)]=!0x0,this[_0x4bba06(0x209)](),_0x245fd3(_0x2ddca3[_0x4bba06(0x21b)]||[_0x4bba06(0x21c)])[_0x4bba06(0x213)](async _0x3c892b=>{const _0x1c4bd4=_0x4bba06;_0x26b259['ui'][_0x1c4bd4(0x216)][_0x1c4bd4(0x225)](_0x49398e(_0x26b259[_0x1c4bd4(0x20f)],_0x1c4bd4(0x1f7)));const _0x314821=await _0x2ec2d0(_0x26b259),_0x23e304={'html':_0x1c4bd4(0x21f)+_0x26b259[_0x1c4bd4(0x20f)][_0x1c4bd4(0x220)]+'\x22>'+_0x314821+_0x1c4bd4(0x217),'css':_0x3c892b,[_0x52ecba?_0x1c4bd4(0x206):_0x1c4bd4(0x22e)]:{..._0x278dbc,..._0x52ecba?_0x455c00(_0x26b259,_0x278dbc):_0x437611(_0x26b259,_0x278dbc)}},_0x4f2965={'method':_0x1c4bd4(0x22a),'headers':{'Content-Type':_0x1c4bd4(0x227),'Accept':_0x1c4bd4(0x204),..._0x30b9fc?{'Authorization':_0x30b9fc[_0x1c4bd4(0x224)]}:null},'body':JSON[_0x1c4bd4(0x210)](_0x23e304)};return window[_0x1c4bd4(0x1f4)](_0x245aaf,_0x4f2965)[_0x1c4bd4(0x213)](_0xff220a=>{const _0x1afc15=_0x1c4bd4;if(0xc8!==_0xff220a[_0x1afc15(0x238)])throw _0xff220a;return _0xff220a[_0x1afc15(0x241)]();})[_0x1c4bd4(0x213)](_0xf7a6c6=>{const _0x3abc64=_0x1c4bd4;_0x26b259['ui'][_0x3abc64(0x216)][_0x3abc64(0x225)](_0x49398e(_0x26b259[_0x3abc64(0x20f)],_0x3abc64(0x240)));const _0x50fbb7=_0x3abc64(0x22b)==typeof _0x2ddca3[_0x3abc64(0x21d)]?_0x2ddca3[_0x3abc64(0x21d)]():_0x2ddca3[_0x3abc64(0x21d)];this[_0x3abc64(0x1f5)](_0xf7a6c6,_0x50fbb7||_0x3abc64(0x202));});})[_0x4bba06(0x235)](_0x5e9d19=>{const _0x4b0a65=_0x4bba06,_0xea6afb=_0x26b259[_0x4b0a65(0x1ff)][_0x4b0a65(0x211)](_0x4b0a65(0x1fd));throw _0x26b259['ui'][_0x4b0a65(0x216)][_0x4b0a65(0x225)](_0x49398e(_0x26b259[_0x4b0a65(0x20f)],_0x4b0a65(0x226)),{'politeness':_0x4b0a65(0x1f8)}),_0xea6afb[_0x4b0a65(0x200)](_0x49398e(_0x26b259[_0x4b0a65(0x20f)],_0x4b0a65(0x229))),_0x5e9d19;})[_0x4bba06(0x222)](()=>{const _0xdb4e6e=_0x4bba06;this[_0xdb4e6e(0x237)]=!0x1,this[_0xdb4e6e(0x209)]();});}[_0x229427(0x1f5)](_0x2dddbf,_0x13d309){const _0x512edf=_0x229427,_0xdff4e7=document[_0x512edf(0x214)]('a');_0xdff4e7[_0x512edf(0x232)]=window[_0x512edf(0x1f6)][_0x512edf(0x23b)](_0x2dddbf),_0xdff4e7[_0x512edf(0x1fb)]=_0x13d309,_0xdff4e7[_0x512edf(0x21a)](),_0xdff4e7[_0x512edf(0x22f)]();}}