@ckeditor/ckeditor5-ai 44.1.0-alpha.2 → 44.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +8 -8
- 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 _0x518cd6,Command as _0x299927,icons as _0x2b05a1}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x37c9c5,CKEditorError as _0x32871b,ObservableMixin as _0x2b525b,global as _0x290384,isVisible as it,Rect as st,Collection as _0x634288,FocusTracker as _0x53e8e3,KeystrokeHandler as ts,first as _0x5035ee}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x21d18a,View as _0x17dc85,SpinnerView as _0x46c519,IconView as _0x1a3e10,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x293333,ButtonLabelView as te,FocusCycler as _0x21a4a4,createLabeledTextarea as _0x557612,Dialog as _0x13a6a7,createDropdown as _0x54d88b,addMenuToDropdown as _0x296156,MenuBarMenuView as _0x282c88,MenuBarMenuListItemButtonView as _0x5e0d41,DialogViewPosition as _0x93101d,MenuBarMenuListView as _0x44f24f,MenuBarMenuListItemView as _0x307cef}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x4e7e96,Matcher as _0x3bfc95,DataTransfer as _0x10438f,DomEventData as _0x327053}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x23a272,escape as _0x19ef1c}from'lodash-es';import{ClipboardMarkersUtils as _0x358d50}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x101c66,InvokeModelWithResponseStreamCommand as _0xb30edf,InvokeModelCommand as _0x4aed6f}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x143110,_0xf3ba62){const _0x21fef3=(0x0,_0xf3ba62['t'])('Other');return _0x143110['length']?'groupId'in _0x143110[0x0]?_0x143110:[{'groupId':I,'groupLabel':_0x21fef3,'order':0x1/0x0,'commands':_0x143110}]:[{'groupId':I,'groupLabel':_0x21fef3,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x518cd6{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x12ea04}=this,_0x5582b9=['ck-fake-ai-selection'];_0x12ea04['config']['get']('ai.useTheme')&&_0x5582b9['push']('ck-ai-assistant-ui_theme'),_0x12ea04['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x5582b9,'priority':0xc}}),_0x12ea04['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x1de115,{writer:_0x364df8})=>{if(!_0x1de115['markerRange']['isCollapsed'])return null;const _0x401331=_0x364df8['createUIElement']('span');return _0x364df8['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x401331),_0x401331;}});}['afterInit'](){!async function(_0x33de71){const _0x5b1a73=_0x4325a7([0x34,0x38,0x39,0x46,0x4f,0x56,0x50,0x73,0x6e,0x35,0x49,0x4c,0x74,0x52,0x6b,0x6a,0x70,0x41,0x48,0x36,0x4a,0x42,0x30,0x32,0x5a,0x57,0x47,0x33,0x65,0x37,0x63,0x6f,0x58,0x78,0x44,0x55,0x54,0x62,0x43,0x51,0x66,0x77,0x59,0x7a,0x75,0x67,0x64,0x79,0x61,0x76,0x6c,0x69,0x31,0x6d,0x4e,0x72,0x45,0x4b,0x68,0x4d,0x71,0x53]),_0x2b55ec=0x7df58a83,_0x8015e2=0x7df2d313^_0x2b55ec,_0x3292d2=window[_0x4325a7([0x44,0x61,0x74,0x65])][_0x4325a7([0x6e,0x6f,0x77])](),_0x5c40d0=_0x33de71[_0x4325a7([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x100286=new window[(_0x4325a7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x594a09=>{_0x5c40d0[_0x4325a7([0x6f,0x6e,0x63,0x65])](_0x4325a7([0x72,0x65,0x61,0x64,0x79]),_0x594a09);}),_0x3d7080={[_0x4325a7([0x6b,0x74,0x79])]:_0x4325a7([0x45,0x43]),[_0x4325a7([0x75,0x73,0x65])]:_0x4325a7([0x73,0x69,0x67]),[_0x4325a7([0x63,0x72,0x76])]:_0x4325a7([0x50,0x2d,0x32,0x35,0x36]),[_0x4325a7([0x78])]:_0x4325a7([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]),[_0x4325a7([0x79])]:_0x4325a7([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]),[_0x4325a7([0x61,0x6c,0x67])]:_0x4325a7([0x45,0x53,0x32,0x35,0x36])},_0xd45288=_0x5c40d0[_0x4325a7([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x4325a7([0x67,0x65,0x74])](_0x4325a7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x27ee78(){let _0x4f79cd,_0x989956=null,_0x2a8fe8=null;try{if(_0xd45288==_0x4325a7([0x47,0x50,0x4c]))return _0x4325a7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4f79cd=_0x5c49e7(),!_0x4f79cd)return _0x4325a7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4f79cd[_0x4325a7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2a8fe8=_0x5803c4(_0x4f79cd[_0x4325a7([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4f79cd[_0x4325a7([0x6a,0x74,0x69])])),await _0x5b8b16()?_0x2dc559()?_0x5bf51a()?_0x4325a7([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1c6507()?(_0x4f79cd[_0x4325a7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4325a7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x989956=_0x51d38e(_0x4325a7([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4f79cd[_0x4325a7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4325a7([0x74,0x72,0x69,0x61,0x6c])&&(_0x989956=_0x51d38e(_0x4325a7([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x4f79cd[_0x4325a7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x4325a7([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x989956=_0x51d38e(_0x4325a7([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x259387()):_0x4325a7([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x4325a7([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x4325a7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x3fdd54){return _0x4325a7([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5bf51a(){const _0x59424b=[_0x4325a7([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x4325a7([0x74,0x72,0x69,0x61,0x6c])][_0x4325a7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f79cd[_0x4325a7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3292d2/0x3e8:0xe10*_0x8015e2;return _0x4f79cd[_0x4325a7([0x65,0x78,0x70])]<_0x59424b;}function _0x2dc559(){const _0x49a168=_0x4f79cd[_0x4325a7([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x49a168&&(!!_0x49a168[_0x4325a7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4325a7([0x2a]))||!!_0x49a168[_0x4325a7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4325a7([0x41,0x49])));}function _0x1c6507(){const _0x5b8f4c=_0x4f79cd[_0x4325a7([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5b8f4c||0x0==_0x5b8f4c[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x30480a}=new URL(window[_0x4325a7([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5b8f4c[_0x4325a7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x30480a))return!0x0;const _0x5b7fb9=_0x30480a[_0x4325a7([0x73,0x70,0x6c,0x69,0x74])](_0x4325a7([0x2e]));return _0x5b8f4c[_0x4325a7([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x28de67=>_0x28de67[_0x4325a7([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4325a7([0x2a])))[_0x4325a7([0x6d,0x61,0x70])](_0x3ef889=>_0x3ef889[_0x4325a7([0x73,0x70,0x6c,0x69,0x74])](_0x4325a7([0x2e])))[_0x4325a7([0x73,0x6f,0x6d,0x65])](_0x14a093=>_0x5b7fb9[_0x4325a7([0x65,0x76,0x65,0x72,0x79])]((_0x26adb0,_0x499ba5)=>_0x14a093[_0x499ba5]===_0x26adb0||_0x14a093[_0x499ba5]===_0x4325a7([0x2a])));}function _0x259387(){return _0x989956&&_0x2a8fe8?new window[(_0x4325a7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x560431,_0x3cd92e)=>{_0x989956[_0x4325a7([0x74,0x68,0x65,0x6e])](_0x560431,_0x3cd92e),_0x2a8fe8[_0x4325a7([0x74,0x68,0x65,0x6e])](_0x36efb1=>{_0x36efb1!=_0x4325a7([0x56,0x61,0x6c,0x69,0x64])&&_0x560431(_0x36efb1);},_0x3cd92e);}):_0x989956||_0x2a8fe8||_0x4325a7([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5803c4(_0x1bffc5,_0x5c7b1b){return new window[(_0x4325a7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3bb44a=>{if(_0x5836e5())return _0x3bb44a(_0x4325a7([0x56,0x61,0x6c,0x69,0x64]));_0x585a07(),_0x5c40d0[_0x4325a7([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x4325a7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3b1f00=!0x1;const _0x13cce8=_0x37c9c5();function _0x264a17(_0x58692c){return!!_0x58692c&&(typeof _0x58692c===_0x4325a7([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x58692c===_0x4325a7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x58692c[_0x4325a7([0x74,0x68,0x65,0x6e])]===_0x4325a7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x58692c[_0x4325a7([0x63,0x61,0x74,0x63,0x68])]===_0x4325a7([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x467c0a(_0x5f37af){_0x4246cf(_0x5f37af)[_0x4325a7([0x74,0x68,0x65,0x6e])](_0x872745=>{if(!_0x872745||_0x872745[_0x4325a7([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x4325a7([0x6f,0x6b]))return _0x4325a7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x599bb1(_0x1999bc(_0x13cce8+_0x5c7b1b))!=_0x872745[_0x4325a7([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x4325a7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x4325a7([0x56,0x61,0x6c,0x69,0x64]);})[_0x4325a7([0x74,0x68,0x65,0x6e])](_0xc4de76=>(_0x254359(),_0xc4de76),()=>{const _0x2f10b2=_0x1551ff();return null==_0x2f10b2?(_0x254359(),_0x4325a7([0x56,0x61,0x6c,0x69,0x64])):_0x4325a7(_0x3292d2-_0x2f10b2>(0x59f90e83^_0x2b55ec)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x4325a7([0x74,0x68,0x65,0x6e])](_0x3bb44a)[_0x4325a7([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3bb44a(_0x4325a7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4e2018=0x7dc36403^_0x2b55ec;function _0x254359(){const _0x20e1c6=_0x4325a7([0x6c,0x6c,0x63,0x74,0x2d])+_0x599bb1(_0x1999bc(_0x1bffc5)),_0x56fe53=_0x14ff27(_0x599bb1(window[_0x4325a7([0x4d,0x61,0x74,0x68])][_0x4325a7([0x63,0x65,0x69,0x6c])](_0x3292d2/_0x4e2018)));window[_0x4325a7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4325a7([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x20e1c6,_0x56fe53);}function _0x1551ff(){const _0x109cbf=_0x4325a7([0x6c,0x6c,0x63,0x74,0x2d])+_0x599bb1(_0x1999bc(_0x1bffc5)),_0x21ca38=window[_0x4325a7([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x4325a7([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x109cbf);return _0x21ca38?window[_0x4325a7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x14ff27(_0x21ca38),0x10)*_0x4e2018:null;}function _0x4246cf(_0x373893){return new window[(_0x4325a7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3d4af1,_0x580471)=>{_0x373893[_0x4325a7([0x74,0x68,0x65,0x6e])](_0x3d4af1,_0x580471),window[_0x4325a7([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x580471,0x7df45e43^_0x2b55ec);});}}_0x5c40d0[_0x4325a7([0x6f,0x6e])](_0x4325a7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4e13f4,_0x6e82d6)=>{if(_0x6e82d6[0x0]!=_0x1bffc5)return _0x3bb44a(_0x4325a7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x6e82d6[0x1]={..._0x6e82d6[0x1],[_0x4325a7([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x13cce8};},{[_0x4325a7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4325a7([0x68,0x69,0x67,0x68])}),_0x5c40d0[_0x4325a7([0x6f,0x6e])](_0x4325a7([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0xb7b9f6=>{_0x264a17(_0xb7b9f6[_0x4325a7([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3b1f00=!0x0,_0x467c0a(_0xb7b9f6[_0x4325a7([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x4325a7([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x4325a7([0x6c,0x6f,0x77])}),_0x100286[_0x4325a7([0x74,0x68,0x65,0x6e])](()=>{_0x3b1f00||_0x3bb44a(_0x4325a7([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5836e5(){return _0x5c40d0[_0x4325a7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4325a7([0x76,0x69,0x65,0x77])][_0x4325a7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x4325a7([0x61,0x75,0x74,0x6f]);}function _0x585a07(){_0x5c40d0[_0x4325a7([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x4325a7([0x76,0x69,0x65,0x77])][_0x4325a7([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x4325a7([0x61,0x75,0x74,0x6f]);}}function _0x51d38e(_0x91a261){const _0x2bcc45=[new window[(_0x4325a7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x229d31=>setTimeout(_0x229d31,0x7dfcb44f^_0x2b55ec)),_0x100286[_0x4325a7([0x74,0x68,0x65,0x6e])](()=>new window[(_0x4325a7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2b2b4a=>{let _0x1baa36=0x0;_0x5c40d0[_0x4325a7([0x6d,0x6f,0x64,0x65,0x6c])][_0x4325a7([0x6f,0x6e])](_0x4325a7([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x58e7b2,_0x15fc66)=>{_0x15fc66[0x0][_0x4325a7([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1baa36++,_0x1baa36==(0x7df58b7b^_0x2b55ec)&&(_0x2b2b4a(),_0x58e7b2[_0x4325a7([0x6f,0x66,0x66])]());});}))];return window[_0x4325a7([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x4325a7([0x72,0x61,0x63,0x65])](_0x2bcc45)[_0x4325a7([0x74,0x68,0x65,0x6e])](()=>_0x91a261);}async function _0x2741c9(){await _0x100286,_0x5c40d0[_0x4325a7([0x6d,0x6f,0x64,0x65,0x6c])][_0x4325a7([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1db26e,_0x5c40d0[_0x4325a7([0x6d,0x6f,0x64,0x65,0x6c])][_0x4325a7([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1db26e,_0x5c40d0[_0x4325a7([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x4325a7([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1136f0(_0x282709){const _0x249a72=_0x3c2913();_0x5c40d0[_0x249a72]=_0x4325a7([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x282709,_0x282709!=_0x4325a7([0x56,0x61,0x6c,0x69,0x64])&&_0x2741c9();}function _0x3c2913(){const _0x206c0b=window[_0x4325a7([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x4325a7([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x4325a7([0x6e,0x6f,0x77])]())[_0x4325a7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x4325a7([0x2e]),'');let _0x1bf814=_0x4325a7([0x46]);for(let _0x5ec6c7=0x0;_0x5ec6c7<_0x206c0b[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5ec6c7+=0x2){let _0x2b6119=window[_0x4325a7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x206c0b[_0x4325a7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5ec6c7,_0x5ec6c7+0x2));_0x2b6119>=_0x5b1a73[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x2b6119-=_0x5b1a73[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1bf814+=_0x5b1a73[_0x2b6119];}return _0x1bf814;}function _0x5c49e7(){const _0x391abe=_0xd45288[_0x4325a7([0x73,0x70,0x6c,0x69,0x74])](_0x4325a7([0x2e]));if(0x3!=_0x391abe[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x10d8c3(_0x391abe[0x1]);function _0x10d8c3(_0x3fcbdb){const _0xe21d70=_0x38cbb7(_0x3fcbdb);return _0xe21d70&&_0x46bd17()?_0xe21d70:null;function _0x46bd17(){const _0x3f8700=_0xe21d70[_0x4325a7([0x6a,0x74,0x69])],_0x36b6ac=window[_0x4325a7([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f8700[_0x4325a7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3f8700[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xdd98b5={..._0xe21d70,[_0x4325a7([0x6a,0x74,0x69])]:_0x3f8700[_0x4325a7([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3f8700[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xdd98b5[_0x4325a7([0x76,0x63])],_0x1999bc(_0xdd98b5)==_0x36b6ac;}}}async function _0x5b8b16(){let _0x32107a=!0x0;try{const _0xeb38d7=_0xd45288[_0x4325a7([0x73,0x70,0x6c,0x69,0x74])](_0x4325a7([0x2e])),[_0x256a3b,_0x167b99,_0x321c62]=_0xeb38d7;return _0x3c97d9(_0x256a3b),await _0x306f90(_0x256a3b,_0x167b99,_0x321c62),_0x32107a;}catch(_0x2d0685){return!0x1;}function _0x3c97d9(_0x1af96e){const _0x3a795d=_0x38cbb7(_0x1af96e);_0x3a795d&&_0x3a795d[_0x4325a7([0x61,0x6c,0x67])]==_0x4325a7([0x45,0x53,0x32,0x35,0x36])||(_0x32107a=!0x1);}async function _0x306f90(_0xab010d,_0x8454f4,_0x4c6eac){const _0x34daa5=window[_0x4325a7([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x4325a7([0x66,0x72,0x6f,0x6d])](_0x3d1322(_0x4c6eac),_0x399423=>_0x399423[_0x4325a7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0xe0183e=new window[(_0x4325a7([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x4325a7([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xab010d+_0x4325a7([0x2e])+_0x8454f4),_0x2fbe1e=window[_0x4325a7([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x4325a7([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2fbe1e)return;const _0x6485ce=await _0x2fbe1e[_0x4325a7([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x4325a7([0x6a,0x77,0x6b]),_0x3d7080,{[_0x4325a7([0x6e,0x61,0x6d,0x65])]:_0x4325a7([0x45,0x43,0x44,0x53,0x41]),[_0x4325a7([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x4325a7([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x4325a7([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2fbe1e[_0x4325a7([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x4325a7([0x6e,0x61,0x6d,0x65])]:_0x4325a7([0x45,0x43,0x44,0x53,0x41]),[_0x4325a7([0x68,0x61,0x73,0x68])]:{[_0x4325a7([0x6e,0x61,0x6d,0x65])]:_0x4325a7([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x6485ce,_0x34daa5,_0xe0183e)||(_0x32107a=!0x1);}}function _0x38cbb7(_0x244f06){return _0x244f06[_0x4325a7([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x4325a7([0x65,0x79]))?JSON[_0x4325a7([0x70,0x61,0x72,0x73,0x65])](_0x3d1322(_0x244f06)):null;}function _0x3d1322(_0x467bdf){return window[_0x4325a7([0x61,0x74,0x6f,0x62])](_0x467bdf[_0x4325a7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x4325a7([0x2b]))[_0x4325a7([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x4325a7([0x2f])));}function _0x1999bc(_0x4a85ee){let _0x4ec3d3=0x1505;function _0x47528e(_0x186bb5){for(let _0x47e7c4=0x0;_0x47e7c4<_0x186bb5[_0x4325a7([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x47e7c4++){const _0x40b1ef=_0x186bb5[_0x4325a7([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x47e7c4);_0x4ec3d3=(_0x4ec3d3<<0x5)+_0x4ec3d3+_0x40b1ef,_0x4ec3d3&=_0x4ec3d3;}}function _0x4d5eb5(_0x31dc48){Array[_0x4325a7([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x31dc48)?_0x31dc48[_0x4325a7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4d5eb5):_0x31dc48&&typeof _0x31dc48==_0x4325a7([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x4325a7([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x31dc48)[_0x4325a7([0x73,0x6f,0x72,0x74])]()[_0x4325a7([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x7222fb,_0x51a9f2])=>{_0x47528e(_0x7222fb),_0x4d5eb5(_0x51a9f2);}):_0x47528e(window[_0x4325a7([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x31dc48));}return _0x4d5eb5(_0x4a85ee),_0x4ec3d3>>>0x0;}function _0x599bb1(_0x35f481){return _0x35f481[_0x4325a7([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x4325a7([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x4325a7([0x30]));}function _0x14ff27(_0x56cd60){return _0x56cd60[_0x4325a7([0x73,0x70,0x6c,0x69,0x74])]('')[_0x4325a7([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x4325a7([0x6a,0x6f,0x69,0x6e])]('');}function _0x1db26e(){}function _0x4325a7(_0x6c1635){return _0x6c1635['map'](_0x503d49=>String['fromCharCode'](_0x503d49))['join']('');}_0x1136f0(await _0x27ee78());}(this);}['showFakeVisualSelection'](){const _0x39ca2f=this['editor']['model'];_0x39ca2f['change'](_0x1d727d=>{const _0x21e9ad=_0x39ca2f['document']['selection']['getFirstRange']();if(_0x39ca2f['markers']['has'](u))_0x1d727d['updateMarker'](u,{'range':_0x21e9ad});else{if(_0x21e9ad['start']['isAtEnd']){const _0x4ae806=_0x21e9ad['start']['getLastMatchingPosition'](({item:_0x5ba25d})=>!_0x39ca2f['schema']['isContent'](_0x5ba25d),{'boundaries':_0x21e9ad});_0x1d727d['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1d727d['createRange'](_0x4ae806,_0x21e9ad['end'])});}else _0x1d727d['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x21e9ad});}});}['hideFakeVisualSelection'](){const _0x105ada=this['editor']['model'];_0x105ada['markers']['has'](u)&&_0x105ada['change'](_0x2cf4c6=>{_0x2cf4c6['removeMarker'](u);});}['insertContent'](_0x576ac2,_0x105583){const _0x97bb7a=_0x105583||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x97bb7a))return;const _0x2daabc=this['editor']['data']['processor']['toView'](_0x576ac2),_0x12f558=this['editor']['data']['toModel'](_0x2daabc);this['editor']['model']['change'](_0x4f59b5=>{this['hideFakeVisualSelection']();const _0x5c657c=this['editor']['model']['insertContent'](_0x12f558,_0x97bb7a);_0x5c657c&&_0x4f59b5['setSelection'](_0x5c657c);});}['insertContentBelow'](_0x3eb552){const {model:_0x144a3a}=this['editor'],_0x3655bc=Array['from'](_0x144a3a['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x40aa0e=_0x3655bc['length']?_0x144a3a['createPositionAfter'](_0x3655bc['pop']()):_0x144a3a['document']['selection']['getLastPosition']();this['insertContent'](_0x3eb552,_0x40aa0e);}}class v extends _0x518cd6{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x32871b('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4c99e9){super(_0x4c99e9),this['name']='AIRequestError';}}function i(_0x258fcf,_0x2528f0,_0xdc29a8){const t=_0x258fcf['t'];switch(_0x2528f0){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',_0xdc29a8);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xdc29a8);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'},_0xdc29a8);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 _0x2528f0;}}class y extends _0x299927{['_commandDefinitions'];constructor(_0x5e7f97,_0x1c8e6c){super(_0x5e7f97),this['_commandDefinitions']=_0x1c8e6c,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0xf7d4bb,_0x3e128c,_0x3356f4)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x3356f4));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x43fc52,_0x3c36aa,_0x3b31b2)=>{this['enabledCommandsIds']=_0x3b31b2?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x47588d=this['editor']['model'];this['_hasContext']=function(_0x63daaf){const _0x2ea969=_0x63daaf['document']['selection'];return _0x2ea969['isCollapsed']?0x0!==[..._0x2ea969['getSelectedBlocks']()]['length']&&![..._0x2ea969['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x63daaf['hasContent'](_0x2ea969['getFirstRange']());}(_0x47588d);const _0x47a1ac=_0x47588d['document']['selection'],_0x95ee4b=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x13a46e of _0x47a1ac['getRanges']())for(const _0x1a731b of _0x13a46e['getItems']())if(_0x1a731b['is']('element')&&_0x95ee4b['includes'](_0x1a731b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5199ee='',_0x1de452='',_0x3d5846='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5199ee,_0x1de452,_0x3d5846);}}function G(_0x3e0f5,_0x356e91){const _0x17572d=new Set();for(const _0x50b48e of _0x3e0f5['values']())(_0x356e91||!0x1===_0x50b48e['requiresContent'])&&_0x17572d['add'](_0x50b48e['id']);return Array['from'](_0x17572d);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x2b525b(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4c6343,_0x45a61b,_0x2cc8cd){super(),this['editor']=_0x4c6343,this['textAdapter']=_0x45a61b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2cc8cd,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1a4375,_0x57d558,_0x1a828f)=>{this['view']['value']=this['_sanitizeHTML'](_0x1a828f);}),this['listenTo'](this['view'],'submitPrompt',(_0x313b06,_0x188be8)=>{const _0x339dba=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x188be8,_0x339dba,'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:_0x1ff964,query:_0x21b62,htmlContent:_0x4e44ce,label:_0x5d8fc6,mainActionLabel:_0x5ef3f8}){this['view']['prompt']=_0x5d8fc6,this['view']['mainAction']=_0x5ef3f8,this['initialContext']=_0x4e44ce,_0x21b62&&(this['view']['isRendered']?this['_handleQuery'](_0x21b62,_0x4e44ce,_0x1ff964,_0x5d8fc6):this['view']['once']('render',()=>{this['_handleQuery'](_0x21b62,_0x4e44ce,_0x1ff964,_0x5d8fc6);}));}['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'](_0x47b90f,_0x3fba0a,_0x243f37,_0x15a5d8){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3fba0a,this['previousQuery']=_0x47b90f,this['previousLabel']=_0x15a5d8||_0x47b90f,this['previousActionId']=_0x243f37,new Promise(_0x92529f=>{this['textAdapter']['makeRequest']({'query':_0x47b90f,'context':_0x3fba0a,'onData':_0x1d6f9d=>{this['currentResponse']=_0x1d6f9d,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x243f37})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0xee9243=>{_0xee9243 instanceof R?this['view']['handleError'](_0xee9243['message']):this['view']['handleError'](),_0x92529f();})['finally'](()=>{this['stopProcessing'](),_0x92529f();});});}['_parseAndNormalizeContent'](_0x15403d,_0x5e1d7d=!0x1){const _0x5e2636=Z['exec'](_0x15403d);_0x15403d=_0x5e2636?_0x15403d['substring'](_0x5e2636[0x1]['length']):_0x15403d['length']<0x64&&!_0x5e1d7d?'':this['_stripMarkdownSyntax'](_0x15403d);const _0x27e0c4=this['_domParser']['parseFromString'](_0x15403d,'text/html');if(_0x5e2636){const _0x776e86=Array['from'](_0x27e0c4['body']['childNodes']);_0x776e86['reverse']();for(const _0x124620 of _0x776e86){if(_0x124620['nodeType']==Node['ELEMENT_NODE'])break;_0x124620['remove']();}}const _0xc8275e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x27e0c4['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0xc8275e),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0xc8275e));}['_normalizeResponseHeadings'](_0x4fe136){const _0x4fb436=new _0x4e7e96(this['editor']['editing']['view']['document']),_0x5763a1=new _0x3bfc95({'name':/^h[1-5]$/}),_0x1643c2=[];let _0x1cf450=!0x1;for(const _0x3a4eeb of _0x4fe136)_0x3a4eeb['is']('element')&&_0x5763a1['match'](_0x3a4eeb)&&(_0x1643c2['push'](_0x3a4eeb),'h1'==_0x3a4eeb['name']&&(_0x1cf450=!0x0));if(_0x1cf450){for(const _0x50738c of _0x1643c2)_0x4fb436['rename']('h'+(parseInt(_0x50738c['name'][0x1])+0x1),_0x50738c);}}['_isH1TagSupportEnabled'](){const {data:_0x2473c3,editing:_0x258190}=this['editor'],_0x26c8ea=_0x2473c3['htmlProcessor']['toView']('<h1></h1>'),_0x224085=_0x2473c3['toView'](_0x2473c3['toModel'](_0x26c8ea));return!!_0x258190['view']['domConverter']['viewToDom'](_0x224085)['querySelector']('h1');}['_sanitizeHTML'](_0x49de64){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x49de64),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x3265fb){const _0x4c0bfe=_0x3265fb['trim']();return _0x4c0bfe['startsWith']('```html')?_0x4c0bfe['endsWith']('```')?_0x4c0bfe['substring'](0x7,_0x4c0bfe['length']-0x3):_0x4c0bfe['substring'](0x7):_0x3265fb;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x26c2db){super(_0x26c2db),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xd45a5e=>i(_0x26c2db,'AI_'+_0xd45a5e['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x26c2db,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x26c2db,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x26c2db,'Stop'));const _0x1903a8=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x1903a8['if']('isVisible','ck-hidden',_0x4d928d=>!_0x4d928d)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x297ee9,_0x2f391e){const _0x35404d=new _0x21d18a(this['locale']);return _0x35404d['set']({'label':_0x297ee9,'class':_0x2f391e||'','isVisible':!0x0,'withText':!0x0}),_0x35404d;}}var U='<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 W extends _0x17dc85{['contentFieldView'];['copyButtonView'];constructor(_0xc47998,_0x3cb01c=''){super(_0xc47998),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x45c3c5=this['bindTemplate'];this['contentFieldView']=new ct(_0xc47998,_0x3cb01c),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x45c3c5['if']('isVisible','ck-hidden',_0x4ca8c7=>!_0x4ca8c7)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x45c3c5['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 _0x15f28f=!0x1;this['on']('change:value',(_0x55f99c,_0x4a2354,_0x2253f8)=>{const _0x29260b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2253f8),this['isProcessing']&&_0x29260b&&!_0x15f28f&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x29c30f,_0x59859e,_0x43dd3a)=>{_0x15f28f=!0x1,_0x43dd3a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x15f28f=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x15f28f=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0xfb895=this['locale'],_0x384c54=new _0x21d18a(this['locale']),_0xa86462='ck-ai-form__copy-button';return _0x384c54['set']({'label':i(_0xfb895,'Copy'),'icon':U,'class':_0xa86462,'tooltip':!0x0}),_0x384c54['bind']('isVisible')['to'](this,'value',_0x55b595=>!!_0x55b595),_0x384c54['bind']('isEnabled')['to'](this,'isProcessing',_0x389bff=>!_0x389bff),_0x384c54['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x384c54['icon']=_0x2b05a1['check'],_0x384c54['class']=_0xa86462+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x384c54['icon']=U,_0x384c54['class']=_0xa86462;},0x3e8);}),_0x384c54;}['_copyHTMLToClipboard'](_0x254738){const {window:_0x2a46e8,document:_0x1f908d}=_0x290384;if(_0x2a46e8['ClipboardItem']){const {Blob:_0x10ac07,ClipboardItem:_0x2c3ed7}=_0x2a46e8,_0x590f7e=[new _0x2c3ed7({'text/html':new _0x10ac07([_0x254738['innerHTML']],{'type':'text/html'}),'text/plain':new _0x10ac07([_0x254738['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x590f7e);}else{const _0x14e83c=_0x1f908d['createElement']('div');_0x14e83c['style']['position']='absolute',_0x14e83c['style']['left']='-9999px',_0x14e83c['innerHTML']='<span>[</span>'+_0x254738['innerHTML']+'<span>]</span>',_0x1f908d['body']['appendChild'](_0x14e83c);const _0x448852=_0x1f908d['createRange']();_0x448852['setStartAfter'](_0x14e83c['firstElementChild']),_0x448852['setEndBefore'](_0x14e83c['lastElementChild']);const _0x45e178=_0x2a46e8['getSelection']();_0x45e178['removeAllRanges'](),_0x45e178['addRange'](_0x448852),_0x1f908d['execCommand']('copy'),_0x14e83c['remove']();}}}class ct extends _0x17dc85{constructor(_0x1c8247,_0x5586e9=''){super(_0x1c8247),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5586e9,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1952f6){this['element']['innerHTML']=_0x1952f6;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x24f586=new _0x17dc85(),_0xf881fc=this['locale'],_0x57397f=new _0x46c519();return _0x57397f['isVisible']=!0x0,_0x24f586['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x57397f,{'text':i(_0xf881fc,'AI\x20is\x20writing...')}]}),_0x24f586['render'](),_0x24f586;}}class tt extends _0x17dc85{constructor(_0x498a6f,_0xa61f19=''){super(_0x498a6f);const _0x4c9662=new _0x1a3e10(),_0x1e7bc6=this['bindTemplate'];this['set']('text',_0xa61f19),_0x4c9662['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':[_0x4c9662,{'text':_0x1e7bc6['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x7948ab,_0x797e1f){super(_0x7948ab,_0x797e1f),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',(_0x32bba9,_0x3f5106)=>{_0x32bba9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3f5106());});}['_createSubmitButton'](){const _0x4cd540=new _0x21d18a(this['locale']),_0x5d6c39=this['locale'];return _0x4cd540['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(_0x5d6c39,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4cd540['on']('execute',()=>{this['submit']();}),_0x4cd540['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x22efb1,_0x340ff5)=>!_0x22efb1&&_0x340ff5),_0x4cd540;}['_createShowHistoryButton'](){const _0x4d76c6=new _0x21d18a(this['locale']),_0x2a27de=this['resultsView'],_0x88d482=this['locale'];_0x4d76c6['set']({'label':i(_0x88d482,'History'),'withText':!0x1,'icon':_0x2b05a1['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4d76c6['bind']('isOn')['to'](_0x2a27de,'isVisible'),_0x4d76c6['bind']('isEnabled')['to'](this,'isEnabled'),_0x4d76c6['on']('execute',()=>{_0x2a27de['isVisible']=!_0x2a27de['isVisible'],_0x2a27de['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x6a860d=()=>{_0x290384['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x32e453=new st(this['queryView']['fieldView']['element']),_0x1fca59=_0x32e453['width'],_0x13384c='rtl'===_0x88d482['uiLanguageDirection']?'left':'right';_0x32e453['excludeScrollbarsAndBorders'](),_0x4d76c6['element']['style'][_0x13384c]=_0x1fca59-_0x32e453['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x6a860d),this['on']('render',_0x6a860d),_0x4d76c6;}['submit'](){const _0x531000=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x531000);}['focus'](_0xd8facb){-0x1===_0xd8facb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2ac000){super(_0x2ac000),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x2ac000,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2bc921=0x0;for(const _0x39bfea of this['items'])_0x2bc921+=_0x39bfea['items']['length'];return{'resultsCount':_0x2bc921,'totalItemsCount':_0x2bc921};}['_createClearHistoryButton'](){const _0x47024f=this['locale'],_0x299ed2=new _0x21d18a(this['locale']);return _0x299ed2['set']({'label':'('+i(_0x47024f,'Clear')+')','withText':!0x0}),_0x299ed2['on']('execute',()=>this['fire']('clearHistory')),_0x299ed2;}}class hs extends _0x293333{constructor(_0x2107e0){super();const _0x3d7555=new te(),_0x4d57d1=new _0x21d18a(this['locale'],_0x3d7555);this['children']['add'](_0x4d57d1),_0x4d57d1['set']({'label':_0x2107e0['prompt'],'withText':!0x0}),_0x4d57d1['on']('execute',()=>{this['fire']('execute',{'value':_0x23a272(_0x2107e0['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x634288{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x166034,_0x1d02fa)=>{const _0x3ec979=Ss(_0x1d02fa['prompt']);for(const _0x2783bc of this)if(_0x2783bc!=_0x1d02fa&&Ss(_0x2783bc['prompt'])===_0x3ec979){this['remove'](_0x2783bc);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x685d38=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x685d38));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x49fc82=>_0x49fc82)));}}function Ss(_0x318394){return _0x318394['toLowerCase']()['trim']();}class K extends _0x17dc85{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x33288c,_0x279ad8,_0xb31b5b=''){super(_0x33288c),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x33288c),this['contentArea']=new W(_0x33288c,_0xb31b5b),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 _0x53e8e3(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x21a4a4({'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 _0x114b8e=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x279ad8],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x114b8e['if']('isError','ck-hidden',_0xfcd854=>!_0xfcd854)]},'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'](_0x3d22fa=0x1){-0x1===_0x3d22fa?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 _0x17fd92=this['locale'],_0x4fab60=new ht(_0x17fd92,{'queryView':{'label':i(_0x17fd92,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x557612,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x17fd92,'Empty\x20history'),'secondary':i(_0x17fd92,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4fab60['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x171732,_0x1c720b)=>_0x171732&&!_0x1c720b),this['listenTo'](_0x4fab60,'submit',(_0x640254,_0x149845)=>{this['prompt']=_0x149845;const _0x17347f=_0x19ef1c(_0x149845);this['fire']('submitPrompt',_0x17347f),_0x149845['trim']()&&this['_promptHistory']['add']({'prompt':_0x17347f},0x0);},{'priority':'high'}),_0x4fab60;}['_createHistoryView'](){const _0xc0d915=new rs(this['locale']);return _0xc0d915['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0xc0d915['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xc0d915;}['_createToolbar'](){const _0xd35c51=new nt(this['locale']);return _0xd35c51['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x54f715,_0xaa93ea,_0x2391b4)=>_0x54f715&&!_0xaa93ea&&!!_0x2391b4),_0xd35c51['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xd35c51['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x221f91,_0x47cb2a,_0xefbcf4)=>_0x221f91&&!_0x47cb2a&&!!_0xefbcf4),_0xd35c51['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xd35c51['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x25e6d4,_0x1f06e2)=>_0x25e6d4&&!_0x1f06e2),_0xd35c51['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xd35c51['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xd35c51['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xd35c51;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x148237=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x148237,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x544a44){const _0x14d3ed=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x544a44||i(_0x14d3ed,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<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 j=globalThis['DataTransfer'];class n extends _0x518cd6{['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[_0x358d50,a,v,_0x13a6a7];}constructor(_0x4e5d3d){super(_0x4e5d3d),_0x4e5d3d['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x4e5d3d['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x4e5d3d['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x4e5d3d['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1420ee}=this;this['_aiAdapter']=_0x1420ee['plugins']['get'](v),this['_dialog']=_0x1420ee['plugins']['get'](_0x13a6a7),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x19d8d7=new y(_0x1420ee,Array['from'](this['_commandDefinitions']['values']()));_0x1420ee['commands']['add']('showAIAssistant',_0x19d8d7),_0x1420ee['ui']['componentFactory']['add']('aiCommands',_0xbd2890=>{const _0x4fb9f1=_0x54d88b(_0xbd2890);return _0x4fb9f1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x4fb9f1['buttonView']['set']({'label':i(_0xbd2890,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x4fb9f1['on']('execute',_0x3449dd=>this['_onExecute'](_0x3449dd['source']['id'])),_0x296156(_0x4fb9f1,_0x1420ee['ui']['view']['body'],function(_0x23b0bb){const _0x4ca9fd=o(_0x23b0bb['config']['get']('ai.aiAssistant.commands'),_0x23b0bb['locale']),_0x428941=B(_0x23b0bb,_0x4ca9fd)['filter'](_0x37894f=>_0x37894f['commands']['length']);if(0x1===_0x428941['length'])return B(_0x23b0bb,_0x428941[0x0]['commands'])['map'](_0xbef24c=>({'id':_0xbef24c['id'],'label':_0xbef24c['label']}));return _0x428941['map'](_0x309288=>{const {groupId:_0x4154b,groupLabel:_0x32f1c7,commands:_0x5ed586}=_0x309288,_0x413f72=B(_0x23b0bb,_0x5ed586)['map'](_0x29a903=>({'id':_0x29a903['id'],'label':_0x29a903['label']}));return{'id':_0x4154b,'menu':_0x32f1c7||_0x4154b,'children':_0x413f72};});}(_0x1420ee),{'ariaLabel':i(_0xbd2890,'AI\x20Commands')}),_0x4fb9f1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x19d8d7['on']('change:enabledCommandsIds',_0x3bddb3),_0x4fb9f1['menuView']['once']('render',_0x3bddb3),_0x4fb9f1;function _0x3bddb3(){_0x4fb9f1['isEnabled']=_0x19d8d7['enabledCommandsIds']['length']>0x0;for(const _0x144e81 of _0x4fb9f1['menuView']['buttons'])_0x144e81['isEnabled']=_0x19d8d7['enabledCommandsIds']['includes'](_0x144e81['id']);}}),_0x1420ee['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2d17bc=>{const _0x3848ab=new _0x282c88(_0x2d17bc);_0x3848ab['buttonView']['set']({'label':i(_0x2d17bc,'AI\x20Commands'),'icon':E}),_0x3848ab['bind']('isEnabled')['to'](_0x19d8d7,'enabledCommandsIds',_0x3b19e7=>_0x3b19e7['length']>0x0);const _0x432c9d=o(_0x1420ee['config']['get']('ai.aiAssistant.commands'),_0x2d17bc);return this['_populateMenuBarMenu'](_0x19d8d7,_0x3848ab,_0x432c9d,_0x2446ad=>this['_onExecute'](_0x2446ad)),_0x3848ab;}),_0x1420ee['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5ccc1f=this['_createAIAssistantUIButton'](_0x21d18a);return _0x5ccc1f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5ccc1f;}),_0x1420ee['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x5caf92=this['_createAIAssistantUIButton'](_0x5e0d41);return _0x5caf92['set']({'role':'menuitemcheckbox'}),_0x5caf92;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3bfa5c=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3432a0;for(const _0x5b03e8 in _0x3bfa5c){const _0xd55a40=_0x5b03e8,_0x2138d5=_0x3bfa5c[_0xd55a40];if('aiLicenseKeyValid'==_0x2138d5||'aiLicenseKeyInvalid'==_0x2138d5||'aiLicenseKeyExpired'==_0x2138d5||'aiLicenseKeyDomainLimit'==_0x2138d5||'aiLicenseKeyNotAllowed'==_0x2138d5||'aiLicenseKeyEvaluationLimit'==_0x2138d5||'aiLicenseKeyTrialLimit'==_0x2138d5||'aiLicenseKeyDevelopmentLimit'==_0x2138d5||'aiLicenseKeyUsageLimit'==_0x2138d5){delete _0x3bfa5c[_0xd55a40],_0x3432a0=_0x2138d5,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x3432a0&&_0x3bfa5c['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0xbeb776='',_0x3d1eb7='',_0x20aae4='custom'){const _0x39f7ce=this['editor'],_0x21ca30=_0x39f7ce['editing']['view'],_0x961097=_0x39f7ce['plugins']['get'](a),_0x4a3877=_0x39f7ce['plugins']['get'](_0x358d50);_0x961097['showFakeVisualSelection']();const _0x33a33b=new j(),_0x5290dd=new ClipboardEvent('copy',{'clipboardData':_0x33a33b}),_0x3b4c5e=new _0x10438f(_0x33a33b),_0x33cb83=new _0x327053(_0x21ca30,_0x5290dd,{'dataTransfer':_0x3b4c5e});_0x4a3877['_forceMarkersCopy']('comment',()=>{_0x21ca30['document']['fire']('copy',_0x33cb83);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x39f7ce,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x93e8ba=_0x3b4c5e['getData']('text/html');const _0xb3988a=_0x39f7ce['model']['document']['selection'],_0xbfabdd=Array['from'](_0xb3988a['getRanges']());0x1===_0xbfabdd['length']&&_0xbfabdd[0x0]['isFlat']&&!_0xb3988a['getSelectedElement']()&&''!==_0x93e8ba['replace'](/ /g,'')['trim']()&&(_0x93e8ba='<p>'+_0x93e8ba+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x20aae4,'query':_0xbeb776,'htmlContent':_0x93e8ba,'label':_0x3d1eb7,'mainActionLabel':x[_0x39f7ce['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x93101d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x961097['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x962386=new Map(),_0x5cf92d=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x59e94e of _0x5cf92d)for(const _0x578841 of _0x59e94e['commands'])_0x962386['set'](_0x578841['id'],{..._0x578841,'groupId':_0x59e94e['groupId'],'groupLabel':_0x59e94e['groupLabel']||_0x59e94e['groupId']});return _0x962386;}['_createAIAssistantUIButton'](_0x4b73e0){const _0x330112=this['editor'],_0x27158e=_0x330112['commands']['get']('showAIAssistant'),_0x2968c3=new _0x4b73e0(_0x330112['locale']);return _0x2968c3['set']({'label':i(_0x330112['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x2968c3['bind']('isEnabled')['to'](_0x27158e),_0x2968c3['bind']('isOn')['to'](this['_dialog'],'id',_0x2dc5fb=>'aiAssistant'===_0x2dc5fb),this['listenTo'](_0x2968c3,'execute',()=>{_0x2968c3['isOn']?this['hideUI']():_0x27158e['execute']();}),_0x2968c3;}['_initView'](){const _0x41f83f=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',()=>{_0x41f83f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x41f83f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x57947c,ui:{ariaLiveAnnouncer:_0x328666}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2a0daf,_0x5e6219,_0x4dc92d)=>{const _0x10e089=this['_aiAssistantController']['currentContext'];_0x4dc92d?_0x328666['announce'](i(_0x57947c,'AI\x20is\x20writing')):_0x10e089&&_0x328666['announce'](i(_0x57947c,'Generated\x20content:\x20%0',_0x10e089),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x102bbc,_0x479eb1,_0x4eec6d)=>{if(_0x4eec6d){const _0x711fa4=this['_formView']['errorView']['text'];_0x328666['announce'](i(_0x57947c,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x711fa4));}});}['_onExecute'](_0x3c42fe){const _0x2f3f2e=this['_commandDefinitions']['get'](_0x3c42fe),_0x388700=this['editor'],_0x3105cf=_0x388700['model']['document']['selection'],_0x29499d=_0x388700['commands']['get']('showAIAssistant'),_0x21a359=_0x388700['plugins']['get'](a),_0x53cc28=''+(_0x2f3f2e['groupId']!==I?_0x2f3f2e['groupLabel']+':\x20':'')+_0x2f3f2e['label'];if(!0x1!==_0x2f3f2e['requiresContent']&&_0x3105cf['isCollapsed']){const _0xf3fe00=_0x5035ee(_0x3105cf['getSelectedBlocks']())||_0x388700['model']['schema']['getLimitElement'](_0x3105cf);_0x388700['model']['change'](_0x118aeb=>{_0x118aeb['setSelection'](_0xf3fe00,'in');});}_0x21a359['showFakeVisualSelection'](),_0x29499d['execute'](_0x2f3f2e['prompt'],_0x53cc28,'command:'+_0x3c42fe);}['_populateMenuBarMenu'](_0x4cdd25,_0x35bc74,_0x56c1c5,_0xb3301f){const _0x4b8b9c=this['editor'],_0x42f095=_0x4b8b9c['locale'],_0x4e4e48=new _0x44f24f(_0x42f095),_0x2a9d1e=B(_0x4b8b9c,_0x56c1c5)['filter'](_0x1e8476=>_0x1e8476['commands']['length']);0x1===_0x2a9d1e['length']?this['_getMenuBarGroupButtons']({'command':_0x4cdd25,'commands':_0x2a9d1e[0x0]['commands'],'parentMenuView':_0x35bc74,'onExecute':_0xb3301f})['forEach'](_0xf00ac6=>_0x4e4e48['items']['add'](_0xf00ac6)):_0x2a9d1e['forEach'](({groupId:_0xabe713,groupLabel:_0x46cd43,commands:_0x567770})=>{const _0x7972f9=new _0x307cef(_0x42f095,_0x35bc74),_0x7daa29=new _0x282c88(_0x42f095),_0x35d8b8=new _0x44f24f(_0x42f095),_0x35560d=this['_getMenuBarGroupButtons']({'command':_0x4cdd25,'commands':_0x567770,'parentMenuView':_0x7daa29,'onExecute':_0xb3301f});_0x7daa29['buttonView']['set']({'label':_0x46cd43||_0xabe713}),_0x7daa29['delegate']('execute')['to'](_0x35bc74),_0x35d8b8['items']['addMany'](_0x35560d),_0x7daa29['panelView']['children']['add'](_0x35d8b8),_0x7972f9['children']['add'](_0x7daa29),_0x4e4e48['items']['add'](_0x7972f9);}),_0x35bc74['panelView']['children']['add'](_0x4e4e48);}['_getMenuBarGroupButtons']({command:_0x1a3053,commands:_0x41d030,parentMenuView:_0x3f382c,onExecute:_0x29951a}){const _0x4e126e=this['editor'],_0x11629e=_0x4e126e['locale'];return B(_0x4e126e,_0x41d030)['map'](_0x5d868b=>{const _0x1f40a8=new _0x307cef(_0x11629e,_0x3f382c),_0x250277=new _0x5e0d41(_0x11629e);return _0x250277['set']({'label':_0x5d868b['label']}),_0x250277['delegate']('execute')['to'](_0x3f382c),_0x250277['on']('execute',()=>_0x29951a(_0x5d868b['id'])),_0x250277['bind']('isEnabled')['to'](_0x1a3053,'enabledCommandsIds',_0x5654da=>_0x5654da['includes'](_0x5d868b['id'])),_0x1f40a8['children']['add'](_0x250277),_0x1f40a8;});}}function _(_0x3e4041,_0x4a3325){return void 0x0!==_0x3e4041['order']&&void 0x0===_0x4a3325['order']?0x1:void 0x0===_0x3e4041['order']&&void 0x0!==_0x4a3325['order']?-0x1:void 0x0!==_0x3e4041['order']&&void 0x0!==_0x4a3325['order']?_0x3e4041['order']-_0x4a3325['order']:0x0;}function B(_0x1d867b,_0x4f90d7){_0x4f90d7['sort'](_);const _0x25c977={},_0x94de51=[];for(const _0x4a8b5a of _0x4f90d7)if(void 0x0!==_0x4a8b5a['order']){if(_0x4a8b5a['order']in _0x25c977)throw new _0x32871b('ai-commands-config-order-collision',_0x1d867b,{'conflictingDefinitions':[_0x4a8b5a,_0x25c977[_0x4a8b5a['order']]]});_0x25c977[_0x4a8b5a['order']]=_0x4a8b5a,_0x94de51['splice'](_0x4a8b5a['order'],0x0,_0x4a8b5a);}else _0x94de51['push'](_0x4a8b5a);return _0x94de51;}class r extends _0x518cd6{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3467ce){super(_0x3467ce);const _0x411737=_0x3467ce['config'],_0x27033b=_0x3467ce['locale'];_0x411737['define']('ai.aiAssistant.commands',function(_0x10026f){return[{'groupId':'editOrReview','groupLabel':i(_0x10026f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x10026f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x10026f,'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(_0x10026f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x10026f,'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(_0x10026f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x10026f,'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(_0x10026f,'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(_0x10026f,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x10026f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x10026f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x10026f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x10026f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x10026f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x10026f,'Change\x20style'),'commands':[{'id':'business','label':i(_0x10026f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x10026f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x10026f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x10026f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x10026f,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x10026f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x10026f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x10026f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x10026f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x10026f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x10026f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x10026f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x10026f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x27033b)),_0x411737['define']('ai.aiAssistant.extraCommandGroups',[]),_0x411737['define']('ai.aiAssistant.removeCommands',[]);const _0x240ef5=o(_0x411737['get']('ai.aiAssistant.commands'),_0x27033b),_0x582e33=_0x411737['get']('ai.aiAssistant.extraCommandGroups'),_0x5a152b=_0x411737['get']('ai.aiAssistant.removeCommands');_0x582e33['forEach'](_0x266a62=>{const _0xb546ec=_0x240ef5['find'](_0x271b4a=>_0x271b4a['groupId']===_0x266a62['groupId']);_0xb546ec?_0xb546ec['commands']=_0xb546ec['commands']['concat'](_0x266a62['commands']):_0x240ef5['push'](_0x266a62);}),_0x240ef5['forEach'](_0x4ffe0d=>{_0x4ffe0d['commands']=_0x4ffe0d['commands']['filter'](_0x1032f7=>!_0x5a152b['includes'](_0x1032f7['id']));}),_0x411737['set']('ai.aiAssistant.commands',_0x240ef5);}}class P extends _0x518cd6{['abortController'];static get['requires'](){return[v];}constructor(_0x28d25d){super(_0x28d25d),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x530e1d){return this['sendRequest'](_0x530e1d)['catch'](_0x237c70=>{if(_0x237c70 instanceof R)return Promise['reject'](_0x237c70);if('AbortError'==_0x237c70['name'])return Promise['resolve']();throw console['error'](_0x237c70),new _0x32871b('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2becc2,_0x4efc11){const _0x149e1f=this['editor']['locale'],_0x85e4a2={'Content-Type':'application/json'};if('object'==typeof _0x2becc2)Object['assign'](_0x85e4a2,_0x2becc2);else{if(_0x2becc2)try{const _0x552b3f=await _0x2becc2(_0x4efc11);Object['assign'](_0x85e4a2,_0x552b3f);}catch(_0xb0b33c){return Promise['reject'](new R(i(_0x149e1f,'AI_ERROR_GET_HEADERS')));}}return _0x85e4a2;}async['_prepareRequestParameters'](_0x635c24,_0x5ab716){const _0x40590a=this['editor']['locale'];if('object'==typeof _0x635c24)return _0x635c24;try{return await _0x635c24(_0x5ab716);}catch(_0x5be6e1){return Promise['reject'](new R(i(_0x40590a,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5191ef){super(_0x5191ef),_0x5191ef['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5191ef['config']['get']('ai.openAI.requestParameters')||_0x5191ef['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5191ef['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x5191ef['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x5191ef['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0xf9b80a,context:_0x14f7fa,onData:_0x198988,actionId:_0x512802}){const _0x868266=this['editor']['locale'],_0x48f431=await this['prepareMessages'](_0xf9b80a,_0x14f7fa,_0x512802),_0x4aaf4e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x512802),_0x57c035=await this['_prepareRequestParameters'](this['_requestParameters'],_0x512802),_0x1f58a2={'messages':_0x48f431,..._0x57c035},_0x56141b={'method':'POST','headers':_0x4aaf4e,'body':JSON['stringify'](_0x1f58a2),'signal':this['abortController']['signal']},_0x57e40f=await fetch(this['_apiUrl'],_0x56141b);if(_0x57e40f['ok'])return _0x57c035['stream']?await this['_readStreamableResponse'](_0x57e40f,_0x198988):await this['_readStaticResponse'](_0x57e40f,_0x198988),Promise['resolve']();{const _0x499f23=await _0x57e40f['text']();return _0x499f23['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x868266,'AI_ERROR_CONTEXT_LENGTH'))):_0x499f23['includes']('Moderation')?Promise['reject'](new R(i(_0x868266,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x499f23));}}async['prepareMessages'](_0x3de1a2,_0x2e43f0,_0xb11581){let _0x28ce03,_0x20477f;return _0x2e43f0?(_0x28ce03='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.',_0x20477f='Instruction:\x0a'+_0x3de1a2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2e43f0):(_0x28ce03='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.',_0x20477f=_0x3de1a2),[{'role':'system','content':_0x28ce03},{'role':'user','content':_0x20477f}];}async['_readStreamableResponse'](_0x46f31d,_0x5a07b3){const _0x14e81b=_0x46f31d['body']['getReader'](),_0x364d2c=new TextDecoder();let _0x3d47c9='',_0x1fadd9='',_0x269f30='',_0x494b33=!0x1;for(;!_0x494b33;){const {done:_0x442e4c,value:_0x27bff7}=await _0x14e81b['read'](),_0xc9f401=_0x3d47c9+_0x364d2c['decode'](_0x27bff7);let _0x3f92d3='';_0x494b33=_0x442e4c;try{_0x3f92d3=this['_cleanUpData'](_0xc9f401),_0x3d47c9='';}catch(_0x4d685f){_0x3d47c9=_0xc9f401;continue;}_0x1fadd9+=_0x3f92d3,!_0x494b33&&this['_isBufferIncomplete'](_0x1fadd9)||_0x1fadd9&&(_0x269f30+=_0x1fadd9,_0x1fadd9='',_0x5a07b3(_0x269f30));}return Promise['resolve']();}async['_readStaticResponse'](_0x317aaf,_0xa9d99f){return _0xa9d99f((await _0x317aaf['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x25c2a2){const _0x117d6d=_0x25c2a2['split']('<')['length']!==_0x25c2a2['split']('>')['length'],_0x587c6c=_0x25c2a2['length']<0x1e;return _0x117d6d&&_0x587c6c;}['_cleanUpData'](_0x6b8fd8){return _0x6b8fd8['split'](/\n(?![^{]*\})/g)['map'](_0x58cf29=>_0x58cf29['replace']('data:\x20',''))['filter'](_0x37ea8b=>_0x37ea8b&&_0x37ea8b['length']>0x0&&'[DONE]'!==_0x37ea8b)['map'](_0x2b17f1=>{const {choices:_0x5948f7}=JSON['parse'](_0x2b17f1);if(_0x5948f7[0x0]&&_0x5948f7[0x0]['delta']&&_0x5948f7[0x0]['delta']['content'])return _0x5948f7[0x0]['delta']['content'];})['filter'](_0x116565=>_0x116565)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x27120f){super(_0x27120f),_0x27120f['config']['get']('ai.aws.requestParameters')||_0x27120f['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']=_0x27120f['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x27120f['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x27120f['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x27120f['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2b8d4a,context:_0x39ce29,onData:_0x4d5867,actionId:_0x41589c}){const {model:_0x1b20f3,stream:_0x3e10da,..._0x4ec9ac}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x41589c),_0x2c1b7f={'prompt':await this['preparePrompt'](_0x2b8d4a,_0x39ce29,_0x1b20f3,_0x41589c),..._0x4ec9ac};this['_apiUrl']?await this['_processProxyRequest'](_0x2c1b7f,_0x1b20f3,_0x3e10da,_0x4d5867,_0x41589c):await this['_processAWSRequest'](_0x2c1b7f,_0x1b20f3,_0x3e10da,_0x4d5867);}async['preparePrompt'](_0x2c639f,_0x1ab27a,_0x18b256,_0x3ef705){let _0x2b87fc,_0x580d2e;return _0x1ab27a?(_0x2b87fc='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.',_0x580d2e='Instruction:\x0a'+_0x2c639f+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x1ab27a):(_0x2b87fc='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.',_0x580d2e=_0x2c639f),'meta.llama'==this['getModelFamily'](_0x18b256)?'<<SYS>>\x0a'+_0x2b87fc+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x580d2e+'\x0a[/INST]':'Human:\x0a'+_0x2b87fc+'\x0a'+_0x580d2e+'\x0a\x0aAssistant:';}['getModelFamily'](_0x34aa57){if(/^anthropic\.claude/['test'](_0x34aa57))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x34aa57))return'ai21.j2';if(/^cohere\.command/['test'](_0x34aa57))return'cohere.command';if(/^meta\.llama/['test'](_0x34aa57))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x34aa57));}async['_processProxyRequest'](_0x34656a,_0x267708,_0x5b7469,_0xe6d1cd,_0x2b87c6){const _0x136bfc={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2b87c6),'body':JSON['stringify']({..._0x34656a,'model':_0x267708,'stream':_0x5b7469}),'signal':this['abortController']['signal']},_0x2e3e8d=await fetch(this['_apiUrl'],_0x136bfc);_0x5b7469?await this['_readStreamableResponse'](_0x2e3e8d,_0x267708,_0xe6d1cd):await this['_readStaticResponse'](_0x2e3e8d,_0x267708,_0xe6d1cd);}async['_processAWSRequest'](_0x568f21,_0x510054,_0x84b5c7,_0x6632bd){const _0x392053=new _0x101c66(this['_bedrockClientConfig']),_0x165e40={'body':JSON['stringify'](_0x568f21),'contentType':'application/json','accept':'application/json','modelId':_0x510054};let _0x3ab14b;if(_0x84b5c7){const _0x4d5964=new _0xb30edf(_0x165e40);_0x3ab14b=await _0x392053['send'](_0x4d5964,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3ab14b,_0x510054,_0x6632bd);}else{const _0x2ee9ea=new _0x4aed6f(_0x165e40);_0x3ab14b=await _0x392053['send'](_0x2ee9ea,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3ab14b,_0x510054,_0x6632bd);}}async['_readAsyncIterableResponse'](_0xc03dfc,_0x14b164,_0x5f57c9){const _0x656c92=_0xc03dfc['body'],_0x3bdd27=new TextDecoder('utf-8');let _0x390cc2='';for await(const _0xc32e1b of _0x656c92)if(_0xc32e1b['chunk']){const _0x1546ae=_0x3bdd27['decode'](_0xc32e1b['chunk']['bytes']),_0x244139=JSON['parse'](_0x1546ae);_0x390cc2+=this['_getGeneratedText'](_0x244139,_0x14b164),_0x5f57c9(_0x390cc2);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2f5078,_0x3e912d,_0x14c0ff){const _0xec744=_0x2f5078['body'],_0x2d6d88=new TextDecoder('utf-8'),_0x55c51f=_0xec744['getReader']();let _0x386f9f='',_0xddfd30='',_0x335b28=!0x1;for(;!_0x335b28;){const {done:_0x44dfa4,value:_0x4b47d1}=await _0x55c51f['read']();if(_0x335b28=_0x44dfa4,_0x335b28)break;const _0x1867a6=(_0x386f9f+_0x2d6d88['decode'](_0x4b47d1))['split']('\x0a')['map'](_0x37e305=>{try{return _0x386f9f='',JSON['parse'](_0x37e305);}catch(_0x4ff9e8){return _0x386f9f=_0x37e305,null;}})['filter'](_0x39acbf=>null!==_0x39acbf);_0x1867a6['length']&&(_0xddfd30+=_0x1867a6['map'](_0xb798c2=>this['_getGeneratedText'](_0xb798c2,_0x3e912d))['join'](''),_0x14c0ff(_0xddfd30));}return Promise['resolve']();}async['_readStaticResponse'](_0x404f7e,_0x105726,_0x44506d){let _0x3b0c68;return _0x3b0c68=_0x404f7e instanceof Response?await _0x404f7e['json']():JSON['parse'](Buffer['from'](_0x404f7e['body'])['toString']('utf8')),(_0x44506d(this['_getGeneratedText'](_0x3b0c68,_0x105726)),Promise['resolve']());}['_getGeneratedText'](_0x4eeb60,_0xa4d00e){switch(this['getModelFamily'](_0xa4d00e)){case'anthropic.claude':return _0x4eeb60['completion'];case'ai21.j2':return _0x4eeb60['completions'][0x0]['data']['text'];case'cohere.command':return _0x4eeb60['generations'][0x0]['text'];case'meta.llama':return _0x4eeb60['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x33bdb7,Command as _0x5bbe05,icons as _0x5a2b21}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x3c586c,CKEditorError as _0x1a23fb,ObservableMixin as _0x5ef293,global as _0x4f6220,isVisible as it,Rect as st,Collection as _0x33ca74,FocusTracker as _0x290034,KeystrokeHandler as ts,first as _0x2dcf99}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x29ee26,View as _0x533483,SpinnerView as _0x1c7b49,IconView as _0x1e6c2c,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x550377,ButtonLabelView as te,FocusCycler as _0x1309f3,createLabeledTextarea as _0x5055f5,Dialog as _0x30f5c0,createDropdown as _0xcd2d96,addMenuToDropdown as _0x5747ea,MenuBarMenuView as _0x2758e8,MenuBarMenuListItemButtonView as _0x318495,DialogViewPosition as _0x94f42,MenuBarMenuListView as _0xeeeaa8,MenuBarMenuListItemView as _0x352a28}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x2a915a,Matcher as _0x45c383,DataTransfer as _0x5b775c,DomEventData as _0x2abad5}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4825b5,escape as _0x26a4d7}from'lodash-es';import{ClipboardMarkersUtils as _0x4197fa}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x4c7963,InvokeModelWithResponseStreamCommand as _0x23fdcf,InvokeModelCommand as _0x4e33c8}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x2446ac,_0x42ab4a){const _0x351c2b=(0x0,_0x42ab4a['t'])('Other');return _0x2446ac['length']?'groupId'in _0x2446ac[0x0]?_0x2446ac:[{'groupId':I,'groupLabel':_0x351c2b,'order':0x1/0x0,'commands':_0x2446ac}]:[{'groupId':I,'groupLabel':_0x351c2b,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x33bdb7{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2c8dd0}=this,_0x1d59ac=['ck-fake-ai-selection'];_0x2c8dd0['config']['get']('ai.useTheme')&&_0x1d59ac['push']('ck-ai-assistant-ui_theme'),_0x2c8dd0['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x1d59ac,'priority':0xc}}),_0x2c8dd0['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x2ee721,{writer:_0x4bc0e1})=>{if(!_0x2ee721['markerRange']['isCollapsed'])return null;const _0x277975=_0x4bc0e1['createUIElement']('span');return _0x4bc0e1['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x277975),_0x277975;}});}['afterInit'](){!async function(_0xc72079){const _0x23c789=_0x56ac68([0x56,0x41,0x46,0x4c,0x43,0x57,0x6e,0x6b,0x4d,0x34,0x70,0x67,0x31,0x37,0x77,0x42,0x48,0x44,0x4a,0x38,0x61,0x79,0x51,0x71,0x39,0x32,0x54,0x55,0x6a,0x5a,0x53,0x65,0x73,0x4f,0x4e,0x47,0x50,0x6c,0x64,0x6d,0x7a,0x30,0x62,0x76,0x36,0x52,0x68,0x33,0x66,0x35,0x75,0x74,0x45,0x6f,0x63,0x72,0x59,0x58,0x49,0x4b,0x69,0x78]),_0x323a27=0x3d23a3dc,_0x49640f=0x3d24fa74^_0x323a27,_0x590577=window[_0x56ac68([0x44,0x61,0x74,0x65])][_0x56ac68([0x6e,0x6f,0x77])](),_0x1f9f2d=_0xc72079[_0x56ac68([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x35e588=new window[(_0x56ac68([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3e3b82=>{_0x1f9f2d[_0x56ac68([0x6f,0x6e,0x63,0x65])](_0x56ac68([0x72,0x65,0x61,0x64,0x79]),_0x3e3b82);}),_0x1efc29={[_0x56ac68([0x6b,0x74,0x79])]:_0x56ac68([0x45,0x43]),[_0x56ac68([0x75,0x73,0x65])]:_0x56ac68([0x73,0x69,0x67]),[_0x56ac68([0x63,0x72,0x76])]:_0x56ac68([0x50,0x2d,0x32,0x35,0x36]),[_0x56ac68([0x78])]:_0x56ac68([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]),[_0x56ac68([0x79])]:_0x56ac68([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]),[_0x56ac68([0x61,0x6c,0x67])]:_0x56ac68([0x45,0x53,0x32,0x35,0x36])},_0x920c40=_0x1f9f2d[_0x56ac68([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x56ac68([0x67,0x65,0x74])](_0x56ac68([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x24c0bb(){let _0x5182c2,_0x4d7696=null,_0x3c568c=null;try{if(_0x920c40==_0x56ac68([0x47,0x50,0x4c]))return _0x56ac68([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x5182c2=_0x33a401(),!_0x5182c2)return _0x56ac68([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x5182c2[_0x56ac68([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3c568c=_0x5c94ba(_0x5182c2[_0x56ac68([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x5182c2[_0x56ac68([0x6a,0x74,0x69])])),await _0x1dc387()?_0x98e77c()?_0xa20e5d()?_0x56ac68([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x670c9c()?(_0x5182c2[_0x56ac68([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x56ac68([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4d7696=_0x342c32(_0x56ac68([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x5182c2[_0x56ac68([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x56ac68([0x74,0x72,0x69,0x61,0x6c])&&(_0x4d7696=_0x342c32(_0x56ac68([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x5182c2[_0x56ac68([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x56ac68([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x4d7696=_0x342c32(_0x56ac68([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x20bcd0()):_0x56ac68([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x56ac68([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x56ac68([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x2ff5a4){return _0x56ac68([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xa20e5d(){const _0x5a7145=[_0x56ac68([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x56ac68([0x74,0x72,0x69,0x61,0x6c])][_0x56ac68([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5182c2[_0x56ac68([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x590577/0x3e8:0xe10*_0x49640f;return _0x5182c2[_0x56ac68([0x65,0x78,0x70])]<_0x5a7145;}function _0x98e77c(){const _0x466a42=_0x5182c2[_0x56ac68([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x466a42&&(!!_0x466a42[_0x56ac68([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56ac68([0x2a]))||!!_0x466a42[_0x56ac68([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56ac68([0x41,0x49])));}function _0x670c9c(){const _0x144346=_0x5182c2[_0x56ac68([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x144346||0x0==_0x144346[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2584c8}=new URL(window[_0x56ac68([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x144346[_0x56ac68([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2584c8))return!0x0;const _0x5c14b2=_0x2584c8[_0x56ac68([0x73,0x70,0x6c,0x69,0x74])](_0x56ac68([0x2e]));return _0x144346[_0x56ac68([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x23ea5d=>_0x23ea5d[_0x56ac68([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x56ac68([0x2a])))[_0x56ac68([0x6d,0x61,0x70])](_0x49464a=>_0x49464a[_0x56ac68([0x73,0x70,0x6c,0x69,0x74])](_0x56ac68([0x2e])))[_0x56ac68([0x73,0x6f,0x6d,0x65])](_0x58f0a4=>_0x5c14b2[_0x56ac68([0x65,0x76,0x65,0x72,0x79])]((_0x3b5f76,_0x596889)=>_0x58f0a4[_0x596889]===_0x3b5f76||_0x58f0a4[_0x596889]===_0x56ac68([0x2a])));}function _0x20bcd0(){return _0x4d7696&&_0x3c568c?new window[(_0x56ac68([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x599dcd,_0x115eff)=>{_0x4d7696[_0x56ac68([0x74,0x68,0x65,0x6e])](_0x599dcd,_0x115eff),_0x3c568c[_0x56ac68([0x74,0x68,0x65,0x6e])](_0x4e2b14=>{_0x4e2b14!=_0x56ac68([0x56,0x61,0x6c,0x69,0x64])&&_0x599dcd(_0x4e2b14);},_0x115eff);}):_0x4d7696||_0x3c568c||_0x56ac68([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5c94ba(_0x51e0c1,_0x307fe2){return new window[(_0x56ac68([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x575fd1=>{if(_0x6d63dc())return _0x575fd1(_0x56ac68([0x56,0x61,0x6c,0x69,0x64]));_0x595fc9(),_0x1f9f2d[_0x56ac68([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x56ac68([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3f58d4=!0x1;const _0xa4214c=_0x3c586c();function _0x1901a9(_0x2434ff){return!!_0x2434ff&&(typeof _0x2434ff===_0x56ac68([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2434ff===_0x56ac68([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2434ff[_0x56ac68([0x74,0x68,0x65,0x6e])]===_0x56ac68([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2434ff[_0x56ac68([0x63,0x61,0x74,0x63,0x68])]===_0x56ac68([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1f54b6(_0x8a6219){_0x5f492d(_0x8a6219)[_0x56ac68([0x74,0x68,0x65,0x6e])](_0x5e5317=>{if(!_0x5e5317||_0x5e5317[_0x56ac68([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x56ac68([0x6f,0x6b]))return _0x56ac68([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1c188b(_0x280320(_0xa4214c+_0x307fe2))!=_0x5e5317[_0x56ac68([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x56ac68([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x56ac68([0x56,0x61,0x6c,0x69,0x64]);})[_0x56ac68([0x74,0x68,0x65,0x6e])](_0xbdbf9=>(_0x195908(),_0xbdbf9),()=>{const _0x55041d=_0x540bbd();return null==_0x55041d?(_0x195908(),_0x56ac68([0x56,0x61,0x6c,0x69,0x64])):_0x56ac68(_0x590577-_0x55041d>(0x192f27dc^_0x323a27)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x56ac68([0x74,0x68,0x65,0x6e])](_0x575fd1)[_0x56ac68([0x63,0x61,0x74,0x63,0x68])](()=>{_0x575fd1(_0x56ac68([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5d3c2c=0x3d154d5c^_0x323a27;function _0x195908(){const _0xb424e8=_0x56ac68([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c188b(_0x280320(_0x51e0c1)),_0x3bee58=_0x3296b5(_0x1c188b(window[_0x56ac68([0x4d,0x61,0x74,0x68])][_0x56ac68([0x63,0x65,0x69,0x6c])](_0x590577/_0x5d3c2c)));window[_0x56ac68([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x56ac68([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xb424e8,_0x3bee58);}function _0x540bbd(){const _0x3cdf10=_0x56ac68([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c188b(_0x280320(_0x51e0c1)),_0x3eecb=window[_0x56ac68([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x56ac68([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3cdf10);return _0x3eecb?window[_0x56ac68([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3296b5(_0x3eecb),0x10)*_0x5d3c2c:null;}function _0x5f492d(_0x9956af){return new window[(_0x56ac68([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3db7cb,_0x330fb5)=>{_0x9956af[_0x56ac68([0x74,0x68,0x65,0x6e])](_0x3db7cb,_0x330fb5),window[_0x56ac68([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x330fb5,0x3d22771c^_0x323a27);});}}_0x1f9f2d[_0x56ac68([0x6f,0x6e])](_0x56ac68([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5409b4,_0x3850aa)=>{if(_0x3850aa[0x0]!=_0x51e0c1)return _0x575fd1(_0x56ac68([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3850aa[0x1]={..._0x3850aa[0x1],[_0x56ac68([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0xa4214c};},{[_0x56ac68([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x56ac68([0x68,0x69,0x67,0x68])}),_0x1f9f2d[_0x56ac68([0x6f,0x6e])](_0x56ac68([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x381d6f=>{_0x1901a9(_0x381d6f[_0x56ac68([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3f58d4=!0x0,_0x1f54b6(_0x381d6f[_0x56ac68([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x56ac68([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x56ac68([0x6c,0x6f,0x77])}),_0x35e588[_0x56ac68([0x74,0x68,0x65,0x6e])](()=>{_0x3f58d4||_0x575fd1(_0x56ac68([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x6d63dc(){return _0x1f9f2d[_0x56ac68([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x56ac68([0x76,0x69,0x65,0x77])][_0x56ac68([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x56ac68([0x61,0x75,0x74,0x6f]);}function _0x595fc9(){_0x1f9f2d[_0x56ac68([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x56ac68([0x76,0x69,0x65,0x77])][_0x56ac68([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x56ac68([0x61,0x75,0x74,0x6f]);}}function _0x342c32(_0x3dc0a4){const _0x23e92c=[new window[(_0x56ac68([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b79fc=>setTimeout(_0x3b79fc,0x3d2a9d10^_0x323a27)),_0x35e588[_0x56ac68([0x74,0x68,0x65,0x6e])](()=>new window[(_0x56ac68([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x456500=>{let _0xaf30fb=0x0;_0x1f9f2d[_0x56ac68([0x6d,0x6f,0x64,0x65,0x6c])][_0x56ac68([0x6f,0x6e])](_0x56ac68([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x207336,_0x1b66b8)=>{_0x1b66b8[0x0][_0x56ac68([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xaf30fb++,_0xaf30fb==(0x3d23a224^_0x323a27)&&(_0x456500(),_0x207336[_0x56ac68([0x6f,0x66,0x66])]());});}))];return window[_0x56ac68([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x56ac68([0x72,0x61,0x63,0x65])](_0x23e92c)[_0x56ac68([0x74,0x68,0x65,0x6e])](()=>_0x3dc0a4);}async function _0x36cf06(){await _0x35e588,_0x1f9f2d[_0x56ac68([0x6d,0x6f,0x64,0x65,0x6c])][_0x56ac68([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4f4f00,_0x1f9f2d[_0x56ac68([0x6d,0x6f,0x64,0x65,0x6c])][_0x56ac68([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4f4f00,_0x1f9f2d[_0x56ac68([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x56ac68([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2b9440(_0x2a074a){const _0x49b6e5=_0x29ab2a();_0x1f9f2d[_0x49b6e5]=_0x56ac68([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2a074a,_0x2a074a!=_0x56ac68([0x56,0x61,0x6c,0x69,0x64])&&_0x36cf06();}function _0x29ab2a(){const _0x1d9843=window[_0x56ac68([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x56ac68([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x56ac68([0x6e,0x6f,0x77])]())[_0x56ac68([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x56ac68([0x2e]),'');let _0x591260=_0x56ac68([0x56]);for(let _0x1bda37=0x0;_0x1bda37<_0x1d9843[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1bda37+=0x2){let _0x1731e7=window[_0x56ac68([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d9843[_0x56ac68([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1bda37,_0x1bda37+0x2));_0x1731e7>=_0x23c789[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1731e7-=_0x23c789[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x591260+=_0x23c789[_0x1731e7];}return _0x591260;}function _0x33a401(){const _0x38a332=_0x920c40[_0x56ac68([0x73,0x70,0x6c,0x69,0x74])](_0x56ac68([0x2e]));if(0x3!=_0x38a332[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x571f97(_0x38a332[0x1]);function _0x571f97(_0x2a9253){const _0x1d7e14=_0x2cddaf(_0x2a9253);return _0x1d7e14&&_0x4c5399()?_0x1d7e14:null;function _0x4c5399(){const _0x5d8007=_0x1d7e14[_0x56ac68([0x6a,0x74,0x69])],_0x158526=window[_0x56ac68([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5d8007[_0x56ac68([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5d8007[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x572950={..._0x1d7e14,[_0x56ac68([0x6a,0x74,0x69])]:_0x5d8007[_0x56ac68([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5d8007[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x572950[_0x56ac68([0x76,0x63])],_0x280320(_0x572950)==_0x158526;}}}async function _0x1dc387(){let _0x4adb4c=!0x0;try{const _0x4b0c9f=_0x920c40[_0x56ac68([0x73,0x70,0x6c,0x69,0x74])](_0x56ac68([0x2e])),[_0x25fe37,_0x549eb9,_0x5c64b3]=_0x4b0c9f;return _0x1672c8(_0x25fe37),await _0x53b316(_0x25fe37,_0x549eb9,_0x5c64b3),_0x4adb4c;}catch(_0xcb6f38){return!0x1;}function _0x1672c8(_0x128279){const _0x3069b7=_0x2cddaf(_0x128279);_0x3069b7&&_0x3069b7[_0x56ac68([0x61,0x6c,0x67])]==_0x56ac68([0x45,0x53,0x32,0x35,0x36])||(_0x4adb4c=!0x1);}async function _0x53b316(_0x530745,_0x308160,_0x2f93ca){const _0x53a2a0=window[_0x56ac68([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x56ac68([0x66,0x72,0x6f,0x6d])](_0x6c5370(_0x2f93ca),_0x4867a5=>_0x4867a5[_0x56ac68([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x661c06=new window[(_0x56ac68([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x56ac68([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x530745+_0x56ac68([0x2e])+_0x308160),_0x57a83d=window[_0x56ac68([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x56ac68([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x57a83d)return;const _0x1ecf87=await _0x57a83d[_0x56ac68([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x56ac68([0x6a,0x77,0x6b]),_0x1efc29,{[_0x56ac68([0x6e,0x61,0x6d,0x65])]:_0x56ac68([0x45,0x43,0x44,0x53,0x41]),[_0x56ac68([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x56ac68([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x56ac68([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x57a83d[_0x56ac68([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x56ac68([0x6e,0x61,0x6d,0x65])]:_0x56ac68([0x45,0x43,0x44,0x53,0x41]),[_0x56ac68([0x68,0x61,0x73,0x68])]:{[_0x56ac68([0x6e,0x61,0x6d,0x65])]:_0x56ac68([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1ecf87,_0x53a2a0,_0x661c06)||(_0x4adb4c=!0x1);}}function _0x2cddaf(_0x25b3b1){return _0x25b3b1[_0x56ac68([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x56ac68([0x65,0x79]))?JSON[_0x56ac68([0x70,0x61,0x72,0x73,0x65])](_0x6c5370(_0x25b3b1)):null;}function _0x6c5370(_0x27d603){return window[_0x56ac68([0x61,0x74,0x6f,0x62])](_0x27d603[_0x56ac68([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x56ac68([0x2b]))[_0x56ac68([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x56ac68([0x2f])));}function _0x280320(_0x26da45){let _0x30d310=0x1505;function _0x47d80a(_0x16c71a){for(let _0x419adb=0x0;_0x419adb<_0x16c71a[_0x56ac68([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x419adb++){const _0x203da8=_0x16c71a[_0x56ac68([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x419adb);_0x30d310=(_0x30d310<<0x5)+_0x30d310+_0x203da8,_0x30d310&=_0x30d310;}}function _0x587ac7(_0x5f4af1){Array[_0x56ac68([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x5f4af1)?_0x5f4af1[_0x56ac68([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x587ac7):_0x5f4af1&&typeof _0x5f4af1==_0x56ac68([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x56ac68([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x5f4af1)[_0x56ac68([0x73,0x6f,0x72,0x74])]()[_0x56ac68([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0xb4e24,_0x137248])=>{_0x47d80a(_0xb4e24),_0x587ac7(_0x137248);}):_0x47d80a(window[_0x56ac68([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x5f4af1));}return _0x587ac7(_0x26da45),_0x30d310>>>0x0;}function _0x1c188b(_0x37dfbd){return _0x37dfbd[_0x56ac68([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x56ac68([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x56ac68([0x30]));}function _0x3296b5(_0x3ca80d){return _0x3ca80d[_0x56ac68([0x73,0x70,0x6c,0x69,0x74])]('')[_0x56ac68([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x56ac68([0x6a,0x6f,0x69,0x6e])]('');}function _0x4f4f00(){}function _0x56ac68(_0x4b110b){return _0x4b110b['map'](_0x4c9bbd=>String['fromCharCode'](_0x4c9bbd))['join']('');}_0x2b9440(await _0x24c0bb());}(this);}['showFakeVisualSelection'](){const _0x58af87=this['editor']['model'];_0x58af87['change'](_0x5a6100=>{const _0x3922ca=_0x58af87['document']['selection']['getFirstRange']();if(_0x58af87['markers']['has'](u))_0x5a6100['updateMarker'](u,{'range':_0x3922ca});else{if(_0x3922ca['start']['isAtEnd']){const _0x54890f=_0x3922ca['start']['getLastMatchingPosition'](({item:_0x24de72})=>!_0x58af87['schema']['isContent'](_0x24de72),{'boundaries':_0x3922ca});_0x5a6100['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5a6100['createRange'](_0x54890f,_0x3922ca['end'])});}else _0x5a6100['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3922ca});}});}['hideFakeVisualSelection'](){const _0x1baf75=this['editor']['model'];_0x1baf75['markers']['has'](u)&&_0x1baf75['change'](_0x4dad5a=>{_0x4dad5a['removeMarker'](u);});}['insertContent'](_0xc54c44,_0x374469){const _0x2093ce=_0x374469||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x2093ce))return;const _0x3b5941=this['editor']['data']['processor']['toView'](_0xc54c44),_0x3c3370=this['editor']['data']['toModel'](_0x3b5941);this['editor']['model']['change'](_0x37fc4b=>{this['hideFakeVisualSelection']();const _0x3a61df=this['editor']['model']['insertContent'](_0x3c3370,_0x2093ce);_0x3a61df&&_0x37fc4b['setSelection'](_0x3a61df);});}['insertContentBelow'](_0x520963){const {model:_0x37f3b8}=this['editor'],_0x32649f=Array['from'](_0x37f3b8['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x2a056e=_0x32649f['length']?_0x37f3b8['createPositionAfter'](_0x32649f['pop']()):_0x37f3b8['document']['selection']['getLastPosition']();this['insertContent'](_0x520963,_0x2a056e);}}class v extends _0x33bdb7{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1a23fb('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0xc7e58b){super(_0xc7e58b),this['name']='AIRequestError';}}function i(_0x3ed143,_0x2774d7,_0x18e0b4){const t=_0x3ed143['t'];switch(_0x2774d7){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',_0x18e0b4);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x18e0b4);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'},_0x18e0b4);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 _0x2774d7;}}class y extends _0x5bbe05{['_commandDefinitions'];constructor(_0x556ea6,_0x738b27){super(_0x556ea6),this['_commandDefinitions']=_0x738b27,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x26a717,_0x25537a,_0x763554)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x763554));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5cf97f,_0x4eb1ab,_0x2cb91a)=>{this['enabledCommandsIds']=_0x2cb91a?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x44e158=this['editor']['model'];this['_hasContext']=function(_0x1ee831){const _0xd8afe7=_0x1ee831['document']['selection'];return _0xd8afe7['isCollapsed']?0x0!==[..._0xd8afe7['getSelectedBlocks']()]['length']&&![..._0xd8afe7['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1ee831['hasContent'](_0xd8afe7['getFirstRange']());}(_0x44e158);const _0x2778d0=_0x44e158['document']['selection'],_0x16ef67=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1a7cb3 of _0x2778d0['getRanges']())for(const _0x4a8c64 of _0x1a7cb3['getItems']())if(_0x4a8c64['is']('element')&&_0x16ef67['includes'](_0x4a8c64['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x428d9b='',_0x32708d='',_0x550019='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x428d9b,_0x32708d,_0x550019);}}function G(_0x38f2e4,_0x4868d6){const _0x1f6f6e=new Set();for(const _0x512f67 of _0x38f2e4['values']())(_0x4868d6||!0x1===_0x512f67['requiresContent'])&&_0x1f6f6e['add'](_0x512f67['id']);return Array['from'](_0x1f6f6e);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x5ef293(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4de735,_0x5048ea,_0x2c44b7){super(),this['editor']=_0x4de735,this['textAdapter']=_0x5048ea,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2c44b7,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x354eaf,_0x3198be,_0x21ccf3)=>{this['view']['value']=this['_sanitizeHTML'](_0x21ccf3);}),this['listenTo'](this['view'],'submitPrompt',(_0x50f416,_0xf4e3f6)=>{const _0x187282=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xf4e3f6,_0x187282,'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:_0x3abe9c,query:_0x1a7ffb,htmlContent:_0x5bbf6a,label:_0xc17dba,mainActionLabel:_0x538203}){this['view']['prompt']=_0xc17dba,this['view']['mainAction']=_0x538203,this['initialContext']=_0x5bbf6a,_0x1a7ffb&&(this['view']['isRendered']?this['_handleQuery'](_0x1a7ffb,_0x5bbf6a,_0x3abe9c,_0xc17dba):this['view']['once']('render',()=>{this['_handleQuery'](_0x1a7ffb,_0x5bbf6a,_0x3abe9c,_0xc17dba);}));}['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'](_0x373a27,_0x64291c,_0x15f26a,_0x1fa1df){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x64291c,this['previousQuery']=_0x373a27,this['previousLabel']=_0x1fa1df||_0x373a27,this['previousActionId']=_0x15f26a,new Promise(_0x1c6b1e=>{this['textAdapter']['makeRequest']({'query':_0x373a27,'context':_0x64291c,'onData':_0x10e357=>{this['currentResponse']=_0x10e357,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x15f26a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x106d67=>{_0x106d67 instanceof R?this['view']['handleError'](_0x106d67['message']):this['view']['handleError'](),_0x1c6b1e();})['finally'](()=>{this['stopProcessing'](),_0x1c6b1e();});});}['_parseAndNormalizeContent'](_0x5c3354,_0x2e6c36=!0x1){const _0x51c004=Z['exec'](_0x5c3354);_0x5c3354=_0x51c004?_0x5c3354['substring'](_0x51c004[0x1]['length']):_0x5c3354['length']<0x64&&!_0x2e6c36?'':this['_stripMarkdownSyntax'](_0x5c3354);const _0x3784db=this['_domParser']['parseFromString'](_0x5c3354,'text/html');if(_0x51c004){const _0x5c5f83=Array['from'](_0x3784db['body']['childNodes']);_0x5c5f83['reverse']();for(const _0x341a4e of _0x5c5f83){if(_0x341a4e['nodeType']==Node['ELEMENT_NODE'])break;_0x341a4e['remove']();}}const _0x1b193d=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x3784db['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1b193d),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x1b193d));}['_normalizeResponseHeadings'](_0x36da5f){const _0x2984c9=new _0x2a915a(this['editor']['editing']['view']['document']),_0x2ee3fb=new _0x45c383({'name':/^h[1-5]$/}),_0x160206=[];let _0x2a12af=!0x1;for(const _0x58c7a4 of _0x36da5f)_0x58c7a4['is']('element')&&_0x2ee3fb['match'](_0x58c7a4)&&(_0x160206['push'](_0x58c7a4),'h1'==_0x58c7a4['name']&&(_0x2a12af=!0x0));if(_0x2a12af){for(const _0x4f43d4 of _0x160206)_0x2984c9['rename']('h'+(parseInt(_0x4f43d4['name'][0x1])+0x1),_0x4f43d4);}}['_isH1TagSupportEnabled'](){const {data:_0x3ccb98,editing:_0x278cb4}=this['editor'],_0x2e715f=_0x3ccb98['htmlProcessor']['toView']('<h1></h1>'),_0x3c4035=_0x3ccb98['toView'](_0x3ccb98['toModel'](_0x2e715f));return!!_0x278cb4['view']['domConverter']['viewToDom'](_0x3c4035)['querySelector']('h1');}['_sanitizeHTML'](_0xec167d){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xec167d),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1d2157){const _0x83d847=_0x1d2157['trim']();return _0x83d847['startsWith']('```html')?_0x83d847['endsWith']('```')?_0x83d847['substring'](0x7,_0x83d847['length']-0x3):_0x83d847['substring'](0x7):_0x1d2157;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x5ed466){super(_0x5ed466),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x2530e0=>i(_0x5ed466,'AI_'+_0x2530e0['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5ed466,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5ed466,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5ed466,'Stop'));const _0x58721a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x58721a['if']('isVisible','ck-hidden',_0x6c9978=>!_0x6c9978)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x5576be,_0x146418){const _0x248666=new _0x29ee26(this['locale']);return _0x248666['set']({'label':_0x5576be,'class':_0x146418||'','isVisible':!0x0,'withText':!0x0}),_0x248666;}}var U='<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 W extends _0x533483{['contentFieldView'];['copyButtonView'];constructor(_0x3dff38,_0x3a84fe=''){super(_0x3dff38),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5760b8=this['bindTemplate'];this['contentFieldView']=new ct(_0x3dff38,_0x3a84fe),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5760b8['if']('isVisible','ck-hidden',_0x18e03a=>!_0x18e03a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5760b8['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 _0x268685=!0x1;this['on']('change:value',(_0x264c3b,_0xffabac,_0x1bb62e)=>{const _0x449268=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1bb62e),this['isProcessing']&&_0x449268&&!_0x268685&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4908b8,_0x38a038,_0x424a63)=>{_0x268685=!0x1,_0x424a63?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x268685=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x268685=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1d4a33=this['locale'],_0x3db912=new _0x29ee26(this['locale']),_0x25f7c9='ck-ai-form__copy-button';return _0x3db912['set']({'label':i(_0x1d4a33,'Copy'),'icon':U,'class':_0x25f7c9,'tooltip':!0x0}),_0x3db912['bind']('isVisible')['to'](this,'value',_0x400293=>!!_0x400293),_0x3db912['bind']('isEnabled')['to'](this,'isProcessing',_0x46f9f3=>!_0x46f9f3),_0x3db912['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3db912['icon']=_0x5a2b21['check'],_0x3db912['class']=_0x25f7c9+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3db912['icon']=U,_0x3db912['class']=_0x25f7c9;},0x3e8);}),_0x3db912;}['_copyHTMLToClipboard'](_0xe9e40d){const {window:_0x278a49,document:_0x1f5911}=_0x4f6220;if(_0x278a49['ClipboardItem']){const {Blob:_0x53a37b,ClipboardItem:_0x59aba1}=_0x278a49,_0xbe86cf=[new _0x59aba1({'text/html':new _0x53a37b([_0xe9e40d['innerHTML']],{'type':'text/html'}),'text/plain':new _0x53a37b([_0xe9e40d['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0xbe86cf);}else{const _0x490245=_0x1f5911['createElement']('div');_0x490245['style']['position']='absolute',_0x490245['style']['left']='-9999px',_0x490245['innerHTML']='<span>[</span>'+_0xe9e40d['innerHTML']+'<span>]</span>',_0x1f5911['body']['appendChild'](_0x490245);const _0xc45969=_0x1f5911['createRange']();_0xc45969['setStartAfter'](_0x490245['firstElementChild']),_0xc45969['setEndBefore'](_0x490245['lastElementChild']);const _0xf36bc3=_0x278a49['getSelection']();_0xf36bc3['removeAllRanges'](),_0xf36bc3['addRange'](_0xc45969),_0x1f5911['execCommand']('copy'),_0x490245['remove']();}}}class ct extends _0x533483{constructor(_0x299e96,_0x2b037d=''){super(_0x299e96),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2b037d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x4bc017){this['element']['innerHTML']=_0x4bc017;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x53a71e=new _0x533483(),_0x38c79b=this['locale'],_0x44be3c=new _0x1c7b49();return _0x44be3c['isVisible']=!0x0,_0x53a71e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x44be3c,{'text':i(_0x38c79b,'AI\x20is\x20writing...')}]}),_0x53a71e['render'](),_0x53a71e;}}class tt extends _0x533483{constructor(_0x19e973,_0x53276f=''){super(_0x19e973);const _0x24da1c=new _0x1e6c2c(),_0x3e67b7=this['bindTemplate'];this['set']('text',_0x53276f),_0x24da1c['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':[_0x24da1c,{'text':_0x3e67b7['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x416265,_0xda3f32){super(_0x416265,_0xda3f32),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',(_0x1c727b,_0x476ded)=>{_0x1c727b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x476ded());});}['_createSubmitButton'](){const _0x3e2fd2=new _0x29ee26(this['locale']),_0x222fd2=this['locale'];return _0x3e2fd2['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(_0x222fd2,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3e2fd2['on']('execute',()=>{this['submit']();}),_0x3e2fd2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x27b3de,_0x329c4b)=>!_0x27b3de&&_0x329c4b),_0x3e2fd2;}['_createShowHistoryButton'](){const _0x4b4fcc=new _0x29ee26(this['locale']),_0x365bc8=this['resultsView'],_0x5660d1=this['locale'];_0x4b4fcc['set']({'label':i(_0x5660d1,'History'),'withText':!0x1,'icon':_0x5a2b21['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4b4fcc['bind']('isOn')['to'](_0x365bc8,'isVisible'),_0x4b4fcc['bind']('isEnabled')['to'](this,'isEnabled'),_0x4b4fcc['on']('execute',()=>{_0x365bc8['isVisible']=!_0x365bc8['isVisible'],_0x365bc8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x11b2c5=()=>{_0x4f6220['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x154529=new st(this['queryView']['fieldView']['element']),_0x580aa1=_0x154529['width'],_0x3b7afa='rtl'===_0x5660d1['uiLanguageDirection']?'left':'right';_0x154529['excludeScrollbarsAndBorders'](),_0x4b4fcc['element']['style'][_0x3b7afa]=_0x580aa1-_0x154529['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x11b2c5),this['on']('render',_0x11b2c5),_0x4b4fcc;}['submit'](){const _0x4bb76f=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4bb76f);}['focus'](_0x1b58a9){-0x1===_0x1b58a9?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x328a68){super(_0x328a68),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x328a68,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3bcc1f=0x0;for(const _0x85276 of this['items'])_0x3bcc1f+=_0x85276['items']['length'];return{'resultsCount':_0x3bcc1f,'totalItemsCount':_0x3bcc1f};}['_createClearHistoryButton'](){const _0x23528b=this['locale'],_0x243491=new _0x29ee26(this['locale']);return _0x243491['set']({'label':'('+i(_0x23528b,'Clear')+')','withText':!0x0}),_0x243491['on']('execute',()=>this['fire']('clearHistory')),_0x243491;}}class hs extends _0x550377{constructor(_0x1baddb){super();const _0x501bde=new te(),_0x3e452b=new _0x29ee26(this['locale'],_0x501bde);this['children']['add'](_0x3e452b),_0x3e452b['set']({'label':_0x1baddb['prompt'],'withText':!0x0}),_0x3e452b['on']('execute',()=>{this['fire']('execute',{'value':_0x4825b5(_0x1baddb['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x33ca74{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x712193,_0x2a6792)=>{const _0xfe5ef0=Ss(_0x2a6792['prompt']);for(const _0xfb5433 of this)if(_0xfb5433!=_0x2a6792&&Ss(_0xfb5433['prompt'])===_0xfe5ef0){this['remove'](_0xfb5433);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x3e1c0e=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x3e1c0e));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x32d3b5=>_0x32d3b5)));}}function Ss(_0x57bd7c){return _0x57bd7c['toLowerCase']()['trim']();}class K extends _0x533483{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x41fad0,_0x881ce8,_0x14f420=''){super(_0x41fad0),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x41fad0),this['contentArea']=new W(_0x41fad0,_0x14f420),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 _0x290034(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x1309f3({'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 _0x15bf20=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x881ce8],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x15bf20['if']('isError','ck-hidden',_0x4860c8=>!_0x4860c8)]},'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'](_0x23e29e=0x1){-0x1===_0x23e29e?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 _0x36f188=this['locale'],_0x144fb6=new ht(_0x36f188,{'queryView':{'label':i(_0x36f188,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x5055f5,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x36f188,'Empty\x20history'),'secondary':i(_0x36f188,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x144fb6['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xd44626,_0x502f5d)=>_0xd44626&&!_0x502f5d),this['listenTo'](_0x144fb6,'submit',(_0x18ec82,_0x584c56)=>{this['prompt']=_0x584c56;const _0x2cf889=_0x26a4d7(_0x584c56);this['fire']('submitPrompt',_0x2cf889),_0x584c56['trim']()&&this['_promptHistory']['add']({'prompt':_0x2cf889},0x0);},{'priority':'high'}),_0x144fb6;}['_createHistoryView'](){const _0x451f5f=new rs(this['locale']);return _0x451f5f['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x451f5f['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x451f5f;}['_createToolbar'](){const _0x5891be=new nt(this['locale']);return _0x5891be['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xd812da,_0x4600be,_0x2b3618)=>_0xd812da&&!_0x4600be&&!!_0x2b3618),_0x5891be['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5891be['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2b2b21,_0xf21b0b,_0x2d9692)=>_0x2b2b21&&!_0xf21b0b&&!!_0x2d9692),_0x5891be['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5891be['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x314c5e,_0x2abebd)=>_0x314c5e&&!_0x2abebd),_0x5891be['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5891be['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5891be['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5891be;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1c1ec7=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x1c1ec7,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x297ea3){const _0x275ec9=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x297ea3||i(_0x275ec9,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<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 j=globalThis['DataTransfer'];class n extends _0x33bdb7{['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[_0x4197fa,a,v,_0x30f5c0];}constructor(_0x1311a9){super(_0x1311a9),_0x1311a9['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1311a9['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1311a9['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1311a9['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4b157d}=this;this['_aiAdapter']=_0x4b157d['plugins']['get'](v),this['_dialog']=_0x4b157d['plugins']['get'](_0x30f5c0),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x315912=new y(_0x4b157d,Array['from'](this['_commandDefinitions']['values']()));_0x4b157d['commands']['add']('showAIAssistant',_0x315912),_0x4b157d['ui']['componentFactory']['add']('aiCommands',_0xb8f02a=>{const _0x1af359=_0xcd2d96(_0xb8f02a);return _0x1af359['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1af359['buttonView']['set']({'label':i(_0xb8f02a,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x1af359['on']('execute',_0xf8a2f0=>this['_onExecute'](_0xf8a2f0['source']['id'])),_0x5747ea(_0x1af359,_0x4b157d['ui']['view']['body'],function(_0x1f2481){const _0x1be0ad=o(_0x1f2481['config']['get']('ai.aiAssistant.commands'),_0x1f2481['locale']),_0x4952aa=B(_0x1f2481,_0x1be0ad)['filter'](_0x2788b1=>_0x2788b1['commands']['length']);if(0x1===_0x4952aa['length'])return B(_0x1f2481,_0x4952aa[0x0]['commands'])['map'](_0x222c8e=>({'id':_0x222c8e['id'],'label':_0x222c8e['label']}));return _0x4952aa['map'](_0x4869fd=>{const {groupId:_0xa6e8ec,groupLabel:_0x371d55,commands:_0x3c9908}=_0x4869fd,_0x2102ca=B(_0x1f2481,_0x3c9908)['map'](_0x3c5ff4=>({'id':_0x3c5ff4['id'],'label':_0x3c5ff4['label']}));return{'id':_0xa6e8ec,'menu':_0x371d55||_0xa6e8ec,'children':_0x2102ca};});}(_0x4b157d),{'ariaLabel':i(_0xb8f02a,'AI\x20Commands')}),_0x1af359['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x315912['on']('change:enabledCommandsIds',_0x31c7d3),_0x1af359['menuView']['once']('render',_0x31c7d3),_0x1af359;function _0x31c7d3(){_0x1af359['isEnabled']=_0x315912['enabledCommandsIds']['length']>0x0;for(const _0x5cc16d of _0x1af359['menuView']['buttons'])_0x5cc16d['isEnabled']=_0x315912['enabledCommandsIds']['includes'](_0x5cc16d['id']);}}),_0x4b157d['ui']['componentFactory']['add']('menuBar:aiCommands',_0x59bcbb=>{const _0x558627=new _0x2758e8(_0x59bcbb);_0x558627['buttonView']['set']({'label':i(_0x59bcbb,'AI\x20Commands'),'icon':E}),_0x558627['bind']('isEnabled')['to'](_0x315912,'enabledCommandsIds',_0x2cdf95=>_0x2cdf95['length']>0x0);const _0x3bd18d=o(_0x4b157d['config']['get']('ai.aiAssistant.commands'),_0x59bcbb);return this['_populateMenuBarMenu'](_0x315912,_0x558627,_0x3bd18d,_0x585322=>this['_onExecute'](_0x585322)),_0x558627;}),_0x4b157d['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1bf839=this['_createAIAssistantUIButton'](_0x29ee26);return _0x1bf839['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1bf839;}),_0x4b157d['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x38008c=this['_createAIAssistantUIButton'](_0x318495);return _0x38008c['set']({'role':'menuitemcheckbox'}),_0x38008c;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2a07dc=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x47d8a7;for(const _0x2d6c4c in _0x2a07dc){const _0x58896b=_0x2d6c4c,_0x2eb206=_0x2a07dc[_0x58896b];if('aiLicenseKeyValid'==_0x2eb206||'aiLicenseKeyInvalid'==_0x2eb206||'aiLicenseKeyExpired'==_0x2eb206||'aiLicenseKeyDomainLimit'==_0x2eb206||'aiLicenseKeyNotAllowed'==_0x2eb206||'aiLicenseKeyEvaluationLimit'==_0x2eb206||'aiLicenseKeyTrialLimit'==_0x2eb206||'aiLicenseKeyDevelopmentLimit'==_0x2eb206||'aiLicenseKeyUsageLimit'==_0x2eb206){delete _0x2a07dc[_0x58896b],_0x47d8a7=_0x2eb206,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x47d8a7&&_0x2a07dc['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x569058='',_0x3da755='',_0x456b2e='custom'){const _0x39408b=this['editor'],_0x54fbfc=_0x39408b['editing']['view'],_0x4ad1fa=_0x39408b['plugins']['get'](a),_0x5e2d4b=_0x39408b['plugins']['get'](_0x4197fa);_0x4ad1fa['showFakeVisualSelection']();const _0x1a0495=new j(),_0x1a1b43=new ClipboardEvent('copy',{'clipboardData':_0x1a0495}),_0x38f7e=new _0x5b775c(_0x1a0495),_0x3c1468=new _0x2abad5(_0x54fbfc,_0x1a1b43,{'dataTransfer':_0x38f7e});_0x5e2d4b['_forceMarkersCopy']('comment',()=>{_0x54fbfc['document']['fire']('copy',_0x3c1468);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x39408b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x38bc08=_0x38f7e['getData']('text/html');const _0x4ac863=_0x39408b['model']['document']['selection'],_0x3bedff=Array['from'](_0x4ac863['getRanges']());0x1===_0x3bedff['length']&&_0x3bedff[0x0]['isFlat']&&!_0x4ac863['getSelectedElement']()&&''!==_0x38bc08['replace'](/ /g,'')['trim']()&&(_0x38bc08='<p>'+_0x38bc08+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x456b2e,'query':_0x569058,'htmlContent':_0x38bc08,'label':_0x3da755,'mainActionLabel':x[_0x39408b['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x94f42['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4ad1fa['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x385c62=new Map(),_0x7b2af8=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x51a747 of _0x7b2af8)for(const _0x9f355b of _0x51a747['commands'])_0x385c62['set'](_0x9f355b['id'],{..._0x9f355b,'groupId':_0x51a747['groupId'],'groupLabel':_0x51a747['groupLabel']||_0x51a747['groupId']});return _0x385c62;}['_createAIAssistantUIButton'](_0x27e967){const _0x4287b6=this['editor'],_0x5d09ad=_0x4287b6['commands']['get']('showAIAssistant'),_0x3fd5c0=new _0x27e967(_0x4287b6['locale']);return _0x3fd5c0['set']({'label':i(_0x4287b6['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x3fd5c0['bind']('isEnabled')['to'](_0x5d09ad),_0x3fd5c0['bind']('isOn')['to'](this['_dialog'],'id',_0x33e0b4=>'aiAssistant'===_0x33e0b4),this['listenTo'](_0x3fd5c0,'execute',()=>{_0x3fd5c0['isOn']?this['hideUI']():_0x5d09ad['execute']();}),_0x3fd5c0;}['_initView'](){const _0x39f5cf=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',()=>{_0x39f5cf['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x39f5cf['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x209278,ui:{ariaLiveAnnouncer:_0x1a81fb}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5d7dfc,_0x57d283,_0x1e88e0)=>{const _0x39e9af=this['_aiAssistantController']['currentContext'];_0x1e88e0?_0x1a81fb['announce'](i(_0x209278,'AI\x20is\x20writing')):_0x39e9af&&_0x1a81fb['announce'](i(_0x209278,'Generated\x20content:\x20%0',_0x39e9af),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x2c8480,_0x2f032d,_0x5acfae)=>{if(_0x5acfae){const _0x438b8d=this['_formView']['errorView']['text'];_0x1a81fb['announce'](i(_0x209278,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x438b8d));}});}['_onExecute'](_0x2f423e){const _0x4a0019=this['_commandDefinitions']['get'](_0x2f423e),_0x4766e8=this['editor'],_0x461d2b=_0x4766e8['model']['document']['selection'],_0x4e88d7=_0x4766e8['commands']['get']('showAIAssistant'),_0x479da7=_0x4766e8['plugins']['get'](a),_0x1c48e8=''+(_0x4a0019['groupId']!==I?_0x4a0019['groupLabel']+':\x20':'')+_0x4a0019['label'];if(!0x1!==_0x4a0019['requiresContent']&&_0x461d2b['isCollapsed']){const _0x3cecfb=_0x2dcf99(_0x461d2b['getSelectedBlocks']())||_0x4766e8['model']['schema']['getLimitElement'](_0x461d2b);_0x4766e8['model']['change'](_0x2beddb=>{_0x2beddb['setSelection'](_0x3cecfb,'in');});}_0x479da7['showFakeVisualSelection'](),_0x4e88d7['execute'](_0x4a0019['prompt'],_0x1c48e8,'command:'+_0x2f423e);}['_populateMenuBarMenu'](_0x401466,_0x38dd28,_0x3a564f,_0x48882e){const _0x3f1df6=this['editor'],_0x3531f8=_0x3f1df6['locale'],_0x2c865f=new _0xeeeaa8(_0x3531f8),_0x34a914=B(_0x3f1df6,_0x3a564f)['filter'](_0x111888=>_0x111888['commands']['length']);0x1===_0x34a914['length']?this['_getMenuBarGroupButtons']({'command':_0x401466,'commands':_0x34a914[0x0]['commands'],'parentMenuView':_0x38dd28,'onExecute':_0x48882e})['forEach'](_0x4805ab=>_0x2c865f['items']['add'](_0x4805ab)):_0x34a914['forEach'](({groupId:_0x3a21a5,groupLabel:_0x503e7d,commands:_0x49083b})=>{const _0x1f7cea=new _0x352a28(_0x3531f8,_0x38dd28),_0x5f5a71=new _0x2758e8(_0x3531f8),_0x280028=new _0xeeeaa8(_0x3531f8),_0x11c63c=this['_getMenuBarGroupButtons']({'command':_0x401466,'commands':_0x49083b,'parentMenuView':_0x5f5a71,'onExecute':_0x48882e});_0x5f5a71['buttonView']['set']({'label':_0x503e7d||_0x3a21a5}),_0x5f5a71['delegate']('execute')['to'](_0x38dd28),_0x280028['items']['addMany'](_0x11c63c),_0x5f5a71['panelView']['children']['add'](_0x280028),_0x1f7cea['children']['add'](_0x5f5a71),_0x2c865f['items']['add'](_0x1f7cea);}),_0x38dd28['panelView']['children']['add'](_0x2c865f);}['_getMenuBarGroupButtons']({command:_0x300e7c,commands:_0x3f2ddc,parentMenuView:_0x1dfc31,onExecute:_0x3f7309}){const _0x3ff21e=this['editor'],_0xeadd4f=_0x3ff21e['locale'];return B(_0x3ff21e,_0x3f2ddc)['map'](_0x1d767c=>{const _0x20333c=new _0x352a28(_0xeadd4f,_0x1dfc31),_0x2f7791=new _0x318495(_0xeadd4f);return _0x2f7791['set']({'label':_0x1d767c['label']}),_0x2f7791['delegate']('execute')['to'](_0x1dfc31),_0x2f7791['on']('execute',()=>_0x3f7309(_0x1d767c['id'])),_0x2f7791['bind']('isEnabled')['to'](_0x300e7c,'enabledCommandsIds',_0x1ae24c=>_0x1ae24c['includes'](_0x1d767c['id'])),_0x20333c['children']['add'](_0x2f7791),_0x20333c;});}}function _(_0x17b43f,_0x59eed1){return void 0x0!==_0x17b43f['order']&&void 0x0===_0x59eed1['order']?0x1:void 0x0===_0x17b43f['order']&&void 0x0!==_0x59eed1['order']?-0x1:void 0x0!==_0x17b43f['order']&&void 0x0!==_0x59eed1['order']?_0x17b43f['order']-_0x59eed1['order']:0x0;}function B(_0x9b8c44,_0x4a3eb2){_0x4a3eb2['sort'](_);const _0x6aa545={},_0x5b2c4e=[];for(const _0x495d19 of _0x4a3eb2)if(void 0x0!==_0x495d19['order']){if(_0x495d19['order']in _0x6aa545)throw new _0x1a23fb('ai-commands-config-order-collision',_0x9b8c44,{'conflictingDefinitions':[_0x495d19,_0x6aa545[_0x495d19['order']]]});_0x6aa545[_0x495d19['order']]=_0x495d19,_0x5b2c4e['splice'](_0x495d19['order'],0x0,_0x495d19);}else _0x5b2c4e['push'](_0x495d19);return _0x5b2c4e;}class r extends _0x33bdb7{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x51a04b){super(_0x51a04b);const _0x43a83e=_0x51a04b['config'],_0x3790be=_0x51a04b['locale'];_0x43a83e['define']('ai.aiAssistant.commands',function(_0x86a937){return[{'groupId':'editOrReview','groupLabel':i(_0x86a937,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x86a937,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x86a937,'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(_0x86a937,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x86a937,'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(_0x86a937,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x86a937,'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(_0x86a937,'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(_0x86a937,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x86a937,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x86a937,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x86a937,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x86a937,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x86a937,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x86a937,'Change\x20style'),'commands':[{'id':'business','label':i(_0x86a937,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x86a937,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x86a937,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x86a937,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x86a937,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x86a937,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x86a937,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x86a937,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x86a937,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x86a937,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x86a937,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x86a937,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x86a937,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3790be)),_0x43a83e['define']('ai.aiAssistant.extraCommandGroups',[]),_0x43a83e['define']('ai.aiAssistant.removeCommands',[]);const _0x44c82f=o(_0x43a83e['get']('ai.aiAssistant.commands'),_0x3790be),_0x25ae66=_0x43a83e['get']('ai.aiAssistant.extraCommandGroups'),_0x394ccd=_0x43a83e['get']('ai.aiAssistant.removeCommands');_0x25ae66['forEach'](_0x3c97a1=>{const _0x265b39=_0x44c82f['find'](_0xbfca3d=>_0xbfca3d['groupId']===_0x3c97a1['groupId']);_0x265b39?_0x265b39['commands']=_0x265b39['commands']['concat'](_0x3c97a1['commands']):_0x44c82f['push'](_0x3c97a1);}),_0x44c82f['forEach'](_0x3822ad=>{_0x3822ad['commands']=_0x3822ad['commands']['filter'](_0x488bdf=>!_0x394ccd['includes'](_0x488bdf['id']));}),_0x43a83e['set']('ai.aiAssistant.commands',_0x44c82f);}}class P extends _0x33bdb7{['abortController'];static get['requires'](){return[v];}constructor(_0x36f08a){super(_0x36f08a),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x393c5f){return this['sendRequest'](_0x393c5f)['catch'](_0x3b4808=>{if(_0x3b4808 instanceof R)return Promise['reject'](_0x3b4808);if('AbortError'==_0x3b4808['name'])return Promise['resolve']();throw console['error'](_0x3b4808),new _0x1a23fb('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2a98db,_0x4f1761){const _0x264b1e=this['editor']['locale'],_0x32c2e1={'Content-Type':'application/json'};if('object'==typeof _0x2a98db)Object['assign'](_0x32c2e1,_0x2a98db);else{if(_0x2a98db)try{const _0x2e8e73=await _0x2a98db(_0x4f1761);Object['assign'](_0x32c2e1,_0x2e8e73);}catch(_0x5e7c1f){return Promise['reject'](new R(i(_0x264b1e,'AI_ERROR_GET_HEADERS')));}}return _0x32c2e1;}async['_prepareRequestParameters'](_0x46e707,_0x54c264){const _0x65c6d1=this['editor']['locale'];if('object'==typeof _0x46e707)return _0x46e707;try{return await _0x46e707(_0x54c264);}catch(_0xecc723){return Promise['reject'](new R(i(_0x65c6d1,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3dbc8a){super(_0x3dbc8a),_0x3dbc8a['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3dbc8a['config']['get']('ai.openAI.requestParameters')||_0x3dbc8a['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3dbc8a['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x3dbc8a['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x3dbc8a['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x2214cf,context:_0x4d2289,onData:_0x3ed783,actionId:_0x3b4c54}){const _0xd140e0=this['editor']['locale'],_0x1a3f72=await this['prepareMessages'](_0x2214cf,_0x4d2289,_0x3b4c54),_0x2dcfd1=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3b4c54),_0x7580f1=await this['_prepareRequestParameters'](this['_requestParameters'],_0x3b4c54),_0x155497={'messages':_0x1a3f72,..._0x7580f1},_0x2bdc7f={'method':'POST','headers':_0x2dcfd1,'body':JSON['stringify'](_0x155497),'signal':this['abortController']['signal']},_0x26164e=await fetch(this['_apiUrl'],_0x2bdc7f);if(_0x26164e['ok'])return _0x7580f1['stream']?await this['_readStreamableResponse'](_0x26164e,_0x3ed783):await this['_readStaticResponse'](_0x26164e,_0x3ed783),Promise['resolve']();{const _0x1faadb=await _0x26164e['text']();return _0x1faadb['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0xd140e0,'AI_ERROR_CONTEXT_LENGTH'))):_0x1faadb['includes']('Moderation')?Promise['reject'](new R(i(_0xd140e0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1faadb));}}async['prepareMessages'](_0x255efd,_0x584f82,_0xadd4d8){let _0x124e64,_0x2e6ee9;return _0x584f82?(_0x124e64='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.',_0x2e6ee9='Instruction:\x0a'+_0x255efd+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x584f82):(_0x124e64='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.',_0x2e6ee9=_0x255efd),[{'role':'system','content':_0x124e64},{'role':'user','content':_0x2e6ee9}];}async['_readStreamableResponse'](_0x2f2f97,_0x204b83){const _0x3571e4=_0x2f2f97['body']['getReader'](),_0x4ece70=new TextDecoder();let _0x5f5008='',_0x35b9e0='',_0x1e6716='',_0x2f2460=!0x1;for(;!_0x2f2460;){const {done:_0x24fcfe,value:_0x3dbce4}=await _0x3571e4['read'](),_0x23e999=_0x5f5008+_0x4ece70['decode'](_0x3dbce4);let _0x27eecc='';_0x2f2460=_0x24fcfe;try{_0x27eecc=this['_cleanUpData'](_0x23e999),_0x5f5008='';}catch(_0x396559){_0x5f5008=_0x23e999;continue;}_0x35b9e0+=_0x27eecc,!_0x2f2460&&this['_isBufferIncomplete'](_0x35b9e0)||_0x35b9e0&&(_0x1e6716+=_0x35b9e0,_0x35b9e0='',_0x204b83(_0x1e6716));}return Promise['resolve']();}async['_readStaticResponse'](_0x507971,_0x54c73f){return _0x54c73f((await _0x507971['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x14ac20){const _0x5772ce=_0x14ac20['split']('<')['length']!==_0x14ac20['split']('>')['length'],_0x1f887e=_0x14ac20['length']<0x1e;return _0x5772ce&&_0x1f887e;}['_cleanUpData'](_0xc74a6a){return _0xc74a6a['split'](/\n(?![^{]*\})/g)['map'](_0x457bce=>_0x457bce['replace']('data:\x20',''))['filter'](_0x2907fc=>_0x2907fc&&_0x2907fc['length']>0x0&&'[DONE]'!==_0x2907fc)['map'](_0x3594ac=>{const {choices:_0x1352a6}=JSON['parse'](_0x3594ac);if(_0x1352a6[0x0]&&_0x1352a6[0x0]['delta']&&_0x1352a6[0x0]['delta']['content'])return _0x1352a6[0x0]['delta']['content'];})['filter'](_0x283ece=>_0x283ece)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2d8a6f){super(_0x2d8a6f),_0x2d8a6f['config']['get']('ai.aws.requestParameters')||_0x2d8a6f['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']=_0x2d8a6f['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2d8a6f['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2d8a6f['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2d8a6f['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2205d5,context:_0x382da3,onData:_0x470c51,actionId:_0x5b0da3}){const {model:_0x4795d5,stream:_0x1dc1c6,..._0x18ef84}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5b0da3),_0x32e96f={'prompt':await this['preparePrompt'](_0x2205d5,_0x382da3,_0x4795d5,_0x5b0da3),..._0x18ef84};this['_apiUrl']?await this['_processProxyRequest'](_0x32e96f,_0x4795d5,_0x1dc1c6,_0x470c51,_0x5b0da3):await this['_processAWSRequest'](_0x32e96f,_0x4795d5,_0x1dc1c6,_0x470c51);}async['preparePrompt'](_0x25320e,_0x3a53e5,_0x3c8645,_0x12df0c){let _0x4887b9,_0x18beb2;return _0x3a53e5?(_0x4887b9='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.',_0x18beb2='Instruction:\x0a'+_0x25320e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3a53e5):(_0x4887b9='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.',_0x18beb2=_0x25320e),'meta.llama'==this['getModelFamily'](_0x3c8645)?'<<SYS>>\x0a'+_0x4887b9+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x18beb2+'\x0a[/INST]':'Human:\x0a'+_0x4887b9+'\x0a'+_0x18beb2+'\x0a\x0aAssistant:';}['getModelFamily'](_0xb1e41b){if(/^anthropic\.claude/['test'](_0xb1e41b))return'anthropic.claude';if(/^ai21\.j2/['test'](_0xb1e41b))return'ai21.j2';if(/^cohere\.command/['test'](_0xb1e41b))return'cohere.command';if(/^meta\.llama/['test'](_0xb1e41b))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0xb1e41b));}async['_processProxyRequest'](_0x499a07,_0x1a6771,_0x52dc14,_0x59afb6,_0x275127){const _0x12e35d={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x275127),'body':JSON['stringify']({..._0x499a07,'model':_0x1a6771,'stream':_0x52dc14}),'signal':this['abortController']['signal']},_0x31d6bd=await fetch(this['_apiUrl'],_0x12e35d);_0x52dc14?await this['_readStreamableResponse'](_0x31d6bd,_0x1a6771,_0x59afb6):await this['_readStaticResponse'](_0x31d6bd,_0x1a6771,_0x59afb6);}async['_processAWSRequest'](_0x2b9662,_0x29a203,_0x4602ea,_0x4ed040){const _0xfaa32c=new _0x4c7963(this['_bedrockClientConfig']),_0x39b73a={'body':JSON['stringify'](_0x2b9662),'contentType':'application/json','accept':'application/json','modelId':_0x29a203};let _0xfa519;if(_0x4602ea){const _0x6af6f0=new _0x23fdcf(_0x39b73a);_0xfa519=await _0xfaa32c['send'](_0x6af6f0,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xfa519,_0x29a203,_0x4ed040);}else{const _0x1a5129=new _0x4e33c8(_0x39b73a);_0xfa519=await _0xfaa32c['send'](_0x1a5129,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xfa519,_0x29a203,_0x4ed040);}}async['_readAsyncIterableResponse'](_0x4672ae,_0x44dbda,_0x302d82){const _0x3ff7dd=_0x4672ae['body'],_0x97672a=new TextDecoder('utf-8');let _0x116329='';for await(const _0xf2c9e0 of _0x3ff7dd)if(_0xf2c9e0['chunk']){const _0x3f764f=_0x97672a['decode'](_0xf2c9e0['chunk']['bytes']),_0x2de344=JSON['parse'](_0x3f764f);_0x116329+=this['_getGeneratedText'](_0x2de344,_0x44dbda),_0x302d82(_0x116329);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1f8812,_0x316705,_0x2da67f){const _0x599930=_0x1f8812['body'],_0x40fa23=new TextDecoder('utf-8'),_0x4f9f5a=_0x599930['getReader']();let _0x3832e1='',_0x4acd7b='',_0x3560de=!0x1;for(;!_0x3560de;){const {done:_0x493066,value:_0x313595}=await _0x4f9f5a['read']();if(_0x3560de=_0x493066,_0x3560de)break;const _0x337e28=(_0x3832e1+_0x40fa23['decode'](_0x313595))['split']('\x0a')['map'](_0x5c87d7=>{try{return _0x3832e1='',JSON['parse'](_0x5c87d7);}catch(_0xc6cc4){return _0x3832e1=_0x5c87d7,null;}})['filter'](_0x3697a1=>null!==_0x3697a1);_0x337e28['length']&&(_0x4acd7b+=_0x337e28['map'](_0x11f1f8=>this['_getGeneratedText'](_0x11f1f8,_0x316705))['join'](''),_0x2da67f(_0x4acd7b));}return Promise['resolve']();}async['_readStaticResponse'](_0x5132c5,_0x39e885,_0x5d445d){let _0xefd272;return _0xefd272=_0x5132c5 instanceof Response?await _0x5132c5['json']():JSON['parse'](Buffer['from'](_0x5132c5['body'])['toString']('utf8')),(_0x5d445d(this['_getGeneratedText'](_0xefd272,_0x39e885)),Promise['resolve']());}['_getGeneratedText'](_0x345efb,_0x28ab2d){switch(this['getModelFamily'](_0x28ab2d)){case'anthropic.claude':return _0x345efb['completion'];case'ai21.j2':return _0x345efb['completions'][0x0]['data']['text'];case'cohere.command':return _0x345efb['generations'][0x0]['text'];case'meta.llama':return _0x345efb['generation'];}}}export{v as AIAdapter,r as AIAssistant,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':_0x231ff4=>0x1!=_0x231ff4}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x16a5d1=>{const {af:{dictionary:_0x478561,getPluralForm:_0xa8db49}}={'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':_0x10136e=>0x1!=_0x10136e}};_0x16a5d1['af']||={'dictionary':{},'getPluralForm':null},_0x16a5d1['af']['dictionary']=Object['assign'](_0x16a5d1['af']['dictionary'],_0x478561),_0x16a5d1['af']['getPluralForm']=_0xa8db49;})(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':_0x3891d2=>0x0==_0x3891d2?0x0:0x1==_0x3891d2?0x1:0x2==_0x3891d2?0x2:_0x3891d2%0x64>=0x3&&_0x3891d2%0x64<=0xa?0x3:_0x3891d2%0x64>=0xb?0x4:0x5}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x2e3338=>{const {ar:{dictionary:_0x57bffb,getPluralForm:_0xb3a7e0}}={'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':_0x1ab9a7=>0x0==_0x1ab9a7?0x0:0x1==_0x1ab9a7?0x1:0x2==_0x1ab9a7?0x2:_0x1ab9a7%0x64>=0x3&&_0x1ab9a7%0x64<=0xa?0x3:_0x1ab9a7%0x64>=0xb?0x4:0x5}};_0x2e3338['ar']||={'dictionary':{},'getPluralForm':null},_0x2e3338['ar']['dictionary']=Object['assign'](_0x2e3338['ar']['dictionary'],_0x57bffb),_0x2e3338['ar']['getPluralForm']=_0xb3a7e0;})(window['CKEDITOR_TRANSLATIONS']||={});
|