UNPKG

@ckeditor/ckeditor5-ai

Version:

AI Assistant feature for CKEditor 5.

23 lines 8.6 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 _0x50f14b=_0x137c;function _0x137c(_0x5dc6c8,_0xa368e4){const _0x1dbbee=_0x1dbb();return _0x137c=function(_0x137cf7,_0x1e2d84){_0x137cf7=_0x137cf7-0x17e;let _0x59b3ae=_0x1dbbee[_0x137cf7];return _0x59b3ae;},_0x137c(_0x5dc6c8,_0xa368e4);}(function(_0x25371a,_0xcc54c0){const _0x2c4c71=_0x137c,_0x334501=_0x25371a();while(!![]){try{const _0x23e08b=-parseInt(_0x2c4c71(0x18f))/0x1+-parseInt(_0x2c4c71(0x1b3))/0x2*(-parseInt(_0x2c4c71(0x1b8))/0x3)+-parseInt(_0x2c4c71(0x1b6))/0x4+parseInt(_0x2c4c71(0x1a9))/0x5+-parseInt(_0x2c4c71(0x1a7))/0x6*(parseInt(_0x2c4c71(0x18d))/0x7)+-parseInt(_0x2c4c71(0x1b9))/0x8+-parseInt(_0x2c4c71(0x199))/0x9*(-parseInt(_0x2c4c71(0x187))/0xa);if(_0x23e08b===_0xcc54c0)break;else _0x334501['push'](_0x334501['shift']());}catch(_0x42aeb8){_0x334501['push'](_0x334501['shift']());}}}(_0x1dbb,0x22f1e));import{global as _0x5dfc27}from'ckeditor5/src/utils.js';import{View as _0x2ccffe,ButtonView as _0x525d31,SpinnerView as _0x48d0a2}from'ckeditor5/src/ui.js';function _0x1dbb(){const _0x39d435=['style','ck-ai-form__content-area--processing','88672xGZITq','mousedown','59250jIMzPF','1125304UCdGLS','listenTo','position','text/html','getSelection','<span>]</span>','setContent','ck-ai-form__copy-button','ck-content','element','check','<span>[</span>','createRange','execute','querySelector','_createCopyButton','locale','clipboard','isProcessing','smooth','setEndBefore','createElement','appendChild','setTemplate','-9999px','text/plain','loaderView','icon','removeAllRanges','setStartAfter','.ck-ai-form__loader','isEnabled','isVisible','copyButtonView','_copyHTMLToClipboard','ck-ai-form__content-field','1930QFWJMD','ck-ai-form__copy-button-wrapper','appendLoader','\x20ck-ai-form__copy-button--copied','scrollTo','absolute','517993CdNPOX','focus','137570DxlhKy','addRange','firstElementChild','Copy','class','bindTemplate','ck-ai-form__content-area-wrapper','ck-hidden','ck-reset_all-excluded','execCommand','11403cNOtFs','change:isProcessing','change:value','bind','copy','write','innerHTML','render','textContent','value','body','left','remove','div','6aECzSi','ck-ai-form__content-area','377515RlQhxz','ck-ai-form__loader','scrollHeight','AI\x20is\x20writing...','lastElementChild','set','_createLoader','contentFieldView','ClipboardItem','wheel','20jmevQz'];_0x1dbb=function(){return _0x39d435;};return _0x1dbb();}import _0x3e1539 from'../../../theme/icons/copy.svg';import{getTranslation as _0x4d9034}from'../../utils/common-translations.js';import{icons as _0x2b6263}from'ckeditor5/src/core.js';export default class X extends _0x2ccffe{constructor(_0x17fb9c,_0xff59ad=''){const _0xe3dba2=_0x137c;super(_0x17fb9c),this[_0xe3dba2(0x1ae)]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x45aff3=this[_0xe3dba2(0x194)];this[_0xe3dba2(0x1b0)]=new ContentFieldView(_0x17fb9c,_0xff59ad),this[_0xe3dba2(0x184)]=this[_0xe3dba2(0x1c8)](),this[_0xe3dba2(0x1d0)]({'tag':_0xe3dba2(0x1a6),'attributes':{'class':['ck',_0xe3dba2(0x195),_0x45aff3['if'](_0xe3dba2(0x183),_0xe3dba2(0x196),_0x2ac6b3=>!_0x2ac6b3)],'tabindex':'-1'},'children':[{'tag':_0xe3dba2(0x1a6),'attributes':{'class':['ck',_0xe3dba2(0x1a8),_0x45aff3['if'](_0xe3dba2(0x1cb),_0xe3dba2(0x1b5))]},'children':[this[_0xe3dba2(0x1b0)],{'tag':_0xe3dba2(0x1a6),'attributes':{'class':['ck',_0xe3dba2(0x188)]},'children':[this[_0xe3dba2(0x184)]]}]}]});}[_0x50f14b(0x1a0)](){const _0x2a7768=_0x50f14b;super[_0x2a7768(0x1a0)](),this[_0x2a7768(0x1a2)]&&this[_0x2a7768(0x1b0)][_0x2a7768(0x1bf)](this[_0x2a7768(0x1a2)]);let _0x599c58=!0x1;this['on'](_0x2a7768(0x19b),(_0x29b929,_0x10f8da,_0xa348a2)=>{const _0x11ec89=_0x2a7768,_0x40dc2b=!this[_0x11ec89(0x1b0)][_0x11ec89(0x1c2)][_0x11ec89(0x1c7)](_0x11ec89(0x181));this[_0x11ec89(0x1b0)][_0x11ec89(0x1bf)](_0xa348a2),this[_0x11ec89(0x1cb)]&&_0x40dc2b&&!_0x599c58&&this[_0x11ec89(0x1c2)][_0x11ec89(0x18b)]({'top':this[_0x11ec89(0x1c2)][_0x11ec89(0x1ab)],'behavior':_0x11ec89(0x1cc)});}),this['on'](_0x2a7768(0x19a),(_0x166122,_0x23befa,_0x44ccb1)=>{const _0x17d956=_0x2a7768;_0x599c58=!0x1,_0x44ccb1?(this[_0x17d956(0x1a2)]=null,this[_0x17d956(0x1b0)][_0x17d956(0x189)]()):this[_0x17d956(0x1a2)]||this[_0x17d956(0x1b0)][_0x17d956(0x1bf)]('');}),this[_0x2a7768(0x1ba)](this[_0x2a7768(0x1c2)],_0x2a7768(0x1b2),()=>{_0x599c58=!0x0;}),this[_0x2a7768(0x1ba)](this[_0x2a7768(0x1c2)],_0x2a7768(0x1b7),()=>{_0x599c58=!0x0;});}[_0x50f14b(0x18e)](){const _0x2a2af7=_0x50f14b;this[_0x2a2af7(0x1c2)][_0x2a2af7(0x18e)]();}[_0x50f14b(0x1c8)](){const _0xe83ed8=_0x50f14b,_0x4c0ada=this[_0xe83ed8(0x1c9)],_0x18fd8f=new _0x525d31(this[_0xe83ed8(0x1c9)]),_0x17e358=_0xe83ed8(0x1c0);return _0x18fd8f[_0xe83ed8(0x1ae)]({'label':_0x4d9034(_0x4c0ada,_0xe83ed8(0x192)),'icon':_0x3e1539,'class':_0x17e358,'tooltip':!0x0}),_0x18fd8f[_0xe83ed8(0x19c)](_0xe83ed8(0x183))['to'](this,_0xe83ed8(0x1a2),_0x43dc7e=>!!_0x43dc7e),_0x18fd8f[_0xe83ed8(0x19c)](_0xe83ed8(0x182))['to'](this,_0xe83ed8(0x1cb),_0x2e768a=>!_0x2e768a),_0x18fd8f['on'](_0xe83ed8(0x1c6),()=>{const _0x2a8131=_0xe83ed8;this[_0x2a8131(0x185)](this[_0x2a8131(0x1b0)][_0x2a8131(0x1c2)]),_0x18fd8f[_0x2a8131(0x17e)]=_0x2b6263[_0x2a8131(0x1c3)],_0x18fd8f[_0x2a8131(0x193)]=_0x17e358+_0x2a8131(0x18a),this[_0x2a8131(0x18e)](),setTimeout(()=>{const _0x20c13e=_0x2a8131;_0x18fd8f[_0x20c13e(0x17e)]=_0x3e1539,_0x18fd8f[_0x20c13e(0x193)]=_0x17e358;},0x3e8);}),_0x18fd8f;}[_0x50f14b(0x185)](_0x241483){const _0x4f342b=_0x50f14b,{window:_0xfdd527,document:_0x4d446d}=_0x5dfc27;if(_0xfdd527[_0x4f342b(0x1b1)]){const {Blob:_0x48f0ee,ClipboardItem:_0x107259}=_0xfdd527,_0x4ac87a=[new _0x107259({'text/html':new _0x48f0ee([_0x241483[_0x4f342b(0x19f)]],{'type':_0x4f342b(0x1bc)}),'text/plain':new _0x48f0ee([_0x241483[_0x4f342b(0x1a1)]||''],{'type':_0x4f342b(0x1d2)})})];navigator[_0x4f342b(0x1ca)][_0x4f342b(0x19e)](_0x4ac87a);}else{const _0x1e88d5=_0x4d446d[_0x4f342b(0x1ce)](_0x4f342b(0x1a6));_0x1e88d5[_0x4f342b(0x1b4)][_0x4f342b(0x1bb)]=_0x4f342b(0x18c),_0x1e88d5[_0x4f342b(0x1b4)][_0x4f342b(0x1a4)]=_0x4f342b(0x1d1),_0x1e88d5[_0x4f342b(0x19f)]=_0x4f342b(0x1c4)+_0x241483[_0x4f342b(0x19f)]+_0x4f342b(0x1be),_0x4d446d[_0x4f342b(0x1a3)][_0x4f342b(0x1cf)](_0x1e88d5);const _0x18e899=_0x4d446d[_0x4f342b(0x1c5)]();_0x18e899[_0x4f342b(0x180)](_0x1e88d5[_0x4f342b(0x191)]),_0x18e899[_0x4f342b(0x1cd)](_0x1e88d5[_0x4f342b(0x1ad)]);const _0x93f46f=_0xfdd527[_0x4f342b(0x1bd)]();_0x93f46f[_0x4f342b(0x17f)](),_0x93f46f[_0x4f342b(0x190)](_0x18e899),_0x4d446d[_0x4f342b(0x198)](_0x4f342b(0x19d)),_0x1e88d5[_0x4f342b(0x1a5)]();}}}export class ContentFieldView extends _0x2ccffe{constructor(_0x406139,_0xf2c1b=''){const _0x4d9cb6=_0x50f14b;super(_0x406139),this[_0x4d9cb6(0x1d3)]=this[_0x4d9cb6(0x1af)](),this[_0x4d9cb6(0x1d0)]({'tag':_0x4d9cb6(0x1a6),'attributes':{'class':['ck',_0x4d9cb6(0x1c1),_0xf2c1b,_0x4d9cb6(0x197),_0x4d9cb6(0x186)]}});}[_0x50f14b(0x1bf)](_0xef75ef){const _0x380ff6=_0x50f14b;this[_0x380ff6(0x1c2)][_0x380ff6(0x19f)]=_0xef75ef;}[_0x50f14b(0x189)](){const _0x371339=_0x50f14b;this[_0x371339(0x1c2)][_0x371339(0x1cf)](this[_0x371339(0x1d3)][_0x371339(0x1c2)]);}[_0x50f14b(0x1af)](){const _0x17f76d=_0x50f14b,_0x11a3e5=new _0x2ccffe(),_0x23f48b=this[_0x17f76d(0x1c9)],_0xcb97f0=new _0x48d0a2();return _0xcb97f0[_0x17f76d(0x183)]=!0x0,_0x11a3e5[_0x17f76d(0x1d0)]({'tag':_0x17f76d(0x1a6),'attributes':{'class':['ck',_0x17f76d(0x1aa)]},'children':[_0xcb97f0,{'text':_0x4d9034(_0x23f48b,_0x17f76d(0x1ac))}]}),_0x11a3e5[_0x17f76d(0x1a0)](),_0x11a3e5;}}