@ckeditor/ckeditor5-ai 44.2.1-alpha.0 → 44.2.1
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 _0x37ddd7,Command as _0x4422c6,icons as _0x377107}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x564883,CKEditorError as _0xb62f77,ObservableMixin as _0x788f7,global as _0x3e472a,isVisible as it,Rect as st,Collection as _0x3fc6d8,FocusTracker as _0x50d46f,KeystrokeHandler as ts,first as _0x57dd9a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x42f839,View as _0x5aa727,SpinnerView as _0x302c94,IconView as _0x80b91,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x47be89,ButtonLabelView as te,FocusCycler as _0x8737d7,createLabeledTextarea as _0x405fed,Dialog as _0x4a9066,createDropdown as _0x66dc23,addMenuToDropdown as _0x1a76a4,MenuBarMenuView as _0xf45a89,MenuBarMenuListItemButtonView as _0x37c151,DialogViewPosition as _0x538236,MenuBarMenuListView as _0xa976f6,MenuBarMenuListItemView as _0x56307f}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x510a34,ClipboardMarkersUtils as _0x3f129c}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x160a4f,DataTransfer as _0x458830,UpcastWriter as _0x411509,Matcher as _0x31c510}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x10126d,escape as _0x33f6b0}from'lodash-es';import{BedrockRuntimeClient as _0x8cb6c9,InvokeModelWithResponseStreamCommand as _0x50da33,InvokeModelCommand as _0x15a3c9}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x213aea,_0x2efd1a){const _0x568ba2=(0x0,_0x2efd1a['t'])('Other');return _0x213aea['length']?'groupId'in _0x213aea[0x0]?_0x213aea:[{'groupId':x,'groupLabel':_0x568ba2,'order':0x1/0x0,'commands':_0x213aea}]:[{'groupId':x,'groupLabel':_0x568ba2,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x37ddd7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5bc4de}=this,_0x5cbc9e=['ck-fake-ai-selection'];_0x5bc4de['config']['get']('ai.useTheme')&&_0x5cbc9e['push']('ck-ai-assistant-ui_theme'),_0x5bc4de['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x5cbc9e,'priority':0xc}}),_0x5bc4de['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x224d94,{writer:_0xd75814})=>{if(!_0x224d94['markerRange']['isCollapsed'])return null;const _0x5609e1=_0xd75814['createUIElement']('span');return _0xd75814['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x5609e1),_0x5609e1;}});}['afterInit'](){!async function(_0x1ac8e0){const _0x3bf325=_0x475a0f([0x70,0x36,0x38,0x77,0x58,0x75,0x41,0x46,0x4b,0x32,0x42,0x35,0x67,0x4a,0x55,0x30,0x44,0x59,0x48,0x62,0x4e,0x5a,0x52,0x6c,0x43,0x31,0x57,0x4f,0x79,0x69,0x6d,0x6a,0x56,0x45,0x54,0x34,0x50,0x47,0x6f,0x64,0x4c,0x63,0x73,0x39,0x68,0x4d,0x65,0x6b,0x74,0x49,0x71,0x7a,0x6e,0x33,0x66,0x72,0x61,0x51,0x76,0x53,0x37,0x78]),_0x38701c=0x66c5689f,_0x4a1fd3=0x66c2376f^_0x38701c,_0x3f8b35=window[_0x475a0f([0x44,0x61,0x74,0x65])][_0x475a0f([0x6e,0x6f,0x77])](),_0x52437e=_0x1ac8e0[_0x475a0f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x34dd97=new window[(_0x475a0f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5b65e9=>{_0x52437e[_0x475a0f([0x6f,0x6e,0x63,0x65])](_0x475a0f([0x72,0x65,0x61,0x64,0x79]),_0x5b65e9);}),_0x1a87dc={[_0x475a0f([0x6b,0x74,0x79])]:_0x475a0f([0x45,0x43]),[_0x475a0f([0x75,0x73,0x65])]:_0x475a0f([0x73,0x69,0x67]),[_0x475a0f([0x63,0x72,0x76])]:_0x475a0f([0x50,0x2d,0x32,0x35,0x36]),[_0x475a0f([0x78])]:_0x475a0f([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]),[_0x475a0f([0x79])]:_0x475a0f([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]),[_0x475a0f([0x61,0x6c,0x67])]:_0x475a0f([0x45,0x53,0x32,0x35,0x36])},_0x1989d1=_0x52437e[_0x475a0f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x475a0f([0x67,0x65,0x74])](_0x475a0f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x3929d0(){let _0x39049b,_0x1e6a11=null,_0x17227e=null;try{if(_0x1989d1==_0x475a0f([0x47,0x50,0x4c]))return _0x475a0f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x39049b=_0x24cd8e(),!_0x39049b)return _0x475a0f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x39049b[_0x475a0f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x17227e=_0x3b0da9(_0x39049b[_0x475a0f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x39049b[_0x475a0f([0x6a,0x74,0x69])])),await _0x557ce4()?_0x1e687f()?_0x33e99a()?_0x475a0f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x57fe71()?(_0x39049b[_0x475a0f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x475a0f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1e6a11=_0x2367af(_0x475a0f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x39049b[_0x475a0f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x475a0f([0x74,0x72,0x69,0x61,0x6c])&&(_0x1e6a11=_0x2367af(_0x475a0f([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4a1cdc()):_0x475a0f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x475a0f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x475a0f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x2b38cd){return _0x475a0f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x33e99a(){const _0x5dcf1f=[_0x475a0f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x475a0f([0x74,0x72,0x69,0x61,0x6c])][_0x475a0f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x39049b[_0x475a0f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3f8b35/0x3e8:0xe10*_0x4a1fd3;return _0x39049b[_0x475a0f([0x65,0x78,0x70])]<_0x5dcf1f;}function _0x1e687f(){const _0xf9f500=_0x39049b[_0x475a0f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0xf9f500&&(!!_0xf9f500[_0x475a0f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x475a0f([0x2a]))||!!_0xf9f500[_0x475a0f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x475a0f([0x41,0x49])));}function _0x57fe71(){const _0x14d804=_0x39049b[_0x475a0f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x14d804||0x0==_0x14d804[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x57372c}=new URL(window[_0x475a0f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x14d804[_0x475a0f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x57372c))return!0x0;const _0x15d9a0=_0x57372c[_0x475a0f([0x73,0x70,0x6c,0x69,0x74])](_0x475a0f([0x2e]));return _0x14d804[_0x475a0f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x243dc3=>_0x243dc3[_0x475a0f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x475a0f([0x2a])))[_0x475a0f([0x6d,0x61,0x70])](_0x26a1e6=>_0x26a1e6[_0x475a0f([0x73,0x70,0x6c,0x69,0x74])](_0x475a0f([0x2e])))[_0x475a0f([0x73,0x6f,0x6d,0x65])](_0x27ab0e=>_0x15d9a0[_0x475a0f([0x65,0x76,0x65,0x72,0x79])]((_0x44c6cd,_0xbffa)=>_0x27ab0e[_0xbffa]===_0x44c6cd||_0x27ab0e[_0xbffa]===_0x475a0f([0x2a])));}function _0x4a1cdc(){return _0x1e6a11&&_0x17227e?new window[(_0x475a0f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3c38e8,_0x51ae3a)=>{_0x1e6a11[_0x475a0f([0x74,0x68,0x65,0x6e])](_0x3c38e8,_0x51ae3a),_0x17227e[_0x475a0f([0x74,0x68,0x65,0x6e])](_0x54358e=>{_0x54358e!=_0x475a0f([0x56,0x61,0x6c,0x69,0x64])&&_0x3c38e8(_0x54358e);},_0x51ae3a);}):_0x1e6a11||_0x17227e||_0x475a0f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3b0da9(_0x5b7f62,_0x5d5962){return new window[(_0x475a0f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3522bf=>{if(_0x1c6682())return _0x3522bf(_0x475a0f([0x56,0x61,0x6c,0x69,0x64]));_0x3b5720(),_0x52437e[_0x475a0f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x475a0f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xf8cdf1=!0x1;const _0x47cdca=_0x564883();function _0xa55672(_0x31f1f3){return!!_0x31f1f3&&(typeof _0x31f1f3===_0x475a0f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x31f1f3===_0x475a0f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x31f1f3[_0x475a0f([0x74,0x68,0x65,0x6e])]===_0x475a0f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x31f1f3[_0x475a0f([0x63,0x61,0x74,0x63,0x68])]===_0x475a0f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1f0a8c(_0x486e82){_0x546819(_0x486e82)[_0x475a0f([0x74,0x68,0x65,0x6e])](_0x927c49=>{if(!_0x927c49||_0x927c49[_0x475a0f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x475a0f([0x6f,0x6b]))return _0x475a0f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4d0ea6(_0x10f158(_0x47cdca+_0x5d5962))!=_0x927c49[_0x475a0f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x475a0f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x475a0f([0x56,0x61,0x6c,0x69,0x64]);})[_0x475a0f([0x74,0x68,0x65,0x6e])](_0x59247d=>(_0x3081de(),_0x59247d),()=>{const _0x1a54ec=_0x9c98e9();return null==_0x1a54ec?(_0x3081de(),_0x475a0f([0x56,0x61,0x6c,0x69,0x64])):_0x475a0f(_0x3f8b35-_0x1a54ec>(0x42c9ec9f^_0x38701c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x475a0f([0x74,0x68,0x65,0x6e])](_0x3522bf)[_0x475a0f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3522bf(_0x475a0f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2ff58d=0x66f3861f^_0x38701c;function _0x3081de(){const _0x396075=_0x475a0f([0x6c,0x6c,0x63,0x74,0x2d])+_0x4d0ea6(_0x10f158(_0x5b7f62)),_0x2e3748=_0x245b3f(_0x4d0ea6(window[_0x475a0f([0x4d,0x61,0x74,0x68])][_0x475a0f([0x63,0x65,0x69,0x6c])](_0x3f8b35/_0x2ff58d)));window[_0x475a0f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x475a0f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x396075,_0x2e3748);}function _0x9c98e9(){const _0x7c8abb=_0x475a0f([0x6c,0x6c,0x63,0x74,0x2d])+_0x4d0ea6(_0x10f158(_0x5b7f62)),_0x1b1582=window[_0x475a0f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x475a0f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x7c8abb);return _0x1b1582?window[_0x475a0f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x245b3f(_0x1b1582),0x10)*_0x2ff58d:null;}function _0x546819(_0x29dd3d){return new window[(_0x475a0f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2643c3,_0x4ec3fa)=>{_0x29dd3d[_0x475a0f([0x74,0x68,0x65,0x6e])](_0x2643c3,_0x4ec3fa),window[_0x475a0f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4ec3fa,0x66c4bc5f^_0x38701c);});}}_0x52437e[_0x475a0f([0x6f,0x6e])](_0x475a0f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x24c1d9,_0x5a3858)=>{if(_0x5a3858[0x0]!=_0x5b7f62)return _0x3522bf(_0x475a0f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5a3858[0x1]={..._0x5a3858[0x1],[_0x475a0f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x47cdca};},{[_0x475a0f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x475a0f([0x68,0x69,0x67,0x68])}),_0x52437e[_0x475a0f([0x6f,0x6e])](_0x475a0f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xd36299=>{_0xa55672(_0xd36299[_0x475a0f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xf8cdf1=!0x0,_0x1f0a8c(_0xd36299[_0x475a0f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x475a0f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x475a0f([0x6c,0x6f,0x77])}),_0x34dd97[_0x475a0f([0x74,0x68,0x65,0x6e])](()=>{_0xf8cdf1||_0x3522bf(_0x475a0f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1c6682(){return _0x52437e[_0x475a0f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x475a0f([0x76,0x69,0x65,0x77])][_0x475a0f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x475a0f([0x61,0x75,0x74,0x6f]);}function _0x3b5720(){_0x52437e[_0x475a0f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x475a0f([0x76,0x69,0x65,0x77])][_0x475a0f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x475a0f([0x61,0x75,0x74,0x6f]);}}function _0x2367af(_0x8725a6){const _0x5f26b8=[new window[(_0x475a0f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x30dc93=>setTimeout(_0x30dc93,0x66cc5653^_0x38701c)),_0x34dd97[_0x475a0f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x475a0f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5378cf=>{let _0x54be62=0x0;_0x52437e[_0x475a0f([0x6d,0x6f,0x64,0x65,0x6c])][_0x475a0f([0x6f,0x6e])](_0x475a0f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x1d0114,_0x180566)=>{_0x180566[0x0][_0x475a0f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x54be62++,_0x54be62==(0x66c56967^_0x38701c)&&(_0x5378cf(),_0x1d0114[_0x475a0f([0x6f,0x66,0x66])]());});}))];return window[_0x475a0f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x475a0f([0x72,0x61,0x63,0x65])](_0x5f26b8)[_0x475a0f([0x74,0x68,0x65,0x6e])](()=>_0x8725a6);}async function _0x4be15a(){await _0x34dd97,_0x52437e[_0x475a0f([0x6d,0x6f,0x64,0x65,0x6c])][_0x475a0f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2a58db,_0x52437e[_0x475a0f([0x6d,0x6f,0x64,0x65,0x6c])][_0x475a0f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2a58db,_0x52437e[_0x475a0f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x475a0f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3b189f(_0x3ddab1){const _0x3ef0fe=_0x4dfe8c();_0x52437e[_0x3ef0fe]=_0x475a0f([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3ddab1,_0x3ddab1!=_0x475a0f([0x56,0x61,0x6c,0x69,0x64])&&_0x4be15a();}function _0x4dfe8c(){const _0x2250e2=window[_0x475a0f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x475a0f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x475a0f([0x6e,0x6f,0x77])]())[_0x475a0f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x475a0f([0x2e]),'');let _0x552fc9=_0x475a0f([0x70]);for(let _0x533df1=0x0;_0x533df1<_0x2250e2[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x533df1+=0x2){let _0x5eae90=window[_0x475a0f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2250e2[_0x475a0f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x533df1,_0x533df1+0x2));_0x5eae90>=_0x3bf325[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5eae90-=_0x3bf325[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x552fc9+=_0x3bf325[_0x5eae90];}return _0x552fc9;}function _0x24cd8e(){const _0x56c390=_0x1989d1[_0x475a0f([0x73,0x70,0x6c,0x69,0x74])](_0x475a0f([0x2e]));if(0x3!=_0x56c390[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x537f96(_0x56c390[0x1]);function _0x537f96(_0xcb7bba){const _0x5dc1b0=_0x17c804(_0xcb7bba);return _0x5dc1b0&&_0x30a712()?_0x5dc1b0:null;function _0x30a712(){const _0x2b1829=_0x5dc1b0[_0x475a0f([0x6a,0x74,0x69])],_0x35b84c=window[_0x475a0f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2b1829[_0x475a0f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2b1829[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x533702={..._0x5dc1b0,[_0x475a0f([0x6a,0x74,0x69])]:_0x2b1829[_0x475a0f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2b1829[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x533702[_0x475a0f([0x76,0x63])],_0x10f158(_0x533702)==_0x35b84c;}}}async function _0x557ce4(){let _0x361a02=!0x0;try{const _0x631e09=_0x1989d1[_0x475a0f([0x73,0x70,0x6c,0x69,0x74])](_0x475a0f([0x2e])),[_0xde103,_0xe38f6e,_0x5995dc]=_0x631e09;return _0x131414(_0xde103),await _0xdd9d59(_0xde103,_0xe38f6e,_0x5995dc),_0x361a02;}catch(_0x66b2f){return!0x1;}function _0x131414(_0x49240a){const _0x2ceca9=_0x17c804(_0x49240a);_0x2ceca9&&_0x2ceca9[_0x475a0f([0x61,0x6c,0x67])]==_0x475a0f([0x45,0x53,0x32,0x35,0x36])||(_0x361a02=!0x1);}async function _0xdd9d59(_0xe50b7e,_0x3e461d,_0x35155a){const _0xcb3203=window[_0x475a0f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x475a0f([0x66,0x72,0x6f,0x6d])](_0x4f58f3(_0x35155a),_0x25e26e=>_0x25e26e[_0x475a0f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2e68b1=new window[(_0x475a0f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x475a0f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xe50b7e+_0x475a0f([0x2e])+_0x3e461d),_0x11e094=window[_0x475a0f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x475a0f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x11e094)return;const _0x24a95a=await _0x11e094[_0x475a0f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x475a0f([0x6a,0x77,0x6b]),_0x1a87dc,{[_0x475a0f([0x6e,0x61,0x6d,0x65])]:_0x475a0f([0x45,0x43,0x44,0x53,0x41]),[_0x475a0f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x475a0f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x475a0f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x11e094[_0x475a0f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x475a0f([0x6e,0x61,0x6d,0x65])]:_0x475a0f([0x45,0x43,0x44,0x53,0x41]),[_0x475a0f([0x68,0x61,0x73,0x68])]:{[_0x475a0f([0x6e,0x61,0x6d,0x65])]:_0x475a0f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x24a95a,_0xcb3203,_0x2e68b1)||(_0x361a02=!0x1);}}function _0x17c804(_0x449b4b){return _0x449b4b[_0x475a0f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x475a0f([0x65,0x79]))?JSON[_0x475a0f([0x70,0x61,0x72,0x73,0x65])](_0x4f58f3(_0x449b4b)):null;}function _0x4f58f3(_0x4ef2ab){return window[_0x475a0f([0x61,0x74,0x6f,0x62])](_0x4ef2ab[_0x475a0f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x475a0f([0x2b]))[_0x475a0f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x475a0f([0x2f])));}function _0x10f158(_0x2b9086){let _0x1875a9=0x1505;function _0x1f3ed6(_0x4bcd1c){for(let _0x4c2c2a=0x0;_0x4c2c2a<_0x4bcd1c[_0x475a0f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4c2c2a++){const _0x321ab6=_0x4bcd1c[_0x475a0f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4c2c2a);_0x1875a9=(_0x1875a9<<0x5)+_0x1875a9+_0x321ab6,_0x1875a9&=_0x1875a9;}}function _0x550108(_0xec4771){Array[_0x475a0f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xec4771)?_0xec4771[_0x475a0f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x550108):_0xec4771&&typeof _0xec4771==_0x475a0f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x475a0f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xec4771)[_0x475a0f([0x73,0x6f,0x72,0x74])]()[_0x475a0f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4c031b,_0x532cf7])=>{_0x1f3ed6(_0x4c031b),_0x550108(_0x532cf7);}):_0x1f3ed6(window[_0x475a0f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xec4771));}return _0x550108(_0x2b9086),_0x1875a9>>>0x0;}function _0x4d0ea6(_0x211bbb){return _0x211bbb[_0x475a0f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x475a0f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x475a0f([0x30]));}function _0x245b3f(_0x1998c5){return _0x1998c5[_0x475a0f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x475a0f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x475a0f([0x6a,0x6f,0x69,0x6e])]('');}function _0x2a58db(){}function _0x475a0f(_0xb3ea2){return _0xb3ea2['map'](_0x1aaf10=>String['fromCharCode'](_0x1aaf10))['join']('');}_0x3b189f(await _0x3929d0());}(this);}['showFakeVisualSelection'](){const _0x44a52c=this['editor']['model'];_0x44a52c['change'](_0x5f3695=>{const _0x11bc4f=_0x44a52c['document']['selection']['getRanges']();let _0x453461=0x0;for(const _0x24504b of _0x11bc4f){const _0x3a3a9f=f+':'+_0x453461;if(_0x44a52c['markers']['has'](_0x3a3a9f))_0x5f3695['updateMarker'](_0x3a3a9f,{'range':_0x24504b});else{if(_0x24504b['start']['isAtEnd']){const _0x27ab6e=_0x24504b['start']['getLastMatchingPosition'](({item:_0xc1aa3a})=>!_0x44a52c['schema']['isContent'](_0xc1aa3a),{'boundaries':_0x24504b});_0x5f3695['addMarker'](_0x3a3a9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5f3695['createRange'](_0x27ab6e,_0x24504b['end'])});}else _0x5f3695['addMarker'](_0x3a3a9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x24504b});}_0x453461++;}});}['hideFakeVisualSelection'](){const _0x1ded44=this['editor']['model'],_0x2bf4a7=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x2bf4a7['length']&&_0x1ded44['change'](_0x1e7c99=>{_0x2bf4a7['forEach'](_0x22690c=>{_0x1e7c99['removeMarker'](_0x22690c);});});}['insertContent'](_0x1dd884,_0x5486db){const _0x252387=this['_getAISelection'](),_0x491df2=_0x5486db||_0x252387['getFirstRange']();this['editor']['model']['canEditAt'](_0x491df2)&&this['editor']['model']['change'](_0x316d0d=>{this['hideFakeVisualSelection'](),_0x5486db||this['_resetContentOfSelectedTableCells'](_0x316d0d,_0x252387),this['_pasteHTMLUsingClipboard']({'insertAt':_0x491df2,'writer':_0x316d0d,'html':_0x1dd884});});}['insertContentBelow'](_0x2eab57){const {model:_0x14390e}=this['editor'],_0x22ed6d=this['_getAISelection']();_0x14390e['change'](()=>{const _0x33ade0=this['_prepareTableInsertBelowPosition'](_0x2eab57,_0x22ed6d)||this['_getDefaultInsertBelowPosition'](_0x22ed6d);this['insertContent'](_0x2eab57,_0x33ade0);});}['_getAISelection'](){const _0x367917=this['editor']['model'],_0x203b60=Array['from'](_0x367917['markers']['getMarkersGroup'](f))['map'](_0x10fe5c=>_0x10fe5c['getRange']());return _0x367917['createSelection'](_0x203b60);}['_pasteHTMLUsingClipboard']({writer:_0x496ae5,html:_0x551492,insertAt:_0x24f538}){const {view:_0x36f21c}=this['editor']['editing'],_0x591354=this['editor']['plugins']['get'](_0x510a34),_0x11b925=new dt();_0x11b925['setData']('text/html',_0x551492);const _0x32ff0d=new ClipboardEvent('paste',{'clipboardData':_0x11b925}),_0x5c115f=new _0x160a4f(_0x36f21c,_0x32ff0d,{'dataTransfer':new _0x458830(_0x11b925)});_0x496ae5['setSelection'](_0x24f538);const _0x16da39=(_0x4342cd,_0x165df2)=>{_0x165df2['resultRange']&&_0x496ae5['setSelection'](_0x165df2['resultRange']);};_0x591354['once']('contentInsertion',_0x16da39,{'priority':'lowest'}),_0x36f21c['document']['fire']('paste',_0x5c115f),_0x591354['off']('contentInsertion',_0x16da39);}['_getDefaultInsertBelowPosition'](_0xc7fcb2){const {model:_0x555415}=this['editor'],_0x18237a=Array['from'](_0xc7fcb2['getSelectedBlocks']());return _0x18237a['length']?_0x555415['createPositionAfter'](_0x18237a['pop']()):_0xc7fcb2['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x59cea0,_0xcd2ad9){const {model:_0x360a62,plugins:_0x3f64f0}=this['editor'];if(_0x3f64f0['has']('TableUtils')){const _0x3131c1=_0x3f64f0['get']('TableUtils')['getSelectedTableCells'](_0xcd2ad9);if(_0x3131c1['length']){const _0x33a8eb=this['_getTableRowCountFromContent'](_0x59cea0),_0x19e2ee=this['_createEmptyTableRows'](_0x3131c1,_0x33a8eb);return _0x360a62['createPositionAt'](_0x19e2ee,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5319cb){const _0x57c0eb=this['editor']['plugins']['get']('TableUtils'),_0x90d80b=this['editor']['data']['parse'](_0x5319cb),_0x4aebab=Array['from'](_0x90d80b['getChildren']())['filter'](_0x131112=>_0x131112['is']('element','table'));let _0x23725a=0x0;return _0x4aebab['forEach'](_0x4187a5=>{_0x23725a+=_0x57c0eb['getRows'](_0x4187a5);}),_0x23725a;}['_createEmptyTableRows'](_0x3f831c,_0x5c7494){const _0x1a99cf=this['editor']['plugins']['get']('TableUtils'),_0x1f2beb=_0x1a99cf['getRowIndexes'](_0x3f831c),_0x5b13cb=_0x1a99cf['getColumnIndexes'](_0x3f831c),_0x26eea0=_0x1f2beb['last']+0x1,_0xaf0c82=_0x5b13cb['first'],_0x306acd=_0x3f831c[0x0]['findAncestor']('table');for(let _0x4b25ff=0x0;_0x4b25ff<_0x5c7494;_0x4b25ff++)_0x1a99cf['insertRows'](_0x306acd,{'at':_0x26eea0});return _0x306acd['getChild'](_0x26eea0)['getChild'](_0xaf0c82);}['_resetContentOfSelectedTableCells'](_0x36d508,_0x50e7c0){const {plugins:_0x5b7d00}=this['editor'],{model:_0xee9c12}=_0x36d508;if(!_0x5b7d00['has']('TableUtils'))return;_0x5b7d00['get']('TableUtils')['getSelectedTableCells'](_0x50e7c0)['length']&&_0xee9c12['deleteContent'](_0x50e7c0);}}class K extends _0x37ddd7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xb62f77('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x7a4ce1){super(_0x7a4ce1),this['name']='AIRequestError';}}function i(_0x2c0c49,_0x334505,_0x4dda2a){const t=_0x2c0c49['t'];switch(_0x334505){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',_0x4dda2a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4dda2a);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'},_0x4dda2a);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 _0x334505;}}class E extends _0x4422c6{['_commandDefinitions'];constructor(_0x4c1e3b,_0x3d04f5){super(_0x4c1e3b),this['_commandDefinitions']=_0x3d04f5,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x19a98c,_0x8117ba,_0x2eb455)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x2eb455));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x439c9d,_0xec0f88,_0x3ca973)=>{this['enabledCommandsIds']=_0x3ca973?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3922d1=this['editor']['model'];this['_hasContext']=function(_0x59a590){const _0x25a6cb=_0x59a590['document']['selection'];return _0x25a6cb['isCollapsed']?0x0!==[..._0x25a6cb['getSelectedBlocks']()]['length']&&![..._0x25a6cb['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x59a590['hasContent'](_0x25a6cb['getFirstRange']());}(_0x3922d1);const _0x598d14=_0x3922d1['document']['selection'],_0x12abb7=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3e2bd3 of _0x598d14['getRanges']())for(const _0x4fc60c of _0x3e2bd3['getItems']())if(_0x4fc60c['is']('element')&&_0x12abb7['includes'](_0x4fc60c['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4c7d51='',_0x1aea5f='',_0x3eac71='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x4c7d51,_0x1aea5f,_0x3eac71);}}function G(_0x33b50b,_0x4c280a){const _0x3ce6b8=new Set();for(const _0x1d0658 of _0x33b50b['values']())(_0x4c280a||!0x1===_0x1d0658['requiresContent'])&&_0x3ce6b8['add'](_0x1d0658['id']);return Array['from'](_0x3ce6b8);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x788f7(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x23cda6,_0x35f255,_0x270f7d){super(),this['editor']=_0x23cda6,this['textAdapter']=_0x35f255,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x270f7d,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x22307f,_0x1cd321,_0x470eb1)=>{this['view']['value']=this['_sanitizeHTML'](_0x470eb1);}),this['listenTo'](this['view'],'submitPrompt',(_0x9b5300,_0x41fd6f)=>{const _0xd99f89=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x41fd6f,_0xd99f89,'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:_0x5b87cf,query:_0xa910ed,htmlContent:_0x3e5259,label:_0x48e87c,mainActionLabel:_0x774c01}){this['view']['prompt']=_0x48e87c,this['view']['mainAction']=_0x774c01,this['initialContext']=_0x3e5259,_0xa910ed&&(this['view']['isRendered']?this['_handleQuery'](_0xa910ed,_0x3e5259,_0x5b87cf,_0x48e87c):this['view']['once']('render',()=>{this['_handleQuery'](_0xa910ed,_0x3e5259,_0x5b87cf,_0x48e87c);}));}['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'](_0x2256ad,_0x4e532e,_0x147544,_0x5d66ab){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x4e532e,this['previousQuery']=_0x2256ad,this['previousLabel']=_0x5d66ab||_0x2256ad,this['previousActionId']=_0x147544,new Promise(_0x2b1f0b=>{this['textAdapter']['makeRequest']({'query':_0x2256ad,'context':_0x4e532e,'onData':_0x188189=>{this['currentResponse']=_0x188189,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x147544})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x2128e3=>{_0x2128e3 instanceof R?this['view']['handleError'](_0x2128e3['message']):this['view']['handleError'](),_0x2b1f0b();})['finally'](()=>{this['stopProcessing'](),_0x2b1f0b();});});}['_parseAndNormalizeContent'](_0x2e6cc9,_0x3c69b9=!0x1){const _0x123e94=Z['exec'](_0x2e6cc9);_0x2e6cc9=_0x123e94?_0x2e6cc9['substring'](_0x123e94[0x1]['length']):_0x2e6cc9['length']<0x64&&!_0x3c69b9?'':this['_stripMarkdownSyntax'](_0x2e6cc9);const _0x1285f9=this['_domParser']['parseFromString'](_0x2e6cc9,'text/html');if(_0x123e94){const _0x1486b9=Array['from'](_0x1285f9['body']['childNodes']);_0x1486b9['reverse']();for(const _0x10de6c of _0x1486b9){if(_0x10de6c['nodeType']==Node['ELEMENT_NODE'])break;_0x10de6c['remove']();}}const _0x5b7ec2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x1285f9['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x5b7ec2);const _0x13282d=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x54b859=this['editor']['data']['toModel'](_0x5b7ec2);return _0x13282d||_0x54b859['markers']['clear'](),this['editor']['data']['stringify'](_0x54b859);}['_normalizeResponseHeadings'](_0x292bae){const _0x807407=new _0x411509(this['editor']['editing']['view']['document']),_0x3d60fc=new _0x31c510({'name':/^h[1-5]$/}),_0x5e161b=[];let _0x352dae=!0x1;for(const _0x15eeb4 of _0x292bae)_0x15eeb4['is']('element')&&_0x3d60fc['match'](_0x15eeb4)&&(_0x5e161b['push'](_0x15eeb4),'h1'==_0x15eeb4['name']&&(_0x352dae=!0x0));if(_0x352dae){for(const _0x230138 of _0x5e161b)_0x807407['rename']('h'+(parseInt(_0x230138['name'][0x1])+0x1),_0x230138);}}['_isH1TagSupportEnabled'](){const {data:_0x2eb0c1,editing:_0xd57a24}=this['editor'],_0x405235=_0x2eb0c1['htmlProcessor']['toView']('<h1></h1>'),_0x5e7fad=_0x2eb0c1['toView'](_0x2eb0c1['toModel'](_0x405235));return!!_0xd57a24['view']['domConverter']['viewToDom'](_0x5e7fad)['querySelector']('h1');}['_sanitizeHTML'](_0x3535ac){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3535ac),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xc67d08){const _0x47f2b2=_0xc67d08['trim']();return _0x47f2b2['startsWith']('```html')?_0x47f2b2['endsWith']('```')?_0x47f2b2['substring'](0x7,_0x47f2b2['length']-0x3):_0x47f2b2['substring'](0x7):_0xc67d08;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x11ea02){super(_0x11ea02),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x14dc61=>i(_0x11ea02,'AI_'+_0x14dc61['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x11ea02,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x11ea02,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x11ea02,'Stop'));const _0x5985e4=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5985e4['if']('isVisible','ck-hidden',_0x4ea58f=>!_0x4ea58f)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3842a2,_0x4b5850){const _0x2463c8=new _0x42f839(this['locale']);return _0x2463c8['set']({'label':_0x3842a2,'class':_0x4b5850||'','isVisible':!0x0,'withText':!0x0}),_0x2463c8;}}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 _0x5aa727{['contentFieldView'];['copyButtonView'];constructor(_0x32df73,_0x21c479=''){super(_0x32df73),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xcad29a=this['bindTemplate'];this['contentFieldView']=new mt(_0x32df73,_0x21c479),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xcad29a['if']('isVisible','ck-hidden',_0x36316f=>!_0x36316f)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xcad29a['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 _0x2a77f0=!0x1;this['on']('change:value',(_0x2a0e22,_0x3c6d5f,_0x28b2b2)=>{const _0x10e10a=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x28b2b2),this['isProcessing']&&_0x10e10a&&!_0x2a77f0&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x8fccdd,_0x3548c4,_0x2bd67d)=>{_0x2a77f0=!0x1,_0x2bd67d?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x2a77f0=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x2a77f0=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4f151e=this['locale'],_0x4106c1=new _0x42f839(this['locale']),_0x1bdf03='ck-ai-form__copy-button';return _0x4106c1['set']({'label':i(_0x4f151e,'Copy'),'icon':W,'class':_0x1bdf03,'tooltip':!0x0}),_0x4106c1['bind']('isVisible')['to'](this,'value',_0x5d6fcf=>!!_0x5d6fcf),_0x4106c1['bind']('isEnabled')['to'](this,'isProcessing',_0x2a1505=>!_0x2a1505),_0x4106c1['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4106c1['icon']=_0x377107['check'],_0x4106c1['class']=_0x1bdf03+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4106c1['icon']=W,_0x4106c1['class']=_0x1bdf03;},0x3e8);}),_0x4106c1;}['_copyHTMLToClipboard'](_0x2b66ef){const {window:_0x542251,document:_0x153e31}=_0x3e472a;if(_0x542251['ClipboardItem']){const {Blob:_0x2374b6,ClipboardItem:_0x301a1c}=_0x542251,_0x251789=[new _0x301a1c({'text/html':new _0x2374b6([_0x2b66ef['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2374b6([_0x2b66ef['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x251789);}else{const _0x21b580=_0x153e31['createElement']('div');_0x21b580['style']['position']='absolute',_0x21b580['style']['left']='-9999px',_0x21b580['innerHTML']='<span>[</span>'+_0x2b66ef['innerHTML']+'<span>]</span>',_0x153e31['body']['appendChild'](_0x21b580);const _0x5a7f04=_0x153e31['createRange']();_0x5a7f04['setStartAfter'](_0x21b580['firstElementChild']),_0x5a7f04['setEndBefore'](_0x21b580['lastElementChild']);const _0x5c1095=_0x542251['getSelection']();_0x5c1095['removeAllRanges'](),_0x5c1095['addRange'](_0x5a7f04),_0x153e31['execCommand']('copy'),_0x21b580['remove']();}}}class mt extends _0x5aa727{constructor(_0x39184f,_0xf31ac1=''){super(_0x39184f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xf31ac1,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x407e46){this['element']['innerHTML']=_0x407e46;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x3d00a4=new _0x5aa727(),_0x38fe51=this['locale'],_0x312d0f=new _0x302c94();return _0x312d0f['isVisible']=!0x0,_0x3d00a4['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x312d0f,{'text':i(_0x38fe51,'AI\x20is\x20writing...')}]}),_0x3d00a4['render'](),_0x3d00a4;}}class rt extends _0x5aa727{constructor(_0xb4dc7d,_0x913def=''){super(_0xb4dc7d);const _0x336641=new _0x80b91(),_0x50ebc1=this['bindTemplate'];this['set']('text',_0x913def),_0x336641['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':[_0x336641,{'text':_0x50ebc1['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0xb607e9,_0x137ee9){super(_0xb607e9,_0x137ee9),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',(_0x154eb0,_0x4d6be6)=>{_0x154eb0['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4d6be6());});}['_createSubmitButton'](){const _0x7f25d1=new _0x42f839(this['locale']),_0x4ffa06=this['locale'];return _0x7f25d1['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(_0x4ffa06,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x7f25d1['on']('execute',()=>{this['submit']();}),_0x7f25d1['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0xa06de,_0x99aa02)=>!_0xa06de&&_0x99aa02),_0x7f25d1;}['_createShowHistoryButton'](){const _0x1ba717=new _0x42f839(this['locale']),_0x446a86=this['resultsView'],_0x284eeb=this['locale'];_0x1ba717['set']({'label':i(_0x284eeb,'History'),'withText':!0x1,'icon':_0x377107['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x1ba717['bind']('isOn')['to'](_0x446a86,'isVisible'),_0x1ba717['bind']('isEnabled')['to'](this,'isEnabled'),_0x1ba717['on']('execute',()=>{_0x446a86['isVisible']=!_0x446a86['isVisible'],_0x446a86['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5a4608=()=>{_0x3e472a['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x358424=new st(this['queryView']['fieldView']['element']),_0x50383c=_0x358424['width'],_0x1d8fb1='rtl'===_0x284eeb['uiLanguageDirection']?'left':'right';_0x358424['excludeScrollbarsAndBorders'](),_0x1ba717['element']['style'][_0x1d8fb1]=_0x50383c-_0x358424['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5a4608),this['on']('render',_0x5a4608),_0x1ba717;}['submit'](){const _0x386bbf=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x386bbf);}['focus'](_0x7013f2){-0x1===_0x7013f2?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x165f93){super(_0x165f93),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x165f93,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4a1d19=0x0;for(const _0x45b461 of this['items'])_0x4a1d19+=_0x45b461['items']['length'];return{'resultsCount':_0x4a1d19,'totalItemsCount':_0x4a1d19};}['_createClearHistoryButton'](){const _0x5a52bc=this['locale'],_0x4dc8b3=new _0x42f839(this['locale']);return _0x4dc8b3['set']({'label':'('+i(_0x5a52bc,'Clear')+')','withText':!0x0}),_0x4dc8b3['on']('execute',()=>this['fire']('clearHistory')),_0x4dc8b3;}}class hs extends _0x47be89{constructor(_0x46a565){super();const _0x5d68fd=new te(),_0x257f6f=new _0x42f839(this['locale'],_0x5d68fd);this['children']['add'](_0x257f6f),_0x257f6f['set']({'label':_0x46a565['prompt'],'withText':!0x0}),_0x257f6f['on']('execute',()=>{this['fire']('execute',{'value':_0x10126d(_0x46a565['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x3fc6d8{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x120805,_0x322102)=>{const _0x328f0a=Ss(_0x322102['prompt']);for(const _0x2eb897 of this)if(_0x2eb897!=_0x322102&&Ss(_0x2eb897['prompt'])===_0x328f0a){this['remove'](_0x2eb897);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x45a156=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x45a156));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x37f2c7=>_0x37f2c7)));}}function Ss(_0x1cad42){return _0x1cad42['toLowerCase']()['trim']();}class k extends _0x5aa727{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x10f8e3,_0x2535c3,_0x5d9eaf=''){super(_0x10f8e3),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(_0x10f8e3),this['contentArea']=new X(_0x10f8e3,_0x5d9eaf),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 _0x50d46f(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x8737d7({'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 _0x281dd7=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2535c3],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x281dd7['if']('isError','ck-hidden',_0x273abe=>!_0x273abe)]},'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'](_0x3c25fe=0x1){-0x1===_0x3c25fe?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 _0x3675aa=this['locale'],_0x1c9c77=new ht(_0x3675aa,{'queryView':{'label':i(_0x3675aa,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x405fed,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3675aa,'Empty\x20history'),'secondary':i(_0x3675aa,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1c9c77['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x303fc8,_0xa2dc8)=>_0x303fc8&&!_0xa2dc8),this['listenTo'](_0x1c9c77,'submit',(_0x48e9cc,_0x364f34)=>{this['prompt']=_0x364f34;const _0x24fbdd=_0x33f6b0(_0x364f34);this['fire']('submitPrompt',_0x24fbdd),_0x364f34['trim']()&&this['_promptHistory']['add']({'prompt':_0x24fbdd},0x0);},{'priority':'high'}),_0x1c9c77;}['_createHistoryView'](){const _0x44d2c6=new rs(this['locale']);return _0x44d2c6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x44d2c6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x44d2c6;}['_createToolbar'](){const _0x62ccee=new at(this['locale']);return _0x62ccee['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x204574,_0x1707c3,_0x22c73c)=>_0x204574&&!_0x1707c3&&!!_0x22c73c),_0x62ccee['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x62ccee['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3d0abf,_0x398093,_0x2a8775)=>_0x3d0abf&&!_0x398093&&!!_0x2a8775),_0x62ccee['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x62ccee['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x513d3d,_0x5ddb87)=>_0x513d3d&&!_0x5ddb87),_0x62ccee['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x62ccee['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x62ccee['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x62ccee;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0xa7078b=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0xa7078b,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x598004){const _0x591251=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x598004||i(_0x591251,'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 _0x37ddd7{['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[_0x3f129c,a,K,_0x4a9066];}constructor(_0x2508d8){super(_0x2508d8),_0x2508d8['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2508d8['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2508d8['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2508d8['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x41385b}=this;this['_aiAdapter']=_0x41385b['plugins']['get'](K),this['_dialog']=_0x41385b['plugins']['get'](_0x4a9066),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x178364=new E(_0x41385b,Array['from'](this['_commandDefinitions']['values']()));_0x41385b['commands']['add']('showAIAssistant',_0x178364),_0x41385b['ui']['componentFactory']['add']('aiCommands',_0x5844f6=>{const _0x3d5a7c=_0x66dc23(_0x5844f6);return _0x3d5a7c['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3d5a7c['buttonView']['set']({'label':i(_0x5844f6,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x3d5a7c['on']('execute',_0x3d7e40=>this['_onExecute'](_0x3d7e40['source']['id'])),_0x1a76a4(_0x3d5a7c,_0x41385b['ui']['view']['body'],function(_0xf5f27d){const _0x9cff58=o(_0xf5f27d['config']['get']('ai.aiAssistant.commands'),_0xf5f27d['locale']),_0x1838ed=U(_0xf5f27d,_0x9cff58)['filter'](_0xc1d22e=>_0xc1d22e['commands']['length']);if(0x1===_0x1838ed['length'])return U(_0xf5f27d,_0x1838ed[0x0]['commands'])['map'](_0x2d5ad8=>({'id':_0x2d5ad8['id'],'label':_0x2d5ad8['label']}));return _0x1838ed['map'](_0x3c59dc=>{const {groupId:_0x5f597c,groupLabel:_0x750414,commands:_0x2073d6}=_0x3c59dc,_0x277142=U(_0xf5f27d,_0x2073d6)['map'](_0xcf68bf=>({'id':_0xcf68bf['id'],'label':_0xcf68bf['label']}));return{'id':_0x5f597c,'menu':_0x750414||_0x5f597c,'children':_0x277142};});}(_0x41385b),{'ariaLabel':i(_0x5844f6,'AI\x20Commands')}),_0x3d5a7c['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x178364['on']('change:enabledCommandsIds',_0x58989e),_0x3d5a7c['menuView']['once']('render',_0x58989e),_0x3d5a7c;function _0x58989e(){_0x3d5a7c['isEnabled']=_0x178364['enabledCommandsIds']['length']>0x0;for(const _0x39dcf9 of _0x3d5a7c['menuView']['buttons'])_0x39dcf9['isEnabled']=_0x178364['enabledCommandsIds']['includes'](_0x39dcf9['id']);}}),_0x41385b['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3dcc0b=>{const _0x5d1bf9=new _0xf45a89(_0x3dcc0b);_0x5d1bf9['buttonView']['set']({'label':i(_0x3dcc0b,'AI\x20Commands'),'icon':T}),_0x5d1bf9['bind']('isEnabled')['to'](_0x178364,'enabledCommandsIds',_0x330d9e=>_0x330d9e['length']>0x0);const _0x27032e=o(_0x41385b['config']['get']('ai.aiAssistant.commands'),_0x3dcc0b);return this['_populateMenuBarMenu'](_0x178364,_0x5d1bf9,_0x27032e,_0x153427=>this['_onExecute'](_0x153427)),_0x5d1bf9;}),_0x41385b['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2a5f02=this['_createAIAssistantUIButton'](_0x42f839);return _0x2a5f02['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2a5f02;}),_0x41385b['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x3fb4d=this['_createAIAssistantUIButton'](_0x37c151);return _0x3fb4d['set']({'role':'menuitemcheckbox'}),_0x3fb4d;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1e5a0d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x386540;for(const _0x1bcf17 in _0x1e5a0d){const _0x40c917=_0x1bcf17,_0x355d50=_0x1e5a0d[_0x40c917];if('aiLicenseKeyValid'==_0x355d50||'aiLicenseKeyInvalid'==_0x355d50||'aiLicenseKeyExpired'==_0x355d50||'aiLicenseKeyDomainLimit'==_0x355d50||'aiLicenseKeyNotAllowed'==_0x355d50||'aiLicenseKeyEvaluationLimit'==_0x355d50||'aiLicenseKeyTrialLimit'==_0x355d50||'aiLicenseKeyUsageLimit'==_0x355d50){delete _0x1e5a0d[_0x40c917],_0x386540=_0x355d50,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x386540&&_0x1e5a0d['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x386540&&_0x1e5a0d['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x386540&&_0x1e5a0d['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x386540&&_0x1e5a0d['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x386540&&_0x1e5a0d['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x386540&&_0x1e5a0d['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x386540&&_0x1e5a0d['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x47b24a='',_0x54c122='',_0x4bc9e7='custom'){const _0x34f5f0=this['editor'],_0x1c9c37=_0x34f5f0['editing']['view'],_0x39bbed=_0x34f5f0['plugins']['get'](a),_0x23971f=_0x34f5f0['plugins']['get'](_0x3f129c);_0x39bbed['showFakeVisualSelection']();const _0x1826b0=new w(),_0x2502d1=new ClipboardEvent('copy',{'clipboardData':_0x1826b0}),_0x50e3d3=new _0x458830(_0x1826b0),_0x4be00b=new _0x160a4f(_0x1c9c37,_0x2502d1,{'dataTransfer':_0x50e3d3});_0x23971f['_forceMarkersCopy']('comment',()=>{_0x1c9c37['document']['fire']('copy',_0x4be00b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x34f5f0,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x29d4b8=_0x50e3d3['getData']('text/html');const _0x1a0587=_0x34f5f0['model']['document']['selection'],_0x4edfc4=Array['from'](_0x1a0587['getRanges']());0x1===_0x4edfc4['length']&&_0x4edfc4[0x0]['isFlat']&&!_0x1a0587['getSelectedElement']()&&''!==_0x29d4b8['replace'](/ /g,'')['trim']()&&(_0x29d4b8='<p>'+_0x29d4b8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4bc9e7,'query':_0x47b24a,'htmlContent':_0x29d4b8,'label':_0x54c122,'mainActionLabel':M[_0x34f5f0['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':_0x538236['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x39bbed['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x363120=new Map(),_0x267446=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1d0877 of _0x267446)for(const _0x7d98fe of _0x1d0877['commands'])_0x363120['set'](_0x7d98fe['id'],{..._0x7d98fe,'groupId':_0x1d0877['groupId'],'groupLabel':_0x1d0877['groupLabel']||_0x1d0877['groupId']});return _0x363120;}['_createAIAssistantUIButton'](_0x57508b){const _0x1d76b8=this['editor'],_0x40f988=_0x1d76b8['commands']['get']('showAIAssistant'),_0xf0cb27=new _0x57508b(_0x1d76b8['locale']);return _0xf0cb27['set']({'label':i(_0x1d76b8['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0xf0cb27['bind']('isEnabled')['to'](_0x40f988),_0xf0cb27['bind']('isOn')['to'](this['_dialog'],'id',_0x54ef67=>'aiAssistant'===_0x54ef67),this['listenTo'](_0xf0cb27,'execute',()=>{_0xf0cb27['isOn']?this['hideUI']():_0x40f988['execute']();}),_0xf0cb27;}['_initView'](){const _0x535dfb=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',()=>{_0x535dfb['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x535dfb['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x542eef,ui:{ariaLiveAnnouncer:_0xf9220e}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x20ee03,_0x1fbca0,_0x4696f3)=>{const _0x49a344=this['_aiAssistantController']['currentContext'];_0x4696f3?_0xf9220e['announce'](i(_0x542eef,'AI\x20is\x20writing')):_0x49a344&&_0xf9220e['announce'](i(_0x542eef,'Generated\x20content:\x20%0',_0x49a344),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3f7feb,_0xbf0d2f,_0x511602)=>{if(_0x511602){const _0x4c6440=this['_formView']['errorView']['text'];_0xf9220e['announce'](i(_0x542eef,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4c6440));}});}['_onExecute'](_0x36e9b6){const _0x2ba288=this['_commandDefinitions']['get'](_0x36e9b6),_0x5ce96d=this['editor'],_0x4f09e0=_0x5ce96d['model']['document']['selection'],_0x349d26=_0x5ce96d['commands']['get']('showAIAssistant'),_0x38b3dd=_0x5ce96d['plugins']['get'](a),_0xe957dc=''+(_0x2ba288['groupId']!==x?_0x2ba288['groupLabel']+':\x20':'')+_0x2ba288['label'];if(!0x1!==_0x2ba288['requiresContent']&&_0x4f09e0['isCollapsed']){const _0x197a38=_0x57dd9a(_0x4f09e0['getSelectedBlocks']())||_0x5ce96d['model']['schema']['getLimitElement'](_0x4f09e0);_0x5ce96d['model']['change'](_0xa05ad7=>{_0xa05ad7['setSelection'](_0x197a38,'in');});}_0x38b3dd['showFakeVisualSelection'](),_0x349d26['execute'](_0x2ba288['prompt'],_0xe957dc,'command:'+_0x36e9b6);}['_populateMenuBarMenu'](_0x142a77,_0x31d1f6,_0x57a0af,_0x10aa4d){const _0xb3e444=this['editor'],_0x3cd0ba=_0xb3e444['locale'],_0xf9b3bf=new _0xa976f6(_0x3cd0ba),_0x12420c=U(_0xb3e444,_0x57a0af)['filter'](_0x40df34=>_0x40df34['commands']['length']);0x1===_0x12420c['length']?this['_getMenuBarGroupButtons']({'command':_0x142a77,'commands':_0x12420c[0x0]['commands'],'parentMenuView':_0x31d1f6,'onExecute':_0x10aa4d})['forEach'](_0x5e8235=>_0xf9b3bf['items']['add'](_0x5e8235)):_0x12420c['forEach'](({groupId:_0xeb6d36,groupLabel:_0xb3cf5a,commands:_0x44bcba})=>{const _0x453fd1=new _0x56307f(_0x3cd0ba,_0x31d1f6),_0x4d02a0=new _0xf45a89(_0x3cd0ba),_0x1faf8e=new _0xa976f6(_0x3cd0ba),_0x59e3db=this['_getMenuBarGroupButtons']({'command':_0x142a77,'commands':_0x44bcba,'parentMenuView':_0x4d02a0,'onExecute':_0x10aa4d});_0x4d02a0['buttonView']['set']({'label':_0xb3cf5a||_0xeb6d36}),_0x4d02a0['delegate']('execute')['to'](_0x31d1f6),_0x1faf8e['items']['addMany'](_0x59e3db),_0x4d02a0['panelView']['children']['add'](_0x1faf8e),_0x453fd1['children']['add'](_0x4d02a0),_0xf9b3bf['items']['add'](_0x453fd1);}),_0x31d1f6['panelView']['children']['add'](_0xf9b3bf);}['_getMenuBarGroupButtons']({command:_0x4399da,commands:_0x18e4c7,parentMenuView:_0x48987c,onExecute:_0x30b8d2}){const _0x341bab=this['editor'],_0x28cb4f=_0x341bab['locale'];return U(_0x341bab,_0x18e4c7)['map'](_0x4c9103=>{const _0x145bf5=new _0x56307f(_0x28cb4f,_0x48987c),_0x449d0d=new _0x37c151(_0x28cb4f);return _0x449d0d['set']({'label':_0x4c9103['label']}),_0x449d0d['delegate']('execute')['to'](_0x48987c),_0x449d0d['on']('execute',()=>_0x30b8d2(_0x4c9103['id'])),_0x449d0d['bind']('isEnabled')['to'](_0x4399da,'enabledCommandsIds',_0x91d55c=>_0x91d55c['includes'](_0x4c9103['id'])),_0x145bf5['children']['add'](_0x449d0d),_0x145bf5;});}}function B(_0x4fb076,_0x20b12b){return void 0x0!==_0x4fb076['order']&&void 0x0===_0x20b12b['order']?0x1:void 0x0===_0x4fb076['order']&&void 0x0!==_0x20b12b['order']?-0x1:void 0x0!==_0x4fb076['order']&&void 0x0!==_0x20b12b['order']?_0x4fb076['order']-_0x20b12b['order']:0x0;}function U(_0xc551f3,_0xdcb8ee){_0xdcb8ee['sort'](B);const _0xb424aa={},_0x21d211=[];for(const _0x37afba of _0xdcb8ee)if(void 0x0!==_0x37afba['order']){if(_0x37afba['order']in _0xb424aa)throw new _0xb62f77('ai-commands-config-order-collision',_0xc551f3,{'conflictingDefinitions':[_0x37afba,_0xb424aa[_0x37afba['order']]]});_0xb424aa[_0x37afba['order']]=_0x37afba,_0x21d211['splice'](_0x37afba['order'],0x0,_0x37afba);}else _0x21d211['push'](_0x37afba);return _0x21d211;}class r extends _0x37ddd7{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x219d42){super(_0x219d42);const _0x3b13c4=_0x219d42['config'],_0x526b68=_0x219d42['locale'];_0x3b13c4['define']('ai.aiAssistant.preserveComments',!0x0),_0x3b13c4['define']('ai.aiAssistant.commands',function(_0x3fe992){return[{'groupId':'editOrReview','groupLabel':i(_0x3fe992,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x3fe992,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x3fe992,'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(_0x3fe992,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x3fe992,'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(_0x3fe992,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x3fe992,'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(_0x3fe992,'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(_0x3fe992,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x3fe992,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x3fe992,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x3fe992,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x3fe992,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x3fe992,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x3fe992,'Change\x20style'),'commands':[{'id':'business','label':i(_0x3fe992,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x3fe992,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x3fe992,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x3fe992,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x3fe992,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x3fe992,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x3fe992,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x3fe992,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x3fe992,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x3fe992,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x3fe992,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x3fe992,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x3fe992,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x526b68)),_0x3b13c4['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3b13c4['define']('ai.aiAssistant.removeCommands',[]);let _0x456473=o(_0x3b13c4['get']('ai.aiAssistant.commands'),_0x526b68);const _0x3b3bbd=_0x3b13c4['get']('ai.aiAssistant.extraCommandGroups'),_0x2a43ac=_0x3b13c4['get']('ai.aiAssistant.removeCommands');_0x3b3bbd['forEach'](_0xd3c7a1=>{const _0x314569=_0x456473['find'](_0x4bbd19=>_0x4bbd19['groupId']===_0xd3c7a1['groupId']);_0x314569?_0x314569['commands']=_0x314569['commands']['concat'](_0xd3c7a1['commands']):_0x456473['push'](_0xd3c7a1);}),_0x456473=_0x456473['filter'](_0x2a7f48=>!_0x2a43ac['includes'](_0x2a7f48['groupId'])),_0x456473['forEach'](_0x48bb6a=>{_0x48bb6a['commands']=_0x48bb6a['commands']['filter'](_0x2cde3b=>!_0x2a43ac['includes'](_0x2cde3b['id']));}),_0x3b13c4['set']('ai.aiAssistant.commands',_0x456473);}}class P extends _0x37ddd7{['abortController'];static get['requires'](){return[K];}constructor(_0x1820b7){super(_0x1820b7),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'](_0x526400){return this['sendRequest'](_0x526400)['catch'](_0x5eb9ed=>{if(_0x5eb9ed instanceof R)return Promise['reject'](_0x5eb9ed);if('AbortError'==_0x5eb9ed['name'])return Promise['resolve']();throw console['error'](_0x5eb9ed),new _0xb62f77('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x17178e,_0x51220b){const _0x1767bc=this['editor']['locale'],_0xbc3f71={'Content-Type':'application/json'};if('object'==typeof _0x17178e)Object['assign'](_0xbc3f71,_0x17178e);else{if(_0x17178e)try{const _0x570050=await _0x17178e(_0x51220b);Object['assign'](_0xbc3f71,_0x570050);}catch(_0x352ba4){return Promise['reject'](new R(i(_0x1767bc,'AI_ERROR_GET_HEADERS')));}}return _0xbc3f71;}async['_prepareRequestParameters'](_0x4f424d,_0x1e9503){const _0x4abc50=this['editor']['locale'];if('object'==typeof _0x4f424d)return _0x4f424d;try{return await _0x4f424d(_0x1e9503);}catch(_0x4cd50d){return Promise['reject'](new R(i(_0x4abc50,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4acc8f){super(_0x4acc8f),_0x4acc8f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4acc8f['config']['get']('ai.openAI.requestParameters')||_0x4acc8f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4acc8f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4acc8f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4acc8f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3fc4dd,context:_0x2c4797,onData:_0x19536b,actionId:_0x53b948}){const _0x46bc4a=this['editor']['locale'],_0x270cb9=await this['prepareMessages'](_0x3fc4dd,_0x2c4797,_0x53b948),_0x5e7923=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x53b948),_0x4c8ada=await this['_prepareRequestParameters'](this['_requestParameters'],_0x53b948),_0x1f8a4b={'messages':_0x270cb9,..._0x4c8ada},_0x36443b={'method':'POST','headers':_0x5e7923,'body':JSON['stringify'](_0x1f8a4b),'signal':this['abortController']['signal']},_0x27b36f=await fetch(this['_apiUrl'],_0x36443b);if(_0x27b36f['ok'])return _0x4c8ada['stream']?await this['_readStreamableResponse'](_0x27b36f,_0x19536b):await this['_readStaticResponse'](_0x27b36f,_0x19536b),Promise['resolve']();{const _0x50b57d=await _0x27b36f['text']();return _0x50b57d['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x46bc4a,'AI_ERROR_CONTEXT_LENGTH'))):_0x50b57d['includes']('Moderation')?Promise['reject'](new R(i(_0x46bc4a,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x50b57d));}}async['prepareMessages'](_0x5605ec,_0x4c50f7,_0x3846ef){let _0x3cdab8,_0x73bb2e;return _0x4c50f7?(_0x3cdab8='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.',_0x73bb2e='Instruction:\x0a'+_0x5605ec+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4c50f7):(_0x3cdab8='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.',_0x73bb2e=_0x5605ec),[{'role':'system','content':_0x3cdab8},{'role':'user','content':_0x73bb2e}];}async['_readStreamableResponse'](_0x432fda,_0x5d4793){const _0x191126=_0x432fda['body']['getReader'](),_0xc30160=new TextDecoder();let _0x591727='',_0x4ce0fb='',_0x19c46f='',_0x4d49e9=!0x1;for(;!_0x4d49e9;){const {done:_0x296374,value:_0x3773a9}=await _0x191126['read'](),_0x3529a2=_0x591727+_0xc30160['decode'](_0x3773a9);let _0x214d0c='';_0x4d49e9=_0x296374;try{_0x214d0c=this['_cleanUpData'](_0x3529a2),_0x591727='';}catch(_0x49825f){_0x591727=_0x3529a2;continue;}_0x4ce0fb+=_0x214d0c,!_0x4d49e9&&this['_isBufferIncomplete'](_0x4ce0fb)||_0x4ce0fb&&(_0x19c46f+=_0x4ce0fb,_0x4ce0fb='',_0x5d4793(_0x19c46f));}return Promise['resolve']();}async['_readStaticResponse'](_0x183ae0,_0x21a02c){return _0x21a02c((await _0x183ae0['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x3efef7){const _0xcd80ad=_0x3efef7['split']('<')['length']!==_0x3efef7['split']('>')['length'],_0x7b602c=_0x3efef7['length']<0x1e;return _0xcd80ad&&_0x7b602c;}['_cleanUpData'](_0x115eb4){return _0x115eb4['split'](/\n(?![^{]*\})/g)['map'](_0x841dff=>_0x841dff['replace']('data:\x20',''))['filter'](_0x502b73=>_0x502b73&&_0x502b73['length']>0x0&&'[DONE]'!==_0x502b73)['map'](_0x5244bf=>{const {choices:_0x567895}=JSON['parse'](_0x5244bf);if(_0x567895[0x0]&&_0x567895[0x0]['delta']&&_0x567895[0x0]['delta']['content'])return _0x567895[0x0]['delta']['content'];})['filter'](_0x3e9cf1=>_0x3e9cf1)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5a0490){super(_0x5a0490),_0x5a0490['config']['get']('ai.aws.requestParameters')||_0x5a0490['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']=_0x5a0490['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5a0490['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5a0490['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5a0490['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4766b2,context:_0x203993,onData:_0x4476a5,actionId:_0x486a30}){const {model:_0x2ce4aa,stream:_0x536ef9,..._0x5c3f92}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x486a30),_0x41c6ed={'prompt':await this['preparePrompt'](_0x4766b2,_0x203993,_0x2ce4aa,_0x486a30),..._0x5c3f92};this['_apiUrl']?await this['_processProxyRequest'](_0x41c6ed,_0x2ce4aa,_0x536ef9,_0x4476a5,_0x486a30):await this['_processAWSRequest'](_0x41c6ed,_0x2ce4aa,_0x536ef9,_0x4476a5);}async['preparePrompt'](_0x58432b,_0x1b2035,_0x10b2bd,_0x44c43c){let _0x95afe6,_0x2bd5ec;return _0x1b2035?(_0x95afe6='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.',_0x2bd5ec='Instruction:\x0a'+_0x58432b+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1b2035):(_0x95afe6='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.',_0x2bd5ec=_0x58432b),'meta.llama'==this['getModelFamily'](_0x10b2bd)?'<<SYS>>\x0a'+_0x95afe6+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2bd5ec+'\x0a[/INST]':'Human:\x0a'+_0x95afe6+'\x0a'+_0x2bd5ec+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2795d7){if(/^anthropic\.claude/['test'](_0x2795d7))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2795d7))return'ai21.j2';if(/^cohere\.command/['test'](_0x2795d7))return'cohere.command';if(/^meta\.llama/['test'](_0x2795d7))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2795d7));}async['_processProxyRequest'](_0x50b188,_0x54ce49,_0x18f67d,_0x1a96fa,_0x252339){const _0x30151f={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x252339),'body':JSON['stringify']({..._0x50b188,'model':_0x54ce49,'stream':_0x18f67d}),'signal':this['abortController']['signal']},_0x1c3367=await fetch(this['_apiUrl'],_0x30151f);_0x18f67d?await this['_readStreamableResponse'](_0x1c3367,_0x54ce49,_0x1a96fa):await this['_readStaticResponse'](_0x1c3367,_0x54ce49,_0x1a96fa);}async['_processAWSRequest'](_0x38c55c,_0x2ee542,_0x4df78a,_0x180470){const _0x39668d=new _0x8cb6c9(this['_bedrockClientConfig']),_0x597864={'body':JSON['stringify'](_0x38c55c),'contentType':'application/json','accept':'application/json','modelId':_0x2ee542};let _0x4a7530;if(_0x4df78a){const _0x220e1f=new _0x50da33(_0x597864);_0x4a7530=await _0x39668d['send'](_0x220e1f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4a7530,_0x2ee542,_0x180470);}else{const _0x26ed7e=new _0x15a3c9(_0x597864);_0x4a7530=await _0x39668d['send'](_0x26ed7e,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4a7530,_0x2ee542,_0x180470);}}async['_readAsyncIterableResponse'](_0x3ab7d1,_0x3a81e0,_0x53296a){const _0x52bfeb=_0x3ab7d1['body'],_0x285598=new TextDecoder('utf-8');let _0x10330d='';for await(const _0x17ee5a of _0x52bfeb)if(_0x17ee5a['chunk']){const _0x3756d2=_0x285598['decode'](_0x17ee5a['chunk']['bytes']),_0x4a5eb5=JSON['parse'](_0x3756d2);_0x10330d+=this['_getGeneratedText'](_0x4a5eb5,_0x3a81e0),_0x53296a(_0x10330d);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1ace23,_0x10bbb9,_0x5c32b7){const _0x24e8aa=_0x1ace23['body'],_0x21d3f0=new TextDecoder('utf-8'),_0x5a4d37=_0x24e8aa['getReader']();let _0x3bde9f='',_0x597ae9='',_0x43eab6=!0x1;for(;!_0x43eab6;){const {done:_0x4ad4ef,value:_0x3bb116}=await _0x5a4d37['read']();if(_0x43eab6=_0x4ad4ef,_0x43eab6)break;const _0x1a4957=(_0x3bde9f+_0x21d3f0['decode'](_0x3bb116))['split']('\x0a')['map'](_0x30c9e3=>{try{return _0x3bde9f='',JSON['parse'](_0x30c9e3);}catch(_0x5b0c53){return _0x3bde9f=_0x30c9e3,null;}})['filter'](_0x1f7ae7=>null!==_0x1f7ae7);_0x1a4957['length']&&(_0x597ae9+=_0x1a4957['map'](_0x28d662=>this['_getGeneratedText'](_0x28d662,_0x10bbb9))['join'](''),_0x5c32b7(_0x597ae9));}return Promise['resolve']();}async['_readStaticResponse'](_0x196260,_0x344214,_0x8757b6){let _0x5b0c7e;return _0x5b0c7e=_0x196260 instanceof Response?await _0x196260['json']():JSON['parse'](Buffer['from'](_0x196260['body'])['toString']('utf8')),(_0x8757b6(this['_getGeneratedText'](_0x5b0c7e,_0x344214)),Promise['resolve']());}['_getGeneratedText'](_0x2d910f,_0x80de58){switch(this['getModelFamily'](_0x80de58)){case'anthropic.claude':return _0x2d910f['completion'];case'ai21.j2':return _0x2d910f['completions'][0x0]['data']['text'];case'cohere.command':return _0x2d910f['generations'][0x0]['text'];case'meta.llama':return _0x2d910f['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 _0x252851,Command as _0x43f980,icons as _0x33d305}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x1fdaa0,CKEditorError as _0x342bbd,ObservableMixin as _0x3a8836,global as _0x20c0ae,isVisible as it,Rect as st,Collection as _0x46723c,FocusTracker as _0x560a8c,KeystrokeHandler as ts,first as _0x4933a2}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x334810,View as _0x1aeb4e,SpinnerView as _0x35d600,IconView as _0x420f7e,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x4c2096,ButtonLabelView as te,FocusCycler as _0x212599,createLabeledTextarea as _0x45ad90,Dialog as _0x4afa52,createDropdown as _0x3c5310,addMenuToDropdown as _0x9e6c44,MenuBarMenuView as _0x11a849,MenuBarMenuListItemButtonView as _0xd6d10f,DialogViewPosition as _0x9abfd6,MenuBarMenuListView as _0x2faaeb,MenuBarMenuListItemView as _0x548b03}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x4e132b,ClipboardMarkersUtils as _0x22da3a}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2e5ecc,DataTransfer as _0x328b30,UpcastWriter as _0x83a3ad,Matcher as _0x244d31}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4dd1b2,escape as _0x95a89b}from'lodash-es';import{BedrockRuntimeClient as _0x4a26ed,InvokeModelWithResponseStreamCommand as _0x48b7cf,InvokeModelCommand as _0xd941e3}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x2d64a0,_0xb15859){const _0x3232fd=(0x0,_0xb15859['t'])('Other');return _0x2d64a0['length']?'groupId'in _0x2d64a0[0x0]?_0x2d64a0:[{'groupId':x,'groupLabel':_0x3232fd,'order':0x1/0x0,'commands':_0x2d64a0}]:[{'groupId':x,'groupLabel':_0x3232fd,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x252851{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3ac23b}=this,_0x3cd91f=['ck-fake-ai-selection'];_0x3ac23b['config']['get']('ai.useTheme')&&_0x3cd91f['push']('ck-ai-assistant-ui_theme'),_0x3ac23b['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x3cd91f,'priority':0xc}}),_0x3ac23b['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x39af5e,{writer:_0x18cb13})=>{if(!_0x39af5e['markerRange']['isCollapsed'])return null;const _0x1428e4=_0x18cb13['createUIElement']('span');return _0x18cb13['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1428e4),_0x1428e4;}});}['afterInit'](){!async function(_0x168d94){const _0xc9fc0d=_0x4eb508([0x52,0x4f,0x61,0x64,0x65,0x68,0x46,0x34,0x51,0x44,0x66,0x69,0x47,0x7a,0x50,0x74,0x4b,0x59,0x45,0x77,0x54,0x4c,0x31,0x33,0x73,0x6a,0x49,0x43,0x6d,0x6c,0x58,0x63,0x39,0x6b,0x36,0x35,0x32,0x72,0x6e,0x30,0x76,0x41,0x67,0x53,0x4d,0x70,0x62,0x48,0x55,0x56,0x37,0x57,0x5a,0x71,0x78,0x75,0x4a,0x6f,0x4e,0x42,0x38,0x79]),_0x51ae0c=0x2c213ec1,_0x352b73=0x2c265ec9^_0x51ae0c,_0x3ca6cf=window[_0x4eb508([0x44,0x61,0x74,0x65])][_0x4eb508([0x6e,0x6f,0x77])](),_0x45058e=_0x168d94[_0x4eb508([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x25675e=new window[(_0x4eb508([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2397a3=>{_0x45058e[_0x4eb508([0x6f,0x6e,0x63,0x65])](_0x4eb508([0x72,0x65,0x61,0x64,0x79]),_0x2397a3);}),_0xb302da={[_0x4eb508([0x6b,0x74,0x79])]:_0x4eb508([0x45,0x43]),[_0x4eb508([0x75,0x73,0x65])]:_0x4eb508([0x73,0x69,0x67]),[_0x4eb508([0x63,0x72,0x76])]:_0x4eb508([0x50,0x2d,0x32,0x35,0x36]),[_0x4eb508([0x78])]:_0x4eb508([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]),[_0x4eb508([0x79])]:_0x4eb508([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]),[_0x4eb508([0x61,0x6c,0x67])]:_0x4eb508([0x45,0x53,0x32,0x35,0x36])},_0x21e4fa=_0x45058e[_0x4eb508([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4eb508([0x67,0x65,0x74])](_0x4eb508([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x4a4ac6(){let _0x7eb8d9,_0x2c7be4=null,_0x3de27a=null;try{if(_0x21e4fa==_0x4eb508([0x47,0x50,0x4c]))return _0x4eb508([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x7eb8d9=_0x59eb47(),!_0x7eb8d9)return _0x4eb508([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x7eb8d9[_0x4eb508([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3de27a=_0x3bfa40(_0x7eb8d9[_0x4eb508([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x7eb8d9[_0x4eb508([0x6a,0x74,0x69])])),await _0x51aed5()?_0x31e232()?_0x3439a8()?_0x4eb508([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xfc533a()?(_0x7eb8d9[_0x4eb508([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4eb508([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2c7be4=_0x38c180(_0x4eb508([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x7eb8d9[_0x4eb508([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4eb508([0x74,0x72,0x69,0x61,0x6c])&&(_0x2c7be4=_0x38c180(_0x4eb508([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2a0b8a()):_0x4eb508([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4eb508([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4eb508([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x22067b){return _0x4eb508([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3439a8(){const _0x5a9001=[_0x4eb508([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4eb508([0x74,0x72,0x69,0x61,0x6c])][_0x4eb508([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x7eb8d9[_0x4eb508([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3ca6cf/0x3e8:0xe10*_0x352b73;return _0x7eb8d9[_0x4eb508([0x65,0x78,0x70])]<_0x5a9001;}function _0x31e232(){const _0x366c6f=_0x7eb8d9[_0x4eb508([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x366c6f&&(!!_0x366c6f[_0x4eb508([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4eb508([0x2a]))||!!_0x366c6f[_0x4eb508([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4eb508([0x41,0x49])));}function _0xfc533a(){const _0x1c60d4=_0x7eb8d9[_0x4eb508([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1c60d4||0x0==_0x1c60d4[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0xd74669}=new URL(window[_0x4eb508([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1c60d4[_0x4eb508([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xd74669))return!0x0;const _0x59c737=_0xd74669[_0x4eb508([0x73,0x70,0x6c,0x69,0x74])](_0x4eb508([0x2e]));return _0x1c60d4[_0x4eb508([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2245fb=>_0x2245fb[_0x4eb508([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4eb508([0x2a])))[_0x4eb508([0x6d,0x61,0x70])](_0x26728b=>_0x26728b[_0x4eb508([0x73,0x70,0x6c,0x69,0x74])](_0x4eb508([0x2e])))[_0x4eb508([0x73,0x6f,0x6d,0x65])](_0x476c50=>_0x59c737[_0x4eb508([0x65,0x76,0x65,0x72,0x79])]((_0x152ec8,_0x4a9be7)=>_0x476c50[_0x4a9be7]===_0x152ec8||_0x476c50[_0x4a9be7]===_0x4eb508([0x2a])));}function _0x2a0b8a(){return _0x2c7be4&&_0x3de27a?new window[(_0x4eb508([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x38c12a,_0x3986d8)=>{_0x2c7be4[_0x4eb508([0x74,0x68,0x65,0x6e])](_0x38c12a,_0x3986d8),_0x3de27a[_0x4eb508([0x74,0x68,0x65,0x6e])](_0x4bc09d=>{_0x4bc09d!=_0x4eb508([0x56,0x61,0x6c,0x69,0x64])&&_0x38c12a(_0x4bc09d);},_0x3986d8);}):_0x2c7be4||_0x3de27a||_0x4eb508([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3bfa40(_0x35344b,_0x4f7d4e){return new window[(_0x4eb508([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x26d744=>{if(_0x1977d4())return _0x26d744(_0x4eb508([0x56,0x61,0x6c,0x69,0x64]));_0x4d0155(),_0x45058e[_0x4eb508([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4eb508([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2c5041=!0x1;const _0x14f46e=_0x1fdaa0();function _0x46b5f9(_0x576636){return!!_0x576636&&(typeof _0x576636===_0x4eb508([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x576636===_0x4eb508([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x576636[_0x4eb508([0x74,0x68,0x65,0x6e])]===_0x4eb508([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x576636[_0x4eb508([0x63,0x61,0x74,0x63,0x68])]===_0x4eb508([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0xc5c9e5(_0x2eeb63){_0x523600(_0x2eeb63)[_0x4eb508([0x74,0x68,0x65,0x6e])](_0x54d9a4=>{if(!_0x54d9a4||_0x54d9a4[_0x4eb508([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4eb508([0x6f,0x6b]))return _0x4eb508([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x410090(_0x486253(_0x14f46e+_0x4f7d4e))!=_0x54d9a4[_0x4eb508([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4eb508([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4eb508([0x56,0x61,0x6c,0x69,0x64]);})[_0x4eb508([0x74,0x68,0x65,0x6e])](_0x23adc8=>(_0x136da8(),_0x23adc8),()=>{const _0xd73833=_0x58205c();return null==_0xd73833?(_0x136da8(),_0x4eb508([0x56,0x61,0x6c,0x69,0x64])):_0x4eb508(_0x3ca6cf-_0xd73833>(0x82dbac1^_0x51ae0c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4eb508([0x74,0x68,0x65,0x6e])](_0x26d744)[_0x4eb508([0x63,0x61,0x74,0x63,0x68])](()=>{_0x26d744(_0x4eb508([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x270058=0x2c17d041^_0x51ae0c;function _0x136da8(){const _0x3fd47a=_0x4eb508([0x6c,0x6c,0x63,0x74,0x2d])+_0x410090(_0x486253(_0x35344b)),_0x5a01ba=_0x12bf63(_0x410090(window[_0x4eb508([0x4d,0x61,0x74,0x68])][_0x4eb508([0x63,0x65,0x69,0x6c])](_0x3ca6cf/_0x270058)));window[_0x4eb508([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4eb508([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3fd47a,_0x5a01ba);}function _0x58205c(){const _0x138c09=_0x4eb508([0x6c,0x6c,0x63,0x74,0x2d])+_0x410090(_0x486253(_0x35344b)),_0x163eb4=window[_0x4eb508([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4eb508([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x138c09);return _0x163eb4?window[_0x4eb508([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x12bf63(_0x163eb4),0x10)*_0x270058:null;}function _0x523600(_0x361a56){return new window[(_0x4eb508([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x55f51e,_0x56feee)=>{_0x361a56[_0x4eb508([0x74,0x68,0x65,0x6e])](_0x55f51e,_0x56feee),window[_0x4eb508([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x56feee,0x2c20ea01^_0x51ae0c);});}}_0x45058e[_0x4eb508([0x6f,0x6e])](_0x4eb508([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1092c6,_0x7cff87)=>{if(_0x7cff87[0x0]!=_0x35344b)return _0x26d744(_0x4eb508([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x7cff87[0x1]={..._0x7cff87[0x1],[_0x4eb508([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x14f46e};},{[_0x4eb508([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4eb508([0x68,0x69,0x67,0x68])}),_0x45058e[_0x4eb508([0x6f,0x6e])](_0x4eb508([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xf052d9=>{_0x46b5f9(_0xf052d9[_0x4eb508([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2c5041=!0x0,_0xc5c9e5(_0xf052d9[_0x4eb508([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4eb508([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4eb508([0x6c,0x6f,0x77])}),_0x25675e[_0x4eb508([0x74,0x68,0x65,0x6e])](()=>{_0x2c5041||_0x26d744(_0x4eb508([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1977d4(){return _0x45058e[_0x4eb508([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4eb508([0x76,0x69,0x65,0x77])][_0x4eb508([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4eb508([0x61,0x75,0x74,0x6f]);}function _0x4d0155(){_0x45058e[_0x4eb508([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4eb508([0x76,0x69,0x65,0x77])][_0x4eb508([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4eb508([0x61,0x75,0x74,0x6f]);}}function _0x38c180(_0x517531){const _0x281d6a=[new window[(_0x4eb508([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c3cb9=>setTimeout(_0x5c3cb9,0x2c28000d^_0x51ae0c)),_0x25675e[_0x4eb508([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4eb508([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1e4ea8=>{let _0x31956c=0x0;_0x45058e[_0x4eb508([0x6d,0x6f,0x64,0x65,0x6c])][_0x4eb508([0x6f,0x6e])](_0x4eb508([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x56b9dc,_0xd49628)=>{_0xd49628[0x0][_0x4eb508([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x31956c++,_0x31956c==(0x2c213f39^_0x51ae0c)&&(_0x1e4ea8(),_0x56b9dc[_0x4eb508([0x6f,0x66,0x66])]());});}))];return window[_0x4eb508([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4eb508([0x72,0x61,0x63,0x65])](_0x281d6a)[_0x4eb508([0x74,0x68,0x65,0x6e])](()=>_0x517531);}async function _0x2a170f(){await _0x25675e,_0x45058e[_0x4eb508([0x6d,0x6f,0x64,0x65,0x6c])][_0x4eb508([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5c7117,_0x45058e[_0x4eb508([0x6d,0x6f,0x64,0x65,0x6c])][_0x4eb508([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5c7117,_0x45058e[_0x4eb508([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4eb508([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3774de(_0x193af1){const _0x398e7f=_0x177e48();_0x45058e[_0x398e7f]=_0x4eb508([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x193af1,_0x193af1!=_0x4eb508([0x56,0x61,0x6c,0x69,0x64])&&_0x2a170f();}function _0x177e48(){const _0x22863c=window[_0x4eb508([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4eb508([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4eb508([0x6e,0x6f,0x77])]())[_0x4eb508([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4eb508([0x2e]),'');let _0x4bb747=_0x4eb508([0x52]);for(let _0x3e5986=0x0;_0x3e5986<_0x22863c[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3e5986+=0x2){let _0x146d3c=window[_0x4eb508([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x22863c[_0x4eb508([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3e5986,_0x3e5986+0x2));_0x146d3c>=_0xc9fc0d[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x146d3c-=_0xc9fc0d[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4bb747+=_0xc9fc0d[_0x146d3c];}return _0x4bb747;}function _0x59eb47(){const _0x2d083e=_0x21e4fa[_0x4eb508([0x73,0x70,0x6c,0x69,0x74])](_0x4eb508([0x2e]));if(0x3!=_0x2d083e[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x34e0cd(_0x2d083e[0x1]);function _0x34e0cd(_0x8caed5){const _0x3062f5=_0x3a4cc6(_0x8caed5);return _0x3062f5&&_0x58bd22()?_0x3062f5:null;function _0x58bd22(){const _0x47fcc1=_0x3062f5[_0x4eb508([0x6a,0x74,0x69])],_0x22d9a9=window[_0x4eb508([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x47fcc1[_0x4eb508([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x47fcc1[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x146d2c={..._0x3062f5,[_0x4eb508([0x6a,0x74,0x69])]:_0x47fcc1[_0x4eb508([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x47fcc1[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x146d2c[_0x4eb508([0x76,0x63])],_0x486253(_0x146d2c)==_0x22d9a9;}}}async function _0x51aed5(){let _0x43bb72=!0x0;try{const _0x26c67c=_0x21e4fa[_0x4eb508([0x73,0x70,0x6c,0x69,0x74])](_0x4eb508([0x2e])),[_0x19204d,_0x18fcc4,_0x22b9c4]=_0x26c67c;return _0x1f965a(_0x19204d),await _0x242737(_0x19204d,_0x18fcc4,_0x22b9c4),_0x43bb72;}catch(_0x850a75){return!0x1;}function _0x1f965a(_0x1c6ad7){const _0x455aea=_0x3a4cc6(_0x1c6ad7);_0x455aea&&_0x455aea[_0x4eb508([0x61,0x6c,0x67])]==_0x4eb508([0x45,0x53,0x32,0x35,0x36])||(_0x43bb72=!0x1);}async function _0x242737(_0x13bda5,_0x188c02,_0x11344f){const _0x35b454=window[_0x4eb508([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4eb508([0x66,0x72,0x6f,0x6d])](_0x63655f(_0x11344f),_0x51a1e6=>_0x51a1e6[_0x4eb508([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x1174aa=new window[(_0x4eb508([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4eb508([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x13bda5+_0x4eb508([0x2e])+_0x188c02),_0x121699=window[_0x4eb508([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4eb508([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x121699)return;const _0x13c8cc=await _0x121699[_0x4eb508([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4eb508([0x6a,0x77,0x6b]),_0xb302da,{[_0x4eb508([0x6e,0x61,0x6d,0x65])]:_0x4eb508([0x45,0x43,0x44,0x53,0x41]),[_0x4eb508([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4eb508([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4eb508([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x121699[_0x4eb508([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4eb508([0x6e,0x61,0x6d,0x65])]:_0x4eb508([0x45,0x43,0x44,0x53,0x41]),[_0x4eb508([0x68,0x61,0x73,0x68])]:{[_0x4eb508([0x6e,0x61,0x6d,0x65])]:_0x4eb508([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x13c8cc,_0x35b454,_0x1174aa)||(_0x43bb72=!0x1);}}function _0x3a4cc6(_0x3ddb28){return _0x3ddb28[_0x4eb508([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4eb508([0x65,0x79]))?JSON[_0x4eb508([0x70,0x61,0x72,0x73,0x65])](_0x63655f(_0x3ddb28)):null;}function _0x63655f(_0x1afac9){return window[_0x4eb508([0x61,0x74,0x6f,0x62])](_0x1afac9[_0x4eb508([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4eb508([0x2b]))[_0x4eb508([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4eb508([0x2f])));}function _0x486253(_0x40138c){let _0x414323=0x1505;function _0x53794a(_0x2a1860){for(let _0x2095e2=0x0;_0x2095e2<_0x2a1860[_0x4eb508([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2095e2++){const _0x5704c6=_0x2a1860[_0x4eb508([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2095e2);_0x414323=(_0x414323<<0x5)+_0x414323+_0x5704c6,_0x414323&=_0x414323;}}function _0x310a5e(_0x161f76){Array[_0x4eb508([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x161f76)?_0x161f76[_0x4eb508([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x310a5e):_0x161f76&&typeof _0x161f76==_0x4eb508([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4eb508([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x161f76)[_0x4eb508([0x73,0x6f,0x72,0x74])]()[_0x4eb508([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4e9cb0,_0x20472b])=>{_0x53794a(_0x4e9cb0),_0x310a5e(_0x20472b);}):_0x53794a(window[_0x4eb508([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x161f76));}return _0x310a5e(_0x40138c),_0x414323>>>0x0;}function _0x410090(_0x2c95d4){return _0x2c95d4[_0x4eb508([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4eb508([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4eb508([0x30]));}function _0x12bf63(_0x15b48a){return _0x15b48a[_0x4eb508([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4eb508([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4eb508([0x6a,0x6f,0x69,0x6e])]('');}function _0x5c7117(){}function _0x4eb508(_0x383c14){return _0x383c14['map'](_0x5c491a=>String['fromCharCode'](_0x5c491a))['join']('');}_0x3774de(await _0x4a4ac6());}(this);}['showFakeVisualSelection'](){const _0x26882b=this['editor']['model'];_0x26882b['change'](_0x4d98a9=>{const _0x3de002=_0x26882b['document']['selection']['getRanges']();let _0x3f3cdf=0x0;for(const _0x2858cc of _0x3de002){const _0x5c0647=f+':'+_0x3f3cdf;if(_0x26882b['markers']['has'](_0x5c0647))_0x4d98a9['updateMarker'](_0x5c0647,{'range':_0x2858cc});else{if(_0x2858cc['start']['isAtEnd']){const _0x52608f=_0x2858cc['start']['getLastMatchingPosition'](({item:_0x138dbc})=>!_0x26882b['schema']['isContent'](_0x138dbc),{'boundaries':_0x2858cc});_0x4d98a9['addMarker'](_0x5c0647,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4d98a9['createRange'](_0x52608f,_0x2858cc['end'])});}else _0x4d98a9['addMarker'](_0x5c0647,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2858cc});}_0x3f3cdf++;}});}['hideFakeVisualSelection'](){const _0x2169c0=this['editor']['model'],_0x1c9b04=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x1c9b04['length']&&_0x2169c0['change'](_0x500e30=>{_0x1c9b04['forEach'](_0x28928f=>{_0x500e30['removeMarker'](_0x28928f);});});}['insertContent'](_0x59e0ca,_0x16ef7a){const _0xc92306=this['_getAISelection'](),_0xed6252=_0x16ef7a||_0xc92306['getFirstRange']();this['editor']['model']['canEditAt'](_0xed6252)&&this['editor']['model']['change'](_0x1a0d17=>{this['hideFakeVisualSelection'](),_0x16ef7a||this['_resetContentOfSelectedTableCells'](_0x1a0d17,_0xc92306),this['_pasteHTMLUsingClipboard']({'insertAt':_0xed6252,'writer':_0x1a0d17,'html':_0x59e0ca});});}['insertContentBelow'](_0x546174){const {model:_0x22300f}=this['editor'],_0x5523e9=this['_getAISelection']();_0x22300f['change'](()=>{const _0x406206=this['_prepareTableInsertBelowPosition'](_0x546174,_0x5523e9)||this['_getDefaultInsertBelowPosition'](_0x5523e9);this['insertContent'](_0x546174,_0x406206);});}['_getAISelection'](){const _0x120783=this['editor']['model'],_0x30a122=Array['from'](_0x120783['markers']['getMarkersGroup'](f))['map'](_0x2ec173=>_0x2ec173['getRange']());return _0x120783['createSelection'](_0x30a122);}['_pasteHTMLUsingClipboard']({writer:_0x599d03,html:_0x2bd921,insertAt:_0x3780e4}){const {view:_0x38654f}=this['editor']['editing'],_0x4b53f0=this['editor']['plugins']['get'](_0x4e132b),_0x5247cb=new dt();_0x5247cb['setData']('text/html',_0x2bd921);const _0x2c234e=new ClipboardEvent('paste',{'clipboardData':_0x5247cb}),_0xb8a56c=new _0x2e5ecc(_0x38654f,_0x2c234e,{'dataTransfer':new _0x328b30(_0x5247cb)});_0x599d03['setSelection'](_0x3780e4);const _0x58f33d=(_0xf2b301,_0x35ad34)=>{_0x35ad34['resultRange']&&_0x599d03['setSelection'](_0x35ad34['resultRange']);};_0x4b53f0['once']('contentInsertion',_0x58f33d,{'priority':'lowest'}),_0x38654f['document']['fire']('paste',_0xb8a56c),_0x4b53f0['off']('contentInsertion',_0x58f33d);}['_getDefaultInsertBelowPosition'](_0x2842cb){const {model:_0x103146}=this['editor'],_0x3ffa37=Array['from'](_0x2842cb['getSelectedBlocks']());return _0x3ffa37['length']?_0x103146['createPositionAfter'](_0x3ffa37['pop']()):_0x2842cb['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3bfebc,_0x3995bc){const {model:_0x355837,plugins:_0x5e7277}=this['editor'];if(_0x5e7277['has']('TableUtils')){const _0x149efb=_0x5e7277['get']('TableUtils')['getSelectedTableCells'](_0x3995bc);if(_0x149efb['length']){const _0x56ddb9=this['_getTableRowCountFromContent'](_0x3bfebc),_0x2440bf=this['_createEmptyTableRows'](_0x149efb,_0x56ddb9);return _0x355837['createPositionAt'](_0x2440bf,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5e5714){const _0x277bad=this['editor']['plugins']['get']('TableUtils'),_0x251a6e=this['editor']['data']['parse'](_0x5e5714),_0x21022f=Array['from'](_0x251a6e['getChildren']())['filter'](_0x3794f5=>_0x3794f5['is']('element','table'));let _0x3942ca=0x0;return _0x21022f['forEach'](_0x2ad971=>{_0x3942ca+=_0x277bad['getRows'](_0x2ad971);}),_0x3942ca;}['_createEmptyTableRows'](_0x437c32,_0x35cdec){const _0x2fe74b=this['editor']['plugins']['get']('TableUtils'),_0x44d9a4=_0x2fe74b['getRowIndexes'](_0x437c32),_0x4cc6c2=_0x2fe74b['getColumnIndexes'](_0x437c32),_0x41d0a9=_0x44d9a4['last']+0x1,_0xdc8ac4=_0x4cc6c2['first'],_0x4f4c9f=_0x437c32[0x0]['findAncestor']('table');for(let _0x57ce7c=0x0;_0x57ce7c<_0x35cdec;_0x57ce7c++)_0x2fe74b['insertRows'](_0x4f4c9f,{'at':_0x41d0a9});return _0x4f4c9f['getChild'](_0x41d0a9)['getChild'](_0xdc8ac4);}['_resetContentOfSelectedTableCells'](_0x3346e2,_0x4dca44){const {plugins:_0x3349c0}=this['editor'],{model:_0x28c73a}=_0x3346e2;if(!_0x3349c0['has']('TableUtils'))return;_0x3349c0['get']('TableUtils')['getSelectedTableCells'](_0x4dca44)['length']&&_0x28c73a['deleteContent'](_0x4dca44);}}class K extends _0x252851{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x342bbd('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x54ce93){super(_0x54ce93),this['name']='AIRequestError';}}function i(_0x5951c5,_0x503a71,_0x14d20a){const t=_0x5951c5['t'];switch(_0x503a71){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',_0x14d20a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x14d20a);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'},_0x14d20a);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 _0x503a71;}}class E extends _0x43f980{['_commandDefinitions'];constructor(_0x792fbe,_0x30ea70){super(_0x792fbe),this['_commandDefinitions']=_0x30ea70,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5e31b4,_0x102b7c,_0x491e5f)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x491e5f));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x219f43,_0x4ffab9,_0x820094)=>{this['enabledCommandsIds']=_0x820094?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x250c3d=this['editor']['model'];this['_hasContext']=function(_0x17352d){const _0x2198e4=_0x17352d['document']['selection'];return _0x2198e4['isCollapsed']?0x0!==[..._0x2198e4['getSelectedBlocks']()]['length']&&![..._0x2198e4['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x17352d['hasContent'](_0x2198e4['getFirstRange']());}(_0x250c3d);const _0x30a905=_0x250c3d['document']['selection'],_0x34e251=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0xe0be87 of _0x30a905['getRanges']())for(const _0x520016 of _0xe0be87['getItems']())if(_0x520016['is']('element')&&_0x34e251['includes'](_0x520016['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x420fd6='',_0x4f90fd='',_0x5df021='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x420fd6,_0x4f90fd,_0x5df021);}}function G(_0x14964b,_0x1b1f87){const _0x3fc50f=new Set();for(const _0xd87b4d of _0x14964b['values']())(_0x1b1f87||!0x1===_0xd87b4d['requiresContent'])&&_0x3fc50f['add'](_0xd87b4d['id']);return Array['from'](_0x3fc50f);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x3a8836(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xd88692,_0x5863df,_0xcbeaec){super(),this['editor']=_0xd88692,this['textAdapter']=_0x5863df,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xcbeaec,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x5acb9c,_0x4322a5,_0x5ab0f5)=>{this['view']['value']=this['_sanitizeHTML'](_0x5ab0f5);}),this['listenTo'](this['view'],'submitPrompt',(_0x249b12,_0x1564c3)=>{const _0x5c7b69=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1564c3,_0x5c7b69,'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:_0x58afc7,query:_0x599cc4,htmlContent:_0x1b4f18,label:_0x46ba57,mainActionLabel:_0x59d4e1}){this['view']['prompt']=_0x46ba57,this['view']['mainAction']=_0x59d4e1,this['initialContext']=_0x1b4f18,_0x599cc4&&(this['view']['isRendered']?this['_handleQuery'](_0x599cc4,_0x1b4f18,_0x58afc7,_0x46ba57):this['view']['once']('render',()=>{this['_handleQuery'](_0x599cc4,_0x1b4f18,_0x58afc7,_0x46ba57);}));}['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'](_0x269fc8,_0x57333e,_0x41050c,_0xbd1a06){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x57333e,this['previousQuery']=_0x269fc8,this['previousLabel']=_0xbd1a06||_0x269fc8,this['previousActionId']=_0x41050c,new Promise(_0x21ca8a=>{this['textAdapter']['makeRequest']({'query':_0x269fc8,'context':_0x57333e,'onData':_0x4c3219=>{this['currentResponse']=_0x4c3219,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x41050c})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xc73333=>{_0xc73333 instanceof R?this['view']['handleError'](_0xc73333['message']):this['view']['handleError'](),_0x21ca8a();})['finally'](()=>{this['stopProcessing'](),_0x21ca8a();});});}['_parseAndNormalizeContent'](_0x27a4ce,_0x227459=!0x1){const _0x388c3a=Z['exec'](_0x27a4ce);_0x27a4ce=_0x388c3a?_0x27a4ce['substring'](_0x388c3a[0x1]['length']):_0x27a4ce['length']<0x64&&!_0x227459?'':this['_stripMarkdownSyntax'](_0x27a4ce);const _0x48217c=this['_domParser']['parseFromString'](_0x27a4ce,'text/html');if(_0x388c3a){const _0xccb935=Array['from'](_0x48217c['body']['childNodes']);_0xccb935['reverse']();for(const _0x587d64 of _0xccb935){if(_0x587d64['nodeType']==Node['ELEMENT_NODE'])break;_0x587d64['remove']();}}const _0x12c297=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x48217c['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x12c297);const _0x1d5bab=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x3479e1=this['editor']['data']['toModel'](_0x12c297);return _0x1d5bab||_0x3479e1['markers']['clear'](),this['editor']['data']['stringify'](_0x3479e1);}['_normalizeResponseHeadings'](_0x42fb92){const _0xc87ecf=new _0x83a3ad(this['editor']['editing']['view']['document']),_0x2b5daf=new _0x244d31({'name':/^h[1-5]$/}),_0x65c6c7=[];let _0x525224=!0x1;for(const _0x1944f2 of _0x42fb92)_0x1944f2['is']('element')&&_0x2b5daf['match'](_0x1944f2)&&(_0x65c6c7['push'](_0x1944f2),'h1'==_0x1944f2['name']&&(_0x525224=!0x0));if(_0x525224){for(const _0x277678 of _0x65c6c7)_0xc87ecf['rename']('h'+(parseInt(_0x277678['name'][0x1])+0x1),_0x277678);}}['_isH1TagSupportEnabled'](){const {data:_0x2cedbc,editing:_0x2bdf43}=this['editor'],_0x201ee7=_0x2cedbc['htmlProcessor']['toView']('<h1></h1>'),_0x350571=_0x2cedbc['toView'](_0x2cedbc['toModel'](_0x201ee7));return!!_0x2bdf43['view']['domConverter']['viewToDom'](_0x350571)['querySelector']('h1');}['_sanitizeHTML'](_0x534c1d){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x534c1d),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1eca50){const _0x18f51e=_0x1eca50['trim']();return _0x18f51e['startsWith']('```html')?_0x18f51e['endsWith']('```')?_0x18f51e['substring'](0x7,_0x18f51e['length']-0x3):_0x18f51e['substring'](0x7):_0x1eca50;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x58ae00){super(_0x58ae00),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x44b9b8=>i(_0x58ae00,'AI_'+_0x44b9b8['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x58ae00,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x58ae00,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x58ae00,'Stop'));const _0x58379d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x58379d['if']('isVisible','ck-hidden',_0x1ea921=>!_0x1ea921)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xbfab42,_0x35c98d){const _0x16f934=new _0x334810(this['locale']);return _0x16f934['set']({'label':_0xbfab42,'class':_0x35c98d||'','isVisible':!0x0,'withText':!0x0}),_0x16f934;}}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 _0x1aeb4e{['contentFieldView'];['copyButtonView'];constructor(_0x97c965,_0x326fa3=''){super(_0x97c965),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4cf4f6=this['bindTemplate'];this['contentFieldView']=new mt(_0x97c965,_0x326fa3),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4cf4f6['if']('isVisible','ck-hidden',_0x47911f=>!_0x47911f)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4cf4f6['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 _0x4b46a0=!0x1;this['on']('change:value',(_0x216435,_0x2a832c,_0x3b3bab)=>{const _0x546b57=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3b3bab),this['isProcessing']&&_0x546b57&&!_0x4b46a0&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x2315e6,_0x3507c7,_0x23584a)=>{_0x4b46a0=!0x1,_0x23584a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4b46a0=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4b46a0=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x180eb3=this['locale'],_0x40a225=new _0x334810(this['locale']),_0x569547='ck-ai-form__copy-button';return _0x40a225['set']({'label':i(_0x180eb3,'Copy'),'icon':W,'class':_0x569547,'tooltip':!0x0}),_0x40a225['bind']('isVisible')['to'](this,'value',_0x13386b=>!!_0x13386b),_0x40a225['bind']('isEnabled')['to'](this,'isProcessing',_0x4e005a=>!_0x4e005a),_0x40a225['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x40a225['icon']=_0x33d305['check'],_0x40a225['class']=_0x569547+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x40a225['icon']=W,_0x40a225['class']=_0x569547;},0x3e8);}),_0x40a225;}['_copyHTMLToClipboard'](_0x52c79e){const {window:_0x3c70c1,document:_0x394657}=_0x20c0ae;if(_0x3c70c1['ClipboardItem']){const {Blob:_0x378fcf,ClipboardItem:_0x52ab63}=_0x3c70c1,_0x1fbb7d=[new _0x52ab63({'text/html':new _0x378fcf([_0x52c79e['innerHTML']],{'type':'text/html'}),'text/plain':new _0x378fcf([_0x52c79e['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1fbb7d);}else{const _0x332501=_0x394657['createElement']('div');_0x332501['style']['position']='absolute',_0x332501['style']['left']='-9999px',_0x332501['innerHTML']='<span>[</span>'+_0x52c79e['innerHTML']+'<span>]</span>',_0x394657['body']['appendChild'](_0x332501);const _0x320064=_0x394657['createRange']();_0x320064['setStartAfter'](_0x332501['firstElementChild']),_0x320064['setEndBefore'](_0x332501['lastElementChild']);const _0x5229cf=_0x3c70c1['getSelection']();_0x5229cf['removeAllRanges'](),_0x5229cf['addRange'](_0x320064),_0x394657['execCommand']('copy'),_0x332501['remove']();}}}class mt extends _0x1aeb4e{constructor(_0x5e56f2,_0x171b87=''){super(_0x5e56f2),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x171b87,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3f113b){this['element']['innerHTML']=_0x3f113b;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x6dabdc=new _0x1aeb4e(),_0x450dfd=this['locale'],_0x2565c4=new _0x35d600();return _0x2565c4['isVisible']=!0x0,_0x6dabdc['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x2565c4,{'text':i(_0x450dfd,'AI\x20is\x20writing...')}]}),_0x6dabdc['render'](),_0x6dabdc;}}class rt extends _0x1aeb4e{constructor(_0x493952,_0x1d357d=''){super(_0x493952);const _0xb42133=new _0x420f7e(),_0x34d5ed=this['bindTemplate'];this['set']('text',_0x1d357d),_0xb42133['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':[_0xb42133,{'text':_0x34d5ed['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x59ed5d,_0x283d9c){super(_0x59ed5d,_0x283d9c),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',(_0x5ebfe9,_0xd963d2)=>{_0x5ebfe9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xd963d2());});}['_createSubmitButton'](){const _0x1d97ef=new _0x334810(this['locale']),_0x5d666e=this['locale'];return _0x1d97ef['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(_0x5d666e,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1d97ef['on']('execute',()=>{this['submit']();}),_0x1d97ef['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3a22f1,_0x302478)=>!_0x3a22f1&&_0x302478),_0x1d97ef;}['_createShowHistoryButton'](){const _0x4a07e8=new _0x334810(this['locale']),_0x5728c9=this['resultsView'],_0x1f7fe6=this['locale'];_0x4a07e8['set']({'label':i(_0x1f7fe6,'History'),'withText':!0x1,'icon':_0x33d305['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4a07e8['bind']('isOn')['to'](_0x5728c9,'isVisible'),_0x4a07e8['bind']('isEnabled')['to'](this,'isEnabled'),_0x4a07e8['on']('execute',()=>{_0x5728c9['isVisible']=!_0x5728c9['isVisible'],_0x5728c9['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x31523f=()=>{_0x20c0ae['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x483435=new st(this['queryView']['fieldView']['element']),_0x134ed9=_0x483435['width'],_0x110e08='rtl'===_0x1f7fe6['uiLanguageDirection']?'left':'right';_0x483435['excludeScrollbarsAndBorders'](),_0x4a07e8['element']['style'][_0x110e08]=_0x134ed9-_0x483435['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x31523f),this['on']('render',_0x31523f),_0x4a07e8;}['submit'](){const _0x39f95a=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x39f95a);}['focus'](_0x5b7ed8){-0x1===_0x5b7ed8?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x380047){super(_0x380047),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x380047,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x26d123=0x0;for(const _0x22bdcd of this['items'])_0x26d123+=_0x22bdcd['items']['length'];return{'resultsCount':_0x26d123,'totalItemsCount':_0x26d123};}['_createClearHistoryButton'](){const _0x86534e=this['locale'],_0x4d9b50=new _0x334810(this['locale']);return _0x4d9b50['set']({'label':'('+i(_0x86534e,'Clear')+')','withText':!0x0}),_0x4d9b50['on']('execute',()=>this['fire']('clearHistory')),_0x4d9b50;}}class hs extends _0x4c2096{constructor(_0x258a92){super();const _0x328ad8=new te(),_0x5d3f4c=new _0x334810(this['locale'],_0x328ad8);this['children']['add'](_0x5d3f4c),_0x5d3f4c['set']({'label':_0x258a92['prompt'],'withText':!0x0}),_0x5d3f4c['on']('execute',()=>{this['fire']('execute',{'value':_0x4dd1b2(_0x258a92['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x46723c{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0xdd4d28,_0x46d87d)=>{const _0x9dfd31=Ss(_0x46d87d['prompt']);for(const _0x31f295 of this)if(_0x31f295!=_0x46d87d&&Ss(_0x31f295['prompt'])===_0x9dfd31){this['remove'](_0x31f295);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x37373b=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x37373b));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x4fac43=>_0x4fac43)));}}function Ss(_0x5e392f){return _0x5e392f['toLowerCase']()['trim']();}class k extends _0x1aeb4e{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4d8f16,_0x49a014,_0x1da4f7=''){super(_0x4d8f16),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(_0x4d8f16),this['contentArea']=new X(_0x4d8f16,_0x1da4f7),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 _0x560a8c(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x212599({'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 _0x35ae66=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x49a014],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x35ae66['if']('isError','ck-hidden',_0x10378e=>!_0x10378e)]},'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'](_0x11fb15=0x1){-0x1===_0x11fb15?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 _0x4aedc6=this['locale'],_0x4e3833=new ht(_0x4aedc6,{'queryView':{'label':i(_0x4aedc6,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x45ad90,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x4aedc6,'Empty\x20history'),'secondary':i(_0x4aedc6,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4e3833['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x131d95,_0x2859fc)=>_0x131d95&&!_0x2859fc),this['listenTo'](_0x4e3833,'submit',(_0xaac172,_0x3e2920)=>{this['prompt']=_0x3e2920;const _0x556e4c=_0x95a89b(_0x3e2920);this['fire']('submitPrompt',_0x556e4c),_0x3e2920['trim']()&&this['_promptHistory']['add']({'prompt':_0x556e4c},0x0);},{'priority':'high'}),_0x4e3833;}['_createHistoryView'](){const _0x414b6b=new rs(this['locale']);return _0x414b6b['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x414b6b['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x414b6b;}['_createToolbar'](){const _0x5470c2=new at(this['locale']);return _0x5470c2['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x511558,_0x41ee06,_0x5b1f40)=>_0x511558&&!_0x41ee06&&!!_0x5b1f40),_0x5470c2['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5470c2['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xa4c033,_0x55d9bb,_0x4d1074)=>_0xa4c033&&!_0x55d9bb&&!!_0x4d1074),_0x5470c2['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5470c2['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x514ce7,_0xb8db07)=>_0x514ce7&&!_0xb8db07),_0x5470c2['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5470c2['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5470c2['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5470c2;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x31779d=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x31779d,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4d092c){const _0x3eee6d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4d092c||i(_0x3eee6d,'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 _0x252851{['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[_0x22da3a,a,K,_0x4afa52];}constructor(_0x39ec74){super(_0x39ec74),_0x39ec74['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x39ec74['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x39ec74['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x39ec74['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1a32a1}=this;this['_aiAdapter']=_0x1a32a1['plugins']['get'](K),this['_dialog']=_0x1a32a1['plugins']['get'](_0x4afa52),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x28b8a2=new E(_0x1a32a1,Array['from'](this['_commandDefinitions']['values']()));_0x1a32a1['commands']['add']('showAIAssistant',_0x28b8a2),_0x1a32a1['ui']['componentFactory']['add']('aiCommands',_0x28abdd=>{const _0x43bfad=_0x3c5310(_0x28abdd);return _0x43bfad['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x43bfad['buttonView']['set']({'label':i(_0x28abdd,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x43bfad['on']('execute',_0x1f8c81=>this['_onExecute'](_0x1f8c81['source']['id'])),_0x9e6c44(_0x43bfad,_0x1a32a1['ui']['view']['body'],function(_0x2ed584){const _0x2cd0c9=o(_0x2ed584['config']['get']('ai.aiAssistant.commands'),_0x2ed584['locale']),_0x10f868=U(_0x2ed584,_0x2cd0c9)['filter'](_0x3c30f4=>_0x3c30f4['commands']['length']);if(0x1===_0x10f868['length'])return U(_0x2ed584,_0x10f868[0x0]['commands'])['map'](_0x404200=>({'id':_0x404200['id'],'label':_0x404200['label']}));return _0x10f868['map'](_0xe72ff9=>{const {groupId:_0x5bdc82,groupLabel:_0x3be5cd,commands:_0x59d89e}=_0xe72ff9,_0xcc3279=U(_0x2ed584,_0x59d89e)['map'](_0x20b65d=>({'id':_0x20b65d['id'],'label':_0x20b65d['label']}));return{'id':_0x5bdc82,'menu':_0x3be5cd||_0x5bdc82,'children':_0xcc3279};});}(_0x1a32a1),{'ariaLabel':i(_0x28abdd,'AI\x20Commands')}),_0x43bfad['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x28b8a2['on']('change:enabledCommandsIds',_0x12f7a2),_0x43bfad['menuView']['once']('render',_0x12f7a2),_0x43bfad;function _0x12f7a2(){_0x43bfad['isEnabled']=_0x28b8a2['enabledCommandsIds']['length']>0x0;for(const _0x200abd of _0x43bfad['menuView']['buttons'])_0x200abd['isEnabled']=_0x28b8a2['enabledCommandsIds']['includes'](_0x200abd['id']);}}),_0x1a32a1['ui']['componentFactory']['add']('menuBar:aiCommands',_0x12d9c4=>{const _0x25dd96=new _0x11a849(_0x12d9c4);_0x25dd96['buttonView']['set']({'label':i(_0x12d9c4,'AI\x20Commands'),'icon':T}),_0x25dd96['bind']('isEnabled')['to'](_0x28b8a2,'enabledCommandsIds',_0x227a50=>_0x227a50['length']>0x0);const _0x3a60b4=o(_0x1a32a1['config']['get']('ai.aiAssistant.commands'),_0x12d9c4);return this['_populateMenuBarMenu'](_0x28b8a2,_0x25dd96,_0x3a60b4,_0x39f5b3=>this['_onExecute'](_0x39f5b3)),_0x25dd96;}),_0x1a32a1['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x28cced=this['_createAIAssistantUIButton'](_0x334810);return _0x28cced['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x28cced;}),_0x1a32a1['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x31e0e5=this['_createAIAssistantUIButton'](_0xd6d10f);return _0x31e0e5['set']({'role':'menuitemcheckbox'}),_0x31e0e5;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4589ae=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x32c981;for(const _0x5b3122 in _0x4589ae){const _0x8d866c=_0x5b3122,_0x1bf490=_0x4589ae[_0x8d866c];if('aiLicenseKeyValid'==_0x1bf490||'aiLicenseKeyInvalid'==_0x1bf490||'aiLicenseKeyExpired'==_0x1bf490||'aiLicenseKeyDomainLimit'==_0x1bf490||'aiLicenseKeyNotAllowed'==_0x1bf490||'aiLicenseKeyEvaluationLimit'==_0x1bf490||'aiLicenseKeyTrialLimit'==_0x1bf490||'aiLicenseKeyUsageLimit'==_0x1bf490){delete _0x4589ae[_0x8d866c],_0x32c981=_0x1bf490,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x32c981&&_0x4589ae['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x32c981&&_0x4589ae['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x32c981&&_0x4589ae['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x32c981&&_0x4589ae['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x32c981&&_0x4589ae['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x32c981&&_0x4589ae['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x32c981&&_0x4589ae['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x1dfd85='',_0x535661='',_0x48f78b='custom'){const _0x31a71c=this['editor'],_0xd31878=_0x31a71c['editing']['view'],_0x39a8c1=_0x31a71c['plugins']['get'](a),_0xe15b08=_0x31a71c['plugins']['get'](_0x22da3a);_0x39a8c1['showFakeVisualSelection']();const _0x1ba8b3=new w(),_0x21372e=new ClipboardEvent('copy',{'clipboardData':_0x1ba8b3}),_0x3210bc=new _0x328b30(_0x1ba8b3),_0x6bc75d=new _0x2e5ecc(_0xd31878,_0x21372e,{'dataTransfer':_0x3210bc});_0xe15b08['_forceMarkersCopy']('comment',()=>{_0xd31878['document']['fire']('copy',_0x6bc75d);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x31a71c,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2d78a8=_0x3210bc['getData']('text/html');const _0x29fb0d=_0x31a71c['model']['document']['selection'],_0x12f852=Array['from'](_0x29fb0d['getRanges']());0x1===_0x12f852['length']&&_0x12f852[0x0]['isFlat']&&!_0x29fb0d['getSelectedElement']()&&''!==_0x2d78a8['replace'](/ /g,'')['trim']()&&(_0x2d78a8='<p>'+_0x2d78a8+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x48f78b,'query':_0x1dfd85,'htmlContent':_0x2d78a8,'label':_0x535661,'mainActionLabel':M[_0x31a71c['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':_0x9abfd6['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x39a8c1['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x5dc33e=new Map(),_0x417150=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0xf3a25 of _0x417150)for(const _0x42f1e4 of _0xf3a25['commands'])_0x5dc33e['set'](_0x42f1e4['id'],{..._0x42f1e4,'groupId':_0xf3a25['groupId'],'groupLabel':_0xf3a25['groupLabel']||_0xf3a25['groupId']});return _0x5dc33e;}['_createAIAssistantUIButton'](_0x51e3e2){const _0x8ebfb9=this['editor'],_0x396849=_0x8ebfb9['commands']['get']('showAIAssistant'),_0x43f10a=new _0x51e3e2(_0x8ebfb9['locale']);return _0x43f10a['set']({'label':i(_0x8ebfb9['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x43f10a['bind']('isEnabled')['to'](_0x396849),_0x43f10a['bind']('isOn')['to'](this['_dialog'],'id',_0x25be67=>'aiAssistant'===_0x25be67),this['listenTo'](_0x43f10a,'execute',()=>{_0x43f10a['isOn']?this['hideUI']():_0x396849['execute']();}),_0x43f10a;}['_initView'](){const _0x444dfd=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',()=>{_0x444dfd['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x444dfd['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x400755,ui:{ariaLiveAnnouncer:_0x88265c}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x197a68,_0x10cdd6,_0x5a2bf2)=>{const _0x761c79=this['_aiAssistantController']['currentContext'];_0x5a2bf2?_0x88265c['announce'](i(_0x400755,'AI\x20is\x20writing')):_0x761c79&&_0x88265c['announce'](i(_0x400755,'Generated\x20content:\x20%0',_0x761c79),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1aa7eb,_0x112934,_0x49ed1e)=>{if(_0x49ed1e){const _0x4b91e5=this['_formView']['errorView']['text'];_0x88265c['announce'](i(_0x400755,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4b91e5));}});}['_onExecute'](_0x3aef69){const _0x1aa494=this['_commandDefinitions']['get'](_0x3aef69),_0x30d38c=this['editor'],_0x13a060=_0x30d38c['model']['document']['selection'],_0x3e4c09=_0x30d38c['commands']['get']('showAIAssistant'),_0x4b39d4=_0x30d38c['plugins']['get'](a),_0x4725b1=''+(_0x1aa494['groupId']!==x?_0x1aa494['groupLabel']+':\x20':'')+_0x1aa494['label'];if(!0x1!==_0x1aa494['requiresContent']&&_0x13a060['isCollapsed']){const _0x46e6b2=_0x4933a2(_0x13a060['getSelectedBlocks']())||_0x30d38c['model']['schema']['getLimitElement'](_0x13a060);_0x30d38c['model']['change'](_0x4cdaa6=>{_0x4cdaa6['setSelection'](_0x46e6b2,'in');});}_0x4b39d4['showFakeVisualSelection'](),_0x3e4c09['execute'](_0x1aa494['prompt'],_0x4725b1,'command:'+_0x3aef69);}['_populateMenuBarMenu'](_0x219138,_0x1b16bf,_0x24d3e8,_0x5db78f){const _0x5db5a5=this['editor'],_0x547d7a=_0x5db5a5['locale'],_0x481604=new _0x2faaeb(_0x547d7a),_0x2356cf=U(_0x5db5a5,_0x24d3e8)['filter'](_0x200530=>_0x200530['commands']['length']);0x1===_0x2356cf['length']?this['_getMenuBarGroupButtons']({'command':_0x219138,'commands':_0x2356cf[0x0]['commands'],'parentMenuView':_0x1b16bf,'onExecute':_0x5db78f})['forEach'](_0x308d62=>_0x481604['items']['add'](_0x308d62)):_0x2356cf['forEach'](({groupId:_0x415e47,groupLabel:_0x172311,commands:_0x5a3b1e})=>{const _0x471fb1=new _0x548b03(_0x547d7a,_0x1b16bf),_0x3d0d08=new _0x11a849(_0x547d7a),_0x5ec0d0=new _0x2faaeb(_0x547d7a),_0x4febbc=this['_getMenuBarGroupButtons']({'command':_0x219138,'commands':_0x5a3b1e,'parentMenuView':_0x3d0d08,'onExecute':_0x5db78f});_0x3d0d08['buttonView']['set']({'label':_0x172311||_0x415e47}),_0x3d0d08['delegate']('execute')['to'](_0x1b16bf),_0x5ec0d0['items']['addMany'](_0x4febbc),_0x3d0d08['panelView']['children']['add'](_0x5ec0d0),_0x471fb1['children']['add'](_0x3d0d08),_0x481604['items']['add'](_0x471fb1);}),_0x1b16bf['panelView']['children']['add'](_0x481604);}['_getMenuBarGroupButtons']({command:_0x40cfcf,commands:_0x3eaee6,parentMenuView:_0x4efafe,onExecute:_0x34734a}){const _0x554bb9=this['editor'],_0xf408d6=_0x554bb9['locale'];return U(_0x554bb9,_0x3eaee6)['map'](_0x115f68=>{const _0x4fce38=new _0x548b03(_0xf408d6,_0x4efafe),_0x44631c=new _0xd6d10f(_0xf408d6);return _0x44631c['set']({'label':_0x115f68['label']}),_0x44631c['delegate']('execute')['to'](_0x4efafe),_0x44631c['on']('execute',()=>_0x34734a(_0x115f68['id'])),_0x44631c['bind']('isEnabled')['to'](_0x40cfcf,'enabledCommandsIds',_0xe124cc=>_0xe124cc['includes'](_0x115f68['id'])),_0x4fce38['children']['add'](_0x44631c),_0x4fce38;});}}function B(_0x51840a,_0x203423){return void 0x0!==_0x51840a['order']&&void 0x0===_0x203423['order']?0x1:void 0x0===_0x51840a['order']&&void 0x0!==_0x203423['order']?-0x1:void 0x0!==_0x51840a['order']&&void 0x0!==_0x203423['order']?_0x51840a['order']-_0x203423['order']:0x0;}function U(_0x48ce39,_0x160652){_0x160652['sort'](B);const _0x46c457={},_0x5dd504=[];for(const _0x1e7987 of _0x160652)if(void 0x0!==_0x1e7987['order']){if(_0x1e7987['order']in _0x46c457)throw new _0x342bbd('ai-commands-config-order-collision',_0x48ce39,{'conflictingDefinitions':[_0x1e7987,_0x46c457[_0x1e7987['order']]]});_0x46c457[_0x1e7987['order']]=_0x1e7987,_0x5dd504['splice'](_0x1e7987['order'],0x0,_0x1e7987);}else _0x5dd504['push'](_0x1e7987);return _0x5dd504;}class r extends _0x252851{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2a771c){super(_0x2a771c);const _0x222691=_0x2a771c['config'],_0x583489=_0x2a771c['locale'];_0x222691['define']('ai.aiAssistant.preserveComments',!0x0),_0x222691['define']('ai.aiAssistant.commands',function(_0x5603c1){return[{'groupId':'editOrReview','groupLabel':i(_0x5603c1,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x5603c1,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x5603c1,'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(_0x5603c1,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x5603c1,'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(_0x5603c1,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x5603c1,'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(_0x5603c1,'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(_0x5603c1,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x5603c1,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x5603c1,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x5603c1,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x5603c1,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x5603c1,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x5603c1,'Change\x20style'),'commands':[{'id':'business','label':i(_0x5603c1,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x5603c1,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x5603c1,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x5603c1,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x5603c1,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x5603c1,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x5603c1,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x5603c1,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x5603c1,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x5603c1,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x5603c1,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x5603c1,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x5603c1,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x583489)),_0x222691['define']('ai.aiAssistant.extraCommandGroups',[]),_0x222691['define']('ai.aiAssistant.removeCommands',[]);let _0xd7982c=o(_0x222691['get']('ai.aiAssistant.commands'),_0x583489);const _0x50e446=_0x222691['get']('ai.aiAssistant.extraCommandGroups'),_0x143acf=_0x222691['get']('ai.aiAssistant.removeCommands');_0x50e446['forEach'](_0x458084=>{const _0x1d6919=_0xd7982c['find'](_0x2aa818=>_0x2aa818['groupId']===_0x458084['groupId']);_0x1d6919?_0x1d6919['commands']=_0x1d6919['commands']['concat'](_0x458084['commands']):_0xd7982c['push'](_0x458084);}),_0xd7982c=_0xd7982c['filter'](_0x1475c1=>!_0x143acf['includes'](_0x1475c1['groupId'])),_0xd7982c['forEach'](_0x2cf33a=>{_0x2cf33a['commands']=_0x2cf33a['commands']['filter'](_0x4be6f5=>!_0x143acf['includes'](_0x4be6f5['id']));}),_0x222691['set']('ai.aiAssistant.commands',_0xd7982c);}}class P extends _0x252851{['abortController'];static get['requires'](){return[K];}constructor(_0x5e0a0b){super(_0x5e0a0b),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'](_0x3a7a95){return this['sendRequest'](_0x3a7a95)['catch'](_0x18b836=>{if(_0x18b836 instanceof R)return Promise['reject'](_0x18b836);if('AbortError'==_0x18b836['name'])return Promise['resolve']();throw console['error'](_0x18b836),new _0x342bbd('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x83ec6b,_0x50fead){const _0x13911e=this['editor']['locale'],_0x49db9c={'Content-Type':'application/json'};if('object'==typeof _0x83ec6b)Object['assign'](_0x49db9c,_0x83ec6b);else{if(_0x83ec6b)try{const _0x1d308c=await _0x83ec6b(_0x50fead);Object['assign'](_0x49db9c,_0x1d308c);}catch(_0x2a1c22){return Promise['reject'](new R(i(_0x13911e,'AI_ERROR_GET_HEADERS')));}}return _0x49db9c;}async['_prepareRequestParameters'](_0x315bee,_0x4be6a6){const _0x4018e4=this['editor']['locale'];if('object'==typeof _0x315bee)return _0x315bee;try{return await _0x315bee(_0x4be6a6);}catch(_0x37741d){return Promise['reject'](new R(i(_0x4018e4,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x33b73a){super(_0x33b73a),_0x33b73a['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x33b73a['config']['get']('ai.openAI.requestParameters')||_0x33b73a['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x33b73a['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x33b73a['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x33b73a['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x40f3ff,context:_0x5c577a,onData:_0x5a2104,actionId:_0x4774eb}){const _0x32ec4b=this['editor']['locale'],_0x1bf9de=await this['prepareMessages'](_0x40f3ff,_0x5c577a,_0x4774eb),_0xb7e287=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4774eb),_0x22aac7=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4774eb),_0x4da847={'messages':_0x1bf9de,..._0x22aac7},_0x1a8cd8={'method':'POST','headers':_0xb7e287,'body':JSON['stringify'](_0x4da847),'signal':this['abortController']['signal']},_0x125b4c=await fetch(this['_apiUrl'],_0x1a8cd8);if(_0x125b4c['ok'])return _0x22aac7['stream']?await this['_readStreamableResponse'](_0x125b4c,_0x5a2104):await this['_readStaticResponse'](_0x125b4c,_0x5a2104),Promise['resolve']();{const _0xf430e5=await _0x125b4c['text']();return _0xf430e5['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x32ec4b,'AI_ERROR_CONTEXT_LENGTH'))):_0xf430e5['includes']('Moderation')?Promise['reject'](new R(i(_0x32ec4b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xf430e5));}}async['prepareMessages'](_0x5db529,_0x882c8,_0x3b43ba){let _0x1be103,_0x55ec3c;return _0x882c8?(_0x1be103='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.',_0x55ec3c='Instruction:\x0a'+_0x5db529+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x882c8):(_0x1be103='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.',_0x55ec3c=_0x5db529),[{'role':'system','content':_0x1be103},{'role':'user','content':_0x55ec3c}];}async['_readStreamableResponse'](_0x46a35b,_0x557df5){const _0x260934=_0x46a35b['body']['getReader'](),_0x76e30d=new TextDecoder();let _0x5ea14e='',_0x469e04='',_0x1a2324='',_0x51a58a=!0x1;for(;!_0x51a58a;){const {done:_0x15ed05,value:_0x371e43}=await _0x260934['read'](),_0x59d67a=_0x5ea14e+_0x76e30d['decode'](_0x371e43);let _0x4d0ab3='';_0x51a58a=_0x15ed05;try{_0x4d0ab3=this['_cleanUpData'](_0x59d67a),_0x5ea14e='';}catch(_0x570a72){_0x5ea14e=_0x59d67a;continue;}_0x469e04+=_0x4d0ab3,!_0x51a58a&&this['_isBufferIncomplete'](_0x469e04)||_0x469e04&&(_0x1a2324+=_0x469e04,_0x469e04='',_0x557df5(_0x1a2324));}return Promise['resolve']();}async['_readStaticResponse'](_0x20825c,_0x5eaec){return _0x5eaec((await _0x20825c['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x513920){const _0x241eaa=_0x513920['split']('<')['length']!==_0x513920['split']('>')['length'],_0x5e76c9=_0x513920['length']<0x1e;return _0x241eaa&&_0x5e76c9;}['_cleanUpData'](_0x31d595){return _0x31d595['split'](/\n(?![^{]*\})/g)['map'](_0x23a68d=>_0x23a68d['replace']('data:\x20',''))['filter'](_0x4235ab=>_0x4235ab&&_0x4235ab['length']>0x0&&'[DONE]'!==_0x4235ab)['map'](_0x260923=>{const {choices:_0x42b443}=JSON['parse'](_0x260923);if(_0x42b443[0x0]&&_0x42b443[0x0]['delta']&&_0x42b443[0x0]['delta']['content'])return _0x42b443[0x0]['delta']['content'];})['filter'](_0x5f17b4=>_0x5f17b4)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5f0c37){super(_0x5f0c37),_0x5f0c37['config']['get']('ai.aws.requestParameters')||_0x5f0c37['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']=_0x5f0c37['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5f0c37['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5f0c37['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5f0c37['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x47f55c,context:_0x582f72,onData:_0x22f688,actionId:_0x278dc8}){const {model:_0x3c5f72,stream:_0x2c1e45,..._0x3cafaa}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x278dc8),_0x2019de={'prompt':await this['preparePrompt'](_0x47f55c,_0x582f72,_0x3c5f72,_0x278dc8),..._0x3cafaa};this['_apiUrl']?await this['_processProxyRequest'](_0x2019de,_0x3c5f72,_0x2c1e45,_0x22f688,_0x278dc8):await this['_processAWSRequest'](_0x2019de,_0x3c5f72,_0x2c1e45,_0x22f688);}async['preparePrompt'](_0x4a5215,_0xa1a661,_0x4b9230,_0x3edaa8){let _0x43b127,_0x267a9e;return _0xa1a661?(_0x43b127='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.',_0x267a9e='Instruction:\x0a'+_0x4a5215+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xa1a661):(_0x43b127='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.',_0x267a9e=_0x4a5215),'meta.llama'==this['getModelFamily'](_0x4b9230)?'<<SYS>>\x0a'+_0x43b127+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x267a9e+'\x0a[/INST]':'Human:\x0a'+_0x43b127+'\x0a'+_0x267a9e+'\x0a\x0aAssistant:';}['getModelFamily'](_0x2f4cc1){if(/^anthropic\.claude/['test'](_0x2f4cc1))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x2f4cc1))return'ai21.j2';if(/^cohere\.command/['test'](_0x2f4cc1))return'cohere.command';if(/^meta\.llama/['test'](_0x2f4cc1))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x2f4cc1));}async['_processProxyRequest'](_0x673b2d,_0x12bff8,_0xf8968b,_0x5f2940,_0x3b867f){const _0x11c351={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3b867f),'body':JSON['stringify']({..._0x673b2d,'model':_0x12bff8,'stream':_0xf8968b}),'signal':this['abortController']['signal']},_0x16c795=await fetch(this['_apiUrl'],_0x11c351);_0xf8968b?await this['_readStreamableResponse'](_0x16c795,_0x12bff8,_0x5f2940):await this['_readStaticResponse'](_0x16c795,_0x12bff8,_0x5f2940);}async['_processAWSRequest'](_0x437642,_0x5c1cc1,_0x38d6bf,_0x20d280){const _0x23d097=new _0x4a26ed(this['_bedrockClientConfig']),_0x4874ed={'body':JSON['stringify'](_0x437642),'contentType':'application/json','accept':'application/json','modelId':_0x5c1cc1};let _0x428642;if(_0x38d6bf){const _0x10a70c=new _0x48b7cf(_0x4874ed);_0x428642=await _0x23d097['send'](_0x10a70c,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x428642,_0x5c1cc1,_0x20d280);}else{const _0x1575dc=new _0xd941e3(_0x4874ed);_0x428642=await _0x23d097['send'](_0x1575dc,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x428642,_0x5c1cc1,_0x20d280);}}async['_readAsyncIterableResponse'](_0x3c3232,_0x5e4763,_0x29344b){const _0x3c5093=_0x3c3232['body'],_0x3a01ba=new TextDecoder('utf-8');let _0x3346c6='';for await(const _0x35ba81 of _0x3c5093)if(_0x35ba81['chunk']){const _0x5c2455=_0x3a01ba['decode'](_0x35ba81['chunk']['bytes']),_0x265e2b=JSON['parse'](_0x5c2455);_0x3346c6+=this['_getGeneratedText'](_0x265e2b,_0x5e4763),_0x29344b(_0x3346c6);}return Promise['resolve']();}async['_readStreamableResponse'](_0x9eec90,_0x173bff,_0x533db8){const _0x4b8c5d=_0x9eec90['body'],_0x518596=new TextDecoder('utf-8'),_0x4fbc46=_0x4b8c5d['getReader']();let _0x3d1321='',_0x115af6='',_0x13bcfa=!0x1;for(;!_0x13bcfa;){const {done:_0x3005df,value:_0x31e9c4}=await _0x4fbc46['read']();if(_0x13bcfa=_0x3005df,_0x13bcfa)break;const _0x150edb=(_0x3d1321+_0x518596['decode'](_0x31e9c4))['split']('\x0a')['map'](_0xcb9d04=>{try{return _0x3d1321='',JSON['parse'](_0xcb9d04);}catch(_0x2b6f60){return _0x3d1321=_0xcb9d04,null;}})['filter'](_0x2b4ff7=>null!==_0x2b4ff7);_0x150edb['length']&&(_0x115af6+=_0x150edb['map'](_0x4cbaf6=>this['_getGeneratedText'](_0x4cbaf6,_0x173bff))['join'](''),_0x533db8(_0x115af6));}return Promise['resolve']();}async['_readStaticResponse'](_0xf5fe47,_0x3dfa74,_0x4d1133){let _0x3e616d;return _0x3e616d=_0xf5fe47 instanceof Response?await _0xf5fe47['json']():JSON['parse'](Buffer['from'](_0xf5fe47['body'])['toString']('utf8')),(_0x4d1133(this['_getGeneratedText'](_0x3e616d,_0x3dfa74)),Promise['resolve']());}['_getGeneratedText'](_0x12ee27,_0x55d11d){switch(this['getModelFamily'](_0x55d11d)){case'anthropic.claude':return _0x12ee27['completion'];case'ai21.j2':return _0x12ee27['completions'][0x0]['data']['text'];case'cohere.command':return _0x12ee27['generations'][0x0]['text'];case'meta.llama':return _0x12ee27['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':_0x242ee4=>0x1!=_0x242ee4}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x1e1afb=>{const {af:{dictionary:_0x3a3aa8,getPluralForm:_0x8db400}}={'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':_0x2ed055=>0x1!=_0x2ed055}};_0x1e1afb['af']||={'dictionary':{},'getPluralForm':null},_0x1e1afb['af']['dictionary']=Object['assign'](_0x1e1afb['af']['dictionary'],_0x3a3aa8),_0x1e1afb['af']['getPluralForm']=_0x8db400;})(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':_0x166862=>0x0==_0x166862?0x0:0x1==_0x166862?0x1:0x2==_0x166862?0x2:_0x166862%0x64>=0x3&&_0x166862%0x64<=0xa?0x3:_0x166862%0x64>=0xb?0x4:0x5}};
|