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

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 _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};
23
+ import{Plugin as _0x2141a7,Command as _0x1753db}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x25d06d,IconCheck as _0x3d4704,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0xfcc0af,IconRobotPencil as _0x4a2c5f}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x1678c8,CKEditorError as _0x2c453e,ObservableMixin as _0x32a727,global as _0x280648,isVisible as ot,Rect as it,Collection as _0x193d7b,FocusTracker as mt,KeystrokeHandler as ut,first as _0x589312}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x1d57a2,View as _0xd64d08,SpinnerView as _0x53dc20,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 _0x3e357e,createDropdown as _0x5b23cd,addMenuToDropdown as _0x52b4e5,MenuBarMenuView as _0x5e7641,MenuBarMenuListItemButtonView as _0xb1dcc0,DialogViewPosition as _0x3073c0,MenuBarMenuListView as _0x4e401a,MenuBarMenuListItemView as _0x35210b}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x5cad60,ClipboardMarkersUtils as _0x3650f3}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2cb29c,DataTransfer as _0x3ed6a0,UpcastWriter as _0x143e6a,Matcher as _0x15c29a}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x55fd7a,InvokeModelWithResponseStreamCommand as _0x5d8c68,InvokeModelCommand as _0x32bf9}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x214ac4,_0x79a6b0){const _0x1e8053=(0x0,_0x79a6b0['t'])('Other');return _0x214ac4['length']?'groupId'in _0x214ac4[0x0]?_0x214ac4:[{'groupId':x,'groupLabel':_0x1e8053,'order':0x1/0x0,'commands':_0x214ac4}]:[{'groupId':x,'groupLabel':_0x1e8053,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2141a7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x106b4a}=this,_0x484701=['ck-fake-ai-selection'];_0x106b4a['config']['get']('ai.useTheme')&&_0x484701['push']('ck-ai-assistant-ui_theme'),_0x106b4a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x484701,'priority':0xc}}),_0x106b4a['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x567a27,{writer:_0x5c4d1b})=>{if(!_0x567a27['markerRange']['isCollapsed'])return null;const _0x272c0e=_0x5c4d1b['createUIElement']('span');return _0x5c4d1b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x272c0e),_0x272c0e;}});}['afterInit'](){!async function(_0x203690){const _0x3b7b11=_0x446e19([0x5a,0x73,0x42,0x4a,0x35,0x68,0x6c,0x55,0x50,0x53,0x70,0x48,0x79,0x65,0x63,0x6b,0x34,0x30,0x32,0x6a,0x76,0x51,0x78,0x57,0x52,0x7a,0x4d,0x45,0x75,0x6d,0x66,0x77,0x62,0x71,0x37,0x69,0x4f,0x67,0x31,0x74,0x4e,0x4c,0x41,0x59,0x49,0x54,0x47,0x4b,0x39,0x46,0x61,0x56,0x58,0x72,0x6f,0x64,0x33,0x44,0x38,0x43,0x6e,0x36]),_0x18dfbf=0x7bc975de,_0x64065f=0x7bce1c16^_0x18dfbf,_0x5334df=window[_0x446e19([0x44,0x61,0x74,0x65])][_0x446e19([0x6e,0x6f,0x77])](),_0x5404fa=_0x203690[_0x446e19([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1acf3e=new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x27be14=>{_0x5404fa[_0x446e19([0x6f,0x6e,0x63,0x65])](_0x446e19([0x72,0x65,0x61,0x64,0x79]),_0x27be14);}),_0x36670e={[_0x446e19([0x6b,0x74,0x79])]:_0x446e19([0x45,0x43]),[_0x446e19([0x75,0x73,0x65])]:_0x446e19([0x73,0x69,0x67]),[_0x446e19([0x63,0x72,0x76])]:_0x446e19([0x50,0x2d,0x32,0x35,0x36]),[_0x446e19([0x78])]:_0x446e19([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]),[_0x446e19([0x79])]:_0x446e19([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]),[_0x446e19([0x61,0x6c,0x67])]:_0x446e19([0x45,0x53,0x32,0x35,0x36])},_0x139ae6=_0x5404fa[_0x446e19([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x446e19([0x67,0x65,0x74])](_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x20a63a(){let _0x5bd3d6,_0x430077=null,_0x2f363a=null;try{if(_0x139ae6==_0x446e19([0x47,0x50,0x4c]))return _0x446e19([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5bd3d6=_0x4146bf(),!_0x5bd3d6)return _0x446e19([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5bd3d6[_0x446e19([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2f363a=_0x59040a(_0x5bd3d6[_0x446e19([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5bd3d6[_0x446e19([0x6a,0x74,0x69])])),await _0x2fd72f()?_0x2ac597()?_0x288ede()?_0x446e19([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xd7f100()?(_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x446e19([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x430077=_0x420de0(_0x446e19([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x446e19([0x74,0x72,0x69,0x61,0x6c])&&(_0x430077=_0x420de0(_0x446e19([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x193871()):_0x446e19([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x446e19([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x446e19([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x446e19([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x288ede(){const _0x5b0e8e=[_0x446e19([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x446e19([0x74,0x72,0x69,0x61,0x6c])][_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5334df/0x3e8:0xe10*_0x64065f;return _0x5bd3d6[_0x446e19([0x65,0x78,0x70])]<_0x5b0e8e;}function _0x2ac597(){const _0x5df87a=_0x5bd3d6[_0x446e19([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5df87a&&(!!_0x5df87a[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x446e19([0x2a]))||!!_0x5df87a[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x446e19([0x41,0x49])));}function _0xd7f100(){const _0x1a5c27=_0x5bd3d6[_0x446e19([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1a5c27||0x0==_0x1a5c27[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x46f6af}=new URL(window[_0x446e19([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1a5c27[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x46f6af))return!0x0;const _0x16c9ea=_0x46f6af[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e]));return _0x1a5c27[_0x446e19([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3bd8c1=>_0x3bd8c1[_0x446e19([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x446e19([0x2a])))[_0x446e19([0x6d,0x61,0x70])](_0xacea29=>_0xacea29[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e])))[_0x446e19([0x73,0x6f,0x6d,0x65])](_0x2df84d=>_0x16c9ea[_0x446e19([0x65,0x76,0x65,0x72,0x79])]((_0x5705f4,_0xba5455)=>_0x2df84d[_0xba5455]===_0x5705f4||_0x2df84d[_0xba5455]===_0x446e19([0x2a])));}function _0x193871(){return _0x430077&&_0x2f363a?new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4cfec4,_0x3bc7b3)=>{_0x430077[_0x446e19([0x74,0x68,0x65,0x6e])](_0x4cfec4,_0x3bc7b3),_0x2f363a[_0x446e19([0x74,0x68,0x65,0x6e])](_0x558839=>{_0x558839!=_0x446e19([0x56,0x61,0x6c,0x69,0x64])&&_0x4cfec4(_0x558839);},_0x3bc7b3);}):_0x430077||_0x2f363a||_0x446e19([0x56,0x61,0x6c,0x69,0x64]);}}function _0x59040a(_0x302a6b,_0xf60d10){return new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b01da=>{if(_0x30be9b())return _0x2b01da(_0x446e19([0x56,0x61,0x6c,0x69,0x64]));_0x19e0d0(),_0x5404fa[_0x446e19([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x446e19([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3e85e0=!0x1;const _0x49109f=_0x1678c8();function _0x91037e(_0x3f916b){return!!_0x3f916b&&(typeof _0x3f916b===_0x446e19([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3f916b===_0x446e19([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3f916b[_0x446e19([0x74,0x68,0x65,0x6e])]===_0x446e19([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3f916b[_0x446e19([0x63,0x61,0x74,0x63,0x68])]===_0x446e19([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x52c49d(_0x17f3cb){_0x31d5ce(_0x17f3cb)[_0x446e19([0x74,0x68,0x65,0x6e])](_0x4444c2=>{if(!_0x4444c2||_0x4444c2[_0x446e19([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x446e19([0x6f,0x6b]))return _0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x7f6ed7(_0x4d63bf(_0x49109f+_0xf60d10))!=_0x4444c2[_0x446e19([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x446e19([0x56,0x61,0x6c,0x69,0x64]);})[_0x446e19([0x74,0x68,0x65,0x6e])](_0x5ba860=>(_0x313794(),_0x5ba860),()=>{const _0x2f370a=_0x2f2ced();return null==_0x2f370a?(_0x313794(),_0x446e19([0x56,0x61,0x6c,0x69,0x64])):_0x446e19(_0x5334df-_0x2f370a>(0x5fc5f1de^_0x18dfbf)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x446e19([0x74,0x68,0x65,0x6e])](_0x2b01da)[_0x446e19([0x63,0x61,0x74,0x63,0x68])](()=>{_0x2b01da(_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2fc2b4=0x7bff9b5e^_0x18dfbf;function _0x313794(){const _0x2b1ba1=_0x446e19([0x6c,0x6c,0x63,0x74,0x2d])+_0x7f6ed7(_0x4d63bf(_0x302a6b)),_0x1c0665=_0x49e57b(_0x7f6ed7(window[_0x446e19([0x4d,0x61,0x74,0x68])][_0x446e19([0x63,0x65,0x69,0x6c])](_0x5334df/_0x2fc2b4)));window[_0x446e19([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x446e19([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2b1ba1,_0x1c0665);}function _0x2f2ced(){const _0x499f3a=_0x446e19([0x6c,0x6c,0x63,0x74,0x2d])+_0x7f6ed7(_0x4d63bf(_0x302a6b)),_0x544604=window[_0x446e19([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x446e19([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x499f3a);return _0x544604?window[_0x446e19([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x49e57b(_0x544604),0x10)*_0x2fc2b4:null;}function _0x31d5ce(_0x326c48){return new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3382fe,_0x15194e)=>{_0x326c48[_0x446e19([0x74,0x68,0x65,0x6e])](_0x3382fe,_0x15194e),window[_0x446e19([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x15194e,0x7bc8a11e^_0x18dfbf);});}}_0x5404fa[_0x446e19([0x6f,0x6e])](_0x446e19([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xbb0d63,_0x4a0297)=>{if(_0x4a0297[0x0]!=_0x302a6b)return _0x2b01da(_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4a0297[0x1]={..._0x4a0297[0x1],[_0x446e19([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x49109f};},{[_0x446e19([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x446e19([0x68,0x69,0x67,0x68])}),_0x5404fa[_0x446e19([0x6f,0x6e])](_0x446e19([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3853eb=>{_0x91037e(_0x3853eb[_0x446e19([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3e85e0=!0x0,_0x52c49d(_0x3853eb[_0x446e19([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x446e19([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x446e19([0x6c,0x6f,0x77])}),_0x1acf3e[_0x446e19([0x74,0x68,0x65,0x6e])](()=>{_0x3e85e0||_0x2b01da(_0x446e19([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x30be9b(){return _0x5404fa[_0x446e19([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x446e19([0x76,0x69,0x65,0x77])][_0x446e19([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x446e19([0x61,0x75,0x74,0x6f]);}function _0x19e0d0(){_0x5404fa[_0x446e19([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x446e19([0x76,0x69,0x65,0x77])][_0x446e19([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x446e19([0x61,0x75,0x74,0x6f]);}}function _0x420de0(_0x5e3a6c){const _0x786f34=[new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2fff68=>setTimeout(_0x2fff68,0x7bc04b12^_0x18dfbf)),_0x1acf3e[_0x446e19([0x74,0x68,0x65,0x6e])](()=>new window[(_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3264ea=>{let _0x1f6777=0x0;_0x5404fa[_0x446e19([0x6d,0x6f,0x64,0x65,0x6c])][_0x446e19([0x6f,0x6e])](_0x446e19([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4b69c2,_0x3ec87c)=>{_0x3ec87c[0x0][_0x446e19([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1f6777++,_0x1f6777==(0x7bc97426^_0x18dfbf)&&(_0x3264ea(),_0x4b69c2[_0x446e19([0x6f,0x66,0x66])]());});}))];return window[_0x446e19([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x446e19([0x72,0x61,0x63,0x65])](_0x786f34)[_0x446e19([0x74,0x68,0x65,0x6e])](()=>_0x5e3a6c);}async function _0x2861a6(){await _0x1acf3e,_0x5404fa[_0x446e19([0x6d,0x6f,0x64,0x65,0x6c])][_0x446e19([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1a7e5e,_0x5404fa[_0x446e19([0x6d,0x6f,0x64,0x65,0x6c])][_0x446e19([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1a7e5e,_0x5404fa[_0x446e19([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x446e19([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5b2c07(_0x4f9a25){const _0x3757f6=_0x1893d6();_0x5404fa[_0x3757f6]=_0x446e19([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4f9a25,_0x4f9a25!=_0x446e19([0x56,0x61,0x6c,0x69,0x64])&&_0x2861a6();}function _0x1893d6(){const _0x3ec55b=window[_0x446e19([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x446e19([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x446e19([0x6e,0x6f,0x77])]())[_0x446e19([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x446e19([0x2e]),'');let _0x39d5ba=_0x446e19([0x5a]);for(let _0x2fe9af=0x0;_0x2fe9af<_0x3ec55b[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2fe9af+=0x2){let _0xb3084b=window[_0x446e19([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3ec55b[_0x446e19([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2fe9af,_0x2fe9af+0x2));_0xb3084b>=_0x3b7b11[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xb3084b-=_0x3b7b11[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x39d5ba+=_0x3b7b11[_0xb3084b];}return _0x39d5ba;}function _0x4146bf(){const _0x45043e=_0x139ae6[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e]));if(0x3!=_0x45043e[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x585438(_0x45043e[0x1]);function _0x585438(_0x2cb6bd){const _0x126760=_0x3930a9(_0x2cb6bd);return _0x126760&&_0x250122()?_0x126760:null;function _0x250122(){const _0x3d43e2=_0x126760[_0x446e19([0x6a,0x74,0x69])],_0x246f37=window[_0x446e19([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d43e2[_0x446e19([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3d43e2[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2ce959={..._0x126760,[_0x446e19([0x6a,0x74,0x69])]:_0x3d43e2[_0x446e19([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3d43e2[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2ce959[_0x446e19([0x76,0x63])],_0x4d63bf(_0x2ce959)==_0x246f37;}}}async function _0x2fd72f(){let _0x1276b8=!0x0;try{const _0x5a45df=_0x139ae6[_0x446e19([0x73,0x70,0x6c,0x69,0x74])](_0x446e19([0x2e])),[_0x500ad7,_0x1d88f7,_0x20842e]=_0x5a45df;return _0x39f0d1(_0x500ad7),await _0x39dc85(_0x500ad7,_0x1d88f7,_0x20842e),_0x1276b8;}catch{return!0x1;}function _0x39f0d1(_0x5e0c17){const _0x2987de=_0x3930a9(_0x5e0c17);_0x2987de&&_0x2987de[_0x446e19([0x61,0x6c,0x67])]==_0x446e19([0x45,0x53,0x32,0x35,0x36])||(_0x1276b8=!0x1);}async function _0x39dc85(_0x29f521,_0x549fa7,_0x3629a2){const _0x2b8c03=window[_0x446e19([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x446e19([0x66,0x72,0x6f,0x6d])](_0x35ab72(_0x3629a2),_0x427d41=>_0x427d41[_0x446e19([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1f0cd1=new window[(_0x446e19([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x446e19([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x29f521+_0x446e19([0x2e])+_0x549fa7),_0x10b8ef=window[_0x446e19([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x446e19([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x10b8ef)return;const _0x212d3d=await _0x10b8ef[_0x446e19([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x446e19([0x6a,0x77,0x6b]),_0x36670e,{[_0x446e19([0x6e,0x61,0x6d,0x65])]:_0x446e19([0x45,0x43,0x44,0x53,0x41]),[_0x446e19([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x446e19([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x446e19([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x10b8ef[_0x446e19([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x446e19([0x6e,0x61,0x6d,0x65])]:_0x446e19([0x45,0x43,0x44,0x53,0x41]),[_0x446e19([0x68,0x61,0x73,0x68])]:{[_0x446e19([0x6e,0x61,0x6d,0x65])]:_0x446e19([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x212d3d,_0x2b8c03,_0x1f0cd1)||(_0x1276b8=!0x1);}}function _0x3930a9(_0x3993b3){return _0x3993b3[_0x446e19([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x446e19([0x65,0x79]))?JSON[_0x446e19([0x70,0x61,0x72,0x73,0x65])](_0x35ab72(_0x3993b3)):null;}function _0x35ab72(_0x1642c5){return window[_0x446e19([0x61,0x74,0x6f,0x62])](_0x1642c5[_0x446e19([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x446e19([0x2b]))[_0x446e19([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x446e19([0x2f])));}function _0x4d63bf(_0x67216){let _0x1f9a5c=0x1505;function _0x143b59(_0x104815){for(let _0x20d8cf=0x0;_0x20d8cf<_0x104815[_0x446e19([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x20d8cf++){const _0x1f2f82=_0x104815[_0x446e19([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x20d8cf);_0x1f9a5c=(_0x1f9a5c<<0x5)+_0x1f9a5c+_0x1f2f82,_0x1f9a5c&=_0x1f9a5c;}}function _0x28ebce(_0x46cab5){Array[_0x446e19([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x46cab5)?_0x46cab5[_0x446e19([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x28ebce):_0x46cab5&&typeof _0x46cab5==_0x446e19([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x446e19([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x46cab5)[_0x446e19([0x73,0x6f,0x72,0x74])]()[_0x446e19([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x552686,_0xe22b2b])=>{_0x143b59(_0x552686),_0x28ebce(_0xe22b2b);}):_0x143b59(window[_0x446e19([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x46cab5));}return _0x28ebce(_0x67216),_0x1f9a5c>>>0x0;}function _0x7f6ed7(_0x1c457e){return _0x1c457e[_0x446e19([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x446e19([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x446e19([0x30]));}function _0x49e57b(_0x337a9e){return _0x337a9e[_0x446e19([0x73,0x70,0x6c,0x69,0x74])]('')[_0x446e19([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x446e19([0x6a,0x6f,0x69,0x6e])]('');}function _0x1a7e5e(){}function _0x446e19(_0x50ecfd){return _0x50ecfd['map'](_0xd23860=>String['fromCharCode'](_0xd23860))['join']('');}_0x5b2c07(await _0x20a63a());}(this);}['showFakeVisualSelection'](){const _0x413e2e=this['editor']['model'];_0x413e2e['change'](_0x42cfaf=>{const _0x5ac254=_0x413e2e['document']['selection']['getRanges']();let _0x5a0a82=0x0;for(const _0xf289f3 of _0x5ac254){const _0x4b8978=f+':'+_0x5a0a82;if(_0x413e2e['markers']['has'](_0x4b8978))_0x42cfaf['updateMarker'](_0x4b8978,{'range':_0xf289f3});else{if(_0xf289f3['start']['isAtEnd']){const _0x2fb4ec=_0xf289f3['start']['getLastMatchingPosition'](({item:_0x5426d7})=>!_0x413e2e['schema']['isContent'](_0x5426d7),{'boundaries':_0xf289f3});_0x42cfaf['addMarker'](_0x4b8978,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x42cfaf['createRange'](_0x2fb4ec,_0xf289f3['end'])});}else _0x42cfaf['addMarker'](_0x4b8978,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xf289f3});}_0x5a0a82++;}});}['hideFakeVisualSelection'](){const _0x4c5ed8=this['editor']['model'],_0x12d330=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x12d330['length']&&_0x4c5ed8['change'](_0x247260=>{_0x12d330['forEach'](_0x41cf02=>{_0x247260['removeMarker'](_0x41cf02);});});}['insertContent'](_0x418e87,_0x310f50){const _0x27c3a2=this['_getAISelection'](),_0x27bcaf=_0x310f50||_0x27c3a2['getFirstRange']();this['editor']['model']['canEditAt'](_0x27bcaf)&&this['editor']['model']['change'](_0xa499ba=>{this['hideFakeVisualSelection'](),_0x310f50||this['_resetContentOfSelectedTableCells'](_0xa499ba,_0x27c3a2),this['_pasteHTMLUsingClipboard']({'insertAt':_0x27bcaf,'writer':_0xa499ba,'html':_0x418e87});});}['insertContentBelow'](_0x2bb83c){const {model:_0x47d1ca}=this['editor'],_0x35100d=this['_getAISelection']();_0x47d1ca['change'](()=>{const _0x173440=this['_prepareTableInsertBelowPosition'](_0x2bb83c,_0x35100d)||this['_getDefaultInsertBelowPosition'](_0x35100d);this['insertContent'](_0x2bb83c,_0x173440);});}['_getAISelection'](){const _0x3f45aa=this['editor']['model'],_0x19bad8=Array['from'](_0x3f45aa['markers']['getMarkersGroup'](f))['map'](_0x3818e2=>_0x3818e2['getRange']());return _0x3f45aa['createSelection'](_0x19bad8);}['_pasteHTMLUsingClipboard']({writer:_0xa77c3e,html:_0x3ef2a3,insertAt:_0xfd6d91}){const {view:_0x12b6fa}=this['editor']['editing'],_0xeb9435=this['editor']['plugins']['get'](_0x5cad60),_0x56bb99=new gt();_0x56bb99['setData']('text/html',_0x3ef2a3);const _0x1b7391=new ClipboardEvent('paste',{'clipboardData':_0x56bb99}),_0x5ac0e1=new _0x2cb29c(_0x12b6fa,_0x1b7391,{'dataTransfer':new _0x3ed6a0(_0x56bb99)});_0xa77c3e['setSelection'](_0xfd6d91);const _0x5e1d11=(_0x280df8,_0x5dd99e)=>{_0x5dd99e['resultRange']&&_0xa77c3e['setSelection'](_0x5dd99e['resultRange']);};_0xeb9435['once']('contentInsertion',_0x5e1d11,{'priority':'lowest'}),_0x12b6fa['document']['fire']('paste',_0x5ac0e1),_0xeb9435['off']('contentInsertion',_0x5e1d11);}['_getDefaultInsertBelowPosition'](_0x417c60){const {model:_0xfaad64}=this['editor'],_0x7bc98c=Array['from'](_0x417c60['getSelectedBlocks']());return _0x7bc98c['length']?_0xfaad64['createPositionAfter'](_0x7bc98c['pop']()):_0x417c60['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x151477,_0x4bba18){const {model:_0x3a9a34,plugins:_0x435f9c}=this['editor'];if(_0x435f9c['has']('TableUtils')){const _0x35f080=_0x435f9c['get']('TableUtils')['getSelectedTableCells'](_0x4bba18);if(_0x35f080['length']){const _0x460339=this['_getTableRowCountFromContent'](_0x151477),_0x35d851=this['_createEmptyTableRows'](_0x35f080,_0x460339);return _0x3a9a34['createPositionAt'](_0x35d851,0x0);}}return null;}['_getTableRowCountFromContent'](_0x252ddc){const _0x297e8f=this['editor']['plugins']['get']('TableUtils'),_0x3229b6=this['editor']['data']['parse'](_0x252ddc),_0x40a870=Array['from'](_0x3229b6['getChildren']())['filter'](_0x29e0c3=>_0x29e0c3['is']('element','table'));let _0x3cbb63=0x0;return _0x40a870['forEach'](_0x22a958=>{_0x3cbb63+=_0x297e8f['getRows'](_0x22a958);}),_0x3cbb63;}['_createEmptyTableRows'](_0x2c1301,_0x51ea6c){const _0x58d5d1=this['editor']['plugins']['get']('TableUtils'),_0xc1efd=_0x58d5d1['getRowIndexes'](_0x2c1301),_0x38acdb=_0x58d5d1['getColumnIndexes'](_0x2c1301),_0xc70cf0=_0xc1efd['last']+0x1,_0x174da8=_0x38acdb['first'],_0x29097f=_0x2c1301[0x0]['findAncestor']('table');for(let _0x527d23=0x0;_0x527d23<_0x51ea6c;_0x527d23++)_0x58d5d1['insertRows'](_0x29097f,{'at':_0xc70cf0});return _0x29097f['getChild'](_0xc70cf0)['getChild'](_0x174da8);}['_resetContentOfSelectedTableCells'](_0x5c4bbf,_0x5f22ac){const {plugins:_0x5aeb9a}=this['editor'],{model:_0x476017}=_0x5c4bbf;if(!_0x5aeb9a['has']('TableUtils'))return;_0x5aeb9a['get']('TableUtils')['getSelectedTableCells'](_0x5f22ac)['length']&&_0x476017['deleteContent'](_0x5f22ac);}}class E extends _0x2141a7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x2c453e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x85ae9b){super(_0x85ae9b),this['name']='AIRequestError';}}function i(_0x684bb8,_0x50a5d9,_0x524a13){const t=_0x684bb8['t'];switch(_0x50a5d9){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',_0x524a13);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x524a13);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'},_0x524a13);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 _0x50a5d9;}}class j extends _0x1753db{['_commandDefinitions'];constructor(_0x44ccd2,_0x45ba93){super(_0x44ccd2),this['_commandDefinitions']=_0x45ba93,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1b4fad,_0x3f3dd3,_0x557c19)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x557c19));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2c971a,_0x3bdec4,_0x365d2c)=>{this['enabledCommandsIds']=_0x365d2c?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2047ca=this['editor']['model'];this['_hasContext']=function(_0x3baa8f){const _0x193f7e=_0x3baa8f['document']['selection'];return _0x193f7e['isCollapsed']?0x0!==[..._0x193f7e['getSelectedBlocks']()]['length']&&![..._0x193f7e['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3baa8f['hasContent'](_0x193f7e['getFirstRange']());}(_0x2047ca);const _0x49fd6e=_0x2047ca['document']['selection'],_0x40c873=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x4382ef of _0x49fd6e['getRanges']())for(const _0x32aa8f of _0x4382ef['getItems']())if(_0x32aa8f['is']('element')&&_0x40c873['includes'](_0x32aa8f['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2bc624='',_0x62cbd='',_0x34f54b='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2bc624,_0x62cbd,_0x34f54b);}}function G(_0x4732eb,_0x4ed463){const _0x2ce270=new Set();for(const _0x1442f3 of _0x4732eb['values']())(_0x4ed463||!0x1===_0x1442f3['requiresContent'])&&_0x2ce270['add'](_0x1442f3['id']);return Array['from'](_0x2ce270);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0x32a727(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x63c8be,_0x3593c0,_0x4f73c0){super(),this['editor']=_0x63c8be,this['textAdapter']=_0x3593c0,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x4f73c0,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x430e01,_0xc4ffde,_0x564e78)=>{this['view']['value']=this['_sanitizeHTML'](_0x564e78);}),this['listenTo'](this['view'],'submitPrompt',(_0x2cbf10,_0x46e17b)=>{const _0x44ec95=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x46e17b,_0x44ec95,'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:_0x1a5ba1,query:_0x5b6db8,htmlContent:_0x3dcbde,label:_0x894067,mainActionLabel:_0xb00fa8}){this['view']['prompt']=_0x894067,this['view']['mainAction']=_0xb00fa8,this['initialContext']=_0x3dcbde,_0x5b6db8&&(this['view']['isRendered']?this['_handleQuery'](_0x5b6db8,_0x3dcbde,_0x1a5ba1,_0x894067):this['view']['once']('render',()=>{this['_handleQuery'](_0x5b6db8,_0x3dcbde,_0x1a5ba1,_0x894067);}));}['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'](_0x4936aa,_0x5bb50f,_0x68a9e5,_0x323d42){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x5bb50f,this['previousQuery']=_0x4936aa,this['previousLabel']=_0x323d42||_0x4936aa,this['previousActionId']=_0x68a9e5,new Promise(_0x3317ba=>{this['textAdapter']['makeRequest']({'query':_0x4936aa,'context':_0x5bb50f,'onData':_0x56020e=>{this['currentResponse']=_0x56020e,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x68a9e5})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x497d55=>{_0x497d55 instanceof R?this['view']['handleError'](_0x497d55['message']):this['view']['handleError'](),_0x3317ba();})['finally'](()=>{this['stopProcessing'](),_0x3317ba();});});}['_parseAndNormalizeContent'](_0x3f2a69,_0x3730b0=!0x1){const _0xdd0336=Z['exec'](_0x3f2a69);_0x3f2a69=_0xdd0336?_0x3f2a69['substring'](_0xdd0336[0x1]['length']):_0x3f2a69['length']<0x64&&!_0x3730b0?'':this['_stripMarkdownSyntax'](_0x3f2a69);const _0x36057b=this['_domParser']['parseFromString'](_0x3f2a69,'text/html');if(_0xdd0336){const _0x516974=Array['from'](_0x36057b['body']['childNodes']);_0x516974['reverse']();for(const _0x5d91a8 of _0x516974){if(_0x5d91a8['nodeType']==Node['ELEMENT_NODE'])break;_0x5d91a8['remove']();}}const _0x55c52a=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x36057b['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x55c52a);const _0x92035=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x1f7430=this['editor']['data']['toModel'](_0x55c52a);return _0x92035||_0x1f7430['markers']['clear'](),this['editor']['data']['stringify'](_0x1f7430);}['_normalizeResponseHeadings'](_0x414242){const _0x25e438=new _0x143e6a(this['editor']['editing']['view']['document']),_0x1bc788=new _0x15c29a({'name':/^h[1-5]$/}),_0xad005a=[];let _0x10176d=!0x1;for(const _0x59a050 of _0x414242)_0x59a050['is']('element')&&_0x1bc788['match'](_0x59a050)&&(_0xad005a['push'](_0x59a050),'h1'==_0x59a050['name']&&(_0x10176d=!0x0));if(_0x10176d){for(const _0x351bf8 of _0xad005a)_0x25e438['rename']('h'+(parseInt(_0x351bf8['name'][0x1])+0x1),_0x351bf8);}}['_isH1TagSupportEnabled'](){const {data:_0x45b7d6,editing:_0x2c40be}=this['editor'],_0x409eff=_0x45b7d6['htmlProcessor']['toView']('<h1></h1>'),_0x305f65=_0x45b7d6['toView'](_0x45b7d6['toModel'](_0x409eff));return!!_0x2c40be['view']['domConverter']['viewToDom'](_0x305f65)['querySelector']('h1');}['_sanitizeHTML'](_0x3dbc19){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3dbc19),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x51a98a){const _0x2502ca=_0x51a98a['trim']();return _0x2502ca['startsWith']('```html')?_0x2502ca['endsWith']('```')?_0x2502ca['substring'](0x7,_0x2502ca['length']-0x3):_0x2502ca['substring'](0x7):_0x51a98a;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x28327e){super(_0x28327e),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x85584f=>i(_0x28327e,'AI_'+_0x85584f['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x28327e,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x28327e,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x28327e,'Stop'));const _0x48561b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x48561b['if']('isVisible','ck-hidden',_0xb20a8d=>!_0xb20a8d)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3d2f45,_0xc70b79){const _0x527d5a=new _0x1d57a2(this['locale']);return _0x527d5a['set']({'label':_0x3d2f45,'class':_0xc70b79||'','isVisible':!0x0,'withText':!0x0}),_0x527d5a;}}class Y extends _0xd64d08{['contentFieldView'];['copyButtonView'];constructor(_0x4665d6,_0x6c332a=''){super(_0x4665d6),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x28de4b=this['bindTemplate'];this['contentFieldView']=new At(_0x4665d6,_0x6c332a),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x28de4b['if']('isVisible','ck-hidden',_0x31203c=>!_0x31203c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x28de4b['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 _0x1bbf83=!0x1;this['on']('change:value',(_0x3874d6,_0x5a9fb0,_0x2b5673)=>{const _0x161d40=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2b5673),this['isProcessing']&&_0x161d40&&!_0x1bbf83&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x371937,_0x2c0405,_0x3485b0)=>{_0x1bbf83=!0x1,_0x3485b0?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1bbf83=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1bbf83=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x59b089=this['locale'],_0x4fbee3=new _0x1d57a2(this['locale']),_0x459c0b='ck-ai-form__copy-button';return _0x4fbee3['set']({'label':i(_0x59b089,'Copy'),'icon':_0x25d06d,'class':_0x459c0b,'tooltip':!0x0}),_0x4fbee3['bind']('isVisible')['to'](this,'value',_0x14f819=>!!_0x14f819),_0x4fbee3['bind']('isEnabled')['to'](this,'isProcessing',_0x38c7e=>!_0x38c7e),_0x4fbee3['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4fbee3['icon']=_0x3d4704,_0x4fbee3['class']=_0x459c0b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4fbee3['icon']=_0x25d06d,_0x4fbee3['class']=_0x459c0b;},0x3e8);}),_0x4fbee3;}['_copyHTMLToClipboard'](_0x2c0636){const {window:_0x498d97,document:_0x1d1b6e}=_0x280648;if(_0x498d97['ClipboardItem']){const {Blob:_0x4e876d,ClipboardItem:_0x986745}=_0x498d97,_0x537c72=[new _0x986745({'text/html':new _0x4e876d([_0x2c0636['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4e876d([_0x2c0636['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x537c72);}else{const _0x26bc83=_0x1d1b6e['createElement']('div');_0x26bc83['style']['position']='absolute',_0x26bc83['style']['left']='-9999px',_0x26bc83['innerHTML']='<span>[</span>'+_0x2c0636['innerHTML']+'<span>]</span>',_0x1d1b6e['body']['appendChild'](_0x26bc83);const _0x132606=_0x1d1b6e['createRange']();_0x132606['setStartAfter'](_0x26bc83['firstElementChild']),_0x132606['setEndBefore'](_0x26bc83['lastElementChild']);const _0x2e0bfc=_0x498d97['getSelection']();_0x2e0bfc['removeAllRanges'](),_0x2e0bfc['addRange'](_0x132606),_0x1d1b6e['execCommand']('copy'),_0x26bc83['remove']();}}}class At extends _0xd64d08{constructor(_0x3b6dfb,_0x2b5c8d=''){super(_0x3b6dfb),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2b5c8d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x31e00f){this['element']['innerHTML']=_0x31e00f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x34713e=new _0xd64d08(),_0x44953d=this['locale'],_0x1d568b=new _0x53dc20();return _0x1d568b['isVisible']=!0x0,_0x34713e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1d568b,{'text':i(_0x44953d,'AI\x20is\x20writing...')}]}),_0x34713e['render'](),_0x34713e;}}class st extends _0xd64d08{constructor(_0x4f6b91,_0x370b99=''){super(_0x4f6b91);const _0x583f69=new rt(),_0x1e76b0=this['bindTemplate'];this['set']('text',_0x370b99),_0x583f69['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x583f69,{'text':_0x1e76b0['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2499a1,_0x2c8e6e){super(_0x2499a1,_0x2c8e6e),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',(_0x156699,_0x42a7d4)=>{_0x156699['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x42a7d4());});}['_createSubmitButton'](){const _0x1f722d=new _0x1d57a2(this['locale']),_0x165b39=this['locale'];return _0x1f722d['set']({'icon':ht,'label':i(_0x165b39,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1f722d['on']('execute',()=>{this['submit']();}),_0x1f722d['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x15997b,_0x2226a0)=>!_0x15997b&&_0x2226a0),_0x1f722d;}['_createShowHistoryButton'](){const _0x383608=new _0x1d57a2(this['locale']),_0x3502e2=this['resultsView'],_0x489a72=this['locale'];_0x383608['set']({'label':i(_0x489a72,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x383608['bind']('isOn')['to'](_0x3502e2,'isVisible'),_0x383608['bind']('isEnabled')['to'](this,'isEnabled'),_0x383608['on']('execute',()=>{_0x3502e2['isVisible']=!_0x3502e2['isVisible'],_0x3502e2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x38297f=()=>{_0x280648['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x53207f=new it(this['queryView']['fieldView']['element']),_0x3d7370=_0x53207f['width'],_0x394d2e='rtl'===_0x489a72['uiLanguageDirection']?'left':'right';_0x53207f['excludeScrollbarsAndBorders'](),_0x383608['element']['style'][_0x394d2e]=_0x3d7370-_0x53207f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x38297f),this['on']('render',_0x38297f),_0x383608;}['submit'](){const _0x1c9083=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1c9083);}['focus'](_0x3e22ee){-0x1===_0x3e22ee?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x5be6be){super(_0x5be6be),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x5be6be,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5c3e87=0x0;for(const _0x154939 of this['items'])_0x5c3e87+=_0x154939['items']['length'];return{'resultsCount':_0x5c3e87,'totalItemsCount':_0x5c3e87};}['_createClearHistoryButton'](){const _0x5dfb28=this['locale'],_0x393dec=new _0x1d57a2(this['locale']);return _0x393dec['set']({'label':'('+i(_0x5dfb28,'Clear')+')','withText':!0x0}),_0x393dec['on']('execute',()=>this['fire']('clearHistory')),_0x393dec;}}class bt extends xt{constructor(_0x4ddf03){super();const _0x291327=new kt(),_0x5884f6=new _0x1d57a2(this['locale'],_0x291327);this['children']['add'](_0x5884f6),_0x5884f6['set']({'label':_0x4ddf03['prompt'],'withText':!0x0}),_0x5884f6['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x4ddf03['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x193d7b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3b45d6,_0x149bfa)=>{const _0x38f3e9=os(_0x149bfa['prompt']);for(const _0x3bcc12 of this)if(_0x3bcc12!=_0x149bfa&&os(_0x3bcc12['prompt'])===_0x38f3e9){this['remove'](_0x3bcc12);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x59e665=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x59e665));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x402570=>_0x402570)));}}function os(_0x3c056a){return _0x3c056a['toLowerCase']()['trim']();}class _ extends _0xd64d08{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xea227f,_0x4b364a,_0x5728a0=''){super(_0xea227f),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(_0xea227f),this['contentArea']=new Y(_0xea227f,_0x5728a0),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 _0x47a589=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4b364a],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x47a589['if']('isError','ck-hidden',_0x31b27e=>!_0x31b27e)]},'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'](_0x169775=0x1){-0x1===_0x169775?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 _0x53d3e4=this['locale'],_0x38c187=new ct(_0x53d3e4,{'queryView':{'label':i(_0x53d3e4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x53d3e4,'Empty\x20history'),'secondary':i(_0x53d3e4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x38c187['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x40e41c,_0x55dabc)=>_0x40e41c&&!_0x55dabc),this['listenTo'](_0x38c187,'submit',(_0x3c9ab,_0x52d129)=>{this['prompt']=_0x52d129;const _0x8b4616=yt(_0x52d129);this['fire']('submitPrompt',_0x8b4616),_0x52d129['trim']()&&this['_promptHistory']['add']({'prompt':_0x8b4616},0x0);},{'priority':'high'}),_0x38c187;}['_createHistoryView'](){const _0x52848e=new ft(this['locale']);return _0x52848e['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x52848e['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x52848e;}['_createToolbar'](){const _0x26546a=new lt(this['locale']);return _0x26546a['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xe85b3d,_0x127e8d,_0x1c11a3)=>_0xe85b3d&&!_0x127e8d&&!!_0x1c11a3),_0x26546a['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x26546a['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x666425,_0x4c90b7,_0x2a4e0b)=>_0x666425&&!_0x4c90b7&&!!_0x2a4e0b),_0x26546a['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x26546a['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x14d4a9,_0x389405)=>_0x14d4a9&&!_0x389405),_0x26546a['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x26546a['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x26546a['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x26546a;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x101283=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x101283,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x305eb0){const _0x237adf=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x305eb0||i(_0x237adf,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x2141a7{['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[_0x3650f3,a,E,_0x3e357e];}constructor(_0x3f0368){super(_0x3f0368),_0x3f0368['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3f0368['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x3f0368['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3f0368['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x106da8}=this;this['_aiAdapter']=_0x106da8['plugins']['get'](E),this['_dialog']=_0x106da8['plugins']['get'](_0x3e357e),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x14d206=new j(_0x106da8,Array['from'](this['_commandDefinitions']['values']()));_0x106da8['commands']['add']('showAIAssistant',_0x14d206),_0x106da8['ui']['componentFactory']['add']('aiCommands',_0x32d3a9=>{const _0x383930=_0x5b23cd(_0x32d3a9);return _0x383930['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x383930['buttonView']['set']({'label':i(_0x32d3a9,'AI\x20Commands'),'icon':_0xfcc0af,'tooltip':!0x0}),_0x383930['on']('execute',_0x27d389=>this['_onExecute'](_0x27d389['source']['id'])),_0x52b4e5(_0x383930,_0x106da8['ui']['view']['body'],function(_0x302c7f){const _0x2b5195=o(_0x302c7f['config']['get']('ai.aiAssistant.commands'),_0x302c7f['locale']),_0x55efb8=U(_0x302c7f,_0x2b5195)['filter'](_0x63463f=>_0x63463f['commands']['length']);if(0x1===_0x55efb8['length'])return U(_0x302c7f,_0x55efb8[0x0]['commands'])['map'](_0x3e3e82=>({'id':_0x3e3e82['id'],'label':_0x3e3e82['label']}));return _0x55efb8['map'](_0x36dfc8=>{const {groupId:_0x259cf4,groupLabel:_0x4e8fb,commands:_0xbf71b1}=_0x36dfc8,_0x1ab6e1=U(_0x302c7f,_0xbf71b1)['map'](_0x1ffdd4=>({'id':_0x1ffdd4['id'],'label':_0x1ffdd4['label']}));return{'id':_0x259cf4,'menu':_0x4e8fb||_0x259cf4,'children':_0x1ab6e1};});}(_0x106da8),{'ariaLabel':i(_0x32d3a9,'AI\x20Commands')}),_0x383930['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x14d206['on']('change:enabledCommandsIds',_0x189e25),_0x383930['menuView']['once']('render',_0x189e25),_0x383930;function _0x189e25(){_0x383930['isEnabled']=_0x14d206['enabledCommandsIds']['length']>0x0;for(const _0x106648 of _0x383930['menuView']['buttons'])_0x106648['isEnabled']=_0x14d206['enabledCommandsIds']['includes'](_0x106648['id']);}}),_0x106da8['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4bd326=>{const _0x266d9e=new _0x5e7641(_0x4bd326);_0x266d9e['buttonView']['set']({'label':i(_0x4bd326,'AI\x20Commands'),'icon':_0xfcc0af}),_0x266d9e['bind']('isEnabled')['to'](_0x14d206,'enabledCommandsIds',_0x262ad5=>_0x262ad5['length']>0x0);const _0x5d30ef=o(_0x106da8['config']['get']('ai.aiAssistant.commands'),_0x4bd326);return this['_populateMenuBarMenu'](_0x14d206,_0x266d9e,_0x5d30ef,_0x1b0a05=>this['_onExecute'](_0x1b0a05)),_0x266d9e;}),_0x106da8['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1845ae=this['_createAIAssistantUIButton'](_0x1d57a2);return _0x1845ae['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1845ae;}),_0x106da8['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x441801=this['_createAIAssistantUIButton'](_0xb1dcc0);return _0x441801['set']({'role':'menuitemcheckbox'}),_0x441801;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5b7e41=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x466064;for(const _0x3964a5 in _0x5b7e41){const _0x258ceb=_0x3964a5,_0x583d88=_0x5b7e41[_0x258ceb];if('aiLicenseKeyValid'==_0x583d88||'aiLicenseKeyInvalid'==_0x583d88||'aiLicenseKeyExpired'==_0x583d88||'aiLicenseKeyDomainLimit'==_0x583d88||'aiLicenseKeyNotAllowed'==_0x583d88||'aiLicenseKeyEvaluationLimit'==_0x583d88||'aiLicenseKeyTrialLimit'==_0x583d88||'aiLicenseKeyUsageLimit'==_0x583d88){delete _0x5b7e41[_0x258ceb],_0x466064=_0x583d88,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x466064&&_0x5b7e41['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x466064&&_0x5b7e41['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x466064&&_0x5b7e41['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x466064&&_0x5b7e41['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x218baa='',_0x2e19b2='',_0x2cc552='custom'){const _0x5bf994=this['editor'],_0x230430=_0x5bf994['editing']['view'],_0x5133a2=_0x5bf994['plugins']['get'](a),_0x327f9a=_0x5bf994['plugins']['get'](_0x3650f3);_0x5133a2['showFakeVisualSelection']();const _0x454c05=new w(),_0x36d5ad=new ClipboardEvent('copy',{'clipboardData':_0x454c05}),_0x3624d3=new _0x3ed6a0(_0x454c05),_0x76696e=new _0x2cb29c(_0x230430,_0x36d5ad,{'dataTransfer':_0x3624d3});_0x327f9a['_forceMarkersCopy']('comment',()=>{_0x230430['document']['fire']('copy',_0x76696e);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x5bf994,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x311eba=_0x3624d3['getData']('text/html');const _0x5df044=_0x5bf994['model']['document']['selection'],_0xed3ea0=Array['from'](_0x5df044['getRanges']());0x1===_0xed3ea0['length']&&_0xed3ea0[0x0]['isFlat']&&!_0x5df044['getSelectedElement']()&&''!==_0x311eba['replace'](/&nbsp;/g,'')['trim']()&&(_0x311eba='<p>'+_0x311eba+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2cc552,'query':_0x218baa,'htmlContent':_0x311eba,'label':_0x2e19b2,'mainActionLabel':M[_0x5bf994['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x4a2c5f,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3073c0['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5133a2['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2dd43e=new Map(),_0x2ababb=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3d4717 of _0x2ababb)for(const _0x33bb54 of _0x3d4717['commands'])_0x2dd43e['set'](_0x33bb54['id'],{..._0x33bb54,'groupId':_0x3d4717['groupId'],'groupLabel':_0x3d4717['groupLabel']||_0x3d4717['groupId']});return _0x2dd43e;}['_createAIAssistantUIButton'](_0x3f62dc){const _0x966a8e=this['editor'],_0x38f260=_0x966a8e['commands']['get']('showAIAssistant'),_0x4965e2=new _0x3f62dc(_0x966a8e['locale']);return _0x4965e2['set']({'label':i(_0x966a8e['locale'],'AI\x20Assistant'),'icon':_0x4a2c5f,'isToggleable':!0x0}),_0x4965e2['bind']('isEnabled')['to'](_0x38f260),_0x4965e2['bind']('isOn')['to'](this['_dialog'],'id',_0xf8175c=>'aiAssistant'===_0xf8175c),this['listenTo'](_0x4965e2,'execute',()=>{_0x4965e2['isOn']?this['hideUI']():_0x38f260['execute']();}),_0x4965e2;}['_initView'](){const _0x22e48a=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',()=>{_0x22e48a['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x22e48a['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x371d8f,ui:{ariaLiveAnnouncer:_0x168bce}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2de12d,_0xea18c1,_0x52d9de)=>{const _0x3fdc0d=this['_aiAssistantController']['currentContext'];_0x52d9de?_0x168bce['announce'](i(_0x371d8f,'AI\x20is\x20writing')):_0x3fdc0d&&_0x168bce['announce'](i(_0x371d8f,'Generated\x20content:\x20%0',_0x3fdc0d),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1a116,_0x26bbbf,_0x46a4ec)=>{if(_0x46a4ec){const _0x45c9cf=this['_formView']['errorView']['text'];_0x168bce['announce'](i(_0x371d8f,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x45c9cf));}});}['_onExecute'](_0x543fe0){const _0x5de866=this['_commandDefinitions']['get'](_0x543fe0),_0x267871=this['editor'],_0x293443=_0x267871['model']['document']['selection'],_0x1df742=_0x267871['commands']['get']('showAIAssistant'),_0x2e0b3f=_0x267871['plugins']['get'](a),_0x46cfb8=''+(_0x5de866['groupId']!==x?_0x5de866['groupLabel']+':\x20':'')+_0x5de866['label'];if(!0x1!==_0x5de866['requiresContent']&&_0x293443['isCollapsed']){const _0x3a6a93=_0x589312(_0x293443['getSelectedBlocks']())||_0x267871['model']['schema']['getLimitElement'](_0x293443);_0x267871['model']['change'](_0x18fdd3=>{_0x18fdd3['setSelection'](_0x3a6a93,'in');});}_0x2e0b3f['showFakeVisualSelection'](),_0x1df742['execute'](_0x5de866['prompt'],_0x46cfb8,'command:'+_0x543fe0);}['_populateMenuBarMenu'](_0x3f761c,_0x12a00d,_0x58017a,_0xdea8ec){const _0x4b6790=this['editor'],_0x5e6b21=_0x4b6790['locale'],_0x2a6409=new _0x4e401a(_0x5e6b21),_0x354f7c=U(_0x4b6790,_0x58017a)['filter'](_0x159022=>_0x159022['commands']['length']);0x1===_0x354f7c['length']?this['_getMenuBarGroupButtons']({'command':_0x3f761c,'commands':_0x354f7c[0x0]['commands'],'parentMenuView':_0x12a00d,'onExecute':_0xdea8ec})['forEach'](_0x503f20=>_0x2a6409['items']['add'](_0x503f20)):_0x354f7c['forEach'](({groupId:_0x6b8c2a,groupLabel:_0x5c69fa,commands:_0x508871})=>{const _0x3eaf2a=new _0x35210b(_0x5e6b21,_0x12a00d),_0x51d206=new _0x5e7641(_0x5e6b21),_0x20d0b3=new _0x4e401a(_0x5e6b21),_0x32fa74=this['_getMenuBarGroupButtons']({'command':_0x3f761c,'commands':_0x508871,'parentMenuView':_0x51d206,'onExecute':_0xdea8ec});_0x51d206['buttonView']['set']({'label':_0x5c69fa||_0x6b8c2a}),_0x51d206['delegate']('execute')['to'](_0x12a00d),_0x20d0b3['items']['addMany'](_0x32fa74),_0x51d206['panelView']['children']['add'](_0x20d0b3),_0x3eaf2a['children']['add'](_0x51d206),_0x2a6409['items']['add'](_0x3eaf2a);}),_0x12a00d['panelView']['children']['add'](_0x2a6409);}['_getMenuBarGroupButtons']({command:_0x513705,commands:_0x5512af,parentMenuView:_0x4c8a66,onExecute:_0x2e9b42}){const _0x275604=this['editor'],_0x340058=_0x275604['locale'];return U(_0x275604,_0x5512af)['map'](_0x40355e=>{const _0x23da38=new _0x35210b(_0x340058,_0x4c8a66),_0x552709=new _0xb1dcc0(_0x340058);return _0x552709['set']({'label':_0x40355e['label']}),_0x552709['delegate']('execute')['to'](_0x4c8a66),_0x552709['on']('execute',()=>_0x2e9b42(_0x40355e['id'])),_0x552709['bind']('isEnabled')['to'](_0x513705,'enabledCommandsIds',_0x1b7bb1=>_0x1b7bb1['includes'](_0x40355e['id'])),_0x23da38['children']['add'](_0x552709),_0x23da38;});}}function B(_0x212d49,_0x9a556a){return void 0x0!==_0x212d49['order']&&void 0x0===_0x9a556a['order']?0x1:void 0x0===_0x212d49['order']&&void 0x0!==_0x9a556a['order']?-0x1:void 0x0!==_0x212d49['order']&&void 0x0!==_0x9a556a['order']?_0x212d49['order']-_0x9a556a['order']:0x0;}function U(_0x474e9b,_0x43e476){_0x43e476['sort'](B);const _0x36283e={},_0x201af0=[];for(const _0x5995ca of _0x43e476)if(void 0x0!==_0x5995ca['order']){if(_0x5995ca['order']in _0x36283e)throw new _0x2c453e('ai-commands-config-order-collision',_0x474e9b,{'conflictingDefinitions':[_0x5995ca,_0x36283e[_0x5995ca['order']]]});_0x36283e[_0x5995ca['order']]=_0x5995ca,_0x201af0['splice'](_0x5995ca['order'],0x0,_0x5995ca);}else _0x201af0['push'](_0x5995ca);return _0x201af0;}class r extends _0x2141a7{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x24d8c5){super(_0x24d8c5);const _0x5c2878=_0x24d8c5['config'],_0x51beb9=_0x24d8c5['locale'];_0x5c2878['define']('ai.aiAssistant.preserveComments',!0x0),_0x5c2878['define']('ai.aiAssistant.commands',function(_0x560ffc){return[{'groupId':'editOrReview','groupLabel':i(_0x560ffc,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x560ffc,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x560ffc,'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(_0x560ffc,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x560ffc,'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(_0x560ffc,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x560ffc,'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(_0x560ffc,'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(_0x560ffc,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x560ffc,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x560ffc,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x560ffc,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x560ffc,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x560ffc,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x560ffc,'Change\x20style'),'commands':[{'id':'business','label':i(_0x560ffc,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x560ffc,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x560ffc,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x560ffc,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x560ffc,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x560ffc,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x560ffc,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x560ffc,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x560ffc,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x560ffc,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x560ffc,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x560ffc,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x560ffc,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x51beb9)),_0x5c2878['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5c2878['define']('ai.aiAssistant.removeCommands',[]);let _0x3f7f4d=o(_0x5c2878['get']('ai.aiAssistant.commands'),_0x51beb9);const _0x105727=_0x5c2878['get']('ai.aiAssistant.extraCommandGroups'),_0xf44b=_0x5c2878['get']('ai.aiAssistant.removeCommands');_0x105727['forEach'](_0xc0dbdc=>{const _0x2f47cb=_0x3f7f4d['find'](_0x25cb17=>_0x25cb17['groupId']===_0xc0dbdc['groupId']);_0x2f47cb?_0x2f47cb['commands']=_0x2f47cb['commands']['concat'](_0xc0dbdc['commands']):_0x3f7f4d['push'](_0xc0dbdc);}),_0x3f7f4d=_0x3f7f4d['filter'](_0x8b2f26=>!_0xf44b['includes'](_0x8b2f26['groupId'])),_0x3f7f4d['forEach'](_0x2635c5=>{_0x2635c5['commands']=_0x2635c5['commands']['filter'](_0x4009e6=>!_0xf44b['includes'](_0x4009e6['id']));}),_0x5c2878['set']('ai.aiAssistant.commands',_0x3f7f4d);}}class P extends _0x2141a7{['abortController'];static get['requires'](){return[E];}constructor(_0x3afea8){super(_0x3afea8),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'](_0xc940ee){return this['sendRequest'](_0xc940ee)['catch'](_0x5abc23=>{if(_0x5abc23 instanceof R)return Promise['reject'](_0x5abc23);if('AbortError'==_0x5abc23['name'])return Promise['resolve']();throw console['error'](_0x5abc23),new _0x2c453e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4c1a26,_0x4cbbe6){const _0x1e04b9=this['editor']['locale'],_0x5b3989={'Content-Type':'application/json'};if('object'==typeof _0x4c1a26)Object['assign'](_0x5b3989,_0x4c1a26);else{if(_0x4c1a26)try{const _0x15eeda=await _0x4c1a26(_0x4cbbe6);Object['assign'](_0x5b3989,_0x15eeda);}catch{return Promise['reject'](new R(i(_0x1e04b9,'AI_ERROR_GET_HEADERS')));}}return _0x5b3989;}async['_prepareRequestParameters'](_0x296273,_0x13660a){const _0x2eb936=this['editor']['locale'];if('object'==typeof _0x296273)return _0x296273;try{return await _0x296273(_0x13660a);}catch{return Promise['reject'](new R(i(_0x2eb936,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x19b392){super(_0x19b392),_0x19b392['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x19b392['config']['get']('ai.openAI.requestParameters')||_0x19b392['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x19b392['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x19b392['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x19b392['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3ff89c,context:_0x74ccee,onData:_0x132b9e,actionId:_0x4030dd}){const _0x4eb1db=this['editor']['locale'],_0x482f4c=await this['prepareMessages'](_0x3ff89c,_0x74ccee,_0x4030dd),_0x48f9e4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4030dd),_0x86bb45=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4030dd),_0x18b2ff={'messages':_0x482f4c,..._0x86bb45},_0x29e0eb={'method':'POST','headers':_0x48f9e4,'body':JSON['stringify'](_0x18b2ff),'signal':this['abortController']['signal']},_0x5763a9=await fetch(this['_apiUrl'],_0x29e0eb);if(_0x5763a9['ok'])return _0x86bb45['stream']?await this['_readStreamableResponse'](_0x5763a9,_0x132b9e):await this['_readStaticResponse'](_0x5763a9,_0x132b9e),Promise['resolve']();{const _0x2850ea=await _0x5763a9['text']();return _0x2850ea['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4eb1db,'AI_ERROR_CONTEXT_LENGTH'))):_0x2850ea['includes']('Moderation')?Promise['reject'](new R(i(_0x4eb1db,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2850ea));}}async['prepareMessages'](_0x465f9d,_0x1c49be,_0x470fc8){let _0x320c4c,_0x4feb2d;return _0x1c49be?(_0x320c4c='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.',_0x4feb2d='Instruction:\x0a'+_0x465f9d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1c49be):(_0x320c4c='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.',_0x4feb2d=_0x465f9d),[{'role':'system','content':_0x320c4c},{'role':'user','content':_0x4feb2d}];}async['_readStreamableResponse'](_0x573466,_0x58902c){const _0x43ec53=_0x573466['body']['getReader'](),_0x561dfa=new TextDecoder();let _0x85fdaa='',_0x4339f0='',_0x3593ea='',_0x3093fe=!0x1;for(;!_0x3093fe;){const {done:_0x4487cc,value:_0x33de97}=await _0x43ec53['read'](),_0x12678a=_0x85fdaa+_0x561dfa['decode'](_0x33de97);let _0x26f3e0='';_0x3093fe=_0x4487cc;try{_0x26f3e0=this['_cleanUpData'](_0x12678a),_0x85fdaa='';}catch{_0x85fdaa=_0x12678a;continue;}_0x4339f0+=_0x26f3e0,!_0x3093fe&&this['_isBufferIncomplete'](_0x4339f0)||_0x4339f0&&(_0x3593ea+=_0x4339f0,_0x4339f0='',_0x58902c(_0x3593ea));}return Promise['resolve']();}async['_readStaticResponse'](_0x58019a,_0x1232a){return _0x1232a((await _0x58019a['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4c1291){const _0x2c2b88=_0x4c1291['split']('<')['length']!==_0x4c1291['split']('>')['length'],_0x3f54bf=_0x4c1291['length']<0x1e;return _0x2c2b88&&_0x3f54bf;}['_cleanUpData'](_0x21c496){return _0x21c496['split'](/\n(?![^{]*\})/g)['map'](_0x4fd080=>_0x4fd080['replace']('data:\x20',''))['filter'](_0x209282=>_0x209282&&_0x209282['length']>0x0&&'[DONE]'!==_0x209282)['map'](_0x597411=>{const {choices:_0x5155f8}=JSON['parse'](_0x597411);if(_0x5155f8[0x0]?.['delta']?.['content'])return _0x5155f8[0x0]['delta']['content'];})['filter'](_0x54ab30=>_0x54ab30)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x286058){super(_0x286058),_0x286058['config']['get']('ai.aws.requestParameters')||_0x286058['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']=_0x286058['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x286058['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x286058['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x286058['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4177d5,context:_0x48381d,onData:_0x1434f8,actionId:_0x12d999}){const {model:_0x2249ad,stream:_0x510fd8,..._0x14c972}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x12d999),_0x2ec281={'prompt':await this['preparePrompt'](_0x4177d5,_0x48381d,_0x2249ad,_0x12d999),..._0x14c972};this['_apiUrl']?await this['_processProxyRequest'](_0x2ec281,_0x2249ad,_0x510fd8,_0x1434f8,_0x12d999):await this['_processAWSRequest'](_0x2ec281,_0x2249ad,_0x510fd8,_0x1434f8);}async['preparePrompt'](_0x2636d5,_0x2d8842,_0x9a406c,_0x163ef0){let _0x389446,_0x20a126;return _0x2d8842?(_0x389446='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.',_0x20a126='Instruction:\x0a'+_0x2636d5+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2d8842):(_0x389446='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.',_0x20a126=_0x2636d5),'meta.llama'==this['getModelFamily'](_0x9a406c)?'<<SYS>>\x0a'+_0x389446+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x20a126+'\x0a[/INST]':'Human:\x0a'+_0x389446+'\x0a'+_0x20a126+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2b0835){if(/^anthropic\.claude/['test'](_0x2b0835))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2b0835))return'ai21.j2';if(/^cohere\.command/['test'](_0x2b0835))return'cohere.command';if(/^meta\.llama/['test'](_0x2b0835))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2b0835));}async['_processProxyRequest'](_0x46c9f5,_0x2b140e,_0x173339,_0x5a65d4,_0x40696b){const _0x43b702={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x40696b),'body':JSON['stringify']({..._0x46c9f5,'model':_0x2b140e,'stream':_0x173339}),'signal':this['abortController']['signal']},_0x2a054d=await fetch(this['_apiUrl'],_0x43b702);_0x173339?await this['_readStreamableResponse'](_0x2a054d,_0x2b140e,_0x5a65d4):await this['_readStaticResponse'](_0x2a054d,_0x2b140e,_0x5a65d4);}async['_processAWSRequest'](_0x38e892,_0x3d6644,_0x3f2d73,_0x2020ed){const _0x450dd5=new _0x55fd7a(this['_bedrockClientConfig']),_0x24fa36={'body':JSON['stringify'](_0x38e892),'contentType':'application/json','accept':'application/json','modelId':_0x3d6644};let _0x3db39c;if(_0x3f2d73){const _0x2a360b=new _0x5d8c68(_0x24fa36);_0x3db39c=await _0x450dd5['send'](_0x2a360b,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3db39c,_0x3d6644,_0x2020ed);}else{const _0x5f4633=new _0x32bf9(_0x24fa36);_0x3db39c=await _0x450dd5['send'](_0x5f4633,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3db39c,_0x3d6644,_0x2020ed);}}async['_readAsyncIterableResponse'](_0x38ceec,_0x197f0e,_0x5c01be){const _0x136067=_0x38ceec['body'],_0x3fa7d5=new TextDecoder('utf-8');let _0x12b94b='';for await(const _0x539f35 of _0x136067)if(_0x539f35['chunk']){const _0x1ffc7f=_0x3fa7d5['decode'](_0x539f35['chunk']['bytes']),_0x53d1b6=JSON['parse'](_0x1ffc7f);_0x12b94b+=this['_getGeneratedText'](_0x53d1b6,_0x197f0e),_0x5c01be(_0x12b94b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x142ae1,_0xc98dc0,_0x435b77){const _0x263ccd=_0x142ae1['body'],_0x15ae10=new TextDecoder('utf-8'),_0x393711=_0x263ccd['getReader']();let _0x2bf84b='',_0x2ff795='',_0x4f69db=!0x1;for(;!_0x4f69db;){const {done:_0x5bb781,value:_0x7695aa}=await _0x393711['read']();if(_0x4f69db=_0x5bb781,_0x4f69db)break;const _0x5e8386=(_0x2bf84b+_0x15ae10['decode'](_0x7695aa))['split']('\x0a')['map'](_0x4d6b2d=>{try{return _0x2bf84b='',JSON['parse'](_0x4d6b2d);}catch{return _0x2bf84b=_0x4d6b2d,null;}})['filter'](_0x26e8e8=>null!==_0x26e8e8);_0x5e8386['length']&&(_0x2ff795+=_0x5e8386['map'](_0x3545c9=>this['_getGeneratedText'](_0x3545c9,_0xc98dc0))['join'](''),_0x435b77(_0x2ff795));}return Promise['resolve']();}async['_readStaticResponse'](_0x2510d2,_0x1b48e4,_0x52539b){let _0xf5edc2;return _0xf5edc2=_0x2510d2 instanceof Response?await _0x2510d2['json']():JSON['parse'](Buffer['from'](_0x2510d2['body'])['toString']('utf8')),(_0x52539b(this['_getGeneratedText'](_0xf5edc2,_0x1b48e4)),Promise['resolve']());}['_getGeneratedText'](_0x5c88fa,_0x376bbf){switch(this['getModelFamily'](_0x376bbf)){case'anthropic.claude':return _0x5c88fa['completion'];case'ai21.j2':return _0x5c88fa['completions'][0x0]['data']['text'];case'cohere.command':return _0x5c88fa['generations'][0x0]['text'];case'meta.llama':return _0x5c88fa['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.6",
3
+ "version": "45.2.0-alpha.7",
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.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",
27
+ "@ckeditor/ckeditor5-clipboard": "45.2.0-alpha.7",
28
+ "@ckeditor/ckeditor5-core": "45.2.0-alpha.7",
29
+ "@ckeditor/ckeditor5-engine": "45.2.0-alpha.7",
30
+ "@ckeditor/ckeditor5-icons": "45.2.0-alpha.7",
31
+ "@ckeditor/ckeditor5-table": "45.2.0-alpha.7",
32
+ "@ckeditor/ckeditor5-ui": "45.2.0-alpha.7",
33
+ "@ckeditor/ckeditor5-utils": "45.2.0-alpha.7",
34
+ "ckeditor5": "45.2.0-alpha.7",
35
35
  "es-toolkit": "1.32.0"
36
36
  },
37
37
  "type": "module",