@ckeditor/ckeditor5-ai 44.2.0-alpha.2 → 44.2.0-alpha.3
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/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +9 -9
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/index.js +1 -1
- package/src/legacyerrors.js +1 -1
- package/src/ui/aiassistantcontroller.js +2 -2
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x9ae703,Command as _0x164e0a,icons as _0x7bdd78}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x295c57,CKEditorError as _0x3b6f97,ObservableMixin as _0x5cf217,global as _0x5a7465,isVisible as it,Rect as st,Collection as _0x42ea7b,FocusTracker as _0x3f6e5b,KeystrokeHandler as ts,first as _0x10b596}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x4a5354,View as _0x55cc94,SpinnerView as _0x618bc3,IconView as _0x1795a5,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x23734d,ButtonLabelView as te,FocusCycler as _0x19c01a,createLabeledTextarea as _0x404365,Dialog as _0x3115a1,createDropdown as _0x34501d,addMenuToDropdown as _0x41d464,MenuBarMenuView as _0x4432b2,MenuBarMenuListItemButtonView as _0x31338e,DialogViewPosition as _0xf161e3,MenuBarMenuListView as _0x4d49c2,MenuBarMenuListItemView as _0x39c588}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x3f0eee,ClipboardMarkersUtils as _0x1a3977}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x61b577,DataTransfer as _0x3b612c,UpcastWriter as _0xa57b48,Matcher as _0x334e7d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x16aed8,escape as _0x22edb8}from'lodash-es';import{BedrockRuntimeClient as _0x35c0f0,InvokeModelWithResponseStreamCommand as _0x5135c4,InvokeModelCommand as _0x146945}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x4df135,_0x505bdd){const _0x445d4f=(0x0,_0x505bdd['t'])('Other');return _0x4df135['length']?'groupId'in _0x4df135[0x0]?_0x4df135:[{'groupId':x,'groupLabel':_0x445d4f,'order':0x1/0x0,'commands':_0x4df135}]:[{'groupId':x,'groupLabel':_0x445d4f,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x9ae703{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x59fc91}=this,_0x5616cd=['ck-fake-ai-selection'];_0x59fc91['config']['get']('ai.useTheme')&&_0x5616cd['push']('ck-ai-assistant-ui_theme'),_0x59fc91['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5616cd,'priority':0xc}}),_0x59fc91['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xec9dbd,{writer:_0xfc71f3})=>{if(!_0xec9dbd['markerRange']['isCollapsed'])return null;const _0x22c54c=_0xfc71f3['createUIElement']('span');return _0xfc71f3['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x22c54c),_0x22c54c;}});}['afterInit'](){!async function(_0x85124a){const _0x41b915=_0x318933([0x47,0x39,0x51,0x68,0x37,0x46,0x67,0x41,0x57,0x58,0x50,0x78,0x4f,0x61,0x32,0x31,0x63,0x45,0x4b,0x73,0x42,0x5a,0x64,0x49,0x72,0x52,0x6e,0x48,0x55,0x7a,0x76,0x6d,0x53,0x66,0x71,0x4c,0x75,0x33,0x6f,0x56,0x77,0x6b,0x54,0x30,0x36,0x38,0x6a,0x34,0x79,0x70,0x69,0x44,0x74,0x62,0x4e,0x65,0x35,0x43,0x4d,0x6c,0x59,0x4a]),_0x3f45ff=0x592a80b4,_0x46cd10=0x592ddea4^_0x3f45ff,_0x4c02a5=window[_0x318933([0x44,0x61,0x74,0x65])][_0x318933([0x6e,0x6f,0x77])](),_0x8501b7=_0x85124a[_0x318933([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1fb28b=new window[(_0x318933([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x343274=>{_0x8501b7[_0x318933([0x6f,0x6e,0x63,0x65])](_0x318933([0x72,0x65,0x61,0x64,0x79]),_0x343274);}),_0x1eebcc={[_0x318933([0x6b,0x74,0x79])]:_0x318933([0x45,0x43]),[_0x318933([0x75,0x73,0x65])]:_0x318933([0x73,0x69,0x67]),[_0x318933([0x63,0x72,0x76])]:_0x318933([0x50,0x2d,0x32,0x35,0x36]),[_0x318933([0x78])]:_0x318933([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]),[_0x318933([0x79])]:_0x318933([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]),[_0x318933([0x61,0x6c,0x67])]:_0x318933([0x45,0x53,0x32,0x35,0x36])},_0x5ada5b=_0x8501b7[_0x318933([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x318933([0x67,0x65,0x74])](_0x318933([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x467092(){let _0x5c643a,_0x2936e6=null,_0x38e495=null;try{if(_0x5ada5b==_0x318933([0x47,0x50,0x4c]))return _0x318933([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5c643a=_0x3883b4(),!_0x5c643a)return _0x318933([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5c643a[_0x318933([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x38e495=_0x1debb6(_0x5c643a[_0x318933([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5c643a[_0x318933([0x6a,0x74,0x69])])),await _0x3eb5a2()?_0x4cfd52()?_0x297d31()?_0x318933([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x34dab8()?(_0x5c643a[_0x318933([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x318933([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2936e6=_0x42b137(_0x318933([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5c643a[_0x318933([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x318933([0x74,0x72,0x69,0x61,0x6c])&&(_0x2936e6=_0x42b137(_0x318933([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1e074e()):_0x318933([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x318933([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x318933([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x5d1d1b){return _0x318933([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x297d31(){const _0x57bc74=[_0x318933([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x318933([0x74,0x72,0x69,0x61,0x6c])][_0x318933([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5c643a[_0x318933([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4c02a5/0x3e8:0xe10*_0x46cd10;return _0x5c643a[_0x318933([0x65,0x78,0x70])]<_0x57bc74;}function _0x4cfd52(){const _0x55fdfb=_0x5c643a[_0x318933([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x55fdfb&&(!!_0x55fdfb[_0x318933([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x318933([0x2a]))||!!_0x55fdfb[_0x318933([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x318933([0x41,0x49])));}function _0x34dab8(){const _0x10deb9=_0x5c643a[_0x318933([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x10deb9||0x0==_0x10deb9[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x143f07}=new URL(window[_0x318933([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x10deb9[_0x318933([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x143f07))return!0x0;const _0x123f17=_0x143f07[_0x318933([0x73,0x70,0x6c,0x69,0x74])](_0x318933([0x2e]));return _0x10deb9[_0x318933([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5c7588=>_0x5c7588[_0x318933([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x318933([0x2a])))[_0x318933([0x6d,0x61,0x70])](_0x981a1a=>_0x981a1a[_0x318933([0x73,0x70,0x6c,0x69,0x74])](_0x318933([0x2e])))[_0x318933([0x73,0x6f,0x6d,0x65])](_0xf313e6=>_0x123f17[_0x318933([0x65,0x76,0x65,0x72,0x79])]((_0x2f4dec,_0x2ecebe)=>_0xf313e6[_0x2ecebe]===_0x2f4dec||_0xf313e6[_0x2ecebe]===_0x318933([0x2a])));}function _0x1e074e(){return _0x2936e6&&_0x38e495?new window[(_0x318933([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3cd59a,_0x41ffcc)=>{_0x2936e6[_0x318933([0x74,0x68,0x65,0x6e])](_0x3cd59a,_0x41ffcc),_0x38e495[_0x318933([0x74,0x68,0x65,0x6e])](_0x514261=>{_0x514261!=_0x318933([0x56,0x61,0x6c,0x69,0x64])&&_0x3cd59a(_0x514261);},_0x41ffcc);}):_0x2936e6||_0x38e495||_0x318933([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1debb6(_0x13d533,_0x1da2a5){return new window[(_0x318933([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x47be21=>{if(_0x2af573())return _0x47be21(_0x318933([0x56,0x61,0x6c,0x69,0x64]));_0xd9fb72(),_0x8501b7[_0x318933([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x318933([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3a13a7=!0x1;const _0x7375a3=_0x295c57();function _0x56b487(_0x1627b3){return!!_0x1627b3&&(typeof _0x1627b3===_0x318933([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1627b3===_0x318933([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1627b3[_0x318933([0x74,0x68,0x65,0x6e])]===_0x318933([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1627b3[_0x318933([0x63,0x61,0x74,0x63,0x68])]===_0x318933([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1417b6(_0x5dafb2){_0x199e06(_0x5dafb2)[_0x318933([0x74,0x68,0x65,0x6e])](_0x2fe278=>{if(!_0x2fe278||_0x2fe278[_0x318933([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x318933([0x6f,0x6b]))return _0x318933([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1d94ef(_0x11f801(_0x7375a3+_0x1da2a5))!=_0x2fe278[_0x318933([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x318933([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x318933([0x56,0x61,0x6c,0x69,0x64]);})[_0x318933([0x74,0x68,0x65,0x6e])](_0x5d4552=>(_0x388d59(),_0x5d4552),()=>{const _0x5d4014=_0x4933f8();return null==_0x5d4014?(_0x388d59(),_0x318933([0x56,0x61,0x6c,0x69,0x64])):_0x318933(_0x4c02a5-_0x5d4014>(0x7d2604b4^_0x3f45ff)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x318933([0x74,0x68,0x65,0x6e])](_0x47be21)[_0x318933([0x63,0x61,0x74,0x63,0x68])](()=>{_0x47be21(_0x318933([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x283bcc=0x591c6e34^_0x3f45ff;function _0x388d59(){const _0x6bde03=_0x318933([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d94ef(_0x11f801(_0x13d533)),_0x2e879c=_0x58d65c(_0x1d94ef(window[_0x318933([0x4d,0x61,0x74,0x68])][_0x318933([0x63,0x65,0x69,0x6c])](_0x4c02a5/_0x283bcc)));window[_0x318933([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x318933([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x6bde03,_0x2e879c);}function _0x4933f8(){const _0x413964=_0x318933([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d94ef(_0x11f801(_0x13d533)),_0x4a4210=window[_0x318933([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x318933([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x413964);return _0x4a4210?window[_0x318933([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x58d65c(_0x4a4210),0x10)*_0x283bcc:null;}function _0x199e06(_0x192fc7){return new window[(_0x318933([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3d11e4,_0x506564)=>{_0x192fc7[_0x318933([0x74,0x68,0x65,0x6e])](_0x3d11e4,_0x506564),window[_0x318933([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x506564,0x592b5474^_0x3f45ff);});}}_0x8501b7[_0x318933([0x6f,0x6e])](_0x318933([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x15cdc8,_0x48a6b6)=>{if(_0x48a6b6[0x0]!=_0x13d533)return _0x47be21(_0x318933([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x48a6b6[0x1]={..._0x48a6b6[0x1],[_0x318933([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x7375a3};},{[_0x318933([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x318933([0x68,0x69,0x67,0x68])}),_0x8501b7[_0x318933([0x6f,0x6e])](_0x318933([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1d8f66=>{_0x56b487(_0x1d8f66[_0x318933([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3a13a7=!0x0,_0x1417b6(_0x1d8f66[_0x318933([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x318933([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x318933([0x6c,0x6f,0x77])}),_0x1fb28b[_0x318933([0x74,0x68,0x65,0x6e])](()=>{_0x3a13a7||_0x47be21(_0x318933([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2af573(){return _0x8501b7[_0x318933([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x318933([0x76,0x69,0x65,0x77])][_0x318933([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x318933([0x61,0x75,0x74,0x6f]);}function _0xd9fb72(){_0x8501b7[_0x318933([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x318933([0x76,0x69,0x65,0x77])][_0x318933([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x318933([0x61,0x75,0x74,0x6f]);}}function _0x42b137(_0x52e4ec){const _0x3f55ea=[new window[(_0x318933([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4bacb5=>setTimeout(_0x4bacb5,0x5923be78^_0x3f45ff)),_0x1fb28b[_0x318933([0x74,0x68,0x65,0x6e])](()=>new window[(_0x318933([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x504da4=>{let _0xf4cc4f=0x0;_0x8501b7[_0x318933([0x6d,0x6f,0x64,0x65,0x6c])][_0x318933([0x6f,0x6e])](_0x318933([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x333b4f,_0x253847)=>{_0x253847[0x0][_0x318933([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xf4cc4f++,_0xf4cc4f==(0x592a814c^_0x3f45ff)&&(_0x504da4(),_0x333b4f[_0x318933([0x6f,0x66,0x66])]());});}))];return window[_0x318933([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x318933([0x72,0x61,0x63,0x65])](_0x3f55ea)[_0x318933([0x74,0x68,0x65,0x6e])](()=>_0x52e4ec);}async function _0x1653e6(){await _0x1fb28b,_0x8501b7[_0x318933([0x6d,0x6f,0x64,0x65,0x6c])][_0x318933([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x396c57,_0x8501b7[_0x318933([0x6d,0x6f,0x64,0x65,0x6c])][_0x318933([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x396c57,_0x8501b7[_0x318933([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x318933([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x514ea0(_0x42a886){const _0x5c6c10=_0xa08bc();_0x8501b7[_0x5c6c10]=_0x318933([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x42a886,_0x42a886!=_0x318933([0x56,0x61,0x6c,0x69,0x64])&&_0x1653e6();}function _0xa08bc(){const _0x29cfe7=window[_0x318933([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x318933([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x318933([0x6e,0x6f,0x77])]())[_0x318933([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x318933([0x2e]),'');let _0x95ef92=_0x318933([0x47]);for(let _0x465e4d=0x0;_0x465e4d<_0x29cfe7[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x465e4d+=0x2){let _0x2546b2=window[_0x318933([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x29cfe7[_0x318933([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x465e4d,_0x465e4d+0x2));_0x2546b2>=_0x41b915[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2546b2-=_0x41b915[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x95ef92+=_0x41b915[_0x2546b2];}return _0x95ef92;}function _0x3883b4(){const _0x19e6e2=_0x5ada5b[_0x318933([0x73,0x70,0x6c,0x69,0x74])](_0x318933([0x2e]));if(0x3!=_0x19e6e2[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x7d75f9(_0x19e6e2[0x1]);function _0x7d75f9(_0x45f09e){const _0x55c865=_0xb486dd(_0x45f09e);return _0x55c865&&_0x4dcaaa()?_0x55c865:null;function _0x4dcaaa(){const _0x54c86f=_0x55c865[_0x318933([0x6a,0x74,0x69])],_0xd0d602=window[_0x318933([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x54c86f[_0x318933([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x54c86f[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x90bcac={..._0x55c865,[_0x318933([0x6a,0x74,0x69])]:_0x54c86f[_0x318933([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x54c86f[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x90bcac[_0x318933([0x76,0x63])],_0x11f801(_0x90bcac)==_0xd0d602;}}}async function _0x3eb5a2(){let _0x540025=!0x0;try{const _0x41b448=_0x5ada5b[_0x318933([0x73,0x70,0x6c,0x69,0x74])](_0x318933([0x2e])),[_0x338e31,_0x5d9e2b,_0x52b120]=_0x41b448;return _0x48232f(_0x338e31),await _0x4cbcd5(_0x338e31,_0x5d9e2b,_0x52b120),_0x540025;}catch(_0x55c2bb){return!0x1;}function _0x48232f(_0x12dd32){const _0x4f9f1a=_0xb486dd(_0x12dd32);_0x4f9f1a&&_0x4f9f1a[_0x318933([0x61,0x6c,0x67])]==_0x318933([0x45,0x53,0x32,0x35,0x36])||(_0x540025=!0x1);}async function _0x4cbcd5(_0xdfedbd,_0x4df569,_0x47cc35){const _0x534276=window[_0x318933([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x318933([0x66,0x72,0x6f,0x6d])](_0x879b9f(_0x47cc35),_0x59a6fc=>_0x59a6fc[_0x318933([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1488b6=new window[(_0x318933([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x318933([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xdfedbd+_0x318933([0x2e])+_0x4df569),_0x8ece46=window[_0x318933([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x318933([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x8ece46)return;const _0x55d4b6=await _0x8ece46[_0x318933([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x318933([0x6a,0x77,0x6b]),_0x1eebcc,{[_0x318933([0x6e,0x61,0x6d,0x65])]:_0x318933([0x45,0x43,0x44,0x53,0x41]),[_0x318933([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x318933([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x318933([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x8ece46[_0x318933([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x318933([0x6e,0x61,0x6d,0x65])]:_0x318933([0x45,0x43,0x44,0x53,0x41]),[_0x318933([0x68,0x61,0x73,0x68])]:{[_0x318933([0x6e,0x61,0x6d,0x65])]:_0x318933([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x55d4b6,_0x534276,_0x1488b6)||(_0x540025=!0x1);}}function _0xb486dd(_0x521768){return _0x521768[_0x318933([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x318933([0x65,0x79]))?JSON[_0x318933([0x70,0x61,0x72,0x73,0x65])](_0x879b9f(_0x521768)):null;}function _0x879b9f(_0x35c517){return window[_0x318933([0x61,0x74,0x6f,0x62])](_0x35c517[_0x318933([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x318933([0x2b]))[_0x318933([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x318933([0x2f])));}function _0x11f801(_0x1f84f8){let _0x5e586e=0x1505;function _0x32357c(_0x2d009a){for(let _0x536b3b=0x0;_0x536b3b<_0x2d009a[_0x318933([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x536b3b++){const _0x19d139=_0x2d009a[_0x318933([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x536b3b);_0x5e586e=(_0x5e586e<<0x5)+_0x5e586e+_0x19d139,_0x5e586e&=_0x5e586e;}}function _0x3fe88c(_0x1b3468){Array[_0x318933([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1b3468)?_0x1b3468[_0x318933([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3fe88c):_0x1b3468&&typeof _0x1b3468==_0x318933([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x318933([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1b3468)[_0x318933([0x73,0x6f,0x72,0x74])]()[_0x318933([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x169e5b,_0x4bef9a])=>{_0x32357c(_0x169e5b),_0x3fe88c(_0x4bef9a);}):_0x32357c(window[_0x318933([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1b3468));}return _0x3fe88c(_0x1f84f8),_0x5e586e>>>0x0;}function _0x1d94ef(_0x250e83){return _0x250e83[_0x318933([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x318933([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x318933([0x30]));}function _0x58d65c(_0x3d1d20){return _0x3d1d20[_0x318933([0x73,0x70,0x6c,0x69,0x74])]('')[_0x318933([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x318933([0x6a,0x6f,0x69,0x6e])]('');}function _0x396c57(){}function _0x318933(_0x4b19d8){return _0x4b19d8['map'](_0x412834=>String['fromCharCode'](_0x412834))['join']('');}_0x514ea0(await _0x467092());}(this);}['showFakeVisualSelection'](){const _0x44b6ae=this['editor']['model'];_0x44b6ae['change'](_0x47e57d=>{const _0x33ba85=_0x44b6ae['document']['selection']['getRanges']();let _0x4e281c=0x0;for(const _0xaf5651 of _0x33ba85){const _0x536cf1=f+':'+_0x4e281c;if(_0x44b6ae['markers']['has'](_0x536cf1))_0x47e57d['updateMarker'](_0x536cf1,{'range':_0xaf5651});else{if(_0xaf5651['start']['isAtEnd']){const _0x211e40=_0xaf5651['start']['getLastMatchingPosition'](({item:_0x398b66})=>!_0x44b6ae['schema']['isContent'](_0x398b66),{'boundaries':_0xaf5651});_0x47e57d['addMarker'](_0x536cf1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x47e57d['createRange'](_0x211e40,_0xaf5651['end'])});}else _0x47e57d['addMarker'](_0x536cf1,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xaf5651});}_0x4e281c++;}});}['hideFakeVisualSelection'](){const _0x5ecf3e=this['editor']['model'],_0x2f98ab=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x2f98ab['length']&&_0x5ecf3e['change'](_0x5da99e=>{_0x2f98ab['forEach'](_0x4924ae=>{_0x5da99e['removeMarker'](_0x4924ae);});});}['insertContent'](_0x3dc381,_0x52a05d){const _0x1dd705=this['_getAISelection'](),_0x57d7ce=_0x52a05d||_0x1dd705['getFirstRange']();this['editor']['model']['canEditAt'](_0x57d7ce)&&this['editor']['model']['change'](_0xea53aa=>{this['hideFakeVisualSelection'](),_0x52a05d||this['_resetContentOfSelectedTableCells'](_0xea53aa,_0x1dd705),this['_pasteHTMLUsingClipboard']({'insertAt':_0x57d7ce,'writer':_0xea53aa,'html':_0x3dc381});});}['insertContentBelow'](_0x8581de){const {model:_0x89c3e9}=this['editor'],_0x11b8e1=this['_getAISelection']();_0x89c3e9['change'](()=>{const _0x563f44=this['_prepareTableInsertBelowPosition'](_0x8581de,_0x11b8e1)||this['_getDefaultInsertBelowPosition'](_0x11b8e1);this['insertContent'](_0x8581de,_0x563f44);});}['_getAISelection'](){const _0x30727c=this['editor']['model'],_0x448736=Array['from'](_0x30727c['markers']['getMarkersGroup'](f))['map'](_0x12e4b8=>_0x12e4b8['getRange']());return _0x30727c['createSelection'](_0x448736);}['_pasteHTMLUsingClipboard']({writer:_0x3419cc,html:_0x4fd1e2,insertAt:_0x539bd2}){const {view:_0x3f3325}=this['editor']['editing'],_0x5490e8=this['editor']['plugins']['get'](_0x3f0eee),_0xed47f7=new dt();_0xed47f7['setData']('text/html',_0x4fd1e2);const _0x479a1a=new ClipboardEvent('paste',{'clipboardData':_0xed47f7}),_0x2cf1d4=new _0x61b577(_0x3f3325,_0x479a1a,{'dataTransfer':new _0x3b612c(_0xed47f7)});_0x3419cc['setSelection'](_0x539bd2);const _0x381010=(_0x23391b,_0x34f45f)=>{_0x34f45f['resultRange']&&_0x3419cc['setSelection'](_0x34f45f['resultRange']);};_0x5490e8['once']('contentInsertion',_0x381010,{'priority':'lowest'}),_0x3f3325['document']['fire']('paste',_0x2cf1d4),_0x5490e8['off']('contentInsertion',_0x381010);}['_getDefaultInsertBelowPosition'](_0x35e0d1){const {model:_0x59e948}=this['editor'],_0x32d9d2=Array['from'](_0x35e0d1['getSelectedBlocks']());return _0x32d9d2['length']?_0x59e948['createPositionAfter'](_0x32d9d2['pop']()):_0x35e0d1['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x41ade2,_0x455efb){const {model:_0x3dce48,plugins:_0x4cb6eb}=this['editor'];if(_0x4cb6eb['has']('TableUtils')){const _0x238acd=_0x4cb6eb['get']('TableUtils')['getSelectedTableCells'](_0x455efb);if(_0x238acd['length']){const _0x191546=this['_getTableRowCountFromContent'](_0x41ade2),_0x48b721=this['_createEmptyTableRows'](_0x238acd,_0x191546);return _0x3dce48['createPositionAt'](_0x48b721,0x0);}}return null;}['_getTableRowCountFromContent'](_0x57f530){const _0x5f3de8=this['editor']['plugins']['get']('TableUtils'),_0x4a74a5=this['editor']['data']['parse'](_0x57f530),_0x5f0888=Array['from'](_0x4a74a5['getChildren']())['filter'](_0x1ac396=>_0x1ac396['is']('element','table'));let _0x6a6a22=0x0;return _0x5f0888['forEach'](_0x5de655=>{_0x6a6a22+=_0x5f3de8['getRows'](_0x5de655);}),_0x6a6a22;}['_createEmptyTableRows'](_0x330ea1,_0x54f885){const _0x457b09=this['editor']['plugins']['get']('TableUtils'),_0xc800cf=_0x457b09['getRowIndexes'](_0x330ea1),_0x3f49ec=_0x457b09['getColumnIndexes'](_0x330ea1),_0x471e44=_0xc800cf['last']+0x1,_0x1707ef=_0x3f49ec['first'],_0x6fe4d=_0x330ea1[0x0]['findAncestor']('table');for(let _0x5b9c2b=0x0;_0x5b9c2b<_0x54f885;_0x5b9c2b++)_0x457b09['insertRows'](_0x6fe4d,{'at':_0x471e44});return _0x6fe4d['getChild'](_0x471e44)['getChild'](_0x1707ef);}['_resetContentOfSelectedTableCells'](_0x4eaf31,_0x5543ce){const {plugins:_0x57adf7}=this['editor'],{model:_0x4bda4e}=_0x4eaf31;if(!_0x57adf7['has']('TableUtils'))return;_0x57adf7['get']('TableUtils')['getSelectedTableCells'](_0x5543ce)['length']&&_0x4bda4e['deleteContent'](_0x5543ce);}}class K extends _0x9ae703{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x3b6f97('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x15385d){super(_0x15385d),this['name']='AIRequestError';}}function i(_0x5ebc33,_0x485b1c,_0x277236){const t=_0x5ebc33['t'];switch(_0x485b1c){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',_0x277236);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x277236);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'},_0x277236);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 _0x485b1c;}}class E extends _0x164e0a{['_commandDefinitions'];constructor(_0x51c07a,_0x554ca1){super(_0x51c07a),this['_commandDefinitions']=_0x554ca1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5526b2,_0x37c038,_0x36e0de)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x36e0de));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x121c6c,_0x53d9db,_0x5cb6f6)=>{this['enabledCommandsIds']=_0x5cb6f6?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x40ae25=this['editor']['model'];this['_hasContext']=function(_0x3d75ee){const _0x2e54dd=_0x3d75ee['document']['selection'];return _0x2e54dd['isCollapsed']?0x0!==[..._0x2e54dd['getSelectedBlocks']()]['length']&&![..._0x2e54dd['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3d75ee['hasContent'](_0x2e54dd['getFirstRange']());}(_0x40ae25);const _0x400eb6=_0x40ae25['document']['selection'],_0xe2533=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x391a25 of _0x400eb6['getRanges']())for(const _0x12ee56 of _0x391a25['getItems']())if(_0x12ee56['is']('element')&&_0xe2533['includes'](_0x12ee56['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x502d93='',_0x5f5452='',_0x176dc0='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x502d93,_0x5f5452,_0x176dc0);}}function G(_0x44540e,_0x93d975){const _0x13bd0a=new Set();for(const _0x46d39e of _0x44540e['values']())(_0x93d975||!0x1===_0x46d39e['requiresContent'])&&_0x13bd0a['add'](_0x46d39e['id']);return Array['from'](_0x13bd0a);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x5cf217(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3d4dfc,_0x52b1f5,_0x61b71f){super(),this['editor']=_0x3d4dfc,this['textAdapter']=_0x52b1f5,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x61b71f,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x188b4a,_0x117423,_0x159855)=>{this['view']['value']=this['_sanitizeHTML'](_0x159855);}),this['listenTo'](this['view'],'submitPrompt',(_0x48a346,_0x5842cc)=>{const _0x3d67a5=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x5842cc,_0x3d67a5,'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:_0xdc92d6,query:_0x24c282,htmlContent:_0xbd3dda,label:_0xb46783,mainActionLabel:_0x5dfaa2}){this['view']['prompt']=_0xb46783,this['view']['mainAction']=_0x5dfaa2,this['initialContext']=_0xbd3dda,_0x24c282&&(this['view']['isRendered']?this['_handleQuery'](_0x24c282,_0xbd3dda,_0xdc92d6,_0xb46783):this['view']['once']('render',()=>{this['_handleQuery'](_0x24c282,_0xbd3dda,_0xdc92d6,_0xb46783);}));}['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'](_0x35ce69,_0x2c413d,_0x39f670,_0x50cf61){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2c413d,this['previousQuery']=_0x35ce69,this['previousLabel']=_0x50cf61||_0x35ce69,this['previousActionId']=_0x39f670,new Promise(_0x2c2a73=>{this['textAdapter']['makeRequest']({'query':_0x35ce69,'context':_0x2c413d,'onData':_0x5b87a3=>{this['currentResponse']=_0x5b87a3,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x39f670})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x157c6a=>{_0x157c6a instanceof R?this['view']['handleError'](_0x157c6a['message']):this['view']['handleError'](),_0x2c2a73();})['finally'](()=>{this['stopProcessing'](),_0x2c2a73();});});}['_parseAndNormalizeContent'](_0x14dda5,_0x58de85=!0x1){const _0x4c462c=Z['exec'](_0x14dda5);_0x14dda5=_0x4c462c?_0x14dda5['substring'](_0x4c462c[0x1]['length']):_0x14dda5['length']<0x64&&!_0x58de85?'':this['_stripMarkdownSyntax'](_0x14dda5);const _0x33fba1=this['_domParser']['parseFromString'](_0x14dda5,'text/html');if(_0x4c462c){const _0x31126d=Array['from'](_0x33fba1['body']['childNodes']);_0x31126d['reverse']();for(const _0x225700 of _0x31126d){if(_0x225700['nodeType']==Node['ELEMENT_NODE'])break;_0x225700['remove']();}}const _0x26eadf=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x33fba1['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x26eadf);const _0x4e2319=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x27ffd=this['editor']['data']['toModel'](_0x26eadf);return _0x4e2319||_0x27ffd['markers']['clear'](),this['editor']['data']['stringify'](_0x27ffd);}['_normalizeResponseHeadings'](_0x2ccd1c){const _0x246da9=new _0xa57b48(this['editor']['editing']['view']['document']),_0x26c65f=new _0x334e7d({'name':/^h[1-5]$/}),_0x5a4846=[];let _0x10ec62=!0x1;for(const _0x3fc1c2 of _0x2ccd1c)_0x3fc1c2['is']('element')&&_0x26c65f['match'](_0x3fc1c2)&&(_0x5a4846['push'](_0x3fc1c2),'h1'==_0x3fc1c2['name']&&(_0x10ec62=!0x0));if(_0x10ec62){for(const _0x222d40 of _0x5a4846)_0x246da9['rename']('h'+(parseInt(_0x222d40['name'][0x1])+0x1),_0x222d40);}}['_isH1TagSupportEnabled'](){const {data:_0x1dbad4,editing:_0x20e779}=this['editor'],_0x381d7f=_0x1dbad4['htmlProcessor']['toView']('<h1></h1>'),_0x14a5ce=_0x1dbad4['toView'](_0x1dbad4['toModel'](_0x381d7f));return!!_0x20e779['view']['domConverter']['viewToDom'](_0x14a5ce)['querySelector']('h1');}['_sanitizeHTML'](_0x455309){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x455309),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x26d38d){const _0x1c0953=_0x26d38d['trim']();return _0x1c0953['startsWith']('```html')?_0x1c0953['endsWith']('```')?_0x1c0953['substring'](0x7,_0x1c0953['length']-0x3):_0x1c0953['substring'](0x7):_0x26d38d;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x13fba2){super(_0x13fba2),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x57dec0=>i(_0x13fba2,'AI_'+_0x57dec0['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x13fba2,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x13fba2,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x13fba2,'Stop'));const _0x3c1e5b=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x3c1e5b['if']('isVisible','ck-hidden',_0x1950e7=>!_0x1950e7)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x25d5b2,_0x4dc18c){const _0x5cc3be=new _0x4a5354(this['locale']);return _0x5cc3be['set']({'label':_0x25d5b2,'class':_0x4dc18c||'','isVisible':!0x0,'withText':!0x0}),_0x5cc3be;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x55cc94{['contentFieldView'];['copyButtonView'];constructor(_0x519b05,_0x5ae6bf=''){super(_0x519b05),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x2155b0=this['bindTemplate'];this['contentFieldView']=new mt(_0x519b05,_0x5ae6bf),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x2155b0['if']('isVisible','ck-hidden',_0x907049=>!_0x907049)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x2155b0['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 _0x146adc=!0x1;this['on']('change:value',(_0x19ae5d,_0x34487f,_0x128171)=>{const _0x3410ee=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x128171),this['isProcessing']&&_0x3410ee&&!_0x146adc&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x45a903,_0x1910c9,_0x1d4eb8)=>{_0x146adc=!0x1,_0x1d4eb8?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x146adc=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x146adc=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3ec638=this['locale'],_0x145c9f=new _0x4a5354(this['locale']),_0x2614db='ck-ai-form__copy-button';return _0x145c9f['set']({'label':i(_0x3ec638,'Copy'),'icon':W,'class':_0x2614db,'tooltip':!0x0}),_0x145c9f['bind']('isVisible')['to'](this,'value',_0x1e1f31=>!!_0x1e1f31),_0x145c9f['bind']('isEnabled')['to'](this,'isProcessing',_0x412d17=>!_0x412d17),_0x145c9f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x145c9f['icon']=_0x7bdd78['check'],_0x145c9f['class']=_0x2614db+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x145c9f['icon']=W,_0x145c9f['class']=_0x2614db;},0x3e8);}),_0x145c9f;}['_copyHTMLToClipboard'](_0x55ed7d){const {window:_0x466fcd,document:_0x377031}=_0x5a7465;if(_0x466fcd['ClipboardItem']){const {Blob:_0x46ff0f,ClipboardItem:_0x481eb5}=_0x466fcd,_0x1d2ee0=[new _0x481eb5({'text/html':new _0x46ff0f([_0x55ed7d['innerHTML']],{'type':'text/html'}),'text/plain':new _0x46ff0f([_0x55ed7d['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1d2ee0);}else{const _0x564fbf=_0x377031['createElement']('div');_0x564fbf['style']['position']='absolute',_0x564fbf['style']['left']='-9999px',_0x564fbf['innerHTML']='<span>[</span>'+_0x55ed7d['innerHTML']+'<span>]</span>',_0x377031['body']['appendChild'](_0x564fbf);const _0x4de6c5=_0x377031['createRange']();_0x4de6c5['setStartAfter'](_0x564fbf['firstElementChild']),_0x4de6c5['setEndBefore'](_0x564fbf['lastElementChild']);const _0x548f59=_0x466fcd['getSelection']();_0x548f59['removeAllRanges'](),_0x548f59['addRange'](_0x4de6c5),_0x377031['execCommand']('copy'),_0x564fbf['remove']();}}}class mt extends _0x55cc94{constructor(_0x47f594,_0x3a2f3e=''){super(_0x47f594),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x3a2f3e,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xdde27a){this['element']['innerHTML']=_0xdde27a;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x52a3c2=new _0x55cc94(),_0x3fb567=this['locale'],_0x3dcdef=new _0x618bc3();return _0x3dcdef['isVisible']=!0x0,_0x52a3c2['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3dcdef,{'text':i(_0x3fb567,'AI\x20is\x20writing...')}]}),_0x52a3c2['render'](),_0x52a3c2;}}class rt extends _0x55cc94{constructor(_0x1782a6,_0x18a99a=''){super(_0x1782a6);const _0x32856c=new _0x1795a5(),_0x3e53c5=this['bindTemplate'];this['set']('text',_0x18a99a),_0x32856c['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x32856c,{'text':_0x3e53c5['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x1806a9,_0x341f46){super(_0x1806a9,_0x341f46),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',(_0x109f5b,_0x5d06ec)=>{_0x109f5b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5d06ec());});}['_createSubmitButton'](){const _0x3ad39f=new _0x4a5354(this['locale']),_0x4af55e=this['locale'];return _0x3ad39f['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x4af55e,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3ad39f['on']('execute',()=>{this['submit']();}),_0x3ad39f['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1957fb,_0x38e640)=>!_0x1957fb&&_0x38e640),_0x3ad39f;}['_createShowHistoryButton'](){const _0x2110cb=new _0x4a5354(this['locale']),_0x43f48f=this['resultsView'],_0x2e58ba=this['locale'];_0x2110cb['set']({'label':i(_0x2e58ba,'History'),'withText':!0x1,'icon':_0x7bdd78['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2110cb['bind']('isOn')['to'](_0x43f48f,'isVisible'),_0x2110cb['bind']('isEnabled')['to'](this,'isEnabled'),_0x2110cb['on']('execute',()=>{_0x43f48f['isVisible']=!_0x43f48f['isVisible'],_0x43f48f['isVisible']?this['filteredView']['focus']():this['focus']();});const _0xbbbbcf=()=>{_0x5a7465['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x52cb44=new st(this['queryView']['fieldView']['element']),_0x38c158=_0x52cb44['width'],_0xdc3c80='rtl'===_0x2e58ba['uiLanguageDirection']?'left':'right';_0x52cb44['excludeScrollbarsAndBorders'](),_0x2110cb['element']['style'][_0xdc3c80]=_0x38c158-_0x52cb44['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0xbbbbcf),this['on']('render',_0xbbbbcf),_0x2110cb;}['submit'](){const _0x43a144=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x43a144);}['focus'](_0x293523){-0x1===_0x293523?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x5d9343){super(_0x5d9343),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x5d9343,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4bd138=0x0;for(const _0x58ccba of this['items'])_0x4bd138+=_0x58ccba['items']['length'];return{'resultsCount':_0x4bd138,'totalItemsCount':_0x4bd138};}['_createClearHistoryButton'](){const _0x29114f=this['locale'],_0x371413=new _0x4a5354(this['locale']);return _0x371413['set']({'label':'('+i(_0x29114f,'Clear')+')','withText':!0x0}),_0x371413['on']('execute',()=>this['fire']('clearHistory')),_0x371413;}}class hs extends _0x23734d{constructor(_0x39aafb){super();const _0x4fa6ed=new te(),_0x17be4a=new _0x4a5354(this['locale'],_0x4fa6ed);this['children']['add'](_0x17be4a),_0x17be4a['set']({'label':_0x39aafb['prompt'],'withText':!0x0}),_0x17be4a['on']('execute',()=>{this['fire']('execute',{'value':_0x16aed8(_0x39aafb['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x42ea7b{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x516ac9,_0xd78136)=>{const _0x474acb=Ss(_0xd78136['prompt']);for(const _0x419aa7 of this)if(_0x419aa7!=_0xd78136&&Ss(_0x419aa7['prompt'])===_0x474acb){this['remove'](_0x419aa7);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5e8cb8=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x5e8cb8));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x133033=>_0x133033)));}}function Ss(_0x1e0cb8){return _0x1e0cb8['toLowerCase']()['trim']();}class k extends _0x55cc94{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x251c93,_0x235030,_0x4a7bb9=''){super(_0x251c93),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 os(),this['errorView']=new rt(_0x251c93),this['contentArea']=new X(_0x251c93,_0x4a7bb9),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 _0x3f6e5b(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x19c01a({'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 _0x153a12=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x235030],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x153a12['if']('isError','ck-hidden',_0x4af202=>!_0x4af202)]},'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'](_0x556cfb=0x1){-0x1===_0x556cfb?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 _0x571c9e=this['locale'],_0x17f555=new ht(_0x571c9e,{'queryView':{'label':i(_0x571c9e,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x404365,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x571c9e,'Empty\x20history'),'secondary':i(_0x571c9e,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x17f555['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x36fecb,_0x1f8d44)=>_0x36fecb&&!_0x1f8d44),this['listenTo'](_0x17f555,'submit',(_0x17379,_0x388d03)=>{this['prompt']=_0x388d03;const _0x5ca802=_0x22edb8(_0x388d03);this['fire']('submitPrompt',_0x5ca802),_0x388d03['trim']()&&this['_promptHistory']['add']({'prompt':_0x5ca802},0x0);},{'priority':'high'}),_0x17f555;}['_createHistoryView'](){const _0x4080c3=new rs(this['locale']);return _0x4080c3['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x4080c3['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x4080c3;}['_createToolbar'](){const _0x15524b=new at(this['locale']);return _0x15524b['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x34afa8,_0x381863,_0x4d6340)=>_0x34afa8&&!_0x381863&&!!_0x4d6340),_0x15524b['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x15524b['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2a09a5,_0x45f5e5,_0x467cdd)=>_0x2a09a5&&!_0x45f5e5&&!!_0x467cdd),_0x15524b['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x15524b['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5cb5d5,_0x12adf2)=>_0x5cb5d5&&!_0x12adf2),_0x15524b['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x15524b['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x15524b['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x15524b;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3db2d2=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3db2d2,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x5a2ad7){const _0x2d6cc7=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x5a2ad7||i(_0x2d6cc7,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x9ae703{['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[_0x1a3977,a,K,_0x3115a1];}constructor(_0x4d8bc7){super(_0x4d8bc7),_0x4d8bc7['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4d8bc7['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x4d8bc7['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4d8bc7['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x77d5b2}=this;this['_aiAdapter']=_0x77d5b2['plugins']['get'](K),this['_dialog']=_0x77d5b2['plugins']['get'](_0x3115a1),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4e5c8d=new E(_0x77d5b2,Array['from'](this['_commandDefinitions']['values']()));_0x77d5b2['commands']['add']('showAIAssistant',_0x4e5c8d),_0x77d5b2['ui']['componentFactory']['add']('aiCommands',_0x546204=>{const _0x1bdfbb=_0x34501d(_0x546204);return _0x1bdfbb['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1bdfbb['buttonView']['set']({'label':i(_0x546204,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x1bdfbb['on']('execute',_0x37e508=>this['_onExecute'](_0x37e508['source']['id'])),_0x41d464(_0x1bdfbb,_0x77d5b2['ui']['view']['body'],function(_0x5aae90){const _0x571bd5=o(_0x5aae90['config']['get']('ai.aiAssistant.commands'),_0x5aae90['locale']),_0x315e1e=U(_0x5aae90,_0x571bd5)['filter'](_0x3c57b7=>_0x3c57b7['commands']['length']);if(0x1===_0x315e1e['length'])return U(_0x5aae90,_0x315e1e[0x0]['commands'])['map'](_0x359f2f=>({'id':_0x359f2f['id'],'label':_0x359f2f['label']}));return _0x315e1e['map'](_0x378841=>{const {groupId:_0x468f67,groupLabel:_0x832193,commands:_0x2d032e}=_0x378841,_0x1f61e6=U(_0x5aae90,_0x2d032e)['map'](_0x488f48=>({'id':_0x488f48['id'],'label':_0x488f48['label']}));return{'id':_0x468f67,'menu':_0x832193||_0x468f67,'children':_0x1f61e6};});}(_0x77d5b2),{'ariaLabel':i(_0x546204,'AI\x20Commands')}),_0x1bdfbb['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4e5c8d['on']('change:enabledCommandsIds',_0x3d96e9),_0x1bdfbb['menuView']['once']('render',_0x3d96e9),_0x1bdfbb;function _0x3d96e9(){_0x1bdfbb['isEnabled']=_0x4e5c8d['enabledCommandsIds']['length']>0x0;for(const _0x6cb308 of _0x1bdfbb['menuView']['buttons'])_0x6cb308['isEnabled']=_0x4e5c8d['enabledCommandsIds']['includes'](_0x6cb308['id']);}}),_0x77d5b2['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3b472f=>{const _0x314d91=new _0x4432b2(_0x3b472f);_0x314d91['buttonView']['set']({'label':i(_0x3b472f,'AI\x20Commands'),'icon':T}),_0x314d91['bind']('isEnabled')['to'](_0x4e5c8d,'enabledCommandsIds',_0x107f9b=>_0x107f9b['length']>0x0);const _0x3719e5=o(_0x77d5b2['config']['get']('ai.aiAssistant.commands'),_0x3b472f);return this['_populateMenuBarMenu'](_0x4e5c8d,_0x314d91,_0x3719e5,_0x386f51=>this['_onExecute'](_0x386f51)),_0x314d91;}),_0x77d5b2['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1a73ca=this['_createAIAssistantUIButton'](_0x4a5354);return _0x1a73ca['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1a73ca;}),_0x77d5b2['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x542cb1=this['_createAIAssistantUIButton'](_0x31338e);return _0x542cb1['set']({'role':'menuitemcheckbox'}),_0x542cb1;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x5a9227=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x36e1d8;for(const _0x1df9fa in _0x5a9227){const _0x514ce3=_0x1df9fa,_0x4395e6=_0x5a9227[_0x514ce3];if('aiLicenseKeyValid'==_0x4395e6||'aiLicenseKeyInvalid'==_0x4395e6||'aiLicenseKeyExpired'==_0x4395e6||'aiLicenseKeyDomainLimit'==_0x4395e6||'aiLicenseKeyNotAllowed'==_0x4395e6||'aiLicenseKeyEvaluationLimit'==_0x4395e6||'aiLicenseKeyTrialLimit'==_0x4395e6||'aiLicenseKeyUsageLimit'==_0x4395e6){delete _0x5a9227[_0x514ce3],_0x36e1d8=_0x4395e6,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x36e1d8&&_0x5a9227['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x36e1d8&&_0x5a9227['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x36e1d8&&_0x5a9227['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x36e1d8&&_0x5a9227['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x36e1d8&&_0x5a9227['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x36e1d8&&_0x5a9227['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x36e1d8&&_0x5a9227['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5a8848='',_0x23e77f='',_0x292ed2='custom'){const _0x2287ad=this['editor'],_0x33fb52=_0x2287ad['editing']['view'],_0x71a3ae=_0x2287ad['plugins']['get'](a),_0x448849=_0x2287ad['plugins']['get'](_0x1a3977);_0x71a3ae['showFakeVisualSelection']();const _0x45d21d=new w(),_0x116bc6=new ClipboardEvent('copy',{'clipboardData':_0x45d21d}),_0x193bbf=new _0x3b612c(_0x45d21d),_0x4201bf=new _0x61b577(_0x33fb52,_0x116bc6,{'dataTransfer':_0x193bbf});_0x448849['_forceMarkersCopy']('comment',()=>{_0x33fb52['document']['fire']('copy',_0x4201bf);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x2287ad,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x1d1082=_0x193bbf['getData']('text/html');const _0x5cc79c=_0x2287ad['model']['document']['selection'],_0x303202=Array['from'](_0x5cc79c['getRanges']());0x1===_0x303202['length']&&_0x303202[0x0]['isFlat']&&!_0x5cc79c['getSelectedElement']()&&''!==_0x1d1082['replace'](/ /g,'')['trim']()&&(_0x1d1082='<p>'+_0x1d1082+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x292ed2,'query':_0x5a8848,'htmlContent':_0x1d1082,'label':_0x23e77f,'mainActionLabel':M[_0x2287ad['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0xf161e3['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x71a3ae['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x513552=new Map(),_0x4fa49a=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4be93c of _0x4fa49a)for(const _0x299057 of _0x4be93c['commands'])_0x513552['set'](_0x299057['id'],{..._0x299057,'groupId':_0x4be93c['groupId'],'groupLabel':_0x4be93c['groupLabel']||_0x4be93c['groupId']});return _0x513552;}['_createAIAssistantUIButton'](_0x1ee332){const _0x1002eb=this['editor'],_0x79cde1=_0x1002eb['commands']['get']('showAIAssistant'),_0x2954a2=new _0x1ee332(_0x1002eb['locale']);return _0x2954a2['set']({'label':i(_0x1002eb['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x2954a2['bind']('isEnabled')['to'](_0x79cde1),_0x2954a2['bind']('isOn')['to'](this['_dialog'],'id',_0x51be86=>'aiAssistant'===_0x51be86),this['listenTo'](_0x2954a2,'execute',()=>{_0x2954a2['isOn']?this['hideUI']():_0x79cde1['execute']();}),_0x2954a2;}['_initView'](){const _0x4c7b4c=this['editor']['plugins']['get'](a);this['_formView']=new k(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',()=>{_0x4c7b4c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4c7b4c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x52d068,ui:{ariaLiveAnnouncer:_0x265098}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x442059,_0x330429,_0x5bcb57)=>{const _0x179117=this['_aiAssistantController']['currentContext'];_0x5bcb57?_0x265098['announce'](i(_0x52d068,'AI\x20is\x20writing')):_0x179117&&_0x265098['announce'](i(_0x52d068,'Generated\x20content:\x20%0',_0x179117),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3f7267,_0x17c592,_0x4fe114)=>{if(_0x4fe114){const _0x42af1c=this['_formView']['errorView']['text'];_0x265098['announce'](i(_0x52d068,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x42af1c));}});}['_onExecute'](_0x3f8281){const _0x5145dc=this['_commandDefinitions']['get'](_0x3f8281),_0x5a647f=this['editor'],_0x37b29e=_0x5a647f['model']['document']['selection'],_0x215d11=_0x5a647f['commands']['get']('showAIAssistant'),_0xec8373=_0x5a647f['plugins']['get'](a),_0x3d276a=''+(_0x5145dc['groupId']!==x?_0x5145dc['groupLabel']+':\x20':'')+_0x5145dc['label'];if(!0x1!==_0x5145dc['requiresContent']&&_0x37b29e['isCollapsed']){const _0x3a2bd6=_0x10b596(_0x37b29e['getSelectedBlocks']())||_0x5a647f['model']['schema']['getLimitElement'](_0x37b29e);_0x5a647f['model']['change'](_0x15d430=>{_0x15d430['setSelection'](_0x3a2bd6,'in');});}_0xec8373['showFakeVisualSelection'](),_0x215d11['execute'](_0x5145dc['prompt'],_0x3d276a,'command:'+_0x3f8281);}['_populateMenuBarMenu'](_0x522f86,_0x5b989e,_0x5a71b2,_0x243569){const _0x3c304d=this['editor'],_0xa722de=_0x3c304d['locale'],_0x71b80=new _0x4d49c2(_0xa722de),_0x1f9940=U(_0x3c304d,_0x5a71b2)['filter'](_0x4b4d87=>_0x4b4d87['commands']['length']);0x1===_0x1f9940['length']?this['_getMenuBarGroupButtons']({'command':_0x522f86,'commands':_0x1f9940[0x0]['commands'],'parentMenuView':_0x5b989e,'onExecute':_0x243569})['forEach'](_0x4c7be2=>_0x71b80['items']['add'](_0x4c7be2)):_0x1f9940['forEach'](({groupId:_0x488d46,groupLabel:_0x477fc2,commands:_0x5d390c})=>{const _0x5d329c=new _0x39c588(_0xa722de,_0x5b989e),_0x4ba29=new _0x4432b2(_0xa722de),_0xaf98d0=new _0x4d49c2(_0xa722de),_0x40d2e9=this['_getMenuBarGroupButtons']({'command':_0x522f86,'commands':_0x5d390c,'parentMenuView':_0x4ba29,'onExecute':_0x243569});_0x4ba29['buttonView']['set']({'label':_0x477fc2||_0x488d46}),_0x4ba29['delegate']('execute')['to'](_0x5b989e),_0xaf98d0['items']['addMany'](_0x40d2e9),_0x4ba29['panelView']['children']['add'](_0xaf98d0),_0x5d329c['children']['add'](_0x4ba29),_0x71b80['items']['add'](_0x5d329c);}),_0x5b989e['panelView']['children']['add'](_0x71b80);}['_getMenuBarGroupButtons']({command:_0x4b1bc8,commands:_0x16a7c8,parentMenuView:_0x1a080b,onExecute:_0x49e609}){const _0x39a8bf=this['editor'],_0x47adee=_0x39a8bf['locale'];return U(_0x39a8bf,_0x16a7c8)['map'](_0x29b1f4=>{const _0x725a81=new _0x39c588(_0x47adee,_0x1a080b),_0x1f1ac9=new _0x31338e(_0x47adee);return _0x1f1ac9['set']({'label':_0x29b1f4['label']}),_0x1f1ac9['delegate']('execute')['to'](_0x1a080b),_0x1f1ac9['on']('execute',()=>_0x49e609(_0x29b1f4['id'])),_0x1f1ac9['bind']('isEnabled')['to'](_0x4b1bc8,'enabledCommandsIds',_0x3439fd=>_0x3439fd['includes'](_0x29b1f4['id'])),_0x725a81['children']['add'](_0x1f1ac9),_0x725a81;});}}function B(_0x4ec88b,_0x5cbba4){return void 0x0!==_0x4ec88b['order']&&void 0x0===_0x5cbba4['order']?0x1:void 0x0===_0x4ec88b['order']&&void 0x0!==_0x5cbba4['order']?-0x1:void 0x0!==_0x4ec88b['order']&&void 0x0!==_0x5cbba4['order']?_0x4ec88b['order']-_0x5cbba4['order']:0x0;}function U(_0xc932ce,_0x4b074e){_0x4b074e['sort'](B);const _0x10875d={},_0x43c3fd=[];for(const _0x3e162e of _0x4b074e)if(void 0x0!==_0x3e162e['order']){if(_0x3e162e['order']in _0x10875d)throw new _0x3b6f97('ai-commands-config-order-collision',_0xc932ce,{'conflictingDefinitions':[_0x3e162e,_0x10875d[_0x3e162e['order']]]});_0x10875d[_0x3e162e['order']]=_0x3e162e,_0x43c3fd['splice'](_0x3e162e['order'],0x0,_0x3e162e);}else _0x43c3fd['push'](_0x3e162e);return _0x43c3fd;}class r extends _0x9ae703{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x41d4f7){super(_0x41d4f7);const _0x403777=_0x41d4f7['config'],_0x50a922=_0x41d4f7['locale'];_0x403777['define']('ai.aiAssistant.preserveComments',!0x0),_0x403777['define']('ai.aiAssistant.commands',function(_0x3a422d){return[{'groupId':'editOrReview','groupLabel':i(_0x3a422d,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3a422d,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3a422d,'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(_0x3a422d,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3a422d,'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(_0x3a422d,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3a422d,'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(_0x3a422d,'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(_0x3a422d,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3a422d,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3a422d,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3a422d,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3a422d,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3a422d,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3a422d,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3a422d,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3a422d,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3a422d,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3a422d,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3a422d,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3a422d,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3a422d,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3a422d,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3a422d,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3a422d,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3a422d,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3a422d,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3a422d,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x50a922)),_0x403777['define']('ai.aiAssistant.extraCommandGroups',[]),_0x403777['define']('ai.aiAssistant.removeCommands',[]);let _0x40711b=o(_0x403777['get']('ai.aiAssistant.commands'),_0x50a922);const _0x5b0e72=_0x403777['get']('ai.aiAssistant.extraCommandGroups'),_0x191324=_0x403777['get']('ai.aiAssistant.removeCommands');_0x5b0e72['forEach'](_0x3461bb=>{const _0x207916=_0x40711b['find'](_0x4a3355=>_0x4a3355['groupId']===_0x3461bb['groupId']);_0x207916?_0x207916['commands']=_0x207916['commands']['concat'](_0x3461bb['commands']):_0x40711b['push'](_0x3461bb);}),_0x40711b=_0x40711b['filter'](_0x1a10e8=>!_0x191324['includes'](_0x1a10e8['groupId'])),_0x40711b['forEach'](_0x5b37f0=>{_0x5b37f0['commands']=_0x5b37f0['commands']['filter'](_0x570a8d=>!_0x191324['includes'](_0x570a8d['id']));}),_0x403777['set']('ai.aiAssistant.commands',_0x40711b);}}class P extends _0x9ae703{['abortController'];static get['requires'](){return[K];}constructor(_0x4fb72b){super(_0x4fb72b),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x32fdeb){return this['sendRequest'](_0x32fdeb)['catch'](_0x55d224=>{if(_0x55d224 instanceof R)return Promise['reject'](_0x55d224);if('AbortError'==_0x55d224['name'])return Promise['resolve']();throw console['error'](_0x55d224),new _0x3b6f97('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x152838,_0x3b922d){const _0x2d1e87=this['editor']['locale'],_0x5b1919={'Content-Type':'application/json'};if('object'==typeof _0x152838)Object['assign'](_0x5b1919,_0x152838);else{if(_0x152838)try{const _0x58685a=await _0x152838(_0x3b922d);Object['assign'](_0x5b1919,_0x58685a);}catch(_0x44cd43){return Promise['reject'](new R(i(_0x2d1e87,'AI_ERROR_GET_HEADERS')));}}return _0x5b1919;}async['_prepareRequestParameters'](_0x313358,_0x14a644){const _0x562f01=this['editor']['locale'];if('object'==typeof _0x313358)return _0x313358;try{return await _0x313358(_0x14a644);}catch(_0xd636b3){return Promise['reject'](new R(i(_0x562f01,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3d086e){super(_0x3d086e),_0x3d086e['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3d086e['config']['get']('ai.openAI.requestParameters')||_0x3d086e['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3d086e['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x3d086e['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x3d086e['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x27011b,context:_0x518669,onData:_0x541c93,actionId:_0xb49e95}){const _0x3ec9bb=this['editor']['locale'],_0x1bf5fd=await this['prepareMessages'](_0x27011b,_0x518669,_0xb49e95),_0x3bfc71=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xb49e95),_0x119445=await this['_prepareRequestParameters'](this['_requestParameters'],_0xb49e95),_0x59edf4={'messages':_0x1bf5fd,..._0x119445},_0x14d584={'method':'POST','headers':_0x3bfc71,'body':JSON['stringify'](_0x59edf4),'signal':this['abortController']['signal']},_0x556180=await fetch(this['_apiUrl'],_0x14d584);if(_0x556180['ok'])return _0x119445['stream']?await this['_readStreamableResponse'](_0x556180,_0x541c93):await this['_readStaticResponse'](_0x556180,_0x541c93),Promise['resolve']();{const _0x5b0d59=await _0x556180['text']();return _0x5b0d59['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3ec9bb,'AI_ERROR_CONTEXT_LENGTH'))):_0x5b0d59['includes']('Moderation')?Promise['reject'](new R(i(_0x3ec9bb,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x5b0d59));}}async['prepareMessages'](_0x3e7d74,_0xdc1175,_0x17314b){let _0x183b17,_0x1def23;return _0xdc1175?(_0x183b17='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.',_0x1def23='Instruction:\x0a'+_0x3e7d74+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xdc1175):(_0x183b17='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.',_0x1def23=_0x3e7d74),[{'role':'system','content':_0x183b17},{'role':'user','content':_0x1def23}];}async['_readStreamableResponse'](_0x4a7b21,_0x26e7df){const _0x13109a=_0x4a7b21['body']['getReader'](),_0x23f3af=new TextDecoder();let _0x4e4a68='',_0x43ce41='',_0x3624c1='',_0x236d0b=!0x1;for(;!_0x236d0b;){const {done:_0x5e383a,value:_0x5f3f19}=await _0x13109a['read'](),_0x4e5a1f=_0x4e4a68+_0x23f3af['decode'](_0x5f3f19);let _0x32afb2='';_0x236d0b=_0x5e383a;try{_0x32afb2=this['_cleanUpData'](_0x4e5a1f),_0x4e4a68='';}catch(_0x5e588f){_0x4e4a68=_0x4e5a1f;continue;}_0x43ce41+=_0x32afb2,!_0x236d0b&&this['_isBufferIncomplete'](_0x43ce41)||_0x43ce41&&(_0x3624c1+=_0x43ce41,_0x43ce41='',_0x26e7df(_0x3624c1));}return Promise['resolve']();}async['_readStaticResponse'](_0x34f8ec,_0x5424a1){return _0x5424a1((await _0x34f8ec['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x4e777e){const _0x550454=_0x4e777e['split']('<')['length']!==_0x4e777e['split']('>')['length'],_0x42d6b4=_0x4e777e['length']<0x1e;return _0x550454&&_0x42d6b4;}['_cleanUpData'](_0x2b97a8){return _0x2b97a8['split'](/\n(?![^{]*\})/g)['map'](_0x52c07c=>_0x52c07c['replace']('data:\x20',''))['filter'](_0x37039e=>_0x37039e&&_0x37039e['length']>0x0&&'[DONE]'!==_0x37039e)['map'](_0x5395b7=>{const {choices:_0x1c4fbc}=JSON['parse'](_0x5395b7);if(_0x1c4fbc[0x0]&&_0x1c4fbc[0x0]['delta']&&_0x1c4fbc[0x0]['delta']['content'])return _0x1c4fbc[0x0]['delta']['content'];})['filter'](_0xb4a512=>_0xb4a512)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x336d4c){super(_0x336d4c),_0x336d4c['config']['get']('ai.aws.requestParameters')||_0x336d4c['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']=_0x336d4c['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x336d4c['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x336d4c['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x336d4c['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x29c68f,context:_0x2fe55e,onData:_0x446a95,actionId:_0x49f66b}){const {model:_0x307c74,stream:_0xa37ff2,..._0x1f7a21}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x49f66b),_0x2a7126={'prompt':await this['preparePrompt'](_0x29c68f,_0x2fe55e,_0x307c74,_0x49f66b),..._0x1f7a21};this['_apiUrl']?await this['_processProxyRequest'](_0x2a7126,_0x307c74,_0xa37ff2,_0x446a95,_0x49f66b):await this['_processAWSRequest'](_0x2a7126,_0x307c74,_0xa37ff2,_0x446a95);}async['preparePrompt'](_0xd9b051,_0x57718c,_0xabd4b5,_0x302ce2){let _0x59ce98,_0x2ff232;return _0x57718c?(_0x59ce98='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.',_0x2ff232='Instruction:\x0a'+_0xd9b051+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x57718c):(_0x59ce98='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.',_0x2ff232=_0xd9b051),'meta.llama'==this['getModelFamily'](_0xabd4b5)?'<<SYS>>\x0a'+_0x59ce98+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2ff232+'\x0a[/INST]':'Human:\x0a'+_0x59ce98+'\x0a'+_0x2ff232+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1d9e7d){if(/^anthropic\.claude/['test'](_0x1d9e7d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1d9e7d))return'ai21.j2';if(/^cohere\.command/['test'](_0x1d9e7d))return'cohere.command';if(/^meta\.llama/['test'](_0x1d9e7d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1d9e7d));}async['_processProxyRequest'](_0x5d7af4,_0x67bbc8,_0x4f5d79,_0xcd95b6,_0x11a627){const _0x2b1592={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x11a627),'body':JSON['stringify']({..._0x5d7af4,'model':_0x67bbc8,'stream':_0x4f5d79}),'signal':this['abortController']['signal']},_0x4886bf=await fetch(this['_apiUrl'],_0x2b1592);_0x4f5d79?await this['_readStreamableResponse'](_0x4886bf,_0x67bbc8,_0xcd95b6):await this['_readStaticResponse'](_0x4886bf,_0x67bbc8,_0xcd95b6);}async['_processAWSRequest'](_0x42a61e,_0x95401d,_0x3fdb60,_0x493aaf){const _0x25c729=new _0x35c0f0(this['_bedrockClientConfig']),_0x1bc0cc={'body':JSON['stringify'](_0x42a61e),'contentType':'application/json','accept':'application/json','modelId':_0x95401d};let _0x5bc0f4;if(_0x3fdb60){const _0x2fd7fa=new _0x5135c4(_0x1bc0cc);_0x5bc0f4=await _0x25c729['send'](_0x2fd7fa,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x5bc0f4,_0x95401d,_0x493aaf);}else{const _0x2d801d=new _0x146945(_0x1bc0cc);_0x5bc0f4=await _0x25c729['send'](_0x2d801d,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x5bc0f4,_0x95401d,_0x493aaf);}}async['_readAsyncIterableResponse'](_0x416f01,_0x57e355,_0x2b73c0){const _0x4e03ab=_0x416f01['body'],_0x872d8d=new TextDecoder('utf-8');let _0x420a98='';for await(const _0x2ae0e7 of _0x4e03ab)if(_0x2ae0e7['chunk']){const _0x5f1a26=_0x872d8d['decode'](_0x2ae0e7['chunk']['bytes']),_0xba8b5a=JSON['parse'](_0x5f1a26);_0x420a98+=this['_getGeneratedText'](_0xba8b5a,_0x57e355),_0x2b73c0(_0x420a98);}return Promise['resolve']();}async['_readStreamableResponse'](_0x513c4c,_0x3857d2,_0x6832a2){const _0x15b651=_0x513c4c['body'],_0x264849=new TextDecoder('utf-8'),_0x2d6648=_0x15b651['getReader']();let _0x3f0031='',_0x6d783='',_0x1f1f4c=!0x1;for(;!_0x1f1f4c;){const {done:_0x14a1bc,value:_0x38f40e}=await _0x2d6648['read']();if(_0x1f1f4c=_0x14a1bc,_0x1f1f4c)break;const _0x4c18fc=(_0x3f0031+_0x264849['decode'](_0x38f40e))['split']('\x0a')['map'](_0x561b8e=>{try{return _0x3f0031='',JSON['parse'](_0x561b8e);}catch(_0x55c191){return _0x3f0031=_0x561b8e,null;}})['filter'](_0x3ef541=>null!==_0x3ef541);_0x4c18fc['length']&&(_0x6d783+=_0x4c18fc['map'](_0x248b1b=>this['_getGeneratedText'](_0x248b1b,_0x3857d2))['join'](''),_0x6832a2(_0x6d783));}return Promise['resolve']();}async['_readStaticResponse'](_0x152d99,_0x5c8a87,_0x54a381){let _0xd070ef;return _0xd070ef=_0x152d99 instanceof Response?await _0x152d99['json']():JSON['parse'](Buffer['from'](_0x152d99['body'])['toString']('utf8')),(_0x54a381(this['_getGeneratedText'](_0xd070ef,_0x5c8a87)),Promise['resolve']());}['_getGeneratedText'](_0x5ad642,_0x5e9fcf){switch(this['getModelFamily'](_0x5e9fcf)){case'anthropic.claude':return _0x5ad642['completion'];case'ai21.j2':return _0x5ad642['completions'][0x0]['data']['text'];case'cohere.command':return _0x5ad642['generations'][0x0]['text'];case'meta.llama':return _0x5ad642['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0xc924d8,Command as _0x301361,icons as _0x522d83}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x136710,CKEditorError as _0x567ba8,ObservableMixin as _0x198539,global as _0x1dd5c9,isVisible as it,Rect as st,Collection as _0x1cb9bb,FocusTracker as _0x21e63b,KeystrokeHandler as ts,first as _0x32d55e}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x2b981b,View as _0x5b848a,SpinnerView as _0x41e295,IconView as _0x5c1326,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x39988d,ButtonLabelView as te,FocusCycler as _0x48bbf9,createLabeledTextarea as _0xebfc45,Dialog as _0x407e06,createDropdown as _0xf86420,addMenuToDropdown as _0x10552a,MenuBarMenuView as _0x4507e7,MenuBarMenuListItemButtonView as _0x467b5c,DialogViewPosition as _0x2f2b27,MenuBarMenuListView as _0x458fdc,MenuBarMenuListItemView as _0x563a5a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x49a6d8,ClipboardMarkersUtils as _0x2a385d}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2aaf62,DataTransfer as _0x525304,UpcastWriter as _0xb35fc7,Matcher as _0x4dc0c1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x522a75,escape as _0x1ca36f}from'lodash-es';import{BedrockRuntimeClient as _0x14af6e,InvokeModelWithResponseStreamCommand as _0x5b5899,InvokeModelCommand as _0x463689}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2c25e7,_0x238c75){const _0x19f1d8=(0x0,_0x238c75['t'])('Other');return _0x2c25e7['length']?'groupId'in _0x2c25e7[0x0]?_0x2c25e7:[{'groupId':x,'groupLabel':_0x19f1d8,'order':0x1/0x0,'commands':_0x2c25e7}]:[{'groupId':x,'groupLabel':_0x19f1d8,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0xc924d8{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x12bc48}=this,_0x552071=['ck-fake-ai-selection'];_0x12bc48['config']['get']('ai.useTheme')&&_0x552071['push']('ck-ai-assistant-ui_theme'),_0x12bc48['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x552071,'priority':0xc}}),_0x12bc48['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4b3cc4,{writer:_0x747f4c})=>{if(!_0x4b3cc4['markerRange']['isCollapsed'])return null;const _0x1a780a=_0x747f4c['createUIElement']('span');return _0x747f4c['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1a780a),_0x1a780a;}});}['afterInit'](){!async function(_0x38d694){const _0x14f7fd=_0x2d546e([0x47,0x6e,0x45,0x71,0x35,0x34,0x41,0x44,0x66,0x51,0x76,0x48,0x77,0x50,0x59,0x6a,0x73,0x72,0x38,0x49,0x53,0x33,0x6c,0x32,0x39,0x7a,0x4e,0x63,0x62,0x6f,0x74,0x68,0x67,0x4a,0x4d,0x61,0x57,0x4f,0x42,0x4b,0x58,0x78,0x43,0x79,0x52,0x54,0x37,0x75,0x65,0x31,0x70,0x4c,0x55,0x6d,0x30,0x36,0x46,0x6b,0x69,0x64,0x56,0x5a]),_0x2e8c79=0x62df0cca,_0x39cb9c=0x62d852e2^_0x2e8c79,_0x1b5d30=window[_0x2d546e([0x44,0x61,0x74,0x65])][_0x2d546e([0x6e,0x6f,0x77])](),_0x4aca7f=_0x38d694[_0x2d546e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x50d31b=new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x317107=>{_0x4aca7f[_0x2d546e([0x6f,0x6e,0x63,0x65])](_0x2d546e([0x72,0x65,0x61,0x64,0x79]),_0x317107);}),_0x2dd10c={[_0x2d546e([0x6b,0x74,0x79])]:_0x2d546e([0x45,0x43]),[_0x2d546e([0x75,0x73,0x65])]:_0x2d546e([0x73,0x69,0x67]),[_0x2d546e([0x63,0x72,0x76])]:_0x2d546e([0x50,0x2d,0x32,0x35,0x36]),[_0x2d546e([0x78])]:_0x2d546e([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]),[_0x2d546e([0x79])]:_0x2d546e([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]),[_0x2d546e([0x61,0x6c,0x67])]:_0x2d546e([0x45,0x53,0x32,0x35,0x36])},_0x472ee6=_0x4aca7f[_0x2d546e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2d546e([0x67,0x65,0x74])](_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5cfa95(){let _0x17fb3a,_0x121f29=null,_0x2aed36=null;try{if(_0x472ee6==_0x2d546e([0x47,0x50,0x4c]))return _0x2d546e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x17fb3a=_0x575b5b(),!_0x17fb3a)return _0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x17fb3a[_0x2d546e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2aed36=_0x17f849(_0x17fb3a[_0x2d546e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x17fb3a[_0x2d546e([0x6a,0x74,0x69])])),await _0x3ffeb0()?_0x2ff653()?_0x56aa80()?_0x2d546e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x388c7e()?(_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2d546e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x121f29=_0x22f1e1(_0x2d546e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2d546e([0x74,0x72,0x69,0x61,0x6c])&&(_0x121f29=_0x22f1e1(_0x2d546e([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x54262b()):_0x2d546e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2d546e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xfd2cc3){return _0x2d546e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x56aa80(){const _0x50ef53=[_0x2d546e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2d546e([0x74,0x72,0x69,0x61,0x6c])][_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1b5d30/0x3e8:0xe10*_0x39cb9c;return _0x17fb3a[_0x2d546e([0x65,0x78,0x70])]<_0x50ef53;}function _0x2ff653(){const _0x4c8416=_0x17fb3a[_0x2d546e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4c8416&&(!!_0x4c8416[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x2a]))||!!_0x4c8416[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x41,0x49])));}function _0x388c7e(){const _0x370c40=_0x17fb3a[_0x2d546e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x370c40||0x0==_0x370c40[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x9fd667}=new URL(window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x370c40[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x9fd667))return!0x0;const _0x5f065a=_0x9fd667[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e]));return _0x370c40[_0x2d546e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x28f80e=>_0x28f80e[_0x2d546e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d546e([0x2a])))[_0x2d546e([0x6d,0x61,0x70])](_0x9499b8=>_0x9499b8[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e])))[_0x2d546e([0x73,0x6f,0x6d,0x65])](_0x34e2c4=>_0x5f065a[_0x2d546e([0x65,0x76,0x65,0x72,0x79])]((_0x48030d,_0x1e77a7)=>_0x34e2c4[_0x1e77a7]===_0x48030d||_0x34e2c4[_0x1e77a7]===_0x2d546e([0x2a])));}function _0x54262b(){return _0x121f29&&_0x2aed36?new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x23b72f,_0x2d0d9a)=>{_0x121f29[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x23b72f,_0x2d0d9a),_0x2aed36[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x1f78ce=>{_0x1f78ce!=_0x2d546e([0x56,0x61,0x6c,0x69,0x64])&&_0x23b72f(_0x1f78ce);},_0x2d0d9a);}):_0x121f29||_0x2aed36||_0x2d546e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x17f849(_0x2bda66,_0x425b91){return new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30ab6e=>{if(_0x12530e())return _0x30ab6e(_0x2d546e([0x56,0x61,0x6c,0x69,0x64]));_0x3289c2(),_0x4aca7f[_0x2d546e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x6609d0=!0x1;const _0x28b2db=_0x136710();function _0x4c1378(_0x3975b6){return!!_0x3975b6&&(typeof _0x3975b6===_0x2d546e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3975b6===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3975b6[_0x2d546e([0x74,0x68,0x65,0x6e])]===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3975b6[_0x2d546e([0x63,0x61,0x74,0x63,0x68])]===_0x2d546e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2394f2(_0x37f7a9){_0x4d39d7(_0x37f7a9)[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x3fda3c=>{if(!_0x3fda3c||_0x3fda3c[_0x2d546e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2d546e([0x6f,0x6b]))return _0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x15c2ff(_0x226bc6(_0x28b2db+_0x425b91))!=_0x3fda3c[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2d546e([0x56,0x61,0x6c,0x69,0x64]);})[_0x2d546e([0x74,0x68,0x65,0x6e])](_0xc33e57=>(_0x2c619f(),_0xc33e57),()=>{const _0x105887=_0x48553b();return null==_0x105887?(_0x2c619f(),_0x2d546e([0x56,0x61,0x6c,0x69,0x64])):_0x2d546e(_0x1b5d30-_0x105887>(0x46d388ca^_0x2e8c79)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x30ab6e)[_0x2d546e([0x63,0x61,0x74,0x63,0x68])](()=>{_0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1a01cf=0x62e9e24a^_0x2e8c79;function _0x2c619f(){const _0x24fb53=_0x2d546e([0x6c,0x6c,0x63,0x74,0x2d])+_0x15c2ff(_0x226bc6(_0x2bda66)),_0x40a45=_0x47225b(_0x15c2ff(window[_0x2d546e([0x4d,0x61,0x74,0x68])][_0x2d546e([0x63,0x65,0x69,0x6c])](_0x1b5d30/_0x1a01cf)));window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2d546e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x24fb53,_0x40a45);}function _0x48553b(){const _0x3b7620=_0x2d546e([0x6c,0x6c,0x63,0x74,0x2d])+_0x15c2ff(_0x226bc6(_0x2bda66)),_0x49ce05=window[_0x2d546e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2d546e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3b7620);return _0x49ce05?window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47225b(_0x49ce05),0x10)*_0x1a01cf:null;}function _0x4d39d7(_0x5a4605){return new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2af823,_0x2d5535)=>{_0x5a4605[_0x2d546e([0x74,0x68,0x65,0x6e])](_0x2af823,_0x2d5535),window[_0x2d546e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2d5535,0x62ded80a^_0x2e8c79);});}}_0x4aca7f[_0x2d546e([0x6f,0x6e])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xac1148,_0x1552cb)=>{if(_0x1552cb[0x0]!=_0x2bda66)return _0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1552cb[0x1]={..._0x1552cb[0x1],[_0x2d546e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x28b2db};},{[_0x2d546e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2d546e([0x68,0x69,0x67,0x68])}),_0x4aca7f[_0x2d546e([0x6f,0x6e])](_0x2d546e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4afd9e=>{_0x4c1378(_0x4afd9e[_0x2d546e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x6609d0=!0x0,_0x2394f2(_0x4afd9e[_0x2d546e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2d546e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2d546e([0x6c,0x6f,0x77])}),_0x50d31b[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>{_0x6609d0||_0x30ab6e(_0x2d546e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x12530e(){return _0x4aca7f[_0x2d546e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2d546e([0x76,0x69,0x65,0x77])][_0x2d546e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2d546e([0x61,0x75,0x74,0x6f]);}function _0x3289c2(){_0x4aca7f[_0x2d546e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2d546e([0x76,0x69,0x65,0x77])][_0x2d546e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2d546e([0x61,0x75,0x74,0x6f]);}}function _0x22f1e1(_0x3e6619){const _0x3c4321=[new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x52b3be=>setTimeout(_0x52b3be,0x62d63206^_0x2e8c79)),_0x50d31b[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2da23f=>{let _0x526f2b=0x0;_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x6f,0x6e])](_0x2d546e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x27dc63,_0x1a1eb2)=>{_0x1a1eb2[0x0][_0x2d546e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x526f2b++,_0x526f2b==(0x62df0d32^_0x2e8c79)&&(_0x2da23f(),_0x27dc63[_0x2d546e([0x6f,0x66,0x66])]());});}))];return window[_0x2d546e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2d546e([0x72,0x61,0x63,0x65])](_0x3c4321)[_0x2d546e([0x74,0x68,0x65,0x6e])](()=>_0x3e6619);}async function _0x27251a(){await _0x50d31b,_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x35e9d6,_0x4aca7f[_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c])][_0x2d546e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x35e9d6,_0x4aca7f[_0x2d546e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2d546e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x25117c(_0x2f7984){const _0x36beda=_0x2726e6();_0x4aca7f[_0x36beda]=_0x2d546e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2f7984,_0x2f7984!=_0x2d546e([0x56,0x61,0x6c,0x69,0x64])&&_0x27251a();}function _0x2726e6(){const _0x35e4fe=window[_0x2d546e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2d546e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2d546e([0x6e,0x6f,0x77])]())[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2d546e([0x2e]),'');let _0x5e9211=_0x2d546e([0x47]);for(let _0x5b9363=0x0;_0x5b9363<_0x35e4fe[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5b9363+=0x2){let _0x476b5a=window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x35e4fe[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5b9363,_0x5b9363+0x2));_0x476b5a>=_0x14f7fd[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x476b5a-=_0x14f7fd[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x5e9211+=_0x14f7fd[_0x476b5a];}return _0x5e9211;}function _0x575b5b(){const _0x371fb4=_0x472ee6[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e]));if(0x3!=_0x371fb4[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xe06b59(_0x371fb4[0x1]);function _0xe06b59(_0xd31e9e){const _0x5272d5=_0x4a1f64(_0xd31e9e);return _0x5272d5&&_0x32273c()?_0x5272d5:null;function _0x32273c(){const _0x28ccea=_0x5272d5[_0x2d546e([0x6a,0x74,0x69])],_0x5eb492=window[_0x2d546e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x28ccea[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x28ccea[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5202c3={..._0x5272d5,[_0x2d546e([0x6a,0x74,0x69])]:_0x28ccea[_0x2d546e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x28ccea[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5202c3[_0x2d546e([0x76,0x63])],_0x226bc6(_0x5202c3)==_0x5eb492;}}}async function _0x3ffeb0(){let _0x27a3f3=!0x0;try{const _0x6a8c5b=_0x472ee6[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])](_0x2d546e([0x2e])),[_0x26968e,_0x2dc9a3,_0x5214d5]=_0x6a8c5b;return _0x9e79ac(_0x26968e),await _0x5ea7a4(_0x26968e,_0x2dc9a3,_0x5214d5),_0x27a3f3;}catch(_0x2d9a66){return!0x1;}function _0x9e79ac(_0x5cfcfe){const _0x3c2d62=_0x4a1f64(_0x5cfcfe);_0x3c2d62&&_0x3c2d62[_0x2d546e([0x61,0x6c,0x67])]==_0x2d546e([0x45,0x53,0x32,0x35,0x36])||(_0x27a3f3=!0x1);}async function _0x5ea7a4(_0x4f0652,_0x447f26,_0x13e122){const _0x3ea824=window[_0x2d546e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2d546e([0x66,0x72,0x6f,0x6d])](_0x5a314c(_0x13e122),_0x1bc275=>_0x1bc275[_0x2d546e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x17c97c=new window[(_0x2d546e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2d546e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4f0652+_0x2d546e([0x2e])+_0x447f26),_0x1afbb1=window[_0x2d546e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2d546e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1afbb1)return;const _0x970227=await _0x1afbb1[_0x2d546e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2d546e([0x6a,0x77,0x6b]),_0x2dd10c,{[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x45,0x43,0x44,0x53,0x41]),[_0x2d546e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2d546e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1afbb1[_0x2d546e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x45,0x43,0x44,0x53,0x41]),[_0x2d546e([0x68,0x61,0x73,0x68])]:{[_0x2d546e([0x6e,0x61,0x6d,0x65])]:_0x2d546e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x970227,_0x3ea824,_0x17c97c)||(_0x27a3f3=!0x1);}}function _0x4a1f64(_0x49fbf0){return _0x49fbf0[_0x2d546e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2d546e([0x65,0x79]))?JSON[_0x2d546e([0x70,0x61,0x72,0x73,0x65])](_0x5a314c(_0x49fbf0)):null;}function _0x5a314c(_0x1a7ea1){return window[_0x2d546e([0x61,0x74,0x6f,0x62])](_0x1a7ea1[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2d546e([0x2b]))[_0x2d546e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2d546e([0x2f])));}function _0x226bc6(_0x33c7dc){let _0xce51ed=0x1505;function _0x22c1fe(_0x4dc0f8){for(let _0x5ea99d=0x0;_0x5ea99d<_0x4dc0f8[_0x2d546e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5ea99d++){const _0x29e03b=_0x4dc0f8[_0x2d546e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x5ea99d);_0xce51ed=(_0xce51ed<<0x5)+_0xce51ed+_0x29e03b,_0xce51ed&=_0xce51ed;}}function _0x270139(_0x292d88){Array[_0x2d546e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x292d88)?_0x292d88[_0x2d546e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x270139):_0x292d88&&typeof _0x292d88==_0x2d546e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2d546e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x292d88)[_0x2d546e([0x73,0x6f,0x72,0x74])]()[_0x2d546e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x544076,_0x45c07d])=>{_0x22c1fe(_0x544076),_0x270139(_0x45c07d);}):_0x22c1fe(window[_0x2d546e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x292d88));}return _0x270139(_0x33c7dc),_0xce51ed>>>0x0;}function _0x15c2ff(_0x3b1e5a){return _0x3b1e5a[_0x2d546e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2d546e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2d546e([0x30]));}function _0x47225b(_0x2320c8){return _0x2320c8[_0x2d546e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2d546e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2d546e([0x6a,0x6f,0x69,0x6e])]('');}function _0x35e9d6(){}function _0x2d546e(_0x1dbca2){return _0x1dbca2['map'](_0xcadf7e=>String['fromCharCode'](_0xcadf7e))['join']('');}_0x25117c(await _0x5cfa95());}(this);}['showFakeVisualSelection'](){const _0x2eddd7=this['editor']['model'];_0x2eddd7['change'](_0x5c24de=>{const _0x3d9bf0=_0x2eddd7['document']['selection']['getRanges']();let _0x2619f0=0x0;for(const _0x29883b of _0x3d9bf0){const _0x396afa=f+':'+_0x2619f0;if(_0x2eddd7['markers']['has'](_0x396afa))_0x5c24de['updateMarker'](_0x396afa,{'range':_0x29883b});else{if(_0x29883b['start']['isAtEnd']){const _0x4e3517=_0x29883b['start']['getLastMatchingPosition'](({item:_0x185d41})=>!_0x2eddd7['schema']['isContent'](_0x185d41),{'boundaries':_0x29883b});_0x5c24de['addMarker'](_0x396afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5c24de['createRange'](_0x4e3517,_0x29883b['end'])});}else _0x5c24de['addMarker'](_0x396afa,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x29883b});}_0x2619f0++;}});}['hideFakeVisualSelection'](){const _0x4583d6=this['editor']['model'],_0x5ba8cf=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x5ba8cf['length']&&_0x4583d6['change'](_0x50ccdf=>{_0x5ba8cf['forEach'](_0x4056d7=>{_0x50ccdf['removeMarker'](_0x4056d7);});});}['insertContent'](_0x66af6,_0x5b1581){const _0x5477ce=this['_getAISelection'](),_0x57845a=_0x5b1581||_0x5477ce['getFirstRange']();this['editor']['model']['canEditAt'](_0x57845a)&&this['editor']['model']['change'](_0x8f511d=>{this['hideFakeVisualSelection'](),_0x5b1581||this['_resetContentOfSelectedTableCells'](_0x8f511d,_0x5477ce),this['_pasteHTMLUsingClipboard']({'insertAt':_0x57845a,'writer':_0x8f511d,'html':_0x66af6});});}['insertContentBelow'](_0xdba881){const {model:_0x4ea55e}=this['editor'],_0x455062=this['_getAISelection']();_0x4ea55e['change'](()=>{const _0x13b1a4=this['_prepareTableInsertBelowPosition'](_0xdba881,_0x455062)||this['_getDefaultInsertBelowPosition'](_0x455062);this['insertContent'](_0xdba881,_0x13b1a4);});}['_getAISelection'](){const _0x5a080a=this['editor']['model'],_0x89f7a3=Array['from'](_0x5a080a['markers']['getMarkersGroup'](f))['map'](_0x33b0af=>_0x33b0af['getRange']());return _0x5a080a['createSelection'](_0x89f7a3);}['_pasteHTMLUsingClipboard']({writer:_0x24886b,html:_0x114714,insertAt:_0x256638}){const {view:_0x33156c}=this['editor']['editing'],_0x47b1ee=this['editor']['plugins']['get'](_0x49a6d8),_0x5e85ee=new dt();_0x5e85ee['setData']('text/html',_0x114714);const _0x434a4c=new ClipboardEvent('paste',{'clipboardData':_0x5e85ee}),_0x20b8ea=new _0x2aaf62(_0x33156c,_0x434a4c,{'dataTransfer':new _0x525304(_0x5e85ee)});_0x24886b['setSelection'](_0x256638);const _0x123a59=(_0x2bac12,_0x46092e)=>{_0x46092e['resultRange']&&_0x24886b['setSelection'](_0x46092e['resultRange']);};_0x47b1ee['once']('contentInsertion',_0x123a59,{'priority':'lowest'}),_0x33156c['document']['fire']('paste',_0x20b8ea),_0x47b1ee['off']('contentInsertion',_0x123a59);}['_getDefaultInsertBelowPosition'](_0x55c9eb){const {model:_0x3780a3}=this['editor'],_0x3ec9f9=Array['from'](_0x55c9eb['getSelectedBlocks']());return _0x3ec9f9['length']?_0x3780a3['createPositionAfter'](_0x3ec9f9['pop']()):_0x55c9eb['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3bc9c8,_0x33bf0a){const {model:_0x4440fc,plugins:_0x38f683}=this['editor'];if(_0x38f683['has']('TableUtils')){const _0x40a6a2=_0x38f683['get']('TableUtils')['getSelectedTableCells'](_0x33bf0a);if(_0x40a6a2['length']){const _0x4d1400=this['_getTableRowCountFromContent'](_0x3bc9c8),_0x3aa798=this['_createEmptyTableRows'](_0x40a6a2,_0x4d1400);return _0x4440fc['createPositionAt'](_0x3aa798,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5b441c){const _0x275090=this['editor']['plugins']['get']('TableUtils'),_0x22044c=this['editor']['data']['parse'](_0x5b441c),_0x1d2cce=Array['from'](_0x22044c['getChildren']())['filter'](_0x33c46d=>_0x33c46d['is']('element','table'));let _0x31f7eb=0x0;return _0x1d2cce['forEach'](_0x8d989a=>{_0x31f7eb+=_0x275090['getRows'](_0x8d989a);}),_0x31f7eb;}['_createEmptyTableRows'](_0x5cee67,_0x29c7c7){const _0x25eec2=this['editor']['plugins']['get']('TableUtils'),_0x27dc3c=_0x25eec2['getRowIndexes'](_0x5cee67),_0x5d6046=_0x25eec2['getColumnIndexes'](_0x5cee67),_0xf87ff4=_0x27dc3c['last']+0x1,_0x3946c0=_0x5d6046['first'],_0x642f3f=_0x5cee67[0x0]['findAncestor']('table');for(let _0x51ce69=0x0;_0x51ce69<_0x29c7c7;_0x51ce69++)_0x25eec2['insertRows'](_0x642f3f,{'at':_0xf87ff4});return _0x642f3f['getChild'](_0xf87ff4)['getChild'](_0x3946c0);}['_resetContentOfSelectedTableCells'](_0x29926c,_0x202fe4){const {plugins:_0x43354d}=this['editor'],{model:_0x3df98c}=_0x29926c;if(!_0x43354d['has']('TableUtils'))return;_0x43354d['get']('TableUtils')['getSelectedTableCells'](_0x202fe4)['length']&&_0x3df98c['deleteContent'](_0x202fe4);}}class K extends _0xc924d8{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x567ba8('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2c0fff){super(_0x2c0fff),this['name']='AIRequestError';}}function i(_0xc2cc5,_0xcd20bc,_0x187e13){const t=_0xc2cc5['t'];switch(_0xcd20bc){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',_0x187e13);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x187e13);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'},_0x187e13);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 _0xcd20bc;}}class E extends _0x301361{['_commandDefinitions'];constructor(_0x5d7d7d,_0x5d6c82){super(_0x5d7d7d),this['_commandDefinitions']=_0x5d6c82,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3c2c5d,_0x471a31,_0x56c68a)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x56c68a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5dbac2,_0x991980,_0x4ebfed)=>{this['enabledCommandsIds']=_0x4ebfed?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xdb609e=this['editor']['model'];this['_hasContext']=function(_0x4bf303){const _0x4c352f=_0x4bf303['document']['selection'];return _0x4c352f['isCollapsed']?0x0!==[..._0x4c352f['getSelectedBlocks']()]['length']&&![..._0x4c352f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4bf303['hasContent'](_0x4c352f['getFirstRange']());}(_0xdb609e);const _0x5b7568=_0xdb609e['document']['selection'],_0x353828=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x704cdc of _0x5b7568['getRanges']())for(const _0x17f8d7 of _0x704cdc['getItems']())if(_0x17f8d7['is']('element')&&_0x353828['includes'](_0x17f8d7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2ff211='',_0x3d6b3d='',_0x1d0f1a='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2ff211,_0x3d6b3d,_0x1d0f1a);}}function G(_0x58e10b,_0x1ee453){const _0x45ec3e=new Set();for(const _0x3d104a of _0x58e10b['values']())(_0x1ee453||!0x1===_0x3d104a['requiresContent'])&&_0x45ec3e['add'](_0x3d104a['id']);return Array['from'](_0x45ec3e);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x198539(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x270f04,_0x1f8a7b,_0x22c4da){super(),this['editor']=_0x270f04,this['textAdapter']=_0x1f8a7b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x22c4da,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x479483,_0x18014a,_0x1dacf4)=>{this['view']['value']=this['_sanitizeHTML'](_0x1dacf4);}),this['listenTo'](this['view'],'submitPrompt',(_0x16490c,_0x6710bd)=>{const _0x27d4f9=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x6710bd,_0x27d4f9,'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:_0x2a265a,query:_0x533be8,htmlContent:_0x35f790,label:_0x23a607,mainActionLabel:_0x42f1d6}){this['view']['prompt']=_0x23a607,this['view']['mainAction']=_0x42f1d6,this['initialContext']=_0x35f790,_0x533be8&&(this['view']['isRendered']?this['_handleQuery'](_0x533be8,_0x35f790,_0x2a265a,_0x23a607):this['view']['once']('render',()=>{this['_handleQuery'](_0x533be8,_0x35f790,_0x2a265a,_0x23a607);}));}['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'](_0x3cb08f,_0x3ec7d7,_0x3623a9,_0x831ac4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3ec7d7,this['previousQuery']=_0x3cb08f,this['previousLabel']=_0x831ac4||_0x3cb08f,this['previousActionId']=_0x3623a9,new Promise(_0x1696bc=>{this['textAdapter']['makeRequest']({'query':_0x3cb08f,'context':_0x3ec7d7,'onData':_0x3cdd1d=>{this['currentResponse']=_0x3cdd1d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x3623a9})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x10ed5a=>{_0x10ed5a instanceof R?this['view']['handleError'](_0x10ed5a['message']):this['view']['handleError'](),_0x1696bc();})['finally'](()=>{this['stopProcessing'](),_0x1696bc();});});}['_parseAndNormalizeContent'](_0x2ae1b4,_0x5386a4=!0x1){const _0x34ecea=Z['exec'](_0x2ae1b4);_0x2ae1b4=_0x34ecea?_0x2ae1b4['substring'](_0x34ecea[0x1]['length']):_0x2ae1b4['length']<0x64&&!_0x5386a4?'':this['_stripMarkdownSyntax'](_0x2ae1b4);const _0xd758dc=this['_domParser']['parseFromString'](_0x2ae1b4,'text/html');if(_0x34ecea){const _0x1bb3b5=Array['from'](_0xd758dc['body']['childNodes']);_0x1bb3b5['reverse']();for(const _0xf61f77 of _0x1bb3b5){if(_0xf61f77['nodeType']==Node['ELEMENT_NODE'])break;_0xf61f77['remove']();}}const _0x797a71=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xd758dc['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x797a71);const _0x79e174=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x2c51e8=this['editor']['data']['toModel'](_0x797a71);return _0x79e174||_0x2c51e8['markers']['clear'](),this['editor']['data']['stringify'](_0x2c51e8);}['_normalizeResponseHeadings'](_0x32dd72){const _0xf4ce21=new _0xb35fc7(this['editor']['editing']['view']['document']),_0x5cfc55=new _0x4dc0c1({'name':/^h[1-5]$/}),_0x16eab5=[];let _0x53f1eb=!0x1;for(const _0x270af5 of _0x32dd72)_0x270af5['is']('element')&&_0x5cfc55['match'](_0x270af5)&&(_0x16eab5['push'](_0x270af5),'h1'==_0x270af5['name']&&(_0x53f1eb=!0x0));if(_0x53f1eb){for(const _0x2bdfe6 of _0x16eab5)_0xf4ce21['rename']('h'+(parseInt(_0x2bdfe6['name'][0x1])+0x1),_0x2bdfe6);}}['_isH1TagSupportEnabled'](){const {data:_0x442adc,editing:_0x4f0692}=this['editor'],_0x46777f=_0x442adc['htmlProcessor']['toView']('<h1></h1>'),_0xbf028c=_0x442adc['toView'](_0x442adc['toModel'](_0x46777f));return!!_0x4f0692['view']['domConverter']['viewToDom'](_0xbf028c)['querySelector']('h1');}['_sanitizeHTML'](_0x50c86c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x50c86c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x133f92){const _0x49c9c8=_0x133f92['trim']();return _0x49c9c8['startsWith']('```html')?_0x49c9c8['endsWith']('```')?_0x49c9c8['substring'](0x7,_0x49c9c8['length']-0x3):_0x49c9c8['substring'](0x7):_0x133f92;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x13f7a0){super(_0x13f7a0),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x280d61=>i(_0x13f7a0,'AI_'+_0x280d61['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x13f7a0,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x13f7a0,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x13f7a0,'Stop'));const _0x237f94=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x237f94['if']('isVisible','ck-hidden',_0x3a8133=>!_0x3a8133)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2f2f14,_0x5550bd){const _0x3b8191=new _0x2b981b(this['locale']);return _0x3b8191['set']({'label':_0x2f2f14,'class':_0x5550bd||'','isVisible':!0x0,'withText':!0x0}),_0x3b8191;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x5b848a{['contentFieldView'];['copyButtonView'];constructor(_0x539328,_0xe58597=''){super(_0x539328),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x249177=this['bindTemplate'];this['contentFieldView']=new mt(_0x539328,_0xe58597),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x249177['if']('isVisible','ck-hidden',_0x25d8c1=>!_0x25d8c1)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x249177['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 _0x4e8160=!0x1;this['on']('change:value',(_0x223f86,_0x4fb59b,_0x43df78)=>{const _0x459b67=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x43df78),this['isProcessing']&&_0x459b67&&!_0x4e8160&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x5f008b,_0x596696,_0x25979d)=>{_0x4e8160=!0x1,_0x25979d?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4e8160=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4e8160=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3bf47e=this['locale'],_0x4dd4d5=new _0x2b981b(this['locale']),_0x2bd4a3='ck-ai-form__copy-button';return _0x4dd4d5['set']({'label':i(_0x3bf47e,'Copy'),'icon':W,'class':_0x2bd4a3,'tooltip':!0x0}),_0x4dd4d5['bind']('isVisible')['to'](this,'value',_0x9cd81e=>!!_0x9cd81e),_0x4dd4d5['bind']('isEnabled')['to'](this,'isProcessing',_0x18f895=>!_0x18f895),_0x4dd4d5['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4dd4d5['icon']=_0x522d83['check'],_0x4dd4d5['class']=_0x2bd4a3+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4dd4d5['icon']=W,_0x4dd4d5['class']=_0x2bd4a3;},0x3e8);}),_0x4dd4d5;}['_copyHTMLToClipboard'](_0x1c1ac0){const {window:_0x366b14,document:_0x4fc14e}=_0x1dd5c9;if(_0x366b14['ClipboardItem']){const {Blob:_0x3189b4,ClipboardItem:_0x3a9ed2}=_0x366b14,_0xa62ea6=[new _0x3a9ed2({'text/html':new _0x3189b4([_0x1c1ac0['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3189b4([_0x1c1ac0['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xa62ea6);}else{const _0x4b0003=_0x4fc14e['createElement']('div');_0x4b0003['style']['position']='absolute',_0x4b0003['style']['left']='-9999px',_0x4b0003['innerHTML']='<span>[</span>'+_0x1c1ac0['innerHTML']+'<span>]</span>',_0x4fc14e['body']['appendChild'](_0x4b0003);const _0x197114=_0x4fc14e['createRange']();_0x197114['setStartAfter'](_0x4b0003['firstElementChild']),_0x197114['setEndBefore'](_0x4b0003['lastElementChild']);const _0x54436e=_0x366b14['getSelection']();_0x54436e['removeAllRanges'](),_0x54436e['addRange'](_0x197114),_0x4fc14e['execCommand']('copy'),_0x4b0003['remove']();}}}class mt extends _0x5b848a{constructor(_0x2530c3,_0x41b38f=''){super(_0x2530c3),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x41b38f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3213c4){this['element']['innerHTML']=_0x3213c4;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x59037e=new _0x5b848a(),_0xa1795f=this['locale'],_0x8cc092=new _0x41e295();return _0x8cc092['isVisible']=!0x0,_0x59037e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x8cc092,{'text':i(_0xa1795f,'AI\x20is\x20writing...')}]}),_0x59037e['render'](),_0x59037e;}}class rt extends _0x5b848a{constructor(_0x3a1219,_0x5e4ad4=''){super(_0x3a1219);const _0x5990b5=new _0x5c1326(),_0x1ed605=this['bindTemplate'];this['set']('text',_0x5e4ad4),_0x5990b5['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x5990b5,{'text':_0x1ed605['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x145833,_0x2ce6b6){super(_0x145833,_0x2ce6b6),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',(_0x1902f8,_0x1f4df0)=>{_0x1902f8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1f4df0());});}['_createSubmitButton'](){const _0x46dd25=new _0x2b981b(this['locale']),_0x5b5785=this['locale'];return _0x46dd25['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x5b5785,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x46dd25['on']('execute',()=>{this['submit']();}),_0x46dd25['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x27133d,_0x3e0c07)=>!_0x27133d&&_0x3e0c07),_0x46dd25;}['_createShowHistoryButton'](){const _0x24738b=new _0x2b981b(this['locale']),_0x38d4e8=this['resultsView'],_0x3c7798=this['locale'];_0x24738b['set']({'label':i(_0x3c7798,'History'),'withText':!0x1,'icon':_0x522d83['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x24738b['bind']('isOn')['to'](_0x38d4e8,'isVisible'),_0x24738b['bind']('isEnabled')['to'](this,'isEnabled'),_0x24738b['on']('execute',()=>{_0x38d4e8['isVisible']=!_0x38d4e8['isVisible'],_0x38d4e8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x128573=()=>{_0x1dd5c9['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x102e0c=new st(this['queryView']['fieldView']['element']),_0x1e86ba=_0x102e0c['width'],_0x1880cc='rtl'===_0x3c7798['uiLanguageDirection']?'left':'right';_0x102e0c['excludeScrollbarsAndBorders'](),_0x24738b['element']['style'][_0x1880cc]=_0x1e86ba-_0x102e0c['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x128573),this['on']('render',_0x128573),_0x24738b;}['submit'](){const _0x380cba=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x380cba);}['focus'](_0x5093a0){-0x1===_0x5093a0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4736ba){super(_0x4736ba),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4736ba,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x19adfd=0x0;for(const _0x4d34dc of this['items'])_0x19adfd+=_0x4d34dc['items']['length'];return{'resultsCount':_0x19adfd,'totalItemsCount':_0x19adfd};}['_createClearHistoryButton'](){const _0x1656d7=this['locale'],_0x291595=new _0x2b981b(this['locale']);return _0x291595['set']({'label':'('+i(_0x1656d7,'Clear')+')','withText':!0x0}),_0x291595['on']('execute',()=>this['fire']('clearHistory')),_0x291595;}}class hs extends _0x39988d{constructor(_0x70fe87){super();const _0x5df28f=new te(),_0x49364c=new _0x2b981b(this['locale'],_0x5df28f);this['children']['add'](_0x49364c),_0x49364c['set']({'label':_0x70fe87['prompt'],'withText':!0x0}),_0x49364c['on']('execute',()=>{this['fire']('execute',{'value':_0x522a75(_0x70fe87['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x1cb9bb{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x46c30e,_0x47a0fc)=>{const _0x213433=Ss(_0x47a0fc['prompt']);for(const _0x4c0866 of this)if(_0x4c0866!=_0x47a0fc&&Ss(_0x4c0866['prompt'])===_0x213433){this['remove'](_0x4c0866);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x367bc8=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x367bc8));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x3352ca=>_0x3352ca)));}}function Ss(_0x10d7c1){return _0x10d7c1['toLowerCase']()['trim']();}class k extends _0x5b848a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x258948,_0x4c1def,_0x15b3fb=''){super(_0x258948),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 os(),this['errorView']=new rt(_0x258948),this['contentArea']=new X(_0x258948,_0x15b3fb),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 _0x21e63b(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x48bbf9({'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 _0x5800ef=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4c1def],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5800ef['if']('isError','ck-hidden',_0x1ecc39=>!_0x1ecc39)]},'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'](_0x40459e=0x1){-0x1===_0x40459e?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 _0x249f13=this['locale'],_0xf54625=new ht(_0x249f13,{'queryView':{'label':i(_0x249f13,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xebfc45,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x249f13,'Empty\x20history'),'secondary':i(_0x249f13,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf54625['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x45dc9f,_0x5035a6)=>_0x45dc9f&&!_0x5035a6),this['listenTo'](_0xf54625,'submit',(_0x4c852b,_0x6ca3d2)=>{this['prompt']=_0x6ca3d2;const _0x40f572=_0x1ca36f(_0x6ca3d2);this['fire']('submitPrompt',_0x40f572),_0x6ca3d2['trim']()&&this['_promptHistory']['add']({'prompt':_0x40f572},0x0);},{'priority':'high'}),_0xf54625;}['_createHistoryView'](){const _0x23d4d1=new rs(this['locale']);return _0x23d4d1['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x23d4d1['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x23d4d1;}['_createToolbar'](){const _0x46f669=new at(this['locale']);return _0x46f669['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5e4498,_0x4e8729,_0x3d3438)=>_0x5e4498&&!_0x4e8729&&!!_0x3d3438),_0x46f669['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x46f669['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4bf38c,_0x19b7b8,_0x25eb3c)=>_0x4bf38c&&!_0x19b7b8&&!!_0x25eb3c),_0x46f669['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x46f669['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3f181c,_0x5ea2bb)=>_0x3f181c&&!_0x5ea2bb),_0x46f669['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x46f669['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x46f669['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x46f669;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2b95e3=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2b95e3,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x9db727){const _0x32748b=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x9db727||i(_0x32748b,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0xc924d8{['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[_0x2a385d,a,K,_0x407e06];}constructor(_0x2209f3){super(_0x2209f3),_0x2209f3['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2209f3['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2209f3['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2209f3['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x38108f}=this;this['_aiAdapter']=_0x38108f['plugins']['get'](K),this['_dialog']=_0x38108f['plugins']['get'](_0x407e06),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1b1adc=new E(_0x38108f,Array['from'](this['_commandDefinitions']['values']()));_0x38108f['commands']['add']('showAIAssistant',_0x1b1adc),_0x38108f['ui']['componentFactory']['add']('aiCommands',_0x5c4421=>{const _0x2e6cf5=_0xf86420(_0x5c4421);return _0x2e6cf5['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x2e6cf5['buttonView']['set']({'label':i(_0x5c4421,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x2e6cf5['on']('execute',_0x19c48c=>this['_onExecute'](_0x19c48c['source']['id'])),_0x10552a(_0x2e6cf5,_0x38108f['ui']['view']['body'],function(_0x3ab41c){const _0x852f7=o(_0x3ab41c['config']['get']('ai.aiAssistant.commands'),_0x3ab41c['locale']),_0x18a840=U(_0x3ab41c,_0x852f7)['filter'](_0x44097b=>_0x44097b['commands']['length']);if(0x1===_0x18a840['length'])return U(_0x3ab41c,_0x18a840[0x0]['commands'])['map'](_0x301726=>({'id':_0x301726['id'],'label':_0x301726['label']}));return _0x18a840['map'](_0x47fbf1=>{const {groupId:_0x2cad27,groupLabel:_0x21a72b,commands:_0x26a7db}=_0x47fbf1,_0x2f4f80=U(_0x3ab41c,_0x26a7db)['map'](_0x1075ea=>({'id':_0x1075ea['id'],'label':_0x1075ea['label']}));return{'id':_0x2cad27,'menu':_0x21a72b||_0x2cad27,'children':_0x2f4f80};});}(_0x38108f),{'ariaLabel':i(_0x5c4421,'AI\x20Commands')}),_0x2e6cf5['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1b1adc['on']('change:enabledCommandsIds',_0x589c17),_0x2e6cf5['menuView']['once']('render',_0x589c17),_0x2e6cf5;function _0x589c17(){_0x2e6cf5['isEnabled']=_0x1b1adc['enabledCommandsIds']['length']>0x0;for(const _0x555775 of _0x2e6cf5['menuView']['buttons'])_0x555775['isEnabled']=_0x1b1adc['enabledCommandsIds']['includes'](_0x555775['id']);}}),_0x38108f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3e2d0b=>{const _0x59b0c1=new _0x4507e7(_0x3e2d0b);_0x59b0c1['buttonView']['set']({'label':i(_0x3e2d0b,'AI\x20Commands'),'icon':T}),_0x59b0c1['bind']('isEnabled')['to'](_0x1b1adc,'enabledCommandsIds',_0x46df04=>_0x46df04['length']>0x0);const _0x148a95=o(_0x38108f['config']['get']('ai.aiAssistant.commands'),_0x3e2d0b);return this['_populateMenuBarMenu'](_0x1b1adc,_0x59b0c1,_0x148a95,_0x241e8d=>this['_onExecute'](_0x241e8d)),_0x59b0c1;}),_0x38108f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2d7e18=this['_createAIAssistantUIButton'](_0x2b981b);return _0x2d7e18['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2d7e18;}),_0x38108f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1caca9=this['_createAIAssistantUIButton'](_0x467b5c);return _0x1caca9['set']({'role':'menuitemcheckbox'}),_0x1caca9;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x119911=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x47e627;for(const _0x22fb42 in _0x119911){const _0x270c51=_0x22fb42,_0x4e5a5b=_0x119911[_0x270c51];if('aiLicenseKeyValid'==_0x4e5a5b||'aiLicenseKeyInvalid'==_0x4e5a5b||'aiLicenseKeyExpired'==_0x4e5a5b||'aiLicenseKeyDomainLimit'==_0x4e5a5b||'aiLicenseKeyNotAllowed'==_0x4e5a5b||'aiLicenseKeyEvaluationLimit'==_0x4e5a5b||'aiLicenseKeyTrialLimit'==_0x4e5a5b||'aiLicenseKeyUsageLimit'==_0x4e5a5b){delete _0x119911[_0x270c51],_0x47e627=_0x4e5a5b,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x47e627&&_0x119911['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x47e627&&_0x119911['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x47e627&&_0x119911['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x47e627&&_0x119911['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x47e627&&_0x119911['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x47e627&&_0x119911['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x47e627&&_0x119911['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x222a68='',_0x474b77='',_0x245f14='custom'){const _0x25b0bc=this['editor'],_0x443ed5=_0x25b0bc['editing']['view'],_0x4a7246=_0x25b0bc['plugins']['get'](a),_0x4c6809=_0x25b0bc['plugins']['get'](_0x2a385d);_0x4a7246['showFakeVisualSelection']();const _0x279897=new w(),_0x1fa33c=new ClipboardEvent('copy',{'clipboardData':_0x279897}),_0x1cb2e8=new _0x525304(_0x279897),_0x51810b=new _0x2aaf62(_0x443ed5,_0x1fa33c,{'dataTransfer':_0x1cb2e8});_0x4c6809['_forceMarkersCopy']('comment',()=>{_0x443ed5['document']['fire']('copy',_0x51810b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x25b0bc,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x25ca45=_0x1cb2e8['getData']('text/html');const _0x88a02a=_0x25b0bc['model']['document']['selection'],_0x911428=Array['from'](_0x88a02a['getRanges']());0x1===_0x911428['length']&&_0x911428[0x0]['isFlat']&&!_0x88a02a['getSelectedElement']()&&''!==_0x25ca45['replace'](/ /g,'')['trim']()&&(_0x25ca45='<p>'+_0x25ca45+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x245f14,'query':_0x222a68,'htmlContent':_0x25ca45,'label':_0x474b77,'mainActionLabel':M[_0x25b0bc['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2f2b27['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4a7246['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x98e5f2=new Map(),_0x3ac554=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x45461a of _0x3ac554)for(const _0x57fbf4 of _0x45461a['commands'])_0x98e5f2['set'](_0x57fbf4['id'],{..._0x57fbf4,'groupId':_0x45461a['groupId'],'groupLabel':_0x45461a['groupLabel']||_0x45461a['groupId']});return _0x98e5f2;}['_createAIAssistantUIButton'](_0x1a2d92){const _0x5f0235=this['editor'],_0x317791=_0x5f0235['commands']['get']('showAIAssistant'),_0x383e22=new _0x1a2d92(_0x5f0235['locale']);return _0x383e22['set']({'label':i(_0x5f0235['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x383e22['bind']('isEnabled')['to'](_0x317791),_0x383e22['bind']('isOn')['to'](this['_dialog'],'id',_0x375469=>'aiAssistant'===_0x375469),this['listenTo'](_0x383e22,'execute',()=>{_0x383e22['isOn']?this['hideUI']():_0x317791['execute']();}),_0x383e22;}['_initView'](){const _0x55119c=this['editor']['plugins']['get'](a);this['_formView']=new k(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',()=>{_0x55119c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x55119c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5539b0,ui:{ariaLiveAnnouncer:_0x43ee24}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x39e496,_0x106564,_0xc5771c)=>{const _0x24bd18=this['_aiAssistantController']['currentContext'];_0xc5771c?_0x43ee24['announce'](i(_0x5539b0,'AI\x20is\x20writing')):_0x24bd18&&_0x43ee24['announce'](i(_0x5539b0,'Generated\x20content:\x20%0',_0x24bd18),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3dc347,_0x431245,_0x190fc2)=>{if(_0x190fc2){const _0x508177=this['_formView']['errorView']['text'];_0x43ee24['announce'](i(_0x5539b0,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x508177));}});}['_onExecute'](_0x8407f1){const _0x5dcf19=this['_commandDefinitions']['get'](_0x8407f1),_0x19ad4a=this['editor'],_0x239989=_0x19ad4a['model']['document']['selection'],_0x1c8292=_0x19ad4a['commands']['get']('showAIAssistant'),_0x286e08=_0x19ad4a['plugins']['get'](a),_0x5c43d4=''+(_0x5dcf19['groupId']!==x?_0x5dcf19['groupLabel']+':\x20':'')+_0x5dcf19['label'];if(!0x1!==_0x5dcf19['requiresContent']&&_0x239989['isCollapsed']){const _0x4e9cb1=_0x32d55e(_0x239989['getSelectedBlocks']())||_0x19ad4a['model']['schema']['getLimitElement'](_0x239989);_0x19ad4a['model']['change'](_0x32a567=>{_0x32a567['setSelection'](_0x4e9cb1,'in');});}_0x286e08['showFakeVisualSelection'](),_0x1c8292['execute'](_0x5dcf19['prompt'],_0x5c43d4,'command:'+_0x8407f1);}['_populateMenuBarMenu'](_0xf122d5,_0x12bdf7,_0x1b8ba6,_0x3280bf){const _0x1058d1=this['editor'],_0x18fe87=_0x1058d1['locale'],_0x3a683c=new _0x458fdc(_0x18fe87),_0x1b2e7d=U(_0x1058d1,_0x1b8ba6)['filter'](_0x42edc7=>_0x42edc7['commands']['length']);0x1===_0x1b2e7d['length']?this['_getMenuBarGroupButtons']({'command':_0xf122d5,'commands':_0x1b2e7d[0x0]['commands'],'parentMenuView':_0x12bdf7,'onExecute':_0x3280bf})['forEach'](_0x3c4855=>_0x3a683c['items']['add'](_0x3c4855)):_0x1b2e7d['forEach'](({groupId:_0x23b9f2,groupLabel:_0x1ae647,commands:_0x3f6a09})=>{const _0x3f0f02=new _0x563a5a(_0x18fe87,_0x12bdf7),_0x444191=new _0x4507e7(_0x18fe87),_0x453304=new _0x458fdc(_0x18fe87),_0x220dbf=this['_getMenuBarGroupButtons']({'command':_0xf122d5,'commands':_0x3f6a09,'parentMenuView':_0x444191,'onExecute':_0x3280bf});_0x444191['buttonView']['set']({'label':_0x1ae647||_0x23b9f2}),_0x444191['delegate']('execute')['to'](_0x12bdf7),_0x453304['items']['addMany'](_0x220dbf),_0x444191['panelView']['children']['add'](_0x453304),_0x3f0f02['children']['add'](_0x444191),_0x3a683c['items']['add'](_0x3f0f02);}),_0x12bdf7['panelView']['children']['add'](_0x3a683c);}['_getMenuBarGroupButtons']({command:_0x2ded4e,commands:_0x3ccf27,parentMenuView:_0x472e13,onExecute:_0x534cfb}){const _0x257529=this['editor'],_0x328af7=_0x257529['locale'];return U(_0x257529,_0x3ccf27)['map'](_0x9bbdbd=>{const _0x55dbfc=new _0x563a5a(_0x328af7,_0x472e13),_0x4991e0=new _0x467b5c(_0x328af7);return _0x4991e0['set']({'label':_0x9bbdbd['label']}),_0x4991e0['delegate']('execute')['to'](_0x472e13),_0x4991e0['on']('execute',()=>_0x534cfb(_0x9bbdbd['id'])),_0x4991e0['bind']('isEnabled')['to'](_0x2ded4e,'enabledCommandsIds',_0x4755cf=>_0x4755cf['includes'](_0x9bbdbd['id'])),_0x55dbfc['children']['add'](_0x4991e0),_0x55dbfc;});}}function B(_0xd026c3,_0x46f277){return void 0x0!==_0xd026c3['order']&&void 0x0===_0x46f277['order']?0x1:void 0x0===_0xd026c3['order']&&void 0x0!==_0x46f277['order']?-0x1:void 0x0!==_0xd026c3['order']&&void 0x0!==_0x46f277['order']?_0xd026c3['order']-_0x46f277['order']:0x0;}function U(_0x577f11,_0xf78836){_0xf78836['sort'](B);const _0x3ee315={},_0x674185=[];for(const _0x1e33ff of _0xf78836)if(void 0x0!==_0x1e33ff['order']){if(_0x1e33ff['order']in _0x3ee315)throw new _0x567ba8('ai-commands-config-order-collision',_0x577f11,{'conflictingDefinitions':[_0x1e33ff,_0x3ee315[_0x1e33ff['order']]]});_0x3ee315[_0x1e33ff['order']]=_0x1e33ff,_0x674185['splice'](_0x1e33ff['order'],0x0,_0x1e33ff);}else _0x674185['push'](_0x1e33ff);return _0x674185;}class r extends _0xc924d8{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3cf5d8){super(_0x3cf5d8);const _0x2923b5=_0x3cf5d8['config'],_0x435828=_0x3cf5d8['locale'];_0x2923b5['define']('ai.aiAssistant.preserveComments',!0x0),_0x2923b5['define']('ai.aiAssistant.commands',function(_0xb50aa8){return[{'groupId':'editOrReview','groupLabel':i(_0xb50aa8,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0xb50aa8,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0xb50aa8,'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(_0xb50aa8,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0xb50aa8,'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(_0xb50aa8,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0xb50aa8,'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(_0xb50aa8,'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(_0xb50aa8,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0xb50aa8,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0xb50aa8,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0xb50aa8,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0xb50aa8,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0xb50aa8,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0xb50aa8,'Change\x20style'),'commands':[{'id':'business','label':i(_0xb50aa8,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0xb50aa8,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0xb50aa8,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0xb50aa8,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0xb50aa8,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0xb50aa8,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0xb50aa8,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0xb50aa8,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0xb50aa8,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0xb50aa8,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0xb50aa8,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0xb50aa8,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0xb50aa8,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x435828)),_0x2923b5['define']('ai.aiAssistant.extraCommandGroups',[]),_0x2923b5['define']('ai.aiAssistant.removeCommands',[]);let _0x55d13e=o(_0x2923b5['get']('ai.aiAssistant.commands'),_0x435828);const _0x24f21e=_0x2923b5['get']('ai.aiAssistant.extraCommandGroups'),_0x45fca8=_0x2923b5['get']('ai.aiAssistant.removeCommands');_0x24f21e['forEach'](_0x15501f=>{const _0x3f23cd=_0x55d13e['find'](_0x555274=>_0x555274['groupId']===_0x15501f['groupId']);_0x3f23cd?_0x3f23cd['commands']=_0x3f23cd['commands']['concat'](_0x15501f['commands']):_0x55d13e['push'](_0x15501f);}),_0x55d13e=_0x55d13e['filter'](_0x3317c2=>!_0x45fca8['includes'](_0x3317c2['groupId'])),_0x55d13e['forEach'](_0x3666f7=>{_0x3666f7['commands']=_0x3666f7['commands']['filter'](_0x58c809=>!_0x45fca8['includes'](_0x58c809['id']));}),_0x2923b5['set']('ai.aiAssistant.commands',_0x55d13e);}}class P extends _0xc924d8{['abortController'];static get['requires'](){return[K];}constructor(_0x5be120){super(_0x5be120),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x427347){return this['sendRequest'](_0x427347)['catch'](_0x3e0a88=>{if(_0x3e0a88 instanceof R)return Promise['reject'](_0x3e0a88);if('AbortError'==_0x3e0a88['name'])return Promise['resolve']();throw console['error'](_0x3e0a88),new _0x567ba8('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5efec6,_0x2cf71a){const _0x27c71b=this['editor']['locale'],_0x5d522f={'Content-Type':'application/json'};if('object'==typeof _0x5efec6)Object['assign'](_0x5d522f,_0x5efec6);else{if(_0x5efec6)try{const _0x4da353=await _0x5efec6(_0x2cf71a);Object['assign'](_0x5d522f,_0x4da353);}catch(_0x276549){return Promise['reject'](new R(i(_0x27c71b,'AI_ERROR_GET_HEADERS')));}}return _0x5d522f;}async['_prepareRequestParameters'](_0x3e302b,_0x1ce485){const _0x11b8b8=this['editor']['locale'];if('object'==typeof _0x3e302b)return _0x3e302b;try{return await _0x3e302b(_0x1ce485);}catch(_0x4d5b2e){return Promise['reject'](new R(i(_0x11b8b8,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x95566e){super(_0x95566e),_0x95566e['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x95566e['config']['get']('ai.openAI.requestParameters')||_0x95566e['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x95566e['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x95566e['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x95566e['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x27f875,context:_0x3cfd05,onData:_0x59887a,actionId:_0x28f36c}){const _0x28b541=this['editor']['locale'],_0x3135f9=await this['prepareMessages'](_0x27f875,_0x3cfd05,_0x28f36c),_0x179f90=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x28f36c),_0x2e4060=await this['_prepareRequestParameters'](this['_requestParameters'],_0x28f36c),_0x556f8f={'messages':_0x3135f9,..._0x2e4060},_0x480210={'method':'POST','headers':_0x179f90,'body':JSON['stringify'](_0x556f8f),'signal':this['abortController']['signal']},_0x128a81=await fetch(this['_apiUrl'],_0x480210);if(_0x128a81['ok'])return _0x2e4060['stream']?await this['_readStreamableResponse'](_0x128a81,_0x59887a):await this['_readStaticResponse'](_0x128a81,_0x59887a),Promise['resolve']();{const _0x37a7db=await _0x128a81['text']();return _0x37a7db['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x28b541,'AI_ERROR_CONTEXT_LENGTH'))):_0x37a7db['includes']('Moderation')?Promise['reject'](new R(i(_0x28b541,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x37a7db));}}async['prepareMessages'](_0x2aeba4,_0x4cd8e1,_0x1c3e14){let _0x2fe640,_0x33c69f;return _0x4cd8e1?(_0x2fe640='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.',_0x33c69f='Instruction:\x0a'+_0x2aeba4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4cd8e1):(_0x2fe640='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.',_0x33c69f=_0x2aeba4),[{'role':'system','content':_0x2fe640},{'role':'user','content':_0x33c69f}];}async['_readStreamableResponse'](_0x23b83b,_0x1aee3d){const _0x2058f2=_0x23b83b['body']['getReader'](),_0x4bf0e0=new TextDecoder();let _0x4cd281='',_0x1520b2='',_0x43e5e5='',_0x2c7abc=!0x1;for(;!_0x2c7abc;){const {done:_0x18537c,value:_0x50ca0a}=await _0x2058f2['read'](),_0x1d8aa5=_0x4cd281+_0x4bf0e0['decode'](_0x50ca0a);let _0xadd615='';_0x2c7abc=_0x18537c;try{_0xadd615=this['_cleanUpData'](_0x1d8aa5),_0x4cd281='';}catch(_0x2dcd76){_0x4cd281=_0x1d8aa5;continue;}_0x1520b2+=_0xadd615,!_0x2c7abc&&this['_isBufferIncomplete'](_0x1520b2)||_0x1520b2&&(_0x43e5e5+=_0x1520b2,_0x1520b2='',_0x1aee3d(_0x43e5e5));}return Promise['resolve']();}async['_readStaticResponse'](_0x249190,_0x5489d6){return _0x5489d6((await _0x249190['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x366f49){const _0x3b02c7=_0x366f49['split']('<')['length']!==_0x366f49['split']('>')['length'],_0x11562f=_0x366f49['length']<0x1e;return _0x3b02c7&&_0x11562f;}['_cleanUpData'](_0x3bbc33){return _0x3bbc33['split'](/\n(?![^{]*\})/g)['map'](_0xf3f574=>_0xf3f574['replace']('data:\x20',''))['filter'](_0x453cd4=>_0x453cd4&&_0x453cd4['length']>0x0&&'[DONE]'!==_0x453cd4)['map'](_0x140379=>{const {choices:_0x46bd2d}=JSON['parse'](_0x140379);if(_0x46bd2d[0x0]&&_0x46bd2d[0x0]['delta']&&_0x46bd2d[0x0]['delta']['content'])return _0x46bd2d[0x0]['delta']['content'];})['filter'](_0x508caf=>_0x508caf)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x168829){super(_0x168829),_0x168829['config']['get']('ai.aws.requestParameters')||_0x168829['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']=_0x168829['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x168829['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x168829['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x168829['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4f8eb2,context:_0x441ffc,onData:_0x852819,actionId:_0x4b0322}){const {model:_0x392e45,stream:_0x1c9514,..._0x11005a}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4b0322),_0x1b7f1c={'prompt':await this['preparePrompt'](_0x4f8eb2,_0x441ffc,_0x392e45,_0x4b0322),..._0x11005a};this['_apiUrl']?await this['_processProxyRequest'](_0x1b7f1c,_0x392e45,_0x1c9514,_0x852819,_0x4b0322):await this['_processAWSRequest'](_0x1b7f1c,_0x392e45,_0x1c9514,_0x852819);}async['preparePrompt'](_0x4cf0a8,_0x478086,_0x41804e,_0x1003cf){let _0x3792a0,_0x4dc222;return _0x478086?(_0x3792a0='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.',_0x4dc222='Instruction:\x0a'+_0x4cf0a8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x478086):(_0x3792a0='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.',_0x4dc222=_0x4cf0a8),'meta.llama'==this['getModelFamily'](_0x41804e)?'<<SYS>>\x0a'+_0x3792a0+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4dc222+'\x0a[/INST]':'Human:\x0a'+_0x3792a0+'\x0a'+_0x4dc222+'\x0a\x0aAssistant:';}['getModelFamily'](_0x22ff9d){if(/^anthropic\.claude/['test'](_0x22ff9d))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x22ff9d))return'ai21.j2';if(/^cohere\.command/['test'](_0x22ff9d))return'cohere.command';if(/^meta\.llama/['test'](_0x22ff9d))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x22ff9d));}async['_processProxyRequest'](_0x27d60b,_0x485208,_0x1cff27,_0x4ad5bc,_0x3d3ab2){const _0x2e1635={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3d3ab2),'body':JSON['stringify']({..._0x27d60b,'model':_0x485208,'stream':_0x1cff27}),'signal':this['abortController']['signal']},_0x3660f5=await fetch(this['_apiUrl'],_0x2e1635);_0x1cff27?await this['_readStreamableResponse'](_0x3660f5,_0x485208,_0x4ad5bc):await this['_readStaticResponse'](_0x3660f5,_0x485208,_0x4ad5bc);}async['_processAWSRequest'](_0x508b28,_0x357b81,_0x18540e,_0x3f5c52){const _0x46e4f2=new _0x14af6e(this['_bedrockClientConfig']),_0x3fc1c8={'body':JSON['stringify'](_0x508b28),'contentType':'application/json','accept':'application/json','modelId':_0x357b81};let _0xfbf721;if(_0x18540e){const _0x434992=new _0x5b5899(_0x3fc1c8);_0xfbf721=await _0x46e4f2['send'](_0x434992,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xfbf721,_0x357b81,_0x3f5c52);}else{const _0xdffc2b=new _0x463689(_0x3fc1c8);_0xfbf721=await _0x46e4f2['send'](_0xdffc2b,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xfbf721,_0x357b81,_0x3f5c52);}}async['_readAsyncIterableResponse'](_0x4d7b57,_0x5e08bd,_0x1c1a39){const _0x7fbf8e=_0x4d7b57['body'],_0x42264a=new TextDecoder('utf-8');let _0x3220ab='';for await(const _0x542e94 of _0x7fbf8e)if(_0x542e94['chunk']){const _0x2da327=_0x42264a['decode'](_0x542e94['chunk']['bytes']),_0x1f85ce=JSON['parse'](_0x2da327);_0x3220ab+=this['_getGeneratedText'](_0x1f85ce,_0x5e08bd),_0x1c1a39(_0x3220ab);}return Promise['resolve']();}async['_readStreamableResponse'](_0x48e00e,_0x255f65,_0xaa746){const _0xcdf618=_0x48e00e['body'],_0x683582=new TextDecoder('utf-8'),_0x296b04=_0xcdf618['getReader']();let _0x574509='',_0x1046a5='',_0x1ff245=!0x1;for(;!_0x1ff245;){const {done:_0x1956eb,value:_0x190b5f}=await _0x296b04['read']();if(_0x1ff245=_0x1956eb,_0x1ff245)break;const _0x1cf56c=(_0x574509+_0x683582['decode'](_0x190b5f))['split']('\x0a')['map'](_0x42cd5b=>{try{return _0x574509='',JSON['parse'](_0x42cd5b);}catch(_0x2d1c10){return _0x574509=_0x42cd5b,null;}})['filter'](_0x240bc1=>null!==_0x240bc1);_0x1cf56c['length']&&(_0x1046a5+=_0x1cf56c['map'](_0x2c78e8=>this['_getGeneratedText'](_0x2c78e8,_0x255f65))['join'](''),_0xaa746(_0x1046a5));}return Promise['resolve']();}async['_readStaticResponse'](_0x2db993,_0x2dfce1,_0x560c4a){let _0x13bbcd;return _0x13bbcd=_0x2db993 instanceof Response?await _0x2db993['json']():JSON['parse'](Buffer['from'](_0x2db993['body'])['toString']('utf8')),(_0x560c4a(this['_getGeneratedText'](_0x13bbcd,_0x2dfce1)),Promise['resolve']());}['_getGeneratedText'](_0x85e1b9,_0x267a86){switch(this['getModelFamily'](_0x267a86)){case'anthropic.claude':return _0x85e1b9['completion'];case'ai21.j2':return _0x85e1b9['completions'][0x0]['data']['text'];case'cohere.command':return _0x85e1b9['generations'][0x0]['text'];case'meta.llama':return _0x85e1b9['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x51a70f=>0x1!=_0x51a70f}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x186256=>{const {af:{dictionary:_0x7e3176,getPluralForm:_0x26e46e}}={'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0xdf87a9=>0x1!=_0xdf87a9}};_0x186256['af']||={'dictionary':{},'getPluralForm':null},_0x186256['af']['dictionary']=Object['assign'](_0x186256['af']['dictionary'],_0x7e3176),_0x186256['af']['getPluralForm']=_0x26e46e;})(window['CKEDITOR_TRANSLATIONS']||={});
|
package/dist/translations/ar.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':
|
|
23
|
+
export default{'ar':{'dictionary':{'Edit\x20or\x20review':'التحرير\x20أو\x20المراجعة','Improve\x20writing':'قم\x20بتحسين\x20الكتابة','Make\x20shorter':'اجعله\x20أقصر','Make\x20longer':'اجعله\x20أطول','Simplify\x20language':'قم\x20بتبسيط\x20اللغة','Generate\x20from\x20selection':'قم\x20بالإنشاء\x20من\x20التحديد','Summarize':'تلخيص','Continue':'متابعة','Change\x20tone':'تغيير\x20الأسلوب','Professional':'احترافي','Casual':'غير\x20رسمي','Direct':'مباشر','Confident':'لهجة\x20واثقة','Friendly':'ودي','Change\x20style':'تغيير\x20الأسلوب','Business':'تجاري','Legal':'قانوني','Journalism':'الكتابة\x20الصحفية','Poetic':'شِعري','Translate':'ترجِمْ','English':'الإنكليزية','Spanish':'الإسبانية','German':'الألمانية','Portuguese':'البرتغالية','French':'الفرنسية','Simplified\x20Chinese':'الصينية\x20المبسطة','Hindi':'الهندية','Arabic':'العربية','AI\x20Assistant':'مساعد\x20الذكاء\x20الاصطناعي','AI\x20Commands':'أوامر\x20الذكاء\x20الاصطناعي','Ask\x20AI\x20to\x20edit\x20or\x20generate':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بالتحرير\x20أو\x20الإنشاء','Ask\x20AI\x20to\x20improve\x20generated\x20text':'اطلب\x20من\x20الذكاء\x20الاصطناعي\x20أن\x20يقوم\x20بتحسين\x20النص\x20الذي\x20تم\x20إنشاؤه','Copy':'نسخ','Submit':'إرسال','Insert\x20below':'أدخل\x20أدناه','Try\x20again':'حاول\x20مجددًا','Stop':'إيقاف','AI\x20is\x20writing...':'يقوم\x20الذكاء\x20الاصطناعي\x20بالكتابة...','AI\x20is\x20writing':'يكتب\x20الذكاء\x20الاصطناعي','Generated\x20content:\x20%0':'المحتوى\x20الذي\x20تم\x20إنشاؤه:\x20%0','Error\x20during\x20AI\x20content\x20generation:\x20%0':'حدث\x20خطأ\x20أثناء\x20إنشاء\x20محتوى\x20الذكاء\x20الاصطناعي:\x20%0','History':'سجل\x20المحفوظات','Empty\x20history':'السجل\x20فارغ','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'سيتم\x20إدراج\x20الطلبات\x20التي\x20طلبتها\x20من\x20الذكاء\x20الاصطناعي\x20والتوجيهات\x20الخاصة\x20بك\x20هنا\x20لكي\x20يتم\x20استخدامها\x20لاحقًا.','Prompt\x20history':'سجل\x20التوجيهات','AI_REPLACE_CONTENT':'استبدال','AI_INSERT_CONTENT':'إدراج','AI_ERROR_GET_HEADERS':'فشلت\x20عملية\x20تحضير\x20عناوين\x20الطلبات','AI_ERROR_GET_PARAMETERS':'لقد\x20فشلت\x20عملية\x20إعداد\x20معلمات\x20الطلب','AI_ERROR_UNSUPPORTED_MODEL':'إن\x20نموذج\x20AI\x20المطلوب\x20(\x22%0\x22)\x20غير\x20مدعوم','AI_ERROR_CONTEXT_LENGTH':'المحتوى\x20المحدد\x20طويل\x20جداً','AI_ERROR_MODERATION':'الاستعلام\x20المطلوب\x20لا\x20يجتاز\x20قواعد\x20الإشراف','AI_ERROR_FAILED':'لقد\x20فشل\x20التواصل\x20مع\x20خدمة\x20الذكاء\x20الاصطناعي','Other':'آخر'},'getPluralForm':_0x310012=>0x0==_0x310012?0x0:0x1==_0x310012?0x1:0x2==_0x310012?0x2:_0x310012%0x64>=0x3&&_0x310012%0x64<=0xa?0x3:_0x310012%0x64>=0xb?0x4:0x5}};
|