@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 8.55 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
function _0x4557(_0x4c1ad8,_0x336809){const _0x330316=_0x3303();return _0x4557=function(_0x4557cf,_0x4c5385){_0x4557cf=_0x4557cf-0x18e;let _0x1703d4=_0x330316[_0x4557cf];return _0x1703d4;},_0x4557(_0x4c1ad8,_0x336809);}function _0x3303(){const _0x598e85=['1456uhmzVd','loaderView','text/plain','setTemplate','scrollTo','createRange','class','style','text/html','856385knfXGD','bindTemplate','listenTo','ck-ai-form__content-field','textContent','querySelector','setEndBefore','focus','ck-ai-form__content-area-wrapper','<span>]</span>','ck-ai-form__copy-button-wrapper','<span>[</span>','452wfoLWE','appendChild','setStartAfter','-9999px','absolute','lastElementChild','smooth','AI\x20is\x20writing...','ck-reset_all-excluded','execute','getSelection','contentFieldView','ck-ai-form__content-area--processing','element','_createLoader','remove','innerHTML','128872MIYdew','871frXCfz','\x20ck-ai-form__copy-button--copied','isEnabled','ClipboardItem','render','_createCopyButton','isVisible','body','8116720ToaoOq','isProcessing','scrollHeight','change:value','setContent','locale','change:isProcessing','182928pBYJQr','8YJvnUj','copyButtonView','.ck-ai-form__loader','copy','removeAllRanges','set','addRange','ck-ai-form__content-area','bind','clipboard','firstElementChild','icon','ck-ai-form__loader','_copyHTMLToClipboard','ck-hidden','position','createElement','166536xSVQnM','Copy','4926ekZEDP','left','appendLoader','execCommand','mousedown','value','div','ck-content','wheel','write','ck-ai-form__copy-button'];_0x3303=function(){return _0x598e85;};return _0x3303();}const _0x55a6bd=_0x4557;(function(_0x588996,_0x501ef5){const _0x3c5e01=_0x4557,_0xc44ae2=_0x588996();while(!![]){try{const _0x204ce9=parseInt(_0x3c5e01(0x1d5))/0x1*(-parseInt(_0x3c5e01(0x1c3))/0x2)+-parseInt(_0x3c5e01(0x18f))/0x3+-parseInt(_0x3c5e01(0x1d4))/0x4+-parseInt(_0x3c5e01(0x1b7))/0x5+-parseInt(_0x3c5e01(0x1a3))/0x6*(parseInt(_0x3c5e01(0x1ae))/0x7)+-parseInt(_0x3c5e01(0x190))/0x8*(-parseInt(_0x3c5e01(0x1a1))/0x9)+parseInt(_0x3c5e01(0x1dd))/0xa;if(_0x204ce9===_0x501ef5)break;else _0xc44ae2['push'](_0xc44ae2['shift']());}catch(_0x4322d2){_0xc44ae2['push'](_0xc44ae2['shift']());}}}(_0x3303,0x305cb));import{global as _0x4cbe54}from'ckeditor5/src/utils.js';import{View as _0x44c23a,ButtonView as _0x718155,SpinnerView as _0x565775}from'ckeditor5/src/ui.js';import{IconCheck as _0x1ca887,IconCopy as _0x959c1}from'ckeditor5/src/icons.js';import{getTranslation as _0x2cc465}from'../../utils/common-translations.js';export class AIFormContentArea extends _0x44c23a{[_0x55a6bd(0x1ce)];[_0x55a6bd(0x191)];constructor(_0x20f598,_0x8e926c=''){const _0x3c386a=_0x55a6bd;super(_0x20f598),this[_0x3c386a(0x195)]({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x59ebeb=this[_0x3c386a(0x1b8)];this[_0x3c386a(0x1ce)]=new ContentFieldView(_0x20f598,_0x8e926c),this[_0x3c386a(0x191)]=this[_0x3c386a(0x1da)](),this[_0x3c386a(0x1b1)]({'tag':_0x3c386a(0x1a9),'attributes':{'class':['ck',_0x3c386a(0x1bf),_0x59ebeb['if'](_0x3c386a(0x1db),_0x3c386a(0x19e),_0x8b7afa=>!_0x8b7afa)],'tabindex':'-1'},'children':[{'tag':_0x3c386a(0x1a9),'attributes':{'class':['ck',_0x3c386a(0x197),_0x59ebeb['if'](_0x3c386a(0x1de),_0x3c386a(0x1cf))]},'children':[this[_0x3c386a(0x1ce)],{'tag':_0x3c386a(0x1a9),'attributes':{'class':['ck',_0x3c386a(0x1c1)]},'children':[this[_0x3c386a(0x191)]]}]}]});}[_0x55a6bd(0x1d9)](){const _0x1a5dd8=_0x55a6bd;super[_0x1a5dd8(0x1d9)](),this[_0x1a5dd8(0x1a8)]&&this[_0x1a5dd8(0x1ce)][_0x1a5dd8(0x1e1)](this[_0x1a5dd8(0x1a8)]);let _0x5b724b=!0x1;this['on'](_0x1a5dd8(0x1e0),(_0x539d5a,_0x48a678,_0x51b688)=>{const _0x58ed25=_0x1a5dd8,_0x3286ec=!this[_0x58ed25(0x1ce)][_0x58ed25(0x1d0)][_0x58ed25(0x1bc)](_0x58ed25(0x192));this[_0x58ed25(0x1ce)][_0x58ed25(0x1e1)](_0x51b688),this[_0x58ed25(0x1de)]&&_0x3286ec&&!_0x5b724b&&this[_0x58ed25(0x1d0)][_0x58ed25(0x1b2)]({'top':this[_0x58ed25(0x1d0)][_0x58ed25(0x1df)],'behavior':_0x58ed25(0x1c9)});}),this['on'](_0x1a5dd8(0x18e),(_0x177f33,_0xf3412c,_0xe1c2d2)=>{const _0x4b5521=_0x1a5dd8;_0x5b724b=!0x1,_0xe1c2d2?(this[_0x4b5521(0x1a8)]=null,this[_0x4b5521(0x1ce)][_0x4b5521(0x1a5)]()):this[_0x4b5521(0x1a8)]||this[_0x4b5521(0x1ce)][_0x4b5521(0x1e1)]('');}),this[_0x1a5dd8(0x1b9)](this[_0x1a5dd8(0x1d0)],_0x1a5dd8(0x1ab),()=>{_0x5b724b=!0x0;}),this[_0x1a5dd8(0x1b9)](this[_0x1a5dd8(0x1d0)],_0x1a5dd8(0x1a7),()=>{_0x5b724b=!0x0;});}[_0x55a6bd(0x1be)](){const _0x551e42=_0x55a6bd;this[_0x551e42(0x1d0)][_0x551e42(0x1be)]();}[_0x55a6bd(0x1da)](){const _0x6247=_0x55a6bd,_0x401ba9=this[_0x6247(0x1e2)],_0x7d81c=new _0x718155(this[_0x6247(0x1e2)]),_0x503528=_0x6247(0x1ad);return _0x7d81c[_0x6247(0x195)]({'label':_0x2cc465(_0x401ba9,_0x6247(0x1a2)),'icon':_0x959c1,'class':_0x503528,'tooltip':!0x0}),_0x7d81c[_0x6247(0x198)](_0x6247(0x1db))['to'](this,_0x6247(0x1a8),_0x3f232f=>!!_0x3f232f),_0x7d81c[_0x6247(0x198)](_0x6247(0x1d7))['to'](this,_0x6247(0x1de),_0x538045=>!_0x538045),_0x7d81c['on'](_0x6247(0x1cc),()=>{const _0xeeab0c=_0x6247;this[_0xeeab0c(0x19d)](this[_0xeeab0c(0x1ce)][_0xeeab0c(0x1d0)]),_0x7d81c[_0xeeab0c(0x19b)]=_0x1ca887,_0x7d81c[_0xeeab0c(0x1b4)]=_0x503528+_0xeeab0c(0x1d6),this[_0xeeab0c(0x1be)](),setTimeout(()=>{const _0x4063fa=_0xeeab0c;_0x7d81c[_0x4063fa(0x19b)]=_0x959c1,_0x7d81c[_0x4063fa(0x1b4)]=_0x503528;},0x3e8);}),_0x7d81c;}[_0x55a6bd(0x19d)](_0x212674){const _0x3a5762=_0x55a6bd,{window:_0x8b3968,document:_0x55d88c}=_0x4cbe54;if(_0x8b3968[_0x3a5762(0x1d8)]){const {Blob:_0x30c743,ClipboardItem:_0x29055e}=_0x8b3968,_0x4450a7=[new _0x29055e({'text/html':new _0x30c743([_0x212674[_0x3a5762(0x1d3)]],{'type':_0x3a5762(0x1b6)}),'text/plain':new _0x30c743([_0x212674[_0x3a5762(0x1bb)]||''],{'type':_0x3a5762(0x1b0)})})];navigator[_0x3a5762(0x199)][_0x3a5762(0x1ac)](_0x4450a7);}else{const _0x3fbe02=_0x55d88c[_0x3a5762(0x1a0)](_0x3a5762(0x1a9));_0x3fbe02[_0x3a5762(0x1b5)][_0x3a5762(0x19f)]=_0x3a5762(0x1c7),_0x3fbe02[_0x3a5762(0x1b5)][_0x3a5762(0x1a4)]=_0x3a5762(0x1c6),_0x3fbe02[_0x3a5762(0x1d3)]=_0x3a5762(0x1c2)+_0x212674[_0x3a5762(0x1d3)]+_0x3a5762(0x1c0),_0x55d88c[_0x3a5762(0x1dc)][_0x3a5762(0x1c4)](_0x3fbe02);const _0x535d58=_0x55d88c[_0x3a5762(0x1b3)]();_0x535d58[_0x3a5762(0x1c5)](_0x3fbe02[_0x3a5762(0x19a)]),_0x535d58[_0x3a5762(0x1bd)](_0x3fbe02[_0x3a5762(0x1c8)]);const _0x356af3=_0x8b3968[_0x3a5762(0x1cd)]();_0x356af3[_0x3a5762(0x194)](),_0x356af3[_0x3a5762(0x196)](_0x535d58),_0x55d88c[_0x3a5762(0x1a6)](_0x3a5762(0x193)),_0x3fbe02[_0x3a5762(0x1d2)]();}}}export class ContentFieldView extends _0x44c23a{constructor(_0x5255ac,_0x5ae690=''){const _0x171d91=_0x55a6bd;super(_0x5255ac),this[_0x171d91(0x1af)]=this[_0x171d91(0x1d1)](),this[_0x171d91(0x1b1)]({'tag':_0x171d91(0x1a9),'attributes':{'class':['ck',_0x171d91(0x1aa),_0x5ae690,_0x171d91(0x1cb),_0x171d91(0x1ba)]}});}[_0x55a6bd(0x1e1)](_0x57efa0){const _0x192b7b=_0x55a6bd;this[_0x192b7b(0x1d0)][_0x192b7b(0x1d3)]=_0x57efa0;}[_0x55a6bd(0x1a5)](){const _0x27328f=_0x55a6bd;this[_0x27328f(0x1d0)][_0x27328f(0x1c4)](this[_0x27328f(0x1af)][_0x27328f(0x1d0)]);}[_0x55a6bd(0x1d1)](){const _0x5772cf=_0x55a6bd,_0x3f2124=new _0x44c23a(),_0x24999c=this[_0x5772cf(0x1e2)],_0x4acdc6=new _0x565775();return _0x4acdc6[_0x5772cf(0x1db)]=!0x0,_0x3f2124[_0x5772cf(0x1b1)]({'tag':_0x5772cf(0x1a9),'attributes':{'class':['ck',_0x5772cf(0x19c)]},'children':[_0x4acdc6,{'text':_0x2cc465(_0x24999c,_0x5772cf(0x1ca))}]}),_0x3f2124[_0x5772cf(0x1d9)](),_0x3f2124;}}