@ckeditor/ckeditor5-ai 45.1.0-alpha.2 → 45.1.0-alpha.4

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 _0x33ae66,Command as _0x13b69c}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xbadf8b,IconCheck as _0x2fccd4,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x20e77e,IconRobotPencil as _0x36e8d9}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4e3286,CKEditorError as _0x278b6c,ObservableMixin as _0x422f80,global as _0xcdee6,isVisible as ot,Rect as it,Collection as _0x83cd52,FocusTracker as mt,KeystrokeHandler as ut,first as _0x4ccd99}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x3f2621,View as _0x23b47f,SpinnerView as _0x30cdc3,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 _0x2f88f3,createDropdown as _0x149b36,addMenuToDropdown as _0x5c2f3c,MenuBarMenuView as _0xaca37f,MenuBarMenuListItemButtonView as _0x3510dc,DialogViewPosition as _0x1fea3f,MenuBarMenuListView as _0xea96c3,MenuBarMenuListItemView as _0x1d54fe}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1a391e,ClipboardMarkersUtils as _0xd3129d}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x4724aa,DataTransfer as _0x199775,UpcastWriter as _0x2c0ef3,Matcher as _0x35cc3d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x135afc,InvokeModelWithResponseStreamCommand as _0x7ec8a2,InvokeModelCommand as _0x1fc2a1}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2c5da6,_0x20cfb1){const _0x4895c=(0x0,_0x20cfb1['t'])('Other');return _0x2c5da6['length']?'groupId'in _0x2c5da6[0x0]?_0x2c5da6:[{'groupId':x,'groupLabel':_0x4895c,'order':0x1/0x0,'commands':_0x2c5da6}]:[{'groupId':x,'groupLabel':_0x4895c,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x33ae66{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x8d9fdc}=this,_0x1e20c7=['ck-fake-ai-selection'];_0x8d9fdc['config']['get']('ai.useTheme')&&_0x1e20c7['push']('ck-ai-assistant-ui_theme'),_0x8d9fdc['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x1e20c7,'priority':0xc}}),_0x8d9fdc['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x3194f9,{writer:_0x275755})=>{if(!_0x3194f9['markerRange']['isCollapsed'])return null;const _0x2c3d01=_0x275755['createUIElement']('span');return _0x275755['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2c3d01),_0x2c3d01;}});}['afterInit'](){!async function(_0x14cb56){const _0xef4d28=_0x4c6a49([0x50,0x6f,0x46,0x77,0x6c,0x41,0x7a,0x69,0x59,0x51,0x65,0x44,0x55,0x79,0x4b,0x64,0x54,0x68,0x61,0x63,0x75,0x66,0x57,0x35,0x78,0x39,0x31,0x4c,0x6b,0x4e,0x4d,0x43,0x62,0x45,0x48,0x30,0x58,0x76,0x37,0x36,0x56,0x33,0x34,0x6a,0x49,0x6d,0x53,0x5a,0x32,0x71,0x38,0x52,0x73,0x6e,0x72,0x42,0x4a,0x47,0x74,0x4f,0x67,0x70]),_0x17b76c=0x70508ff8,_0x43a6bb=0x7057e8a0^_0x17b76c,_0x5b77db=window[_0x4c6a49([0x44,0x61,0x74,0x65])][_0x4c6a49([0x6e,0x6f,0x77])](),_0x59672c=_0x14cb56[_0x4c6a49([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x538b27=new window[(_0x4c6a49([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x10004d=>{_0x59672c[_0x4c6a49([0x6f,0x6e,0x63,0x65])](_0x4c6a49([0x72,0x65,0x61,0x64,0x79]),_0x10004d);}),_0x406220={[_0x4c6a49([0x6b,0x74,0x79])]:_0x4c6a49([0x45,0x43]),[_0x4c6a49([0x75,0x73,0x65])]:_0x4c6a49([0x73,0x69,0x67]),[_0x4c6a49([0x63,0x72,0x76])]:_0x4c6a49([0x50,0x2d,0x32,0x35,0x36]),[_0x4c6a49([0x78])]:_0x4c6a49([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]),[_0x4c6a49([0x79])]:_0x4c6a49([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]),[_0x4c6a49([0x61,0x6c,0x67])]:_0x4c6a49([0x45,0x53,0x32,0x35,0x36])},_0x261c79=_0x59672c[_0x4c6a49([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4c6a49([0x67,0x65,0x74])](_0x4c6a49([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2f6f5c(){let _0x20b63d,_0x1f4742=null,_0x32c2e0=null;try{if(_0x261c79==_0x4c6a49([0x47,0x50,0x4c]))return _0x4c6a49([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x20b63d=_0x2aaa7f(),!_0x20b63d)return _0x4c6a49([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x20b63d[_0x4c6a49([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x32c2e0=_0x474c81(_0x20b63d[_0x4c6a49([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x20b63d[_0x4c6a49([0x6a,0x74,0x69])])),await _0x38330e()?_0x299c74()?_0x4a3768()?_0x4c6a49([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x56790c()?(_0x20b63d[_0x4c6a49([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4c6a49([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1f4742=_0x3807f9(_0x4c6a49([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x20b63d[_0x4c6a49([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4c6a49([0x74,0x72,0x69,0x61,0x6c])&&(_0x1f4742=_0x3807f9(_0x4c6a49([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4440dd()):_0x4c6a49([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4c6a49([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4c6a49([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xdf33d0){return _0x4c6a49([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4a3768(){const _0x324b5c=[_0x4c6a49([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4c6a49([0x74,0x72,0x69,0x61,0x6c])][_0x4c6a49([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x20b63d[_0x4c6a49([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x5b77db/0x3e8:0xe10*_0x43a6bb;return _0x20b63d[_0x4c6a49([0x65,0x78,0x70])]<_0x324b5c;}function _0x299c74(){const _0x4587c8=_0x20b63d[_0x4c6a49([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4587c8&&(!!_0x4587c8[_0x4c6a49([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c6a49([0x2a]))||!!_0x4587c8[_0x4c6a49([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c6a49([0x41,0x49])));}function _0x56790c(){const _0x3998f8=_0x20b63d[_0x4c6a49([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3998f8||0x0==_0x3998f8[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x110a4d}=new URL(window[_0x4c6a49([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3998f8[_0x4c6a49([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x110a4d))return!0x0;const _0x2371b0=_0x110a4d[_0x4c6a49([0x73,0x70,0x6c,0x69,0x74])](_0x4c6a49([0x2e]));return _0x3998f8[_0x4c6a49([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2a937c=>_0x2a937c[_0x4c6a49([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c6a49([0x2a])))[_0x4c6a49([0x6d,0x61,0x70])](_0x4ddfbd=>_0x4ddfbd[_0x4c6a49([0x73,0x70,0x6c,0x69,0x74])](_0x4c6a49([0x2e])))[_0x4c6a49([0x73,0x6f,0x6d,0x65])](_0x2d16fa=>_0x2371b0[_0x4c6a49([0x65,0x76,0x65,0x72,0x79])]((_0x46711b,_0x1b67b9)=>_0x2d16fa[_0x1b67b9]===_0x46711b||_0x2d16fa[_0x1b67b9]===_0x4c6a49([0x2a])));}function _0x4440dd(){return _0x1f4742&&_0x32c2e0?new window[(_0x4c6a49([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2b36cc,_0x82705e)=>{_0x1f4742[_0x4c6a49([0x74,0x68,0x65,0x6e])](_0x2b36cc,_0x82705e),_0x32c2e0[_0x4c6a49([0x74,0x68,0x65,0x6e])](_0xfc075d=>{_0xfc075d!=_0x4c6a49([0x56,0x61,0x6c,0x69,0x64])&&_0x2b36cc(_0xfc075d);},_0x82705e);}):_0x1f4742||_0x32c2e0||_0x4c6a49([0x56,0x61,0x6c,0x69,0x64]);}}function _0x474c81(_0x19428b,_0x1d7fa8){return new window[(_0x4c6a49([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5596ef=>{if(_0x3b67e3())return _0x5596ef(_0x4c6a49([0x56,0x61,0x6c,0x69,0x64]));_0x4a5370(),_0x59672c[_0x4c6a49([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4c6a49([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x697636=!0x1;const _0x11e984=_0x4e3286();function _0x182aa7(_0x1f5f6a){return!!_0x1f5f6a&&(typeof _0x1f5f6a===_0x4c6a49([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1f5f6a===_0x4c6a49([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1f5f6a[_0x4c6a49([0x74,0x68,0x65,0x6e])]===_0x4c6a49([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1f5f6a[_0x4c6a49([0x63,0x61,0x74,0x63,0x68])]===_0x4c6a49([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4391f2(_0x2417c4){_0x4dadcb(_0x2417c4)[_0x4c6a49([0x74,0x68,0x65,0x6e])](_0x2dba0b=>{if(!_0x2dba0b||_0x2dba0b[_0x4c6a49([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4c6a49([0x6f,0x6b]))return _0x4c6a49([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x475e2f(_0x8bc307(_0x11e984+_0x1d7fa8))!=_0x2dba0b[_0x4c6a49([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4c6a49([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4c6a49([0x56,0x61,0x6c,0x69,0x64]);})[_0x4c6a49([0x74,0x68,0x65,0x6e])](_0x12a2c1=>(_0x3f1bae(),_0x12a2c1),()=>{const _0x196279=_0x473a0f();return null==_0x196279?(_0x3f1bae(),_0x4c6a49([0x56,0x61,0x6c,0x69,0x64])):_0x4c6a49(_0x5b77db-_0x196279>(0x545c0bf8^_0x17b76c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4c6a49([0x74,0x68,0x65,0x6e])](_0x5596ef)[_0x4c6a49([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5596ef(_0x4c6a49([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x500e4e=0x70666178^_0x17b76c;function _0x3f1bae(){const _0x8926ab=_0x4c6a49([0x6c,0x6c,0x63,0x74,0x2d])+_0x475e2f(_0x8bc307(_0x19428b)),_0x1dc580=_0x25d58c(_0x475e2f(window[_0x4c6a49([0x4d,0x61,0x74,0x68])][_0x4c6a49([0x63,0x65,0x69,0x6c])](_0x5b77db/_0x500e4e)));window[_0x4c6a49([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4c6a49([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x8926ab,_0x1dc580);}function _0x473a0f(){const _0x1e4e45=_0x4c6a49([0x6c,0x6c,0x63,0x74,0x2d])+_0x475e2f(_0x8bc307(_0x19428b)),_0x3a3629=window[_0x4c6a49([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4c6a49([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1e4e45);return _0x3a3629?window[_0x4c6a49([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x25d58c(_0x3a3629),0x10)*_0x500e4e:null;}function _0x4dadcb(_0x1ca6c7){return new window[(_0x4c6a49([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x25e110,_0xb03481)=>{_0x1ca6c7[_0x4c6a49([0x74,0x68,0x65,0x6e])](_0x25e110,_0xb03481),window[_0x4c6a49([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xb03481,0x70515b38^_0x17b76c);});}}_0x59672c[_0x4c6a49([0x6f,0x6e])](_0x4c6a49([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2b3d11,_0x4c78a6)=>{if(_0x4c78a6[0x0]!=_0x19428b)return _0x5596ef(_0x4c6a49([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4c78a6[0x1]={..._0x4c78a6[0x1],[_0x4c6a49([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x11e984};},{[_0x4c6a49([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4c6a49([0x68,0x69,0x67,0x68])}),_0x59672c[_0x4c6a49([0x6f,0x6e])](_0x4c6a49([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5621b0=>{_0x182aa7(_0x5621b0[_0x4c6a49([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x697636=!0x0,_0x4391f2(_0x5621b0[_0x4c6a49([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4c6a49([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4c6a49([0x6c,0x6f,0x77])}),_0x538b27[_0x4c6a49([0x74,0x68,0x65,0x6e])](()=>{_0x697636||_0x5596ef(_0x4c6a49([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3b67e3(){return _0x59672c[_0x4c6a49([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4c6a49([0x76,0x69,0x65,0x77])][_0x4c6a49([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4c6a49([0x61,0x75,0x74,0x6f]);}function _0x4a5370(){_0x59672c[_0x4c6a49([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4c6a49([0x76,0x69,0x65,0x77])][_0x4c6a49([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4c6a49([0x61,0x75,0x74,0x6f]);}}function _0x3807f9(_0x202e93){const _0x3127ea=[new window[(_0x4c6a49([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x72007b=>setTimeout(_0x72007b,0x7059b134^_0x17b76c)),_0x538b27[_0x4c6a49([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4c6a49([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x119780=>{let _0x729795=0x0;_0x59672c[_0x4c6a49([0x6d,0x6f,0x64,0x65,0x6c])][_0x4c6a49([0x6f,0x6e])](_0x4c6a49([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x149993,_0x4a884f)=>{_0x4a884f[0x0][_0x4c6a49([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x729795++,_0x729795==(0x70508e00^_0x17b76c)&&(_0x119780(),_0x149993[_0x4c6a49([0x6f,0x66,0x66])]());});}))];return window[_0x4c6a49([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4c6a49([0x72,0x61,0x63,0x65])](_0x3127ea)[_0x4c6a49([0x74,0x68,0x65,0x6e])](()=>_0x202e93);}async function _0x45cce8(){await _0x538b27,_0x59672c[_0x4c6a49([0x6d,0x6f,0x64,0x65,0x6c])][_0x4c6a49([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3a58fd,_0x59672c[_0x4c6a49([0x6d,0x6f,0x64,0x65,0x6c])][_0x4c6a49([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3a58fd,_0x59672c[_0x4c6a49([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4c6a49([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xa38d98(_0x593f56){const _0xfadde6=_0x47620e();_0x59672c[_0xfadde6]=_0x4c6a49([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x593f56,_0x593f56!=_0x4c6a49([0x56,0x61,0x6c,0x69,0x64])&&_0x45cce8();}function _0x47620e(){const _0x2ad00a=window[_0x4c6a49([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4c6a49([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4c6a49([0x6e,0x6f,0x77])]())[_0x4c6a49([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4c6a49([0x2e]),'');let _0x3c8dc0=_0x4c6a49([0x50]);for(let _0x67a5dd=0x0;_0x67a5dd<_0x2ad00a[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x67a5dd+=0x2){let _0x2e5772=window[_0x4c6a49([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ad00a[_0x4c6a49([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x67a5dd,_0x67a5dd+0x2));_0x2e5772>=_0xef4d28[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2e5772-=_0xef4d28[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3c8dc0+=_0xef4d28[_0x2e5772];}return _0x3c8dc0;}function _0x2aaa7f(){const _0xe7b1a4=_0x261c79[_0x4c6a49([0x73,0x70,0x6c,0x69,0x74])](_0x4c6a49([0x2e]));if(0x3!=_0xe7b1a4[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x116236(_0xe7b1a4[0x1]);function _0x116236(_0x24f6b9){const _0xaf4895=_0x27d3b0(_0x24f6b9);return _0xaf4895&&_0xb0a3ac()?_0xaf4895:null;function _0xb0a3ac(){const _0x59ab0d=_0xaf4895[_0x4c6a49([0x6a,0x74,0x69])],_0x4d09d5=window[_0x4c6a49([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x59ab0d[_0x4c6a49([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x59ab0d[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x10cf9e={..._0xaf4895,[_0x4c6a49([0x6a,0x74,0x69])]:_0x59ab0d[_0x4c6a49([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x59ab0d[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x10cf9e[_0x4c6a49([0x76,0x63])],_0x8bc307(_0x10cf9e)==_0x4d09d5;}}}async function _0x38330e(){let _0x584c74=!0x0;try{const _0x50f257=_0x261c79[_0x4c6a49([0x73,0x70,0x6c,0x69,0x74])](_0x4c6a49([0x2e])),[_0x11e9b9,_0xf4fd6f,_0x2def83]=_0x50f257;return _0x821ac4(_0x11e9b9),await _0xa07b52(_0x11e9b9,_0xf4fd6f,_0x2def83),_0x584c74;}catch(_0xb57b5c){return!0x1;}function _0x821ac4(_0x5f4692){const _0x476c2a=_0x27d3b0(_0x5f4692);_0x476c2a&&_0x476c2a[_0x4c6a49([0x61,0x6c,0x67])]==_0x4c6a49([0x45,0x53,0x32,0x35,0x36])||(_0x584c74=!0x1);}async function _0xa07b52(_0x2e820b,_0x266b32,_0x266ec3){const _0x2823e3=window[_0x4c6a49([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4c6a49([0x66,0x72,0x6f,0x6d])](_0x4201df(_0x266ec3),_0x236bc5=>_0x236bc5[_0x4c6a49([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x660a55=new window[(_0x4c6a49([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4c6a49([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x2e820b+_0x4c6a49([0x2e])+_0x266b32),_0x30322e=window[_0x4c6a49([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4c6a49([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x30322e)return;const _0x281e32=await _0x30322e[_0x4c6a49([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4c6a49([0x6a,0x77,0x6b]),_0x406220,{[_0x4c6a49([0x6e,0x61,0x6d,0x65])]:_0x4c6a49([0x45,0x43,0x44,0x53,0x41]),[_0x4c6a49([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4c6a49([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4c6a49([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x30322e[_0x4c6a49([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4c6a49([0x6e,0x61,0x6d,0x65])]:_0x4c6a49([0x45,0x43,0x44,0x53,0x41]),[_0x4c6a49([0x68,0x61,0x73,0x68])]:{[_0x4c6a49([0x6e,0x61,0x6d,0x65])]:_0x4c6a49([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x281e32,_0x2823e3,_0x660a55)||(_0x584c74=!0x1);}}function _0x27d3b0(_0x63bc22){return _0x63bc22[_0x4c6a49([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4c6a49([0x65,0x79]))?JSON[_0x4c6a49([0x70,0x61,0x72,0x73,0x65])](_0x4201df(_0x63bc22)):null;}function _0x4201df(_0x3788d3){return window[_0x4c6a49([0x61,0x74,0x6f,0x62])](_0x3788d3[_0x4c6a49([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4c6a49([0x2b]))[_0x4c6a49([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4c6a49([0x2f])));}function _0x8bc307(_0x12c058){let _0x4fd485=0x1505;function _0x257b23(_0x2cde35){for(let _0x2cb2c8=0x0;_0x2cb2c8<_0x2cde35[_0x4c6a49([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2cb2c8++){const _0x176d67=_0x2cde35[_0x4c6a49([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2cb2c8);_0x4fd485=(_0x4fd485<<0x5)+_0x4fd485+_0x176d67,_0x4fd485&=_0x4fd485;}}function _0x22e0f7(_0x12b223){Array[_0x4c6a49([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x12b223)?_0x12b223[_0x4c6a49([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x22e0f7):_0x12b223&&typeof _0x12b223==_0x4c6a49([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4c6a49([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x12b223)[_0x4c6a49([0x73,0x6f,0x72,0x74])]()[_0x4c6a49([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x63e8c2,_0x17b32b])=>{_0x257b23(_0x63e8c2),_0x22e0f7(_0x17b32b);}):_0x257b23(window[_0x4c6a49([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x12b223));}return _0x22e0f7(_0x12c058),_0x4fd485>>>0x0;}function _0x475e2f(_0x371b9f){return _0x371b9f[_0x4c6a49([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4c6a49([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4c6a49([0x30]));}function _0x25d58c(_0x516eeb){return _0x516eeb[_0x4c6a49([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4c6a49([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4c6a49([0x6a,0x6f,0x69,0x6e])]('');}function _0x3a58fd(){}function _0x4c6a49(_0x1cfcf6){return _0x1cfcf6['map'](_0x53b726=>String['fromCharCode'](_0x53b726))['join']('');}_0xa38d98(await _0x2f6f5c());}(this);}['showFakeVisualSelection'](){const _0x31d481=this['editor']['model'];_0x31d481['change'](_0x2bab42=>{const _0x59f296=_0x31d481['document']['selection']['getRanges']();let _0x4b11e7=0x0;for(const _0x31fb23 of _0x59f296){const _0x527b2f=f+':'+_0x4b11e7;if(_0x31d481['markers']['has'](_0x527b2f))_0x2bab42['updateMarker'](_0x527b2f,{'range':_0x31fb23});else{if(_0x31fb23['start']['isAtEnd']){const _0x22af12=_0x31fb23['start']['getLastMatchingPosition'](({item:_0xb38042})=>!_0x31d481['schema']['isContent'](_0xb38042),{'boundaries':_0x31fb23});_0x2bab42['addMarker'](_0x527b2f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2bab42['createRange'](_0x22af12,_0x31fb23['end'])});}else _0x2bab42['addMarker'](_0x527b2f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x31fb23});}_0x4b11e7++;}});}['hideFakeVisualSelection'](){const _0x434e3f=this['editor']['model'],_0x54d4a6=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x54d4a6['length']&&_0x434e3f['change'](_0x29d659=>{_0x54d4a6['forEach'](_0x4b8aef=>{_0x29d659['removeMarker'](_0x4b8aef);});});}['insertContent'](_0x21fed4,_0x56eb56){const _0x55e45a=this['_getAISelection'](),_0xeaee94=_0x56eb56||_0x55e45a['getFirstRange']();this['editor']['model']['canEditAt'](_0xeaee94)&&this['editor']['model']['change'](_0x504048=>{this['hideFakeVisualSelection'](),_0x56eb56||this['_resetContentOfSelectedTableCells'](_0x504048,_0x55e45a),this['_pasteHTMLUsingClipboard']({'insertAt':_0xeaee94,'writer':_0x504048,'html':_0x21fed4});});}['insertContentBelow'](_0x5c6381){const {model:_0xac5ae3}=this['editor'],_0x537b67=this['_getAISelection']();_0xac5ae3['change'](()=>{const _0x290112=this['_prepareTableInsertBelowPosition'](_0x5c6381,_0x537b67)||this['_getDefaultInsertBelowPosition'](_0x537b67);this['insertContent'](_0x5c6381,_0x290112);});}['_getAISelection'](){const _0x3e3cef=this['editor']['model'],_0x419623=Array['from'](_0x3e3cef['markers']['getMarkersGroup'](f))['map'](_0x587b78=>_0x587b78['getRange']());return _0x3e3cef['createSelection'](_0x419623);}['_pasteHTMLUsingClipboard']({writer:_0x241938,html:_0x3ffd45,insertAt:_0x3402bd}){const {view:_0x4c6934}=this['editor']['editing'],_0x3bcda=this['editor']['plugins']['get'](_0x1a391e),_0x4f4292=new gt();_0x4f4292['setData']('text/html',_0x3ffd45);const _0x5170b6=new ClipboardEvent('paste',{'clipboardData':_0x4f4292}),_0x254627=new _0x4724aa(_0x4c6934,_0x5170b6,{'dataTransfer':new _0x199775(_0x4f4292)});_0x241938['setSelection'](_0x3402bd);const _0x449086=(_0x1513bb,_0x444331)=>{_0x444331['resultRange']&&_0x241938['setSelection'](_0x444331['resultRange']);};_0x3bcda['once']('contentInsertion',_0x449086,{'priority':'lowest'}),_0x4c6934['document']['fire']('paste',_0x254627),_0x3bcda['off']('contentInsertion',_0x449086);}['_getDefaultInsertBelowPosition'](_0x2e2f0b){const {model:_0x403ea5}=this['editor'],_0x3cf043=Array['from'](_0x2e2f0b['getSelectedBlocks']());return _0x3cf043['length']?_0x403ea5['createPositionAfter'](_0x3cf043['pop']()):_0x2e2f0b['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1c53c2,_0x445035){const {model:_0x10d497,plugins:_0x450a33}=this['editor'];if(_0x450a33['has']('TableUtils')){const _0x26ed05=_0x450a33['get']('TableUtils')['getSelectedTableCells'](_0x445035);if(_0x26ed05['length']){const _0x47829c=this['_getTableRowCountFromContent'](_0x1c53c2),_0x4a8a5b=this['_createEmptyTableRows'](_0x26ed05,_0x47829c);return _0x10d497['createPositionAt'](_0x4a8a5b,0x0);}}return null;}['_getTableRowCountFromContent'](_0x39b65a){const _0x52e1f6=this['editor']['plugins']['get']('TableUtils'),_0x3c198c=this['editor']['data']['parse'](_0x39b65a),_0xfda4dc=Array['from'](_0x3c198c['getChildren']())['filter'](_0x3d72b1=>_0x3d72b1['is']('element','table'));let _0x34fe3b=0x0;return _0xfda4dc['forEach'](_0x38edf3=>{_0x34fe3b+=_0x52e1f6['getRows'](_0x38edf3);}),_0x34fe3b;}['_createEmptyTableRows'](_0x4acbcd,_0x32949a){const _0x273cd5=this['editor']['plugins']['get']('TableUtils'),_0x587898=_0x273cd5['getRowIndexes'](_0x4acbcd),_0x1ed49a=_0x273cd5['getColumnIndexes'](_0x4acbcd),_0x469e82=_0x587898['last']+0x1,_0x4006a1=_0x1ed49a['first'],_0x35e35f=_0x4acbcd[0x0]['findAncestor']('table');for(let _0x308aab=0x0;_0x308aab<_0x32949a;_0x308aab++)_0x273cd5['insertRows'](_0x35e35f,{'at':_0x469e82});return _0x35e35f['getChild'](_0x469e82)['getChild'](_0x4006a1);}['_resetContentOfSelectedTableCells'](_0x4e6b5d,_0x2c0910){const {plugins:_0x22705a}=this['editor'],{model:_0x213db3}=_0x4e6b5d;if(!_0x22705a['has']('TableUtils'))return;_0x22705a['get']('TableUtils')['getSelectedTableCells'](_0x2c0910)['length']&&_0x213db3['deleteContent'](_0x2c0910);}}class E extends _0x33ae66{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x278b6c('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x148a86){super(_0x148a86),this['name']='AIRequestError';}}function i(_0x2e9c93,_0xb6742f,_0x5637f8){const t=_0x2e9c93['t'];switch(_0xb6742f){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',_0x5637f8);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5637f8);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'},_0x5637f8);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 _0xb6742f;}}class j extends _0x13b69c{['_commandDefinitions'];constructor(_0x14c222,_0x3b008c){super(_0x14c222),this['_commandDefinitions']=_0x3b008c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5187a6,_0x2b0381,_0x491601)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x491601));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xa6e635,_0x5625de,_0x5db56e)=>{this['enabledCommandsIds']=_0x5db56e?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x17c6eb=this['editor']['model'];this['_hasContext']=function(_0x42f8b4){const _0x312881=_0x42f8b4['document']['selection'];return _0x312881['isCollapsed']?0x0!==[..._0x312881['getSelectedBlocks']()]['length']&&![..._0x312881['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x42f8b4['hasContent'](_0x312881['getFirstRange']());}(_0x17c6eb);const _0x385830=_0x17c6eb['document']['selection'],_0x1deb96=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x4457de of _0x385830['getRanges']())for(const _0x3e0d2c of _0x4457de['getItems']())if(_0x3e0d2c['is']('element')&&_0x1deb96['includes'](_0x3e0d2c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x6eb6b='',_0x480495='',_0x3ca65d='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x6eb6b,_0x480495,_0x3ca65d);}}function G(_0x20f4a5,_0x4e7a15){const _0x3f21df=new Set();for(const _0x52d815 of _0x20f4a5['values']())(_0x4e7a15||!0x1===_0x52d815['requiresContent'])&&_0x3f21df['add'](_0x52d815['id']);return Array['from'](_0x3f21df);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
- _0x422f80(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x2415c8,_0x167db1,_0x3495ec){super(),this['editor']=_0x2415c8,this['textAdapter']=_0x167db1,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3495ec,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x3eece5,_0x5b6310,_0x397c3a)=>{this['view']['value']=this['_sanitizeHTML'](_0x397c3a);}),this['listenTo'](this['view'],'submitPrompt',(_0x60f425,_0x1e9e7a)=>{const _0x5c6aa2=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1e9e7a,_0x5c6aa2,'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:_0x5ca6fb,query:_0x2b802e,htmlContent:_0x556308,label:_0x2b2299,mainActionLabel:_0x2a83f3}){this['view']['prompt']=_0x2b2299,this['view']['mainAction']=_0x2a83f3,this['initialContext']=_0x556308,_0x2b802e&&(this['view']['isRendered']?this['_handleQuery'](_0x2b802e,_0x556308,_0x5ca6fb,_0x2b2299):this['view']['once']('render',()=>{this['_handleQuery'](_0x2b802e,_0x556308,_0x5ca6fb,_0x2b2299);}));}['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'](_0x317b5e,_0x555085,_0x2229d6,_0x1a0d63){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x555085,this['previousQuery']=_0x317b5e,this['previousLabel']=_0x1a0d63||_0x317b5e,this['previousActionId']=_0x2229d6,new Promise(_0x87c08b=>{this['textAdapter']['makeRequest']({'query':_0x317b5e,'context':_0x555085,'onData':_0x49c960=>{this['currentResponse']=_0x49c960,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2229d6})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x244228=>{_0x244228 instanceof R?this['view']['handleError'](_0x244228['message']):this['view']['handleError'](),_0x87c08b();})['finally'](()=>{this['stopProcessing'](),_0x87c08b();});});}['_parseAndNormalizeContent'](_0x253db6,_0x248cf7=!0x1){const _0x252bfd=Z['exec'](_0x253db6);_0x253db6=_0x252bfd?_0x253db6['substring'](_0x252bfd[0x1]['length']):_0x253db6['length']<0x64&&!_0x248cf7?'':this['_stripMarkdownSyntax'](_0x253db6);const _0x1f22ef=this['_domParser']['parseFromString'](_0x253db6,'text/html');if(_0x252bfd){const _0x3b5d1c=Array['from'](_0x1f22ef['body']['childNodes']);_0x3b5d1c['reverse']();for(const _0x49ad85 of _0x3b5d1c){if(_0x49ad85['nodeType']==Node['ELEMENT_NODE'])break;_0x49ad85['remove']();}}const _0x175a0e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1f22ef['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x175a0e);const _0x575b30=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x294562=this['editor']['data']['toModel'](_0x175a0e);return _0x575b30||_0x294562['markers']['clear'](),this['editor']['data']['stringify'](_0x294562);}['_normalizeResponseHeadings'](_0x43a040){const _0x5e47d4=new _0x2c0ef3(this['editor']['editing']['view']['document']),_0x2e53f4=new _0x35cc3d({'name':/^h[1-5]$/}),_0x5a986b=[];let _0x2b5ffc=!0x1;for(const _0x3003a8 of _0x43a040)_0x3003a8['is']('element')&&_0x2e53f4['match'](_0x3003a8)&&(_0x5a986b['push'](_0x3003a8),'h1'==_0x3003a8['name']&&(_0x2b5ffc=!0x0));if(_0x2b5ffc){for(const _0x12d2f2 of _0x5a986b)_0x5e47d4['rename']('h'+(parseInt(_0x12d2f2['name'][0x1])+0x1),_0x12d2f2);}}['_isH1TagSupportEnabled'](){const {data:_0x393cea,editing:_0x50809f}=this['editor'],_0x56f1f2=_0x393cea['htmlProcessor']['toView']('<h1></h1>'),_0x275ef0=_0x393cea['toView'](_0x393cea['toModel'](_0x56f1f2));return!!_0x50809f['view']['domConverter']['viewToDom'](_0x275ef0)['querySelector']('h1');}['_sanitizeHTML'](_0x168ce9){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x168ce9),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x5c62d3){const _0x4fb050=_0x5c62d3['trim']();return _0x4fb050['startsWith']('```html')?_0x4fb050['endsWith']('```')?_0x4fb050['substring'](0x7,_0x4fb050['length']-0x3):_0x4fb050['substring'](0x7):_0x5c62d3;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x510e74){super(_0x510e74),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x394593=>i(_0x510e74,'AI_'+_0x394593['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x510e74,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x510e74,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x510e74,'Stop'));const _0x4f4bc1=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4f4bc1['if']('isVisible','ck-hidden',_0x9dc4e2=>!_0x9dc4e2)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1765d5,_0x5416de){const _0x409e64=new _0x3f2621(this['locale']);return _0x409e64['set']({'label':_0x1765d5,'class':_0x5416de||'','isVisible':!0x0,'withText':!0x0}),_0x409e64;}}class Y extends _0x23b47f{['contentFieldView'];['copyButtonView'];constructor(_0x17ce32,_0x2aa96b=''){super(_0x17ce32),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1deae6=this['bindTemplate'];this['contentFieldView']=new At(_0x17ce32,_0x2aa96b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1deae6['if']('isVisible','ck-hidden',_0xde7e52=>!_0xde7e52)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1deae6['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 _0x5d95a0=!0x1;this['on']('change:value',(_0x3311fa,_0x3f9e55,_0x917af3)=>{const _0x121782=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x917af3),this['isProcessing']&&_0x121782&&!_0x5d95a0&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x251765,_0x34c7b0,_0x1e88c3)=>{_0x5d95a0=!0x1,_0x1e88c3?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5d95a0=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5d95a0=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x10e78b=this['locale'],_0x2a5cc5=new _0x3f2621(this['locale']),_0x536911='ck-ai-form__copy-button';return _0x2a5cc5['set']({'label':i(_0x10e78b,'Copy'),'icon':_0xbadf8b,'class':_0x536911,'tooltip':!0x0}),_0x2a5cc5['bind']('isVisible')['to'](this,'value',_0x1aaa0b=>!!_0x1aaa0b),_0x2a5cc5['bind']('isEnabled')['to'](this,'isProcessing',_0x8eec17=>!_0x8eec17),_0x2a5cc5['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x2a5cc5['icon']=_0x2fccd4,_0x2a5cc5['class']=_0x536911+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x2a5cc5['icon']=_0xbadf8b,_0x2a5cc5['class']=_0x536911;},0x3e8);}),_0x2a5cc5;}['_copyHTMLToClipboard'](_0xe02b94){const {window:_0x16ae99,document:_0x3e60d6}=_0xcdee6;if(_0x16ae99['ClipboardItem']){const {Blob:_0x22df9c,ClipboardItem:_0x4bc45d}=_0x16ae99,_0xb7ff09=[new _0x4bc45d({'text/html':new _0x22df9c([_0xe02b94['innerHTML']],{'type':'text/html'}),'text/plain':new _0x22df9c([_0xe02b94['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xb7ff09);}else{const _0x34712f=_0x3e60d6['createElement']('div');_0x34712f['style']['position']='absolute',_0x34712f['style']['left']='-9999px',_0x34712f['innerHTML']='<span>[</span>'+_0xe02b94['innerHTML']+'<span>]</span>',_0x3e60d6['body']['appendChild'](_0x34712f);const _0x27e6ba=_0x3e60d6['createRange']();_0x27e6ba['setStartAfter'](_0x34712f['firstElementChild']),_0x27e6ba['setEndBefore'](_0x34712f['lastElementChild']);const _0xd0a0ce=_0x16ae99['getSelection']();_0xd0a0ce['removeAllRanges'](),_0xd0a0ce['addRange'](_0x27e6ba),_0x3e60d6['execCommand']('copy'),_0x34712f['remove']();}}}class At extends _0x23b47f{constructor(_0x446765,_0x5ec368=''){super(_0x446765),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5ec368,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xcd0cd9){this['element']['innerHTML']=_0xcd0cd9;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4bae09=new _0x23b47f(),_0x14d8c5=this['locale'],_0x583d8c=new _0x30cdc3();return _0x583d8c['isVisible']=!0x0,_0x4bae09['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x583d8c,{'text':i(_0x14d8c5,'AI\x20is\x20writing...')}]}),_0x4bae09['render'](),_0x4bae09;}}class st extends _0x23b47f{constructor(_0x3ecc23,_0x53fbd3=''){super(_0x3ecc23);const _0x2a068a=new rt(),_0x17029c=this['bindTemplate'];this['set']('text',_0x53fbd3),_0x2a068a['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2a068a,{'text':_0x17029c['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x550db7,_0x3332af){super(_0x550db7,_0x3332af),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',(_0x52399c,_0x17bd3a)=>{_0x52399c['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x17bd3a());});}['_createSubmitButton'](){const _0x595873=new _0x3f2621(this['locale']),_0x374e59=this['locale'];return _0x595873['set']({'icon':ht,'label':i(_0x374e59,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x595873['on']('execute',()=>{this['submit']();}),_0x595873['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x163a61,_0x3dfa5b)=>!_0x163a61&&_0x3dfa5b),_0x595873;}['_createShowHistoryButton'](){const _0x5e65f3=new _0x3f2621(this['locale']),_0x349390=this['resultsView'],_0x142fd7=this['locale'];_0x5e65f3['set']({'label':i(_0x142fd7,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5e65f3['bind']('isOn')['to'](_0x349390,'isVisible'),_0x5e65f3['bind']('isEnabled')['to'](this,'isEnabled'),_0x5e65f3['on']('execute',()=>{_0x349390['isVisible']=!_0x349390['isVisible'],_0x349390['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x57480f=()=>{_0xcdee6['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x5f26d2=new it(this['queryView']['fieldView']['element']),_0x7ce67=_0x5f26d2['width'],_0x8a1374='rtl'===_0x142fd7['uiLanguageDirection']?'left':'right';_0x5f26d2['excludeScrollbarsAndBorders'](),_0x5e65f3['element']['style'][_0x8a1374]=_0x7ce67-_0x5f26d2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x57480f),this['on']('render',_0x57480f),_0x5e65f3;}['submit'](){const _0x19e23c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x19e23c);}['focus'](_0x42ee1b){-0x1===_0x42ee1b?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x55595a){super(_0x55595a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x55595a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x375933=0x0;for(const _0x612781 of this['items'])_0x375933+=_0x612781['items']['length'];return{'resultsCount':_0x375933,'totalItemsCount':_0x375933};}['_createClearHistoryButton'](){const _0x360dcc=this['locale'],_0x1cf722=new _0x3f2621(this['locale']);return _0x1cf722['set']({'label':'('+i(_0x360dcc,'Clear')+')','withText':!0x0}),_0x1cf722['on']('execute',()=>this['fire']('clearHistory')),_0x1cf722;}}class bt extends xt{constructor(_0x1b119f){super();const _0xf8af02=new kt(),_0x148fef=new _0x3f2621(this['locale'],_0xf8af02);this['children']['add'](_0x148fef),_0x148fef['set']({'label':_0x1b119f['prompt'],'withText':!0x0}),_0x148fef['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x1b119f['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x83cd52{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1ec527,_0x2d7402)=>{const _0x39aa5a=os(_0x2d7402['prompt']);for(const _0x1a5b13 of this)if(_0x1a5b13!=_0x2d7402&&os(_0x1a5b13['prompt'])===_0x39aa5a){this['remove'](_0x1a5b13);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x42fc57=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x42fc57));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x2319da=>_0x2319da)));}}function os(_0x3cd947){return _0x3cd947['toLowerCase']()['trim']();}class _ extends _0x23b47f{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3f79fa,_0xa8e975,_0x2ccb1b=''){super(_0x3f79fa),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(_0x3f79fa),this['contentArea']=new Y(_0x3f79fa,_0x2ccb1b),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 _0x3723ae=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xa8e975],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3723ae['if']('isError','ck-hidden',_0x171446=>!_0x171446)]},'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'](_0x3b368d=0x1){-0x1===_0x3b368d?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 _0x12444d=this['locale'],_0x107704=new ct(_0x12444d,{'queryView':{'label':i(_0x12444d,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x12444d,'Empty\x20history'),'secondary':i(_0x12444d,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x107704['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x17d98d,_0x517ed4)=>_0x17d98d&&!_0x517ed4),this['listenTo'](_0x107704,'submit',(_0x4ff55c,_0x30f6e7)=>{this['prompt']=_0x30f6e7;const _0x30c519=yt(_0x30f6e7);this['fire']('submitPrompt',_0x30c519),_0x30f6e7['trim']()&&this['_promptHistory']['add']({'prompt':_0x30c519},0x0);},{'priority':'high'}),_0x107704;}['_createHistoryView'](){const _0x347ae3=new ft(this['locale']);return _0x347ae3['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x347ae3['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x347ae3;}['_createToolbar'](){const _0x1fbeff=new lt(this['locale']);return _0x1fbeff['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x36e097,_0x41969a,_0x41e912)=>_0x36e097&&!_0x41969a&&!!_0x41e912),_0x1fbeff['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1fbeff['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x492486,_0x2c9e7b,_0x5cfaba)=>_0x492486&&!_0x2c9e7b&&!!_0x5cfaba),_0x1fbeff['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1fbeff['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5587b7,_0x29d7d5)=>_0x5587b7&&!_0x29d7d5),_0x1fbeff['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1fbeff['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1fbeff['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1fbeff;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5cd224=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5cd224,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5c49ae){const _0x54d76f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5c49ae||i(_0x54d76f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x33ae66{['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[_0xd3129d,a,E,_0x2f88f3];}constructor(_0x24e45e){super(_0x24e45e),_0x24e45e['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x24e45e['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x24e45e['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x24e45e['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x34167e}=this;this['_aiAdapter']=_0x34167e['plugins']['get'](E),this['_dialog']=_0x34167e['plugins']['get'](_0x2f88f3),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x469a7a=new j(_0x34167e,Array['from'](this['_commandDefinitions']['values']()));_0x34167e['commands']['add']('showAIAssistant',_0x469a7a),_0x34167e['ui']['componentFactory']['add']('aiCommands',_0x1e8093=>{const _0x3c7880=_0x149b36(_0x1e8093);return _0x3c7880['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3c7880['buttonView']['set']({'label':i(_0x1e8093,'AI\x20Commands'),'icon':_0x20e77e,'tooltip':!0x0}),_0x3c7880['on']('execute',_0x4b346f=>this['_onExecute'](_0x4b346f['source']['id'])),_0x5c2f3c(_0x3c7880,_0x34167e['ui']['view']['body'],function(_0x51ffc){const _0x312731=o(_0x51ffc['config']['get']('ai.aiAssistant.commands'),_0x51ffc['locale']),_0x2829d4=U(_0x51ffc,_0x312731)['filter'](_0x2b9298=>_0x2b9298['commands']['length']);if(0x1===_0x2829d4['length'])return U(_0x51ffc,_0x2829d4[0x0]['commands'])['map'](_0x958c05=>({'id':_0x958c05['id'],'label':_0x958c05['label']}));return _0x2829d4['map'](_0x1f0f74=>{const {groupId:_0x3c00dc,groupLabel:_0x2d3b08,commands:_0x493e08}=_0x1f0f74,_0x1d1c12=U(_0x51ffc,_0x493e08)['map'](_0x55adcd=>({'id':_0x55adcd['id'],'label':_0x55adcd['label']}));return{'id':_0x3c00dc,'menu':_0x2d3b08||_0x3c00dc,'children':_0x1d1c12};});}(_0x34167e),{'ariaLabel':i(_0x1e8093,'AI\x20Commands')}),_0x3c7880['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x469a7a['on']('change:enabledCommandsIds',_0x16b7b5),_0x3c7880['menuView']['once']('render',_0x16b7b5),_0x3c7880;function _0x16b7b5(){_0x3c7880['isEnabled']=_0x469a7a['enabledCommandsIds']['length']>0x0;for(const _0x21c607 of _0x3c7880['menuView']['buttons'])_0x21c607['isEnabled']=_0x469a7a['enabledCommandsIds']['includes'](_0x21c607['id']);}}),_0x34167e['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3b4d83=>{const _0x523b7a=new _0xaca37f(_0x3b4d83);_0x523b7a['buttonView']['set']({'label':i(_0x3b4d83,'AI\x20Commands'),'icon':_0x20e77e}),_0x523b7a['bind']('isEnabled')['to'](_0x469a7a,'enabledCommandsIds',_0x5ad6e8=>_0x5ad6e8['length']>0x0);const _0x32f3d6=o(_0x34167e['config']['get']('ai.aiAssistant.commands'),_0x3b4d83);return this['_populateMenuBarMenu'](_0x469a7a,_0x523b7a,_0x32f3d6,_0x1f68e5=>this['_onExecute'](_0x1f68e5)),_0x523b7a;}),_0x34167e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x55b4a2=this['_createAIAssistantUIButton'](_0x3f2621);return _0x55b4a2['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x55b4a2;}),_0x34167e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x16ed74=this['_createAIAssistantUIButton'](_0x3510dc);return _0x16ed74['set']({'role':'menuitemcheckbox'}),_0x16ed74;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x39f067=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x6d7c72;for(const _0x2d6c74 in _0x39f067){const _0x589e98=_0x2d6c74,_0x5bbbd0=_0x39f067[_0x589e98];if('aiLicenseKeyValid'==_0x5bbbd0||'aiLicenseKeyInvalid'==_0x5bbbd0||'aiLicenseKeyExpired'==_0x5bbbd0||'aiLicenseKeyDomainLimit'==_0x5bbbd0||'aiLicenseKeyNotAllowed'==_0x5bbbd0||'aiLicenseKeyEvaluationLimit'==_0x5bbbd0||'aiLicenseKeyTrialLimit'==_0x5bbbd0||'aiLicenseKeyUsageLimit'==_0x5bbbd0){delete _0x39f067[_0x589e98],_0x6d7c72=_0x5bbbd0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x6d7c72&&_0x39f067['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x6d7c72&&_0x39f067['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x6d7c72&&_0x39f067['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x6d7c72&&_0x39f067['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x6d7c72&&_0x39f067['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x6d7c72&&_0x39f067['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x6d7c72&&_0x39f067['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2e3089='',_0x35a2bf='',_0x5f0683='custom'){const _0x38e4e7=this['editor'],_0x1dfec6=_0x38e4e7['editing']['view'],_0x3230c4=_0x38e4e7['plugins']['get'](a),_0x5810b4=_0x38e4e7['plugins']['get'](_0xd3129d);_0x3230c4['showFakeVisualSelection']();const _0x6440b8=new w(),_0x2ba375=new ClipboardEvent('copy',{'clipboardData':_0x6440b8}),_0x30c7c9=new _0x199775(_0x6440b8),_0xf2f74f=new _0x4724aa(_0x1dfec6,_0x2ba375,{'dataTransfer':_0x30c7c9});_0x5810b4['_forceMarkersCopy']('comment',()=>{_0x1dfec6['document']['fire']('copy',_0xf2f74f);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x38e4e7,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2c1624=_0x30c7c9['getData']('text/html');const _0x5638fa=_0x38e4e7['model']['document']['selection'],_0x4c9e3a=Array['from'](_0x5638fa['getRanges']());0x1===_0x4c9e3a['length']&&_0x4c9e3a[0x0]['isFlat']&&!_0x5638fa['getSelectedElement']()&&''!==_0x2c1624['replace'](/&nbsp;/g,'')['trim']()&&(_0x2c1624='<p>'+_0x2c1624+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x5f0683,'query':_0x2e3089,'htmlContent':_0x2c1624,'label':_0x35a2bf,'mainActionLabel':M[_0x38e4e7['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x36e8d9,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1fea3f['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3230c4['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x668497=new Map(),_0x5ccb5e=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x2d13e8 of _0x5ccb5e)for(const _0x490ba4 of _0x2d13e8['commands'])_0x668497['set'](_0x490ba4['id'],{..._0x490ba4,'groupId':_0x2d13e8['groupId'],'groupLabel':_0x2d13e8['groupLabel']||_0x2d13e8['groupId']});return _0x668497;}['_createAIAssistantUIButton'](_0x2c2c8f){const _0x25382b=this['editor'],_0xb01b4f=_0x25382b['commands']['get']('showAIAssistant'),_0x24e206=new _0x2c2c8f(_0x25382b['locale']);return _0x24e206['set']({'label':i(_0x25382b['locale'],'AI\x20Assistant'),'icon':_0x36e8d9,'isToggleable':!0x0}),_0x24e206['bind']('isEnabled')['to'](_0xb01b4f),_0x24e206['bind']('isOn')['to'](this['_dialog'],'id',_0x4eb9b4=>'aiAssistant'===_0x4eb9b4),this['listenTo'](_0x24e206,'execute',()=>{_0x24e206['isOn']?this['hideUI']():_0xb01b4f['execute']();}),_0x24e206;}['_initView'](){const _0x1f360f=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',()=>{_0x1f360f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1f360f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x59f0fe,ui:{ariaLiveAnnouncer:_0x5af311}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x24abf0,_0x4f5b58,_0x4e1037)=>{const _0x5187d2=this['_aiAssistantController']['currentContext'];_0x4e1037?_0x5af311['announce'](i(_0x59f0fe,'AI\x20is\x20writing')):_0x5187d2&&_0x5af311['announce'](i(_0x59f0fe,'Generated\x20content:\x20%0',_0x5187d2),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3eecbd,_0x3a6f15,_0x59a6fb)=>{if(_0x59a6fb){const _0xd60b81=this['_formView']['errorView']['text'];_0x5af311['announce'](i(_0x59f0fe,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xd60b81));}});}['_onExecute'](_0x248228){const _0x299a95=this['_commandDefinitions']['get'](_0x248228),_0x8bfed2=this['editor'],_0x5de568=_0x8bfed2['model']['document']['selection'],_0xca5ad3=_0x8bfed2['commands']['get']('showAIAssistant'),_0x5bf234=_0x8bfed2['plugins']['get'](a),_0xc07b43=''+(_0x299a95['groupId']!==x?_0x299a95['groupLabel']+':\x20':'')+_0x299a95['label'];if(!0x1!==_0x299a95['requiresContent']&&_0x5de568['isCollapsed']){const _0x546be7=_0x4ccd99(_0x5de568['getSelectedBlocks']())||_0x8bfed2['model']['schema']['getLimitElement'](_0x5de568);_0x8bfed2['model']['change'](_0x5b4d09=>{_0x5b4d09['setSelection'](_0x546be7,'in');});}_0x5bf234['showFakeVisualSelection'](),_0xca5ad3['execute'](_0x299a95['prompt'],_0xc07b43,'command:'+_0x248228);}['_populateMenuBarMenu'](_0x243799,_0x22fab0,_0x42925f,_0x1aba9a){const _0x3c7b48=this['editor'],_0x387c00=_0x3c7b48['locale'],_0x3a4888=new _0xea96c3(_0x387c00),_0x24f572=U(_0x3c7b48,_0x42925f)['filter'](_0x10fcae=>_0x10fcae['commands']['length']);0x1===_0x24f572['length']?this['_getMenuBarGroupButtons']({'command':_0x243799,'commands':_0x24f572[0x0]['commands'],'parentMenuView':_0x22fab0,'onExecute':_0x1aba9a})['forEach'](_0x7f2286=>_0x3a4888['items']['add'](_0x7f2286)):_0x24f572['forEach'](({groupId:_0x595ede,groupLabel:_0x2d24a3,commands:_0x4d9715})=>{const _0x2dad19=new _0x1d54fe(_0x387c00,_0x22fab0),_0x3ce474=new _0xaca37f(_0x387c00),_0x48c3ef=new _0xea96c3(_0x387c00),_0x2c00e0=this['_getMenuBarGroupButtons']({'command':_0x243799,'commands':_0x4d9715,'parentMenuView':_0x3ce474,'onExecute':_0x1aba9a});_0x3ce474['buttonView']['set']({'label':_0x2d24a3||_0x595ede}),_0x3ce474['delegate']('execute')['to'](_0x22fab0),_0x48c3ef['items']['addMany'](_0x2c00e0),_0x3ce474['panelView']['children']['add'](_0x48c3ef),_0x2dad19['children']['add'](_0x3ce474),_0x3a4888['items']['add'](_0x2dad19);}),_0x22fab0['panelView']['children']['add'](_0x3a4888);}['_getMenuBarGroupButtons']({command:_0x41d5f5,commands:_0x29f170,parentMenuView:_0x3dc5cf,onExecute:_0x138ddd}){const _0x41c966=this['editor'],_0xa9722b=_0x41c966['locale'];return U(_0x41c966,_0x29f170)['map'](_0x147c16=>{const _0xb5d1f8=new _0x1d54fe(_0xa9722b,_0x3dc5cf),_0x148080=new _0x3510dc(_0xa9722b);return _0x148080['set']({'label':_0x147c16['label']}),_0x148080['delegate']('execute')['to'](_0x3dc5cf),_0x148080['on']('execute',()=>_0x138ddd(_0x147c16['id'])),_0x148080['bind']('isEnabled')['to'](_0x41d5f5,'enabledCommandsIds',_0x248ee3=>_0x248ee3['includes'](_0x147c16['id'])),_0xb5d1f8['children']['add'](_0x148080),_0xb5d1f8;});}}function B(_0x3a8c32,_0x47c05f){return void 0x0!==_0x3a8c32['order']&&void 0x0===_0x47c05f['order']?0x1:void 0x0===_0x3a8c32['order']&&void 0x0!==_0x47c05f['order']?-0x1:void 0x0!==_0x3a8c32['order']&&void 0x0!==_0x47c05f['order']?_0x3a8c32['order']-_0x47c05f['order']:0x0;}function U(_0x986b4,_0xa8a2b3){_0xa8a2b3['sort'](B);const _0x4f97dc={},_0x41a2e8=[];for(const _0x257733 of _0xa8a2b3)if(void 0x0!==_0x257733['order']){if(_0x257733['order']in _0x4f97dc)throw new _0x278b6c('ai-commands-config-order-collision',_0x986b4,{'conflictingDefinitions':[_0x257733,_0x4f97dc[_0x257733['order']]]});_0x4f97dc[_0x257733['order']]=_0x257733,_0x41a2e8['splice'](_0x257733['order'],0x0,_0x257733);}else _0x41a2e8['push'](_0x257733);return _0x41a2e8;}class r extends _0x33ae66{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x5025f4){super(_0x5025f4);const _0x36e77b=_0x5025f4['config'],_0x52fce9=_0x5025f4['locale'];_0x36e77b['define']('ai.aiAssistant.preserveComments',!0x0),_0x36e77b['define']('ai.aiAssistant.commands',function(_0x3d2f79){return[{'groupId':'editOrReview','groupLabel':i(_0x3d2f79,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3d2f79,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3d2f79,'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(_0x3d2f79,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3d2f79,'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(_0x3d2f79,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3d2f79,'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(_0x3d2f79,'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(_0x3d2f79,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3d2f79,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3d2f79,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3d2f79,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3d2f79,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3d2f79,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3d2f79,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3d2f79,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3d2f79,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3d2f79,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3d2f79,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3d2f79,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3d2f79,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3d2f79,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3d2f79,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3d2f79,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3d2f79,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3d2f79,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3d2f79,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3d2f79,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x52fce9)),_0x36e77b['define']('ai.aiAssistant.extraCommandGroups',[]),_0x36e77b['define']('ai.aiAssistant.removeCommands',[]);let _0x16633b=o(_0x36e77b['get']('ai.aiAssistant.commands'),_0x52fce9);const _0x3cb624=_0x36e77b['get']('ai.aiAssistant.extraCommandGroups'),_0x557e0f=_0x36e77b['get']('ai.aiAssistant.removeCommands');_0x3cb624['forEach'](_0x2220e4=>{const _0x5c919e=_0x16633b['find'](_0x32dd8a=>_0x32dd8a['groupId']===_0x2220e4['groupId']);_0x5c919e?_0x5c919e['commands']=_0x5c919e['commands']['concat'](_0x2220e4['commands']):_0x16633b['push'](_0x2220e4);}),_0x16633b=_0x16633b['filter'](_0x512fc5=>!_0x557e0f['includes'](_0x512fc5['groupId'])),_0x16633b['forEach'](_0x4d95ba=>{_0x4d95ba['commands']=_0x4d95ba['commands']['filter'](_0x4e82fd=>!_0x557e0f['includes'](_0x4e82fd['id']));}),_0x36e77b['set']('ai.aiAssistant.commands',_0x16633b);}}class P extends _0x33ae66{['abortController'];static get['requires'](){return[E];}constructor(_0x11c9a0){super(_0x11c9a0),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'](_0x287294){return this['sendRequest'](_0x287294)['catch'](_0x356b38=>{if(_0x356b38 instanceof R)return Promise['reject'](_0x356b38);if('AbortError'==_0x356b38['name'])return Promise['resolve']();throw console['error'](_0x356b38),new _0x278b6c('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1cf112,_0x3d501e){const _0xa0cffb=this['editor']['locale'],_0x445755={'Content-Type':'application/json'};if('object'==typeof _0x1cf112)Object['assign'](_0x445755,_0x1cf112);else{if(_0x1cf112)try{const _0x12f415=await _0x1cf112(_0x3d501e);Object['assign'](_0x445755,_0x12f415);}catch(_0x1df48a){return Promise['reject'](new R(i(_0xa0cffb,'AI_ERROR_GET_HEADERS')));}}return _0x445755;}async['_prepareRequestParameters'](_0x159a2e,_0x29766e){const _0x564538=this['editor']['locale'];if('object'==typeof _0x159a2e)return _0x159a2e;try{return await _0x159a2e(_0x29766e);}catch(_0x3e1e45){return Promise['reject'](new R(i(_0x564538,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x58951b){super(_0x58951b),_0x58951b['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x58951b['config']['get']('ai.openAI.requestParameters')||_0x58951b['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x58951b['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x58951b['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x58951b['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x5adf06,context:_0x5d32ec,onData:_0x1ae341,actionId:_0xdaa0d}){const _0x306850=this['editor']['locale'],_0x1ff9c7=await this['prepareMessages'](_0x5adf06,_0x5d32ec,_0xdaa0d),_0x13437a=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xdaa0d),_0x59c4fd=await this['_prepareRequestParameters'](this['_requestParameters'],_0xdaa0d),_0x1aee59={'messages':_0x1ff9c7,..._0x59c4fd},_0x4e333d={'method':'POST','headers':_0x13437a,'body':JSON['stringify'](_0x1aee59),'signal':this['abortController']['signal']},_0x3147f2=await fetch(this['_apiUrl'],_0x4e333d);if(_0x3147f2['ok'])return _0x59c4fd['stream']?await this['_readStreamableResponse'](_0x3147f2,_0x1ae341):await this['_readStaticResponse'](_0x3147f2,_0x1ae341),Promise['resolve']();{const _0x20de2b=await _0x3147f2['text']();return _0x20de2b['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x306850,'AI_ERROR_CONTEXT_LENGTH'))):_0x20de2b['includes']('Moderation')?Promise['reject'](new R(i(_0x306850,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x20de2b));}}async['prepareMessages'](_0x5fecc2,_0x4a79d3,_0x579af8){let _0x59b569,_0x2f47ca;return _0x4a79d3?(_0x59b569='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.',_0x2f47ca='Instruction:\x0a'+_0x5fecc2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4a79d3):(_0x59b569='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.',_0x2f47ca=_0x5fecc2),[{'role':'system','content':_0x59b569},{'role':'user','content':_0x2f47ca}];}async['_readStreamableResponse'](_0x13e166,_0x58f18e){const _0x2dc2f7=_0x13e166['body']['getReader'](),_0x9c3813=new TextDecoder();let _0x5bf3bd='',_0x394821='',_0x579a72='',_0x573aff=!0x1;for(;!_0x573aff;){const {done:_0x4770cb,value:_0x4be3aa}=await _0x2dc2f7['read'](),_0x56c33c=_0x5bf3bd+_0x9c3813['decode'](_0x4be3aa);let _0x58e8fe='';_0x573aff=_0x4770cb;try{_0x58e8fe=this['_cleanUpData'](_0x56c33c),_0x5bf3bd='';}catch(_0x3f675c){_0x5bf3bd=_0x56c33c;continue;}_0x394821+=_0x58e8fe,!_0x573aff&&this['_isBufferIncomplete'](_0x394821)||_0x394821&&(_0x579a72+=_0x394821,_0x394821='',_0x58f18e(_0x579a72));}return Promise['resolve']();}async['_readStaticResponse'](_0x4b2547,_0x53f690){return _0x53f690((await _0x4b2547['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x377eb2){const _0xa31d9e=_0x377eb2['split']('<')['length']!==_0x377eb2['split']('>')['length'],_0xcadee9=_0x377eb2['length']<0x1e;return _0xa31d9e&&_0xcadee9;}['_cleanUpData'](_0x1a9605){return _0x1a9605['split'](/\n(?![^{]*\})/g)['map'](_0x14d090=>_0x14d090['replace']('data:\x20',''))['filter'](_0xbcd3d4=>_0xbcd3d4&&_0xbcd3d4['length']>0x0&&'[DONE]'!==_0xbcd3d4)['map'](_0x1abfc1=>{const {choices:_0xcd0dff}=JSON['parse'](_0x1abfc1);if(_0xcd0dff[0x0]?.['delta']?.['content'])return _0xcd0dff[0x0]['delta']['content'];})['filter'](_0x483c92=>_0x483c92)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1433d2){super(_0x1433d2),_0x1433d2['config']['get']('ai.aws.requestParameters')||_0x1433d2['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']=_0x1433d2['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1433d2['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1433d2['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1433d2['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2a26ff,context:_0x51dafa,onData:_0x365650,actionId:_0x448619}){const {model:_0x30011c,stream:_0x45e478,..._0x2def9d}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x448619),_0x247bf9={'prompt':await this['preparePrompt'](_0x2a26ff,_0x51dafa,_0x30011c,_0x448619),..._0x2def9d};this['_apiUrl']?await this['_processProxyRequest'](_0x247bf9,_0x30011c,_0x45e478,_0x365650,_0x448619):await this['_processAWSRequest'](_0x247bf9,_0x30011c,_0x45e478,_0x365650);}async['preparePrompt'](_0x12f9af,_0x40c91d,_0x5bae97,_0x23f5d4){let _0x28a7eb,_0x1706bf;return _0x40c91d?(_0x28a7eb='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.',_0x1706bf='Instruction:\x0a'+_0x12f9af+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x40c91d):(_0x28a7eb='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.',_0x1706bf=_0x12f9af),'meta.llama'==this['getModelFamily'](_0x5bae97)?'<<SYS>>\x0a'+_0x28a7eb+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1706bf+'\x0a[/INST]':'Human:\x0a'+_0x28a7eb+'\x0a'+_0x1706bf+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1c8545){if(/^anthropic\.claude/['test'](_0x1c8545))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1c8545))return'ai21.j2';if(/^cohere\.command/['test'](_0x1c8545))return'cohere.command';if(/^meta\.llama/['test'](_0x1c8545))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1c8545));}async['_processProxyRequest'](_0xfb8e55,_0x3a2abd,_0x1f9aac,_0x4d017f,_0x5b70c0){const _0x2eb529={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5b70c0),'body':JSON['stringify']({..._0xfb8e55,'model':_0x3a2abd,'stream':_0x1f9aac}),'signal':this['abortController']['signal']},_0x4d4afb=await fetch(this['_apiUrl'],_0x2eb529);_0x1f9aac?await this['_readStreamableResponse'](_0x4d4afb,_0x3a2abd,_0x4d017f):await this['_readStaticResponse'](_0x4d4afb,_0x3a2abd,_0x4d017f);}async['_processAWSRequest'](_0x48c06b,_0x5ef68e,_0x3821ee,_0x1da7a2){const _0x55f89b=new _0x135afc(this['_bedrockClientConfig']),_0x3facdb={'body':JSON['stringify'](_0x48c06b),'contentType':'application/json','accept':'application/json','modelId':_0x5ef68e};let _0x54ec85;if(_0x3821ee){const _0x5067a7=new _0x7ec8a2(_0x3facdb);_0x54ec85=await _0x55f89b['send'](_0x5067a7,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x54ec85,_0x5ef68e,_0x1da7a2);}else{const _0x373803=new _0x1fc2a1(_0x3facdb);_0x54ec85=await _0x55f89b['send'](_0x373803,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x54ec85,_0x5ef68e,_0x1da7a2);}}async['_readAsyncIterableResponse'](_0x2492eb,_0x5e2d93,_0x5a458b){const _0x3a4a5f=_0x2492eb['body'],_0x8b469b=new TextDecoder('utf-8');let _0xf2b701='';for await(const _0x1163a9 of _0x3a4a5f)if(_0x1163a9['chunk']){const _0x2cf2ec=_0x8b469b['decode'](_0x1163a9['chunk']['bytes']),_0x11af97=JSON['parse'](_0x2cf2ec);_0xf2b701+=this['_getGeneratedText'](_0x11af97,_0x5e2d93),_0x5a458b(_0xf2b701);}return Promise['resolve']();}async['_readStreamableResponse'](_0x28410f,_0x404ae2,_0x3aafd4){const _0x18fb15=_0x28410f['body'],_0x19692a=new TextDecoder('utf-8'),_0xcdfc48=_0x18fb15['getReader']();let _0x3a6c4f='',_0x5019df='',_0x403f79=!0x1;for(;!_0x403f79;){const {done:_0x1a3416,value:_0x322ede}=await _0xcdfc48['read']();if(_0x403f79=_0x1a3416,_0x403f79)break;const _0x1f155a=(_0x3a6c4f+_0x19692a['decode'](_0x322ede))['split']('\x0a')['map'](_0x35ac2e=>{try{return _0x3a6c4f='',JSON['parse'](_0x35ac2e);}catch(_0x284a10){return _0x3a6c4f=_0x35ac2e,null;}})['filter'](_0x20713c=>null!==_0x20713c);_0x1f155a['length']&&(_0x5019df+=_0x1f155a['map'](_0x1834d5=>this['_getGeneratedText'](_0x1834d5,_0x404ae2))['join'](''),_0x3aafd4(_0x5019df));}return Promise['resolve']();}async['_readStaticResponse'](_0x3cbe6c,_0x23d32e,_0x6e0239){let _0xc902b8;return _0xc902b8=_0x3cbe6c instanceof Response?await _0x3cbe6c['json']():JSON['parse'](Buffer['from'](_0x3cbe6c['body'])['toString']('utf8')),(_0x6e0239(this['_getGeneratedText'](_0xc902b8,_0x23d32e)),Promise['resolve']());}['_getGeneratedText'](_0x3c4e23,_0x2d5ac0){switch(this['getModelFamily'](_0x2d5ac0)){case'anthropic.claude':return _0x3c4e23['completion'];case'ai21.j2':return _0x3c4e23['completions'][0x0]['data']['text'];case'cohere.command':return _0x3c4e23['generations'][0x0]['text'];case'meta.llama':return _0x3c4e23['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 _0x19bcde,Command as _0xf56563}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2598ac,IconCheck as _0x11c928,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x13fcd1,IconRobotPencil as _0x5aca5d}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x15343f,CKEditorError as _0x1b1dd3,ObservableMixin as _0x2dc2e2,global as _0x26e53b,isVisible as ot,Rect as it,Collection as _0x10d6a9,FocusTracker as mt,KeystrokeHandler as ut,first as _0x4a4589}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x1b6e8e,View as _0x131093,SpinnerView as _0x5f4fe5,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 _0x16c2b6,createDropdown as _0x200e1d,addMenuToDropdown as _0x15144d,MenuBarMenuView as _0x328b85,MenuBarMenuListItemButtonView as _0x5a9095,DialogViewPosition as _0x464932,MenuBarMenuListView as _0x344ffd,MenuBarMenuListItemView as _0x296ec0}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1ce61f,ClipboardMarkersUtils as _0x189c42}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x20f0cc,DataTransfer as _0x48abd2,UpcastWriter as _0x47f9e8,Matcher as _0x158613}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x559b14,InvokeModelWithResponseStreamCommand as _0x8b9452,InvokeModelCommand as _0x3d7377}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x474986,_0x29514e){const _0x5e44d9=(0x0,_0x29514e['t'])('Other');return _0x474986['length']?'groupId'in _0x474986[0x0]?_0x474986:[{'groupId':x,'groupLabel':_0x5e44d9,'order':0x1/0x0,'commands':_0x474986}]:[{'groupId':x,'groupLabel':_0x5e44d9,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x19bcde{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x41a573}=this,_0x3a1f1d=['ck-fake-ai-selection'];_0x41a573['config']['get']('ai.useTheme')&&_0x3a1f1d['push']('ck-ai-assistant-ui_theme'),_0x41a573['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x3a1f1d,'priority':0xc}}),_0x41a573['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x5c0443,{writer:_0x515dae})=>{if(!_0x5c0443['markerRange']['isCollapsed'])return null;const _0x4172b4=_0x515dae['createUIElement']('span');return _0x515dae['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4172b4),_0x4172b4;}});}['afterInit'](){!async function(_0x38ebe2){const _0x104a5f=_0xa7a793([0x33,0x5a,0x76,0x59,0x4f,0x6c,0x39,0x41,0x6e,0x68,0x6b,0x79,0x32,0x4d,0x63,0x44,0x77,0x74,0x45,0x56,0x6a,0x6d,0x55,0x71,0x43,0x46,0x4e,0x4c,0x30,0x4b,0x37,0x61,0x67,0x31,0x54,0x65,0x52,0x4a,0x78,0x58,0x75,0x66,0x48,0x6f,0x57,0x70,0x49,0x50,0x72,0x73,0x34,0x36,0x51,0x35,0x64,0x38,0x53,0x47,0x7a,0x69,0x42,0x62]),_0x2a9272=0x387dd584,_0x5e82c0=0x387ab20c^_0x2a9272,_0x48972b=window[_0xa7a793([0x44,0x61,0x74,0x65])][_0xa7a793([0x6e,0x6f,0x77])](),_0x42c612=_0x38ebe2[_0xa7a793([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4426fc=new window[(_0xa7a793([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c8ba6=>{_0x42c612[_0xa7a793([0x6f,0x6e,0x63,0x65])](_0xa7a793([0x72,0x65,0x61,0x64,0x79]),_0x4c8ba6);}),_0x97f505={[_0xa7a793([0x6b,0x74,0x79])]:_0xa7a793([0x45,0x43]),[_0xa7a793([0x75,0x73,0x65])]:_0xa7a793([0x73,0x69,0x67]),[_0xa7a793([0x63,0x72,0x76])]:_0xa7a793([0x50,0x2d,0x32,0x35,0x36]),[_0xa7a793([0x78])]:_0xa7a793([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]),[_0xa7a793([0x79])]:_0xa7a793([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]),[_0xa7a793([0x61,0x6c,0x67])]:_0xa7a793([0x45,0x53,0x32,0x35,0x36])},_0x187724=_0x42c612[_0xa7a793([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xa7a793([0x67,0x65,0x74])](_0xa7a793([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1b9758(){let _0x5da62e,_0x29fc7f=null,_0x1b1860=null;try{if(_0x187724==_0xa7a793([0x47,0x50,0x4c]))return _0xa7a793([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5da62e=_0x4d4812(),!_0x5da62e)return _0xa7a793([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5da62e[_0xa7a793([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1b1860=_0x3164f4(_0x5da62e[_0xa7a793([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5da62e[_0xa7a793([0x6a,0x74,0x69])])),await _0x62e07d()?_0x5ab0fb()?_0x5a4801()?_0xa7a793([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x44b29a()?(_0x5da62e[_0xa7a793([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xa7a793([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x29fc7f=_0x53fed3(_0xa7a793([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5da62e[_0xa7a793([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xa7a793([0x74,0x72,0x69,0x61,0x6c])&&(_0x29fc7f=_0x53fed3(_0xa7a793([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x32a809()):_0xa7a793([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xa7a793([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xa7a793([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x479b7a){return _0xa7a793([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5a4801(){const _0x3c8404=[_0xa7a793([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xa7a793([0x74,0x72,0x69,0x61,0x6c])][_0xa7a793([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5da62e[_0xa7a793([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x48972b/0x3e8:0xe10*_0x5e82c0;return _0x5da62e[_0xa7a793([0x65,0x78,0x70])]<_0x3c8404;}function _0x5ab0fb(){const _0x4f73e3=_0x5da62e[_0xa7a793([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4f73e3&&(!!_0x4f73e3[_0xa7a793([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa7a793([0x2a]))||!!_0x4f73e3[_0xa7a793([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa7a793([0x41,0x49])));}function _0x44b29a(){const _0x2bb2c2=_0x5da62e[_0xa7a793([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2bb2c2||0x0==_0x2bb2c2[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x192179}=new URL(window[_0xa7a793([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2bb2c2[_0xa7a793([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x192179))return!0x0;const _0x4e2154=_0x192179[_0xa7a793([0x73,0x70,0x6c,0x69,0x74])](_0xa7a793([0x2e]));return _0x2bb2c2[_0xa7a793([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2e2e32=>_0x2e2e32[_0xa7a793([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xa7a793([0x2a])))[_0xa7a793([0x6d,0x61,0x70])](_0x272832=>_0x272832[_0xa7a793([0x73,0x70,0x6c,0x69,0x74])](_0xa7a793([0x2e])))[_0xa7a793([0x73,0x6f,0x6d,0x65])](_0x32cf44=>_0x4e2154[_0xa7a793([0x65,0x76,0x65,0x72,0x79])]((_0xc58111,_0xd80bf8)=>_0x32cf44[_0xd80bf8]===_0xc58111||_0x32cf44[_0xd80bf8]===_0xa7a793([0x2a])));}function _0x32a809(){return _0x29fc7f&&_0x1b1860?new window[(_0xa7a793([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1a7c98,_0x27d98a)=>{_0x29fc7f[_0xa7a793([0x74,0x68,0x65,0x6e])](_0x1a7c98,_0x27d98a),_0x1b1860[_0xa7a793([0x74,0x68,0x65,0x6e])](_0x1c3a39=>{_0x1c3a39!=_0xa7a793([0x56,0x61,0x6c,0x69,0x64])&&_0x1a7c98(_0x1c3a39);},_0x27d98a);}):_0x29fc7f||_0x1b1860||_0xa7a793([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3164f4(_0x2fb267,_0x5d3f02){return new window[(_0xa7a793([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xcff7e4=>{if(_0xc4c18a())return _0xcff7e4(_0xa7a793([0x56,0x61,0x6c,0x69,0x64]));_0x23394e(),_0x42c612[_0xa7a793([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xa7a793([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x255da0=!0x1;const _0x242db7=_0x15343f();function _0x2aa99d(_0x4e12c4){return!!_0x4e12c4&&(typeof _0x4e12c4===_0xa7a793([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4e12c4===_0xa7a793([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4e12c4[_0xa7a793([0x74,0x68,0x65,0x6e])]===_0xa7a793([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4e12c4[_0xa7a793([0x63,0x61,0x74,0x63,0x68])]===_0xa7a793([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x8bcad7(_0x4838c7){_0x2c429e(_0x4838c7)[_0xa7a793([0x74,0x68,0x65,0x6e])](_0x49a81c=>{if(!_0x49a81c||_0x49a81c[_0xa7a793([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xa7a793([0x6f,0x6b]))return _0xa7a793([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2d3796(_0x56b024(_0x242db7+_0x5d3f02))!=_0x49a81c[_0xa7a793([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xa7a793([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xa7a793([0x56,0x61,0x6c,0x69,0x64]);})[_0xa7a793([0x74,0x68,0x65,0x6e])](_0xc8ffed=>(_0x2d1d85(),_0xc8ffed),()=>{const _0x1db345=_0x4003f9();return null==_0x1db345?(_0x2d1d85(),_0xa7a793([0x56,0x61,0x6c,0x69,0x64])):_0xa7a793(_0x48972b-_0x1db345>(0x1c715184^_0x2a9272)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xa7a793([0x74,0x68,0x65,0x6e])](_0xcff7e4)[_0xa7a793([0x63,0x61,0x74,0x63,0x68])](()=>{_0xcff7e4(_0xa7a793([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xd0d96f=0x384b3b04^_0x2a9272;function _0x2d1d85(){const _0x593f0c=_0xa7a793([0x6c,0x6c,0x63,0x74,0x2d])+_0x2d3796(_0x56b024(_0x2fb267)),_0x2d577f=_0x12a873(_0x2d3796(window[_0xa7a793([0x4d,0x61,0x74,0x68])][_0xa7a793([0x63,0x65,0x69,0x6c])](_0x48972b/_0xd0d96f)));window[_0xa7a793([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xa7a793([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x593f0c,_0x2d577f);}function _0x4003f9(){const _0x530f19=_0xa7a793([0x6c,0x6c,0x63,0x74,0x2d])+_0x2d3796(_0x56b024(_0x2fb267)),_0x3b38bb=window[_0xa7a793([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xa7a793([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x530f19);return _0x3b38bb?window[_0xa7a793([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x12a873(_0x3b38bb),0x10)*_0xd0d96f:null;}function _0x2c429e(_0x597503){return new window[(_0xa7a793([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x418c41,_0x38f68d)=>{_0x597503[_0xa7a793([0x74,0x68,0x65,0x6e])](_0x418c41,_0x38f68d),window[_0xa7a793([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x38f68d,0x387c0144^_0x2a9272);});}}_0x42c612[_0xa7a793([0x6f,0x6e])](_0xa7a793([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x37405d,_0x5add86)=>{if(_0x5add86[0x0]!=_0x2fb267)return _0xcff7e4(_0xa7a793([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5add86[0x1]={..._0x5add86[0x1],[_0xa7a793([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x242db7};},{[_0xa7a793([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xa7a793([0x68,0x69,0x67,0x68])}),_0x42c612[_0xa7a793([0x6f,0x6e])](_0xa7a793([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3ffcad=>{_0x2aa99d(_0x3ffcad[_0xa7a793([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x255da0=!0x0,_0x8bcad7(_0x3ffcad[_0xa7a793([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xa7a793([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xa7a793([0x6c,0x6f,0x77])}),_0x4426fc[_0xa7a793([0x74,0x68,0x65,0x6e])](()=>{_0x255da0||_0xcff7e4(_0xa7a793([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xc4c18a(){return _0x42c612[_0xa7a793([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xa7a793([0x76,0x69,0x65,0x77])][_0xa7a793([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xa7a793([0x61,0x75,0x74,0x6f]);}function _0x23394e(){_0x42c612[_0xa7a793([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xa7a793([0x76,0x69,0x65,0x77])][_0xa7a793([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xa7a793([0x61,0x75,0x74,0x6f]);}}function _0x53fed3(_0x459e39){const _0x2e8a05=[new window[(_0xa7a793([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x272258=>setTimeout(_0x272258,0x3874eb48^_0x2a9272)),_0x4426fc[_0xa7a793([0x74,0x68,0x65,0x6e])](()=>new window[(_0xa7a793([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x39e3ba=>{let _0x4ca935=0x0;_0x42c612[_0xa7a793([0x6d,0x6f,0x64,0x65,0x6c])][_0xa7a793([0x6f,0x6e])](_0xa7a793([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1cbce5,_0x1a8443)=>{_0x1a8443[0x0][_0xa7a793([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4ca935++,_0x4ca935==(0x387dd47c^_0x2a9272)&&(_0x39e3ba(),_0x1cbce5[_0xa7a793([0x6f,0x66,0x66])]());});}))];return window[_0xa7a793([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xa7a793([0x72,0x61,0x63,0x65])](_0x2e8a05)[_0xa7a793([0x74,0x68,0x65,0x6e])](()=>_0x459e39);}async function _0xcf2034(){await _0x4426fc,_0x42c612[_0xa7a793([0x6d,0x6f,0x64,0x65,0x6c])][_0xa7a793([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2dc15e,_0x42c612[_0xa7a793([0x6d,0x6f,0x64,0x65,0x6c])][_0xa7a793([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2dc15e,_0x42c612[_0xa7a793([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xa7a793([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xb6ab03(_0x2155d5){const _0x32d945=_0xc2d081();_0x42c612[_0x32d945]=_0xa7a793([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2155d5,_0x2155d5!=_0xa7a793([0x56,0x61,0x6c,0x69,0x64])&&_0xcf2034();}function _0xc2d081(){const _0x528b84=window[_0xa7a793([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xa7a793([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xa7a793([0x6e,0x6f,0x77])]())[_0xa7a793([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xa7a793([0x2e]),'');let _0x16ec45=_0xa7a793([0x5a]);for(let _0x30febd=0x0;_0x30febd<_0x528b84[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x30febd+=0x2){let _0x3ea57d=window[_0xa7a793([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x528b84[_0xa7a793([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x30febd,_0x30febd+0x2));_0x3ea57d>=_0x104a5f[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3ea57d-=_0x104a5f[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x16ec45+=_0x104a5f[_0x3ea57d];}return _0x16ec45;}function _0x4d4812(){const _0x17ff98=_0x187724[_0xa7a793([0x73,0x70,0x6c,0x69,0x74])](_0xa7a793([0x2e]));if(0x3!=_0x17ff98[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1bd665(_0x17ff98[0x1]);function _0x1bd665(_0x183fd9){const _0x30f61b=_0x5b0364(_0x183fd9);return _0x30f61b&&_0x29e0d8()?_0x30f61b:null;function _0x29e0d8(){const _0x2101d9=_0x30f61b[_0xa7a793([0x6a,0x74,0x69])],_0x5c3eea=window[_0xa7a793([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2101d9[_0xa7a793([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2101d9[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x39c515={..._0x30f61b,[_0xa7a793([0x6a,0x74,0x69])]:_0x2101d9[_0xa7a793([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2101d9[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x39c515[_0xa7a793([0x76,0x63])],_0x56b024(_0x39c515)==_0x5c3eea;}}}async function _0x62e07d(){let _0xa233bf=!0x0;try{const _0x5e07c7=_0x187724[_0xa7a793([0x73,0x70,0x6c,0x69,0x74])](_0xa7a793([0x2e])),[_0x188101,_0x63d3de,_0x4fcd87]=_0x5e07c7;return _0x5d87d1(_0x188101),await _0x5b0ca0(_0x188101,_0x63d3de,_0x4fcd87),_0xa233bf;}catch(_0x3f6e96){return!0x1;}function _0x5d87d1(_0x35e9ba){const _0x19b637=_0x5b0364(_0x35e9ba);_0x19b637&&_0x19b637[_0xa7a793([0x61,0x6c,0x67])]==_0xa7a793([0x45,0x53,0x32,0x35,0x36])||(_0xa233bf=!0x1);}async function _0x5b0ca0(_0x520750,_0x1d60e9,_0x2260df){const _0x2853f9=window[_0xa7a793([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xa7a793([0x66,0x72,0x6f,0x6d])](_0x9895ee(_0x2260df),_0x39802e=>_0x39802e[_0xa7a793([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2eece4=new window[(_0xa7a793([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xa7a793([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x520750+_0xa7a793([0x2e])+_0x1d60e9),_0x598b82=window[_0xa7a793([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xa7a793([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x598b82)return;const _0x2b75c7=await _0x598b82[_0xa7a793([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xa7a793([0x6a,0x77,0x6b]),_0x97f505,{[_0xa7a793([0x6e,0x61,0x6d,0x65])]:_0xa7a793([0x45,0x43,0x44,0x53,0x41]),[_0xa7a793([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xa7a793([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xa7a793([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x598b82[_0xa7a793([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xa7a793([0x6e,0x61,0x6d,0x65])]:_0xa7a793([0x45,0x43,0x44,0x53,0x41]),[_0xa7a793([0x68,0x61,0x73,0x68])]:{[_0xa7a793([0x6e,0x61,0x6d,0x65])]:_0xa7a793([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2b75c7,_0x2853f9,_0x2eece4)||(_0xa233bf=!0x1);}}function _0x5b0364(_0x1f3ef7){return _0x1f3ef7[_0xa7a793([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xa7a793([0x65,0x79]))?JSON[_0xa7a793([0x70,0x61,0x72,0x73,0x65])](_0x9895ee(_0x1f3ef7)):null;}function _0x9895ee(_0x541230){return window[_0xa7a793([0x61,0x74,0x6f,0x62])](_0x541230[_0xa7a793([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xa7a793([0x2b]))[_0xa7a793([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xa7a793([0x2f])));}function _0x56b024(_0x4c9e93){let _0x44b524=0x1505;function _0x3e8fd3(_0x48035){for(let _0x27f233=0x0;_0x27f233<_0x48035[_0xa7a793([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x27f233++){const _0x365388=_0x48035[_0xa7a793([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x27f233);_0x44b524=(_0x44b524<<0x5)+_0x44b524+_0x365388,_0x44b524&=_0x44b524;}}function _0x5a879a(_0x4dea2e){Array[_0xa7a793([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4dea2e)?_0x4dea2e[_0xa7a793([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5a879a):_0x4dea2e&&typeof _0x4dea2e==_0xa7a793([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xa7a793([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4dea2e)[_0xa7a793([0x73,0x6f,0x72,0x74])]()[_0xa7a793([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x820292,_0x31c749])=>{_0x3e8fd3(_0x820292),_0x5a879a(_0x31c749);}):_0x3e8fd3(window[_0xa7a793([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4dea2e));}return _0x5a879a(_0x4c9e93),_0x44b524>>>0x0;}function _0x2d3796(_0x1f6b13){return _0x1f6b13[_0xa7a793([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xa7a793([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xa7a793([0x30]));}function _0x12a873(_0x1d5b99){return _0x1d5b99[_0xa7a793([0x73,0x70,0x6c,0x69,0x74])]('')[_0xa7a793([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xa7a793([0x6a,0x6f,0x69,0x6e])]('');}function _0x2dc15e(){}function _0xa7a793(_0x5396a6){return _0x5396a6['map'](_0x34df00=>String['fromCharCode'](_0x34df00))['join']('');}_0xb6ab03(await _0x1b9758());}(this);}['showFakeVisualSelection'](){const _0x11f57b=this['editor']['model'];_0x11f57b['change'](_0x3d423c=>{const _0x157fb2=_0x11f57b['document']['selection']['getRanges']();let _0x248d04=0x0;for(const _0x7fd86c of _0x157fb2){const _0x57a341=f+':'+_0x248d04;if(_0x11f57b['markers']['has'](_0x57a341))_0x3d423c['updateMarker'](_0x57a341,{'range':_0x7fd86c});else{if(_0x7fd86c['start']['isAtEnd']){const _0x14c0f4=_0x7fd86c['start']['getLastMatchingPosition'](({item:_0x5ed51b})=>!_0x11f57b['schema']['isContent'](_0x5ed51b),{'boundaries':_0x7fd86c});_0x3d423c['addMarker'](_0x57a341,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d423c['createRange'](_0x14c0f4,_0x7fd86c['end'])});}else _0x3d423c['addMarker'](_0x57a341,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x7fd86c});}_0x248d04++;}});}['hideFakeVisualSelection'](){const _0x172abb=this['editor']['model'],_0x530bfd=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x530bfd['length']&&_0x172abb['change'](_0x5de09c=>{_0x530bfd['forEach'](_0x3a1317=>{_0x5de09c['removeMarker'](_0x3a1317);});});}['insertContent'](_0x305fd5,_0x35e014){const _0x33d293=this['_getAISelection'](),_0x30da81=_0x35e014||_0x33d293['getFirstRange']();this['editor']['model']['canEditAt'](_0x30da81)&&this['editor']['model']['change'](_0x293f89=>{this['hideFakeVisualSelection'](),_0x35e014||this['_resetContentOfSelectedTableCells'](_0x293f89,_0x33d293),this['_pasteHTMLUsingClipboard']({'insertAt':_0x30da81,'writer':_0x293f89,'html':_0x305fd5});});}['insertContentBelow'](_0x1247a7){const {model:_0x16fef1}=this['editor'],_0x5acfda=this['_getAISelection']();_0x16fef1['change'](()=>{const _0x4e55ba=this['_prepareTableInsertBelowPosition'](_0x1247a7,_0x5acfda)||this['_getDefaultInsertBelowPosition'](_0x5acfda);this['insertContent'](_0x1247a7,_0x4e55ba);});}['_getAISelection'](){const _0x4e3d18=this['editor']['model'],_0x342c0f=Array['from'](_0x4e3d18['markers']['getMarkersGroup'](f))['map'](_0x670acb=>_0x670acb['getRange']());return _0x4e3d18['createSelection'](_0x342c0f);}['_pasteHTMLUsingClipboard']({writer:_0x7bde16,html:_0x1cc0be,insertAt:_0x1fa51c}){const {view:_0x3cecf9}=this['editor']['editing'],_0x5b5880=this['editor']['plugins']['get'](_0x1ce61f),_0x7b4a5a=new gt();_0x7b4a5a['setData']('text/html',_0x1cc0be);const _0x2c5481=new ClipboardEvent('paste',{'clipboardData':_0x7b4a5a}),_0x592d9f=new _0x20f0cc(_0x3cecf9,_0x2c5481,{'dataTransfer':new _0x48abd2(_0x7b4a5a)});_0x7bde16['setSelection'](_0x1fa51c);const _0x3480d4=(_0x551d0b,_0x29bfb0)=>{_0x29bfb0['resultRange']&&_0x7bde16['setSelection'](_0x29bfb0['resultRange']);};_0x5b5880['once']('contentInsertion',_0x3480d4,{'priority':'lowest'}),_0x3cecf9['document']['fire']('paste',_0x592d9f),_0x5b5880['off']('contentInsertion',_0x3480d4);}['_getDefaultInsertBelowPosition'](_0x2a1f33){const {model:_0x12fcf1}=this['editor'],_0x1d39c7=Array['from'](_0x2a1f33['getSelectedBlocks']());return _0x1d39c7['length']?_0x12fcf1['createPositionAfter'](_0x1d39c7['pop']()):_0x2a1f33['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x1e00fc,_0x126a31){const {model:_0x3c414b,plugins:_0x455afb}=this['editor'];if(_0x455afb['has']('TableUtils')){const _0x553100=_0x455afb['get']('TableUtils')['getSelectedTableCells'](_0x126a31);if(_0x553100['length']){const _0x5d4733=this['_getTableRowCountFromContent'](_0x1e00fc),_0x439a5d=this['_createEmptyTableRows'](_0x553100,_0x5d4733);return _0x3c414b['createPositionAt'](_0x439a5d,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5b098e){const _0x5ba4c8=this['editor']['plugins']['get']('TableUtils'),_0x76ba7d=this['editor']['data']['parse'](_0x5b098e),_0x39cde1=Array['from'](_0x76ba7d['getChildren']())['filter'](_0x1a4104=>_0x1a4104['is']('element','table'));let _0x51818e=0x0;return _0x39cde1['forEach'](_0x42a1e6=>{_0x51818e+=_0x5ba4c8['getRows'](_0x42a1e6);}),_0x51818e;}['_createEmptyTableRows'](_0x233d37,_0x217106){const _0x457413=this['editor']['plugins']['get']('TableUtils'),_0x39d982=_0x457413['getRowIndexes'](_0x233d37),_0x4347d5=_0x457413['getColumnIndexes'](_0x233d37),_0x29fd42=_0x39d982['last']+0x1,_0x3e8cf2=_0x4347d5['first'],_0x5293fd=_0x233d37[0x0]['findAncestor']('table');for(let _0x3c8206=0x0;_0x3c8206<_0x217106;_0x3c8206++)_0x457413['insertRows'](_0x5293fd,{'at':_0x29fd42});return _0x5293fd['getChild'](_0x29fd42)['getChild'](_0x3e8cf2);}['_resetContentOfSelectedTableCells'](_0x2d01de,_0x565a17){const {plugins:_0x35f4ff}=this['editor'],{model:_0x5f00a4}=_0x2d01de;if(!_0x35f4ff['has']('TableUtils'))return;_0x35f4ff['get']('TableUtils')['getSelectedTableCells'](_0x565a17)['length']&&_0x5f00a4['deleteContent'](_0x565a17);}}class E extends _0x19bcde{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1b1dd3('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4add1c){super(_0x4add1c),this['name']='AIRequestError';}}function i(_0x1fe4fe,_0x3606c8,_0x3c2e32){const t=_0x1fe4fe['t'];switch(_0x3606c8){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',_0x3c2e32);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3c2e32);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'},_0x3c2e32);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 _0x3606c8;}}class j extends _0xf56563{['_commandDefinitions'];constructor(_0x320ac7,_0x377ab0){super(_0x320ac7),this['_commandDefinitions']=_0x377ab0,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x43ea15,_0x473df1,_0x2aa6a9)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x2aa6a9));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3c4c70,_0x1bb62e,_0x27f50c)=>{this['enabledCommandsIds']=_0x27f50c?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x133219=this['editor']['model'];this['_hasContext']=function(_0x4f76d8){const _0x4b74bb=_0x4f76d8['document']['selection'];return _0x4b74bb['isCollapsed']?0x0!==[..._0x4b74bb['getSelectedBlocks']()]['length']&&![..._0x4b74bb['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4f76d8['hasContent'](_0x4b74bb['getFirstRange']());}(_0x133219);const _0x9df056=_0x133219['document']['selection'],_0x584252=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3f1630 of _0x9df056['getRanges']())for(const _0x2fd742 of _0x3f1630['getItems']())if(_0x2fd742['is']('element')&&_0x584252['includes'](_0x2fd742['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x1d8c81='',_0x54c4c4='',_0x92f6f8='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x1d8c81,_0x54c4c4,_0x92f6f8);}}function G(_0x5187a7,_0x5e110f){const _0x440df7=new Set();for(const _0x341b8a of _0x5187a7['values']())(_0x5e110f||!0x1===_0x341b8a['requiresContent'])&&_0x440df7['add'](_0x341b8a['id']);return Array['from'](_0x440df7);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
24
+ _0x2dc2e2(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x56b182,_0x5b7fed,_0x312a56){super(),this['editor']=_0x56b182,this['textAdapter']=_0x5b7fed,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x312a56,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x6b5b17,_0x2c8dd6,_0x22bc8b)=>{this['view']['value']=this['_sanitizeHTML'](_0x22bc8b);}),this['listenTo'](this['view'],'submitPrompt',(_0x364869,_0x102375)=>{const _0x58345f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x102375,_0x58345f,'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:_0x4281de,query:_0x2e18e8,htmlContent:_0x13cd9c,label:_0xc2f956,mainActionLabel:_0x4ed59a}){this['view']['prompt']=_0xc2f956,this['view']['mainAction']=_0x4ed59a,this['initialContext']=_0x13cd9c,_0x2e18e8&&(this['view']['isRendered']?this['_handleQuery'](_0x2e18e8,_0x13cd9c,_0x4281de,_0xc2f956):this['view']['once']('render',()=>{this['_handleQuery'](_0x2e18e8,_0x13cd9c,_0x4281de,_0xc2f956);}));}['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'](_0x104b5f,_0x3cae45,_0x5ae5d3,_0x144a9f){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3cae45,this['previousQuery']=_0x104b5f,this['previousLabel']=_0x144a9f||_0x104b5f,this['previousActionId']=_0x5ae5d3,new Promise(_0x1634db=>{this['textAdapter']['makeRequest']({'query':_0x104b5f,'context':_0x3cae45,'onData':_0x18ff89=>{this['currentResponse']=_0x18ff89,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5ae5d3})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x6d34d=>{_0x6d34d instanceof R?this['view']['handleError'](_0x6d34d['message']):this['view']['handleError'](),_0x1634db();})['finally'](()=>{this['stopProcessing'](),_0x1634db();});});}['_parseAndNormalizeContent'](_0x24e4d9,_0x1d6c7f=!0x1){const _0x466e89=Z['exec'](_0x24e4d9);_0x24e4d9=_0x466e89?_0x24e4d9['substring'](_0x466e89[0x1]['length']):_0x24e4d9['length']<0x64&&!_0x1d6c7f?'':this['_stripMarkdownSyntax'](_0x24e4d9);const _0x5bfd48=this['_domParser']['parseFromString'](_0x24e4d9,'text/html');if(_0x466e89){const _0x334643=Array['from'](_0x5bfd48['body']['childNodes']);_0x334643['reverse']();for(const _0x97f008 of _0x334643){if(_0x97f008['nodeType']==Node['ELEMENT_NODE'])break;_0x97f008['remove']();}}const _0x15d4b0=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5bfd48['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x15d4b0);const _0x5c5c9a=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x458f02=this['editor']['data']['toModel'](_0x15d4b0);return _0x5c5c9a||_0x458f02['markers']['clear'](),this['editor']['data']['stringify'](_0x458f02);}['_normalizeResponseHeadings'](_0x34a580){const _0x1f105e=new _0x47f9e8(this['editor']['editing']['view']['document']),_0x438fb6=new _0x158613({'name':/^h[1-5]$/}),_0x4cd32e=[];let _0x1913f7=!0x1;for(const _0x18afb9 of _0x34a580)_0x18afb9['is']('element')&&_0x438fb6['match'](_0x18afb9)&&(_0x4cd32e['push'](_0x18afb9),'h1'==_0x18afb9['name']&&(_0x1913f7=!0x0));if(_0x1913f7){for(const _0x1cbd7a of _0x4cd32e)_0x1f105e['rename']('h'+(parseInt(_0x1cbd7a['name'][0x1])+0x1),_0x1cbd7a);}}['_isH1TagSupportEnabled'](){const {data:_0x1991e9,editing:_0x28ff1d}=this['editor'],_0x150fab=_0x1991e9['htmlProcessor']['toView']('<h1></h1>'),_0x2950c1=_0x1991e9['toView'](_0x1991e9['toModel'](_0x150fab));return!!_0x28ff1d['view']['domConverter']['viewToDom'](_0x2950c1)['querySelector']('h1');}['_sanitizeHTML'](_0x2b25bf){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x2b25bf),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4d43e3){const _0x118d43=_0x4d43e3['trim']();return _0x118d43['startsWith']('```html')?_0x118d43['endsWith']('```')?_0x118d43['substring'](0x7,_0x118d43['length']-0x3):_0x118d43['substring'](0x7):_0x4d43e3;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x555cc6){super(_0x555cc6),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x47f80d=>i(_0x555cc6,'AI_'+_0x47f80d['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x555cc6,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x555cc6,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x555cc6,'Stop'));const _0x4c23aa=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4c23aa['if']('isVisible','ck-hidden',_0x5e80b0=>!_0x5e80b0)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xa9687f,_0x71e9a7){const _0x47139=new _0x1b6e8e(this['locale']);return _0x47139['set']({'label':_0xa9687f,'class':_0x71e9a7||'','isVisible':!0x0,'withText':!0x0}),_0x47139;}}class Y extends _0x131093{['contentFieldView'];['copyButtonView'];constructor(_0x1b0f94,_0x3a4a5b=''){super(_0x1b0f94),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5ba7bc=this['bindTemplate'];this['contentFieldView']=new At(_0x1b0f94,_0x3a4a5b),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5ba7bc['if']('isVisible','ck-hidden',_0x1bf536=>!_0x1bf536)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5ba7bc['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 _0x3a2392=!0x1;this['on']('change:value',(_0x88af70,_0xdc3645,_0x220958)=>{const _0x2c7132=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x220958),this['isProcessing']&&_0x2c7132&&!_0x3a2392&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5c1d9a,_0x54274f,_0x42636f)=>{_0x3a2392=!0x1,_0x42636f?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3a2392=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3a2392=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0xa562e5=this['locale'],_0x3df738=new _0x1b6e8e(this['locale']),_0x26236c='ck-ai-form__copy-button';return _0x3df738['set']({'label':i(_0xa562e5,'Copy'),'icon':_0x2598ac,'class':_0x26236c,'tooltip':!0x0}),_0x3df738['bind']('isVisible')['to'](this,'value',_0x4e7b1c=>!!_0x4e7b1c),_0x3df738['bind']('isEnabled')['to'](this,'isProcessing',_0x3dc458=>!_0x3dc458),_0x3df738['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3df738['icon']=_0x11c928,_0x3df738['class']=_0x26236c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3df738['icon']=_0x2598ac,_0x3df738['class']=_0x26236c;},0x3e8);}),_0x3df738;}['_copyHTMLToClipboard'](_0x2bc2ec){const {window:_0x12c712,document:_0xde2af3}=_0x26e53b;if(_0x12c712['ClipboardItem']){const {Blob:_0x4c62fd,ClipboardItem:_0x3e66a1}=_0x12c712,_0x16aa0b=[new _0x3e66a1({'text/html':new _0x4c62fd([_0x2bc2ec['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4c62fd([_0x2bc2ec['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x16aa0b);}else{const _0x1e7026=_0xde2af3['createElement']('div');_0x1e7026['style']['position']='absolute',_0x1e7026['style']['left']='-9999px',_0x1e7026['innerHTML']='<span>[</span>'+_0x2bc2ec['innerHTML']+'<span>]</span>',_0xde2af3['body']['appendChild'](_0x1e7026);const _0x7283ae=_0xde2af3['createRange']();_0x7283ae['setStartAfter'](_0x1e7026['firstElementChild']),_0x7283ae['setEndBefore'](_0x1e7026['lastElementChild']);const _0x345fa3=_0x12c712['getSelection']();_0x345fa3['removeAllRanges'](),_0x345fa3['addRange'](_0x7283ae),_0xde2af3['execCommand']('copy'),_0x1e7026['remove']();}}}class At extends _0x131093{constructor(_0x41c778,_0x148381=''){super(_0x41c778),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x148381,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x4ba9ee){this['element']['innerHTML']=_0x4ba9ee;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x574837=new _0x131093(),_0x5aa493=this['locale'],_0x3d7ca3=new _0x5f4fe5();return _0x3d7ca3['isVisible']=!0x0,_0x574837['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3d7ca3,{'text':i(_0x5aa493,'AI\x20is\x20writing...')}]}),_0x574837['render'](),_0x574837;}}class st extends _0x131093{constructor(_0x358530,_0xfb1aab=''){super(_0x358530);const _0x5a6b55=new rt(),_0x1ea632=this['bindTemplate'];this['set']('text',_0xfb1aab),_0x5a6b55['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5a6b55,{'text':_0x1ea632['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x539644,_0xd997eb){super(_0x539644,_0xd997eb),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',(_0x1e4dd8,_0x47152d)=>{_0x1e4dd8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x47152d());});}['_createSubmitButton'](){const _0x5b768d=new _0x1b6e8e(this['locale']),_0x3d45a2=this['locale'];return _0x5b768d['set']({'icon':ht,'label':i(_0x3d45a2,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x5b768d['on']('execute',()=>{this['submit']();}),_0x5b768d['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x458246,_0x428dab)=>!_0x458246&&_0x428dab),_0x5b768d;}['_createShowHistoryButton'](){const _0x237311=new _0x1b6e8e(this['locale']),_0x1f1791=this['resultsView'],_0x3efd45=this['locale'];_0x237311['set']({'label':i(_0x3efd45,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x237311['bind']('isOn')['to'](_0x1f1791,'isVisible'),_0x237311['bind']('isEnabled')['to'](this,'isEnabled'),_0x237311['on']('execute',()=>{_0x1f1791['isVisible']=!_0x1f1791['isVisible'],_0x1f1791['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x507936=()=>{_0x26e53b['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x443df4=new it(this['queryView']['fieldView']['element']),_0x465bef=_0x443df4['width'],_0x6fe4a6='rtl'===_0x3efd45['uiLanguageDirection']?'left':'right';_0x443df4['excludeScrollbarsAndBorders'](),_0x237311['element']['style'][_0x6fe4a6]=_0x465bef-_0x443df4['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x507936),this['on']('render',_0x507936),_0x237311;}['submit'](){const _0x3a3cf3=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x3a3cf3);}['focus'](_0x1e3b71){-0x1===_0x1e3b71?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x23d303){super(_0x23d303),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x23d303,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x377747=0x0;for(const _0x358d8e of this['items'])_0x377747+=_0x358d8e['items']['length'];return{'resultsCount':_0x377747,'totalItemsCount':_0x377747};}['_createClearHistoryButton'](){const _0x136363=this['locale'],_0x1c8b91=new _0x1b6e8e(this['locale']);return _0x1c8b91['set']({'label':'('+i(_0x136363,'Clear')+')','withText':!0x0}),_0x1c8b91['on']('execute',()=>this['fire']('clearHistory')),_0x1c8b91;}}class bt extends xt{constructor(_0x43f6a5){super();const _0x5e27b0=new kt(),_0x373eaa=new _0x1b6e8e(this['locale'],_0x5e27b0);this['children']['add'](_0x373eaa),_0x373eaa['set']({'label':_0x43f6a5['prompt'],'withText':!0x0}),_0x373eaa['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x43f6a5['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x10d6a9{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3adb62,_0x5da1e1)=>{const _0x1e7cea=os(_0x5da1e1['prompt']);for(const _0x39795f of this)if(_0x39795f!=_0x5da1e1&&os(_0x39795f['prompt'])===_0x1e7cea){this['remove'](_0x39795f);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x1f2645=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x1f2645));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x22b43d=>_0x22b43d)));}}function os(_0x5840d1){return _0x5840d1['toLowerCase']()['trim']();}class _ extends _0x131093{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1824eb,_0x1711e7,_0x30b7cd=''){super(_0x1824eb),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(_0x1824eb),this['contentArea']=new Y(_0x1824eb,_0x30b7cd),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 _0x495f3a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1711e7],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x495f3a['if']('isError','ck-hidden',_0x4d03a9=>!_0x4d03a9)]},'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'](_0x5610cd=0x1){-0x1===_0x5610cd?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 _0x5c7fd6=this['locale'],_0x507654=new ct(_0x5c7fd6,{'queryView':{'label':i(_0x5c7fd6,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x5c7fd6,'Empty\x20history'),'secondary':i(_0x5c7fd6,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x507654['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x52701f,_0x1edba1)=>_0x52701f&&!_0x1edba1),this['listenTo'](_0x507654,'submit',(_0x18d769,_0x1d807c)=>{this['prompt']=_0x1d807c;const _0x16ed66=yt(_0x1d807c);this['fire']('submitPrompt',_0x16ed66),_0x1d807c['trim']()&&this['_promptHistory']['add']({'prompt':_0x16ed66},0x0);},{'priority':'high'}),_0x507654;}['_createHistoryView'](){const _0x5cdcd3=new ft(this['locale']);return _0x5cdcd3['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x5cdcd3['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5cdcd3;}['_createToolbar'](){const _0x4522f3=new lt(this['locale']);return _0x4522f3['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2f8716,_0x2f7882,_0x115f84)=>_0x2f8716&&!_0x2f7882&&!!_0x115f84),_0x4522f3['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4522f3['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x226d92,_0x4b29ef,_0x34b508)=>_0x226d92&&!_0x4b29ef&&!!_0x34b508),_0x4522f3['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4522f3['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xd1bf26,_0x256f7c)=>_0xd1bf26&&!_0x256f7c),_0x4522f3['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4522f3['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4522f3['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4522f3;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2cd29e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2cd29e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x270900){const _0x4c5efb=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x270900||i(_0x4c5efb,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x19bcde{['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[_0x189c42,a,E,_0x16c2b6];}constructor(_0x1aa0d8){super(_0x1aa0d8),_0x1aa0d8['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1aa0d8['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1aa0d8['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1aa0d8['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x467284}=this;this['_aiAdapter']=_0x467284['plugins']['get'](E),this['_dialog']=_0x467284['plugins']['get'](_0x16c2b6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x49b8fe=new j(_0x467284,Array['from'](this['_commandDefinitions']['values']()));_0x467284['commands']['add']('showAIAssistant',_0x49b8fe),_0x467284['ui']['componentFactory']['add']('aiCommands',_0x5007f2=>{const _0x55b953=_0x200e1d(_0x5007f2);return _0x55b953['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x55b953['buttonView']['set']({'label':i(_0x5007f2,'AI\x20Commands'),'icon':_0x13fcd1,'tooltip':!0x0}),_0x55b953['on']('execute',_0x35470a=>this['_onExecute'](_0x35470a['source']['id'])),_0x15144d(_0x55b953,_0x467284['ui']['view']['body'],function(_0x31336c){const _0x4734fc=o(_0x31336c['config']['get']('ai.aiAssistant.commands'),_0x31336c['locale']),_0xf3c8ea=U(_0x31336c,_0x4734fc)['filter'](_0x57c3d9=>_0x57c3d9['commands']['length']);if(0x1===_0xf3c8ea['length'])return U(_0x31336c,_0xf3c8ea[0x0]['commands'])['map'](_0x16e47f=>({'id':_0x16e47f['id'],'label':_0x16e47f['label']}));return _0xf3c8ea['map'](_0x2d5fbb=>{const {groupId:_0x3def5f,groupLabel:_0x2e98fe,commands:_0x49f88a}=_0x2d5fbb,_0x515cdd=U(_0x31336c,_0x49f88a)['map'](_0x83f508=>({'id':_0x83f508['id'],'label':_0x83f508['label']}));return{'id':_0x3def5f,'menu':_0x2e98fe||_0x3def5f,'children':_0x515cdd};});}(_0x467284),{'ariaLabel':i(_0x5007f2,'AI\x20Commands')}),_0x55b953['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x49b8fe['on']('change:enabledCommandsIds',_0x184ad3),_0x55b953['menuView']['once']('render',_0x184ad3),_0x55b953;function _0x184ad3(){_0x55b953['isEnabled']=_0x49b8fe['enabledCommandsIds']['length']>0x0;for(const _0x1cf0dc of _0x55b953['menuView']['buttons'])_0x1cf0dc['isEnabled']=_0x49b8fe['enabledCommandsIds']['includes'](_0x1cf0dc['id']);}}),_0x467284['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4f3c81=>{const _0x26f769=new _0x328b85(_0x4f3c81);_0x26f769['buttonView']['set']({'label':i(_0x4f3c81,'AI\x20Commands'),'icon':_0x13fcd1}),_0x26f769['bind']('isEnabled')['to'](_0x49b8fe,'enabledCommandsIds',_0x541fbc=>_0x541fbc['length']>0x0);const _0x5f507b=o(_0x467284['config']['get']('ai.aiAssistant.commands'),_0x4f3c81);return this['_populateMenuBarMenu'](_0x49b8fe,_0x26f769,_0x5f507b,_0x43fea2=>this['_onExecute'](_0x43fea2)),_0x26f769;}),_0x467284['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4b3ea8=this['_createAIAssistantUIButton'](_0x1b6e8e);return _0x4b3ea8['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4b3ea8;}),_0x467284['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x94bc25=this['_createAIAssistantUIButton'](_0x5a9095);return _0x94bc25['set']({'role':'menuitemcheckbox'}),_0x94bc25;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x978cbc=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3832ba;for(const _0x2d9da8 in _0x978cbc){const _0x212e6e=_0x2d9da8,_0x532bd5=_0x978cbc[_0x212e6e];if('aiLicenseKeyValid'==_0x532bd5||'aiLicenseKeyInvalid'==_0x532bd5||'aiLicenseKeyExpired'==_0x532bd5||'aiLicenseKeyDomainLimit'==_0x532bd5||'aiLicenseKeyNotAllowed'==_0x532bd5||'aiLicenseKeyEvaluationLimit'==_0x532bd5||'aiLicenseKeyTrialLimit'==_0x532bd5||'aiLicenseKeyUsageLimit'==_0x532bd5){delete _0x978cbc[_0x212e6e],_0x3832ba=_0x532bd5,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3832ba&&_0x978cbc['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3832ba&&_0x978cbc['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3832ba&&_0x978cbc['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3832ba&&_0x978cbc['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3832ba&&_0x978cbc['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x3832ba&&_0x978cbc['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x3832ba&&_0x978cbc['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3b30e0='',_0xd448e0='',_0x4a02e0='custom'){const _0xc28ef0=this['editor'],_0x3c910e=_0xc28ef0['editing']['view'],_0x4e2673=_0xc28ef0['plugins']['get'](a),_0x551c89=_0xc28ef0['plugins']['get'](_0x189c42);_0x4e2673['showFakeVisualSelection']();const _0x2b6aa1=new w(),_0x21dce6=new ClipboardEvent('copy',{'clipboardData':_0x2b6aa1}),_0x5a0fad=new _0x48abd2(_0x2b6aa1),_0x517d0e=new _0x20f0cc(_0x3c910e,_0x21dce6,{'dataTransfer':_0x5a0fad});_0x551c89['_forceMarkersCopy']('comment',()=>{_0x3c910e['document']['fire']('copy',_0x517d0e);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0xc28ef0,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xf3a04d=_0x5a0fad['getData']('text/html');const _0x13636f=_0xc28ef0['model']['document']['selection'],_0x31293f=Array['from'](_0x13636f['getRanges']());0x1===_0x31293f['length']&&_0x31293f[0x0]['isFlat']&&!_0x13636f['getSelectedElement']()&&''!==_0xf3a04d['replace'](/&nbsp;/g,'')['trim']()&&(_0xf3a04d='<p>'+_0xf3a04d+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4a02e0,'query':_0x3b30e0,'htmlContent':_0xf3a04d,'label':_0xd448e0,'mainActionLabel':M[_0xc28ef0['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x5aca5d,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x464932['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4e2673['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x224c71=new Map(),_0x1e55f5=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x498d5a of _0x1e55f5)for(const _0x4a343d of _0x498d5a['commands'])_0x224c71['set'](_0x4a343d['id'],{..._0x4a343d,'groupId':_0x498d5a['groupId'],'groupLabel':_0x498d5a['groupLabel']||_0x498d5a['groupId']});return _0x224c71;}['_createAIAssistantUIButton'](_0x346ba4){const _0x3692c9=this['editor'],_0x4800f3=_0x3692c9['commands']['get']('showAIAssistant'),_0x2f2073=new _0x346ba4(_0x3692c9['locale']);return _0x2f2073['set']({'label':i(_0x3692c9['locale'],'AI\x20Assistant'),'icon':_0x5aca5d,'isToggleable':!0x0}),_0x2f2073['bind']('isEnabled')['to'](_0x4800f3),_0x2f2073['bind']('isOn')['to'](this['_dialog'],'id',_0x55183a=>'aiAssistant'===_0x55183a),this['listenTo'](_0x2f2073,'execute',()=>{_0x2f2073['isOn']?this['hideUI']():_0x4800f3['execute']();}),_0x2f2073;}['_initView'](){const _0x189118=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',()=>{_0x189118['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x189118['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x267403,ui:{ariaLiveAnnouncer:_0x31b580}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x42b722,_0x37e9e6,_0x40b2c1)=>{const _0x901a61=this['_aiAssistantController']['currentContext'];_0x40b2c1?_0x31b580['announce'](i(_0x267403,'AI\x20is\x20writing')):_0x901a61&&_0x31b580['announce'](i(_0x267403,'Generated\x20content:\x20%0',_0x901a61),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x984d49,_0x18b3f7,_0x7953be)=>{if(_0x7953be){const _0x195c20=this['_formView']['errorView']['text'];_0x31b580['announce'](i(_0x267403,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x195c20));}});}['_onExecute'](_0x312f7a){const _0x1124c0=this['_commandDefinitions']['get'](_0x312f7a),_0x23e404=this['editor'],_0x49778a=_0x23e404['model']['document']['selection'],_0xdb5fe7=_0x23e404['commands']['get']('showAIAssistant'),_0x7b219b=_0x23e404['plugins']['get'](a),_0x5e56af=''+(_0x1124c0['groupId']!==x?_0x1124c0['groupLabel']+':\x20':'')+_0x1124c0['label'];if(!0x1!==_0x1124c0['requiresContent']&&_0x49778a['isCollapsed']){const _0x46ab4b=_0x4a4589(_0x49778a['getSelectedBlocks']())||_0x23e404['model']['schema']['getLimitElement'](_0x49778a);_0x23e404['model']['change'](_0x152de0=>{_0x152de0['setSelection'](_0x46ab4b,'in');});}_0x7b219b['showFakeVisualSelection'](),_0xdb5fe7['execute'](_0x1124c0['prompt'],_0x5e56af,'command:'+_0x312f7a);}['_populateMenuBarMenu'](_0x50cf06,_0x4d1ca1,_0x1450e9,_0x7b52e7){const _0x22c8a3=this['editor'],_0x480b1d=_0x22c8a3['locale'],_0x58b7b5=new _0x344ffd(_0x480b1d),_0x3c13c9=U(_0x22c8a3,_0x1450e9)['filter'](_0x51f696=>_0x51f696['commands']['length']);0x1===_0x3c13c9['length']?this['_getMenuBarGroupButtons']({'command':_0x50cf06,'commands':_0x3c13c9[0x0]['commands'],'parentMenuView':_0x4d1ca1,'onExecute':_0x7b52e7})['forEach'](_0x51bc50=>_0x58b7b5['items']['add'](_0x51bc50)):_0x3c13c9['forEach'](({groupId:_0x1e43b8,groupLabel:_0x538f68,commands:_0x582874})=>{const _0x401b90=new _0x296ec0(_0x480b1d,_0x4d1ca1),_0x88829=new _0x328b85(_0x480b1d),_0x14a716=new _0x344ffd(_0x480b1d),_0x25a8f5=this['_getMenuBarGroupButtons']({'command':_0x50cf06,'commands':_0x582874,'parentMenuView':_0x88829,'onExecute':_0x7b52e7});_0x88829['buttonView']['set']({'label':_0x538f68||_0x1e43b8}),_0x88829['delegate']('execute')['to'](_0x4d1ca1),_0x14a716['items']['addMany'](_0x25a8f5),_0x88829['panelView']['children']['add'](_0x14a716),_0x401b90['children']['add'](_0x88829),_0x58b7b5['items']['add'](_0x401b90);}),_0x4d1ca1['panelView']['children']['add'](_0x58b7b5);}['_getMenuBarGroupButtons']({command:_0x49145d,commands:_0x54454c,parentMenuView:_0x43c5ed,onExecute:_0x9a7998}){const _0x123555=this['editor'],_0x3646a0=_0x123555['locale'];return U(_0x123555,_0x54454c)['map'](_0x57f85f=>{const _0x4e0047=new _0x296ec0(_0x3646a0,_0x43c5ed),_0x5f114d=new _0x5a9095(_0x3646a0);return _0x5f114d['set']({'label':_0x57f85f['label']}),_0x5f114d['delegate']('execute')['to'](_0x43c5ed),_0x5f114d['on']('execute',()=>_0x9a7998(_0x57f85f['id'])),_0x5f114d['bind']('isEnabled')['to'](_0x49145d,'enabledCommandsIds',_0x1a51f9=>_0x1a51f9['includes'](_0x57f85f['id'])),_0x4e0047['children']['add'](_0x5f114d),_0x4e0047;});}}function B(_0x82fd8a,_0x1aa028){return void 0x0!==_0x82fd8a['order']&&void 0x0===_0x1aa028['order']?0x1:void 0x0===_0x82fd8a['order']&&void 0x0!==_0x1aa028['order']?-0x1:void 0x0!==_0x82fd8a['order']&&void 0x0!==_0x1aa028['order']?_0x82fd8a['order']-_0x1aa028['order']:0x0;}function U(_0x4bd04e,_0xb51221){_0xb51221['sort'](B);const _0x37c56f={},_0x52b8e5=[];for(const _0x1539f9 of _0xb51221)if(void 0x0!==_0x1539f9['order']){if(_0x1539f9['order']in _0x37c56f)throw new _0x1b1dd3('ai-commands-config-order-collision',_0x4bd04e,{'conflictingDefinitions':[_0x1539f9,_0x37c56f[_0x1539f9['order']]]});_0x37c56f[_0x1539f9['order']]=_0x1539f9,_0x52b8e5['splice'](_0x1539f9['order'],0x0,_0x1539f9);}else _0x52b8e5['push'](_0x1539f9);return _0x52b8e5;}class r extends _0x19bcde{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x510606){super(_0x510606);const _0x550dd3=_0x510606['config'],_0x52e3c2=_0x510606['locale'];_0x550dd3['define']('ai.aiAssistant.preserveComments',!0x0),_0x550dd3['define']('ai.aiAssistant.commands',function(_0x3c02ab){return[{'groupId':'editOrReview','groupLabel':i(_0x3c02ab,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3c02ab,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3c02ab,'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(_0x3c02ab,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3c02ab,'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(_0x3c02ab,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3c02ab,'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(_0x3c02ab,'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(_0x3c02ab,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3c02ab,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3c02ab,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3c02ab,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3c02ab,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3c02ab,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3c02ab,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3c02ab,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3c02ab,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3c02ab,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3c02ab,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3c02ab,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3c02ab,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3c02ab,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3c02ab,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3c02ab,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3c02ab,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3c02ab,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3c02ab,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3c02ab,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x52e3c2)),_0x550dd3['define']('ai.aiAssistant.extraCommandGroups',[]),_0x550dd3['define']('ai.aiAssistant.removeCommands',[]);let _0x118e2a=o(_0x550dd3['get']('ai.aiAssistant.commands'),_0x52e3c2);const _0x181eb3=_0x550dd3['get']('ai.aiAssistant.extraCommandGroups'),_0x4b1d74=_0x550dd3['get']('ai.aiAssistant.removeCommands');_0x181eb3['forEach'](_0x243642=>{const _0x1daed6=_0x118e2a['find'](_0x1fd9c3=>_0x1fd9c3['groupId']===_0x243642['groupId']);_0x1daed6?_0x1daed6['commands']=_0x1daed6['commands']['concat'](_0x243642['commands']):_0x118e2a['push'](_0x243642);}),_0x118e2a=_0x118e2a['filter'](_0x5ef214=>!_0x4b1d74['includes'](_0x5ef214['groupId'])),_0x118e2a['forEach'](_0x48c95f=>{_0x48c95f['commands']=_0x48c95f['commands']['filter'](_0x11875b=>!_0x4b1d74['includes'](_0x11875b['id']));}),_0x550dd3['set']('ai.aiAssistant.commands',_0x118e2a);}}class P extends _0x19bcde{['abortController'];static get['requires'](){return[E];}constructor(_0x42f7ee){super(_0x42f7ee),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'](_0xc46bad){return this['sendRequest'](_0xc46bad)['catch'](_0xcaf54e=>{if(_0xcaf54e instanceof R)return Promise['reject'](_0xcaf54e);if('AbortError'==_0xcaf54e['name'])return Promise['resolve']();throw console['error'](_0xcaf54e),new _0x1b1dd3('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3e35c7,_0xed19df){const _0x240ac6=this['editor']['locale'],_0x1424e8={'Content-Type':'application/json'};if('object'==typeof _0x3e35c7)Object['assign'](_0x1424e8,_0x3e35c7);else{if(_0x3e35c7)try{const _0x40ee0c=await _0x3e35c7(_0xed19df);Object['assign'](_0x1424e8,_0x40ee0c);}catch(_0x24d7b1){return Promise['reject'](new R(i(_0x240ac6,'AI_ERROR_GET_HEADERS')));}}return _0x1424e8;}async['_prepareRequestParameters'](_0x5cd212,_0x159339){const _0x42ab91=this['editor']['locale'];if('object'==typeof _0x5cd212)return _0x5cd212;try{return await _0x5cd212(_0x159339);}catch(_0x3642d7){return Promise['reject'](new R(i(_0x42ab91,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x35a82e){super(_0x35a82e),_0x35a82e['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x35a82e['config']['get']('ai.openAI.requestParameters')||_0x35a82e['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x35a82e['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x35a82e['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x35a82e['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x2c69f4,context:_0x5e4232,onData:_0xd38def,actionId:_0x4370e3}){const _0x190f2e=this['editor']['locale'],_0x45355f=await this['prepareMessages'](_0x2c69f4,_0x5e4232,_0x4370e3),_0x2a6e54=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4370e3),_0x127236=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4370e3),_0x4b57eb={'messages':_0x45355f,..._0x127236},_0x1617a2={'method':'POST','headers':_0x2a6e54,'body':JSON['stringify'](_0x4b57eb),'signal':this['abortController']['signal']},_0x329400=await fetch(this['_apiUrl'],_0x1617a2);if(_0x329400['ok'])return _0x127236['stream']?await this['_readStreamableResponse'](_0x329400,_0xd38def):await this['_readStaticResponse'](_0x329400,_0xd38def),Promise['resolve']();{const _0x36c3c4=await _0x329400['text']();return _0x36c3c4['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x190f2e,'AI_ERROR_CONTEXT_LENGTH'))):_0x36c3c4['includes']('Moderation')?Promise['reject'](new R(i(_0x190f2e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x36c3c4));}}async['prepareMessages'](_0x26de8b,_0x175d06,_0x5b396e){let _0x51330b,_0x59cbec;return _0x175d06?(_0x51330b='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.',_0x59cbec='Instruction:\x0a'+_0x26de8b+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x175d06):(_0x51330b='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.',_0x59cbec=_0x26de8b),[{'role':'system','content':_0x51330b},{'role':'user','content':_0x59cbec}];}async['_readStreamableResponse'](_0xf1ae58,_0x3edbdd){const _0xa2eb82=_0xf1ae58['body']['getReader'](),_0x5cf65c=new TextDecoder();let _0x373e41='',_0x5181d5='',_0x46ff0f='',_0x1afbb5=!0x1;for(;!_0x1afbb5;){const {done:_0x4ffdb1,value:_0x26698f}=await _0xa2eb82['read'](),_0x474888=_0x373e41+_0x5cf65c['decode'](_0x26698f);let _0x54d120='';_0x1afbb5=_0x4ffdb1;try{_0x54d120=this['_cleanUpData'](_0x474888),_0x373e41='';}catch(_0x43480f){_0x373e41=_0x474888;continue;}_0x5181d5+=_0x54d120,!_0x1afbb5&&this['_isBufferIncomplete'](_0x5181d5)||_0x5181d5&&(_0x46ff0f+=_0x5181d5,_0x5181d5='',_0x3edbdd(_0x46ff0f));}return Promise['resolve']();}async['_readStaticResponse'](_0x31b659,_0x516f68){return _0x516f68((await _0x31b659['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2b049d){const _0x3272cd=_0x2b049d['split']('<')['length']!==_0x2b049d['split']('>')['length'],_0x1002a4=_0x2b049d['length']<0x1e;return _0x3272cd&&_0x1002a4;}['_cleanUpData'](_0x197397){return _0x197397['split'](/\n(?![^{]*\})/g)['map'](_0x408ab1=>_0x408ab1['replace']('data:\x20',''))['filter'](_0x5501df=>_0x5501df&&_0x5501df['length']>0x0&&'[DONE]'!==_0x5501df)['map'](_0x2d3237=>{const {choices:_0x5f5690}=JSON['parse'](_0x2d3237);if(_0x5f5690[0x0]?.['delta']?.['content'])return _0x5f5690[0x0]['delta']['content'];})['filter'](_0x17990e=>_0x17990e)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2b1fdf){super(_0x2b1fdf),_0x2b1fdf['config']['get']('ai.aws.requestParameters')||_0x2b1fdf['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']=_0x2b1fdf['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2b1fdf['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2b1fdf['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2b1fdf['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x819482,context:_0x595920,onData:_0x20caa4,actionId:_0xe65502}){const {model:_0x3fadcb,stream:_0xe0d5e2,..._0x3839c8}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xe65502),_0x3812ca={'prompt':await this['preparePrompt'](_0x819482,_0x595920,_0x3fadcb,_0xe65502),..._0x3839c8};this['_apiUrl']?await this['_processProxyRequest'](_0x3812ca,_0x3fadcb,_0xe0d5e2,_0x20caa4,_0xe65502):await this['_processAWSRequest'](_0x3812ca,_0x3fadcb,_0xe0d5e2,_0x20caa4);}async['preparePrompt'](_0x2496c2,_0x13c289,_0x266810,_0x5a5da0){let _0x4d4b9e,_0x4a9aae;return _0x13c289?(_0x4d4b9e='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.',_0x4a9aae='Instruction:\x0a'+_0x2496c2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x13c289):(_0x4d4b9e='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.',_0x4a9aae=_0x2496c2),'meta.llama'==this['getModelFamily'](_0x266810)?'<<SYS>>\x0a'+_0x4d4b9e+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4a9aae+'\x0a[/INST]':'Human:\x0a'+_0x4d4b9e+'\x0a'+_0x4a9aae+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1247bf){if(/^anthropic\.claude/['test'](_0x1247bf))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1247bf))return'ai21.j2';if(/^cohere\.command/['test'](_0x1247bf))return'cohere.command';if(/^meta\.llama/['test'](_0x1247bf))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1247bf));}async['_processProxyRequest'](_0x491e98,_0x2ffcd1,_0x537f3e,_0x2c2b3d,_0x2896cb){const _0x46cfb4={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2896cb),'body':JSON['stringify']({..._0x491e98,'model':_0x2ffcd1,'stream':_0x537f3e}),'signal':this['abortController']['signal']},_0x15d2e5=await fetch(this['_apiUrl'],_0x46cfb4);_0x537f3e?await this['_readStreamableResponse'](_0x15d2e5,_0x2ffcd1,_0x2c2b3d):await this['_readStaticResponse'](_0x15d2e5,_0x2ffcd1,_0x2c2b3d);}async['_processAWSRequest'](_0x13e6b3,_0x15a338,_0x35bf34,_0x340189){const _0x195a89=new _0x559b14(this['_bedrockClientConfig']),_0xcae2db={'body':JSON['stringify'](_0x13e6b3),'contentType':'application/json','accept':'application/json','modelId':_0x15a338};let _0x10a8ed;if(_0x35bf34){const _0x23924b=new _0x8b9452(_0xcae2db);_0x10a8ed=await _0x195a89['send'](_0x23924b,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x10a8ed,_0x15a338,_0x340189);}else{const _0x3142a8=new _0x3d7377(_0xcae2db);_0x10a8ed=await _0x195a89['send'](_0x3142a8,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x10a8ed,_0x15a338,_0x340189);}}async['_readAsyncIterableResponse'](_0x54c98d,_0x4d5217,_0x45aaca){const _0x2ef0aa=_0x54c98d['body'],_0x171ab0=new TextDecoder('utf-8');let _0x32e82b='';for await(const _0x2117fb of _0x2ef0aa)if(_0x2117fb['chunk']){const _0x47df26=_0x171ab0['decode'](_0x2117fb['chunk']['bytes']),_0x56f70f=JSON['parse'](_0x47df26);_0x32e82b+=this['_getGeneratedText'](_0x56f70f,_0x4d5217),_0x45aaca(_0x32e82b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x47f769,_0x3a1b76,_0x1da80d){const _0x181e84=_0x47f769['body'],_0x4dbb3d=new TextDecoder('utf-8'),_0x518880=_0x181e84['getReader']();let _0x431183='',_0x5ef64b='',_0x420650=!0x1;for(;!_0x420650;){const {done:_0x1ecc97,value:_0x5c73c0}=await _0x518880['read']();if(_0x420650=_0x1ecc97,_0x420650)break;const _0x2cdf82=(_0x431183+_0x4dbb3d['decode'](_0x5c73c0))['split']('\x0a')['map'](_0x5ec646=>{try{return _0x431183='',JSON['parse'](_0x5ec646);}catch(_0xb31884){return _0x431183=_0x5ec646,null;}})['filter'](_0x5b9cc5=>null!==_0x5b9cc5);_0x2cdf82['length']&&(_0x5ef64b+=_0x2cdf82['map'](_0x4b2626=>this['_getGeneratedText'](_0x4b2626,_0x3a1b76))['join'](''),_0x1da80d(_0x5ef64b));}return Promise['resolve']();}async['_readStaticResponse'](_0x37ab25,_0x3b8354,_0x19b253){let _0x20b754;return _0x20b754=_0x37ab25 instanceof Response?await _0x37ab25['json']():JSON['parse'](Buffer['from'](_0x37ab25['body'])['toString']('utf8')),(_0x19b253(this['_getGeneratedText'](_0x20b754,_0x3b8354)),Promise['resolve']());}['_getGeneratedText'](_0x27b04d,_0x440a44){switch(this['getModelFamily'](_0x440a44)){case'anthropic.claude':return _0x27b04d['completion'];case'ai21.j2':return _0x27b04d['completions'][0x0]['data']['text'];case'cohere.command':return _0x27b04d['generations'][0x0]['text'];case'meta.llama':return _0x27b04d['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.1.0-alpha.2",
3
+ "version": "45.1.0-alpha.4",
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.1.0-alpha.2",
28
- "@ckeditor/ckeditor5-core": "45.1.0-alpha.2",
29
- "@ckeditor/ckeditor5-engine": "45.1.0-alpha.2",
30
- "@ckeditor/ckeditor5-icons": "45.1.0-alpha.2",
31
- "@ckeditor/ckeditor5-table": "45.1.0-alpha.2",
32
- "@ckeditor/ckeditor5-ui": "45.1.0-alpha.2",
33
- "@ckeditor/ckeditor5-utils": "45.1.0-alpha.2",
34
- "ckeditor5": "45.1.0-alpha.2",
27
+ "@ckeditor/ckeditor5-clipboard": "45.1.0-alpha.4",
28
+ "@ckeditor/ckeditor5-core": "45.1.0-alpha.4",
29
+ "@ckeditor/ckeditor5-engine": "45.1.0-alpha.4",
30
+ "@ckeditor/ckeditor5-icons": "45.1.0-alpha.4",
31
+ "@ckeditor/ckeditor5-table": "45.1.0-alpha.4",
32
+ "@ckeditor/ckeditor5-ui": "45.1.0-alpha.4",
33
+ "@ckeditor/ckeditor5-utils": "45.1.0-alpha.4",
34
+ "ckeditor5": "45.1.0-alpha.4",
35
35
  "es-toolkit": "1.32.0"
36
36
  },
37
37
  "type": "module",