UNPKG

@ckeditor/ckeditor5-ai

Version:

AI Assistant feature for CKEditor 5.

23 lines 8.53 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 _0x3cfe89=_0x5857;(function(_0x43dade,_0x411ac2){const _0x25c2c6=_0x5857,_0x32d787=_0x43dade();while(!![]){try{const _0x3a5427=-parseInt(_0x25c2c6(0xcd))/0x1+-parseInt(_0x25c2c6(0x9b))/0x2*(parseInt(_0x25c2c6(0xd6))/0x3)+parseInt(_0x25c2c6(0x98))/0x4*(parseInt(_0x25c2c6(0xb8))/0x5)+parseInt(_0x25c2c6(0xa8))/0x6*(parseInt(_0x25c2c6(0xd4))/0x7)+parseInt(_0x25c2c6(0x9a))/0x8*(-parseInt(_0x25c2c6(0xc7))/0x9)+-parseInt(_0x25c2c6(0xe3))/0xa+-parseInt(_0x25c2c6(0xa7))/0xb*(-parseInt(_0x25c2c6(0xb4))/0xc);if(_0x3a5427===_0x411ac2)break;else _0x32d787['push'](_0x32d787['shift']());}catch(_0xc1a6bf){_0x32d787['push'](_0x32d787['shift']());}}}(_0x1161,0xc4242));import{global as _0x4f6ea3}from'ckeditor5/src/utils.js';import{View as _0x452513,ButtonView as _0x51f06b,SpinnerView as _0x96abe1}from'ckeditor5/src/ui.js';import{IconCheck as _0x2a1009,IconCopy as _0x8785a2}from'ckeditor5/src/icons.js';import{getTranslation as _0x356b94}from'../../utils/common-translations.js';export class AIFormContentArea extends _0x452513{[_0x3cfe89(0xc1)];[_0x3cfe89(0xb9)];constructor(_0x4facdb,_0x2f5650=''){const _0x5071fd=_0x3cfe89;super(_0x4facdb),this[_0x5071fd(0xaf)]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3b0e1b=this[_0x5071fd(0xa2)];this[_0x5071fd(0xc1)]=new ContentFieldView(_0x4facdb,_0x2f5650),this[_0x5071fd(0xb9)]=this[_0x5071fd(0xcb)](),this[_0x5071fd(0xac)]({'tag':_0x5071fd(0x9c),'attributes':{'class':['ck',_0x5071fd(0xc2),_0x3b0e1b['if'](_0x5071fd(0xe1),_0x5071fd(0xa5),_0x31b6f0=>!_0x31b6f0)],'tabindex':'-1'},'children':[{'tag':_0x5071fd(0x9c),'attributes':{'class':['ck',_0x5071fd(0xd9),_0x3b0e1b['if'](_0x5071fd(0xb3),_0x5071fd(0xd2))]},'children':[this[_0x5071fd(0xc1)],{'tag':_0x5071fd(0x9c),'attributes':{'class':['ck',_0x5071fd(0xe0)]},'children':[this[_0x5071fd(0xb9)]]}]}]});}[_0x3cfe89(0xd7)](){const _0x23a2d7=_0x3cfe89;super[_0x23a2d7(0xd7)](),this[_0x23a2d7(0xb1)]&&this[_0x23a2d7(0xc1)][_0x23a2d7(0xc3)](this[_0x23a2d7(0xb1)]);let _0x150aaa=!0x1;this['on'](_0x23a2d7(0xc5),(_0x3ab124,_0xbf114f,_0x337be2)=>{const _0x442a60=_0x23a2d7,_0x22780c=!this[_0x442a60(0xc1)][_0x442a60(0xca)][_0x442a60(0xce)](_0x442a60(0xa3));this[_0x442a60(0xc1)][_0x442a60(0xc3)](_0x337be2),this[_0x442a60(0xb3)]&&_0x22780c&&!_0x150aaa&&this[_0x442a60(0xca)][_0x442a60(0x93)]({'top':this[_0x442a60(0xca)][_0x442a60(0x95)],'behavior':_0x442a60(0xcf)});}),this['on'](_0x23a2d7(0xdc),(_0xba9ddc,_0x28e0b2,_0x2f460c)=>{const _0x19b71e=_0x23a2d7;_0x150aaa=!0x1,_0x2f460c?(this[_0x19b71e(0xb1)]=null,this[_0x19b71e(0xc1)][_0x19b71e(0xe2)]()):this[_0x19b71e(0xb1)]||this[_0x19b71e(0xc1)][_0x19b71e(0xc3)]('');}),this[_0x23a2d7(0xde)](this[_0x23a2d7(0xca)],_0x23a2d7(0xa4),()=>{_0x150aaa=!0x0;}),this[_0x23a2d7(0xde)](this[_0x23a2d7(0xca)],_0x23a2d7(0x99),()=>{_0x150aaa=!0x0;});}[_0x3cfe89(0xdd)](){const _0x1b4169=_0x3cfe89;this[_0x1b4169(0xca)][_0x1b4169(0xdd)]();}[_0x3cfe89(0xcb)](){const _0x577035=_0x3cfe89,_0x4246a5=this[_0x577035(0xd0)],_0x11fb8d=new _0x51f06b(this[_0x577035(0xd0)]),_0x5cbea3=_0x577035(0xc6);return _0x11fb8d[_0x577035(0xaf)]({'label':_0x356b94(_0x4246a5,_0x577035(0xc4)),'icon':_0x8785a2,'class':_0x5cbea3,'tooltip':!0x0}),_0x11fb8d[_0x577035(0xbe)](_0x577035(0xe1))['to'](this,_0x577035(0xb1),_0x4e2c02=>!!_0x4e2c02),_0x11fb8d[_0x577035(0xbe)](_0x577035(0xcc))['to'](this,_0x577035(0xb3),_0x30c537=>!_0x30c537),_0x11fb8d['on'](_0x577035(0xd1),()=>{const _0x31a8f4=_0x577035;this[_0x31a8f4(0xae)](this[_0x31a8f4(0xc1)][_0x31a8f4(0xca)]),_0x11fb8d[_0x31a8f4(0xa9)]=_0x2a1009,_0x11fb8d[_0x31a8f4(0x91)]=_0x5cbea3+_0x31a8f4(0xbc),this[_0x31a8f4(0xdd)](),setTimeout(()=>{const _0x1abf1e=_0x31a8f4;_0x11fb8d[_0x1abf1e(0xa9)]=_0x8785a2,_0x11fb8d[_0x1abf1e(0x91)]=_0x5cbea3;},0x3e8);}),_0x11fb8d;}[_0x3cfe89(0xae)](_0x549977){const _0xedabb9=_0x3cfe89,{window:_0x3cd98c,document:_0x4b58b2}=_0x4f6ea3;if(_0x3cd98c[_0xedabb9(0x9e)]){const {Blob:_0x60bb36,ClipboardItem:_0x274a24}=_0x3cd98c,_0x5d8ce6=[new _0x274a24({'text/html':new _0x60bb36([_0x549977[_0xedabb9(0xaa)]],{'type':_0xedabb9(0xb5)}),'text/plain':new _0x60bb36([_0x549977[_0xedabb9(0xab)]||''],{'type':_0xedabb9(0x9f)})})];navigator[_0xedabb9(0xb2)][_0xedabb9(0x97)](_0x5d8ce6);}else{const _0x16bc2f=_0x4b58b2[_0xedabb9(0x94)](_0xedabb9(0x9c));_0x16bc2f[_0xedabb9(0x9d)][_0xedabb9(0xbd)]=_0xedabb9(0xc0),_0x16bc2f[_0xedabb9(0x9d)][_0xedabb9(0xa6)]=_0xedabb9(0xad),_0x16bc2f[_0xedabb9(0xaa)]=_0xedabb9(0xc8)+_0x549977[_0xedabb9(0xaa)]+_0xedabb9(0xda),_0x4b58b2[_0xedabb9(0xa1)][_0xedabb9(0xe4)](_0x16bc2f);const _0x469216=_0x4b58b2[_0xedabb9(0xc9)]();_0x469216[_0xedabb9(0xba)](_0x16bc2f[_0xedabb9(0xd8)]),_0x469216[_0xedabb9(0x90)](_0x16bc2f[_0xedabb9(0xbb)]);const _0x239864=_0x3cd98c[_0xedabb9(0xdf)]();_0x239864[_0xedabb9(0xb0)](),_0x239864[_0xedabb9(0x92)](_0x469216),_0x4b58b2[_0xedabb9(0xdb)](_0xedabb9(0xb7)),_0x16bc2f[_0xedabb9(0x96)]();}}}export class ContentFieldView extends _0x452513{constructor(_0x3dd7b3,_0x4f0b6f=''){const _0x295fee=_0x3cfe89;super(_0x3dd7b3),this[_0x295fee(0xa0)]=this[_0x295fee(0xe6)](),this[_0x295fee(0xac)]({'tag':_0x295fee(0x9c),'attributes':{'class':['ck',_0x295fee(0xd5),_0x4f0b6f,_0x295fee(0xb6),_0x295fee(0xe5)]}});}[_0x3cfe89(0xc3)](_0x22c4d1){const _0x31db4f=_0x3cfe89;this[_0x31db4f(0xca)][_0x31db4f(0xaa)]=_0x22c4d1;}[_0x3cfe89(0xe2)](){const _0x4f1115=_0x3cfe89;this[_0x4f1115(0xca)][_0x4f1115(0xe4)](this[_0x4f1115(0xa0)][_0x4f1115(0xca)]);}[_0x3cfe89(0xe6)](){const _0x2596d9=_0x3cfe89,_0x1704b=new _0x452513(),_0x288b3b=this[_0x2596d9(0xd0)],_0x1b6c44=new _0x96abe1();return _0x1b6c44[_0x2596d9(0xe1)]=!0x0,_0x1704b[_0x2596d9(0xac)]({'tag':_0x2596d9(0x9c),'attributes':{'class':['ck',_0x2596d9(0xd3)]},'children':[_0x1b6c44,{'text':_0x356b94(_0x288b3b,_0x2596d9(0xbf))}]}),_0x1704b[_0x2596d9(0xd7)](),_0x1704b;}}function _0x5857(_0x877883,_0x657480){const _0x1161e7=_0x1161();return _0x5857=function(_0x585770,_0x177969){_0x585770=_0x585770-0x90;let _0x3d4a98=_0x1161e7[_0x585770];return _0x3d4a98;},_0x5857(_0x877883,_0x657480);}function _0x1161(){const _0x1cf1dc=['isEnabled','27063IrRFaT','querySelector','smooth','locale','execute','ck-ai-form__content-area--processing','ck-ai-form__loader','7qhenmX','ck-content','6HWhExg','render','firstElementChild','ck-ai-form__content-area','<span>]</span>','execCommand','change:isProcessing','focus','listenTo','getSelection','ck-ai-form__copy-button-wrapper','isVisible','appendLoader','9259490AULlLt','appendChild','ck-ai-form__content-field','_createLoader','setEndBefore','class','addRange','scrollTo','createElement','scrollHeight','remove','write','56RDSYYb','mousedown','19288TsvjxP','409918ivbhkR','div','style','ClipboardItem','text/plain','loaderView','body','bindTemplate','.ck-ai-form__loader','wheel','ck-hidden','left','207658vguMSN','348414hpvZBw','icon','innerHTML','textContent','setTemplate','-9999px','_copyHTMLToClipboard','set','removeAllRanges','value','clipboard','isProcessing','972CCTIup','text/html','ck-reset_all-excluded','copy','295525TDbIed','copyButtonView','setStartAfter','lastElementChild','\x20ck-ai-form__copy-button--copied','position','bind','AI\x20is\x20writing...','absolute','contentFieldView','ck-ai-form__content-area-wrapper','setContent','Copy','change:value','ck-ai-form__copy-button','927RaxZbh','<span>[</span>','createRange','element','_createCopyButton'];_0x1161=function(){return _0x1cf1dc;};return _0x1161();}