{"size": 3217, "ext": "js", "max_stars_repo_path": "node_modules/@ckeditor/ckeditor5-export-word/src/exportwordcommand.js", "max_stars_repo_name": "Sequesto/ckeditor5-custom-build", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "node_modules/@ckeditor/ckeditor5-export-word/src/exportwordcommand.js", "max_issues_repo_name": "Sequesto/ckeditor5-custom-build", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/@ckeditor/ckeditor5-export-word/src/exportwordcommand.js", "max_forks_repo_name": "Sequesto/ckeditor5-custom-build", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 139.8695652174, "max_line_length": 2037, "alphanum_fraction": 0.5383898042}
/*
 *             Copyright (c) 2016 - 2021, CKSource - Frederico Knabben. 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.              |
 *          |                                                                                 |
 *          |                                                                                 |
 *          +---------------------------------------------------------------------------------+
 *
 *
 *
 *
 */
import{Command as _0x1c738f}from'ckeditor5/src/core';import{getStyles as _0x5c7075,getConverterOptions as _0x23ac4a}from'./utils';export default class i extends _0x1c738f{constructor(_0x1f62fc){super(_0x1f62fc),this['set']('isBusy',!0x1),this['affectsData']=!0x1;}['refresh'](){this['isEnabled']=!this['isBusy'],this['value']=this['isBusy']?'pending':void 0x0;}['execute'](_0x194ca4={}){const _0x18dff6=this['editor'],t=_0x18dff6['t'],_0x37add2=_0x194ca4['converterUrl']||'https://docx-converter.cke-cs.com/v1/convert',_0x2e6bec=_0x194ca4['converterOptions']||{},_0x412947=_0x18dff6['plugins']['get']('ExportWord'),_0x15a1f7=_0x194ca4['token']||_0x412947['_token'],_0x5e8c8b=!0x1!==_0x2e6bec['auto_pagination'],_0x1a4b2b=_0x194ca4['dataCallback']||(_0x53015f=>_0x53015f['getData']({'pagination':_0x5e8c8b}));return this['isBusy']=!0x0,this['refresh'](),_0x5c7075(_0x194ca4['stylesheets']||['EDITOR_STYLES'])['then'](_0x5b76ab=>{const _0x55aec2=_0x1a4b2b(_0x18dff6),_0x5d6a7e={'html':'<div\x20class=\x22ck-content\x22\x20dir=\x22'+_0x18dff6['locale']['contentLanguageDirection']+'\x22>'+_0x55aec2+'</div>','css':_0x5b76ab,'options':{..._0x2e6bec,..._0x23ac4a(_0x18dff6)}},_0x5e86d0={'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/docx',..._0x15a1f7?{'Authorization':_0x15a1f7['value']}:null},'body':JSON['stringify'](_0x5d6a7e)};return window['fetch'](_0x37add2,_0x5e86d0)['then'](_0x1817d7=>{if(0xc8!==_0x1817d7['status'])throw _0x1817d7;return _0x1817d7['blob']();})['then'](_0x5b1820=>{this['o'](_0x5b1820,_0x194ca4['fileName']||'document.docx');});})['catch'](_0x18a824=>{throw _0x18dff6['plugins']['get']('Notification')['showWarning'](t('An\x20error\x20occurred\x20while\x20generating\x20the\x20Word\x20file.')),_0x18a824;})['finally'](()=>{this['isBusy']=!0x1,this['refresh']();});}['o'](_0x5954f9,_0x298f5a){const _0x4795be=document['createElement']('a');_0x4795be['href']=window['URL']['createObjectURL'](_0x5954f9),_0x4795be['download']=_0x298f5a,_0x4795be['click'](),_0x4795be['remove']();}}