@ckeditor/ckeditor5-ai 45.2.0-alpha.4 → 45.2.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x24e675,Command as _0x2952ed}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x1a86c0,IconCheck as _0x3b483a,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3cb38c,IconRobotPencil as _0x3e1a5d}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x31d56c,CKEditorError as _0x1ed59c,ObservableMixin as _0x370eab,global as _0x2dbbc9,isVisible as ot,Rect as it,Collection as _0x4ccbc3,FocusTracker as mt,KeystrokeHandler as ut,first as _0x9bd64f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x269602,View as _0x437a39,SpinnerView as _0x4d4ebe,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x54ad93,createDropdown as _0x58b909,addMenuToDropdown as _0x5511ab,MenuBarMenuView as _0x595115,MenuBarMenuListItemButtonView as _0x53d973,DialogViewPosition as _0x550034,MenuBarMenuListView as _0x10d556,MenuBarMenuListItemView as _0x48fceb}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x102e51,ClipboardMarkersUtils as _0x514629}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x333171,DataTransfer as _0x4e16c7,UpcastWriter as _0x46e462,Matcher as _0x39bfc2}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x4967b9,InvokeModelWithResponseStreamCommand as _0x49e8cb,InvokeModelCommand as _0x13fb25}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x15f0a5,_0x37eb9d){const _0x498035=(0x0,_0x37eb9d['t'])('Other');return _0x15f0a5['length']?'groupId'in _0x15f0a5[0x0]?_0x15f0a5:[{'groupId':x,'groupLabel':_0x498035,'order':0x1/0x0,'commands':_0x15f0a5}]:[{'groupId':x,'groupLabel':_0x498035,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x24e675{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x331bb1}=this,_0x2931f4=['ck-fake-ai-selection'];_0x331bb1['config']['get']('ai.useTheme')&&_0x2931f4['push']('ck-ai-assistant-ui_theme'),_0x331bb1['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x2931f4,'priority':0xc}}),_0x331bb1['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x58b961,{writer:_0x48b520})=>{if(!_0x58b961['markerRange']['isCollapsed'])return null;const _0x27df34=_0x48b520['createUIElement']('span');return _0x48b520['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x27df34),_0x27df34;}});}['afterInit'](){!async function(_0x276048){const _0x137395=_0x1e4199([0x61,0x57,0x5a,0x64,0x4a,0x56,0x31,0x36,0x50,0x74,0x72,0x76,0x6b,0x73,0x79,0x6a,0x47,0x67,0x30,0x62,0x34,0x7a,0x35,0x6c,0x33,0x70,0x58,0x53,0x4e,0x4f,0x51,0x37,0x65,0x43,0x4b,0x78,0x42,0x38,0x32,0x69,0x39,0x6e,0x63,0x66,0x77,0x45,0x68,0x6f,0x41,0x44,0x4c,0x59,0x6d,0x52,0x55,0x4d,0x48,0x75,0x46,0x71,0x54,0x49]),_0x15edee=0x62379ca0,_0xcdd35=0x6230f520^_0x15edee,_0x4fd960=window[_0x1e4199([0x44,0x61,0x74,0x65])][_0x1e4199([0x6e,0x6f,0x77])](),_0x41d56e=_0x276048[_0x1e4199([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4cb242=new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2f8c6f=>{_0x41d56e[_0x1e4199([0x6f,0x6e,0x63,0x65])](_0x1e4199([0x72,0x65,0x61,0x64,0x79]),_0x2f8c6f);}),_0x44a167={[_0x1e4199([0x6b,0x74,0x79])]:_0x1e4199([0x45,0x43]),[_0x1e4199([0x75,0x73,0x65])]:_0x1e4199([0x73,0x69,0x67]),[_0x1e4199([0x63,0x72,0x76])]:_0x1e4199([0x50,0x2d,0x32,0x35,0x36]),[_0x1e4199([0x78])]:_0x1e4199([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x1e4199([0x79])]:_0x1e4199([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x1e4199([0x61,0x6c,0x67])]:_0x1e4199([0x45,0x53,0x32,0x35,0x36])},_0x4acbf5=_0x41d56e[_0x1e4199([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1e4199([0x67,0x65,0x74])](_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5ad2f5(){let _0x25e448,_0x24b02f=null,_0x4eee96=null;try{if(_0x4acbf5==_0x1e4199([0x47,0x50,0x4c]))return _0x1e4199([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x25e448=_0x3395d8(),!_0x25e448)return _0x1e4199([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x25e448[_0x1e4199([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x4eee96=_0x2310c7(_0x25e448[_0x1e4199([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x25e448[_0x1e4199([0x6a,0x74,0x69])])),await _0xa4eac4()?_0x8bab41()?_0x2b3794()?_0x1e4199([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x52cf5c()?(_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1e4199([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x24b02f=_0x40adbb(_0x1e4199([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1e4199([0x74,0x72,0x69,0x61,0x6c])&&(_0x24b02f=_0x40adbb(_0x1e4199([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3f750f()):_0x1e4199([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1e4199([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1e4199([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1e4199([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2b3794(){const _0x9df7c8=[_0x1e4199([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1e4199([0x74,0x72,0x69,0x61,0x6c])][_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4fd960/0x3e8:0xe10*_0xcdd35;return _0x25e448[_0x1e4199([0x65,0x78,0x70])]<_0x9df7c8;}function _0x8bab41(){const _0x2a6f80=_0x25e448[_0x1e4199([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x2a6f80&&(!!_0x2a6f80[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1e4199([0x2a]))||!!_0x2a6f80[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1e4199([0x41,0x49])));}function _0x52cf5c(){const _0x1763fe=_0x25e448[_0x1e4199([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1763fe||0x0==_0x1763fe[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x72f185}=new URL(window[_0x1e4199([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1763fe[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x72f185))return!0x0;const _0x544907=_0x72f185[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e]));return _0x1763fe[_0x1e4199([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x184f6c=>_0x184f6c[_0x1e4199([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1e4199([0x2a])))[_0x1e4199([0x6d,0x61,0x70])](_0x24a678=>_0x24a678[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e])))[_0x1e4199([0x73,0x6f,0x6d,0x65])](_0x4707ec=>_0x544907[_0x1e4199([0x65,0x76,0x65,0x72,0x79])]((_0x3276e0,_0x129d19)=>_0x4707ec[_0x129d19]===_0x3276e0||_0x4707ec[_0x129d19]===_0x1e4199([0x2a])));}function _0x3f750f(){return _0x24b02f&&_0x4eee96?new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3f2aa2,_0x1103f2)=>{_0x24b02f[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x3f2aa2,_0x1103f2),_0x4eee96[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x235d56=>{_0x235d56!=_0x1e4199([0x56,0x61,0x6c,0x69,0x64])&&_0x3f2aa2(_0x235d56);},_0x1103f2);}):_0x24b02f||_0x4eee96||_0x1e4199([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2310c7(_0x4a502c,_0x35d973){return new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x215a98=>{if(_0x8d87b2())return _0x215a98(_0x1e4199([0x56,0x61,0x6c,0x69,0x64]));_0x4b4368(),_0x41d56e[_0x1e4199([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1e4199([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x224402=!0x1;const _0x226cb6=_0x31d56c();function _0x27fd17(_0x19b4b9){return!!_0x19b4b9&&(typeof _0x19b4b9===_0x1e4199([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x19b4b9===_0x1e4199([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x19b4b9[_0x1e4199([0x74,0x68,0x65,0x6e])]===_0x1e4199([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x19b4b9[_0x1e4199([0x63,0x61,0x74,0x63,0x68])]===_0x1e4199([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x255583(_0x474766){_0x38394c(_0x474766)[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x1959bd=>{if(!_0x1959bd||_0x1959bd[_0x1e4199([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1e4199([0x6f,0x6b]))return _0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x596d74(_0x398c9a(_0x226cb6+_0x35d973))!=_0x1959bd[_0x1e4199([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1e4199([0x56,0x61,0x6c,0x69,0x64]);})[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x47b4c9=>(_0x30c038(),_0x47b4c9),()=>{const _0x492d03=_0x52bbcd();return null==_0x492d03?(_0x30c038(),_0x1e4199([0x56,0x61,0x6c,0x69,0x64])):_0x1e4199(_0x4fd960-_0x492d03>(0x463b18a0^_0x15edee)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x215a98)[_0x1e4199([0x63,0x61,0x74,0x63,0x68])](()=>{_0x215a98(_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5f3007=0x62017220^_0x15edee;function _0x30c038(){const _0x4bc3fb=_0x1e4199([0x6c,0x6c,0x63,0x74,0x2d])+_0x596d74(_0x398c9a(_0x4a502c)),_0x5a204d=_0x273967(_0x596d74(window[_0x1e4199([0x4d,0x61,0x74,0x68])][_0x1e4199([0x63,0x65,0x69,0x6c])](_0x4fd960/_0x5f3007)));window[_0x1e4199([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1e4199([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4bc3fb,_0x5a204d);}function _0x52bbcd(){const _0x5eae85=_0x1e4199([0x6c,0x6c,0x63,0x74,0x2d])+_0x596d74(_0x398c9a(_0x4a502c)),_0x3bc1d4=window[_0x1e4199([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1e4199([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5eae85);return _0x3bc1d4?window[_0x1e4199([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x273967(_0x3bc1d4),0x10)*_0x5f3007:null;}function _0x38394c(_0x408fc7){return new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x54b6f9,_0x312933)=>{_0x408fc7[_0x1e4199([0x74,0x68,0x65,0x6e])](_0x54b6f9,_0x312933),window[_0x1e4199([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x312933,0x62364860^_0x15edee);});}}_0x41d56e[_0x1e4199([0x6f,0x6e])](_0x1e4199([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x452d1e,_0x42cc7d)=>{if(_0x42cc7d[0x0]!=_0x4a502c)return _0x215a98(_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x42cc7d[0x1]={..._0x42cc7d[0x1],[_0x1e4199([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x226cb6};},{[_0x1e4199([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1e4199([0x68,0x69,0x67,0x68])}),_0x41d56e[_0x1e4199([0x6f,0x6e])](_0x1e4199([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x15a31f=>{_0x27fd17(_0x15a31f[_0x1e4199([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x224402=!0x0,_0x255583(_0x15a31f[_0x1e4199([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1e4199([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1e4199([0x6c,0x6f,0x77])}),_0x4cb242[_0x1e4199([0x74,0x68,0x65,0x6e])](()=>{_0x224402||_0x215a98(_0x1e4199([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x8d87b2(){return _0x41d56e[_0x1e4199([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1e4199([0x76,0x69,0x65,0x77])][_0x1e4199([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1e4199([0x61,0x75,0x74,0x6f]);}function _0x4b4368(){_0x41d56e[_0x1e4199([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1e4199([0x76,0x69,0x65,0x77])][_0x1e4199([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1e4199([0x61,0x75,0x74,0x6f]);}}function _0x40adbb(_0x388fe7){const _0x3e5eea=[new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4bb15b=>setTimeout(_0x4bb15b,0x623ea26c^_0x15edee)),_0x4cb242[_0x1e4199([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x50947b=>{let _0x27d32f=0x0;_0x41d56e[_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c])][_0x1e4199([0x6f,0x6e])](_0x1e4199([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x53e08f,_0x177c93)=>{_0x177c93[0x0][_0x1e4199([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x27d32f++,_0x27d32f==(0x62379d58^_0x15edee)&&(_0x50947b(),_0x53e08f[_0x1e4199([0x6f,0x66,0x66])]());});}))];return window[_0x1e4199([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1e4199([0x72,0x61,0x63,0x65])](_0x3e5eea)[_0x1e4199([0x74,0x68,0x65,0x6e])](()=>_0x388fe7);}async function _0x1e3064(){await _0x4cb242,_0x41d56e[_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c])][_0x1e4199([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2dce31,_0x41d56e[_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c])][_0x1e4199([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2dce31,_0x41d56e[_0x1e4199([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1e4199([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5c9e49(_0x290414){const _0x2f066c=_0xe4c67e();_0x41d56e[_0x2f066c]=_0x1e4199([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x290414,_0x290414!=_0x1e4199([0x56,0x61,0x6c,0x69,0x64])&&_0x1e3064();}function _0xe4c67e(){const _0x5c67bf=window[_0x1e4199([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1e4199([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1e4199([0x6e,0x6f,0x77])]())[_0x1e4199([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1e4199([0x2e]),'');let _0x59cae2=_0x1e4199([0x61]);for(let _0x5c1352=0x0;_0x5c1352<_0x5c67bf[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5c1352+=0x2){let _0x4d187b=window[_0x1e4199([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5c67bf[_0x1e4199([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5c1352,_0x5c1352+0x2));_0x4d187b>=_0x137395[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4d187b-=_0x137395[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x59cae2+=_0x137395[_0x4d187b];}return _0x59cae2;}function _0x3395d8(){const _0x3293cb=_0x4acbf5[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e]));if(0x3!=_0x3293cb[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x5314d5(_0x3293cb[0x1]);function _0x5314d5(_0x137d4f){const _0x1166dd=_0xc6aac(_0x137d4f);return _0x1166dd&&_0x282c46()?_0x1166dd:null;function _0x282c46(){const _0x4e3434=_0x1166dd[_0x1e4199([0x6a,0x74,0x69])],_0x504429=window[_0x1e4199([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4e3434[_0x1e4199([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4e3434[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x19b612={..._0x1166dd,[_0x1e4199([0x6a,0x74,0x69])]:_0x4e3434[_0x1e4199([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4e3434[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x19b612[_0x1e4199([0x76,0x63])],_0x398c9a(_0x19b612)==_0x504429;}}}async function _0xa4eac4(){let _0x572ea2=!0x0;try{const _0x2f0692=_0x4acbf5[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])](_0x1e4199([0x2e])),[_0x165110,_0x219646,_0x295865]=_0x2f0692;return _0x479e02(_0x165110),await _0x58bccf(_0x165110,_0x219646,_0x295865),_0x572ea2;}catch{return!0x1;}function _0x479e02(_0x30037e){const _0x321c45=_0xc6aac(_0x30037e);_0x321c45&&_0x321c45[_0x1e4199([0x61,0x6c,0x67])]==_0x1e4199([0x45,0x53,0x32,0x35,0x36])||(_0x572ea2=!0x1);}async function _0x58bccf(_0x524b02,_0xa5338,_0x2d5466){const _0xda159d=window[_0x1e4199([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1e4199([0x66,0x72,0x6f,0x6d])](_0x3737c0(_0x2d5466),_0x5a5b6f=>_0x5a5b6f[_0x1e4199([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x19e05b=new window[(_0x1e4199([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1e4199([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x524b02+_0x1e4199([0x2e])+_0xa5338),_0x52c9ac=window[_0x1e4199([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1e4199([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x52c9ac)return;const _0x4fb9a0=await _0x52c9ac[_0x1e4199([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1e4199([0x6a,0x77,0x6b]),_0x44a167,{[_0x1e4199([0x6e,0x61,0x6d,0x65])]:_0x1e4199([0x45,0x43,0x44,0x53,0x41]),[_0x1e4199([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1e4199([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1e4199([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x52c9ac[_0x1e4199([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1e4199([0x6e,0x61,0x6d,0x65])]:_0x1e4199([0x45,0x43,0x44,0x53,0x41]),[_0x1e4199([0x68,0x61,0x73,0x68])]:{[_0x1e4199([0x6e,0x61,0x6d,0x65])]:_0x1e4199([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4fb9a0,_0xda159d,_0x19e05b)||(_0x572ea2=!0x1);}}function _0xc6aac(_0x490ac2){return _0x490ac2[_0x1e4199([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1e4199([0x65,0x79]))?JSON[_0x1e4199([0x70,0x61,0x72,0x73,0x65])](_0x3737c0(_0x490ac2)):null;}function _0x3737c0(_0x444a36){return window[_0x1e4199([0x61,0x74,0x6f,0x62])](_0x444a36[_0x1e4199([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1e4199([0x2b]))[_0x1e4199([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1e4199([0x2f])));}function _0x398c9a(_0x12a7d2){let _0x3d56e8=0x1505;function _0x509a6e(_0x42a39d){for(let _0x3227ef=0x0;_0x3227ef<_0x42a39d[_0x1e4199([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3227ef++){const _0x48735b=_0x42a39d[_0x1e4199([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3227ef);_0x3d56e8=(_0x3d56e8<<0x5)+_0x3d56e8+_0x48735b,_0x3d56e8&=_0x3d56e8;}}function _0x4da0d0(_0x194d56){Array[_0x1e4199([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x194d56)?_0x194d56[_0x1e4199([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4da0d0):_0x194d56&&typeof _0x194d56==_0x1e4199([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1e4199([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x194d56)[_0x1e4199([0x73,0x6f,0x72,0x74])]()[_0x1e4199([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x134fd2,_0x234a81])=>{_0x509a6e(_0x134fd2),_0x4da0d0(_0x234a81);}):_0x509a6e(window[_0x1e4199([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x194d56));}return _0x4da0d0(_0x12a7d2),_0x3d56e8>>>0x0;}function _0x596d74(_0x3371c9){return _0x3371c9[_0x1e4199([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1e4199([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1e4199([0x30]));}function _0x273967(_0x22c180){return _0x22c180[_0x1e4199([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1e4199([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1e4199([0x6a,0x6f,0x69,0x6e])]('');}function _0x2dce31(){}function _0x1e4199(_0x40143e){return _0x40143e['map'](_0x3b4ced=>String['fromCharCode'](_0x3b4ced))['join']('');}_0x5c9e49(await _0x5ad2f5());}(this);}['showFakeVisualSelection'](){const _0x534230=this['editor']['model'];_0x534230['change'](_0x2baf41=>{const _0x1a49f7=_0x534230['document']['selection']['getRanges']();let _0x314872=0x0;for(const _0x2463e9 of _0x1a49f7){const _0x4a24eb=f+':'+_0x314872;if(_0x534230['markers']['has'](_0x4a24eb))_0x2baf41['updateMarker'](_0x4a24eb,{'range':_0x2463e9});else{if(_0x2463e9['start']['isAtEnd']){const _0x125c23=_0x2463e9['start']['getLastMatchingPosition'](({item:_0x336a53})=>!_0x534230['schema']['isContent'](_0x336a53),{'boundaries':_0x2463e9});_0x2baf41['addMarker'](_0x4a24eb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2baf41['createRange'](_0x125c23,_0x2463e9['end'])});}else _0x2baf41['addMarker'](_0x4a24eb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2463e9});}_0x314872++;}});}['hideFakeVisualSelection'](){const _0x1a7024=this['editor']['model'],_0x43fdde=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x43fdde['length']&&_0x1a7024['change'](_0x5518de=>{_0x43fdde['forEach'](_0xbed6ed=>{_0x5518de['removeMarker'](_0xbed6ed);});});}['insertContent'](_0x2a2f49,_0x3fcd95){const _0x56026b=this['_getAISelection'](),_0x4a66e9=_0x3fcd95||_0x56026b['getFirstRange']();this['editor']['model']['canEditAt'](_0x4a66e9)&&this['editor']['model']['change'](_0x1fc971=>{this['hideFakeVisualSelection'](),_0x3fcd95||this['_resetContentOfSelectedTableCells'](_0x1fc971,_0x56026b),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4a66e9,'writer':_0x1fc971,'html':_0x2a2f49});});}['insertContentBelow'](_0x4c5bab){const {model:_0x12906d}=this['editor'],_0x3d5285=this['_getAISelection']();_0x12906d['change'](()=>{const _0x1ac544=this['_prepareTableInsertBelowPosition'](_0x4c5bab,_0x3d5285)||this['_getDefaultInsertBelowPosition'](_0x3d5285);this['insertContent'](_0x4c5bab,_0x1ac544);});}['_getAISelection'](){const _0x4a3863=this['editor']['model'],_0xf4d27d=Array['from'](_0x4a3863['markers']['getMarkersGroup'](f))['map'](_0x27ca25=>_0x27ca25['getRange']());return _0x4a3863['createSelection'](_0xf4d27d);}['_pasteHTMLUsingClipboard']({writer:_0x939135,html:_0x37790c,insertAt:_0x6690d3}){const {view:_0x180e4b}=this['editor']['editing'],_0x1ed364=this['editor']['plugins']['get'](_0x102e51),_0x5ab9db=new gt();_0x5ab9db['setData']('text/html',_0x37790c);const _0x32fd75=new ClipboardEvent('paste',{'clipboardData':_0x5ab9db}),_0x3aea6c=new _0x333171(_0x180e4b,_0x32fd75,{'dataTransfer':new _0x4e16c7(_0x5ab9db)});_0x939135['setSelection'](_0x6690d3);const _0x5b66db=(_0xa7d0cb,_0x4ae823)=>{_0x4ae823['resultRange']&&_0x939135['setSelection'](_0x4ae823['resultRange']);};_0x1ed364['once']('contentInsertion',_0x5b66db,{'priority':'lowest'}),_0x180e4b['document']['fire']('paste',_0x3aea6c),_0x1ed364['off']('contentInsertion',_0x5b66db);}['_getDefaultInsertBelowPosition'](_0xadfa57){const {model:_0x4b385b}=this['editor'],_0x20d6af=Array['from'](_0xadfa57['getSelectedBlocks']());return _0x20d6af['length']?_0x4b385b['createPositionAfter'](_0x20d6af['pop']()):_0xadfa57['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x4b47fa,_0x4dc7ba){const {model:_0x55cf99,plugins:_0x4401cc}=this['editor'];if(_0x4401cc['has']('TableUtils')){const _0x2e97c4=_0x4401cc['get']('TableUtils')['getSelectedTableCells'](_0x4dc7ba);if(_0x2e97c4['length']){const _0x365552=this['_getTableRowCountFromContent'](_0x4b47fa),_0x39d5d7=this['_createEmptyTableRows'](_0x2e97c4,_0x365552);return _0x55cf99['createPositionAt'](_0x39d5d7,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1870a2){const _0x3633c0=this['editor']['plugins']['get']('TableUtils'),_0x26bd26=this['editor']['data']['parse'](_0x1870a2),_0x23a154=Array['from'](_0x26bd26['getChildren']())['filter'](_0xd6e9f1=>_0xd6e9f1['is']('element','table'));let _0x36bc83=0x0;return _0x23a154['forEach'](_0x368431=>{_0x36bc83+=_0x3633c0['getRows'](_0x368431);}),_0x36bc83;}['_createEmptyTableRows'](_0x18d122,_0x480cd4){const _0x2019ca=this['editor']['plugins']['get']('TableUtils'),_0x551752=_0x2019ca['getRowIndexes'](_0x18d122),_0x4c702b=_0x2019ca['getColumnIndexes'](_0x18d122),_0x391dc5=_0x551752['last']+0x1,_0x54509a=_0x4c702b['first'],_0x204ec1=_0x18d122[0x0]['findAncestor']('table');for(let _0x260266=0x0;_0x260266<_0x480cd4;_0x260266++)_0x2019ca['insertRows'](_0x204ec1,{'at':_0x391dc5});return _0x204ec1['getChild'](_0x391dc5)['getChild'](_0x54509a);}['_resetContentOfSelectedTableCells'](_0x3c43af,_0x1c7412){const {plugins:_0x46f39b}=this['editor'],{model:_0x37ad81}=_0x3c43af;if(!_0x46f39b['has']('TableUtils'))return;_0x46f39b['get']('TableUtils')['getSelectedTableCells'](_0x1c7412)['length']&&_0x37ad81['deleteContent'](_0x1c7412);}}class E extends _0x24e675{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1ed59c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x113acc){super(_0x113acc),this['name']='AIRequestError';}}function i(_0x9dcce,_0x671b0,_0x3c50b6){const t=_0x9dcce['t'];switch(_0x671b0){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x3c50b6);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3c50b6);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x3c50b6);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0x671b0;}}class j extends _0x2952ed{['_commandDefinitions'];constructor(_0x34a0d8,_0x5b12e7){super(_0x34a0d8),this['_commandDefinitions']=_0x5b12e7,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1cadd1,_0x2b579b,_0x181a66)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x181a66));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x217576,_0x2348ae,_0x5e1fa8)=>{this['enabledCommandsIds']=_0x5e1fa8?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2f2f32=this['editor']['model'];this['_hasContext']=function(_0xaabc56){const _0x201d6e=_0xaabc56['document']['selection'];return _0x201d6e['isCollapsed']?0x0!==[..._0x201d6e['getSelectedBlocks']()]['length']&&![..._0x201d6e['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xaabc56['hasContent'](_0x201d6e['getFirstRange']());}(_0x2f2f32);const _0xf73d28=_0x2f2f32['document']['selection'],_0x43e715=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x29082c of _0xf73d28['getRanges']())for(const _0x189f38 of _0x29082c['getItems']())if(_0x189f38['is']('element')&&_0x43e715['includes'](_0x189f38['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x34243d='',_0x39bbb3='',_0x2ff279='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x34243d,_0x39bbb3,_0x2ff279);}}function G(_0x358cf0,_0x2434fe){const _0x4e7868=new Set();for(const _0x26cfc9 of _0x358cf0['values']())(_0x2434fe||!0x1===_0x26cfc9['requiresContent'])&&_0x4e7868['add'](_0x26cfc9['id']);return Array['from'](_0x4e7868);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
- _0x370eab(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5ac885,_0x3bc34e,_0x290f63){super(),this['editor']=_0x5ac885,this['textAdapter']=_0x3bc34e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x290f63,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x305c5e,_0x1e9c6c,_0x2039ea)=>{this['view']['value']=this['_sanitizeHTML'](_0x2039ea);}),this['listenTo'](this['view'],'submitPrompt',(_0x27f006,_0x42ca14)=>{const _0x446636=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x42ca14,_0x446636,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x259a6f,query:_0x1df33d,htmlContent:_0x3e6c01,label:_0x1ce8fb,mainActionLabel:_0x5eb675}){this['view']['prompt']=_0x1ce8fb,this['view']['mainAction']=_0x5eb675,this['initialContext']=_0x3e6c01,_0x1df33d&&(this['view']['isRendered']?this['_handleQuery'](_0x1df33d,_0x3e6c01,_0x259a6f,_0x1ce8fb):this['view']['once']('render',()=>{this['_handleQuery'](_0x1df33d,_0x3e6c01,_0x259a6f,_0x1ce8fb);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x51254e,_0x2e84f7,_0x4fe2bc,_0x43ffc9){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2e84f7,this['previousQuery']=_0x51254e,this['previousLabel']=_0x43ffc9||_0x51254e,this['previousActionId']=_0x4fe2bc,new Promise(_0x3d2405=>{this['textAdapter']['makeRequest']({'query':_0x51254e,'context':_0x2e84f7,'onData':_0x8fb481=>{this['currentResponse']=_0x8fb481,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4fe2bc})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5733c4=>{_0x5733c4 instanceof R?this['view']['handleError'](_0x5733c4['message']):this['view']['handleError'](),_0x3d2405();})['finally'](()=>{this['stopProcessing'](),_0x3d2405();});});}['_parseAndNormalizeContent'](_0x195821,_0x358f5a=!0x1){const _0x1b11a5=Z['exec'](_0x195821);_0x195821=_0x1b11a5?_0x195821['substring'](_0x1b11a5[0x1]['length']):_0x195821['length']<0x64&&!_0x358f5a?'':this['_stripMarkdownSyntax'](_0x195821);const _0x49eb4a=this['_domParser']['parseFromString'](_0x195821,'text/html');if(_0x1b11a5){const _0x18fa7c=Array['from'](_0x49eb4a['body']['childNodes']);_0x18fa7c['reverse']();for(const _0x139cf2 of _0x18fa7c){if(_0x139cf2['nodeType']==Node['ELEMENT_NODE'])break;_0x139cf2['remove']();}}const _0x261d91=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x49eb4a['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x261d91);const _0x1831e7=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x4e5800=this['editor']['data']['toModel'](_0x261d91);return _0x1831e7||_0x4e5800['markers']['clear'](),this['editor']['data']['stringify'](_0x4e5800);}['_normalizeResponseHeadings'](_0xc45f96){const _0x170e72=new _0x46e462(this['editor']['editing']['view']['document']),_0x2e219d=new _0x39bfc2({'name':/^h[1-5]$/}),_0x1527cc=[];let _0x4662cf=!0x1;for(const _0x56408b of _0xc45f96)_0x56408b['is']('element')&&_0x2e219d['match'](_0x56408b)&&(_0x1527cc['push'](_0x56408b),'h1'==_0x56408b['name']&&(_0x4662cf=!0x0));if(_0x4662cf){for(const _0x3c6302 of _0x1527cc)_0x170e72['rename']('h'+(parseInt(_0x3c6302['name'][0x1])+0x1),_0x3c6302);}}['_isH1TagSupportEnabled'](){const {data:_0x2020d8,editing:_0xc66567}=this['editor'],_0x595cbb=_0x2020d8['htmlProcessor']['toView']('<h1></h1>'),_0x2375d8=_0x2020d8['toView'](_0x2020d8['toModel'](_0x595cbb));return!!_0xc66567['view']['domConverter']['viewToDom'](_0x2375d8)['querySelector']('h1');}['_sanitizeHTML'](_0x9a40a7){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x9a40a7),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x57bb03){const _0x577d0f=_0x57bb03['trim']();return _0x577d0f['startsWith']('```html')?_0x577d0f['endsWith']('```')?_0x577d0f['substring'](0x7,_0x577d0f['length']-0x3):_0x577d0f['substring'](0x7):_0x57bb03;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0xbc6eee){super(_0xbc6eee),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3459b4=>i(_0xbc6eee,'AI_'+_0x3459b4['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0xbc6eee,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0xbc6eee,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0xbc6eee,'Stop'));const _0x4596d0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4596d0['if']('isVisible','ck-hidden',_0x967372=>!_0x967372)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3ffbf9,_0x53e2c4){const _0x5e89d0=new _0x269602(this['locale']);return _0x5e89d0['set']({'label':_0x3ffbf9,'class':_0x53e2c4||'','isVisible':!0x0,'withText':!0x0}),_0x5e89d0;}}class Y extends _0x437a39{['contentFieldView'];['copyButtonView'];constructor(_0x51f5fb,_0x23f1d5=''){super(_0x51f5fb),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x136120=this['bindTemplate'];this['contentFieldView']=new At(_0x51f5fb,_0x23f1d5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x136120['if']('isVisible','ck-hidden',_0x34d31b=>!_0x34d31b)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x136120['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x47cd86=!0x1;this['on']('change:value',(_0x1a240e,_0x3c2560,_0x45b6f6)=>{const _0x36e25c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x45b6f6),this['isProcessing']&&_0x36e25c&&!_0x47cd86&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3508fa,_0x20399e,_0x5a8e5e)=>{_0x47cd86=!0x1,_0x5a8e5e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x47cd86=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x47cd86=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x154b7a=this['locale'],_0x11ed4f=new _0x269602(this['locale']),_0x473665='ck-ai-form__copy-button';return _0x11ed4f['set']({'label':i(_0x154b7a,'Copy'),'icon':_0x1a86c0,'class':_0x473665,'tooltip':!0x0}),_0x11ed4f['bind']('isVisible')['to'](this,'value',_0x1c6985=>!!_0x1c6985),_0x11ed4f['bind']('isEnabled')['to'](this,'isProcessing',_0x320d64=>!_0x320d64),_0x11ed4f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x11ed4f['icon']=_0x3b483a,_0x11ed4f['class']=_0x473665+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x11ed4f['icon']=_0x1a86c0,_0x11ed4f['class']=_0x473665;},0x3e8);}),_0x11ed4f;}['_copyHTMLToClipboard'](_0x27fba5){const {window:_0x55bbb9,document:_0x4d70d1}=_0x2dbbc9;if(_0x55bbb9['ClipboardItem']){const {Blob:_0x3ffa1a,ClipboardItem:_0x248569}=_0x55bbb9,_0x2ec80d=[new _0x248569({'text/html':new _0x3ffa1a([_0x27fba5['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3ffa1a([_0x27fba5['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2ec80d);}else{const _0x29492c=_0x4d70d1['createElement']('div');_0x29492c['style']['position']='absolute',_0x29492c['style']['left']='-9999px',_0x29492c['innerHTML']='<span>[</span>'+_0x27fba5['innerHTML']+'<span>]</span>',_0x4d70d1['body']['appendChild'](_0x29492c);const _0x3830b4=_0x4d70d1['createRange']();_0x3830b4['setStartAfter'](_0x29492c['firstElementChild']),_0x3830b4['setEndBefore'](_0x29492c['lastElementChild']);const _0x2ad474=_0x55bbb9['getSelection']();_0x2ad474['removeAllRanges'](),_0x2ad474['addRange'](_0x3830b4),_0x4d70d1['execCommand']('copy'),_0x29492c['remove']();}}}class At extends _0x437a39{constructor(_0x1e3e8c,_0x4ee290=''){super(_0x1e3e8c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4ee290,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x20bc62){this['element']['innerHTML']=_0x20bc62;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2976c4=new _0x437a39(),_0x3a5a68=this['locale'],_0x1033c9=new _0x4d4ebe();return _0x1033c9['isVisible']=!0x0,_0x2976c4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1033c9,{'text':i(_0x3a5a68,'AI\x20is\x20writing...')}]}),_0x2976c4['render'](),_0x2976c4;}}class st extends _0x437a39{constructor(_0x4b53b8,_0x1ef90a=''){super(_0x4b53b8);const _0x516b70=new rt(),_0x495ac8=this['bindTemplate'];this['set']('text',_0x1ef90a),_0x516b70['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x516b70,{'text':_0x495ac8['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x14b126,_0x24668d){super(_0x14b126,_0x24668d),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x4f334c,_0x5c0934)=>{_0x4f334c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5c0934());});}['_createSubmitButton'](){const _0x22a822=new _0x269602(this['locale']),_0x462e79=this['locale'];return _0x22a822['set']({'icon':ht,'label':i(_0x462e79,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x22a822['on']('execute',()=>{this['submit']();}),_0x22a822['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x51b271,_0x371958)=>!_0x51b271&&_0x371958),_0x22a822;}['_createShowHistoryButton'](){const _0x4a9913=new _0x269602(this['locale']),_0x301cd1=this['resultsView'],_0x4bb27d=this['locale'];_0x4a9913['set']({'label':i(_0x4bb27d,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4a9913['bind']('isOn')['to'](_0x301cd1,'isVisible'),_0x4a9913['bind']('isEnabled')['to'](this,'isEnabled'),_0x4a9913['on']('execute',()=>{_0x301cd1['isVisible']=!_0x301cd1['isVisible'],_0x301cd1['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4486b9=()=>{_0x2dbbc9['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x42cef0=new it(this['queryView']['fieldView']['element']),_0x2981d4=_0x42cef0['width'],_0x2cf20f='rtl'===_0x4bb27d['uiLanguageDirection']?'left':'right';_0x42cef0['excludeScrollbarsAndBorders'](),_0x4a9913['element']['style'][_0x2cf20f]=_0x2981d4-_0x42cef0['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4486b9),this['on']('render',_0x4486b9),_0x4a9913;}['submit'](){const _0x54efeb=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x54efeb);}['focus'](_0x24662a){-0x1===_0x24662a?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x4420ff){super(_0x4420ff),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4420ff,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b84dd=0x0;for(const _0x3481b2 of this['items'])_0x2b84dd+=_0x3481b2['items']['length'];return{'resultsCount':_0x2b84dd,'totalItemsCount':_0x2b84dd};}['_createClearHistoryButton'](){const _0x410314=this['locale'],_0x2acbb1=new _0x269602(this['locale']);return _0x2acbb1['set']({'label':'('+i(_0x410314,'Clear')+')','withText':!0x0}),_0x2acbb1['on']('execute',()=>this['fire']('clearHistory')),_0x2acbb1;}}class bt extends xt{constructor(_0x6a9960){super();const _0x286537=new kt(),_0x1afc59=new _0x269602(this['locale'],_0x286537);this['children']['add'](_0x1afc59),_0x1afc59['set']({'label':_0x6a9960['prompt'],'withText':!0x0}),_0x1afc59['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x6a9960['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x4ccbc3{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x328b1f,_0x1067c5)=>{const _0x399f2a=os(_0x1067c5['prompt']);for(const _0x226b0c of this)if(_0x226b0c!=_0x1067c5&&os(_0x226b0c['prompt'])===_0x399f2a){this['remove'](_0x226b0c);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x16ae48=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x16ae48));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x4b67b2=>_0x4b67b2)));}}function os(_0x5b61a2){return _0x5b61a2['toLowerCase']()['trim']();}class _ extends _0x437a39{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x13b519,_0x5f3ff9,_0x3b8deb=''){super(_0x13b519),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x13b519),this['contentArea']=new Y(_0x13b519,_0x3b8deb),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x3f951c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5f3ff9],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3f951c['if']('isError','ck-hidden',_0x2214ad=>!_0x2214ad)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x4c69c1=0x1){-0x1===_0x4c69c1?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x7df2d5=this['locale'],_0x2cdde4=new ct(_0x7df2d5,{'queryView':{'label':i(_0x7df2d5,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x7df2d5,'Empty\x20history'),'secondary':i(_0x7df2d5,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x2cdde4['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3ad993,_0x3ffba9)=>_0x3ad993&&!_0x3ffba9),this['listenTo'](_0x2cdde4,'submit',(_0x5e5236,_0x40d095)=>{this['prompt']=_0x40d095;const _0xf53b4b=yt(_0x40d095);this['fire']('submitPrompt',_0xf53b4b),_0x40d095['trim']()&&this['_promptHistory']['add']({'prompt':_0xf53b4b},0x0);},{'priority':'high'}),_0x2cdde4;}['_createHistoryView'](){const _0x8ef7e3=new ft(this['locale']);return _0x8ef7e3['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x8ef7e3['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x8ef7e3;}['_createToolbar'](){const _0x3463c8=new lt(this['locale']);return _0x3463c8['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x38b380,_0x22ae0e,_0x29c668)=>_0x38b380&&!_0x22ae0e&&!!_0x29c668),_0x3463c8['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3463c8['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3dae02,_0x3deb9a,_0x36783f)=>_0x3dae02&&!_0x3deb9a&&!!_0x36783f),_0x3463c8['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3463c8['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x34fc7a,_0x2a836c)=>_0x34fc7a&&!_0x2a836c),_0x3463c8['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3463c8['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3463c8['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3463c8;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5126ba=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5126ba,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x1a9728){const _0xd4ba1f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x1a9728||i(_0xd4ba1f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x24e675{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x514629,a,E,_0x54ad93];}constructor(_0x2b5928){super(_0x2b5928),_0x2b5928['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2b5928['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2b5928['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2b5928['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1acf7a}=this;this['_aiAdapter']=_0x1acf7a['plugins']['get'](E),this['_dialog']=_0x1acf7a['plugins']['get'](_0x54ad93),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x64c30f=new j(_0x1acf7a,Array['from'](this['_commandDefinitions']['values']()));_0x1acf7a['commands']['add']('showAIAssistant',_0x64c30f),_0x1acf7a['ui']['componentFactory']['add']('aiCommands',_0x4d879d=>{const _0x4fe0d1=_0x58b909(_0x4d879d);return _0x4fe0d1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4fe0d1['buttonView']['set']({'label':i(_0x4d879d,'AI\x20Commands'),'icon':_0x3cb38c,'tooltip':!0x0}),_0x4fe0d1['on']('execute',_0x2ae30b=>this['_onExecute'](_0x2ae30b['source']['id'])),_0x5511ab(_0x4fe0d1,_0x1acf7a['ui']['view']['body'],function(_0xf9035f){const _0x201c06=o(_0xf9035f['config']['get']('ai.aiAssistant.commands'),_0xf9035f['locale']),_0xce0cc9=U(_0xf9035f,_0x201c06)['filter'](_0x288215=>_0x288215['commands']['length']);if(0x1===_0xce0cc9['length'])return U(_0xf9035f,_0xce0cc9[0x0]['commands'])['map'](_0x13c17c=>({'id':_0x13c17c['id'],'label':_0x13c17c['label']}));return _0xce0cc9['map'](_0x281ad7=>{const {groupId:_0x2c4cc1,groupLabel:_0x49852b,commands:_0x4554c0}=_0x281ad7,_0x1eb13e=U(_0xf9035f,_0x4554c0)['map'](_0x4f417c=>({'id':_0x4f417c['id'],'label':_0x4f417c['label']}));return{'id':_0x2c4cc1,'menu':_0x49852b||_0x2c4cc1,'children':_0x1eb13e};});}(_0x1acf7a),{'ariaLabel':i(_0x4d879d,'AI\x20Commands')}),_0x4fe0d1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x64c30f['on']('change:enabledCommandsIds',_0x346a31),_0x4fe0d1['menuView']['once']('render',_0x346a31),_0x4fe0d1;function _0x346a31(){_0x4fe0d1['isEnabled']=_0x64c30f['enabledCommandsIds']['length']>0x0;for(const _0x5f22c8 of _0x4fe0d1['menuView']['buttons'])_0x5f22c8['isEnabled']=_0x64c30f['enabledCommandsIds']['includes'](_0x5f22c8['id']);}}),_0x1acf7a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3c0856=>{const _0x22e081=new _0x595115(_0x3c0856);_0x22e081['buttonView']['set']({'label':i(_0x3c0856,'AI\x20Commands'),'icon':_0x3cb38c}),_0x22e081['bind']('isEnabled')['to'](_0x64c30f,'enabledCommandsIds',_0x1818d4=>_0x1818d4['length']>0x0);const _0x1ec547=o(_0x1acf7a['config']['get']('ai.aiAssistant.commands'),_0x3c0856);return this['_populateMenuBarMenu'](_0x64c30f,_0x22e081,_0x1ec547,_0x125022=>this['_onExecute'](_0x125022)),_0x22e081;}),_0x1acf7a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x526b1f=this['_createAIAssistantUIButton'](_0x269602);return _0x526b1f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x526b1f;}),_0x1acf7a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2181fa=this['_createAIAssistantUIButton'](_0x53d973);return _0x2181fa['set']({'role':'menuitemcheckbox'}),_0x2181fa;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3894d3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xc87d84;for(const _0x476d57 in _0x3894d3){const _0x401140=_0x476d57,_0x578c01=_0x3894d3[_0x401140];if('aiLicenseKeyValid'==_0x578c01||'aiLicenseKeyInvalid'==_0x578c01||'aiLicenseKeyExpired'==_0x578c01||'aiLicenseKeyDomainLimit'==_0x578c01||'aiLicenseKeyNotAllowed'==_0x578c01||'aiLicenseKeyEvaluationLimit'==_0x578c01||'aiLicenseKeyTrialLimit'==_0x578c01||'aiLicenseKeyUsageLimit'==_0x578c01){delete _0x3894d3[_0x401140],_0xc87d84=_0x578c01,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xc87d84&&_0x3894d3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xc87d84&&_0x3894d3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xc87d84&&_0x3894d3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xc87d84&&_0x3894d3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x688fab='',_0xcae7ed='',_0x2b8c3d='custom'){const _0x53968a=this['editor'],_0x1cf263=_0x53968a['editing']['view'],_0x506baf=_0x53968a['plugins']['get'](a),_0x3af8d9=_0x53968a['plugins']['get'](_0x514629);_0x506baf['showFakeVisualSelection']();const _0x3d9473=new w(),_0x15cc8d=new ClipboardEvent('copy',{'clipboardData':_0x3d9473}),_0x5a4d8f=new _0x4e16c7(_0x3d9473),_0x107b46=new _0x333171(_0x1cf263,_0x15cc8d,{'dataTransfer':_0x5a4d8f});_0x3af8d9['_forceMarkersCopy']('comment',()=>{_0x1cf263['document']['fire']('copy',_0x107b46);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x53968a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x51cafa=_0x5a4d8f['getData']('text/html');const _0x344207=_0x53968a['model']['document']['selection'],_0x2355d7=Array['from'](_0x344207['getRanges']());0x1===_0x2355d7['length']&&_0x2355d7[0x0]['isFlat']&&!_0x344207['getSelectedElement']()&&''!==_0x51cafa['replace'](/&nbsp;/g,'')['trim']()&&(_0x51cafa='<p>'+_0x51cafa+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2b8c3d,'query':_0x688fab,'htmlContent':_0x51cafa,'label':_0xcae7ed,'mainActionLabel':M[_0x53968a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3e1a5d,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x550034['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x506baf['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2d783d=new Map(),_0xe92cd0=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x53fe70 of _0xe92cd0)for(const _0x48ac68 of _0x53fe70['commands'])_0x2d783d['set'](_0x48ac68['id'],{..._0x48ac68,'groupId':_0x53fe70['groupId'],'groupLabel':_0x53fe70['groupLabel']||_0x53fe70['groupId']});return _0x2d783d;}['_createAIAssistantUIButton'](_0x5c061f){const _0x5dba79=this['editor'],_0x2a8fbc=_0x5dba79['commands']['get']('showAIAssistant'),_0x5a8873=new _0x5c061f(_0x5dba79['locale']);return _0x5a8873['set']({'label':i(_0x5dba79['locale'],'AI\x20Assistant'),'icon':_0x3e1a5d,'isToggleable':!0x0}),_0x5a8873['bind']('isEnabled')['to'](_0x2a8fbc),_0x5a8873['bind']('isOn')['to'](this['_dialog'],'id',_0x33586e=>'aiAssistant'===_0x33586e),this['listenTo'](_0x5a8873,'execute',()=>{_0x5a8873['isOn']?this['hideUI']():_0x2a8fbc['execute']();}),_0x5a8873;}['_initView'](){const _0x263157=this['editor']['plugins']['get'](a);this['_formView']=new _(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x263157['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x263157['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x18da1c,ui:{ariaLiveAnnouncer:_0x3886dd}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x44ef41,_0x28a643,_0x33619b)=>{const _0x3a737d=this['_aiAssistantController']['currentContext'];_0x33619b?_0x3886dd['announce'](i(_0x18da1c,'AI\x20is\x20writing')):_0x3a737d&&_0x3886dd['announce'](i(_0x18da1c,'Generated\x20content:\x20%0',_0x3a737d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x4f0640,_0x12224d,_0x4514b7)=>{if(_0x4514b7){const _0x49525f=this['_formView']['errorView']['text'];_0x3886dd['announce'](i(_0x18da1c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x49525f));}});}['_onExecute'](_0x153d02){const _0x1300b3=this['_commandDefinitions']['get'](_0x153d02),_0x7e22c1=this['editor'],_0x1802f9=_0x7e22c1['model']['document']['selection'],_0x1d697b=_0x7e22c1['commands']['get']('showAIAssistant'),_0x313c54=_0x7e22c1['plugins']['get'](a),_0x3d983e=''+(_0x1300b3['groupId']!==x?_0x1300b3['groupLabel']+':\x20':'')+_0x1300b3['label'];if(!0x1!==_0x1300b3['requiresContent']&&_0x1802f9['isCollapsed']){const _0x1e7cb9=_0x9bd64f(_0x1802f9['getSelectedBlocks']())||_0x7e22c1['model']['schema']['getLimitElement'](_0x1802f9);_0x7e22c1['model']['change'](_0x4cb1ba=>{_0x4cb1ba['setSelection'](_0x1e7cb9,'in');});}_0x313c54['showFakeVisualSelection'](),_0x1d697b['execute'](_0x1300b3['prompt'],_0x3d983e,'command:'+_0x153d02);}['_populateMenuBarMenu'](_0xfe66bc,_0xab045,_0x8601fc,_0x4d4807){const _0x28c3e7=this['editor'],_0x2f37bd=_0x28c3e7['locale'],_0x28f67c=new _0x10d556(_0x2f37bd),_0x39d755=U(_0x28c3e7,_0x8601fc)['filter'](_0x2d3db2=>_0x2d3db2['commands']['length']);0x1===_0x39d755['length']?this['_getMenuBarGroupButtons']({'command':_0xfe66bc,'commands':_0x39d755[0x0]['commands'],'parentMenuView':_0xab045,'onExecute':_0x4d4807})['forEach'](_0x170de0=>_0x28f67c['items']['add'](_0x170de0)):_0x39d755['forEach'](({groupId:_0x10bcfb,groupLabel:_0x5cb131,commands:_0x643e64})=>{const _0x3c3d0c=new _0x48fceb(_0x2f37bd,_0xab045),_0x125e20=new _0x595115(_0x2f37bd),_0x594bc7=new _0x10d556(_0x2f37bd),_0x457081=this['_getMenuBarGroupButtons']({'command':_0xfe66bc,'commands':_0x643e64,'parentMenuView':_0x125e20,'onExecute':_0x4d4807});_0x125e20['buttonView']['set']({'label':_0x5cb131||_0x10bcfb}),_0x125e20['delegate']('execute')['to'](_0xab045),_0x594bc7['items']['addMany'](_0x457081),_0x125e20['panelView']['children']['add'](_0x594bc7),_0x3c3d0c['children']['add'](_0x125e20),_0x28f67c['items']['add'](_0x3c3d0c);}),_0xab045['panelView']['children']['add'](_0x28f67c);}['_getMenuBarGroupButtons']({command:_0x339efb,commands:_0x517602,parentMenuView:_0x2b18e0,onExecute:_0x32c342}){const _0x36212e=this['editor'],_0x44de13=_0x36212e['locale'];return U(_0x36212e,_0x517602)['map'](_0x259cef=>{const _0x294650=new _0x48fceb(_0x44de13,_0x2b18e0),_0x3b7604=new _0x53d973(_0x44de13);return _0x3b7604['set']({'label':_0x259cef['label']}),_0x3b7604['delegate']('execute')['to'](_0x2b18e0),_0x3b7604['on']('execute',()=>_0x32c342(_0x259cef['id'])),_0x3b7604['bind']('isEnabled')['to'](_0x339efb,'enabledCommandsIds',_0x4404ce=>_0x4404ce['includes'](_0x259cef['id'])),_0x294650['children']['add'](_0x3b7604),_0x294650;});}}function B(_0x36828a,_0x4cb601){return void 0x0!==_0x36828a['order']&&void 0x0===_0x4cb601['order']?0x1:void 0x0===_0x36828a['order']&&void 0x0!==_0x4cb601['order']?-0x1:void 0x0!==_0x36828a['order']&&void 0x0!==_0x4cb601['order']?_0x36828a['order']-_0x4cb601['order']:0x0;}function U(_0x371598,_0xc9dffe){_0xc9dffe['sort'](B);const _0x2ce23f={},_0x1f0484=[];for(const _0x50f005 of _0xc9dffe)if(void 0x0!==_0x50f005['order']){if(_0x50f005['order']in _0x2ce23f)throw new _0x1ed59c('ai-commands-config-order-collision',_0x371598,{'conflictingDefinitions':[_0x50f005,_0x2ce23f[_0x50f005['order']]]});_0x2ce23f[_0x50f005['order']]=_0x50f005,_0x1f0484['splice'](_0x50f005['order'],0x0,_0x50f005);}else _0x1f0484['push'](_0x50f005);return _0x1f0484;}class r extends _0x24e675{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50a8dd){super(_0x50a8dd);const _0x556a69=_0x50a8dd['config'],_0x3d8ce5=_0x50a8dd['locale'];_0x556a69['define']('ai.aiAssistant.preserveComments',!0x0),_0x556a69['define']('ai.aiAssistant.commands',function(_0x13c615){return[{'groupId':'editOrReview','groupLabel':i(_0x13c615,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x13c615,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x13c615,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x13c615,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x13c615,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x13c615,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x13c615,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x13c615,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x13c615,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x13c615,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x13c615,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x13c615,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x13c615,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x13c615,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x13c615,'Change\x20style'),'commands':[{'id':'business','label':i(_0x13c615,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x13c615,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x13c615,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x13c615,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x13c615,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x13c615,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x13c615,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x13c615,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x13c615,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x13c615,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x13c615,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x13c615,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x13c615,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3d8ce5)),_0x556a69['define']('ai.aiAssistant.extraCommandGroups',[]),_0x556a69['define']('ai.aiAssistant.removeCommands',[]);let _0x5852ec=o(_0x556a69['get']('ai.aiAssistant.commands'),_0x3d8ce5);const _0x551449=_0x556a69['get']('ai.aiAssistant.extraCommandGroups'),_0x11e5fd=_0x556a69['get']('ai.aiAssistant.removeCommands');_0x551449['forEach'](_0x11da43=>{const _0xc52b6e=_0x5852ec['find'](_0x52179f=>_0x52179f['groupId']===_0x11da43['groupId']);_0xc52b6e?_0xc52b6e['commands']=_0xc52b6e['commands']['concat'](_0x11da43['commands']):_0x5852ec['push'](_0x11da43);}),_0x5852ec=_0x5852ec['filter'](_0x309341=>!_0x11e5fd['includes'](_0x309341['groupId'])),_0x5852ec['forEach'](_0x10c7f2=>{_0x10c7f2['commands']=_0x10c7f2['commands']['filter'](_0x5769c6=>!_0x11e5fd['includes'](_0x5769c6['id']));}),_0x556a69['set']('ai.aiAssistant.commands',_0x5852ec);}}class P extends _0x24e675{['abortController'];static get['requires'](){return[E];}constructor(_0x275dc5){super(_0x275dc5),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x18d65b){return this['sendRequest'](_0x18d65b)['catch'](_0x45b9c1=>{if(_0x45b9c1 instanceof R)return Promise['reject'](_0x45b9c1);if('AbortError'==_0x45b9c1['name'])return Promise['resolve']();throw console['error'](_0x45b9c1),new _0x1ed59c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0xbb5e3,_0x488f6e){const _0xd71cf=this['editor']['locale'],_0x61ad5a={'Content-Type':'application/json'};if('object'==typeof _0xbb5e3)Object['assign'](_0x61ad5a,_0xbb5e3);else{if(_0xbb5e3)try{const _0xecd46a=await _0xbb5e3(_0x488f6e);Object['assign'](_0x61ad5a,_0xecd46a);}catch{return Promise['reject'](new R(i(_0xd71cf,'AI_ERROR_GET_HEADERS')));}}return _0x61ad5a;}async['_prepareRequestParameters'](_0x141923,_0x4c4afc){const _0x58d2f7=this['editor']['locale'];if('object'==typeof _0x141923)return _0x141923;try{return await _0x141923(_0x4c4afc);}catch{return Promise['reject'](new R(i(_0x58d2f7,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4d6f38){super(_0x4d6f38),_0x4d6f38['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4d6f38['config']['get']('ai.openAI.requestParameters')||_0x4d6f38['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4d6f38['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4d6f38['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4d6f38['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x172508,context:_0x164968,onData:_0x249369,actionId:_0x523ae6}){const _0x403853=this['editor']['locale'],_0x46366d=await this['prepareMessages'](_0x172508,_0x164968,_0x523ae6),_0xb821a0=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x523ae6),_0x1d9f05=await this['_prepareRequestParameters'](this['_requestParameters'],_0x523ae6),_0x38a6a1={'messages':_0x46366d,..._0x1d9f05},_0x4d3b07={'method':'POST','headers':_0xb821a0,'body':JSON['stringify'](_0x38a6a1),'signal':this['abortController']['signal']},_0x45211d=await fetch(this['_apiUrl'],_0x4d3b07);if(_0x45211d['ok'])return _0x1d9f05['stream']?await this['_readStreamableResponse'](_0x45211d,_0x249369):await this['_readStaticResponse'](_0x45211d,_0x249369),Promise['resolve']();{const _0x43c4f9=await _0x45211d['text']();return _0x43c4f9['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x403853,'AI_ERROR_CONTEXT_LENGTH'))):_0x43c4f9['includes']('Moderation')?Promise['reject'](new R(i(_0x403853,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x43c4f9));}}async['prepareMessages'](_0xaf5df7,_0xfd04d1,_0x38a13c){let _0x3a6585,_0x5e2c99;return _0xfd04d1?(_0x3a6585='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x5e2c99='Instruction:\x0a'+_0xaf5df7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xfd04d1):(_0x3a6585='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x5e2c99=_0xaf5df7),[{'role':'system','content':_0x3a6585},{'role':'user','content':_0x5e2c99}];}async['_readStreamableResponse'](_0x17e347,_0x34fb10){const _0x3151c7=_0x17e347['body']['getReader'](),_0x353ca8=new TextDecoder();let _0x2b0066='',_0x3baa86='',_0x249d50='',_0x5571ad=!0x1;for(;!_0x5571ad;){const {done:_0x893266,value:_0x59e2cc}=await _0x3151c7['read'](),_0xa1422=_0x2b0066+_0x353ca8['decode'](_0x59e2cc);let _0x97e865='';_0x5571ad=_0x893266;try{_0x97e865=this['_cleanUpData'](_0xa1422),_0x2b0066='';}catch{_0x2b0066=_0xa1422;continue;}_0x3baa86+=_0x97e865,!_0x5571ad&&this['_isBufferIncomplete'](_0x3baa86)||_0x3baa86&&(_0x249d50+=_0x3baa86,_0x3baa86='',_0x34fb10(_0x249d50));}return Promise['resolve']();}async['_readStaticResponse'](_0x39b563,_0x123e63){return _0x123e63((await _0x39b563['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4fef27){const _0x536ba5=_0x4fef27['split']('<')['length']!==_0x4fef27['split']('>')['length'],_0x38270a=_0x4fef27['length']<0x1e;return _0x536ba5&&_0x38270a;}['_cleanUpData'](_0x3f6f0f){return _0x3f6f0f['split'](/\n(?![^{]*\})/g)['map'](_0x4b9231=>_0x4b9231['replace']('data:\x20',''))['filter'](_0x4adc13=>_0x4adc13&&_0x4adc13['length']>0x0&&'[DONE]'!==_0x4adc13)['map'](_0x596b3e=>{const {choices:_0x13ee5c}=JSON['parse'](_0x596b3e);if(_0x13ee5c[0x0]?.['delta']?.['content'])return _0x13ee5c[0x0]['delta']['content'];})['filter'](_0x549c85=>_0x549c85)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1db43b){super(_0x1db43b),_0x1db43b['config']['get']('ai.aws.requestParameters')||_0x1db43b['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x1db43b['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1db43b['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1db43b['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1db43b['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x314d5a,context:_0x33f1ba,onData:_0x2e02e6,actionId:_0x608371}){const {model:_0x36ff45,stream:_0x3176a8,..._0x5e9e71}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x608371),_0x2ea8ce={'prompt':await this['preparePrompt'](_0x314d5a,_0x33f1ba,_0x36ff45,_0x608371),..._0x5e9e71};this['_apiUrl']?await this['_processProxyRequest'](_0x2ea8ce,_0x36ff45,_0x3176a8,_0x2e02e6,_0x608371):await this['_processAWSRequest'](_0x2ea8ce,_0x36ff45,_0x3176a8,_0x2e02e6);}async['preparePrompt'](_0x435598,_0x553578,_0x1346af,_0x1642b5){let _0x2d73bc,_0xcae957;return _0x553578?(_0x2d73bc='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0xcae957='Instruction:\x0a'+_0x435598+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x553578):(_0x2d73bc='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0xcae957=_0x435598),'meta.llama'==this['getModelFamily'](_0x1346af)?'<<SYS>>\x0a'+_0x2d73bc+'\x0a<</SYS>>\x0a[INST]\x0a'+_0xcae957+'\x0a[/INST]':'Human:\x0a'+_0x2d73bc+'\x0a'+_0xcae957+'\x0a\x0aAssistant:';}['getModelFamily'](_0x331789){if(/^anthropic\.claude/['test'](_0x331789))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x331789))return'ai21.j2';if(/^cohere\.command/['test'](_0x331789))return'cohere.command';if(/^meta\.llama/['test'](_0x331789))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x331789));}async['_processProxyRequest'](_0x4d098a,_0x45bcc6,_0x4d6d69,_0x4f4bf3,_0x29c77b){const _0x2d46fb={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x29c77b),'body':JSON['stringify']({..._0x4d098a,'model':_0x45bcc6,'stream':_0x4d6d69}),'signal':this['abortController']['signal']},_0x24c85f=await fetch(this['_apiUrl'],_0x2d46fb);_0x4d6d69?await this['_readStreamableResponse'](_0x24c85f,_0x45bcc6,_0x4f4bf3):await this['_readStaticResponse'](_0x24c85f,_0x45bcc6,_0x4f4bf3);}async['_processAWSRequest'](_0x387829,_0x132b16,_0xf22b56,_0x58be0c){const _0x3ca7b2=new _0x4967b9(this['_bedrockClientConfig']),_0x390141={'body':JSON['stringify'](_0x387829),'contentType':'application/json','accept':'application/json','modelId':_0x132b16};let _0x53dd8c;if(_0xf22b56){const _0x3fe79f=new _0x49e8cb(_0x390141);_0x53dd8c=await _0x3ca7b2['send'](_0x3fe79f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x53dd8c,_0x132b16,_0x58be0c);}else{const _0x157e44=new _0x13fb25(_0x390141);_0x53dd8c=await _0x3ca7b2['send'](_0x157e44,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x53dd8c,_0x132b16,_0x58be0c);}}async['_readAsyncIterableResponse'](_0x5a00d7,_0x11d525,_0xb085bc){const _0xb49ae9=_0x5a00d7['body'],_0x44acad=new TextDecoder('utf-8');let _0x4d87fd='';for await(const _0x83f821 of _0xb49ae9)if(_0x83f821['chunk']){const _0x2e795b=_0x44acad['decode'](_0x83f821['chunk']['bytes']),_0x553beb=JSON['parse'](_0x2e795b);_0x4d87fd+=this['_getGeneratedText'](_0x553beb,_0x11d525),_0xb085bc(_0x4d87fd);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5c96a4,_0x2c1dfa,_0x5711af){const _0x6ec2d0=_0x5c96a4['body'],_0x275790=new TextDecoder('utf-8'),_0x23d06f=_0x6ec2d0['getReader']();let _0xffc3ff='',_0x57b818='',_0x566892=!0x1;for(;!_0x566892;){const {done:_0x2eaa47,value:_0x1ab6db}=await _0x23d06f['read']();if(_0x566892=_0x2eaa47,_0x566892)break;const _0x3c969e=(_0xffc3ff+_0x275790['decode'](_0x1ab6db))['split']('\x0a')['map'](_0x3a98e6=>{try{return _0xffc3ff='',JSON['parse'](_0x3a98e6);}catch{return _0xffc3ff=_0x3a98e6,null;}})['filter'](_0x8eff9c=>null!==_0x8eff9c);_0x3c969e['length']&&(_0x57b818+=_0x3c969e['map'](_0x37dc4a=>this['_getGeneratedText'](_0x37dc4a,_0x2c1dfa))['join'](''),_0x5711af(_0x57b818));}return Promise['resolve']();}async['_readStaticResponse'](_0x19ea9a,_0xf56c85,_0x2e12ca){let _0x256d33;return _0x256d33=_0x19ea9a instanceof Response?await _0x19ea9a['json']():JSON['parse'](Buffer['from'](_0x19ea9a['body'])['toString']('utf8')),(_0x2e12ca(this['_getGeneratedText'](_0x256d33,_0xf56c85)),Promise['resolve']());}['_getGeneratedText'](_0x544e28,_0x4384e3){switch(this['getModelFamily'](_0x4384e3)){case'anthropic.claude':return _0x544e28['completion'];case'ai21.j2':return _0x544e28['completions'][0x0]['data']['text'];case'cohere.command':return _0x544e28['generations'][0x0]['text'];case'meta.llama':return _0x544e28['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
23
+ import{Plugin as _0xe793ad,Command as _0x2baf96}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x20c3c5,IconCheck as _0x54cc57,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x7b7565,IconRobotPencil as _0x261814}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5f89bc,CKEditorError as _0x476136,ObservableMixin as _0xcbab5e,global as _0x16fcb4,isVisible as ot,Rect as it,Collection as _0x54efc7,FocusTracker as mt,KeystrokeHandler as ut,first as _0x1c954a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x421dfa,View as _0x5552c5,SpinnerView as _0x2c958b,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x57f5b6,createDropdown as _0x55ace3,addMenuToDropdown as _0x1c1fa6,MenuBarMenuView as _0x246737,MenuBarMenuListItemButtonView as _0x1a1400,DialogViewPosition as _0x4ebd44,MenuBarMenuListView as _0x347523,MenuBarMenuListItemView as _0x1b214f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2ee74d,ClipboardMarkersUtils as _0x4a0108}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x4d1a59,DataTransfer as _0x4de348,UpcastWriter as _0x48eae6,Matcher as _0x303821}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x4e8b25,InvokeModelWithResponseStreamCommand as _0x48acd1,InvokeModelCommand as _0x4052cf}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x540f8e,_0x1c0127){const _0x2ba131=(0x0,_0x1c0127['t'])('Other');return _0x540f8e['length']?'groupId'in _0x540f8e[0x0]?_0x540f8e:[{'groupId':x,'groupLabel':_0x2ba131,'order':0x1/0x0,'commands':_0x540f8e}]:[{'groupId':x,'groupLabel':_0x2ba131,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0xe793ad{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4a8694}=this,_0x302847=['ck-fake-ai-selection'];_0x4a8694['config']['get']('ai.useTheme')&&_0x302847['push']('ck-ai-assistant-ui_theme'),_0x4a8694['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x302847,'priority':0xc}}),_0x4a8694['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2b7547,{writer:_0x39bae7})=>{if(!_0x2b7547['markerRange']['isCollapsed'])return null;const _0x4b7a88=_0x39bae7['createUIElement']('span');return _0x39bae7['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4b7a88),_0x4b7a88;}});}['afterInit'](){!async function(_0x5de849){const _0x1eb977=_0x295f56([0x39,0x6a,0x71,0x42,0x78,0x43,0x41,0x4c,0x59,0x33,0x6d,0x66,0x50,0x63,0x73,0x67,0x31,0x4a,0x69,0x35,0x53,0x7a,0x34,0x76,0x62,0x30,0x68,0x77,0x65,0x6b,0x61,0x6f,0x49,0x64,0x58,0x48,0x57,0x47,0x74,0x44,0x4b,0x4f,0x56,0x45,0x4d,0x72,0x52,0x79,0x4e,0x54,0x32,0x5a,0x6c,0x70,0x46,0x36,0x55,0x6e,0x75,0x37,0x51,0x38]),_0x440cab=0x56923e3d,_0xa7e55f=0x5695578d^_0x440cab,_0x5bf9b3=window[_0x295f56([0x44,0x61,0x74,0x65])][_0x295f56([0x6e,0x6f,0x77])](),_0x31770f=_0x5de849[_0x295f56([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1b0577=new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2aa910=>{_0x31770f[_0x295f56([0x6f,0x6e,0x63,0x65])](_0x295f56([0x72,0x65,0x61,0x64,0x79]),_0x2aa910);}),_0x261860={[_0x295f56([0x6b,0x74,0x79])]:_0x295f56([0x45,0x43]),[_0x295f56([0x75,0x73,0x65])]:_0x295f56([0x73,0x69,0x67]),[_0x295f56([0x63,0x72,0x76])]:_0x295f56([0x50,0x2d,0x32,0x35,0x36]),[_0x295f56([0x78])]:_0x295f56([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x295f56([0x79])]:_0x295f56([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x295f56([0x61,0x6c,0x67])]:_0x295f56([0x45,0x53,0x32,0x35,0x36])},_0x88765c=_0x31770f[_0x295f56([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x295f56([0x67,0x65,0x74])](_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x111f5d(){let _0x5d535d,_0x14f5cb=null,_0x434473=null;try{if(_0x88765c==_0x295f56([0x47,0x50,0x4c]))return _0x295f56([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5d535d=_0x5b6a46(),!_0x5d535d)return _0x295f56([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5d535d[_0x295f56([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x434473=_0x5a00d1(_0x5d535d[_0x295f56([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5d535d[_0x295f56([0x6a,0x74,0x69])])),await _0x3bb125()?_0x545ac4()?_0xcdbdc9()?_0x295f56([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x37ce1a()?(_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x295f56([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x14f5cb=_0x58791e(_0x295f56([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x295f56([0x74,0x72,0x69,0x61,0x6c])&&(_0x14f5cb=_0x58791e(_0x295f56([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4abd3c()):_0x295f56([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x295f56([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x295f56([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x295f56([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xcdbdc9(){const _0x201ff0=[_0x295f56([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x295f56([0x74,0x72,0x69,0x61,0x6c])][_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5bf9b3/0x3e8:0xe10*_0xa7e55f;return _0x5d535d[_0x295f56([0x65,0x78,0x70])]<_0x201ff0;}function _0x545ac4(){const _0x53ac15=_0x5d535d[_0x295f56([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x53ac15&&(!!_0x53ac15[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x295f56([0x2a]))||!!_0x53ac15[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x295f56([0x41,0x49])));}function _0x37ce1a(){const _0x32248e=_0x5d535d[_0x295f56([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x32248e||0x0==_0x32248e[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x22acf1}=new URL(window[_0x295f56([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x32248e[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x22acf1))return!0x0;const _0x3a9a38=_0x22acf1[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e]));return _0x32248e[_0x295f56([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4177d4=>_0x4177d4[_0x295f56([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x295f56([0x2a])))[_0x295f56([0x6d,0x61,0x70])](_0x5810a=>_0x5810a[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e])))[_0x295f56([0x73,0x6f,0x6d,0x65])](_0x2a8a9d=>_0x3a9a38[_0x295f56([0x65,0x76,0x65,0x72,0x79])]((_0x28b7b7,_0x3b69d7)=>_0x2a8a9d[_0x3b69d7]===_0x28b7b7||_0x2a8a9d[_0x3b69d7]===_0x295f56([0x2a])));}function _0x4abd3c(){return _0x14f5cb&&_0x434473?new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x20afb1,_0x460aa1)=>{_0x14f5cb[_0x295f56([0x74,0x68,0x65,0x6e])](_0x20afb1,_0x460aa1),_0x434473[_0x295f56([0x74,0x68,0x65,0x6e])](_0x8803b5=>{_0x8803b5!=_0x295f56([0x56,0x61,0x6c,0x69,0x64])&&_0x20afb1(_0x8803b5);},_0x460aa1);}):_0x14f5cb||_0x434473||_0x295f56([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5a00d1(_0x4b3da4,_0x86467b){return new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c424a=>{if(_0x5a3f80())return _0x3c424a(_0x295f56([0x56,0x61,0x6c,0x69,0x64]));_0x13e5c5(),_0x31770f[_0x295f56([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x295f56([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xa14455=!0x1;const _0x2bfaaa=_0x5f89bc();function _0x3da2ff(_0x4afa9d){return!!_0x4afa9d&&(typeof _0x4afa9d===_0x295f56([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4afa9d===_0x295f56([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4afa9d[_0x295f56([0x74,0x68,0x65,0x6e])]===_0x295f56([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4afa9d[_0x295f56([0x63,0x61,0x74,0x63,0x68])]===_0x295f56([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2728f3(_0x28b8e7){_0x3eed60(_0x28b8e7)[_0x295f56([0x74,0x68,0x65,0x6e])](_0x3e4f34=>{if(!_0x3e4f34||_0x3e4f34[_0x295f56([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x295f56([0x6f,0x6b]))return _0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x5e2d87(_0x20012e(_0x2bfaaa+_0x86467b))!=_0x3e4f34[_0x295f56([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x295f56([0x56,0x61,0x6c,0x69,0x64]);})[_0x295f56([0x74,0x68,0x65,0x6e])](_0x598d84=>(_0x1f9f10(),_0x598d84),()=>{const _0x4279e7=_0x486c46();return null==_0x4279e7?(_0x1f9f10(),_0x295f56([0x56,0x61,0x6c,0x69,0x64])):_0x295f56(_0x5bf9b3-_0x4279e7>(0x729eba3d^_0x440cab)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x295f56([0x74,0x68,0x65,0x6e])](_0x3c424a)[_0x295f56([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3c424a(_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2b8988=0x56a4d0bd^_0x440cab;function _0x1f9f10(){const _0x4e393a=_0x295f56([0x6c,0x6c,0x63,0x74,0x2d])+_0x5e2d87(_0x20012e(_0x4b3da4)),_0x1faf9d=_0x2ad3d6(_0x5e2d87(window[_0x295f56([0x4d,0x61,0x74,0x68])][_0x295f56([0x63,0x65,0x69,0x6c])](_0x5bf9b3/_0x2b8988)));window[_0x295f56([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x295f56([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4e393a,_0x1faf9d);}function _0x486c46(){const _0x231845=_0x295f56([0x6c,0x6c,0x63,0x74,0x2d])+_0x5e2d87(_0x20012e(_0x4b3da4)),_0x5eb8de=window[_0x295f56([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x295f56([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x231845);return _0x5eb8de?window[_0x295f56([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ad3d6(_0x5eb8de),0x10)*_0x2b8988:null;}function _0x3eed60(_0x12c8be){return new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x31813e,_0x3d95fe)=>{_0x12c8be[_0x295f56([0x74,0x68,0x65,0x6e])](_0x31813e,_0x3d95fe),window[_0x295f56([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3d95fe,0x5693eafd^_0x440cab);});}}_0x31770f[_0x295f56([0x6f,0x6e])](_0x295f56([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2bf2f4,_0x9f7a19)=>{if(_0x9f7a19[0x0]!=_0x4b3da4)return _0x3c424a(_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x9f7a19[0x1]={..._0x9f7a19[0x1],[_0x295f56([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x2bfaaa};},{[_0x295f56([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x295f56([0x68,0x69,0x67,0x68])}),_0x31770f[_0x295f56([0x6f,0x6e])](_0x295f56([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x26179d=>{_0x3da2ff(_0x26179d[_0x295f56([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xa14455=!0x0,_0x2728f3(_0x26179d[_0x295f56([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x295f56([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x295f56([0x6c,0x6f,0x77])}),_0x1b0577[_0x295f56([0x74,0x68,0x65,0x6e])](()=>{_0xa14455||_0x3c424a(_0x295f56([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5a3f80(){return _0x31770f[_0x295f56([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x295f56([0x76,0x69,0x65,0x77])][_0x295f56([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x295f56([0x61,0x75,0x74,0x6f]);}function _0x13e5c5(){_0x31770f[_0x295f56([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x295f56([0x76,0x69,0x65,0x77])][_0x295f56([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x295f56([0x61,0x75,0x74,0x6f]);}}function _0x58791e(_0x333f55){const _0x14841d=[new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x506241=>setTimeout(_0x506241,0x569b00f1^_0x440cab)),_0x1b0577[_0x295f56([0x74,0x68,0x65,0x6e])](()=>new window[(_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xd889f1=>{let _0x179661=0x0;_0x31770f[_0x295f56([0x6d,0x6f,0x64,0x65,0x6c])][_0x295f56([0x6f,0x6e])](_0x295f56([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xa94b81,_0x47c2f4)=>{_0x47c2f4[0x0][_0x295f56([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x179661++,_0x179661==(0x56923fc5^_0x440cab)&&(_0xd889f1(),_0xa94b81[_0x295f56([0x6f,0x66,0x66])]());});}))];return window[_0x295f56([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x295f56([0x72,0x61,0x63,0x65])](_0x14841d)[_0x295f56([0x74,0x68,0x65,0x6e])](()=>_0x333f55);}async function _0x760415(){await _0x1b0577,_0x31770f[_0x295f56([0x6d,0x6f,0x64,0x65,0x6c])][_0x295f56([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x39596e,_0x31770f[_0x295f56([0x6d,0x6f,0x64,0x65,0x6c])][_0x295f56([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x39596e,_0x31770f[_0x295f56([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x295f56([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x13a9c5(_0x31fff1){const _0xbdd0cb=_0x5664b4();_0x31770f[_0xbdd0cb]=_0x295f56([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x31fff1,_0x31fff1!=_0x295f56([0x56,0x61,0x6c,0x69,0x64])&&_0x760415();}function _0x5664b4(){const _0x25cfeb=window[_0x295f56([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x295f56([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x295f56([0x6e,0x6f,0x77])]())[_0x295f56([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x295f56([0x2e]),'');let _0x3db3a0=_0x295f56([0x6a]);for(let _0x3ca0a8=0x0;_0x3ca0a8<_0x25cfeb[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3ca0a8+=0x2){let _0x2b3335=window[_0x295f56([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x25cfeb[_0x295f56([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3ca0a8,_0x3ca0a8+0x2));_0x2b3335>=_0x1eb977[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2b3335-=_0x1eb977[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3db3a0+=_0x1eb977[_0x2b3335];}return _0x3db3a0;}function _0x5b6a46(){const _0xfff624=_0x88765c[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e]));if(0x3!=_0xfff624[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xec8b2a(_0xfff624[0x1]);function _0xec8b2a(_0x499b32){const _0x13e259=_0x1316f7(_0x499b32);return _0x13e259&&_0x4757c2()?_0x13e259:null;function _0x4757c2(){const _0x185c46=_0x13e259[_0x295f56([0x6a,0x74,0x69])],_0x1e5cc9=window[_0x295f56([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x185c46[_0x295f56([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x185c46[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1c0b00={..._0x13e259,[_0x295f56([0x6a,0x74,0x69])]:_0x185c46[_0x295f56([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x185c46[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1c0b00[_0x295f56([0x76,0x63])],_0x20012e(_0x1c0b00)==_0x1e5cc9;}}}async function _0x3bb125(){let _0x146048=!0x0;try{const _0x36f06c=_0x88765c[_0x295f56([0x73,0x70,0x6c,0x69,0x74])](_0x295f56([0x2e])),[_0xa4e315,_0x3e2ad9,_0x4603be]=_0x36f06c;return _0x37dffc(_0xa4e315),await _0x5e2fdc(_0xa4e315,_0x3e2ad9,_0x4603be),_0x146048;}catch{return!0x1;}function _0x37dffc(_0x5e2de2){const _0x253c4e=_0x1316f7(_0x5e2de2);_0x253c4e&&_0x253c4e[_0x295f56([0x61,0x6c,0x67])]==_0x295f56([0x45,0x53,0x32,0x35,0x36])||(_0x146048=!0x1);}async function _0x5e2fdc(_0x25e5a2,_0x49f8a9,_0x388261){const _0x286125=window[_0x295f56([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x295f56([0x66,0x72,0x6f,0x6d])](_0x1b0f32(_0x388261),_0x5690b4=>_0x5690b4[_0x295f56([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4b3f4b=new window[(_0x295f56([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x295f56([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x25e5a2+_0x295f56([0x2e])+_0x49f8a9),_0x21e946=window[_0x295f56([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x295f56([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x21e946)return;const _0x24045c=await _0x21e946[_0x295f56([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x295f56([0x6a,0x77,0x6b]),_0x261860,{[_0x295f56([0x6e,0x61,0x6d,0x65])]:_0x295f56([0x45,0x43,0x44,0x53,0x41]),[_0x295f56([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x295f56([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x295f56([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x21e946[_0x295f56([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x295f56([0x6e,0x61,0x6d,0x65])]:_0x295f56([0x45,0x43,0x44,0x53,0x41]),[_0x295f56([0x68,0x61,0x73,0x68])]:{[_0x295f56([0x6e,0x61,0x6d,0x65])]:_0x295f56([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x24045c,_0x286125,_0x4b3f4b)||(_0x146048=!0x1);}}function _0x1316f7(_0x20bae2){return _0x20bae2[_0x295f56([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x295f56([0x65,0x79]))?JSON[_0x295f56([0x70,0x61,0x72,0x73,0x65])](_0x1b0f32(_0x20bae2)):null;}function _0x1b0f32(_0x3e941e){return window[_0x295f56([0x61,0x74,0x6f,0x62])](_0x3e941e[_0x295f56([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x295f56([0x2b]))[_0x295f56([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x295f56([0x2f])));}function _0x20012e(_0x117520){let _0x41ae36=0x1505;function _0x264e8a(_0x5e5b7a){for(let _0x1f17f9=0x0;_0x1f17f9<_0x5e5b7a[_0x295f56([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1f17f9++){const _0x43fac1=_0x5e5b7a[_0x295f56([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x1f17f9);_0x41ae36=(_0x41ae36<<0x5)+_0x41ae36+_0x43fac1,_0x41ae36&=_0x41ae36;}}function _0x30fce5(_0x305d54){Array[_0x295f56([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x305d54)?_0x305d54[_0x295f56([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x30fce5):_0x305d54&&typeof _0x305d54==_0x295f56([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x295f56([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x305d54)[_0x295f56([0x73,0x6f,0x72,0x74])]()[_0x295f56([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4b743a,_0x44d54e])=>{_0x264e8a(_0x4b743a),_0x30fce5(_0x44d54e);}):_0x264e8a(window[_0x295f56([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x305d54));}return _0x30fce5(_0x117520),_0x41ae36>>>0x0;}function _0x5e2d87(_0x42999e){return _0x42999e[_0x295f56([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x295f56([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x295f56([0x30]));}function _0x2ad3d6(_0x436b92){return _0x436b92[_0x295f56([0x73,0x70,0x6c,0x69,0x74])]('')[_0x295f56([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x295f56([0x6a,0x6f,0x69,0x6e])]('');}function _0x39596e(){}function _0x295f56(_0x3c8275){return _0x3c8275['map'](_0x38b461=>String['fromCharCode'](_0x38b461))['join']('');}_0x13a9c5(await _0x111f5d());}(this);}['showFakeVisualSelection'](){const _0x3b1b1f=this['editor']['model'];_0x3b1b1f['change'](_0x107e3e=>{const _0x2c7118=_0x3b1b1f['document']['selection']['getRanges']();let _0x3222de=0x0;for(const _0x317683 of _0x2c7118){const _0x553f5a=f+':'+_0x3222de;if(_0x3b1b1f['markers']['has'](_0x553f5a))_0x107e3e['updateMarker'](_0x553f5a,{'range':_0x317683});else{if(_0x317683['start']['isAtEnd']){const _0x2e55eb=_0x317683['start']['getLastMatchingPosition'](({item:_0x370bd2})=>!_0x3b1b1f['schema']['isContent'](_0x370bd2),{'boundaries':_0x317683});_0x107e3e['addMarker'](_0x553f5a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x107e3e['createRange'](_0x2e55eb,_0x317683['end'])});}else _0x107e3e['addMarker'](_0x553f5a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x317683});}_0x3222de++;}});}['hideFakeVisualSelection'](){const _0x2f0e35=this['editor']['model'],_0x1db8c3=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x1db8c3['length']&&_0x2f0e35['change'](_0xdb0cec=>{_0x1db8c3['forEach'](_0x3d002f=>{_0xdb0cec['removeMarker'](_0x3d002f);});});}['insertContent'](_0x5f0fad,_0x361cba){const _0x147640=this['_getAISelection'](),_0x15edf0=_0x361cba||_0x147640['getFirstRange']();this['editor']['model']['canEditAt'](_0x15edf0)&&this['editor']['model']['change'](_0x42873e=>{this['hideFakeVisualSelection'](),_0x361cba||this['_resetContentOfSelectedTableCells'](_0x42873e,_0x147640),this['_pasteHTMLUsingClipboard']({'insertAt':_0x15edf0,'writer':_0x42873e,'html':_0x5f0fad});});}['insertContentBelow'](_0x2e6d30){const {model:_0x3f2d8b}=this['editor'],_0x98e886=this['_getAISelection']();_0x3f2d8b['change'](()=>{const _0x49faa0=this['_prepareTableInsertBelowPosition'](_0x2e6d30,_0x98e886)||this['_getDefaultInsertBelowPosition'](_0x98e886);this['insertContent'](_0x2e6d30,_0x49faa0);});}['_getAISelection'](){const _0x257364=this['editor']['model'],_0x386209=Array['from'](_0x257364['markers']['getMarkersGroup'](f))['map'](_0x41c319=>_0x41c319['getRange']());return _0x257364['createSelection'](_0x386209);}['_pasteHTMLUsingClipboard']({writer:_0x11359c,html:_0x3080bb,insertAt:_0x48effe}){const {view:_0x38f880}=this['editor']['editing'],_0xdcd868=this['editor']['plugins']['get'](_0x2ee74d),_0x247b47=new gt();_0x247b47['setData']('text/html',_0x3080bb);const _0x284db1=new ClipboardEvent('paste',{'clipboardData':_0x247b47}),_0x201aea=new _0x4d1a59(_0x38f880,_0x284db1,{'dataTransfer':new _0x4de348(_0x247b47)});_0x11359c['setSelection'](_0x48effe);const _0x16f679=(_0x5e44ef,_0x2fb13f)=>{_0x2fb13f['resultRange']&&_0x11359c['setSelection'](_0x2fb13f['resultRange']);};_0xdcd868['once']('contentInsertion',_0x16f679,{'priority':'lowest'}),_0x38f880['document']['fire']('paste',_0x201aea),_0xdcd868['off']('contentInsertion',_0x16f679);}['_getDefaultInsertBelowPosition'](_0x4a1980){const {model:_0x3a34a5}=this['editor'],_0x476cef=Array['from'](_0x4a1980['getSelectedBlocks']());return _0x476cef['length']?_0x3a34a5['createPositionAfter'](_0x476cef['pop']()):_0x4a1980['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x483b95,_0x44e6d3){const {model:_0x528bc4,plugins:_0x2e0c9f}=this['editor'];if(_0x2e0c9f['has']('TableUtils')){const _0xfe2ee8=_0x2e0c9f['get']('TableUtils')['getSelectedTableCells'](_0x44e6d3);if(_0xfe2ee8['length']){const _0x79cf9d=this['_getTableRowCountFromContent'](_0x483b95),_0x57a817=this['_createEmptyTableRows'](_0xfe2ee8,_0x79cf9d);return _0x528bc4['createPositionAt'](_0x57a817,0x0);}}return null;}['_getTableRowCountFromContent'](_0xa2b400){const _0x53c0c3=this['editor']['plugins']['get']('TableUtils'),_0x124b5f=this['editor']['data']['parse'](_0xa2b400),_0x3411cf=Array['from'](_0x124b5f['getChildren']())['filter'](_0x25b18d=>_0x25b18d['is']('element','table'));let _0x494fe8=0x0;return _0x3411cf['forEach'](_0x5bc97e=>{_0x494fe8+=_0x53c0c3['getRows'](_0x5bc97e);}),_0x494fe8;}['_createEmptyTableRows'](_0x146515,_0x369803){const _0x61ab07=this['editor']['plugins']['get']('TableUtils'),_0x39892b=_0x61ab07['getRowIndexes'](_0x146515),_0x4309ce=_0x61ab07['getColumnIndexes'](_0x146515),_0x2c3200=_0x39892b['last']+0x1,_0x210679=_0x4309ce['first'],_0x4bb461=_0x146515[0x0]['findAncestor']('table');for(let _0x4f5708=0x0;_0x4f5708<_0x369803;_0x4f5708++)_0x61ab07['insertRows'](_0x4bb461,{'at':_0x2c3200});return _0x4bb461['getChild'](_0x2c3200)['getChild'](_0x210679);}['_resetContentOfSelectedTableCells'](_0x48479f,_0x6132fb){const {plugins:_0x235914}=this['editor'],{model:_0x2c286f}=_0x48479f;if(!_0x235914['has']('TableUtils'))return;_0x235914['get']('TableUtils')['getSelectedTableCells'](_0x6132fb)['length']&&_0x2c286f['deleteContent'](_0x6132fb);}}class E extends _0xe793ad{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x476136('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x3abc85){super(_0x3abc85),this['name']='AIRequestError';}}function i(_0x5ed745,_0xa798b5,_0x2e2663){const t=_0x5ed745['t'];switch(_0xa798b5){case'Edit\x20or\x20review':return t('Edit\x20or\x20review');case'Improve\x20writing':return t('Improve\x20writing');case'Make\x20shorter':return t('Make\x20shorter');case'Make\x20longer':return t('Make\x20longer');case'Simplify\x20language':return t('Simplify\x20language');case'Generate\x20from\x20selection':return t('Generate\x20from\x20selection');case'Summarize':return t('Summarize');case'Continue':return t('Continue');case'Change\x20tone':return t('Change\x20tone');case'Professional':return t('Professional');case'Casual':return t('Casual');case'Direct':return t('Direct');case'Confident':return t('Confident');case'Friendly':return t('Friendly');case'Change\x20style':return t('Change\x20style');case'Business':return t('Business');case'Legal':return t('Legal');case'Journalism':return t('Journalism');case'Poetic':return t('Poetic');case'Translate':return t('Translate');case'English':return t('English');case'Spanish':return t('Spanish');case'German':return t('German');case'Portuguese':return t('Portuguese');case'French':return t('French');case'Simplified\x20Chinese':return t('Simplified\x20Chinese');case'Hindi':return t('Hindi');case'Arabic':return t('Arabic');case'AI\x20Assistant':return t('AI\x20Assistant');case'AI\x20Commands':return t('AI\x20Commands');case'Ask\x20AI\x20to\x20edit\x20or\x20generate':return t('Ask\x20AI\x20to\x20edit\x20or\x20generate');case'Ask\x20AI\x20to\x20improve\x20generated\x20text':return t('Ask\x20AI\x20to\x20improve\x20generated\x20text');case'Copy':return t('Copy');case'Submit':return t('Submit');case'Insert\x20below':return t('Insert\x20below');case'Try\x20again':return t('Try\x20again');case'Stop':return t('Stop');case'AI\x20is\x20writing...':return t('AI\x20is\x20writing...');case'AI\x20is\x20writing':return t('AI\x20is\x20writing');case'Generated\x20content:\x20%0':return t('Generated\x20content:\x20%0',_0x2e2663);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2e2663);case'History':return t('History');case'Empty\x20history':return t('Empty\x20history');case'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':return t('Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.');case'Prompt\x20history':return t('Prompt\x20history');case'Clear':return t('Clear');case'AI_REPLACE_CONTENT':return t({'id':'AI_REPLACE_CONTENT','string':'Replace'});case'AI_INSERT_CONTENT':return t({'id':'AI_INSERT_CONTENT','string':'Insert'});case'AI_ERROR_GET_HEADERS':return t({'id':'AI_ERROR_GET_HEADERS','string':'Preparing\x20request\x20headers\x20failed'});case'AI_ERROR_GET_PARAMETERS':return t({'id':'AI_ERROR_GET_PARAMETERS','string':'Preparing\x20request\x20parameters\x20failed'});case'AI_ERROR_UNSUPPORTED_MODEL':return t({'id':'AI_ERROR_UNSUPPORTED_MODEL','string':'The\x20requested\x20AI\x20model\x20(\x22%0\x22)\x20is\x20not\x20supported'},_0x2e2663);case'AI_ERROR_CONTEXT_LENGTH':return t({'id':'AI_ERROR_CONTEXT_LENGTH','string':'Selected\x20content\x20is\x20too\x20long'});case'AI_ERROR_MODERATION':return t({'id':'AI_ERROR_MODERATION','string':'Requested\x20query\x20does\x20not\x20pass\x20moderation\x20rules'});case'AI_ERROR_FAILED':return t({'id':'AI_ERROR_FAILED','string':'Failed\x20to\x20communicate\x20with\x20the\x20AI\x20service'});default:return _0xa798b5;}}class j extends _0x2baf96{['_commandDefinitions'];constructor(_0x4cb883,_0x20f595){super(_0x4cb883),this['_commandDefinitions']=_0x20f595,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x6db1c2,_0x235076,_0x322417)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x322417));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x22859c,_0x375b7e,_0x10c1cb)=>{this['enabledCommandsIds']=_0x10c1cb?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3f8fae=this['editor']['model'];this['_hasContext']=function(_0x32335c){const _0x1513ed=_0x32335c['document']['selection'];return _0x1513ed['isCollapsed']?0x0!==[..._0x1513ed['getSelectedBlocks']()]['length']&&![..._0x1513ed['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x32335c['hasContent'](_0x1513ed['getFirstRange']());}(_0x3f8fae);const _0x26ebfb=_0x3f8fae['document']['selection'],_0x26e0b3=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1c0140 of _0x26ebfb['getRanges']())for(const _0x5659cd of _0x1c0140['getItems']())if(_0x5659cd['is']('element')&&_0x26e0b3['includes'](_0x5659cd['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x17a9be='',_0x59ac39='',_0x152e2c='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x17a9be,_0x59ac39,_0x152e2c);}}function G(_0x30d9b8,_0x227801){const _0x5b41e3=new Set();for(const _0x2479b3 of _0x30d9b8['values']())(_0x227801||!0x1===_0x2479b3['requiresContent'])&&_0x5b41e3['add'](_0x2479b3['id']);return Array['from'](_0x5b41e3);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0xcbab5e(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4945a1,_0x3ed0f4,_0x47b612){super(),this['editor']=_0x4945a1,this['textAdapter']=_0x3ed0f4,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x47b612,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1015aa,_0xda8bad,_0x2bd555)=>{this['view']['value']=this['_sanitizeHTML'](_0x2bd555);}),this['listenTo'](this['view'],'submitPrompt',(_0xdd5c9,_0x503ca8)=>{const _0x5eed85=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x503ca8,_0x5eed85,'custom');}),this['listenTo'](this['view'],'tryAgainEvent',()=>{this['view']['prompt']=this['previousLabel'],this['_handleQuery'](this['previousQuery'],this['previousContext'],this['previousActionId'],this['previousLabel']);}),this['listenTo'](this['view'],'stopProcessing',()=>{this['stopProcessing']();});}['destroy'](){this['stopListening']();}async['updateView']({actionId:_0x114e55,query:_0x535ace,htmlContent:_0x5584ff,label:_0x64fd47,mainActionLabel:_0x5bd381}){this['view']['prompt']=_0x64fd47,this['view']['mainAction']=_0x5bd381,this['initialContext']=_0x5584ff,_0x535ace&&(this['view']['isRendered']?this['_handleQuery'](_0x535ace,_0x5584ff,_0x114e55,_0x64fd47):this['view']['once']('render',()=>{this['_handleQuery'](_0x535ace,_0x5584ff,_0x114e55,_0x64fd47);}));}['stopProcessing'](){this['isProcessing']&&(this['isProcessing']=!0x1,this['view']['finishProcessing'](),this['textAdapter']['abort']());}['reset'](){this['initialContext']='',this['currentContext']='',this['currentResponse']='',this['previousContext']='',this['previousQuery']='',this['previousLabel']='',this['previousActionId']=void 0x0,this['view']['reset'](),this['stopProcessing']();}async['_handleQuery'](_0x45c5b8,_0x21126f,_0x5abc5c,_0x19ffe7){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x21126f,this['previousQuery']=_0x45c5b8,this['previousLabel']=_0x19ffe7||_0x45c5b8,this['previousActionId']=_0x5abc5c,new Promise(_0x38538c=>{this['textAdapter']['makeRequest']({'query':_0x45c5b8,'context':_0x21126f,'onData':_0x1ed6b1=>{this['currentResponse']=_0x1ed6b1,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5abc5c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x10eb6a=>{_0x10eb6a instanceof R?this['view']['handleError'](_0x10eb6a['message']):this['view']['handleError'](),_0x38538c();})['finally'](()=>{this['stopProcessing'](),_0x38538c();});});}['_parseAndNormalizeContent'](_0x4b8ad2,_0x1e7876=!0x1){const _0x42fbb6=Z['exec'](_0x4b8ad2);_0x4b8ad2=_0x42fbb6?_0x4b8ad2['substring'](_0x42fbb6[0x1]['length']):_0x4b8ad2['length']<0x64&&!_0x1e7876?'':this['_stripMarkdownSyntax'](_0x4b8ad2);const _0x912a73=this['_domParser']['parseFromString'](_0x4b8ad2,'text/html');if(_0x42fbb6){const _0x1de5db=Array['from'](_0x912a73['body']['childNodes']);_0x1de5db['reverse']();for(const _0xa70eda of _0x1de5db){if(_0xa70eda['nodeType']==Node['ELEMENT_NODE'])break;_0xa70eda['remove']();}}const _0x4085cd=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x912a73['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4085cd);const _0x356ef8=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x16b8c0=this['editor']['data']['toModel'](_0x4085cd);return _0x356ef8||_0x16b8c0['markers']['clear'](),this['editor']['data']['stringify'](_0x16b8c0);}['_normalizeResponseHeadings'](_0x161bd8){const _0x4d380c=new _0x48eae6(this['editor']['editing']['view']['document']),_0x15f7e7=new _0x303821({'name':/^h[1-5]$/}),_0x4c5965=[];let _0x211986=!0x1;for(const _0x496514 of _0x161bd8)_0x496514['is']('element')&&_0x15f7e7['match'](_0x496514)&&(_0x4c5965['push'](_0x496514),'h1'==_0x496514['name']&&(_0x211986=!0x0));if(_0x211986){for(const _0x31418f of _0x4c5965)_0x4d380c['rename']('h'+(parseInt(_0x31418f['name'][0x1])+0x1),_0x31418f);}}['_isH1TagSupportEnabled'](){const {data:_0x3578cd,editing:_0xf72997}=this['editor'],_0x2f558d=_0x3578cd['htmlProcessor']['toView']('<h1></h1>'),_0x2cc518=_0x3578cd['toView'](_0x3578cd['toModel'](_0x2f558d));return!!_0xf72997['view']['domConverter']['viewToDom'](_0x2cc518)['querySelector']('h1');}['_sanitizeHTML'](_0xfd7d61){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xfd7d61),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5e1043){const _0x16590b=_0x5e1043['trim']();return _0x16590b['startsWith']('```html')?_0x16590b['endsWith']('```')?_0x16590b['substring'](0x7,_0x16590b['length']-0x3):_0x16590b['substring'](0x7):_0x5e1043;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x1b8eb0){super(_0x1b8eb0),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2bc311=>i(_0x1b8eb0,'AI_'+_0x2bc311['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1b8eb0,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1b8eb0,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1b8eb0,'Stop'));const _0x2c1e56=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2c1e56['if']('isVisible','ck-hidden',_0x527ccc=>!_0x527ccc)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x7c4de0,_0x686c24){const _0x5cd79e=new _0x421dfa(this['locale']);return _0x5cd79e['set']({'label':_0x7c4de0,'class':_0x686c24||'','isVisible':!0x0,'withText':!0x0}),_0x5cd79e;}}class Y extends _0x5552c5{['contentFieldView'];['copyButtonView'];constructor(_0x412d40,_0x322c18=''){super(_0x412d40),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5e8a2e=this['bindTemplate'];this['contentFieldView']=new At(_0x412d40,_0x322c18),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5e8a2e['if']('isVisible','ck-hidden',_0x4a4210=>!_0x4a4210)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5e8a2e['if']('isProcessing','ck-ai-form__content-area--processing')]},'children':[this['contentFieldView'],{'tag':'div','attributes':{'class':['ck','ck-ai-form__copy-button-wrapper']},'children':[this['copyButtonView']]}]}]});}['render'](){super['render'](),this['value']&&this['contentFieldView']['setContent'](this['value']);let _0x479b21=!0x1;this['on']('change:value',(_0x29146f,_0x40fe7c,_0x279c6b)=>{const _0x4033a5=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x279c6b),this['isProcessing']&&_0x4033a5&&!_0x479b21&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1c5f6a,_0x5b4e46,_0x21e6cf)=>{_0x479b21=!0x1,_0x21e6cf?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x479b21=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x479b21=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x30a3cc=this['locale'],_0xfed6b2=new _0x421dfa(this['locale']),_0x1fd818='ck-ai-form__copy-button';return _0xfed6b2['set']({'label':i(_0x30a3cc,'Copy'),'icon':_0x20c3c5,'class':_0x1fd818,'tooltip':!0x0}),_0xfed6b2['bind']('isVisible')['to'](this,'value',_0x1aa43a=>!!_0x1aa43a),_0xfed6b2['bind']('isEnabled')['to'](this,'isProcessing',_0x24fc62=>!_0x24fc62),_0xfed6b2['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xfed6b2['icon']=_0x54cc57,_0xfed6b2['class']=_0x1fd818+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xfed6b2['icon']=_0x20c3c5,_0xfed6b2['class']=_0x1fd818;},0x3e8);}),_0xfed6b2;}['_copyHTMLToClipboard'](_0x24c6cc){const {window:_0x3f5e70,document:_0x42e9d8}=_0x16fcb4;if(_0x3f5e70['ClipboardItem']){const {Blob:_0x28cb44,ClipboardItem:_0x2bd3c4}=_0x3f5e70,_0x551198=[new _0x2bd3c4({'text/html':new _0x28cb44([_0x24c6cc['innerHTML']],{'type':'text/html'}),'text/plain':new _0x28cb44([_0x24c6cc['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x551198);}else{const _0xb96e19=_0x42e9d8['createElement']('div');_0xb96e19['style']['position']='absolute',_0xb96e19['style']['left']='-9999px',_0xb96e19['innerHTML']='<span>[</span>'+_0x24c6cc['innerHTML']+'<span>]</span>',_0x42e9d8['body']['appendChild'](_0xb96e19);const _0x3ccb1b=_0x42e9d8['createRange']();_0x3ccb1b['setStartAfter'](_0xb96e19['firstElementChild']),_0x3ccb1b['setEndBefore'](_0xb96e19['lastElementChild']);const _0x536b22=_0x3f5e70['getSelection']();_0x536b22['removeAllRanges'](),_0x536b22['addRange'](_0x3ccb1b),_0x42e9d8['execCommand']('copy'),_0xb96e19['remove']();}}}class At extends _0x5552c5{constructor(_0x15f2e4,_0x1ddbd6=''){super(_0x15f2e4),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1ddbd6,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2ff804){this['element']['innerHTML']=_0x2ff804;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x570f95=new _0x5552c5(),_0x5c9ec7=this['locale'],_0x9a749=new _0x2c958b();return _0x9a749['isVisible']=!0x0,_0x570f95['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x9a749,{'text':i(_0x5c9ec7,'AI\x20is\x20writing...')}]}),_0x570f95['render'](),_0x570f95;}}class st extends _0x5552c5{constructor(_0x5a2a0f,_0x4bfd9b=''){super(_0x5a2a0f);const _0xf30f3d=new rt(),_0x563fd2=this['bindTemplate'];this['set']('text',_0x4bfd9b),_0xf30f3d['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0xf30f3d,{'text':_0x563fd2['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x48ebed,_0x4158f4){super(_0x48ebed,_0x4158f4),this['queryView']['fieldView']['minRows']=0x1,this['queryView']['fieldView']['maxRows']=0x3,this['submitButtonView']=this['_createSubmitButton'](),this['showHistoryButtonView']=this['_createShowHistoryButton'](),this['focusableChildren']['add'](this['showHistoryButtonView'],0x1),this['focusableChildren']['add'](this['submitButtonView']);}['render'](){super['render'](),this['queryView']['fieldWrapperChildren']['add'](this['showHistoryButtonView']),this['children']['add'](this['submitButtonView']),this['keystrokes']['set']('enter',(_0x4aecea,_0x2f6230)=>{_0x4aecea['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2f6230());});}['_createSubmitButton'](){const _0x32ff0a=new _0x421dfa(this['locale']),_0x3a56cb=this['locale'];return _0x32ff0a['set']({'icon':ht,'label':i(_0x3a56cb,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x32ff0a['on']('execute',()=>{this['submit']();}),_0x32ff0a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x21396e,_0x19c2c9)=>!_0x21396e&&_0x19c2c9),_0x32ff0a;}['_createShowHistoryButton'](){const _0x27b425=new _0x421dfa(this['locale']),_0x1c766f=this['resultsView'],_0xbbd03d=this['locale'];_0x27b425['set']({'label':i(_0xbbd03d,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x27b425['bind']('isOn')['to'](_0x1c766f,'isVisible'),_0x27b425['bind']('isEnabled')['to'](this,'isEnabled'),_0x27b425['on']('execute',()=>{_0x1c766f['isVisible']=!_0x1c766f['isVisible'],_0x1c766f['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x567c2c=()=>{_0x16fcb4['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x2f0531=new it(this['queryView']['fieldView']['element']),_0x151075=_0x2f0531['width'],_0x2387d5='rtl'===_0xbbd03d['uiLanguageDirection']?'left':'right';_0x2f0531['excludeScrollbarsAndBorders'](),_0x27b425['element']['style'][_0x2387d5]=_0x151075-_0x2f0531['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x567c2c),this['on']('render',_0x567c2c),_0x27b425;}['submit'](){const _0x1e48dc=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1e48dc);}['focus'](_0x700215){-0x1===_0x700215?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x52b655){super(_0x52b655),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x52b655,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x19154f=0x0;for(const _0x1cb2b8 of this['items'])_0x19154f+=_0x1cb2b8['items']['length'];return{'resultsCount':_0x19154f,'totalItemsCount':_0x19154f};}['_createClearHistoryButton'](){const _0x42eb56=this['locale'],_0x5d8dbc=new _0x421dfa(this['locale']);return _0x5d8dbc['set']({'label':'('+i(_0x42eb56,'Clear')+')','withText':!0x0}),_0x5d8dbc['on']('execute',()=>this['fire']('clearHistory')),_0x5d8dbc;}}class bt extends xt{constructor(_0x4cf71e){super();const _0x879116=new kt(),_0x1103b7=new _0x421dfa(this['locale'],_0x879116);this['children']['add'](_0x1103b7),_0x1103b7['set']({'label':_0x4cf71e['prompt'],'withText':!0x0}),_0x1103b7['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x4cf71e['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x54efc7{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4fd3bd,_0x240310)=>{const _0x223019=os(_0x240310['prompt']);for(const _0x101be9 of this)if(_0x101be9!=_0x240310&&os(_0x101be9['prompt'])===_0x223019){this['remove'](_0x101be9);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x350e89=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x350e89));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x2a9d4b=>_0x2a9d4b)));}}function os(_0x3a771e){return _0x3a771e['toLowerCase']()['trim']();}class _ extends _0x5552c5{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5284da,_0x5375be,_0x15313f=''){super(_0x5284da),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x5284da),this['contentArea']=new Y(_0x5284da,_0x15313f),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x4bfebb=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x5375be],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x4bfebb['if']('isError','ck-hidden',_0x583e3e=>!_0x583e3e)]},'children':[this['errorView']]},this['contentArea'],this['toolbar'],this['promptView']]}]});}['render'](){super['render'](),this['focusTracker']['add'](this['contentArea']['element']),this['focusTracker']['add'](this['contentArea']['copyButtonView']['element']),this['focusTracker']['add'](this['toolbar']['element']),this['focusTracker']['add'](this['promptView']['element']),this['keystrokes']['listenTo'](this['element']);}['focus'](_0x419e61=0x1){-0x1===_0x419e61?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}['reset'](){this['prompt']='',this['value']='',this['isError']=!0x1,this['promptView']['reset'](),this['contentArea']['isVisible']=!0x1,this['toolbar']['isVisible']=!0x1;}['_createPromptView'](){const _0x3f3685=this['locale'],_0x148980=new ct(_0x3f3685,{'queryView':{'label':i(_0x3f3685,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3f3685,'Empty\x20history'),'secondary':i(_0x3f3685,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x148980['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x492c3d,_0x47a786)=>_0x492c3d&&!_0x47a786),this['listenTo'](_0x148980,'submit',(_0x474ec4,_0x32e9b8)=>{this['prompt']=_0x32e9b8;const _0x2833e5=yt(_0x32e9b8);this['fire']('submitPrompt',_0x2833e5),_0x32e9b8['trim']()&&this['_promptHistory']['add']({'prompt':_0x2833e5},0x0);},{'priority':'high'}),_0x148980;}['_createHistoryView'](){const _0x1ba955=new ft(this['locale']);return _0x1ba955['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x1ba955['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1ba955;}['_createToolbar'](){const _0x4bc393=new lt(this['locale']);return _0x4bc393['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x19bdd1,_0x3a3d6e,_0x2da8f0)=>_0x19bdd1&&!_0x3a3d6e&&!!_0x2da8f0),_0x4bc393['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4bc393['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2fa94d,_0xdb6140,_0x58ee49)=>_0x2fa94d&&!_0xdb6140&&!!_0x58ee49),_0x4bc393['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4bc393['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2a3236,_0x4fa1b7)=>_0x2a3236&&!_0x4fa1b7),_0x4bc393['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4bc393['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4bc393['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4bc393;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x171f0a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x171f0a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x556cf6){const _0x463993=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x556cf6||i(_0x463993,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0xe793ad{['licenseKey'];['_licenseKeyCheckInterval'];['_dialog'];['_formView'];['_aiAdapter'];['_aiAssistantController'];['_uiCssClasses']='';static get['pluginName'](){return'AIAssistantUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get['requires'](){return[_0x4a0108,a,E,_0x57f5b6];}constructor(_0x4dfa66){super(_0x4dfa66),_0x4dfa66['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4dfa66['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x4dfa66['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4dfa66['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3e2a9a}=this;this['_aiAdapter']=_0x3e2a9a['plugins']['get'](E),this['_dialog']=_0x3e2a9a['plugins']['get'](_0x57f5b6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x430e4a=new j(_0x3e2a9a,Array['from'](this['_commandDefinitions']['values']()));_0x3e2a9a['commands']['add']('showAIAssistant',_0x430e4a),_0x3e2a9a['ui']['componentFactory']['add']('aiCommands',_0x4ee424=>{const _0x34cc8f=_0x55ace3(_0x4ee424);return _0x34cc8f['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x34cc8f['buttonView']['set']({'label':i(_0x4ee424,'AI\x20Commands'),'icon':_0x7b7565,'tooltip':!0x0}),_0x34cc8f['on']('execute',_0x7f5cae=>this['_onExecute'](_0x7f5cae['source']['id'])),_0x1c1fa6(_0x34cc8f,_0x3e2a9a['ui']['view']['body'],function(_0x4c3b4c){const _0x3125ef=o(_0x4c3b4c['config']['get']('ai.aiAssistant.commands'),_0x4c3b4c['locale']),_0x30d0e2=U(_0x4c3b4c,_0x3125ef)['filter'](_0x54eedb=>_0x54eedb['commands']['length']);if(0x1===_0x30d0e2['length'])return U(_0x4c3b4c,_0x30d0e2[0x0]['commands'])['map'](_0x2a3e54=>({'id':_0x2a3e54['id'],'label':_0x2a3e54['label']}));return _0x30d0e2['map'](_0x36aee0=>{const {groupId:_0x23b760,groupLabel:_0x521f6a,commands:_0x5b7a17}=_0x36aee0,_0x3f6e21=U(_0x4c3b4c,_0x5b7a17)['map'](_0x14082c=>({'id':_0x14082c['id'],'label':_0x14082c['label']}));return{'id':_0x23b760,'menu':_0x521f6a||_0x23b760,'children':_0x3f6e21};});}(_0x3e2a9a),{'ariaLabel':i(_0x4ee424,'AI\x20Commands')}),_0x34cc8f['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x430e4a['on']('change:enabledCommandsIds',_0x508a63),_0x34cc8f['menuView']['once']('render',_0x508a63),_0x34cc8f;function _0x508a63(){_0x34cc8f['isEnabled']=_0x430e4a['enabledCommandsIds']['length']>0x0;for(const _0x31f66a of _0x34cc8f['menuView']['buttons'])_0x31f66a['isEnabled']=_0x430e4a['enabledCommandsIds']['includes'](_0x31f66a['id']);}}),_0x3e2a9a['ui']['componentFactory']['add']('menuBar:aiCommands',_0x131e1f=>{const _0x5aca5b=new _0x246737(_0x131e1f);_0x5aca5b['buttonView']['set']({'label':i(_0x131e1f,'AI\x20Commands'),'icon':_0x7b7565}),_0x5aca5b['bind']('isEnabled')['to'](_0x430e4a,'enabledCommandsIds',_0xae752c=>_0xae752c['length']>0x0);const _0x43ffa2=o(_0x3e2a9a['config']['get']('ai.aiAssistant.commands'),_0x131e1f);return this['_populateMenuBarMenu'](_0x430e4a,_0x5aca5b,_0x43ffa2,_0x395842=>this['_onExecute'](_0x395842)),_0x5aca5b;}),_0x3e2a9a['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x48741b=this['_createAIAssistantUIButton'](_0x421dfa);return _0x48741b['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x48741b;}),_0x3e2a9a['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x394134=this['_createAIAssistantUIButton'](_0x1a1400);return _0x394134['set']({'role':'menuitemcheckbox'}),_0x394134;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x537ccb=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x196a15;for(const _0x4c65ef in _0x537ccb){const _0x559893=_0x4c65ef,_0x2ad52b=_0x537ccb[_0x559893];if('aiLicenseKeyValid'==_0x2ad52b||'aiLicenseKeyInvalid'==_0x2ad52b||'aiLicenseKeyExpired'==_0x2ad52b||'aiLicenseKeyDomainLimit'==_0x2ad52b||'aiLicenseKeyNotAllowed'==_0x2ad52b||'aiLicenseKeyEvaluationLimit'==_0x2ad52b||'aiLicenseKeyTrialLimit'==_0x2ad52b||'aiLicenseKeyUsageLimit'==_0x2ad52b){delete _0x537ccb[_0x559893],_0x196a15=_0x2ad52b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x196a15&&_0x537ccb['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x196a15&&_0x537ccb['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x196a15&&_0x537ccb['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x196a15&&_0x537ccb['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x434a24='',_0x385a7a='',_0x374b0e='custom'){const _0x4e63a9=this['editor'],_0x44f7ee=_0x4e63a9['editing']['view'],_0x526334=_0x4e63a9['plugins']['get'](a),_0x2646d5=_0x4e63a9['plugins']['get'](_0x4a0108);_0x526334['showFakeVisualSelection']();const _0x50932e=new w(),_0x1b379c=new ClipboardEvent('copy',{'clipboardData':_0x50932e}),_0x2c849e=new _0x4de348(_0x50932e),_0x49cfe6=new _0x4d1a59(_0x44f7ee,_0x1b379c,{'dataTransfer':_0x2c849e});_0x2646d5['_forceMarkersCopy']('comment',()=>{_0x44f7ee['document']['fire']('copy',_0x49cfe6);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x4e63a9,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1a645b=_0x2c849e['getData']('text/html');const _0x199246=_0x4e63a9['model']['document']['selection'],_0x788f7b=Array['from'](_0x199246['getRanges']());0x1===_0x788f7b['length']&&_0x788f7b[0x0]['isFlat']&&!_0x199246['getSelectedElement']()&&''!==_0x1a645b['replace'](/&nbsp;/g,'')['trim']()&&(_0x1a645b='<p>'+_0x1a645b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x374b0e,'query':_0x434a24,'htmlContent':_0x1a645b,'label':_0x385a7a,'mainActionLabel':M[_0x4e63a9['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x261814,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x4ebd44['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x526334['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2be876=new Map(),_0x590be5=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x27f210 of _0x590be5)for(const _0x2d2beb of _0x27f210['commands'])_0x2be876['set'](_0x2d2beb['id'],{..._0x2d2beb,'groupId':_0x27f210['groupId'],'groupLabel':_0x27f210['groupLabel']||_0x27f210['groupId']});return _0x2be876;}['_createAIAssistantUIButton'](_0x562cd0){const _0x483edd=this['editor'],_0xf80f63=_0x483edd['commands']['get']('showAIAssistant'),_0x4435a5=new _0x562cd0(_0x483edd['locale']);return _0x4435a5['set']({'label':i(_0x483edd['locale'],'AI\x20Assistant'),'icon':_0x261814,'isToggleable':!0x0}),_0x4435a5['bind']('isEnabled')['to'](_0xf80f63),_0x4435a5['bind']('isOn')['to'](this['_dialog'],'id',_0xc6fe71=>'aiAssistant'===_0xc6fe71),this['listenTo'](_0x4435a5,'execute',()=>{_0x4435a5['isOn']?this['hideUI']():_0xf80f63['execute']();}),_0x4435a5;}['_initView'](){const _0x56b382=this['editor']['plugins']['get'](a);this['_formView']=new _(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x56b382['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x56b382['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2e2d53,ui:{ariaLiveAnnouncer:_0x5643da}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x341077,_0x5754b7,_0x551ece)=>{const _0x4175db=this['_aiAssistantController']['currentContext'];_0x551ece?_0x5643da['announce'](i(_0x2e2d53,'AI\x20is\x20writing')):_0x4175db&&_0x5643da['announce'](i(_0x2e2d53,'Generated\x20content:\x20%0',_0x4175db),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2c4771,_0x29625d,_0x509377)=>{if(_0x509377){const _0x5263ec=this['_formView']['errorView']['text'];_0x5643da['announce'](i(_0x2e2d53,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5263ec));}});}['_onExecute'](_0x4695e1){const _0x32f102=this['_commandDefinitions']['get'](_0x4695e1),_0x57e99=this['editor'],_0x3341bd=_0x57e99['model']['document']['selection'],_0xd426ba=_0x57e99['commands']['get']('showAIAssistant'),_0x337a27=_0x57e99['plugins']['get'](a),_0x7c2a04=''+(_0x32f102['groupId']!==x?_0x32f102['groupLabel']+':\x20':'')+_0x32f102['label'];if(!0x1!==_0x32f102['requiresContent']&&_0x3341bd['isCollapsed']){const _0x2d7bd6=_0x1c954a(_0x3341bd['getSelectedBlocks']())||_0x57e99['model']['schema']['getLimitElement'](_0x3341bd);_0x57e99['model']['change'](_0x1cf3d2=>{_0x1cf3d2['setSelection'](_0x2d7bd6,'in');});}_0x337a27['showFakeVisualSelection'](),_0xd426ba['execute'](_0x32f102['prompt'],_0x7c2a04,'command:'+_0x4695e1);}['_populateMenuBarMenu'](_0x18a5b3,_0x3fae34,_0x28206d,_0x2502be){const _0x87873=this['editor'],_0x427fd5=_0x87873['locale'],_0x260936=new _0x347523(_0x427fd5),_0x5bd65c=U(_0x87873,_0x28206d)['filter'](_0x71301=>_0x71301['commands']['length']);0x1===_0x5bd65c['length']?this['_getMenuBarGroupButtons']({'command':_0x18a5b3,'commands':_0x5bd65c[0x0]['commands'],'parentMenuView':_0x3fae34,'onExecute':_0x2502be})['forEach'](_0x14a12f=>_0x260936['items']['add'](_0x14a12f)):_0x5bd65c['forEach'](({groupId:_0x2495df,groupLabel:_0x227a38,commands:_0x452a84})=>{const _0x4a5b94=new _0x1b214f(_0x427fd5,_0x3fae34),_0x594599=new _0x246737(_0x427fd5),_0x449bbc=new _0x347523(_0x427fd5),_0x3947f9=this['_getMenuBarGroupButtons']({'command':_0x18a5b3,'commands':_0x452a84,'parentMenuView':_0x594599,'onExecute':_0x2502be});_0x594599['buttonView']['set']({'label':_0x227a38||_0x2495df}),_0x594599['delegate']('execute')['to'](_0x3fae34),_0x449bbc['items']['addMany'](_0x3947f9),_0x594599['panelView']['children']['add'](_0x449bbc),_0x4a5b94['children']['add'](_0x594599),_0x260936['items']['add'](_0x4a5b94);}),_0x3fae34['panelView']['children']['add'](_0x260936);}['_getMenuBarGroupButtons']({command:_0x127652,commands:_0xfd5126,parentMenuView:_0x34b680,onExecute:_0x3b6f03}){const _0x234a03=this['editor'],_0x396017=_0x234a03['locale'];return U(_0x234a03,_0xfd5126)['map'](_0xe06e57=>{const _0x224b0e=new _0x1b214f(_0x396017,_0x34b680),_0x48e498=new _0x1a1400(_0x396017);return _0x48e498['set']({'label':_0xe06e57['label']}),_0x48e498['delegate']('execute')['to'](_0x34b680),_0x48e498['on']('execute',()=>_0x3b6f03(_0xe06e57['id'])),_0x48e498['bind']('isEnabled')['to'](_0x127652,'enabledCommandsIds',_0x154489=>_0x154489['includes'](_0xe06e57['id'])),_0x224b0e['children']['add'](_0x48e498),_0x224b0e;});}}function B(_0x429721,_0x5a5350){return void 0x0!==_0x429721['order']&&void 0x0===_0x5a5350['order']?0x1:void 0x0===_0x429721['order']&&void 0x0!==_0x5a5350['order']?-0x1:void 0x0!==_0x429721['order']&&void 0x0!==_0x5a5350['order']?_0x429721['order']-_0x5a5350['order']:0x0;}function U(_0x1fb1e3,_0x4c3064){_0x4c3064['sort'](B);const _0x330a5d={},_0x16b8a5=[];for(const _0x2d0c20 of _0x4c3064)if(void 0x0!==_0x2d0c20['order']){if(_0x2d0c20['order']in _0x330a5d)throw new _0x476136('ai-commands-config-order-collision',_0x1fb1e3,{'conflictingDefinitions':[_0x2d0c20,_0x330a5d[_0x2d0c20['order']]]});_0x330a5d[_0x2d0c20['order']]=_0x2d0c20,_0x16b8a5['splice'](_0x2d0c20['order'],0x0,_0x2d0c20);}else _0x16b8a5['push'](_0x2d0c20);return _0x16b8a5;}class r extends _0xe793ad{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5f4312){super(_0x5f4312);const _0x452718=_0x5f4312['config'],_0x239e0a=_0x5f4312['locale'];_0x452718['define']('ai.aiAssistant.preserveComments',!0x0),_0x452718['define']('ai.aiAssistant.commands',function(_0x3d9dd0){return[{'groupId':'editOrReview','groupLabel':i(_0x3d9dd0,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3d9dd0,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3d9dd0,'Make\x20shorter'),'prompt':'Remove\x20any\x20repetitive,\x20redundant,\x20or\x20non-essential\x20writing\x20in\x20this\x20content\x20without\x20changing\x20the\x20meaning\x20or\x20losing\x20any\x20key\x20information.'},{'id':'makeLonger','label':i(_0x3d9dd0,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3d9dd0,'Simplify\x20language'),'prompt':'Simplify\x20the\x20writing\x20style\x20of\x20this\x20content\x20and\x20reduce\x20the\x20complexity,\x20so\x20that\x20the\x20content\x20is\x20easy\x20to\x20understand.'}]},{'groupId':'generate','groupLabel':i(_0x3d9dd0,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3d9dd0,'Summarize'),'prompt':'Summarize\x20this\x20content\x20into\x20one\x20paragraph\x20of\x20text.\x20Include\x20only\x20the\x20key\x20ideas\x20and\x20conclusions.\x20Keep\x20it\x20short.\x20Do\x20not\x20keep\x20original\x20text\x20formatting.'},{'id':'continue','label':i(_0x3d9dd0,'Continue'),'prompt':'Start\x20with\x20the\x20provided\x20content\x20and\x20write\x20at\x20the\x20end\x20of\x20it\x20continuing\x20this\x20topic.\x20Keep\x20the\x20added\x20part\x20short.'}]},{'groupId':'changeTone','groupLabel':i(_0x3d9dd0,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3d9dd0,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3d9dd0,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3d9dd0,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3d9dd0,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3d9dd0,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3d9dd0,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3d9dd0,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3d9dd0,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3d9dd0,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3d9dd0,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3d9dd0,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3d9dd0,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3d9dd0,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3d9dd0,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3d9dd0,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3d9dd0,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3d9dd0,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3d9dd0,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3d9dd0,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x239e0a)),_0x452718['define']('ai.aiAssistant.extraCommandGroups',[]),_0x452718['define']('ai.aiAssistant.removeCommands',[]);let _0x1da6d7=o(_0x452718['get']('ai.aiAssistant.commands'),_0x239e0a);const _0x4988c8=_0x452718['get']('ai.aiAssistant.extraCommandGroups'),_0x36544d=_0x452718['get']('ai.aiAssistant.removeCommands');_0x4988c8['forEach'](_0x1f227d=>{const _0x17ecf5=_0x1da6d7['find'](_0x648ed3=>_0x648ed3['groupId']===_0x1f227d['groupId']);_0x17ecf5?_0x17ecf5['commands']=_0x17ecf5['commands']['concat'](_0x1f227d['commands']):_0x1da6d7['push'](_0x1f227d);}),_0x1da6d7=_0x1da6d7['filter'](_0x38e08e=>!_0x36544d['includes'](_0x38e08e['groupId'])),_0x1da6d7['forEach'](_0x4d0a58=>{_0x4d0a58['commands']=_0x4d0a58['commands']['filter'](_0x1c2648=>!_0x36544d['includes'](_0x1c2648['id']));}),_0x452718['set']('ai.aiAssistant.commands',_0x1da6d7);}}class P extends _0xe793ad{['abortController'];static get['requires'](){return[E];}constructor(_0x762246){super(_0x762246),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x2489f5){return this['sendRequest'](_0x2489f5)['catch'](_0x5264e3=>{if(_0x5264e3 instanceof R)return Promise['reject'](_0x5264e3);if('AbortError'==_0x5264e3['name'])return Promise['resolve']();throw console['error'](_0x5264e3),new _0x476136('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1cf2b5,_0x235ce6){const _0x38f98c=this['editor']['locale'],_0x9aa13c={'Content-Type':'application/json'};if('object'==typeof _0x1cf2b5)Object['assign'](_0x9aa13c,_0x1cf2b5);else{if(_0x1cf2b5)try{const _0x48d5af=await _0x1cf2b5(_0x235ce6);Object['assign'](_0x9aa13c,_0x48d5af);}catch{return Promise['reject'](new R(i(_0x38f98c,'AI_ERROR_GET_HEADERS')));}}return _0x9aa13c;}async['_prepareRequestParameters'](_0xce3779,_0x4b25cc){const _0x84da39=this['editor']['locale'];if('object'==typeof _0xce3779)return _0xce3779;try{return await _0xce3779(_0x4b25cc);}catch{return Promise['reject'](new R(i(_0x84da39,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x144408){super(_0x144408),_0x144408['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x144408['config']['get']('ai.openAI.requestParameters')||_0x144408['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x144408['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x144408['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x144408['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x4a00c3,context:_0x2e10d2,onData:_0xd1ba3a,actionId:_0x1be094}){const _0x531cff=this['editor']['locale'],_0x3eeb1c=await this['prepareMessages'](_0x4a00c3,_0x2e10d2,_0x1be094),_0x369369=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1be094),_0x45c3b6=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1be094),_0x3d632d={'messages':_0x3eeb1c,..._0x45c3b6},_0x1dc71a={'method':'POST','headers':_0x369369,'body':JSON['stringify'](_0x3d632d),'signal':this['abortController']['signal']},_0x3544f5=await fetch(this['_apiUrl'],_0x1dc71a);if(_0x3544f5['ok'])return _0x45c3b6['stream']?await this['_readStreamableResponse'](_0x3544f5,_0xd1ba3a):await this['_readStaticResponse'](_0x3544f5,_0xd1ba3a),Promise['resolve']();{const _0x42138c=await _0x3544f5['text']();return _0x42138c['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x531cff,'AI_ERROR_CONTEXT_LENGTH'))):_0x42138c['includes']('Moderation')?Promise['reject'](new R(i(_0x531cff,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x42138c));}}async['prepareMessages'](_0x93611,_0x52bbb0,_0x5a9483){let _0x5df957,_0x42cce6;return _0x52bbb0?(_0x5df957='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x42cce6='Instruction:\x0a'+_0x93611+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x52bbb0):(_0x5df957='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x42cce6=_0x93611),[{'role':'system','content':_0x5df957},{'role':'user','content':_0x42cce6}];}async['_readStreamableResponse'](_0x532b97,_0x65abad){const _0x106085=_0x532b97['body']['getReader'](),_0x2142af=new TextDecoder();let _0x5bc5a8='',_0x4bd2ee='',_0x242964='',_0x37f8cb=!0x1;for(;!_0x37f8cb;){const {done:_0x243b6b,value:_0x5a23ee}=await _0x106085['read'](),_0x2486fa=_0x5bc5a8+_0x2142af['decode'](_0x5a23ee);let _0x140a63='';_0x37f8cb=_0x243b6b;try{_0x140a63=this['_cleanUpData'](_0x2486fa),_0x5bc5a8='';}catch{_0x5bc5a8=_0x2486fa;continue;}_0x4bd2ee+=_0x140a63,!_0x37f8cb&&this['_isBufferIncomplete'](_0x4bd2ee)||_0x4bd2ee&&(_0x242964+=_0x4bd2ee,_0x4bd2ee='',_0x65abad(_0x242964));}return Promise['resolve']();}async['_readStaticResponse'](_0x502fce,_0x3871af){return _0x3871af((await _0x502fce['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2f675f){const _0xdc39fd=_0x2f675f['split']('<')['length']!==_0x2f675f['split']('>')['length'],_0x18a72e=_0x2f675f['length']<0x1e;return _0xdc39fd&&_0x18a72e;}['_cleanUpData'](_0x48a24f){return _0x48a24f['split'](/\n(?![^{]*\})/g)['map'](_0x3e69fd=>_0x3e69fd['replace']('data:\x20',''))['filter'](_0x504ae6=>_0x504ae6&&_0x504ae6['length']>0x0&&'[DONE]'!==_0x504ae6)['map'](_0xe7d46e=>{const {choices:_0x4a10f1}=JSON['parse'](_0xe7d46e);if(_0x4a10f1[0x0]?.['delta']?.['content'])return _0x4a10f1[0x0]['delta']['content'];})['filter'](_0x6519ef=>_0x6519ef)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x32d378){super(_0x32d378),_0x32d378['config']['get']('ai.aws.requestParameters')||_0x32d378['config']['define']('ai.aws.requestParameters',{'model':'anthropic.claude-v2','max_tokens_to_sample':0x7d0,'temperature':0x1,'top_p':0x1,'top_k':0xfa,'anthropic_version':'bedrock-2023-05-31','stream':!0x0}),this['_apiUrl']=_0x32d378['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x32d378['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x32d378['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x32d378['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x35fcca,context:_0x5b1430,onData:_0x5bee38,actionId:_0x57d49b}){const {model:_0x5dfd42,stream:_0x4c1089,..._0x38ce54}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x57d49b),_0x57e964={'prompt':await this['preparePrompt'](_0x35fcca,_0x5b1430,_0x5dfd42,_0x57d49b),..._0x38ce54};this['_apiUrl']?await this['_processProxyRequest'](_0x57e964,_0x5dfd42,_0x4c1089,_0x5bee38,_0x57d49b):await this['_processAWSRequest'](_0x57e964,_0x5dfd42,_0x4c1089,_0x5bee38);}async['preparePrompt'](_0x3c93f6,_0x3c0bd6,_0x50cb39,_0x4f0d15){let _0x3cd74d,_0x538883;return _0x3c0bd6?(_0x3cd74d='Your\x20task\x20is\x20to\x20execute\x20the\x20instruction\x20using\x20the\x20provided\x20HTML\x20content.\x20Follow\x20the\x20instruction\x20closely.\x20Your\x20answer\x20must\x20be\x20a\x20properly\x20formatted\x20HTML\x20code.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x538883='Instruction:\x0a'+_0x3c93f6+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3c0bd6):(_0x3cd74d='Your\x20task\x20is\x20to\x20generate\x20HTML\x20content\x20accordingly\x20to\x20the\x20given\x20instruction.\x20Never\x20include\x20<img>\x20tag\x20in\x20your\x20response\x20even\x20if\x20asked\x20for.\x20Your\x20answer\x20must\x20be\x20a\x20well-structured\x20and\x20properly\x20formatted\x20HTML\x20code.\x20Answer\x20only\x20with\x20the\x20generated\x20HTML\x20content.\x20Do\x20not\x20add\x20any\x20additional\x20remarks\x20or\x20notes.\x20Do\x20not\x20act\x20like\x20a\x20chatbot\x20or\x20a\x20real\x20person.',_0x538883=_0x3c93f6),'meta.llama'==this['getModelFamily'](_0x50cb39)?'<<SYS>>\x0a'+_0x3cd74d+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x538883+'\x0a[/INST]':'Human:\x0a'+_0x3cd74d+'\x0a'+_0x538883+'\x0a\x0aAssistant:';}['getModelFamily'](_0x357272){if(/^anthropic\.claude/['test'](_0x357272))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x357272))return'ai21.j2';if(/^cohere\.command/['test'](_0x357272))return'cohere.command';if(/^meta\.llama/['test'](_0x357272))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x357272));}async['_processProxyRequest'](_0x9e113d,_0x2b7d1e,_0x50c1f9,_0x432e8a,_0x2e540a){const _0x19e5a9={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2e540a),'body':JSON['stringify']({..._0x9e113d,'model':_0x2b7d1e,'stream':_0x50c1f9}),'signal':this['abortController']['signal']},_0x2d6224=await fetch(this['_apiUrl'],_0x19e5a9);_0x50c1f9?await this['_readStreamableResponse'](_0x2d6224,_0x2b7d1e,_0x432e8a):await this['_readStaticResponse'](_0x2d6224,_0x2b7d1e,_0x432e8a);}async['_processAWSRequest'](_0x3c74c4,_0xfbfadf,_0x41d561,_0x139608){const _0x45b32c=new _0x4e8b25(this['_bedrockClientConfig']),_0x40349e={'body':JSON['stringify'](_0x3c74c4),'contentType':'application/json','accept':'application/json','modelId':_0xfbfadf};let _0x1997ec;if(_0x41d561){const _0x3d4a48=new _0x48acd1(_0x40349e);_0x1997ec=await _0x45b32c['send'](_0x3d4a48,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1997ec,_0xfbfadf,_0x139608);}else{const _0x5564cb=new _0x4052cf(_0x40349e);_0x1997ec=await _0x45b32c['send'](_0x5564cb,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1997ec,_0xfbfadf,_0x139608);}}async['_readAsyncIterableResponse'](_0x6d166c,_0x13fd3b,_0x533ff1){const _0x24d95c=_0x6d166c['body'],_0x1673d8=new TextDecoder('utf-8');let _0x2c5517='';for await(const _0x394d28 of _0x24d95c)if(_0x394d28['chunk']){const _0x22779e=_0x1673d8['decode'](_0x394d28['chunk']['bytes']),_0x2bca4e=JSON['parse'](_0x22779e);_0x2c5517+=this['_getGeneratedText'](_0x2bca4e,_0x13fd3b),_0x533ff1(_0x2c5517);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5550be,_0x4f36f3,_0x46e9d5){const _0x532f33=_0x5550be['body'],_0x3a71f6=new TextDecoder('utf-8'),_0x3b3352=_0x532f33['getReader']();let _0x13028e='',_0x4b99dd='',_0x43c032=!0x1;for(;!_0x43c032;){const {done:_0x18c731,value:_0x39f72d}=await _0x3b3352['read']();if(_0x43c032=_0x18c731,_0x43c032)break;const _0x599f7f=(_0x13028e+_0x3a71f6['decode'](_0x39f72d))['split']('\x0a')['map'](_0x3a480d=>{try{return _0x13028e='',JSON['parse'](_0x3a480d);}catch{return _0x13028e=_0x3a480d,null;}})['filter'](_0x437b1c=>null!==_0x437b1c);_0x599f7f['length']&&(_0x4b99dd+=_0x599f7f['map'](_0x588c7e=>this['_getGeneratedText'](_0x588c7e,_0x4f36f3))['join'](''),_0x46e9d5(_0x4b99dd));}return Promise['resolve']();}async['_readStaticResponse'](_0xcf5d30,_0x370c19,_0x41e6ed){let _0x210baa;return _0x210baa=_0xcf5d30 instanceof Response?await _0xcf5d30['json']():JSON['parse'](Buffer['from'](_0xcf5d30['body'])['toString']('utf8')),(_0x41e6ed(this['_getGeneratedText'](_0x210baa,_0x370c19)),Promise['resolve']());}['_getGeneratedText'](_0xfea0ac,_0x4b6ea0){switch(this['getModelFamily'](_0x4b6ea0)){case'anthropic.claude':return _0xfea0ac['completion'];case'ai21.j2':return _0xfea0ac['completions'][0x0]['data']['text'];case'cohere.command':return _0xfea0ac['generations'][0x0]['text'];case'meta.llama':return _0xfea0ac['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ai",
3
- "version": "45.2.0-alpha.4",
3
+ "version": "45.2.0-alpha.6",
4
4
  "description": "AI Assistant feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -24,14 +24,14 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@aws-sdk/client-bedrock-runtime": "3.621.0",
27
- "@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.4",
28
- "@ckeditor/ckeditor5-core": "45.2.0-alpha.4",
29
- "@ckeditor/ckeditor5-engine": "45.2.0-alpha.4",
30
- "@ckeditor/ckeditor5-icons": "45.2.0-alpha.4",
31
- "@ckeditor/ckeditor5-table": "45.2.0-alpha.4",
32
- "@ckeditor/ckeditor5-ui": "45.2.0-alpha.4",
33
- "@ckeditor/ckeditor5-utils": "45.2.0-alpha.4",
34
- "ckeditor5": "45.2.0-alpha.4",
27
+ "@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.6",
28
+ "@ckeditor/ckeditor5-core": "45.2.0-alpha.6",
29
+ "@ckeditor/ckeditor5-engine": "45.2.0-alpha.6",
30
+ "@ckeditor/ckeditor5-icons": "45.2.0-alpha.6",
31
+ "@ckeditor/ckeditor5-table": "45.2.0-alpha.6",
32
+ "@ckeditor/ckeditor5-ui": "45.2.0-alpha.6",
33
+ "@ckeditor/ckeditor5-utils": "45.2.0-alpha.6",
34
+ "ckeditor5": "45.2.0-alpha.6",
35
35
  "es-toolkit": "1.32.0"
36
36
  },
37
37
  "type": "module",