@ckeditor/ckeditor5-ai 44.0.0-alpha.5 → 44.0.0-alpha.6
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 _0x3022e5,Command as _0x389b0a,icons as _0x3ce81c}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x1b7c0c,CKEditorError as _0x56fc72,ObservableMixin as _0x208eeb,global as _0x14a159,isVisible as it,Rect as st,Collection as _0x514d77,FocusTracker as _0x59087d,KeystrokeHandler as ts,first as _0x57197e}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x526107,View as _0x3a7ede,SpinnerView as _0x5d5f7a,IconView as _0x5964f5,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x45dba1,ButtonLabelView as te,FocusCycler as _0x20e712,createLabeledTextarea as _0x18877e,Dialog as _0x35fe77,createDropdown as _0x431174,addMenuToDropdown as _0x550a9a,MenuBarMenuView as _0x4e8ddc,MenuBarMenuListItemButtonView as _0x263888,DialogViewPosition as _0x24b88d,MenuBarMenuListView as _0x47a773,MenuBarMenuListItemView as _0x130bb1}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x47ff33,Matcher as _0x15d9c7,DataTransfer as _0x298556,DomEventData as _0xdeb224}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x4ad890,escape as _0x1f8928}from'lodash-es';import{ClipboardMarkersUtils as _0x1e154b}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x3dc65e,InvokeModelWithResponseStreamCommand as _0x232e61,InvokeModelCommand as _0x3674a1}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x3de5a5,_0x4066d0){const _0x423e4b=(0x0,_0x4066d0['t'])('Other');return _0x3de5a5['length']?'groupId'in _0x3de5a5[0x0]?_0x3de5a5:[{'groupId':I,'groupLabel':_0x423e4b,'order':0x1/0x0,'commands':_0x3de5a5}]:[{'groupId':I,'groupLabel':_0x423e4b,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x3022e5{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xf9c20a}=this,_0x49df38=['ck-fake-ai-selection'];_0xf9c20a['config']['get']('ai.useTheme')&&_0x49df38['push']('ck-ai-assistant-ui_theme'),_0xf9c20a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x49df38,'priority':0xc}}),_0xf9c20a['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x3cb3c6,{writer:_0x58595f})=>{if(!_0x3cb3c6['markerRange']['isCollapsed'])return null;const _0x3b545e=_0x58595f['createUIElement']('span');return _0x58595f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3b545e),_0x3b545e;}});}['afterInit'](){!async function(_0x577303){const _0x2a034f=_0x42e90e([0x32,0x63,0x61,0x33,0x4e,0x59,0x5a,0x4d,0x36,0x4b,0x4a,0x64,0x76,0x6b,0x68,0x69,0x6e,0x42,0x4f,0x67,0x47,0x77,0x34,0x6a,0x74,0x52,0x37,0x50,0x41,0x54,0x43,0x6f,0x71,0x58,0x62,0x35,0x79,0x30,0x55,0x38,0x65,0x51,0x66,0x6d,0x70,0x73,0x46,0x39,0x75,0x57,0x45,0x44,0x78,0x72,0x48,0x31,0x4c,0x6c,0x49,0x7a,0x56,0x53]),_0x401517=0x4aa49674,_0x115eb3=0x4aa3c194^_0x401517,_0x30e5a9=window[_0x42e90e([0x44,0x61,0x74,0x65])][_0x42e90e([0x6e,0x6f,0x77])](),_0x3c53fa=_0x577303[_0x42e90e([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x196347=new window[(_0x42e90e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1a4286=>{_0x3c53fa[_0x42e90e([0x6f,0x6e,0x63,0x65])](_0x42e90e([0x72,0x65,0x61,0x64,0x79]),_0x1a4286);}),_0x1a3426={[_0x42e90e([0x6b,0x74,0x79])]:_0x42e90e([0x45,0x43]),[_0x42e90e([0x75,0x73,0x65])]:_0x42e90e([0x73,0x69,0x67]),[_0x42e90e([0x63,0x72,0x76])]:_0x42e90e([0x50,0x2d,0x32,0x35,0x36]),[_0x42e90e([0x78])]:_0x42e90e([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]),[_0x42e90e([0x79])]:_0x42e90e([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]),[_0x42e90e([0x61,0x6c,0x67])]:_0x42e90e([0x45,0x53,0x32,0x35,0x36])},_0x604071=_0x3c53fa[_0x42e90e([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x42e90e([0x67,0x65,0x74])](_0x42e90e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x316501(){let _0xda9be6,_0x461e7f=null,_0x837104=null;try{if(_0x604071==_0x42e90e([0x47,0x50,0x4c]))return _0x42e90e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0xda9be6=_0x467dd3(),!_0xda9be6)return _0x42e90e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0xda9be6[_0x42e90e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x837104=_0x5d0a23(_0xda9be6[_0x42e90e([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0xda9be6[_0x42e90e([0x6a,0x74,0x69])])),await _0x2ef71f()?_0xd0855c()?_0x44c4bb()?_0x42e90e([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x282143()?(_0xda9be6[_0x42e90e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x42e90e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x461e7f=_0x4f5f6a(_0x42e90e([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0xda9be6[_0x42e90e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x42e90e([0x74,0x72,0x69,0x61,0x6c])&&(_0x461e7f=_0x4f5f6a(_0x42e90e([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0xda9be6[_0x42e90e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x42e90e([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x461e7f=_0x4f5f6a(_0x42e90e([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x1615f4()):_0x42e90e([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x42e90e([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x42e90e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x4ac6f8){return _0x42e90e([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x44c4bb(){const _0x1bd199=[_0x42e90e([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x42e90e([0x74,0x72,0x69,0x61,0x6c])][_0x42e90e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xda9be6[_0x42e90e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x30e5a9/0x3e8:0xe10*_0x115eb3;return _0xda9be6[_0x42e90e([0x65,0x78,0x70])]<_0x1bd199;}function _0xd0855c(){const _0x22af0a=_0xda9be6[_0x42e90e([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x22af0a&&(!!_0x22af0a[_0x42e90e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42e90e([0x2a]))||!!_0x22af0a[_0x42e90e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42e90e([0x41,0x49])));}function _0x282143(){const _0x3c3911=_0xda9be6[_0x42e90e([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3c3911||0x0==_0x3c3911[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2d59d0}=new URL(window[_0x42e90e([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3c3911[_0x42e90e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d59d0))return!0x0;const _0xbcfc0b=_0x2d59d0[_0x42e90e([0x73,0x70,0x6c,0x69,0x74])](_0x42e90e([0x2e]));return _0x3c3911[_0x42e90e([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xf8d6b2=>_0xf8d6b2[_0x42e90e([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x42e90e([0x2a])))[_0x42e90e([0x6d,0x61,0x70])](_0x5e3220=>_0x5e3220[_0x42e90e([0x73,0x70,0x6c,0x69,0x74])](_0x42e90e([0x2e])))[_0x42e90e([0x73,0x6f,0x6d,0x65])](_0x29255a=>_0xbcfc0b[_0x42e90e([0x65,0x76,0x65,0x72,0x79])]((_0x3b815f,_0x42426f)=>_0x29255a[_0x42426f]===_0x3b815f||_0x29255a[_0x42426f]===_0x42e90e([0x2a])));}function _0x1615f4(){return _0x461e7f&&_0x837104?new window[(_0x42e90e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xbfed85,_0x23bfec)=>{_0x461e7f[_0x42e90e([0x74,0x68,0x65,0x6e])](_0xbfed85,_0x23bfec),_0x837104[_0x42e90e([0x74,0x68,0x65,0x6e])](_0x5c2cec=>{_0x5c2cec!=_0x42e90e([0x56,0x61,0x6c,0x69,0x64])&&_0xbfed85(_0x5c2cec);},_0x23bfec);}):_0x461e7f||_0x837104||_0x42e90e([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5d0a23(_0x2bc396,_0x500466){return new window[(_0x42e90e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x326114=>{if(_0x430bf3())return _0x326114(_0x42e90e([0x56,0x61,0x6c,0x69,0x64]));_0x565844(),_0x3c53fa[_0x42e90e([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x42e90e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x5ebf88=!0x1;const _0x3040aa=_0x1b7c0c();function _0x85096c(_0x4b6cb3){return!!_0x4b6cb3&&(typeof _0x4b6cb3===_0x42e90e([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4b6cb3===_0x42e90e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4b6cb3[_0x42e90e([0x74,0x68,0x65,0x6e])]===_0x42e90e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4b6cb3[_0x42e90e([0x63,0x61,0x74,0x63,0x68])]===_0x42e90e([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1eab17(_0x153894){_0x42e98f(_0x153894)[_0x42e90e([0x74,0x68,0x65,0x6e])](_0x183268=>{if(!_0x183268||_0x183268[_0x42e90e([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x42e90e([0x6f,0x6b]))return _0x42e90e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x43efd0(_0x285574(_0x3040aa+_0x500466))!=_0x183268[_0x42e90e([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x42e90e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x42e90e([0x56,0x61,0x6c,0x69,0x64]);})[_0x42e90e([0x74,0x68,0x65,0x6e])](_0x3bea5e=>(_0xe3b7b1(),_0x3bea5e),()=>{const _0x17ed9b=_0x2eb6b5();return null==_0x17ed9b?(_0xe3b7b1(),_0x42e90e([0x56,0x61,0x6c,0x69,0x64])):_0x42e90e(_0x30e5a9-_0x17ed9b>(0x6ea81274^_0x401517)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x42e90e([0x74,0x68,0x65,0x6e])](_0x326114)[_0x42e90e([0x63,0x61,0x74,0x63,0x68])](()=>{_0x326114(_0x42e90e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x466395=0x4a9278f4^_0x401517;function _0xe3b7b1(){const _0x1a4dfc=_0x42e90e([0x6c,0x6c,0x63,0x74,0x2d])+_0x43efd0(_0x285574(_0x2bc396)),_0x1edecf=_0x72d6f4(_0x43efd0(window[_0x42e90e([0x4d,0x61,0x74,0x68])][_0x42e90e([0x63,0x65,0x69,0x6c])](_0x30e5a9/_0x466395)));window[_0x42e90e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x42e90e([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1a4dfc,_0x1edecf);}function _0x2eb6b5(){const _0x29dcd7=_0x42e90e([0x6c,0x6c,0x63,0x74,0x2d])+_0x43efd0(_0x285574(_0x2bc396)),_0x39595b=window[_0x42e90e([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x42e90e([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x29dcd7);return _0x39595b?window[_0x42e90e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x72d6f4(_0x39595b),0x10)*_0x466395:null;}function _0x42e98f(_0x3f9bfd){return new window[(_0x42e90e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x9f85b1,_0x514fbe)=>{_0x3f9bfd[_0x42e90e([0x74,0x68,0x65,0x6e])](_0x9f85b1,_0x514fbe),window[_0x42e90e([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x514fbe,0x4aa542b4^_0x401517);});}}_0x3c53fa[_0x42e90e([0x6f,0x6e])](_0x42e90e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x571f4f,_0x344048)=>{if(_0x344048[0x0]!=_0x2bc396)return _0x326114(_0x42e90e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x344048[0x1]={..._0x344048[0x1],[_0x42e90e([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3040aa};},{[_0x42e90e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x42e90e([0x68,0x69,0x67,0x68])}),_0x3c53fa[_0x42e90e([0x6f,0x6e])](_0x42e90e([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x412049=>{_0x85096c(_0x412049[_0x42e90e([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x5ebf88=!0x0,_0x1eab17(_0x412049[_0x42e90e([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x42e90e([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x42e90e([0x6c,0x6f,0x77])}),_0x196347[_0x42e90e([0x74,0x68,0x65,0x6e])](()=>{_0x5ebf88||_0x326114(_0x42e90e([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x430bf3(){return _0x3c53fa[_0x42e90e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x42e90e([0x76,0x69,0x65,0x77])][_0x42e90e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x42e90e([0x61,0x75,0x74,0x6f]);}function _0x565844(){_0x3c53fa[_0x42e90e([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x42e90e([0x76,0x69,0x65,0x77])][_0x42e90e([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x42e90e([0x61,0x75,0x74,0x6f]);}}function _0x4f5f6a(_0x1b9cef){const _0xf5d306=[new window[(_0x42e90e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5d2835=>setTimeout(_0x5d2835,0x4aada8b8^_0x401517)),_0x196347[_0x42e90e([0x74,0x68,0x65,0x6e])](()=>new window[(_0x42e90e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2be9e0=>{let _0x2f23dd=0x0;_0x3c53fa[_0x42e90e([0x6d,0x6f,0x64,0x65,0x6c])][_0x42e90e([0x6f,0x6e])](_0x42e90e([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3cdf23,_0x4410ec)=>{_0x4410ec[0x0][_0x42e90e([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2f23dd++,_0x2f23dd==(0x4aa4978c^_0x401517)&&(_0x2be9e0(),_0x3cdf23[_0x42e90e([0x6f,0x66,0x66])]());});}))];return window[_0x42e90e([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x42e90e([0x72,0x61,0x63,0x65])](_0xf5d306)[_0x42e90e([0x74,0x68,0x65,0x6e])](()=>_0x1b9cef);}async function _0x46b78c(){await _0x196347,_0x3c53fa[_0x42e90e([0x6d,0x6f,0x64,0x65,0x6c])][_0x42e90e([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x56bd0a,_0x3c53fa[_0x42e90e([0x6d,0x6f,0x64,0x65,0x6c])][_0x42e90e([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x56bd0a,_0x3c53fa[_0x42e90e([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x42e90e([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5cc623(_0x48d0a3){const _0x1d71fd=_0x55abdb();_0x3c53fa[_0x1d71fd]=_0x42e90e([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x48d0a3,_0x48d0a3!=_0x42e90e([0x56,0x61,0x6c,0x69,0x64])&&_0x46b78c();}function _0x55abdb(){const _0xe9f073=window[_0x42e90e([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x42e90e([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x42e90e([0x6e,0x6f,0x77])]())[_0x42e90e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x42e90e([0x2e]),'');let _0x55d284=_0x42e90e([0x63]);for(let _0x5ca7ac=0x0;_0x5ca7ac<_0xe9f073[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5ca7ac+=0x2){let _0x29341d=window[_0x42e90e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xe9f073[_0x42e90e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5ca7ac,_0x5ca7ac+0x2));_0x29341d>=_0x2a034f[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x29341d-=_0x2a034f[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x55d284+=_0x2a034f[_0x29341d];}return _0x55d284;}function _0x467dd3(){const _0x2c2bbb=_0x604071[_0x42e90e([0x73,0x70,0x6c,0x69,0x74])](_0x42e90e([0x2e]));if(0x3!=_0x2c2bbb[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xb1b102(_0x2c2bbb[0x1]);function _0xb1b102(_0x360637){const _0x36fab6=_0x2ac73a(_0x360637);return _0x36fab6&&_0xa636a0()?_0x36fab6:null;function _0xa636a0(){const _0x40a909=_0x36fab6[_0x42e90e([0x6a,0x74,0x69])],_0x2ff70e=window[_0x42e90e([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x40a909[_0x42e90e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x40a909[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5a905b={..._0x36fab6,[_0x42e90e([0x6a,0x74,0x69])]:_0x40a909[_0x42e90e([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x40a909[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5a905b[_0x42e90e([0x76,0x63])],_0x285574(_0x5a905b)==_0x2ff70e;}}}async function _0x2ef71f(){let _0x5b355a=!0x0;try{const _0x355ef4=_0x604071[_0x42e90e([0x73,0x70,0x6c,0x69,0x74])](_0x42e90e([0x2e])),[_0x487c3c,_0x1a6763,_0x24fae7]=_0x355ef4;return _0x305829(_0x487c3c),await _0x1cca5e(_0x487c3c,_0x1a6763,_0x24fae7),_0x5b355a;}catch(_0x5d38d7){return!0x1;}function _0x305829(_0x2207c8){const _0xe2723f=_0x2ac73a(_0x2207c8);_0xe2723f&&_0xe2723f[_0x42e90e([0x61,0x6c,0x67])]==_0x42e90e([0x45,0x53,0x32,0x35,0x36])||(_0x5b355a=!0x1);}async function _0x1cca5e(_0x1959f6,_0x421469,_0xb114b1){const _0x207615=window[_0x42e90e([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x42e90e([0x66,0x72,0x6f,0x6d])](_0x2040a2(_0xb114b1),_0x336e7b=>_0x336e7b[_0x42e90e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4078da=new window[(_0x42e90e([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x42e90e([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1959f6+_0x42e90e([0x2e])+_0x421469),_0x17d48c=window[_0x42e90e([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x42e90e([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x17d48c)return;const _0x4fd70d=await _0x17d48c[_0x42e90e([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x42e90e([0x6a,0x77,0x6b]),_0x1a3426,{[_0x42e90e([0x6e,0x61,0x6d,0x65])]:_0x42e90e([0x45,0x43,0x44,0x53,0x41]),[_0x42e90e([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x42e90e([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x42e90e([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x17d48c[_0x42e90e([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x42e90e([0x6e,0x61,0x6d,0x65])]:_0x42e90e([0x45,0x43,0x44,0x53,0x41]),[_0x42e90e([0x68,0x61,0x73,0x68])]:{[_0x42e90e([0x6e,0x61,0x6d,0x65])]:_0x42e90e([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4fd70d,_0x207615,_0x4078da)||(_0x5b355a=!0x1);}}function _0x2ac73a(_0x327913){return _0x327913[_0x42e90e([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x42e90e([0x65,0x79]))?JSON[_0x42e90e([0x70,0x61,0x72,0x73,0x65])](_0x2040a2(_0x327913)):null;}function _0x2040a2(_0x8fee5f){return window[_0x42e90e([0x61,0x74,0x6f,0x62])](_0x8fee5f[_0x42e90e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x42e90e([0x2b]))[_0x42e90e([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x42e90e([0x2f])));}function _0x285574(_0x4364ff){let _0x4141a6=0x1505;function _0x52f7cc(_0x5c2e0e){for(let _0x3b8ce7=0x0;_0x3b8ce7<_0x5c2e0e[_0x42e90e([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3b8ce7++){const _0x575323=_0x5c2e0e[_0x42e90e([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3b8ce7);_0x4141a6=(_0x4141a6<<0x5)+_0x4141a6+_0x575323,_0x4141a6&=_0x4141a6;}}function _0xd5450f(_0x1016d9){Array[_0x42e90e([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1016d9)?_0x1016d9[_0x42e90e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0xd5450f):_0x1016d9&&typeof _0x1016d9==_0x42e90e([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x42e90e([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1016d9)[_0x42e90e([0x73,0x6f,0x72,0x74])]()[_0x42e90e([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0xce090,_0x3b9032])=>{_0x52f7cc(_0xce090),_0xd5450f(_0x3b9032);}):_0x52f7cc(window[_0x42e90e([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1016d9));}return _0xd5450f(_0x4364ff),_0x4141a6>>>0x0;}function _0x43efd0(_0x4259a6){return _0x4259a6[_0x42e90e([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x42e90e([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x42e90e([0x30]));}function _0x72d6f4(_0x8371fb){return _0x8371fb[_0x42e90e([0x73,0x70,0x6c,0x69,0x74])]('')[_0x42e90e([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x42e90e([0x6a,0x6f,0x69,0x6e])]('');}function _0x56bd0a(){}function _0x42e90e(_0x2e18b4){return _0x2e18b4['map'](_0x54e27f=>String['fromCharCode'](_0x54e27f))['join']('');}_0x5cc623(await _0x316501());}(this);}['showFakeVisualSelection'](){const _0x47f8b4=this['editor']['model'];_0x47f8b4['change'](_0x38120a=>{const _0x59007b=_0x47f8b4['document']['selection']['getFirstRange']();if(_0x47f8b4['markers']['has'](u))_0x38120a['updateMarker'](u,{'range':_0x59007b});else{if(_0x59007b['start']['isAtEnd']){const _0x1ee0fe=_0x59007b['start']['getLastMatchingPosition'](({item:_0x5cf472})=>!_0x47f8b4['schema']['isContent'](_0x5cf472),{'boundaries':_0x59007b});_0x38120a['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x38120a['createRange'](_0x1ee0fe,_0x59007b['end'])});}else _0x38120a['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x59007b});}});}['hideFakeVisualSelection'](){const _0x50c5e5=this['editor']['model'];_0x50c5e5['markers']['has'](u)&&_0x50c5e5['change'](_0x5ce7cc=>{_0x5ce7cc['removeMarker'](u);});}['insertContent'](_0x30d0d0,_0x4334b0){const _0x8b36dc=_0x4334b0||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x8b36dc))return;const _0x234926=this['editor']['data']['processor']['toView'](_0x30d0d0),_0x54e64a=this['editor']['data']['toModel'](_0x234926);this['editor']['model']['change'](_0x4e9a88=>{this['hideFakeVisualSelection']();const _0x139de4=this['editor']['model']['insertContent'](_0x54e64a,_0x8b36dc);_0x139de4&&_0x4e9a88['setSelection'](_0x139de4);});}['insertContentBelow'](_0x597d68){const {model:_0x28c994}=this['editor'],_0x35a59a=Array['from'](_0x28c994['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x42f0f3=_0x35a59a['length']?_0x28c994['createPositionAfter'](_0x35a59a['pop']()):_0x28c994['document']['selection']['getLastPosition']();this['insertContent'](_0x597d68,_0x42f0f3);}}class v extends _0x3022e5{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x56fc72('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1fbbd0){super(_0x1fbbd0),this['name']='AIRequestError';}}function i(_0x170ed3,_0x421082,_0x432e16){const t=_0x170ed3['t'];switch(_0x421082){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',_0x432e16);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x432e16);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'},_0x432e16);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 _0x421082;}}class y extends _0x389b0a{['_commandDefinitions'];constructor(_0x4cf200,_0x4094eb){super(_0x4cf200),this['_commandDefinitions']=_0x4094eb,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x25fa38,_0x2cdfbb,_0xa0e291)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0xa0e291));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x491dfe,_0x82147c,_0x81ee0d)=>{this['enabledCommandsIds']=_0x81ee0d?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0xe88722=this['editor']['model'];this['_hasContext']=function(_0x45fdae){const _0x47e34e=_0x45fdae['document']['selection'];return _0x47e34e['isCollapsed']?0x0!==[..._0x47e34e['getSelectedBlocks']()]['length']&&![..._0x47e34e['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x45fdae['hasContent'](_0x47e34e['getFirstRange']());}(_0xe88722);const _0x1f7440=_0xe88722['document']['selection'],_0x596b1c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1f41ff of _0x1f7440['getRanges']())for(const _0x2ec343 of _0x1f41ff['getItems']())if(_0x2ec343['is']('element')&&_0x596b1c['includes'](_0x2ec343['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x83adec='',_0x1f1220='',_0x45f492='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x83adec,_0x1f1220,_0x45f492);}}function G(_0x369a5f,_0x3d07bd){const _0x2f8eca=new Set();for(const _0x1be6d2 of _0x369a5f['values']())(_0x3d07bd||!0x1===_0x1be6d2['requiresContent'])&&_0x2f8eca['add'](_0x1be6d2['id']);return Array['from'](_0x2f8eca);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x208eeb(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x46cd4b,_0x1293ce,_0x4a8cf0){super(),this['editor']=_0x46cd4b,this['textAdapter']=_0x1293ce,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x4a8cf0,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x49866d,_0x1c9fb2,_0x5a6ec7)=>{this['view']['value']=this['_sanitizeHTML'](_0x5a6ec7);}),this['listenTo'](this['view'],'submitPrompt',(_0x3f4c23,_0x59a868)=>{const _0x29af0c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x59a868,_0x29af0c,'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:_0x2c238b,query:_0x268b98,htmlContent:_0x320325,label:_0x595969,mainActionLabel:_0x46a4f9}){this['view']['prompt']=_0x595969,this['view']['mainAction']=_0x46a4f9,this['initialContext']=_0x320325,_0x268b98&&(this['view']['isRendered']?this['_handleQuery'](_0x268b98,_0x320325,_0x2c238b,_0x595969):this['view']['once']('render',()=>{this['_handleQuery'](_0x268b98,_0x320325,_0x2c238b,_0x595969);}));}['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'](_0x22fbdb,_0x13baf6,_0x55836a,_0x4d063d){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x13baf6,this['previousQuery']=_0x22fbdb,this['previousLabel']=_0x4d063d||_0x22fbdb,this['previousActionId']=_0x55836a,new Promise(_0xb58824=>{this['textAdapter']['makeRequest']({'query':_0x22fbdb,'context':_0x13baf6,'onData':_0x1d1eeb=>{this['currentResponse']=_0x1d1eeb,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x55836a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x317155=>{_0x317155 instanceof R?this['view']['handleError'](_0x317155['message']):this['view']['handleError'](),_0xb58824();})['finally'](()=>{this['stopProcessing'](),_0xb58824();});});}['_parseAndNormalizeContent'](_0x2716dd,_0x398dcd=!0x1){const _0x20fbd1=Z['exec'](_0x2716dd);_0x2716dd=_0x20fbd1?_0x2716dd['substring'](_0x20fbd1[0x1]['length']):_0x2716dd['length']<0x64&&!_0x398dcd?'':this['_stripMarkdownSyntax'](_0x2716dd);const _0xbd95c3=this['_domParser']['parseFromString'](_0x2716dd,'text/html');if(_0x20fbd1){const _0x1daa8f=Array['from'](_0xbd95c3['body']['childNodes']);_0x1daa8f['reverse']();for(const _0x19a2d5 of _0x1daa8f){if(_0x19a2d5['nodeType']==Node['ELEMENT_NODE'])break;_0x19a2d5['remove']();}}const _0x25aeb2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0xbd95c3['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x25aeb2),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x25aeb2));}['_normalizeResponseHeadings'](_0x2b7d4c){const _0x3e191f=new _0x47ff33(this['editor']['editing']['view']['document']),_0x42f196=new _0x15d9c7({'name':/^h[1-5]$/}),_0x5b2b9f=[];let _0x59c963=!0x1;for(const _0x86193 of _0x2b7d4c)_0x86193['is']('element')&&_0x42f196['match'](_0x86193)&&(_0x5b2b9f['push'](_0x86193),'h1'==_0x86193['name']&&(_0x59c963=!0x0));if(_0x59c963){for(const _0x252ddb of _0x5b2b9f)_0x3e191f['rename']('h'+(parseInt(_0x252ddb['name'][0x1])+0x1),_0x252ddb);}}['_isH1TagSupportEnabled'](){const {data:_0x1af699,editing:_0x3bd200}=this['editor'],_0x38eef0=_0x1af699['htmlProcessor']['toView']('<h1></h1>'),_0x44c5e3=_0x1af699['toView'](_0x1af699['toModel'](_0x38eef0));return!!_0x3bd200['view']['domConverter']['viewToDom'](_0x44c5e3)['querySelector']('h1');}['_sanitizeHTML'](_0x16e44d){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x16e44d),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x450fa9){const _0x4220ca=_0x450fa9['trim']();return _0x4220ca['startsWith']('```html')?_0x4220ca['endsWith']('```')?_0x4220ca['substring'](0x7,_0x4220ca['length']-0x3):_0x4220ca['substring'](0x7):_0x450fa9;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x42643a){super(_0x42643a),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x287f64=>i(_0x42643a,'AI_'+_0x287f64['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x42643a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x42643a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x42643a,'Stop'));const _0x455967=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x455967['if']('isVisible','ck-hidden',_0x16acfc=>!_0x16acfc)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3368e8,_0x31ef0d){const _0xe115b4=new _0x526107(this['locale']);return _0xe115b4['set']({'label':_0x3368e8,'class':_0x31ef0d||'','isVisible':!0x0,'withText':!0x0}),_0xe115b4;}}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 _0x3a7ede{['contentFieldView'];['copyButtonView'];constructor(_0x3fc3a3,_0x3dabe1=''){super(_0x3fc3a3),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x48777a=this['bindTemplate'];this['contentFieldView']=new ct(_0x3fc3a3,_0x3dabe1),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x48777a['if']('isVisible','ck-hidden',_0x374ce3=>!_0x374ce3)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x48777a['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 _0x332978=!0x1;this['on']('change:value',(_0x52bdc3,_0x42c975,_0x13a66e)=>{const _0x318091=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x13a66e),this['isProcessing']&&_0x318091&&!_0x332978&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x33c690,_0x28dbe0,_0x14808f)=>{_0x332978=!0x1,_0x14808f?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x332978=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x332978=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x471aee=this['locale'],_0x5a50ce=new _0x526107(this['locale']),_0x40ec43='ck-ai-form__copy-button';return _0x5a50ce['set']({'label':i(_0x471aee,'Copy'),'icon':U,'class':_0x40ec43,'tooltip':!0x0}),_0x5a50ce['bind']('isVisible')['to'](this,'value',_0x3cf238=>!!_0x3cf238),_0x5a50ce['bind']('isEnabled')['to'](this,'isProcessing',_0x1dfc9c=>!_0x1dfc9c),_0x5a50ce['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5a50ce['icon']=_0x3ce81c['check'],_0x5a50ce['class']=_0x40ec43+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5a50ce['icon']=U,_0x5a50ce['class']=_0x40ec43;},0x3e8);}),_0x5a50ce;}['_copyHTMLToClipboard'](_0x220e15){const {window:_0x11cfaf,document:_0x4c10f8}=_0x14a159;if(_0x11cfaf['ClipboardItem']){const {Blob:_0x378afc,ClipboardItem:_0x5b168e}=_0x11cfaf,_0x49f2c9=[new _0x5b168e({'text/html':new _0x378afc([_0x220e15['innerHTML']],{'type':'text/html'}),'text/plain':new _0x378afc([_0x220e15['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x49f2c9);}else{const _0x13f120=_0x4c10f8['createElement']('div');_0x13f120['style']['position']='absolute',_0x13f120['style']['left']='-9999px',_0x13f120['innerHTML']='<span>[</span>'+_0x220e15['innerHTML']+'<span>]</span>',_0x4c10f8['body']['appendChild'](_0x13f120);const _0x231125=_0x4c10f8['createRange']();_0x231125['setStartAfter'](_0x13f120['firstElementChild']),_0x231125['setEndBefore'](_0x13f120['lastElementChild']);const _0x299e66=_0x11cfaf['getSelection']();_0x299e66['removeAllRanges'](),_0x299e66['addRange'](_0x231125),_0x4c10f8['execCommand']('copy'),_0x13f120['remove']();}}}class ct extends _0x3a7ede{constructor(_0x49749e,_0x1db0f8=''){super(_0x49749e),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1db0f8,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xa07cd0){this['element']['innerHTML']=_0xa07cd0;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4f1f03=new _0x3a7ede(),_0x559f66=this['locale'],_0x3e2cfc=new _0x5d5f7a();return _0x3e2cfc['isVisible']=!0x0,_0x4f1f03['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3e2cfc,{'text':i(_0x559f66,'AI\x20is\x20writing...')}]}),_0x4f1f03['render'](),_0x4f1f03;}}class tt extends _0x3a7ede{constructor(_0x3f885c,_0x551d56=''){super(_0x3f885c);const _0x1b1fc7=new _0x5964f5(),_0xdc6f98=this['bindTemplate'];this['set']('text',_0x551d56),_0x1b1fc7['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':[_0x1b1fc7,{'text':_0xdc6f98['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0xf01e20,_0x3b0e92){super(_0xf01e20,_0x3b0e92),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',(_0x54b067,_0x1ca1e3)=>{_0x54b067['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1ca1e3());});}['_createSubmitButton'](){const _0x43e2c4=new _0x526107(this['locale']),_0x57786b=this['locale'];return _0x43e2c4['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(_0x57786b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x43e2c4['on']('execute',()=>{this['submit']();}),_0x43e2c4['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1ca1fd,_0x397b3e)=>!_0x1ca1fd&&_0x397b3e),_0x43e2c4;}['_createShowHistoryButton'](){const _0x28ac0c=new _0x526107(this['locale']),_0x20b948=this['resultsView'],_0x40c51e=this['locale'];_0x28ac0c['set']({'label':i(_0x40c51e,'History'),'withText':!0x1,'icon':_0x3ce81c['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x28ac0c['bind']('isOn')['to'](_0x20b948,'isVisible'),_0x28ac0c['bind']('isEnabled')['to'](this,'isEnabled'),_0x28ac0c['on']('execute',()=>{_0x20b948['isVisible']=!_0x20b948['isVisible'],_0x20b948['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4f91ea=()=>{_0x14a159['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x31d253=new st(this['queryView']['fieldView']['element']),_0x2d0ac7=_0x31d253['width'],_0x1e5029='rtl'===_0x40c51e['uiLanguageDirection']?'left':'right';_0x31d253['excludeScrollbarsAndBorders'](),_0x28ac0c['element']['style'][_0x1e5029]=_0x2d0ac7-_0x31d253['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4f91ea),this['on']('render',_0x4f91ea),_0x28ac0c;}['submit'](){const _0x7a45fa=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x7a45fa);}['focus'](_0x10f9f0){-0x1===_0x10f9f0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x200753){super(_0x200753),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x200753,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x250651=0x0;for(const _0xb9f89b of this['items'])_0x250651+=_0xb9f89b['items']['length'];return{'resultsCount':_0x250651,'totalItemsCount':_0x250651};}['_createClearHistoryButton'](){const _0x301b8f=this['locale'],_0x11c7ea=new _0x526107(this['locale']);return _0x11c7ea['set']({'label':'('+i(_0x301b8f,'Clear')+')','withText':!0x0}),_0x11c7ea['on']('execute',()=>this['fire']('clearHistory')),_0x11c7ea;}}class hs extends _0x45dba1{constructor(_0x28b272){super();const _0x327b39=new te(),_0xcfaf5a=new _0x526107(this['locale'],_0x327b39);this['children']['add'](_0xcfaf5a),_0xcfaf5a['set']({'label':_0x28b272['prompt'],'withText':!0x0}),_0xcfaf5a['on']('execute',()=>{this['fire']('execute',{'value':_0x4ad890(_0x28b272['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x514d77{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2026c3,_0xeaee2a)=>{const _0x56e4f2=Ss(_0xeaee2a['prompt']);for(const _0x1a22cf of this)if(_0x1a22cf!=_0xeaee2a&&Ss(_0x1a22cf['prompt'])===_0x56e4f2){this['remove'](_0x1a22cf);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x49489d=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x49489d));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x39f60b=>_0x39f60b)));}}function Ss(_0x2a5b42){return _0x2a5b42['toLowerCase']()['trim']();}class K extends _0x3a7ede{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x28ab1c,_0x28e794,_0xc5d400=''){super(_0x28ab1c),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(_0x28ab1c),this['contentArea']=new W(_0x28ab1c,_0xc5d400),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 _0x59087d(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x20e712({'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 _0x2d96cc=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x28e794],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2d96cc['if']('isError','ck-hidden',_0x109a04=>!_0x109a04)]},'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'](_0x4593e3=0x1){-0x1===_0x4593e3?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 _0x42105c=this['locale'],_0x468e10=new ht(_0x42105c,{'queryView':{'label':i(_0x42105c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x18877e,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x42105c,'Empty\x20history'),'secondary':i(_0x42105c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x468e10['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x34a605,_0xa89a98)=>_0x34a605&&!_0xa89a98),this['listenTo'](_0x468e10,'submit',(_0x3af9b9,_0x3b48ac)=>{this['prompt']=_0x3b48ac;const _0x481476=_0x1f8928(_0x3b48ac);this['fire']('submitPrompt',_0x481476),_0x3b48ac['trim']()&&this['_promptHistory']['add']({'prompt':_0x481476},0x0);},{'priority':'high'}),_0x468e10;}['_createHistoryView'](){const _0xfd1e4=new rs(this['locale']);return _0xfd1e4['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0xfd1e4['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xfd1e4;}['_createToolbar'](){const _0x32f965=new nt(this['locale']);return _0x32f965['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3e047f,_0xd2ccae,_0x6ff74f)=>_0x3e047f&&!_0xd2ccae&&!!_0x6ff74f),_0x32f965['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x32f965['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x49eb30,_0x1a5ef2,_0x1ef3f5)=>_0x49eb30&&!_0x1a5ef2&&!!_0x1ef3f5),_0x32f965['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x32f965['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x318305,_0x508b8f)=>_0x318305&&!_0x508b8f),_0x32f965['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x32f965['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x32f965['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x32f965;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x46db22=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x46db22,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x17c2c4){const _0x214e41=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x17c2c4||i(_0x214e41,'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 _0x3022e5{['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[_0x1e154b,a,v,_0x35fe77];}constructor(_0x2ed799){super(_0x2ed799),_0x2ed799['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2ed799['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2ed799['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2ed799['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x46266e}=this;this['_aiAdapter']=_0x46266e['plugins']['get'](v),this['_dialog']=_0x46266e['plugins']['get'](_0x35fe77),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x321c2f=new y(_0x46266e,Array['from'](this['_commandDefinitions']['values']()));_0x46266e['commands']['add']('showAIAssistant',_0x321c2f),_0x46266e['ui']['componentFactory']['add']('aiCommands',_0x1a451b=>{const _0xfb3683=_0x431174(_0x1a451b);return _0xfb3683['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xfb3683['buttonView']['set']({'label':i(_0x1a451b,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0xfb3683['on']('execute',_0x3b4ca3=>this['_onExecute'](_0x3b4ca3['source']['id'])),_0x550a9a(_0xfb3683,_0x46266e['ui']['view']['body'],function(_0xac161f){const _0x4674ac=o(_0xac161f['config']['get']('ai.aiAssistant.commands'),_0xac161f['locale']),_0x562011=B(_0xac161f,_0x4674ac)['filter'](_0x2d57db=>_0x2d57db['commands']['length']);if(0x1===_0x562011['length'])return B(_0xac161f,_0x562011[0x0]['commands'])['map'](_0x2c94ff=>({'id':_0x2c94ff['id'],'label':_0x2c94ff['label']}));return _0x562011['map'](_0x2f77e7=>{const {groupId:_0x4e85c8,groupLabel:_0xa2eae1,commands:_0x2d0c23}=_0x2f77e7,_0x3dc048=B(_0xac161f,_0x2d0c23)['map'](_0x47b742=>({'id':_0x47b742['id'],'label':_0x47b742['label']}));return{'id':_0x4e85c8,'menu':_0xa2eae1||_0x4e85c8,'children':_0x3dc048};});}(_0x46266e),{'ariaLabel':i(_0x1a451b,'AI\x20Commands')}),_0xfb3683['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x321c2f['on']('change:enabledCommandsIds',_0x780f04),_0xfb3683['menuView']['once']('render',_0x780f04),_0xfb3683;function _0x780f04(){_0xfb3683['isEnabled']=_0x321c2f['enabledCommandsIds']['length']>0x0;for(const _0x513b6b of _0xfb3683['menuView']['buttons'])_0x513b6b['isEnabled']=_0x321c2f['enabledCommandsIds']['includes'](_0x513b6b['id']);}}),_0x46266e['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1af708=>{const _0x3355c4=new _0x4e8ddc(_0x1af708);_0x3355c4['buttonView']['set']({'label':i(_0x1af708,'AI\x20Commands'),'icon':E}),_0x3355c4['bind']('isEnabled')['to'](_0x321c2f,'enabledCommandsIds',_0x54aa47=>_0x54aa47['length']>0x0);const _0x4aa4e5=o(_0x46266e['config']['get']('ai.aiAssistant.commands'),_0x1af708);return this['_populateMenuBarMenu'](_0x321c2f,_0x3355c4,_0x4aa4e5,_0x4578ed=>this['_onExecute'](_0x4578ed)),_0x3355c4;}),_0x46266e['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x57a9f0=this['_createAIAssistantUIButton'](_0x526107);return _0x57a9f0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x57a9f0;}),_0x46266e['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x108599=this['_createAIAssistantUIButton'](_0x263888);return _0x108599['set']({'role':'menuitemcheckbox'}),_0x108599;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xcf70a3=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x126025;for(const _0x155194 in _0xcf70a3){const _0x2111fd=_0x155194,_0x30f1d8=_0xcf70a3[_0x2111fd];if('aiLicenseKeyValid'==_0x30f1d8||'aiLicenseKeyInvalid'==_0x30f1d8||'aiLicenseKeyExpired'==_0x30f1d8||'aiLicenseKeyDomainLimit'==_0x30f1d8||'aiLicenseKeyNotAllowed'==_0x30f1d8||'aiLicenseKeyEvaluationLimit'==_0x30f1d8||'aiLicenseKeyTrialLimit'==_0x30f1d8||'aiLicenseKeyDevelopmentLimit'==_0x30f1d8||'aiLicenseKeyUsageLimit'==_0x30f1d8){delete _0xcf70a3[_0x2111fd],_0x126025=_0x30f1d8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x126025&&_0xcf70a3['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x126025&&_0xcf70a3['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x126025&&_0xcf70a3['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x126025&&_0xcf70a3['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x126025&&_0xcf70a3['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x126025&&_0xcf70a3['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x126025&&_0xcf70a3['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x126025&&_0xcf70a3['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5a596f='',_0x3ae3ea='',_0x284980='custom'){const _0xab8de0=this['editor'],_0x23b186=_0xab8de0['editing']['view'],_0x44942d=_0xab8de0['plugins']['get'](a),_0xf7803e=_0xab8de0['plugins']['get'](_0x1e154b);_0x44942d['showFakeVisualSelection']();const _0xc66e4a=new j(),_0x57c2b4=new ClipboardEvent('copy',{'clipboardData':_0xc66e4a}),_0x3cd4c8=new _0x298556(_0xc66e4a),_0x328b08=new _0xdeb224(_0x23b186,_0x57c2b4,{'dataTransfer':_0x3cd4c8});_0xf7803e['_forceMarkersCopy']('comment',()=>{_0x23b186['document']['fire']('copy',_0x328b08);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0xab8de0,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x174b9c=_0x3cd4c8['getData']('text/html');const _0x35eb9e=_0xab8de0['model']['document']['selection'],_0x2cb130=Array['from'](_0x35eb9e['getRanges']());0x1===_0x2cb130['length']&&_0x2cb130[0x0]['isFlat']&&!_0x35eb9e['getSelectedElement']()&&''!==_0x174b9c['replace'](/ /g,'')['trim']()&&(_0x174b9c='<p>'+_0x174b9c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x284980,'query':_0x5a596f,'htmlContent':_0x174b9c,'label':_0x3ae3ea,'mainActionLabel':x[_0xab8de0['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':_0x24b88d['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x44942d['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3bfa60=new Map(),_0x2b8d4e=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4ba982 of _0x2b8d4e)for(const _0x29eeaa of _0x4ba982['commands'])_0x3bfa60['set'](_0x29eeaa['id'],{..._0x29eeaa,'groupId':_0x4ba982['groupId'],'groupLabel':_0x4ba982['groupLabel']||_0x4ba982['groupId']});return _0x3bfa60;}['_createAIAssistantUIButton'](_0x5497ba){const _0x4093ea=this['editor'],_0xb2ef1d=_0x4093ea['commands']['get']('showAIAssistant'),_0x1b3473=new _0x5497ba(_0x4093ea['locale']);return _0x1b3473['set']({'label':i(_0x4093ea['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x1b3473['bind']('isEnabled')['to'](_0xb2ef1d),_0x1b3473['bind']('isOn')['to'](this['_dialog'],'id',_0x2aa1bf=>'aiAssistant'===_0x2aa1bf),this['listenTo'](_0x1b3473,'execute',()=>{_0x1b3473['isOn']?this['hideUI']():_0xb2ef1d['execute']();}),_0x1b3473;}['_initView'](){const _0x1c6e5c=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',()=>{_0x1c6e5c['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x1c6e5c['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x44a20d,ui:{ariaLiveAnnouncer:_0x45dbcc}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xf414a7,_0x54bb71,_0x44699e)=>{const _0x5e83e6=this['_aiAssistantController']['currentContext'];_0x44699e?_0x45dbcc['announce'](i(_0x44a20d,'AI\x20is\x20writing')):_0x5e83e6&&_0x45dbcc['announce'](i(_0x44a20d,'Generated\x20content:\x20%0',_0x5e83e6),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0xcb672d,_0x393240,_0x535081)=>{if(_0x535081){const _0xae8290=this['_formView']['errorView']['text'];_0x45dbcc['announce'](i(_0x44a20d,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xae8290));}});}['_onExecute'](_0xfc48e9){const _0x5e33e4=this['_commandDefinitions']['get'](_0xfc48e9),_0x59c55f=this['editor'],_0x2863af=_0x59c55f['model']['document']['selection'],_0x9fe625=_0x59c55f['commands']['get']('showAIAssistant'),_0x2b233e=_0x59c55f['plugins']['get'](a),_0x385477=''+(_0x5e33e4['groupId']!==I?_0x5e33e4['groupLabel']+':\x20':'')+_0x5e33e4['label'];if(!0x1!==_0x5e33e4['requiresContent']&&_0x2863af['isCollapsed']){const _0x17780b=_0x57197e(_0x2863af['getSelectedBlocks']())||_0x59c55f['model']['schema']['getLimitElement'](_0x2863af);_0x59c55f['model']['change'](_0x4b8440=>{_0x4b8440['setSelection'](_0x17780b,'in');});}_0x2b233e['showFakeVisualSelection'](),_0x9fe625['execute'](_0x5e33e4['prompt'],_0x385477,'command:'+_0xfc48e9);}['_populateMenuBarMenu'](_0x45fb28,_0x2b741,_0x3d31d6,_0x1d0ebd){const _0x439312=this['editor'],_0x428fc2=_0x439312['locale'],_0x1d9e79=new _0x47a773(_0x428fc2),_0x36da34=B(_0x439312,_0x3d31d6)['filter'](_0x159e0f=>_0x159e0f['commands']['length']);0x1===_0x36da34['length']?this['_getMenuBarGroupButtons']({'command':_0x45fb28,'commands':_0x36da34[0x0]['commands'],'parentMenuView':_0x2b741,'onExecute':_0x1d0ebd})['forEach'](_0x3d20ef=>_0x1d9e79['items']['add'](_0x3d20ef)):_0x36da34['forEach'](({groupId:_0x3d3cc2,groupLabel:_0x34734a,commands:_0x564618})=>{const _0x4d9ca5=new _0x130bb1(_0x428fc2,_0x2b741),_0x37fbad=new _0x4e8ddc(_0x428fc2),_0x4b3170=new _0x47a773(_0x428fc2),_0x344145=this['_getMenuBarGroupButtons']({'command':_0x45fb28,'commands':_0x564618,'parentMenuView':_0x37fbad,'onExecute':_0x1d0ebd});_0x37fbad['buttonView']['set']({'label':_0x34734a||_0x3d3cc2}),_0x37fbad['delegate']('execute')['to'](_0x2b741),_0x4b3170['items']['addMany'](_0x344145),_0x37fbad['panelView']['children']['add'](_0x4b3170),_0x4d9ca5['children']['add'](_0x37fbad),_0x1d9e79['items']['add'](_0x4d9ca5);}),_0x2b741['panelView']['children']['add'](_0x1d9e79);}['_getMenuBarGroupButtons']({command:_0x51a719,commands:_0x3f6284,parentMenuView:_0x110149,onExecute:_0x60c294}){const _0xaaf946=this['editor'],_0x1b6e3a=_0xaaf946['locale'];return B(_0xaaf946,_0x3f6284)['map'](_0x434e24=>{const _0x2bf513=new _0x130bb1(_0x1b6e3a,_0x110149),_0x532ee0=new _0x263888(_0x1b6e3a);return _0x532ee0['set']({'label':_0x434e24['label']}),_0x532ee0['delegate']('execute')['to'](_0x110149),_0x532ee0['on']('execute',()=>_0x60c294(_0x434e24['id'])),_0x532ee0['bind']('isEnabled')['to'](_0x51a719,'enabledCommandsIds',_0x4db2c0=>_0x4db2c0['includes'](_0x434e24['id'])),_0x2bf513['children']['add'](_0x532ee0),_0x2bf513;});}}function _(_0x46423e,_0x3661ca){return void 0x0!==_0x46423e['order']&&void 0x0===_0x3661ca['order']?0x1:void 0x0===_0x46423e['order']&&void 0x0!==_0x3661ca['order']?-0x1:void 0x0!==_0x46423e['order']&&void 0x0!==_0x3661ca['order']?_0x46423e['order']-_0x3661ca['order']:0x0;}function B(_0x52a025,_0x46ed38){_0x46ed38['sort'](_);const _0x448c0b={},_0x92977=[];for(const _0x288907 of _0x46ed38)if(void 0x0!==_0x288907['order']){if(_0x288907['order']in _0x448c0b)throw new _0x56fc72('ai-commands-config-order-collision',_0x52a025,{'conflictingDefinitions':[_0x288907,_0x448c0b[_0x288907['order']]]});_0x448c0b[_0x288907['order']]=_0x288907,_0x92977['splice'](_0x288907['order'],0x0,_0x288907);}else _0x92977['push'](_0x288907);return _0x92977;}class r extends _0x3022e5{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x43ed30){super(_0x43ed30);const _0x87b914=_0x43ed30['config'],_0x592858=_0x43ed30['locale'];_0x87b914['define']('ai.aiAssistant.commands',function(_0x171aa1){return[{'groupId':'editOrReview','groupLabel':i(_0x171aa1,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x171aa1,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x171aa1,'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(_0x171aa1,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x171aa1,'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(_0x171aa1,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x171aa1,'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(_0x171aa1,'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(_0x171aa1,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x171aa1,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x171aa1,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x171aa1,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x171aa1,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x171aa1,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x171aa1,'Change\x20style'),'commands':[{'id':'business','label':i(_0x171aa1,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x171aa1,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x171aa1,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x171aa1,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x171aa1,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x171aa1,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x171aa1,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x171aa1,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x171aa1,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x171aa1,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x171aa1,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x171aa1,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x171aa1,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x592858)),_0x87b914['define']('ai.aiAssistant.extraCommandGroups',[]),_0x87b914['define']('ai.aiAssistant.removeCommands',[]);const _0x88dbe2=o(_0x87b914['get']('ai.aiAssistant.commands'),_0x592858),_0x1e733b=_0x87b914['get']('ai.aiAssistant.extraCommandGroups'),_0x2a9dce=_0x87b914['get']('ai.aiAssistant.removeCommands');_0x1e733b['forEach'](_0x27a9d0=>{const _0x5f0ac3=_0x88dbe2['find'](_0x28e7fe=>_0x28e7fe['groupId']===_0x27a9d0['groupId']);_0x5f0ac3?_0x5f0ac3['commands']=_0x5f0ac3['commands']['concat'](_0x27a9d0['commands']):_0x88dbe2['push'](_0x27a9d0);}),_0x88dbe2['forEach'](_0x49100f=>{_0x49100f['commands']=_0x49100f['commands']['filter'](_0x9c2e3b=>!_0x2a9dce['includes'](_0x9c2e3b['id']));}),_0x87b914['set']('ai.aiAssistant.commands',_0x88dbe2);}}class P extends _0x3022e5{['abortController'];static get['requires'](){return[v];}constructor(_0x319a90){super(_0x319a90),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'](_0x41e80a){return this['sendRequest'](_0x41e80a)['catch'](_0xcec9fd=>{if(_0xcec9fd instanceof R)return Promise['reject'](_0xcec9fd);if('AbortError'==_0xcec9fd['name'])return Promise['resolve']();throw console['error'](_0xcec9fd),new _0x56fc72('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x8de585,_0x2db048){const _0x5f8a92=this['editor']['locale'],_0x760b2e={'Content-Type':'application/json'};if('object'==typeof _0x8de585)Object['assign'](_0x760b2e,_0x8de585);else{if(_0x8de585)try{const _0x5618ac=await _0x8de585(_0x2db048);Object['assign'](_0x760b2e,_0x5618ac);}catch(_0x3b3ce8){return Promise['reject'](new R(i(_0x5f8a92,'AI_ERROR_GET_HEADERS')));}}return _0x760b2e;}async['_prepareRequestParameters'](_0x129c19,_0x5c1f22){const _0x1f2e38=this['editor']['locale'];if('object'==typeof _0x129c19)return _0x129c19;try{return await _0x129c19(_0x5c1f22);}catch(_0x13255f){return Promise['reject'](new R(i(_0x1f2e38,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x3d5ceb){super(_0x3d5ceb),_0x3d5ceb['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x3d5ceb['config']['get']('ai.openAI.requestParameters')||_0x3d5ceb['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x3d5ceb['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x3d5ceb['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x3d5ceb['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x293cad,context:_0x5dbeed,onData:_0x44723b,actionId:_0x2316c4}){const _0xae7e3d=this['editor']['locale'],_0xc32603=await this['prepareMessages'](_0x293cad,_0x5dbeed,_0x2316c4),_0xdef794=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2316c4),_0x11eab4=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2316c4),_0x57d47a={'messages':_0xc32603,..._0x11eab4},_0x45c2c5={'method':'POST','headers':_0xdef794,'body':JSON['stringify'](_0x57d47a),'signal':this['abortController']['signal']},_0x178029=await fetch(this['_apiUrl'],_0x45c2c5);if(_0x178029['ok'])return _0x11eab4['stream']?await this['_readStreamableResponse'](_0x178029,_0x44723b):await this['_readStaticResponse'](_0x178029,_0x44723b),Promise['resolve']();{const _0x202817=await _0x178029['text']();return _0x202817['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0xae7e3d,'AI_ERROR_CONTEXT_LENGTH'))):_0x202817['includes']('Moderation')?Promise['reject'](new R(i(_0xae7e3d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x202817));}}async['prepareMessages'](_0x3cbc32,_0x387c0b,_0x3df62e){let _0x23a4c0,_0x1f5a8b;return _0x387c0b?(_0x23a4c0='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.',_0x1f5a8b='Instruction:\x0a'+_0x3cbc32+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x387c0b):(_0x23a4c0='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.',_0x1f5a8b=_0x3cbc32),[{'role':'system','content':_0x23a4c0},{'role':'user','content':_0x1f5a8b}];}async['_readStreamableResponse'](_0xb1b858,_0x414b4a){const _0x3bc62b=_0xb1b858['body']['getReader'](),_0x18e707=new TextDecoder();let _0x5b1396='',_0x5b583c='',_0x2f4b3b='',_0x4616b5=!0x1;for(;!_0x4616b5;){const {done:_0x27efc9,value:_0x3fd565}=await _0x3bc62b['read'](),_0xd12b42=_0x5b1396+_0x18e707['decode'](_0x3fd565);let _0x3b1df7='';_0x4616b5=_0x27efc9;try{_0x3b1df7=this['_cleanUpData'](_0xd12b42),_0x5b1396='';}catch(_0x422e3a){_0x5b1396=_0xd12b42;continue;}_0x5b583c+=_0x3b1df7,!_0x4616b5&&this['_isBufferIncomplete'](_0x5b583c)||_0x5b583c&&(_0x2f4b3b+=_0x5b583c,_0x5b583c='',_0x414b4a(_0x2f4b3b));}return Promise['resolve']();}async['_readStaticResponse'](_0x2a762e,_0x24c9ed){return _0x24c9ed((await _0x2a762e['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x17a7ea){const _0x19a98d=_0x17a7ea['split']('<')['length']!==_0x17a7ea['split']('>')['length'],_0x5382e6=_0x17a7ea['length']<0x1e;return _0x19a98d&&_0x5382e6;}['_cleanUpData'](_0xd80bad){return _0xd80bad['split'](/\n(?![^{]*\})/g)['map'](_0xf225ab=>_0xf225ab['replace']('data:\x20',''))['filter'](_0x33b62d=>_0x33b62d&&_0x33b62d['length']>0x0&&'[DONE]'!==_0x33b62d)['map'](_0x3dc6f7=>{const {choices:_0x5ca111}=JSON['parse'](_0x3dc6f7);if(_0x5ca111[0x0]&&_0x5ca111[0x0]['delta']&&_0x5ca111[0x0]['delta']['content'])return _0x5ca111[0x0]['delta']['content'];})['filter'](_0x36b075=>_0x36b075)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x39c778){super(_0x39c778),_0x39c778['config']['get']('ai.aws.requestParameters')||_0x39c778['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']=_0x39c778['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x39c778['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x39c778['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x39c778['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x49a6c5,context:_0x4f7b31,onData:_0x2a725a,actionId:_0x26b60e}){const {model:_0x196182,stream:_0x2d2839,..._0x58f7ac}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x26b60e),_0x29a641={'prompt':await this['preparePrompt'](_0x49a6c5,_0x4f7b31,_0x196182,_0x26b60e),..._0x58f7ac};this['_apiUrl']?await this['_processProxyRequest'](_0x29a641,_0x196182,_0x2d2839,_0x2a725a,_0x26b60e):await this['_processAWSRequest'](_0x29a641,_0x196182,_0x2d2839,_0x2a725a);}async['preparePrompt'](_0x2a6adf,_0x356926,_0xe477d2,_0x2d025e){let _0x801a06,_0x10a822;return _0x356926?(_0x801a06='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.',_0x10a822='Instruction:\x0a'+_0x2a6adf+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x356926):(_0x801a06='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.',_0x10a822=_0x2a6adf),'meta.llama'==this['getModelFamily'](_0xe477d2)?'<<SYS>>\x0a'+_0x801a06+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x10a822+'\x0a[/INST]':'Human:\x0a'+_0x801a06+'\x0a'+_0x10a822+'\x0a\x0aAssistant:';}['getModelFamily'](_0x4d9797){if(/^anthropic\.claude/['test'](_0x4d9797))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x4d9797))return'ai21.j2';if(/^cohere\.command/['test'](_0x4d9797))return'cohere.command';if(/^meta\.llama/['test'](_0x4d9797))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x4d9797));}async['_processProxyRequest'](_0xb44ff2,_0x21ba95,_0x7cd2bb,_0x3fd486,_0x4dce7a){const _0x389580={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4dce7a),'body':JSON['stringify']({..._0xb44ff2,'model':_0x21ba95,'stream':_0x7cd2bb}),'signal':this['abortController']['signal']},_0x4bf3f9=await fetch(this['_apiUrl'],_0x389580);_0x7cd2bb?await this['_readStreamableResponse'](_0x4bf3f9,_0x21ba95,_0x3fd486):await this['_readStaticResponse'](_0x4bf3f9,_0x21ba95,_0x3fd486);}async['_processAWSRequest'](_0x25227b,_0x321117,_0x29c827,_0x320c03){const _0x370cdb=new _0x3dc65e(this['_bedrockClientConfig']),_0x451b83={'body':JSON['stringify'](_0x25227b),'contentType':'application/json','accept':'application/json','modelId':_0x321117};let _0x1ed955;if(_0x29c827){const _0x4f5694=new _0x232e61(_0x451b83);_0x1ed955=await _0x370cdb['send'](_0x4f5694,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1ed955,_0x321117,_0x320c03);}else{const _0x2111c6=new _0x3674a1(_0x451b83);_0x1ed955=await _0x370cdb['send'](_0x2111c6,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1ed955,_0x321117,_0x320c03);}}async['_readAsyncIterableResponse'](_0x294a14,_0x3baad3,_0x2a3139){const _0x8a43ab=_0x294a14['body'],_0x3b85b8=new TextDecoder('utf-8');let _0x35453b='';for await(const _0x3f22e0 of _0x8a43ab)if(_0x3f22e0['chunk']){const _0x34531b=_0x3b85b8['decode'](_0x3f22e0['chunk']['bytes']),_0x16ba11=JSON['parse'](_0x34531b);_0x35453b+=this['_getGeneratedText'](_0x16ba11,_0x3baad3),_0x2a3139(_0x35453b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4b6bf5,_0x400ffe,_0x1acb1a){const _0x38436b=_0x4b6bf5['body'],_0x4ecc0a=new TextDecoder('utf-8'),_0x1dfd52=_0x38436b['getReader']();let _0x4277e3='',_0x49caa8='',_0x59bf37=!0x1;for(;!_0x59bf37;){const {done:_0x501c73,value:_0x43ee08}=await _0x1dfd52['read']();if(_0x59bf37=_0x501c73,_0x59bf37)break;const _0x54ba96=(_0x4277e3+_0x4ecc0a['decode'](_0x43ee08))['split']('\x0a')['map'](_0xec60ba=>{try{return _0x4277e3='',JSON['parse'](_0xec60ba);}catch(_0x4357a0){return _0x4277e3=_0xec60ba,null;}})['filter'](_0x4ba142=>null!==_0x4ba142);_0x54ba96['length']&&(_0x49caa8+=_0x54ba96['map'](_0x284f98=>this['_getGeneratedText'](_0x284f98,_0x400ffe))['join'](''),_0x1acb1a(_0x49caa8));}return Promise['resolve']();}async['_readStaticResponse'](_0x1b9b94,_0x3f5057,_0xb5e1b){let _0x1edd34;return _0x1edd34=_0x1b9b94 instanceof Response?await _0x1b9b94['json']():JSON['parse'](Buffer['from'](_0x1b9b94['body'])['toString']('utf8')),(_0xb5e1b(this['_getGeneratedText'](_0x1edd34,_0x3f5057)),Promise['resolve']());}['_getGeneratedText'](_0x2d1436,_0xfb93b8){switch(this['getModelFamily'](_0xfb93b8)){case'anthropic.claude':return _0x2d1436['completion'];case'ai21.j2':return _0x2d1436['completions'][0x0]['data']['text'];case'cohere.command':return _0x2d1436['generations'][0x0]['text'];case'meta.llama':return _0x2d1436['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x9b5676,Command as _0x2b77f9,icons as _0xfcef30}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x10ea43,CKEditorError as _0x1d1c02,ObservableMixin as _0xb84f64,global as _0x4d93e5,isVisible as it,Rect as st,Collection as _0x1dae02,FocusTracker as _0x5ae073,KeystrokeHandler as ts,first as _0x2fc08c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x13b904,View as _0x2895c2,SpinnerView as _0x423fa1,IconView as _0x47cc86,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0xb9cdd,ButtonLabelView as te,FocusCycler as _0x44053b,createLabeledTextarea as _0x342d39,Dialog as _0x10fb15,createDropdown as _0xd88fe7,addMenuToDropdown as _0x317d6f,MenuBarMenuView as _0x205268,MenuBarMenuListItemButtonView as _0x41d820,DialogViewPosition as _0x23c187,MenuBarMenuListView as _0x5edf2b,MenuBarMenuListItemView as _0x5302fc}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x15d6b0,Matcher as _0xabe594,DataTransfer as _0x49af1b,DomEventData as _0x499e62}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x3044b3,escape as _0x5b29f2}from'lodash-es';import{ClipboardMarkersUtils as _0x33e0ce}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x599b44,InvokeModelWithResponseStreamCommand as _0x3dd78b,InvokeModelCommand as _0x56ece1}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x2c6c86,_0x3db366){const _0x339127=(0x0,_0x3db366['t'])('Other');return _0x2c6c86['length']?'groupId'in _0x2c6c86[0x0]?_0x2c6c86:[{'groupId':I,'groupLabel':_0x339127,'order':0x1/0x0,'commands':_0x2c6c86}]:[{'groupId':I,'groupLabel':_0x339127,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x9b5676{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4b71e8}=this,_0x49361d=['ck-fake-ai-selection'];_0x4b71e8['config']['get']('ai.useTheme')&&_0x49361d['push']('ck-ai-assistant-ui_theme'),_0x4b71e8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x49361d,'priority':0xc}}),_0x4b71e8['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x31a4b1,{writer:_0x41bf85})=>{if(!_0x31a4b1['markerRange']['isCollapsed'])return null;const _0x33b59e=_0x41bf85['createUIElement']('span');return _0x41bf85['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x33b59e),_0x33b59e;}});}['afterInit'](){!async function(_0x1cae89){const _0x39c66b=_0x560dc3([0x52,0x44,0x4c,0x34,0x77,0x54,0x6f,0x39,0x4f,0x58,0x75,0x63,0x6d,0x49,0x69,0x64,0x76,0x70,0x7a,0x5a,0x57,0x32,0x65,0x67,0x45,0x74,0x4b,0x71,0x35,0x6e,0x62,0x4a,0x4d,0x30,0x51,0x38,0x6b,0x6c,0x66,0x53,0x78,0x48,0x42,0x55,0x68,0x72,0x73,0x37,0x79,0x47,0x33,0x41,0x59,0x56,0x6a,0x50,0x43,0x61,0x31,0x4e,0x36,0x46]),_0x55c03a=0x753c239a,_0x270f67=0x753b7462^_0x55c03a,_0x4d4bb0=window[_0x560dc3([0x44,0x61,0x74,0x65])][_0x560dc3([0x6e,0x6f,0x77])](),_0x27db02=_0x1cae89[_0x560dc3([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5663ec=new window[(_0x560dc3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2a8547=>{_0x27db02[_0x560dc3([0x6f,0x6e,0x63,0x65])](_0x560dc3([0x72,0x65,0x61,0x64,0x79]),_0x2a8547);}),_0x529df0={[_0x560dc3([0x6b,0x74,0x79])]:_0x560dc3([0x45,0x43]),[_0x560dc3([0x75,0x73,0x65])]:_0x560dc3([0x73,0x69,0x67]),[_0x560dc3([0x63,0x72,0x76])]:_0x560dc3([0x50,0x2d,0x32,0x35,0x36]),[_0x560dc3([0x78])]:_0x560dc3([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]),[_0x560dc3([0x79])]:_0x560dc3([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]),[_0x560dc3([0x61,0x6c,0x67])]:_0x560dc3([0x45,0x53,0x32,0x35,0x36])},_0x4134db=_0x27db02[_0x560dc3([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x560dc3([0x67,0x65,0x74])](_0x560dc3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5977d5(){let _0x1c86fd,_0x5eeeaf=null,_0x457b1b=null;try{if(_0x4134db==_0x560dc3([0x47,0x50,0x4c]))return _0x560dc3([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1c86fd=_0x1f2bf8(),!_0x1c86fd)return _0x560dc3([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1c86fd[_0x560dc3([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x457b1b=_0x32e1f6(_0x1c86fd[_0x560dc3([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1c86fd[_0x560dc3([0x6a,0x74,0x69])])),await _0x33a4d1()?_0x520df5()?_0x412239()?_0x560dc3([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4e8029()?(_0x1c86fd[_0x560dc3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x560dc3([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5eeeaf=_0x4420db(_0x560dc3([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x1c86fd[_0x560dc3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x560dc3([0x74,0x72,0x69,0x61,0x6c])&&(_0x5eeeaf=_0x4420db(_0x560dc3([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x1c86fd[_0x560dc3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x560dc3([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x5eeeaf=_0x4420db(_0x560dc3([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x538bd8()):_0x560dc3([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x560dc3([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x560dc3([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x1dab55){return _0x560dc3([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x412239(){const _0x376a0f=[_0x560dc3([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x560dc3([0x74,0x72,0x69,0x61,0x6c])][_0x560dc3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1c86fd[_0x560dc3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x4d4bb0/0x3e8:0xe10*_0x270f67;return _0x1c86fd[_0x560dc3([0x65,0x78,0x70])]<_0x376a0f;}function _0x520df5(){const _0x4d1774=_0x1c86fd[_0x560dc3([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4d1774&&(!!_0x4d1774[_0x560dc3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x560dc3([0x2a]))||!!_0x4d1774[_0x560dc3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x560dc3([0x41,0x49])));}function _0x4e8029(){const _0x3bbdd0=_0x1c86fd[_0x560dc3([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3bbdd0||0x0==_0x3bbdd0[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x31142f}=new URL(window[_0x560dc3([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3bbdd0[_0x560dc3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x31142f))return!0x0;const _0x1e2d34=_0x31142f[_0x560dc3([0x73,0x70,0x6c,0x69,0x74])](_0x560dc3([0x2e]));return _0x3bbdd0[_0x560dc3([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4f62ab=>_0x4f62ab[_0x560dc3([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x560dc3([0x2a])))[_0x560dc3([0x6d,0x61,0x70])](_0x5686d8=>_0x5686d8[_0x560dc3([0x73,0x70,0x6c,0x69,0x74])](_0x560dc3([0x2e])))[_0x560dc3([0x73,0x6f,0x6d,0x65])](_0x360613=>_0x1e2d34[_0x560dc3([0x65,0x76,0x65,0x72,0x79])]((_0x329543,_0x52c7ad)=>_0x360613[_0x52c7ad]===_0x329543||_0x360613[_0x52c7ad]===_0x560dc3([0x2a])));}function _0x538bd8(){return _0x5eeeaf&&_0x457b1b?new window[(_0x560dc3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x343773,_0x265e4d)=>{_0x5eeeaf[_0x560dc3([0x74,0x68,0x65,0x6e])](_0x343773,_0x265e4d),_0x457b1b[_0x560dc3([0x74,0x68,0x65,0x6e])](_0x1fa173=>{_0x1fa173!=_0x560dc3([0x56,0x61,0x6c,0x69,0x64])&&_0x343773(_0x1fa173);},_0x265e4d);}):_0x5eeeaf||_0x457b1b||_0x560dc3([0x56,0x61,0x6c,0x69,0x64]);}}function _0x32e1f6(_0x998bfa,_0x45e871){return new window[(_0x560dc3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x50dffc=>{if(_0x2de8cb())return _0x50dffc(_0x560dc3([0x56,0x61,0x6c,0x69,0x64]));_0x3b9271(),_0x27db02[_0x560dc3([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x560dc3([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3ce670=!0x1;const _0x1bde5d=_0x10ea43();function _0x3fa2e9(_0x1ba341){return!!_0x1ba341&&(typeof _0x1ba341===_0x560dc3([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1ba341===_0x560dc3([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1ba341[_0x560dc3([0x74,0x68,0x65,0x6e])]===_0x560dc3([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1ba341[_0x560dc3([0x63,0x61,0x74,0x63,0x68])]===_0x560dc3([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1e521b(_0x20a6c2){_0x5ca0f7(_0x20a6c2)[_0x560dc3([0x74,0x68,0x65,0x6e])](_0x3965b6=>{if(!_0x3965b6||_0x3965b6[_0x560dc3([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x560dc3([0x6f,0x6b]))return _0x560dc3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1d502d(_0x4dcdef(_0x1bde5d+_0x45e871))!=_0x3965b6[_0x560dc3([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x560dc3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x560dc3([0x56,0x61,0x6c,0x69,0x64]);})[_0x560dc3([0x74,0x68,0x65,0x6e])](_0x247b19=>(_0x10ce3a(),_0x247b19),()=>{const _0x412be1=_0x1b4e46();return null==_0x412be1?(_0x10ce3a(),_0x560dc3([0x56,0x61,0x6c,0x69,0x64])):_0x560dc3(_0x4d4bb0-_0x412be1>(0x5130a79a^_0x55c03a)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x560dc3([0x74,0x68,0x65,0x6e])](_0x50dffc)[_0x560dc3([0x63,0x61,0x74,0x63,0x68])](()=>{_0x50dffc(_0x560dc3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xdfbd3d=0x750acd1a^_0x55c03a;function _0x10ce3a(){const _0x5cc94f=_0x560dc3([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d502d(_0x4dcdef(_0x998bfa)),_0x2322a1=_0x50a91b(_0x1d502d(window[_0x560dc3([0x4d,0x61,0x74,0x68])][_0x560dc3([0x63,0x65,0x69,0x6c])](_0x4d4bb0/_0xdfbd3d)));window[_0x560dc3([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x560dc3([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5cc94f,_0x2322a1);}function _0x1b4e46(){const _0x4f1ccb=_0x560dc3([0x6c,0x6c,0x63,0x74,0x2d])+_0x1d502d(_0x4dcdef(_0x998bfa)),_0x4d8ced=window[_0x560dc3([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x560dc3([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4f1ccb);return _0x4d8ced?window[_0x560dc3([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x50a91b(_0x4d8ced),0x10)*_0xdfbd3d:null;}function _0x5ca0f7(_0x162a04){return new window[(_0x560dc3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3eebdd,_0x4e4b73)=>{_0x162a04[_0x560dc3([0x74,0x68,0x65,0x6e])](_0x3eebdd,_0x4e4b73),window[_0x560dc3([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4e4b73,0x753df75a^_0x55c03a);});}}_0x27db02[_0x560dc3([0x6f,0x6e])](_0x560dc3([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x36066c,_0x16dbd)=>{if(_0x16dbd[0x0]!=_0x998bfa)return _0x50dffc(_0x560dc3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x16dbd[0x1]={..._0x16dbd[0x1],[_0x560dc3([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1bde5d};},{[_0x560dc3([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x560dc3([0x68,0x69,0x67,0x68])}),_0x27db02[_0x560dc3([0x6f,0x6e])](_0x560dc3([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x84e61a=>{_0x3fa2e9(_0x84e61a[_0x560dc3([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3ce670=!0x0,_0x1e521b(_0x84e61a[_0x560dc3([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x560dc3([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x560dc3([0x6c,0x6f,0x77])}),_0x5663ec[_0x560dc3([0x74,0x68,0x65,0x6e])](()=>{_0x3ce670||_0x50dffc(_0x560dc3([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x2de8cb(){return _0x27db02[_0x560dc3([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x560dc3([0x76,0x69,0x65,0x77])][_0x560dc3([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x560dc3([0x61,0x75,0x74,0x6f]);}function _0x3b9271(){_0x27db02[_0x560dc3([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x560dc3([0x76,0x69,0x65,0x77])][_0x560dc3([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x560dc3([0x61,0x75,0x74,0x6f]);}}function _0x4420db(_0x331f82){const _0x5a8379=[new window[(_0x560dc3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ae0ae=>setTimeout(_0x3ae0ae,0x75351d56^_0x55c03a)),_0x5663ec[_0x560dc3([0x74,0x68,0x65,0x6e])](()=>new window[(_0x560dc3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x230441=>{let _0x2cf07e=0x0;_0x27db02[_0x560dc3([0x6d,0x6f,0x64,0x65,0x6c])][_0x560dc3([0x6f,0x6e])](_0x560dc3([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x27fdbd,_0x2f29ce)=>{_0x2f29ce[0x0][_0x560dc3([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2cf07e++,_0x2cf07e==(0x753c2262^_0x55c03a)&&(_0x230441(),_0x27fdbd[_0x560dc3([0x6f,0x66,0x66])]());});}))];return window[_0x560dc3([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x560dc3([0x72,0x61,0x63,0x65])](_0x5a8379)[_0x560dc3([0x74,0x68,0x65,0x6e])](()=>_0x331f82);}async function _0x5ec464(){await _0x5663ec,_0x27db02[_0x560dc3([0x6d,0x6f,0x64,0x65,0x6c])][_0x560dc3([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1482ad,_0x27db02[_0x560dc3([0x6d,0x6f,0x64,0x65,0x6c])][_0x560dc3([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1482ad,_0x27db02[_0x560dc3([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x560dc3([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x479e6d(_0x592d5c){const _0xa37ca7=_0x38e15b();_0x27db02[_0xa37ca7]=_0x560dc3([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x592d5c,_0x592d5c!=_0x560dc3([0x56,0x61,0x6c,0x69,0x64])&&_0x5ec464();}function _0x38e15b(){const _0x2f02f0=window[_0x560dc3([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x560dc3([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x560dc3([0x6e,0x6f,0x77])]())[_0x560dc3([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x560dc3([0x2e]),'');let _0x2324e6=_0x560dc3([0x52]);for(let _0x3697fc=0x0;_0x3697fc<_0x2f02f0[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3697fc+=0x2){let _0x27da3d=window[_0x560dc3([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2f02f0[_0x560dc3([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3697fc,_0x3697fc+0x2));_0x27da3d>=_0x39c66b[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x27da3d-=_0x39c66b[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2324e6+=_0x39c66b[_0x27da3d];}return _0x2324e6;}function _0x1f2bf8(){const _0x4bb9d5=_0x4134db[_0x560dc3([0x73,0x70,0x6c,0x69,0x74])](_0x560dc3([0x2e]));if(0x3!=_0x4bb9d5[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x201a62(_0x4bb9d5[0x1]);function _0x201a62(_0x501888){const _0x33d118=_0x507eaa(_0x501888);return _0x33d118&&_0x5f3eae()?_0x33d118:null;function _0x5f3eae(){const _0x559b33=_0x33d118[_0x560dc3([0x6a,0x74,0x69])],_0x2e8164=window[_0x560dc3([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x559b33[_0x560dc3([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x559b33[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x22fddf={..._0x33d118,[_0x560dc3([0x6a,0x74,0x69])]:_0x559b33[_0x560dc3([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x559b33[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x22fddf[_0x560dc3([0x76,0x63])],_0x4dcdef(_0x22fddf)==_0x2e8164;}}}async function _0x33a4d1(){let _0x164db9=!0x0;try{const _0x55c38e=_0x4134db[_0x560dc3([0x73,0x70,0x6c,0x69,0x74])](_0x560dc3([0x2e])),[_0x1a38b2,_0x2f8248,_0x354715]=_0x55c38e;return _0x19b275(_0x1a38b2),await _0x4a665b(_0x1a38b2,_0x2f8248,_0x354715),_0x164db9;}catch(_0x3a7896){return!0x1;}function _0x19b275(_0xf9335f){const _0x1e2caf=_0x507eaa(_0xf9335f);_0x1e2caf&&_0x1e2caf[_0x560dc3([0x61,0x6c,0x67])]==_0x560dc3([0x45,0x53,0x32,0x35,0x36])||(_0x164db9=!0x1);}async function _0x4a665b(_0x258530,_0x18e694,_0xf40a56){const _0x743784=window[_0x560dc3([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x560dc3([0x66,0x72,0x6f,0x6d])](_0x276fbd(_0xf40a56),_0x4d545c=>_0x4d545c[_0x560dc3([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x195405=new window[(_0x560dc3([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x560dc3([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x258530+_0x560dc3([0x2e])+_0x18e694),_0x4c9740=window[_0x560dc3([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x560dc3([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4c9740)return;const _0x95be91=await _0x4c9740[_0x560dc3([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x560dc3([0x6a,0x77,0x6b]),_0x529df0,{[_0x560dc3([0x6e,0x61,0x6d,0x65])]:_0x560dc3([0x45,0x43,0x44,0x53,0x41]),[_0x560dc3([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x560dc3([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x560dc3([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4c9740[_0x560dc3([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x560dc3([0x6e,0x61,0x6d,0x65])]:_0x560dc3([0x45,0x43,0x44,0x53,0x41]),[_0x560dc3([0x68,0x61,0x73,0x68])]:{[_0x560dc3([0x6e,0x61,0x6d,0x65])]:_0x560dc3([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x95be91,_0x743784,_0x195405)||(_0x164db9=!0x1);}}function _0x507eaa(_0x14a001){return _0x14a001[_0x560dc3([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x560dc3([0x65,0x79]))?JSON[_0x560dc3([0x70,0x61,0x72,0x73,0x65])](_0x276fbd(_0x14a001)):null;}function _0x276fbd(_0x2f02b2){return window[_0x560dc3([0x61,0x74,0x6f,0x62])](_0x2f02b2[_0x560dc3([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x560dc3([0x2b]))[_0x560dc3([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x560dc3([0x2f])));}function _0x4dcdef(_0x59c787){let _0x3f8251=0x1505;function _0x1a3bab(_0xb474b8){for(let _0x33a636=0x0;_0x33a636<_0xb474b8[_0x560dc3([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x33a636++){const _0x50f1ce=_0xb474b8[_0x560dc3([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x33a636);_0x3f8251=(_0x3f8251<<0x5)+_0x3f8251+_0x50f1ce,_0x3f8251&=_0x3f8251;}}function _0x304bad(_0x124fd1){Array[_0x560dc3([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x124fd1)?_0x124fd1[_0x560dc3([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x304bad):_0x124fd1&&typeof _0x124fd1==_0x560dc3([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x560dc3([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x124fd1)[_0x560dc3([0x73,0x6f,0x72,0x74])]()[_0x560dc3([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4c72cf,_0x3eb4b7])=>{_0x1a3bab(_0x4c72cf),_0x304bad(_0x3eb4b7);}):_0x1a3bab(window[_0x560dc3([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x124fd1));}return _0x304bad(_0x59c787),_0x3f8251>>>0x0;}function _0x1d502d(_0x54240b){return _0x54240b[_0x560dc3([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x560dc3([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x560dc3([0x30]));}function _0x50a91b(_0x3d204a){return _0x3d204a[_0x560dc3([0x73,0x70,0x6c,0x69,0x74])]('')[_0x560dc3([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x560dc3([0x6a,0x6f,0x69,0x6e])]('');}function _0x1482ad(){}function _0x560dc3(_0xf773cb){return _0xf773cb['map'](_0x1bb235=>String['fromCharCode'](_0x1bb235))['join']('');}_0x479e6d(await _0x5977d5());}(this);}['showFakeVisualSelection'](){const _0x150c86=this['editor']['model'];_0x150c86['change'](_0x71779=>{const _0x52d645=_0x150c86['document']['selection']['getFirstRange']();if(_0x150c86['markers']['has'](u))_0x71779['updateMarker'](u,{'range':_0x52d645});else{if(_0x52d645['start']['isAtEnd']){const _0x296c89=_0x52d645['start']['getLastMatchingPosition'](({item:_0xde9222})=>!_0x150c86['schema']['isContent'](_0xde9222),{'boundaries':_0x52d645});_0x71779['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x71779['createRange'](_0x296c89,_0x52d645['end'])});}else _0x71779['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x52d645});}});}['hideFakeVisualSelection'](){const _0x1c1f8a=this['editor']['model'];_0x1c1f8a['markers']['has'](u)&&_0x1c1f8a['change'](_0x17e078=>{_0x17e078['removeMarker'](u);});}['insertContent'](_0x5d95c5,_0x32e9dc){const _0x10bf3a=_0x32e9dc||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x10bf3a))return;const _0x354773=this['editor']['data']['processor']['toView'](_0x5d95c5),_0x3579cb=this['editor']['data']['toModel'](_0x354773);this['editor']['model']['change'](_0x2b1a29=>{this['hideFakeVisualSelection']();const _0xe99595=this['editor']['model']['insertContent'](_0x3579cb,_0x10bf3a);_0xe99595&&_0x2b1a29['setSelection'](_0xe99595);});}['insertContentBelow'](_0x19bc2b){const {model:_0x597f4d}=this['editor'],_0x292670=Array['from'](_0x597f4d['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x4e3186=_0x292670['length']?_0x597f4d['createPositionAfter'](_0x292670['pop']()):_0x597f4d['document']['selection']['getLastPosition']();this['insertContent'](_0x19bc2b,_0x4e3186);}}class v extends _0x9b5676{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1d1c02('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x578ddf){super(_0x578ddf),this['name']='AIRequestError';}}function i(_0xcd782b,_0x594e4d,_0x26fbb8){const t=_0xcd782b['t'];switch(_0x594e4d){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',_0x26fbb8);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x26fbb8);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'},_0x26fbb8);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 _0x594e4d;}}class y extends _0x2b77f9{['_commandDefinitions'];constructor(_0x418af3,_0x57c5bf){super(_0x418af3),this['_commandDefinitions']=_0x57c5bf,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3b5b6d,_0x3f9ed5,_0x1093cd)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x1093cd));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x17b568,_0xe66ebe,_0x1359fa)=>{this['enabledCommandsIds']=_0x1359fa?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x589ee5=this['editor']['model'];this['_hasContext']=function(_0x446c37){const _0x4ab75e=_0x446c37['document']['selection'];return _0x4ab75e['isCollapsed']?0x0!==[..._0x4ab75e['getSelectedBlocks']()]['length']&&![..._0x4ab75e['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x446c37['hasContent'](_0x4ab75e['getFirstRange']());}(_0x589ee5);const _0x14ff65=_0x589ee5['document']['selection'],_0x38f747=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x5b8bc1 of _0x14ff65['getRanges']())for(const _0x528416 of _0x5b8bc1['getItems']())if(_0x528416['is']('element')&&_0x38f747['includes'](_0x528416['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x25bd34='',_0x22ceac='',_0x2deb6a='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x25bd34,_0x22ceac,_0x2deb6a);}}function G(_0x269617,_0x1bc4c2){const _0x19fed8=new Set();for(const _0x923c83 of _0x269617['values']())(_0x1bc4c2||!0x1===_0x923c83['requiresContent'])&&_0x19fed8['add'](_0x923c83['id']);return Array['from'](_0x19fed8);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0xb84f64(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1698ff,_0x44ed55,_0x384929){super(),this['editor']=_0x1698ff,this['textAdapter']=_0x44ed55,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x384929,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2ab957,_0xe0c08a,_0x102f96)=>{this['view']['value']=this['_sanitizeHTML'](_0x102f96);}),this['listenTo'](this['view'],'submitPrompt',(_0x193c2c,_0x373d6a)=>{const _0xc6dc54=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x373d6a,_0xc6dc54,'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:_0x348785,query:_0x252283,htmlContent:_0x439efb,label:_0x2ac173,mainActionLabel:_0x10ef2f}){this['view']['prompt']=_0x2ac173,this['view']['mainAction']=_0x10ef2f,this['initialContext']=_0x439efb,_0x252283&&(this['view']['isRendered']?this['_handleQuery'](_0x252283,_0x439efb,_0x348785,_0x2ac173):this['view']['once']('render',()=>{this['_handleQuery'](_0x252283,_0x439efb,_0x348785,_0x2ac173);}));}['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'](_0x1eeac9,_0x30617e,_0x2606b9,_0x2821d4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x30617e,this['previousQuery']=_0x1eeac9,this['previousLabel']=_0x2821d4||_0x1eeac9,this['previousActionId']=_0x2606b9,new Promise(_0x2aeb84=>{this['textAdapter']['makeRequest']({'query':_0x1eeac9,'context':_0x30617e,'onData':_0x4b128f=>{this['currentResponse']=_0x4b128f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x2606b9})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x505906=>{_0x505906 instanceof R?this['view']['handleError'](_0x505906['message']):this['view']['handleError'](),_0x2aeb84();})['finally'](()=>{this['stopProcessing'](),_0x2aeb84();});});}['_parseAndNormalizeContent'](_0x57f53f,_0x5c83ea=!0x1){const _0x2f9f29=Z['exec'](_0x57f53f);_0x57f53f=_0x2f9f29?_0x57f53f['substring'](_0x2f9f29[0x1]['length']):_0x57f53f['length']<0x64&&!_0x5c83ea?'':this['_stripMarkdownSyntax'](_0x57f53f);const _0x8c1bdb=this['_domParser']['parseFromString'](_0x57f53f,'text/html');if(_0x2f9f29){const _0x557670=Array['from'](_0x8c1bdb['body']['childNodes']);_0x557670['reverse']();for(const _0x40ef6d of _0x557670){if(_0x40ef6d['nodeType']==Node['ELEMENT_NODE'])break;_0x40ef6d['remove']();}}const _0x4542a2=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x8c1bdb['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4542a2),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x4542a2));}['_normalizeResponseHeadings'](_0x458d84){const _0x133b10=new _0x15d6b0(this['editor']['editing']['view']['document']),_0x327fe2=new _0xabe594({'name':/^h[1-5]$/}),_0x1145da=[];let _0x20fae4=!0x1;for(const _0x3c7418 of _0x458d84)_0x3c7418['is']('element')&&_0x327fe2['match'](_0x3c7418)&&(_0x1145da['push'](_0x3c7418),'h1'==_0x3c7418['name']&&(_0x20fae4=!0x0));if(_0x20fae4){for(const _0x27da2f of _0x1145da)_0x133b10['rename']('h'+(parseInt(_0x27da2f['name'][0x1])+0x1),_0x27da2f);}}['_isH1TagSupportEnabled'](){const {data:_0x38f4c3,editing:_0x44682e}=this['editor'],_0x5f030b=_0x38f4c3['htmlProcessor']['toView']('<h1></h1>'),_0x12ce73=_0x38f4c3['toView'](_0x38f4c3['toModel'](_0x5f030b));return!!_0x44682e['view']['domConverter']['viewToDom'](_0x12ce73)['querySelector']('h1');}['_sanitizeHTML'](_0x4f61c9){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x4f61c9),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xa721fc){const _0xc5b3a5=_0xa721fc['trim']();return _0xc5b3a5['startsWith']('```html')?_0xc5b3a5['endsWith']('```')?_0xc5b3a5['substring'](0x7,_0xc5b3a5['length']-0x3):_0xc5b3a5['substring'](0x7):_0xa721fc;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x26dcb1){super(_0x26dcb1),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x518527=>i(_0x26dcb1,'AI_'+_0x518527['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x26dcb1,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x26dcb1,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x26dcb1,'Stop'));const _0xc8f491=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xc8f491['if']('isVisible','ck-hidden',_0x36976d=>!_0x36976d)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1e9858,_0x28efd1){const _0x44d52c=new _0x13b904(this['locale']);return _0x44d52c['set']({'label':_0x1e9858,'class':_0x28efd1||'','isVisible':!0x0,'withText':!0x0}),_0x44d52c;}}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 _0x2895c2{['contentFieldView'];['copyButtonView'];constructor(_0x49b6dd,_0x46ffae=''){super(_0x49b6dd),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5c040f=this['bindTemplate'];this['contentFieldView']=new ct(_0x49b6dd,_0x46ffae),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5c040f['if']('isVisible','ck-hidden',_0x174bb9=>!_0x174bb9)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5c040f['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 _0x16db8d=!0x1;this['on']('change:value',(_0x20ca54,_0x137c2b,_0x227d6)=>{const _0x3718ce=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x227d6),this['isProcessing']&&_0x3718ce&&!_0x16db8d&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3f6b9e,_0x3f2712,_0x1711cb)=>{_0x16db8d=!0x1,_0x1711cb?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x16db8d=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x16db8d=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3a051f=this['locale'],_0x537f93=new _0x13b904(this['locale']),_0xd07b9='ck-ai-form__copy-button';return _0x537f93['set']({'label':i(_0x3a051f,'Copy'),'icon':U,'class':_0xd07b9,'tooltip':!0x0}),_0x537f93['bind']('isVisible')['to'](this,'value',_0x4d0d3a=>!!_0x4d0d3a),_0x537f93['bind']('isEnabled')['to'](this,'isProcessing',_0x70b154=>!_0x70b154),_0x537f93['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x537f93['icon']=_0xfcef30['check'],_0x537f93['class']=_0xd07b9+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x537f93['icon']=U,_0x537f93['class']=_0xd07b9;},0x3e8);}),_0x537f93;}['_copyHTMLToClipboard'](_0x4d41f6){const {window:_0x51ca8c,document:_0x4c9cbc}=_0x4d93e5;if(_0x51ca8c['ClipboardItem']){const {Blob:_0x1ba171,ClipboardItem:_0xb2439d}=_0x51ca8c,_0x539469=[new _0xb2439d({'text/html':new _0x1ba171([_0x4d41f6['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1ba171([_0x4d41f6['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x539469);}else{const _0x4451d5=_0x4c9cbc['createElement']('div');_0x4451d5['style']['position']='absolute',_0x4451d5['style']['left']='-9999px',_0x4451d5['innerHTML']='<span>[</span>'+_0x4d41f6['innerHTML']+'<span>]</span>',_0x4c9cbc['body']['appendChild'](_0x4451d5);const _0x4dda3c=_0x4c9cbc['createRange']();_0x4dda3c['setStartAfter'](_0x4451d5['firstElementChild']),_0x4dda3c['setEndBefore'](_0x4451d5['lastElementChild']);const _0x33267b=_0x51ca8c['getSelection']();_0x33267b['removeAllRanges'](),_0x33267b['addRange'](_0x4dda3c),_0x4c9cbc['execCommand']('copy'),_0x4451d5['remove']();}}}class ct extends _0x2895c2{constructor(_0x247e2a,_0x543584=''){super(_0x247e2a),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x543584,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x18d6fa){this['element']['innerHTML']=_0x18d6fa;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x589997=new _0x2895c2(),_0x22ed4a=this['locale'],_0x30e5c4=new _0x423fa1();return _0x30e5c4['isVisible']=!0x0,_0x589997['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x30e5c4,{'text':i(_0x22ed4a,'AI\x20is\x20writing...')}]}),_0x589997['render'](),_0x589997;}}class tt extends _0x2895c2{constructor(_0x220b08,_0x16fbec=''){super(_0x220b08);const _0x276f3d=new _0x47cc86(),_0x3a49c1=this['bindTemplate'];this['set']('text',_0x16fbec),_0x276f3d['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':[_0x276f3d,{'text':_0x3a49c1['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x393feb,_0x2d3074){super(_0x393feb,_0x2d3074),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',(_0x6c7c68,_0x120736)=>{_0x6c7c68['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x120736());});}['_createSubmitButton'](){const _0x39537d=new _0x13b904(this['locale']),_0x2a39ad=this['locale'];return _0x39537d['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(_0x2a39ad,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x39537d['on']('execute',()=>{this['submit']();}),_0x39537d['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2fcfc6,_0x373c63)=>!_0x2fcfc6&&_0x373c63),_0x39537d;}['_createShowHistoryButton'](){const _0x3009b0=new _0x13b904(this['locale']),_0x34dfc8=this['resultsView'],_0x37be9d=this['locale'];_0x3009b0['set']({'label':i(_0x37be9d,'History'),'withText':!0x1,'icon':_0xfcef30['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3009b0['bind']('isOn')['to'](_0x34dfc8,'isVisible'),_0x3009b0['bind']('isEnabled')['to'](this,'isEnabled'),_0x3009b0['on']('execute',()=>{_0x34dfc8['isVisible']=!_0x34dfc8['isVisible'],_0x34dfc8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x42dbce=()=>{_0x4d93e5['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x412ebd=new st(this['queryView']['fieldView']['element']),_0x11ce43=_0x412ebd['width'],_0x350398='rtl'===_0x37be9d['uiLanguageDirection']?'left':'right';_0x412ebd['excludeScrollbarsAndBorders'](),_0x3009b0['element']['style'][_0x350398]=_0x11ce43-_0x412ebd['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x42dbce),this['on']('render',_0x42dbce),_0x3009b0;}['submit'](){const _0x1a081c=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1a081c);}['focus'](_0xed436f){-0x1===_0xed436f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x4ae845){super(_0x4ae845),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4ae845,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x101168=0x0;for(const _0x54c9ff of this['items'])_0x101168+=_0x54c9ff['items']['length'];return{'resultsCount':_0x101168,'totalItemsCount':_0x101168};}['_createClearHistoryButton'](){const _0x2f9795=this['locale'],_0x5ead01=new _0x13b904(this['locale']);return _0x5ead01['set']({'label':'('+i(_0x2f9795,'Clear')+')','withText':!0x0}),_0x5ead01['on']('execute',()=>this['fire']('clearHistory')),_0x5ead01;}}class hs extends _0xb9cdd{constructor(_0x4c924d){super();const _0x340e35=new te(),_0xb5ccc1=new _0x13b904(this['locale'],_0x340e35);this['children']['add'](_0xb5ccc1),_0xb5ccc1['set']({'label':_0x4c924d['prompt'],'withText':!0x0}),_0xb5ccc1['on']('execute',()=>{this['fire']('execute',{'value':_0x3044b3(_0x4c924d['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x1dae02{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x263735,_0x1ebd0c)=>{const _0x33196e=Ss(_0x1ebd0c['prompt']);for(const _0x1f4967 of this)if(_0x1f4967!=_0x1ebd0c&&Ss(_0x1f4967['prompt'])===_0x33196e){this['remove'](_0x1f4967);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4799b8=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x4799b8));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0xd9af13=>_0xd9af13)));}}function Ss(_0x4ab1d0){return _0x4ab1d0['toLowerCase']()['trim']();}class K extends _0x2895c2{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x307d14,_0x35fc3b,_0x5c3209=''){super(_0x307d14),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(_0x307d14),this['contentArea']=new W(_0x307d14,_0x5c3209),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 _0x5ae073(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x44053b({'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 _0x47b49d=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x35fc3b],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x47b49d['if']('isError','ck-hidden',_0x3c56fc=>!_0x3c56fc)]},'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'](_0x49061b=0x1){-0x1===_0x49061b?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 _0x2d5928=this['locale'],_0x563c56=new ht(_0x2d5928,{'queryView':{'label':i(_0x2d5928,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x342d39,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x2d5928,'Empty\x20history'),'secondary':i(_0x2d5928,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x563c56['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x31a914,_0x5a1dd2)=>_0x31a914&&!_0x5a1dd2),this['listenTo'](_0x563c56,'submit',(_0x26b068,_0x212327)=>{this['prompt']=_0x212327;const _0x428e24=_0x5b29f2(_0x212327);this['fire']('submitPrompt',_0x428e24),_0x212327['trim']()&&this['_promptHistory']['add']({'prompt':_0x428e24},0x0);},{'priority':'high'}),_0x563c56;}['_createHistoryView'](){const _0x33da20=new rs(this['locale']);return _0x33da20['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x33da20['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x33da20;}['_createToolbar'](){const _0x25214d=new nt(this['locale']);return _0x25214d['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x7a95b1,_0x37be95,_0x568161)=>_0x7a95b1&&!_0x37be95&&!!_0x568161),_0x25214d['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x25214d['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4ce072,_0x5260d3,_0x54d72b)=>_0x4ce072&&!_0x5260d3&&!!_0x54d72b),_0x25214d['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x25214d['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x170547,_0x318fa2)=>_0x170547&&!_0x318fa2),_0x25214d['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x25214d['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x25214d['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x25214d;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x457d38=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x457d38,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x10af02){const _0x4d55c8=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x10af02||i(_0x4d55c8,'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 _0x9b5676{['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[_0x33e0ce,a,v,_0x10fb15];}constructor(_0x2af5b0){super(_0x2af5b0),_0x2af5b0['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2af5b0['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2af5b0['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2af5b0['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4cd709}=this;this['_aiAdapter']=_0x4cd709['plugins']['get'](v),this['_dialog']=_0x4cd709['plugins']['get'](_0x10fb15),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x593937=new y(_0x4cd709,Array['from'](this['_commandDefinitions']['values']()));_0x4cd709['commands']['add']('showAIAssistant',_0x593937),_0x4cd709['ui']['componentFactory']['add']('aiCommands',_0x57ff89=>{const _0x491c36=_0xd88fe7(_0x57ff89);return _0x491c36['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x491c36['buttonView']['set']({'label':i(_0x57ff89,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x491c36['on']('execute',_0x40f0d4=>this['_onExecute'](_0x40f0d4['source']['id'])),_0x317d6f(_0x491c36,_0x4cd709['ui']['view']['body'],function(_0x9f4b0c){const _0x2d6091=o(_0x9f4b0c['config']['get']('ai.aiAssistant.commands'),_0x9f4b0c['locale']),_0x1c526f=B(_0x9f4b0c,_0x2d6091)['filter'](_0x59d3ba=>_0x59d3ba['commands']['length']);if(0x1===_0x1c526f['length'])return B(_0x9f4b0c,_0x1c526f[0x0]['commands'])['map'](_0x78ba96=>({'id':_0x78ba96['id'],'label':_0x78ba96['label']}));return _0x1c526f['map'](_0x263e44=>{const {groupId:_0x24caa3,groupLabel:_0x29ee37,commands:_0x385b3a}=_0x263e44,_0x2dd84b=B(_0x9f4b0c,_0x385b3a)['map'](_0xf94509=>({'id':_0xf94509['id'],'label':_0xf94509['label']}));return{'id':_0x24caa3,'menu':_0x29ee37||_0x24caa3,'children':_0x2dd84b};});}(_0x4cd709),{'ariaLabel':i(_0x57ff89,'AI\x20Commands')}),_0x491c36['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x593937['on']('change:enabledCommandsIds',_0x5ac10c),_0x491c36['menuView']['once']('render',_0x5ac10c),_0x491c36;function _0x5ac10c(){_0x491c36['isEnabled']=_0x593937['enabledCommandsIds']['length']>0x0;for(const _0x3df52a of _0x491c36['menuView']['buttons'])_0x3df52a['isEnabled']=_0x593937['enabledCommandsIds']['includes'](_0x3df52a['id']);}}),_0x4cd709['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3b7449=>{const _0x411e7a=new _0x205268(_0x3b7449);_0x411e7a['buttonView']['set']({'label':i(_0x3b7449,'AI\x20Commands'),'icon':E}),_0x411e7a['bind']('isEnabled')['to'](_0x593937,'enabledCommandsIds',_0x3e81e6=>_0x3e81e6['length']>0x0);const _0x257da2=o(_0x4cd709['config']['get']('ai.aiAssistant.commands'),_0x3b7449);return this['_populateMenuBarMenu'](_0x593937,_0x411e7a,_0x257da2,_0x3a88e4=>this['_onExecute'](_0x3a88e4)),_0x411e7a;}),_0x4cd709['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5a4095=this['_createAIAssistantUIButton'](_0x13b904);return _0x5a4095['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5a4095;}),_0x4cd709['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2613bb=this['_createAIAssistantUIButton'](_0x41d820);return _0x2613bb['set']({'role':'menuitemcheckbox'}),_0x2613bb;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2fa42e=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x220c37;for(const _0x539530 in _0x2fa42e){const _0x1a0b9f=_0x539530,_0x29234f=_0x2fa42e[_0x1a0b9f];if('aiLicenseKeyValid'==_0x29234f||'aiLicenseKeyInvalid'==_0x29234f||'aiLicenseKeyExpired'==_0x29234f||'aiLicenseKeyDomainLimit'==_0x29234f||'aiLicenseKeyNotAllowed'==_0x29234f||'aiLicenseKeyEvaluationLimit'==_0x29234f||'aiLicenseKeyTrialLimit'==_0x29234f||'aiLicenseKeyDevelopmentLimit'==_0x29234f||'aiLicenseKeyUsageLimit'==_0x29234f){delete _0x2fa42e[_0x1a0b9f],_0x220c37=_0x29234f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x220c37&&_0x2fa42e['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x220c37&&_0x2fa42e['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x220c37&&_0x2fa42e['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x220c37&&_0x2fa42e['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x220c37&&_0x2fa42e['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x220c37&&_0x2fa42e['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x220c37&&_0x2fa42e['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x220c37&&_0x2fa42e['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2cc24d='',_0x3f4eee='',_0x201991='custom'){const _0x4bf70a=this['editor'],_0x106adf=_0x4bf70a['editing']['view'],_0xea66de=_0x4bf70a['plugins']['get'](a),_0x540316=_0x4bf70a['plugins']['get'](_0x33e0ce);_0xea66de['showFakeVisualSelection']();const _0x571fcf=new j(),_0x4b3f66=new ClipboardEvent('copy',{'clipboardData':_0x571fcf}),_0x570d9e=new _0x49af1b(_0x571fcf),_0x59da99=new _0x499e62(_0x106adf,_0x4b3f66,{'dataTransfer':_0x570d9e});_0x540316['_forceMarkersCopy']('comment',()=>{_0x106adf['document']['fire']('copy',_0x59da99);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x4bf70a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x26aa1a=_0x570d9e['getData']('text/html');const _0x2ec1b9=_0x4bf70a['model']['document']['selection'],_0x4771a6=Array['from'](_0x2ec1b9['getRanges']());0x1===_0x4771a6['length']&&_0x4771a6[0x0]['isFlat']&&!_0x2ec1b9['getSelectedElement']()&&''!==_0x26aa1a['replace'](/ /g,'')['trim']()&&(_0x26aa1a='<p>'+_0x26aa1a+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x201991,'query':_0x2cc24d,'htmlContent':_0x26aa1a,'label':_0x3f4eee,'mainActionLabel':x[_0x4bf70a['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':_0x23c187['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xea66de['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2df524=new Map(),_0x5cbc85=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x25de83 of _0x5cbc85)for(const _0x1192f9 of _0x25de83['commands'])_0x2df524['set'](_0x1192f9['id'],{..._0x1192f9,'groupId':_0x25de83['groupId'],'groupLabel':_0x25de83['groupLabel']||_0x25de83['groupId']});return _0x2df524;}['_createAIAssistantUIButton'](_0x36503c){const _0xa41847=this['editor'],_0x24c248=_0xa41847['commands']['get']('showAIAssistant'),_0xd15bec=new _0x36503c(_0xa41847['locale']);return _0xd15bec['set']({'label':i(_0xa41847['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0xd15bec['bind']('isEnabled')['to'](_0x24c248),_0xd15bec['bind']('isOn')['to'](this['_dialog'],'id',_0x5e8ea2=>'aiAssistant'===_0x5e8ea2),this['listenTo'](_0xd15bec,'execute',()=>{_0xd15bec['isOn']?this['hideUI']():_0x24c248['execute']();}),_0xd15bec;}['_initView'](){const _0x5cc8c1=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',()=>{_0x5cc8c1['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x5cc8c1['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x13b932,ui:{ariaLiveAnnouncer:_0x38b838}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x345248,_0x118bff,_0x5c88e4)=>{const _0x47758a=this['_aiAssistantController']['currentContext'];_0x5c88e4?_0x38b838['announce'](i(_0x13b932,'AI\x20is\x20writing')):_0x47758a&&_0x38b838['announce'](i(_0x13b932,'Generated\x20content:\x20%0',_0x47758a),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x3b58e4,_0x515e77,_0x395a13)=>{if(_0x395a13){const _0x247a83=this['_formView']['errorView']['text'];_0x38b838['announce'](i(_0x13b932,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x247a83));}});}['_onExecute'](_0x52b720){const _0x5b3904=this['_commandDefinitions']['get'](_0x52b720),_0x5f495f=this['editor'],_0x39b318=_0x5f495f['model']['document']['selection'],_0x5bc7c9=_0x5f495f['commands']['get']('showAIAssistant'),_0xa1b021=_0x5f495f['plugins']['get'](a),_0x445270=''+(_0x5b3904['groupId']!==I?_0x5b3904['groupLabel']+':\x20':'')+_0x5b3904['label'];if(!0x1!==_0x5b3904['requiresContent']&&_0x39b318['isCollapsed']){const _0x1bf200=_0x2fc08c(_0x39b318['getSelectedBlocks']())||_0x5f495f['model']['schema']['getLimitElement'](_0x39b318);_0x5f495f['model']['change'](_0x612edf=>{_0x612edf['setSelection'](_0x1bf200,'in');});}_0xa1b021['showFakeVisualSelection'](),_0x5bc7c9['execute'](_0x5b3904['prompt'],_0x445270,'command:'+_0x52b720);}['_populateMenuBarMenu'](_0x37a600,_0x56f58d,_0x2ea1bb,_0x314167){const _0x56e258=this['editor'],_0x24650c=_0x56e258['locale'],_0x343c0a=new _0x5edf2b(_0x24650c),_0x143892=B(_0x56e258,_0x2ea1bb)['filter'](_0x267fa8=>_0x267fa8['commands']['length']);0x1===_0x143892['length']?this['_getMenuBarGroupButtons']({'command':_0x37a600,'commands':_0x143892[0x0]['commands'],'parentMenuView':_0x56f58d,'onExecute':_0x314167})['forEach'](_0x5c5d1c=>_0x343c0a['items']['add'](_0x5c5d1c)):_0x143892['forEach'](({groupId:_0x168a3a,groupLabel:_0x29be29,commands:_0x464f39})=>{const _0x17c1f3=new _0x5302fc(_0x24650c,_0x56f58d),_0x415b3a=new _0x205268(_0x24650c),_0x4b6526=new _0x5edf2b(_0x24650c),_0x50a0b8=this['_getMenuBarGroupButtons']({'command':_0x37a600,'commands':_0x464f39,'parentMenuView':_0x415b3a,'onExecute':_0x314167});_0x415b3a['buttonView']['set']({'label':_0x29be29||_0x168a3a}),_0x415b3a['delegate']('execute')['to'](_0x56f58d),_0x4b6526['items']['addMany'](_0x50a0b8),_0x415b3a['panelView']['children']['add'](_0x4b6526),_0x17c1f3['children']['add'](_0x415b3a),_0x343c0a['items']['add'](_0x17c1f3);}),_0x56f58d['panelView']['children']['add'](_0x343c0a);}['_getMenuBarGroupButtons']({command:_0xefe2c7,commands:_0x933ac1,parentMenuView:_0x4926c4,onExecute:_0x924526}){const _0xb2c89=this['editor'],_0xf855b4=_0xb2c89['locale'];return B(_0xb2c89,_0x933ac1)['map'](_0x4a9f53=>{const _0x214fcb=new _0x5302fc(_0xf855b4,_0x4926c4),_0x3cecc9=new _0x41d820(_0xf855b4);return _0x3cecc9['set']({'label':_0x4a9f53['label']}),_0x3cecc9['delegate']('execute')['to'](_0x4926c4),_0x3cecc9['on']('execute',()=>_0x924526(_0x4a9f53['id'])),_0x3cecc9['bind']('isEnabled')['to'](_0xefe2c7,'enabledCommandsIds',_0x17c826=>_0x17c826['includes'](_0x4a9f53['id'])),_0x214fcb['children']['add'](_0x3cecc9),_0x214fcb;});}}function _(_0x3b1f1d,_0x38095a){return void 0x0!==_0x3b1f1d['order']&&void 0x0===_0x38095a['order']?0x1:void 0x0===_0x3b1f1d['order']&&void 0x0!==_0x38095a['order']?-0x1:void 0x0!==_0x3b1f1d['order']&&void 0x0!==_0x38095a['order']?_0x3b1f1d['order']-_0x38095a['order']:0x0;}function B(_0x7dff92,_0x574c39){_0x574c39['sort'](_);const _0x434acd={},_0x5c11e4=[];for(const _0x3289ab of _0x574c39)if(void 0x0!==_0x3289ab['order']){if(_0x3289ab['order']in _0x434acd)throw new _0x1d1c02('ai-commands-config-order-collision',_0x7dff92,{'conflictingDefinitions':[_0x3289ab,_0x434acd[_0x3289ab['order']]]});_0x434acd[_0x3289ab['order']]=_0x3289ab,_0x5c11e4['splice'](_0x3289ab['order'],0x0,_0x3289ab);}else _0x5c11e4['push'](_0x3289ab);return _0x5c11e4;}class r extends _0x9b5676{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x50a864){super(_0x50a864);const _0xc91984=_0x50a864['config'],_0xe6aad6=_0x50a864['locale'];_0xc91984['define']('ai.aiAssistant.commands',function(_0x2c032b){return[{'groupId':'editOrReview','groupLabel':i(_0x2c032b,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x2c032b,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x2c032b,'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(_0x2c032b,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x2c032b,'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(_0x2c032b,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x2c032b,'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(_0x2c032b,'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(_0x2c032b,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x2c032b,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x2c032b,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x2c032b,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x2c032b,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x2c032b,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x2c032b,'Change\x20style'),'commands':[{'id':'business','label':i(_0x2c032b,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x2c032b,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x2c032b,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x2c032b,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x2c032b,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x2c032b,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x2c032b,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x2c032b,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x2c032b,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x2c032b,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x2c032b,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x2c032b,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x2c032b,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0xe6aad6)),_0xc91984['define']('ai.aiAssistant.extraCommandGroups',[]),_0xc91984['define']('ai.aiAssistant.removeCommands',[]);const _0x497ec6=o(_0xc91984['get']('ai.aiAssistant.commands'),_0xe6aad6),_0x42e5e0=_0xc91984['get']('ai.aiAssistant.extraCommandGroups'),_0x53ce10=_0xc91984['get']('ai.aiAssistant.removeCommands');_0x42e5e0['forEach'](_0xf2720a=>{const _0x4bdf8d=_0x497ec6['find'](_0x28aeab=>_0x28aeab['groupId']===_0xf2720a['groupId']);_0x4bdf8d?_0x4bdf8d['commands']=_0x4bdf8d['commands']['concat'](_0xf2720a['commands']):_0x497ec6['push'](_0xf2720a);}),_0x497ec6['forEach'](_0x50504e=>{_0x50504e['commands']=_0x50504e['commands']['filter'](_0x28b08a=>!_0x53ce10['includes'](_0x28b08a['id']));}),_0xc91984['set']('ai.aiAssistant.commands',_0x497ec6);}}class P extends _0x9b5676{['abortController'];static get['requires'](){return[v];}constructor(_0x1ac9d8){super(_0x1ac9d8),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'](_0x299a91){return this['sendRequest'](_0x299a91)['catch'](_0x571329=>{if(_0x571329 instanceof R)return Promise['reject'](_0x571329);if('AbortError'==_0x571329['name'])return Promise['resolve']();throw console['error'](_0x571329),new _0x1d1c02('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1303c8,_0x4478ef){const _0x52ad71=this['editor']['locale'],_0x5d831e={'Content-Type':'application/json'};if('object'==typeof _0x1303c8)Object['assign'](_0x5d831e,_0x1303c8);else{if(_0x1303c8)try{const _0xda953d=await _0x1303c8(_0x4478ef);Object['assign'](_0x5d831e,_0xda953d);}catch(_0x33e0bf){return Promise['reject'](new R(i(_0x52ad71,'AI_ERROR_GET_HEADERS')));}}return _0x5d831e;}async['_prepareRequestParameters'](_0x909cad,_0x8cd30e){const _0x2fa8be=this['editor']['locale'];if('object'==typeof _0x909cad)return _0x909cad;try{return await _0x909cad(_0x8cd30e);}catch(_0x17e277){return Promise['reject'](new R(i(_0x2fa8be,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x118236){super(_0x118236),_0x118236['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x118236['config']['get']('ai.openAI.requestParameters')||_0x118236['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x118236['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x118236['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x118236['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x1de94e,context:_0x195aff,onData:_0xb6f666,actionId:_0x1364c6}){const _0x421b0b=this['editor']['locale'],_0x48b8bd=await this['prepareMessages'](_0x1de94e,_0x195aff,_0x1364c6),_0x13827d=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1364c6),_0x26fdce=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1364c6),_0x37268b={'messages':_0x48b8bd,..._0x26fdce},_0x3d8085={'method':'POST','headers':_0x13827d,'body':JSON['stringify'](_0x37268b),'signal':this['abortController']['signal']},_0x4cf78a=await fetch(this['_apiUrl'],_0x3d8085);if(_0x4cf78a['ok'])return _0x26fdce['stream']?await this['_readStreamableResponse'](_0x4cf78a,_0xb6f666):await this['_readStaticResponse'](_0x4cf78a,_0xb6f666),Promise['resolve']();{const _0x4ef549=await _0x4cf78a['text']();return _0x4ef549['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x421b0b,'AI_ERROR_CONTEXT_LENGTH'))):_0x4ef549['includes']('Moderation')?Promise['reject'](new R(i(_0x421b0b,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x4ef549));}}async['prepareMessages'](_0x4258ee,_0x298e69,_0x52c352){let _0x616018,_0x8d2797;return _0x298e69?(_0x616018='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.',_0x8d2797='Instruction:\x0a'+_0x4258ee+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x298e69):(_0x616018='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.',_0x8d2797=_0x4258ee),[{'role':'system','content':_0x616018},{'role':'user','content':_0x8d2797}];}async['_readStreamableResponse'](_0x2aa008,_0x3363c8){const _0x238747=_0x2aa008['body']['getReader'](),_0x81e968=new TextDecoder();let _0x4e66b0='',_0x2ed14b='',_0xe12cd6='',_0x3eb696=!0x1;for(;!_0x3eb696;){const {done:_0x2d98d5,value:_0xc3f515}=await _0x238747['read'](),_0x3a2141=_0x4e66b0+_0x81e968['decode'](_0xc3f515);let _0x591e13='';_0x3eb696=_0x2d98d5;try{_0x591e13=this['_cleanUpData'](_0x3a2141),_0x4e66b0='';}catch(_0x262f4d){_0x4e66b0=_0x3a2141;continue;}_0x2ed14b+=_0x591e13,!_0x3eb696&&this['_isBufferIncomplete'](_0x2ed14b)||_0x2ed14b&&(_0xe12cd6+=_0x2ed14b,_0x2ed14b='',_0x3363c8(_0xe12cd6));}return Promise['resolve']();}async['_readStaticResponse'](_0x18ddf7,_0x33abc4){return _0x33abc4((await _0x18ddf7['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x785090){const _0x384f58=_0x785090['split']('<')['length']!==_0x785090['split']('>')['length'],_0x50f775=_0x785090['length']<0x1e;return _0x384f58&&_0x50f775;}['_cleanUpData'](_0x13e8b6){return _0x13e8b6['split'](/\n(?![^{]*\})/g)['map'](_0x43d4bc=>_0x43d4bc['replace']('data:\x20',''))['filter'](_0x502995=>_0x502995&&_0x502995['length']>0x0&&'[DONE]'!==_0x502995)['map'](_0x78ee60=>{const {choices:_0x317474}=JSON['parse'](_0x78ee60);if(_0x317474[0x0]&&_0x317474[0x0]['delta']&&_0x317474[0x0]['delta']['content'])return _0x317474[0x0]['delta']['content'];})['filter'](_0x3cab40=>_0x3cab40)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4e7f4f){super(_0x4e7f4f),_0x4e7f4f['config']['get']('ai.aws.requestParameters')||_0x4e7f4f['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']=_0x4e7f4f['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x4e7f4f['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4e7f4f['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x4e7f4f['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0xa6eb6e,context:_0x1a9572,onData:_0x2be85e,actionId:_0x127585}){const {model:_0x680b9a,stream:_0x27fe8c,..._0x33d07e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x127585),_0xd06778={'prompt':await this['preparePrompt'](_0xa6eb6e,_0x1a9572,_0x680b9a,_0x127585),..._0x33d07e};this['_apiUrl']?await this['_processProxyRequest'](_0xd06778,_0x680b9a,_0x27fe8c,_0x2be85e,_0x127585):await this['_processAWSRequest'](_0xd06778,_0x680b9a,_0x27fe8c,_0x2be85e);}async['preparePrompt'](_0x3dd5f2,_0x102e07,_0x430df7,_0x378eba){let _0x353b4b,_0x4eadf7;return _0x102e07?(_0x353b4b='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.',_0x4eadf7='Instruction:\x0a'+_0x3dd5f2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x102e07):(_0x353b4b='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.',_0x4eadf7=_0x3dd5f2),'meta.llama'==this['getModelFamily'](_0x430df7)?'<<SYS>>\x0a'+_0x353b4b+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4eadf7+'\x0a[/INST]':'Human:\x0a'+_0x353b4b+'\x0a'+_0x4eadf7+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5d1487){if(/^anthropic\.claude/['test'](_0x5d1487))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5d1487))return'ai21.j2';if(/^cohere\.command/['test'](_0x5d1487))return'cohere.command';if(/^meta\.llama/['test'](_0x5d1487))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5d1487));}async['_processProxyRequest'](_0x20f1f7,_0x1ba362,_0x478f98,_0x43e382,_0x530525){const _0x197856={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x530525),'body':JSON['stringify']({..._0x20f1f7,'model':_0x1ba362,'stream':_0x478f98}),'signal':this['abortController']['signal']},_0x442200=await fetch(this['_apiUrl'],_0x197856);_0x478f98?await this['_readStreamableResponse'](_0x442200,_0x1ba362,_0x43e382):await this['_readStaticResponse'](_0x442200,_0x1ba362,_0x43e382);}async['_processAWSRequest'](_0x19c13f,_0x230132,_0x1fb5b1,_0xbd0f13){const _0xcad533=new _0x599b44(this['_bedrockClientConfig']),_0x41aca6={'body':JSON['stringify'](_0x19c13f),'contentType':'application/json','accept':'application/json','modelId':_0x230132};let _0x1c61a9;if(_0x1fb5b1){const _0x1add5a=new _0x3dd78b(_0x41aca6);_0x1c61a9=await _0xcad533['send'](_0x1add5a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1c61a9,_0x230132,_0xbd0f13);}else{const _0x5eeeda=new _0x56ece1(_0x41aca6);_0x1c61a9=await _0xcad533['send'](_0x5eeeda,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1c61a9,_0x230132,_0xbd0f13);}}async['_readAsyncIterableResponse'](_0x59de5f,_0xd98359,_0x209f0d){const _0x30d28=_0x59de5f['body'],_0x3f7f27=new TextDecoder('utf-8');let _0x4fbcb5='';for await(const _0x451f50 of _0x30d28)if(_0x451f50['chunk']){const _0x53b69d=_0x3f7f27['decode'](_0x451f50['chunk']['bytes']),_0x1e7e7b=JSON['parse'](_0x53b69d);_0x4fbcb5+=this['_getGeneratedText'](_0x1e7e7b,_0xd98359),_0x209f0d(_0x4fbcb5);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1c55fa,_0x3310a1,_0x513865){const _0x3e3255=_0x1c55fa['body'],_0x1a50cc=new TextDecoder('utf-8'),_0x561973=_0x3e3255['getReader']();let _0x2b1e40='',_0x4162c2='',_0xe48e92=!0x1;for(;!_0xe48e92;){const {done:_0x285702,value:_0x118330}=await _0x561973['read']();if(_0xe48e92=_0x285702,_0xe48e92)break;const _0x6ed9fa=(_0x2b1e40+_0x1a50cc['decode'](_0x118330))['split']('\x0a')['map'](_0x4a6703=>{try{return _0x2b1e40='',JSON['parse'](_0x4a6703);}catch(_0x2be602){return _0x2b1e40=_0x4a6703,null;}})['filter'](_0x59d000=>null!==_0x59d000);_0x6ed9fa['length']&&(_0x4162c2+=_0x6ed9fa['map'](_0x20c694=>this['_getGeneratedText'](_0x20c694,_0x3310a1))['join'](''),_0x513865(_0x4162c2));}return Promise['resolve']();}async['_readStaticResponse'](_0x3a1887,_0x11e185,_0x3a1bae){let _0x44b0f7;return _0x44b0f7=_0x3a1887 instanceof Response?await _0x3a1887['json']():JSON['parse'](Buffer['from'](_0x3a1887['body'])['toString']('utf8')),(_0x3a1bae(this['_getGeneratedText'](_0x44b0f7,_0x11e185)),Promise['resolve']());}['_getGeneratedText'](_0x2304d0,_0x3050ba){switch(this['getModelFamily'](_0x3050ba)){case'anthropic.claude':return _0x2304d0['completion'];case'ai21.j2':return _0x2304d0['completions'][0x0]['data']['text'];case'cohere.command':return _0x2304d0['generations'][0x0]['text'];case'meta.llama':return _0x2304d0['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':_0x3aace9=>0x1!=_0x3aace9}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x57555c=>{const {af:{dictionary:_0x573f89,getPluralForm:_0x59e7e6}}={'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':_0x1e0aab=>0x1!=_0x1e0aab}};_0x57555c['af']||={'dictionary':{},'getPluralForm':null},_0x57555c['af']['dictionary']=Object['assign'](_0x57555c['af']['dictionary'],_0x573f89),_0x57555c['af']['getPluralForm']=_0x59e7e6;})(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':_0x1461d1=>0x0==_0x1461d1?0x0:0x1==_0x1461d1?0x1:0x2==_0x1461d1?0x2:_0x1461d1%0x64>=0x3&&_0x1461d1%0x64<=0xa?0x3:_0x1461d1%0x64>=0xb?0x4:0x5}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x54130e=>{const {ar:{dictionary:_0x3f2c79,getPluralForm:_0x53972b}}={'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':_0x5f48eb=>0x0==_0x5f48eb?0x0:0x1==_0x5f48eb?0x1:0x2==_0x5f48eb?0x2:_0x5f48eb%0x64>=0x3&&_0x5f48eb%0x64<=0xa?0x3:_0x5f48eb%0x64>=0xb?0x4:0x5}};_0x54130e['ar']||={'dictionary':{},'getPluralForm':null},_0x54130e['ar']['dictionary']=Object['assign'](_0x54130e['ar']['dictionary'],_0x3f2c79),_0x54130e['ar']['getPluralForm']=_0x53972b;})(window['CKEDITOR_TRANSLATIONS']||={});
|