UNPKG

@ckeditor/ckeditor5-export-pdf

Version:

Export to PDF feature for CKEditor 5.

23 lines • 8.15 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. | * | | * | | * +---------------------------------------------------------------------------------+ * * * * */ function _0x12a8(_0x35d729,_0x416d59){const _0x4e9d15=_0x4e9d();return _0x12a8=function(_0x12a8e9,_0x2f912f){_0x12a8e9=_0x12a8e9-0x17f;let _0x4e9eab=_0x4e9d15[_0x12a8e9];return _0x4e9eab;},_0x12a8(_0x35d729,_0x416d59);}const _0x4315fe=_0x12a8;(function(_0x4e4b8e,_0x444209){const _0x281fac=_0x12a8,_0x31800f=_0x4e4b8e();while(!![]){try{const _0x5386d3=parseInt(_0x281fac(0x1b8))/0x1*(parseInt(_0x281fac(0x1c3))/0x2)+parseInt(_0x281fac(0x180))/0x3*(parseInt(_0x281fac(0x1b7))/0x4)+parseInt(_0x281fac(0x1a6))/0x5+parseInt(_0x281fac(0x1c5))/0x6+parseInt(_0x281fac(0x1c2))/0x7+parseInt(_0x281fac(0x1aa))/0x8*(parseInt(_0x281fac(0x1c7))/0x9)+-parseInt(_0x281fac(0x1a4))/0xa;if(_0x5386d3===_0x444209)break;else _0x31800f['push'](_0x31800f['shift']());}catch(_0x5139aa){_0x31800f['push'](_0x31800f['shift']());}}}(_0x4e9d,0xadc4f));import{Command as _0x1933c8}from'ckeditor5/src/core.js';import{collectStylesheets as _0x1c7af0}from'ckeditor5/src/utils.js';import{getTranslation as _0x1dba8f}from'./utils/common-translations.js';export default class i extends _0x1933c8{constructor(_0x31c258){const _0x3b0600=_0x12a8;super(_0x31c258),this[_0x3b0600(0x1c0)](_0x3b0600(0x187),!0x1),this[_0x3b0600(0x1a9)]=!0x1;}[_0x4315fe(0x1d0)](){const _0xefd013=_0x4315fe;this[_0xefd013(0x17f)]=!this[_0xefd013(0x187)],this[_0xefd013(0x19f)]=this[_0xefd013(0x187)]?_0xefd013(0x1d1):void 0x0;}[_0x4315fe(0x1d4)](_0x32fdbe={}){const _0x2ed592=_0x4315fe,_0x2d9920=this[_0x2ed592(0x1a2)],_0xaa40a1=_0x32fdbe[_0x2ed592(0x19b)]||_0x2ed592(0x194),_0x472692=_0x32fdbe[_0x2ed592(0x18a)]||(_0xdd1b33=>_0xdd1b33[_0x2ed592(0x184)][_0x2ed592(0x19d)]()),_0x2ba462=_0x2d9920[_0x2ed592(0x1b1)][_0x2ed592(0x19d)](_0x2ed592(0x1a5)),_0x935e91=_0x32fdbe[_0x2ed592(0x192)]||_0x2ba462[_0x2ed592(0x18d)];return this[_0x2ed592(0x187)]=!0x0,this[_0x2ed592(0x1d0)](),_0x1c7af0(_0x32fdbe[_0x2ed592(0x1b9)]||[_0x2ed592(0x1af)])[_0x2ed592(0x1ce)](async _0x50debf=>{const _0x3f1faf=_0x2ed592;if(_0x2d9920['ui'][_0x3f1faf(0x1a1)][_0x3f1faf(0x18f)](_0x1dba8f(_0x2d9920[_0x3f1faf(0x18e)],_0x3f1faf(0x1b4))),_0x2d9920[_0x3f1faf(0x1b1)][_0x3f1faf(0x188)](_0x3f1faf(0x1cd))){_0x32fdbe[_0x3f1faf(0x1a8)]||(_0x32fdbe[_0x3f1faf(0x1a8)]={});const _0x3b1c4b=_0x2d9920[_0x3f1faf(0x1b1)][_0x3f1faf(0x19d)](_0x3f1faf(0x1ac)),_0x4a2953=_0x3b1c4b[_0x3f1faf(0x1c6)],{prefix:_0x58ee8c,suffix:_0x12357e}=_0x2d9920[_0x3f1faf(0x189)][_0x3f1faf(0x19d)](_0x3f1faf(0x181)),_0xe045c3=_0x3f1faf(0x199),_0x1e46dc={'prefix':_0x58ee8c,'suffix':_0x12357e,'data':{}};if(_0x3f1faf(0x1bd)===_0x4a2953){for(const _0x4c0d22 of _0x3b1c4b[_0x3f1faf(0x1c8)]())_0x3f1faf(0x1cf)===_0x3b1c4b[_0x3f1faf(0x1b2)](_0x4c0d22)?_0x1e46dc[_0x3f1faf(0x184)][_0x4c0d22]=_0xe045c3:_0x1e46dc[_0x3f1faf(0x184)][_0x4c0d22]=_0x3b1c4b[_0x3f1faf(0x182)](_0x3b1c4b[_0x3f1faf(0x1c1)](_0x4c0d22)||_0x4c0d22);}else{const _0x50cfac=_0x3f1faf(0x19a)===_0x4a2953?_0x3b1c4b[_0x3f1faf(0x1c4)]():_0x3b1c4b[_0x3f1faf(0x1bb)](_0x4a2953,!0x0);for(const _0x2c29d1 of Object[_0x3f1faf(0x1d2)](_0x50cfac)){const [_0x1f81ed,_0x5936cd]=_0x2c29d1;_0x3f1faf(0x1cf)===_0x3b1c4b[_0x3f1faf(0x1b2)](_0x1f81ed)?_0x1e46dc[_0x3f1faf(0x184)][_0x1f81ed]=null!==_0x5936cd?_0x5936cd:_0xe045c3:_0x1e46dc[_0x3f1faf(0x184)][_0x1f81ed]=null!==_0x5936cd?_0x5936cd:_0x3b1c4b[_0x3f1faf(0x1c1)](_0x1f81ed)||_0x1f81ed;}}_0x32fdbe[_0x3f1faf(0x1a8)][_0x3f1faf(0x193)]=_0x1e46dc;}const _0x16d4ba={'html':_0x3f1faf(0x1be)+_0x2d9920[_0x3f1faf(0x18e)][_0x3f1faf(0x183)]+_0x3f1faf(0x197)+await _0x472692(_0x2d9920)+_0x3f1faf(0x1ae),'css':_0x50debf,'options':_0x32fdbe[_0x3f1faf(0x1a8)]},_0x193e56={'method':_0x3f1faf(0x1a3),'headers':{'Content-Type':_0x3f1faf(0x1a7),'Accept':_0x3f1faf(0x1bc),..._0x935e91?{'Authorization':_0x935e91[_0x3f1faf(0x19f)]}:null,'x-cs-app-id':_0x32fdbe[_0x3f1faf(0x19c)]||_0x3f1faf(0x1ca)},'body':JSON[_0x3f1faf(0x195)](_0x16d4ba)};return window[_0x3f1faf(0x18b)](_0xaa40a1,_0x193e56)[_0x3f1faf(0x1ce)](_0x12a0b7=>{const _0x49a9cb=_0x3f1faf;if(0xc8!==_0x12a0b7[_0x49a9cb(0x1a0)])throw _0x12a0b7;return _0x12a0b7[_0x49a9cb(0x1cb)]();})[_0x3f1faf(0x1ce)](_0x50f9a7=>{const _0x1c6c2b=_0x3f1faf;_0x2d9920['ui'][_0x1c6c2b(0x1a1)][_0x1c6c2b(0x18f)](_0x1dba8f(_0x2d9920[_0x1c6c2b(0x18e)],_0x1c6c2b(0x190)));const _0x4a1c7d=_0x1c6c2b(0x1ba)==typeof _0x32fdbe[_0x1c6c2b(0x191)]?_0x32fdbe[_0x1c6c2b(0x191)]():_0x32fdbe[_0x1c6c2b(0x191)];this[_0x1c6c2b(0x19e)](_0x50f9a7,_0x4a1c7d||_0x1c6c2b(0x1b3));});})[_0x2ed592(0x186)](_0x45b990=>{const _0xf7cc5b=_0x2ed592,_0x30e7ad=_0x2d9920[_0xf7cc5b(0x1b1)][_0xf7cc5b(0x19d)](_0xf7cc5b(0x198));throw _0x2d9920['ui'][_0xf7cc5b(0x1a1)][_0xf7cc5b(0x18f)](_0x1dba8f(_0x2d9920[_0xf7cc5b(0x18e)],_0xf7cc5b(0x185)),{'politeness':_0xf7cc5b(0x1d3)}),_0x30e7ad[_0xf7cc5b(0x1c9)](_0x1dba8f(_0x2d9920[_0xf7cc5b(0x18e)],_0xf7cc5b(0x1bf))),_0x45b990;})[_0x2ed592(0x18c)](()=>{const _0x55d89c=_0x2ed592;this[_0x55d89c(0x187)]=!0x1,this[_0x55d89c(0x1d0)]();});}[_0x4315fe(0x19e)](_0x21583b,_0x45e63e){const _0x1b9994=_0x4315fe,_0x4d8877=document[_0x1b9994(0x1cc)]('a');_0x4d8877[_0x1b9994(0x1b0)]=window[_0x1b9994(0x1b5)][_0x1b9994(0x1b6)](_0x21583b),_0x4d8877[_0x1b9994(0x1ab)]=_0x45e63e,_0x4d8877[_0x1b9994(0x1ad)](),_0x4d8877[_0x1b9994(0x196)]();}}function _0x4e9d(){const _0x6eec06=['status','ariaLiveAnnouncer','editor','POST','18654870SlssaD','ExportPdf','2021980JjbWjc','application/json','converterOptions','affectsData','16TYWMDW','download','MergeFieldsEditing','click','\x0a\x09\x09\x09\x09\x09\x09\x09</div>\x0a\x09\x09\x09\x09\x09\x09</body>\x0a\x09\x09\x09\x09\x09</html>','EDITOR_STYLES','href','plugins','getMergeFieldType','document.pdf','PDF\x20export\x20started','URL','createObjectURL','37864gOgQtW','383jWHEmV','stylesheets','function','getDataSetValues','application/pdf','$labels','<html>\x0a\x09\x09\x09\x09\x09\x09<head>\x0a\x09\x09\x09\x09\x09\x09\x09<title>CKEditor\x205\x20PDF\x20document</title>\x0a\x09\x09\x09\x09\x09\x09\x09<meta\x20charset=\x22utf-8\x22>\x0a\x09\x09\x09\x09\x09\x09</head>\x0a\x09\x09\x09\x09\x09\x09<body>\x0a\x09\x09\x09\x09\x09\x09\x09<div\x20class=\x22ck-content\x22\x20dir=\x22','An\x20error\x20occurred\x20while\x20generating\x20the\x20PDF.','set','getLabel','1330679pCwizZ','4862ycpsNu','getDefaultValues','93936YpFBGX','previewMode','1808109qwMSMy','getMergeFieldsIds','showWarning','cke5','blob','createElement','MergeFields','then','image','refresh','pending','entries','assertive','execute','isEnabled','201ecZuay','mergeFields','wrapInAffixes','contentLanguageDirection','data','PDF\x20export\x20failed','catch','isBusy','has','config','dataCallback','fetch','finally','_token','locale','announce','PDF\x20export\x20successful','fileName','token','merge_fields','https://pdf-converter.cke-cs.com/v1/convert/','stringify','remove','\x22>\x0a\x09\x09\x09\x09\x09\x09\x09\x09','Notification','data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP88B8AAuUB8e2ujYwAAAAASUVORK5CYII=','$defaultValues','converterUrl','appID','get','_downloadFile','value'];_0x4e9d=function(){return _0x6eec06;};return _0x4e9d();}