@ckeditor/ckeditor5-ai 44.2.0-alpha.5 → 44.2.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +9 -9
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/index.js +1 -1
- package/src/legacyerrors.js +1 -1
- package/src/ui/aiassistantcontroller.js +2 -2
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x454c11,Command as _0x268214,icons as _0x502dc9}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x41dbe0,CKEditorError as _0x153b71,ObservableMixin as _0xae9dc4,global as _0xf6b9b9,isVisible as it,Rect as st,Collection as _0x579d51,FocusTracker as _0x51a8ad,KeystrokeHandler as ts,first as _0x21543c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x2c4d9e,View as _0x23806c,SpinnerView as _0x2ae8f4,IconView as _0x1e8aef,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x139bfb,ButtonLabelView as te,FocusCycler as _0x3c0f58,createLabeledTextarea as _0x3c94e8,Dialog as _0x2c7d3f,createDropdown as _0x1193ed,addMenuToDropdown as _0x2051f6,MenuBarMenuView as _0x1e65bd,MenuBarMenuListItemButtonView as _0x31bbe5,DialogViewPosition as _0x584113,MenuBarMenuListView as _0x282be8,MenuBarMenuListItemView as _0x4c364a}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x47b320,ClipboardMarkersUtils as _0x2bcedf}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x9388cf,DataTransfer as _0x2981e5,UpcastWriter as _0x207491,Matcher as _0xbf8ba0}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x20307c,escape as _0x29393c}from'lodash-es';import{BedrockRuntimeClient as _0x56414c,InvokeModelWithResponseStreamCommand as _0x5194b5,InvokeModelCommand as _0x5e7f9a}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x32bd52,_0x27ebcb){const _0x382eb7=(0x0,_0x27ebcb['t'])('Other');return _0x32bd52['length']?'groupId'in _0x32bd52[0x0]?_0x32bd52:[{'groupId':x,'groupLabel':_0x382eb7,'order':0x1/0x0,'commands':_0x32bd52}]:[{'groupId':x,'groupLabel':_0x382eb7,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x454c11{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x406e7f}=this,_0x4356f0=['ck-fake-ai-selection'];_0x406e7f['config']['get']('ai.useTheme')&&_0x4356f0['push']('ck-ai-assistant-ui_theme'),_0x406e7f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x4356f0,'priority':0xc}}),_0x406e7f['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4d8b40,{writer:_0x13da05})=>{if(!_0x4d8b40['markerRange']['isCollapsed'])return null;const _0x578be7=_0x13da05['createUIElement']('span');return _0x13da05['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x578be7),_0x578be7;}});}['afterInit'](){!async function(_0x1c5c19){const _0x37d3fa=_0x2fb4e5([0x58,0x6b,0x6c,0x64,0x37,0x55,0x62,0x67,0x66,0x75,0x50,0x70,0x41,0x54,0x68,0x34,0x46,0x7a,0x45,0x72,0x6d,0x4b,0x4a,0x36,0x56,0x49,0x48,0x4f,0x61,0x79,0x52,0x57,0x38,0x30,0x6e,0x65,0x51,0x4e,0x78,0x59,0x71,0x53,0x77,0x32,0x4c,0x44,0x74,0x35,0x42,0x47,0x69,0x4d,0x39,0x6f,0x43,0x73,0x5a,0x76,0x63,0x33,0x31,0x6a]),_0x3306c6=0x429fec51,_0x190f66=0x4298b209^_0x3306c6,_0x2138e0=window[_0x2fb4e5([0x44,0x61,0x74,0x65])][_0x2fb4e5([0x6e,0x6f,0x77])](),_0xd705c=_0x1c5c19[_0x2fb4e5([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x28ff25=new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x278e66=>{_0xd705c[_0x2fb4e5([0x6f,0x6e,0x63,0x65])](_0x2fb4e5([0x72,0x65,0x61,0x64,0x79]),_0x278e66);}),_0x4c57a2={[_0x2fb4e5([0x6b,0x74,0x79])]:_0x2fb4e5([0x45,0x43]),[_0x2fb4e5([0x75,0x73,0x65])]:_0x2fb4e5([0x73,0x69,0x67]),[_0x2fb4e5([0x63,0x72,0x76])]:_0x2fb4e5([0x50,0x2d,0x32,0x35,0x36]),[_0x2fb4e5([0x78])]:_0x2fb4e5([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]),[_0x2fb4e5([0x79])]:_0x2fb4e5([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]),[_0x2fb4e5([0x61,0x6c,0x67])]:_0x2fb4e5([0x45,0x53,0x32,0x35,0x36])},_0x540218=_0xd705c[_0x2fb4e5([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2fb4e5([0x67,0x65,0x74])](_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x24f40c(){let _0x1b3a8e,_0x80ce7b=null,_0x2f853e=null;try{if(_0x540218==_0x2fb4e5([0x47,0x50,0x4c]))return _0x2fb4e5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x1b3a8e=_0xb1bca4(),!_0x1b3a8e)return _0x2fb4e5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x1b3a8e[_0x2fb4e5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2f853e=_0x2d0822(_0x1b3a8e[_0x2fb4e5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x1b3a8e[_0x2fb4e5([0x6a,0x74,0x69])])),await _0x4ab9b1()?_0x145e62()?_0x5bed05()?_0x2fb4e5([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x265725()?(_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2fb4e5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x80ce7b=_0x3d69e0(_0x2fb4e5([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2fb4e5([0x74,0x72,0x69,0x61,0x6c])&&(_0x80ce7b=_0x3d69e0(_0x2fb4e5([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x42d0c9()):_0x2fb4e5([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2fb4e5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2fb4e5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xf20ac3){return _0x2fb4e5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5bed05(){const _0x4162b8=[_0x2fb4e5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2fb4e5([0x74,0x72,0x69,0x61,0x6c])][_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2138e0/0x3e8:0xe10*_0x190f66;return _0x1b3a8e[_0x2fb4e5([0x65,0x78,0x70])]<_0x4162b8;}function _0x145e62(){const _0x58e5ac=_0x1b3a8e[_0x2fb4e5([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x58e5ac&&(!!_0x58e5ac[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2fb4e5([0x2a]))||!!_0x58e5ac[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2fb4e5([0x41,0x49])));}function _0x265725(){const _0x52c89c=_0x1b3a8e[_0x2fb4e5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x52c89c||0x0==_0x52c89c[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x47aaee}=new URL(window[_0x2fb4e5([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x52c89c[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x47aaee))return!0x0;const _0x339756=_0x47aaee[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e]));return _0x52c89c[_0x2fb4e5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xfcab68=>_0xfcab68[_0x2fb4e5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2fb4e5([0x2a])))[_0x2fb4e5([0x6d,0x61,0x70])](_0x53c1d5=>_0x53c1d5[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e])))[_0x2fb4e5([0x73,0x6f,0x6d,0x65])](_0x38d8ef=>_0x339756[_0x2fb4e5([0x65,0x76,0x65,0x72,0x79])]((_0x5b42c6,_0x5a7958)=>_0x38d8ef[_0x5a7958]===_0x5b42c6||_0x38d8ef[_0x5a7958]===_0x2fb4e5([0x2a])));}function _0x42d0c9(){return _0x80ce7b&&_0x2f853e?new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x18db1d,_0x148457)=>{_0x80ce7b[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x18db1d,_0x148457),_0x2f853e[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x476dae=>{_0x476dae!=_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64])&&_0x18db1d(_0x476dae);},_0x148457);}):_0x80ce7b||_0x2f853e||_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2d0822(_0x1ea32d,_0xc474ec){return new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45d1ce=>{if(_0x42213a())return _0x45d1ce(_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64]));_0x5e7227(),_0xd705c[_0x2fb4e5([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2fb4e5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x27be2c=!0x1;const _0x3128f9=_0x41dbe0();function _0x30b529(_0x3c66c5){return!!_0x3c66c5&&(typeof _0x3c66c5===_0x2fb4e5([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3c66c5===_0x2fb4e5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3c66c5[_0x2fb4e5([0x74,0x68,0x65,0x6e])]===_0x2fb4e5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3c66c5[_0x2fb4e5([0x63,0x61,0x74,0x63,0x68])]===_0x2fb4e5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1f6fb7(_0x6090fa){_0x446e56(_0x6090fa)[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x4af060=>{if(!_0x4af060||_0x4af060[_0x2fb4e5([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2fb4e5([0x6f,0x6b]))return _0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x4d53c4(_0x261b29(_0x3128f9+_0xc474ec))!=_0x4af060[_0x2fb4e5([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64]);})[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x38abdd=>(_0x409cb4(),_0x38abdd),()=>{const _0x1136f0=_0x576db3();return null==_0x1136f0?(_0x409cb4(),_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64])):_0x2fb4e5(_0x2138e0-_0x1136f0>(0x66936851^_0x3306c6)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x45d1ce)[_0x2fb4e5([0x63,0x61,0x74,0x63,0x68])](()=>{_0x45d1ce(_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x170411=0x42a902d1^_0x3306c6;function _0x409cb4(){const _0x46c5ea=_0x2fb4e5([0x6c,0x6c,0x63,0x74,0x2d])+_0x4d53c4(_0x261b29(_0x1ea32d)),_0x583dd8=_0x5609ef(_0x4d53c4(window[_0x2fb4e5([0x4d,0x61,0x74,0x68])][_0x2fb4e5([0x63,0x65,0x69,0x6c])](_0x2138e0/_0x170411)));window[_0x2fb4e5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2fb4e5([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x46c5ea,_0x583dd8);}function _0x576db3(){const _0x4937a4=_0x2fb4e5([0x6c,0x6c,0x63,0x74,0x2d])+_0x4d53c4(_0x261b29(_0x1ea32d)),_0x5c365b=window[_0x2fb4e5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2fb4e5([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4937a4);return _0x5c365b?window[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5609ef(_0x5c365b),0x10)*_0x170411:null;}function _0x446e56(_0x468a1a){return new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x584020,_0x11e320)=>{_0x468a1a[_0x2fb4e5([0x74,0x68,0x65,0x6e])](_0x584020,_0x11e320),window[_0x2fb4e5([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x11e320,0x429e3891^_0x3306c6);});}}_0xd705c[_0x2fb4e5([0x6f,0x6e])](_0x2fb4e5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x23d7c1,_0x3e29df)=>{if(_0x3e29df[0x0]!=_0x1ea32d)return _0x45d1ce(_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3e29df[0x1]={..._0x3e29df[0x1],[_0x2fb4e5([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3128f9};},{[_0x2fb4e5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2fb4e5([0x68,0x69,0x67,0x68])}),_0xd705c[_0x2fb4e5([0x6f,0x6e])](_0x2fb4e5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4fefe2=>{_0x30b529(_0x4fefe2[_0x2fb4e5([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x27be2c=!0x0,_0x1f6fb7(_0x4fefe2[_0x2fb4e5([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2fb4e5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2fb4e5([0x6c,0x6f,0x77])}),_0x28ff25[_0x2fb4e5([0x74,0x68,0x65,0x6e])](()=>{_0x27be2c||_0x45d1ce(_0x2fb4e5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x42213a(){return _0xd705c[_0x2fb4e5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2fb4e5([0x76,0x69,0x65,0x77])][_0x2fb4e5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2fb4e5([0x61,0x75,0x74,0x6f]);}function _0x5e7227(){_0xd705c[_0x2fb4e5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2fb4e5([0x76,0x69,0x65,0x77])][_0x2fb4e5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2fb4e5([0x61,0x75,0x74,0x6f]);}}function _0x3d69e0(_0x4f8dd6){const _0x295ec8=[new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x58550d=>setTimeout(_0x58550d,0x4296d29d^_0x3306c6)),_0x28ff25[_0x2fb4e5([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x130776=>{let _0x45b7c8=0x0;_0xd705c[_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2fb4e5([0x6f,0x6e])](_0x2fb4e5([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x16d507,_0x4c2697)=>{_0x4c2697[0x0][_0x2fb4e5([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x45b7c8++,_0x45b7c8==(0x429feda9^_0x3306c6)&&(_0x130776(),_0x16d507[_0x2fb4e5([0x6f,0x66,0x66])]());});}))];return window[_0x2fb4e5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2fb4e5([0x72,0x61,0x63,0x65])](_0x295ec8)[_0x2fb4e5([0x74,0x68,0x65,0x6e])](()=>_0x4f8dd6);}async function _0x26d8d1(){await _0x28ff25,_0xd705c[_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2fb4e5([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3fd490,_0xd705c[_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2fb4e5([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3fd490,_0xd705c[_0x2fb4e5([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2fb4e5([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x164ee4(_0x342f59){const _0x502c90=_0x4c4597();_0xd705c[_0x502c90]=_0x2fb4e5([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x342f59,_0x342f59!=_0x2fb4e5([0x56,0x61,0x6c,0x69,0x64])&&_0x26d8d1();}function _0x4c4597(){const _0xc40ef7=window[_0x2fb4e5([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2fb4e5([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2fb4e5([0x6e,0x6f,0x77])]())[_0x2fb4e5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2fb4e5([0x2e]),'');let _0x26cc84=_0x2fb4e5([0x58]);for(let _0x1dd72b=0x0;_0x1dd72b<_0xc40ef7[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1dd72b+=0x2){let _0x584922=window[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xc40ef7[_0x2fb4e5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1dd72b,_0x1dd72b+0x2));_0x584922>=_0x37d3fa[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x584922-=_0x37d3fa[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x26cc84+=_0x37d3fa[_0x584922];}return _0x26cc84;}function _0xb1bca4(){const _0x286f21=_0x540218[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e]));if(0x3!=_0x286f21[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1e5efe(_0x286f21[0x1]);function _0x1e5efe(_0x390d50){const _0x4a8b6e=_0x45a1f0(_0x390d50);return _0x4a8b6e&&_0x22814a()?_0x4a8b6e:null;function _0x22814a(){const _0xa8383b=_0x4a8b6e[_0x2fb4e5([0x6a,0x74,0x69])],_0x1ac05c=window[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xa8383b[_0x2fb4e5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xa8383b[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x22ad7f={..._0x4a8b6e,[_0x2fb4e5([0x6a,0x74,0x69])]:_0xa8383b[_0x2fb4e5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xa8383b[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x22ad7f[_0x2fb4e5([0x76,0x63])],_0x261b29(_0x22ad7f)==_0x1ac05c;}}}async function _0x4ab9b1(){let _0x1ec078=!0x0;try{const _0x471351=_0x540218[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])](_0x2fb4e5([0x2e])),[_0x4ff4d5,_0x3475c3,_0x18d4c7]=_0x471351;return _0x5b3a80(_0x4ff4d5),await _0x3fd7e9(_0x4ff4d5,_0x3475c3,_0x18d4c7),_0x1ec078;}catch(_0x561b93){return!0x1;}function _0x5b3a80(_0x31b6e3){const _0x11adcf=_0x45a1f0(_0x31b6e3);_0x11adcf&&_0x11adcf[_0x2fb4e5([0x61,0x6c,0x67])]==_0x2fb4e5([0x45,0x53,0x32,0x35,0x36])||(_0x1ec078=!0x1);}async function _0x3fd7e9(_0x499105,_0x4b66b2,_0x378045){const _0x49dd2d=window[_0x2fb4e5([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2fb4e5([0x66,0x72,0x6f,0x6d])](_0x5de736(_0x378045),_0xa0c842=>_0xa0c842[_0x2fb4e5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x40c913=new window[(_0x2fb4e5([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2fb4e5([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x499105+_0x2fb4e5([0x2e])+_0x4b66b2),_0x259c0d=window[_0x2fb4e5([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2fb4e5([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x259c0d)return;const _0x4d7b15=await _0x259c0d[_0x2fb4e5([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2fb4e5([0x6a,0x77,0x6b]),_0x4c57a2,{[_0x2fb4e5([0x6e,0x61,0x6d,0x65])]:_0x2fb4e5([0x45,0x43,0x44,0x53,0x41]),[_0x2fb4e5([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2fb4e5([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2fb4e5([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x259c0d[_0x2fb4e5([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2fb4e5([0x6e,0x61,0x6d,0x65])]:_0x2fb4e5([0x45,0x43,0x44,0x53,0x41]),[_0x2fb4e5([0x68,0x61,0x73,0x68])]:{[_0x2fb4e5([0x6e,0x61,0x6d,0x65])]:_0x2fb4e5([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x4d7b15,_0x49dd2d,_0x40c913)||(_0x1ec078=!0x1);}}function _0x45a1f0(_0x280a2e){return _0x280a2e[_0x2fb4e5([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2fb4e5([0x65,0x79]))?JSON[_0x2fb4e5([0x70,0x61,0x72,0x73,0x65])](_0x5de736(_0x280a2e)):null;}function _0x5de736(_0x3bc63c){return window[_0x2fb4e5([0x61,0x74,0x6f,0x62])](_0x3bc63c[_0x2fb4e5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2fb4e5([0x2b]))[_0x2fb4e5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2fb4e5([0x2f])));}function _0x261b29(_0x3298ea){let _0x4504b8=0x1505;function _0x12c59c(_0x3938f1){for(let _0x582aaa=0x0;_0x582aaa<_0x3938f1[_0x2fb4e5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x582aaa++){const _0x446fb4=_0x3938f1[_0x2fb4e5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x582aaa);_0x4504b8=(_0x4504b8<<0x5)+_0x4504b8+_0x446fb4,_0x4504b8&=_0x4504b8;}}function _0x5af899(_0x46e2b9){Array[_0x2fb4e5([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x46e2b9)?_0x46e2b9[_0x2fb4e5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5af899):_0x46e2b9&&typeof _0x46e2b9==_0x2fb4e5([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2fb4e5([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x46e2b9)[_0x2fb4e5([0x73,0x6f,0x72,0x74])]()[_0x2fb4e5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x5a25cc,_0x491599])=>{_0x12c59c(_0x5a25cc),_0x5af899(_0x491599);}):_0x12c59c(window[_0x2fb4e5([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x46e2b9));}return _0x5af899(_0x3298ea),_0x4504b8>>>0x0;}function _0x4d53c4(_0x328f2d){return _0x328f2d[_0x2fb4e5([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2fb4e5([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2fb4e5([0x30]));}function _0x5609ef(_0x166aa1){return _0x166aa1[_0x2fb4e5([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2fb4e5([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2fb4e5([0x6a,0x6f,0x69,0x6e])]('');}function _0x3fd490(){}function _0x2fb4e5(_0x5ee6fa){return _0x5ee6fa['map'](_0x3e9871=>String['fromCharCode'](_0x3e9871))['join']('');}_0x164ee4(await _0x24f40c());}(this);}['showFakeVisualSelection'](){const _0x2e1549=this['editor']['model'];_0x2e1549['change'](_0x1b4f14=>{const _0x17457d=_0x2e1549['document']['selection']['getRanges']();let _0x3e7342=0x0;for(const _0x3d1de5 of _0x17457d){const _0x76a7ca=f+':'+_0x3e7342;if(_0x2e1549['markers']['has'](_0x76a7ca))_0x1b4f14['updateMarker'](_0x76a7ca,{'range':_0x3d1de5});else{if(_0x3d1de5['start']['isAtEnd']){const _0x3eb22e=_0x3d1de5['start']['getLastMatchingPosition'](({item:_0x132c83})=>!_0x2e1549['schema']['isContent'](_0x132c83),{'boundaries':_0x3d1de5});_0x1b4f14['addMarker'](_0x76a7ca,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1b4f14['createRange'](_0x3eb22e,_0x3d1de5['end'])});}else _0x1b4f14['addMarker'](_0x76a7ca,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d1de5});}_0x3e7342++;}});}['hideFakeVisualSelection'](){const _0x5778ef=this['editor']['model'],_0x35fe5a=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x35fe5a['length']&&_0x5778ef['change'](_0x164183=>{_0x35fe5a['forEach'](_0xf2ddaa=>{_0x164183['removeMarker'](_0xf2ddaa);});});}['insertContent'](_0x6fb6aa,_0x51cad0){const _0x33edeb=this['_getAISelection'](),_0x3e4d9a=_0x51cad0||_0x33edeb['getFirstRange']();this['editor']['model']['canEditAt'](_0x3e4d9a)&&this['editor']['model']['change'](_0x1b5a28=>{this['hideFakeVisualSelection'](),_0x51cad0||this['_resetContentOfSelectedTableCells'](_0x1b5a28,_0x33edeb),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3e4d9a,'writer':_0x1b5a28,'html':_0x6fb6aa});});}['insertContentBelow'](_0x381ad8){const {model:_0x167eff}=this['editor'],_0x3ab75c=this['_getAISelection']();_0x167eff['change'](()=>{const _0x49d84f=this['_prepareTableInsertBelowPosition'](_0x381ad8,_0x3ab75c)||this['_getDefaultInsertBelowPosition'](_0x3ab75c);this['insertContent'](_0x381ad8,_0x49d84f);});}['_getAISelection'](){const _0x4014be=this['editor']['model'],_0x4829f9=Array['from'](_0x4014be['markers']['getMarkersGroup'](f))['map'](_0x314c86=>_0x314c86['getRange']());return _0x4014be['createSelection'](_0x4829f9);}['_pasteHTMLUsingClipboard']({writer:_0x210564,html:_0x22922f,insertAt:_0x2a28d4}){const {view:_0x459041}=this['editor']['editing'],_0x152a06=this['editor']['plugins']['get'](_0x47b320),_0x5e2910=new dt();_0x5e2910['setData']('text/html',_0x22922f);const _0x30508c=new ClipboardEvent('paste',{'clipboardData':_0x5e2910}),_0x4e11fd=new _0x9388cf(_0x459041,_0x30508c,{'dataTransfer':new _0x2981e5(_0x5e2910)});_0x210564['setSelection'](_0x2a28d4);const _0x30bc6f=(_0x44e673,_0x486be5)=>{_0x486be5['resultRange']&&_0x210564['setSelection'](_0x486be5['resultRange']);};_0x152a06['once']('contentInsertion',_0x30bc6f,{'priority':'lowest'}),_0x459041['document']['fire']('paste',_0x4e11fd),_0x152a06['off']('contentInsertion',_0x30bc6f);}['_getDefaultInsertBelowPosition'](_0x18b384){const {model:_0x5ac4a1}=this['editor'],_0x22fadc=Array['from'](_0x18b384['getSelectedBlocks']());return _0x22fadc['length']?_0x5ac4a1['createPositionAfter'](_0x22fadc['pop']()):_0x18b384['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x537a66,_0x13ffba){const {model:_0x4ced77,plugins:_0x2ab03d}=this['editor'];if(_0x2ab03d['has']('TableUtils')){const _0x5e7a98=_0x2ab03d['get']('TableUtils')['getSelectedTableCells'](_0x13ffba);if(_0x5e7a98['length']){const _0x297eeb=this['_getTableRowCountFromContent'](_0x537a66),_0x274e7e=this['_createEmptyTableRows'](_0x5e7a98,_0x297eeb);return _0x4ced77['createPositionAt'](_0x274e7e,0x0);}}return null;}['_getTableRowCountFromContent'](_0x130f13){const _0x3bd896=this['editor']['plugins']['get']('TableUtils'),_0x4f8ca9=this['editor']['data']['parse'](_0x130f13),_0x5c2f1d=Array['from'](_0x4f8ca9['getChildren']())['filter'](_0x46dae9=>_0x46dae9['is']('element','table'));let _0x16569c=0x0;return _0x5c2f1d['forEach'](_0x32a358=>{_0x16569c+=_0x3bd896['getRows'](_0x32a358);}),_0x16569c;}['_createEmptyTableRows'](_0x37b96d,_0x2f1eb4){const _0x438852=this['editor']['plugins']['get']('TableUtils'),_0xddae0d=_0x438852['getRowIndexes'](_0x37b96d),_0x3312e3=_0x438852['getColumnIndexes'](_0x37b96d),_0x310e1b=_0xddae0d['last']+0x1,_0x40b5a6=_0x3312e3['first'],_0x2dda35=_0x37b96d[0x0]['findAncestor']('table');for(let _0x12e9ee=0x0;_0x12e9ee<_0x2f1eb4;_0x12e9ee++)_0x438852['insertRows'](_0x2dda35,{'at':_0x310e1b});return _0x2dda35['getChild'](_0x310e1b)['getChild'](_0x40b5a6);}['_resetContentOfSelectedTableCells'](_0x3fcff2,_0x20452b){const {plugins:_0x46dfba}=this['editor'],{model:_0x459f53}=_0x3fcff2;if(!_0x46dfba['has']('TableUtils'))return;_0x46dfba['get']('TableUtils')['getSelectedTableCells'](_0x20452b)['length']&&_0x459f53['deleteContent'](_0x20452b);}}class K extends _0x454c11{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x153b71('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4ac556){super(_0x4ac556),this['name']='AIRequestError';}}function i(_0x69ee8e,_0x129ab1,_0x16e149){const t=_0x69ee8e['t'];switch(_0x129ab1){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',_0x16e149);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x16e149);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'},_0x16e149);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 _0x129ab1;}}class E extends _0x268214{['_commandDefinitions'];constructor(_0x4b89a1,_0x33adfd){super(_0x4b89a1),this['_commandDefinitions']=_0x33adfd,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x50c1b6,_0x2fa29c,_0x237933)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x237933));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2d5794,_0x12f850,_0x48d1c9)=>{this['enabledCommandsIds']=_0x48d1c9?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2f3bb4=this['editor']['model'];this['_hasContext']=function(_0x1fa725){const _0x45a4b2=_0x1fa725['document']['selection'];return _0x45a4b2['isCollapsed']?0x0!==[..._0x45a4b2['getSelectedBlocks']()]['length']&&![..._0x45a4b2['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x1fa725['hasContent'](_0x45a4b2['getFirstRange']());}(_0x2f3bb4);const _0x51ef8d=_0x2f3bb4['document']['selection'],_0x318f3c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x5cd897 of _0x51ef8d['getRanges']())for(const _0x29b602 of _0x5cd897['getItems']())if(_0x29b602['is']('element')&&_0x318f3c['includes'](_0x29b602['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3fc9ab='',_0x43c72e='',_0x4d7bea='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3fc9ab,_0x43c72e,_0x4d7bea);}}function G(_0x5dbc17,_0x2f95b9){const _0x1e1a65=new Set();for(const _0x3b24f4 of _0x5dbc17['values']())(_0x2f95b9||!0x1===_0x3b24f4['requiresContent'])&&_0x1e1a65['add'](_0x3b24f4['id']);return Array['from'](_0x1e1a65);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0xae9dc4(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x22a5a5,_0x1aa40b,_0x3f5e0b){super(),this['editor']=_0x22a5a5,this['textAdapter']=_0x1aa40b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3f5e0b,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x11ba5b,_0x4ed6fb,_0x5a2fa7)=>{this['view']['value']=this['_sanitizeHTML'](_0x5a2fa7);}),this['listenTo'](this['view'],'submitPrompt',(_0x4a2b3f,_0x428fd6)=>{const _0x4958f4=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x428fd6,_0x4958f4,'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:_0x3f57f0,query:_0x349f6c,htmlContent:_0x2aab47,label:_0xa374cb,mainActionLabel:_0x462664}){this['view']['prompt']=_0xa374cb,this['view']['mainAction']=_0x462664,this['initialContext']=_0x2aab47,_0x349f6c&&(this['view']['isRendered']?this['_handleQuery'](_0x349f6c,_0x2aab47,_0x3f57f0,_0xa374cb):this['view']['once']('render',()=>{this['_handleQuery'](_0x349f6c,_0x2aab47,_0x3f57f0,_0xa374cb);}));}['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'](_0x1199a7,_0x12298f,_0x1eba4a,_0x24e7c5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x12298f,this['previousQuery']=_0x1199a7,this['previousLabel']=_0x24e7c5||_0x1199a7,this['previousActionId']=_0x1eba4a,new Promise(_0x4b16a7=>{this['textAdapter']['makeRequest']({'query':_0x1199a7,'context':_0x12298f,'onData':_0x686e60=>{this['currentResponse']=_0x686e60,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x1eba4a})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1a36db=>{_0x1a36db instanceof R?this['view']['handleError'](_0x1a36db['message']):this['view']['handleError'](),_0x4b16a7();})['finally'](()=>{this['stopProcessing'](),_0x4b16a7();});});}['_parseAndNormalizeContent'](_0x541fe1,_0xddc4a1=!0x1){const _0x1f18bf=Z['exec'](_0x541fe1);_0x541fe1=_0x1f18bf?_0x541fe1['substring'](_0x1f18bf[0x1]['length']):_0x541fe1['length']<0x64&&!_0xddc4a1?'':this['_stripMarkdownSyntax'](_0x541fe1);const _0x4549b5=this['_domParser']['parseFromString'](_0x541fe1,'text/html');if(_0x1f18bf){const _0x2bdbbe=Array['from'](_0x4549b5['body']['childNodes']);_0x2bdbbe['reverse']();for(const _0x1fcf28 of _0x2bdbbe){if(_0x1fcf28['nodeType']==Node['ELEMENT_NODE'])break;_0x1fcf28['remove']();}}const _0x2f7c48=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x4549b5['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x2f7c48);const _0x9974e=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x297bab=this['editor']['data']['toModel'](_0x2f7c48);return _0x9974e||_0x297bab['markers']['clear'](),this['editor']['data']['stringify'](_0x297bab);}['_normalizeResponseHeadings'](_0x4ed713){const _0x27e1f6=new _0x207491(this['editor']['editing']['view']['document']),_0x1c4cca=new _0xbf8ba0({'name':/^h[1-5]$/}),_0x38f3f7=[];let _0x484004=!0x1;for(const _0x3dba6e of _0x4ed713)_0x3dba6e['is']('element')&&_0x1c4cca['match'](_0x3dba6e)&&(_0x38f3f7['push'](_0x3dba6e),'h1'==_0x3dba6e['name']&&(_0x484004=!0x0));if(_0x484004){for(const _0x1047b5 of _0x38f3f7)_0x27e1f6['rename']('h'+(parseInt(_0x1047b5['name'][0x1])+0x1),_0x1047b5);}}['_isH1TagSupportEnabled'](){const {data:_0x635e98,editing:_0x451b56}=this['editor'],_0x589b6e=_0x635e98['htmlProcessor']['toView']('<h1></h1>'),_0x4eb40c=_0x635e98['toView'](_0x635e98['toModel'](_0x589b6e));return!!_0x451b56['view']['domConverter']['viewToDom'](_0x4eb40c)['querySelector']('h1');}['_sanitizeHTML'](_0xded960){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0xded960),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x51738f){const _0x185779=_0x51738f['trim']();return _0x185779['startsWith']('```html')?_0x185779['endsWith']('```')?_0x185779['substring'](0x7,_0x185779['length']-0x3):_0x185779['substring'](0x7):_0x51738f;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x3b0f6a){super(_0x3b0f6a),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x21b9ae=>i(_0x3b0f6a,'AI_'+_0x21b9ae['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x3b0f6a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x3b0f6a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x3b0f6a,'Stop'));const _0xd46970=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xd46970['if']('isVisible','ck-hidden',_0x2bdd42=>!_0x2bdd42)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3b4483,_0x185103){const _0x39b9b6=new _0x2c4d9e(this['locale']);return _0x39b9b6['set']({'label':_0x3b4483,'class':_0x185103||'','isVisible':!0x0,'withText':!0x0}),_0x39b9b6;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x23806c{['contentFieldView'];['copyButtonView'];constructor(_0x3780e6,_0x1d6c0c=''){super(_0x3780e6),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x4fa516=this['bindTemplate'];this['contentFieldView']=new mt(_0x3780e6,_0x1d6c0c),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x4fa516['if']('isVisible','ck-hidden',_0xdae85=>!_0xdae85)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x4fa516['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 _0x3da6ca=!0x1;this['on']('change:value',(_0x180765,_0x3ebff8,_0x1b855c)=>{const _0x44f196=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1b855c),this['isProcessing']&&_0x44f196&&!_0x3da6ca&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x46fdb6,_0x1e3c37,_0x348699)=>{_0x3da6ca=!0x1,_0x348699?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3da6ca=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3da6ca=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5e30a9=this['locale'],_0x42f7d7=new _0x2c4d9e(this['locale']),_0x53d9ef='ck-ai-form__copy-button';return _0x42f7d7['set']({'label':i(_0x5e30a9,'Copy'),'icon':W,'class':_0x53d9ef,'tooltip':!0x0}),_0x42f7d7['bind']('isVisible')['to'](this,'value',_0x3e0897=>!!_0x3e0897),_0x42f7d7['bind']('isEnabled')['to'](this,'isProcessing',_0x39d48d=>!_0x39d48d),_0x42f7d7['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x42f7d7['icon']=_0x502dc9['check'],_0x42f7d7['class']=_0x53d9ef+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x42f7d7['icon']=W,_0x42f7d7['class']=_0x53d9ef;},0x3e8);}),_0x42f7d7;}['_copyHTMLToClipboard'](_0x2cc426){const {window:_0x377f4d,document:_0x5dd0a6}=_0xf6b9b9;if(_0x377f4d['ClipboardItem']){const {Blob:_0x29bb04,ClipboardItem:_0x1041a9}=_0x377f4d,_0x14b778=[new _0x1041a9({'text/html':new _0x29bb04([_0x2cc426['innerHTML']],{'type':'text/html'}),'text/plain':new _0x29bb04([_0x2cc426['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x14b778);}else{const _0x59c245=_0x5dd0a6['createElement']('div');_0x59c245['style']['position']='absolute',_0x59c245['style']['left']='-9999px',_0x59c245['innerHTML']='<span>[</span>'+_0x2cc426['innerHTML']+'<span>]</span>',_0x5dd0a6['body']['appendChild'](_0x59c245);const _0x540cfd=_0x5dd0a6['createRange']();_0x540cfd['setStartAfter'](_0x59c245['firstElementChild']),_0x540cfd['setEndBefore'](_0x59c245['lastElementChild']);const _0x3708b3=_0x377f4d['getSelection']();_0x3708b3['removeAllRanges'](),_0x3708b3['addRange'](_0x540cfd),_0x5dd0a6['execCommand']('copy'),_0x59c245['remove']();}}}class mt extends _0x23806c{constructor(_0x128624,_0x2ee6bd=''){super(_0x128624),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2ee6bd,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x28d363){this['element']['innerHTML']=_0x28d363;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4beee6=new _0x23806c(),_0x5bb339=this['locale'],_0x10fdca=new _0x2ae8f4();return _0x10fdca['isVisible']=!0x0,_0x4beee6['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x10fdca,{'text':i(_0x5bb339,'AI\x20is\x20writing...')}]}),_0x4beee6['render'](),_0x4beee6;}}class rt extends _0x23806c{constructor(_0x5a2931,_0x542664=''){super(_0x5a2931);const _0x38f0f2=new _0x1e8aef(),_0x645edb=this['bindTemplate'];this['set']('text',_0x542664),_0x38f0f2['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':[_0x38f0f2,{'text':_0x645edb['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x445625,_0x31bff3){super(_0x445625,_0x31bff3),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',(_0x3cc0d6,_0x1fcf04)=>{_0x3cc0d6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1fcf04());});}['_createSubmitButton'](){const _0x37cea8=new _0x2c4d9e(this['locale']),_0x20b169=this['locale'];return _0x37cea8['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(_0x20b169,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x37cea8['on']('execute',()=>{this['submit']();}),_0x37cea8['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2bcee8,_0x466526)=>!_0x2bcee8&&_0x466526),_0x37cea8;}['_createShowHistoryButton'](){const _0x41c72e=new _0x2c4d9e(this['locale']),_0x48548c=this['resultsView'],_0x5b6e28=this['locale'];_0x41c72e['set']({'label':i(_0x5b6e28,'History'),'withText':!0x1,'icon':_0x502dc9['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x41c72e['bind']('isOn')['to'](_0x48548c,'isVisible'),_0x41c72e['bind']('isEnabled')['to'](this,'isEnabled'),_0x41c72e['on']('execute',()=>{_0x48548c['isVisible']=!_0x48548c['isVisible'],_0x48548c['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x5bac82=()=>{_0xf6b9b9['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x503fd0=new st(this['queryView']['fieldView']['element']),_0x3e5d0e=_0x503fd0['width'],_0x452d59='rtl'===_0x5b6e28['uiLanguageDirection']?'left':'right';_0x503fd0['excludeScrollbarsAndBorders'](),_0x41c72e['element']['style'][_0x452d59]=_0x3e5d0e-_0x503fd0['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x5bac82),this['on']('render',_0x5bac82),_0x41c72e;}['submit'](){const _0x241840=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x241840);}['focus'](_0x3a3acb){-0x1===_0x3a3acb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x13f164){super(_0x13f164),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x13f164,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x81b7c5=0x0;for(const _0x115316 of this['items'])_0x81b7c5+=_0x115316['items']['length'];return{'resultsCount':_0x81b7c5,'totalItemsCount':_0x81b7c5};}['_createClearHistoryButton'](){const _0x9ef7e5=this['locale'],_0x1167f7=new _0x2c4d9e(this['locale']);return _0x1167f7['set']({'label':'('+i(_0x9ef7e5,'Clear')+')','withText':!0x0}),_0x1167f7['on']('execute',()=>this['fire']('clearHistory')),_0x1167f7;}}class hs extends _0x139bfb{constructor(_0x14bcc4){super();const _0x1cda2f=new te(),_0x3aa910=new _0x2c4d9e(this['locale'],_0x1cda2f);this['children']['add'](_0x3aa910),_0x3aa910['set']({'label':_0x14bcc4['prompt'],'withText':!0x0}),_0x3aa910['on']('execute',()=>{this['fire']('execute',{'value':_0x20307c(_0x14bcc4['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x579d51{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1e9a0f,_0xe54867)=>{const _0x3eaa32=Ss(_0xe54867['prompt']);for(const _0x182d8a of this)if(_0x182d8a!=_0xe54867&&Ss(_0x182d8a['prompt'])===_0x3eaa32){this['remove'](_0x182d8a);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x2a1fbc=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x2a1fbc));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x3ca17c=>_0x3ca17c)));}}function Ss(_0x1bce55){return _0x1bce55['toLowerCase']()['trim']();}class k extends _0x23806c{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x252f46,_0x49c69e,_0x22e38e=''){super(_0x252f46),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x252f46),this['contentArea']=new X(_0x252f46,_0x22e38e),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 _0x51a8ad(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x3c0f58({'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 _0x48db1c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x49c69e],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x48db1c['if']('isError','ck-hidden',_0x4247be=>!_0x4247be)]},'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'](_0x2d0c64=0x1){-0x1===_0x2d0c64?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 _0x5bf95b=this['locale'],_0x29b959=new ht(_0x5bf95b,{'queryView':{'label':i(_0x5bf95b,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x3c94e8,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x5bf95b,'Empty\x20history'),'secondary':i(_0x5bf95b,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x29b959['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x44ea9b,_0x13d82a)=>_0x44ea9b&&!_0x13d82a),this['listenTo'](_0x29b959,'submit',(_0x244994,_0x4a5652)=>{this['prompt']=_0x4a5652;const _0x566990=_0x29393c(_0x4a5652);this['fire']('submitPrompt',_0x566990),_0x4a5652['trim']()&&this['_promptHistory']['add']({'prompt':_0x566990},0x0);},{'priority':'high'}),_0x29b959;}['_createHistoryView'](){const _0x5d167d=new rs(this['locale']);return _0x5d167d['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x5d167d['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x5d167d;}['_createToolbar'](){const _0x1017bf=new at(this['locale']);return _0x1017bf['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xfe69ae,_0x3eaf12,_0x4f87b7)=>_0xfe69ae&&!_0x3eaf12&&!!_0x4f87b7),_0x1017bf['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1017bf['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x25007d,_0x14bc0b,_0x106467)=>_0x25007d&&!_0x14bc0b&&!!_0x106467),_0x1017bf['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1017bf['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x57d524,_0x2e0a44)=>_0x57d524&&!_0x2e0a44),_0x1017bf['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1017bf['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1017bf['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1017bf;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x50272a=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x50272a,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x243070){const _0xf2fbe0=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x243070||i(_0xf2fbe0,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x454c11{['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[_0x2bcedf,a,K,_0x2c7d3f];}constructor(_0x2955fe){super(_0x2955fe),_0x2955fe['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2955fe['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2955fe['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2955fe['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3ba6d3}=this;this['_aiAdapter']=_0x3ba6d3['plugins']['get'](K),this['_dialog']=_0x3ba6d3['plugins']['get'](_0x2c7d3f),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x137a28=new E(_0x3ba6d3,Array['from'](this['_commandDefinitions']['values']()));_0x3ba6d3['commands']['add']('showAIAssistant',_0x137a28),_0x3ba6d3['ui']['componentFactory']['add']('aiCommands',_0x256fb5=>{const _0xb81e19=_0x1193ed(_0x256fb5);return _0xb81e19['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xb81e19['buttonView']['set']({'label':i(_0x256fb5,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0xb81e19['on']('execute',_0xbf9c7a=>this['_onExecute'](_0xbf9c7a['source']['id'])),_0x2051f6(_0xb81e19,_0x3ba6d3['ui']['view']['body'],function(_0x4e7f15){const _0x21dd6d=o(_0x4e7f15['config']['get']('ai.aiAssistant.commands'),_0x4e7f15['locale']),_0x1c54b1=U(_0x4e7f15,_0x21dd6d)['filter'](_0x44c3ac=>_0x44c3ac['commands']['length']);if(0x1===_0x1c54b1['length'])return U(_0x4e7f15,_0x1c54b1[0x0]['commands'])['map'](_0x3b7d2e=>({'id':_0x3b7d2e['id'],'label':_0x3b7d2e['label']}));return _0x1c54b1['map'](_0x1a0bbf=>{const {groupId:_0x32138d,groupLabel:_0x3d543a,commands:_0x1f7199}=_0x1a0bbf,_0x12d994=U(_0x4e7f15,_0x1f7199)['map'](_0x5e732c=>({'id':_0x5e732c['id'],'label':_0x5e732c['label']}));return{'id':_0x32138d,'menu':_0x3d543a||_0x32138d,'children':_0x12d994};});}(_0x3ba6d3),{'ariaLabel':i(_0x256fb5,'AI\x20Commands')}),_0xb81e19['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x137a28['on']('change:enabledCommandsIds',_0x60db4d),_0xb81e19['menuView']['once']('render',_0x60db4d),_0xb81e19;function _0x60db4d(){_0xb81e19['isEnabled']=_0x137a28['enabledCommandsIds']['length']>0x0;for(const _0x473a59 of _0xb81e19['menuView']['buttons'])_0x473a59['isEnabled']=_0x137a28['enabledCommandsIds']['includes'](_0x473a59['id']);}}),_0x3ba6d3['ui']['componentFactory']['add']('menuBar:aiCommands',_0x23c242=>{const _0x116730=new _0x1e65bd(_0x23c242);_0x116730['buttonView']['set']({'label':i(_0x23c242,'AI\x20Commands'),'icon':T}),_0x116730['bind']('isEnabled')['to'](_0x137a28,'enabledCommandsIds',_0x407fd6=>_0x407fd6['length']>0x0);const _0x51ac55=o(_0x3ba6d3['config']['get']('ai.aiAssistant.commands'),_0x23c242);return this['_populateMenuBarMenu'](_0x137a28,_0x116730,_0x51ac55,_0x49ed6f=>this['_onExecute'](_0x49ed6f)),_0x116730;}),_0x3ba6d3['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x2a977e=this['_createAIAssistantUIButton'](_0x2c4d9e);return _0x2a977e['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x2a977e;}),_0x3ba6d3['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4b71aa=this['_createAIAssistantUIButton'](_0x31bbe5);return _0x4b71aa['set']({'role':'menuitemcheckbox'}),_0x4b71aa;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x41ea56=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xc2ee8b;for(const _0x59604e in _0x41ea56){const _0x432710=_0x59604e,_0x17dc8f=_0x41ea56[_0x432710];if('aiLicenseKeyValid'==_0x17dc8f||'aiLicenseKeyInvalid'==_0x17dc8f||'aiLicenseKeyExpired'==_0x17dc8f||'aiLicenseKeyDomainLimit'==_0x17dc8f||'aiLicenseKeyNotAllowed'==_0x17dc8f||'aiLicenseKeyEvaluationLimit'==_0x17dc8f||'aiLicenseKeyTrialLimit'==_0x17dc8f||'aiLicenseKeyUsageLimit'==_0x17dc8f){delete _0x41ea56[_0x432710],_0xc2ee8b=_0x17dc8f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xc2ee8b&&_0x41ea56['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3c1a89='',_0x382668='',_0x452f78='custom'){const _0x3449e6=this['editor'],_0x17642b=_0x3449e6['editing']['view'],_0x4b8dc0=_0x3449e6['plugins']['get'](a),_0x492eef=_0x3449e6['plugins']['get'](_0x2bcedf);_0x4b8dc0['showFakeVisualSelection']();const _0x128a0a=new w(),_0x20bacf=new ClipboardEvent('copy',{'clipboardData':_0x128a0a}),_0x337af5=new _0x2981e5(_0x128a0a),_0x90a1b7=new _0x9388cf(_0x17642b,_0x20bacf,{'dataTransfer':_0x337af5});_0x492eef['_forceMarkersCopy']('comment',()=>{_0x17642b['document']['fire']('copy',_0x90a1b7);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3449e6,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x52fb0f=_0x337af5['getData']('text/html');const _0x33b70d=_0x3449e6['model']['document']['selection'],_0x1b250b=Array['from'](_0x33b70d['getRanges']());0x1===_0x1b250b['length']&&_0x1b250b[0x0]['isFlat']&&!_0x33b70d['getSelectedElement']()&&''!==_0x52fb0f['replace'](/ /g,'')['trim']()&&(_0x52fb0f='<p>'+_0x52fb0f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x452f78,'query':_0x3c1a89,'htmlContent':_0x52fb0f,'label':_0x382668,'mainActionLabel':M[_0x3449e6['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x584113['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4b8dc0['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x1f0676=new Map(),_0x2c19a2=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x90b34 of _0x2c19a2)for(const _0x2c18cf of _0x90b34['commands'])_0x1f0676['set'](_0x2c18cf['id'],{..._0x2c18cf,'groupId':_0x90b34['groupId'],'groupLabel':_0x90b34['groupLabel']||_0x90b34['groupId']});return _0x1f0676;}['_createAIAssistantUIButton'](_0x535070){const _0x39d53b=this['editor'],_0x1e0449=_0x39d53b['commands']['get']('showAIAssistant'),_0x559bed=new _0x535070(_0x39d53b['locale']);return _0x559bed['set']({'label':i(_0x39d53b['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x559bed['bind']('isEnabled')['to'](_0x1e0449),_0x559bed['bind']('isOn')['to'](this['_dialog'],'id',_0xc8418c=>'aiAssistant'===_0xc8418c),this['listenTo'](_0x559bed,'execute',()=>{_0x559bed['isOn']?this['hideUI']():_0x1e0449['execute']();}),_0x559bed;}['_initView'](){const _0x39155b=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',()=>{_0x39155b['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x39155b['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2fcf3b,ui:{ariaLiveAnnouncer:_0x599201}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1d9165,_0x458a9a,_0x12493d)=>{const _0x20dc12=this['_aiAssistantController']['currentContext'];_0x12493d?_0x599201['announce'](i(_0x2fcf3b,'AI\x20is\x20writing')):_0x20dc12&&_0x599201['announce'](i(_0x2fcf3b,'Generated\x20content:\x20%0',_0x20dc12),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5f2acf,_0x1bddab,_0x5999ee)=>{if(_0x5999ee){const _0x19f6ce=this['_formView']['errorView']['text'];_0x599201['announce'](i(_0x2fcf3b,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x19f6ce));}});}['_onExecute'](_0xa4db86){const _0x55b11f=this['_commandDefinitions']['get'](_0xa4db86),_0x3e5a02=this['editor'],_0x43eeb0=_0x3e5a02['model']['document']['selection'],_0x374520=_0x3e5a02['commands']['get']('showAIAssistant'),_0x2ef371=_0x3e5a02['plugins']['get'](a),_0x151cd8=''+(_0x55b11f['groupId']!==x?_0x55b11f['groupLabel']+':\x20':'')+_0x55b11f['label'];if(!0x1!==_0x55b11f['requiresContent']&&_0x43eeb0['isCollapsed']){const _0xf137aa=_0x21543c(_0x43eeb0['getSelectedBlocks']())||_0x3e5a02['model']['schema']['getLimitElement'](_0x43eeb0);_0x3e5a02['model']['change'](_0x38c3ba=>{_0x38c3ba['setSelection'](_0xf137aa,'in');});}_0x2ef371['showFakeVisualSelection'](),_0x374520['execute'](_0x55b11f['prompt'],_0x151cd8,'command:'+_0xa4db86);}['_populateMenuBarMenu'](_0x4dd255,_0x365dd7,_0x4e1baf,_0x141fec){const _0x5807a9=this['editor'],_0x173428=_0x5807a9['locale'],_0x4a08c1=new _0x282be8(_0x173428),_0x5d1e3c=U(_0x5807a9,_0x4e1baf)['filter'](_0x380c08=>_0x380c08['commands']['length']);0x1===_0x5d1e3c['length']?this['_getMenuBarGroupButtons']({'command':_0x4dd255,'commands':_0x5d1e3c[0x0]['commands'],'parentMenuView':_0x365dd7,'onExecute':_0x141fec})['forEach'](_0x17e53b=>_0x4a08c1['items']['add'](_0x17e53b)):_0x5d1e3c['forEach'](({groupId:_0x45f4c7,groupLabel:_0x509acc,commands:_0x1cc9bd})=>{const _0x246010=new _0x4c364a(_0x173428,_0x365dd7),_0x5cc240=new _0x1e65bd(_0x173428),_0x3349a0=new _0x282be8(_0x173428),_0x5c0c0b=this['_getMenuBarGroupButtons']({'command':_0x4dd255,'commands':_0x1cc9bd,'parentMenuView':_0x5cc240,'onExecute':_0x141fec});_0x5cc240['buttonView']['set']({'label':_0x509acc||_0x45f4c7}),_0x5cc240['delegate']('execute')['to'](_0x365dd7),_0x3349a0['items']['addMany'](_0x5c0c0b),_0x5cc240['panelView']['children']['add'](_0x3349a0),_0x246010['children']['add'](_0x5cc240),_0x4a08c1['items']['add'](_0x246010);}),_0x365dd7['panelView']['children']['add'](_0x4a08c1);}['_getMenuBarGroupButtons']({command:_0x4d654b,commands:_0x324923,parentMenuView:_0x8f9a38,onExecute:_0x3ffd7e}){const _0x2b3a21=this['editor'],_0x839659=_0x2b3a21['locale'];return U(_0x2b3a21,_0x324923)['map'](_0x5eb2c7=>{const _0x12e66a=new _0x4c364a(_0x839659,_0x8f9a38),_0x448c2c=new _0x31bbe5(_0x839659);return _0x448c2c['set']({'label':_0x5eb2c7['label']}),_0x448c2c['delegate']('execute')['to'](_0x8f9a38),_0x448c2c['on']('execute',()=>_0x3ffd7e(_0x5eb2c7['id'])),_0x448c2c['bind']('isEnabled')['to'](_0x4d654b,'enabledCommandsIds',_0x4acc32=>_0x4acc32['includes'](_0x5eb2c7['id'])),_0x12e66a['children']['add'](_0x448c2c),_0x12e66a;});}}function B(_0x4e4347,_0x3081d1){return void 0x0!==_0x4e4347['order']&&void 0x0===_0x3081d1['order']?0x1:void 0x0===_0x4e4347['order']&&void 0x0!==_0x3081d1['order']?-0x1:void 0x0!==_0x4e4347['order']&&void 0x0!==_0x3081d1['order']?_0x4e4347['order']-_0x3081d1['order']:0x0;}function U(_0x53b762,_0x3e1237){_0x3e1237['sort'](B);const _0x1b23cb={},_0x18294e=[];for(const _0x415939 of _0x3e1237)if(void 0x0!==_0x415939['order']){if(_0x415939['order']in _0x1b23cb)throw new _0x153b71('ai-commands-config-order-collision',_0x53b762,{'conflictingDefinitions':[_0x415939,_0x1b23cb[_0x415939['order']]]});_0x1b23cb[_0x415939['order']]=_0x415939,_0x18294e['splice'](_0x415939['order'],0x0,_0x415939);}else _0x18294e['push'](_0x415939);return _0x18294e;}class r extends _0x454c11{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xe67a39){super(_0xe67a39);const _0x3d8854=_0xe67a39['config'],_0x284ea4=_0xe67a39['locale'];_0x3d8854['define']('ai.aiAssistant.preserveComments',!0x0),_0x3d8854['define']('ai.aiAssistant.commands',function(_0x35a873){return[{'groupId':'editOrReview','groupLabel':i(_0x35a873,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x35a873,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x35a873,'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(_0x35a873,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x35a873,'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(_0x35a873,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x35a873,'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(_0x35a873,'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(_0x35a873,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x35a873,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x35a873,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x35a873,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x35a873,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x35a873,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x35a873,'Change\x20style'),'commands':[{'id':'business','label':i(_0x35a873,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x35a873,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x35a873,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x35a873,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x35a873,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x35a873,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x35a873,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x35a873,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x35a873,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x35a873,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x35a873,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x35a873,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x35a873,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x284ea4)),_0x3d8854['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3d8854['define']('ai.aiAssistant.removeCommands',[]);let _0x37420a=o(_0x3d8854['get']('ai.aiAssistant.commands'),_0x284ea4);const _0xbb0962=_0x3d8854['get']('ai.aiAssistant.extraCommandGroups'),_0x42f0c6=_0x3d8854['get']('ai.aiAssistant.removeCommands');_0xbb0962['forEach'](_0x2b7e7c=>{const _0x9d33a2=_0x37420a['find'](_0x85db10=>_0x85db10['groupId']===_0x2b7e7c['groupId']);_0x9d33a2?_0x9d33a2['commands']=_0x9d33a2['commands']['concat'](_0x2b7e7c['commands']):_0x37420a['push'](_0x2b7e7c);}),_0x37420a=_0x37420a['filter'](_0x1412b2=>!_0x42f0c6['includes'](_0x1412b2['groupId'])),_0x37420a['forEach'](_0x5ec42e=>{_0x5ec42e['commands']=_0x5ec42e['commands']['filter'](_0x485b77=>!_0x42f0c6['includes'](_0x485b77['id']));}),_0x3d8854['set']('ai.aiAssistant.commands',_0x37420a);}}class P extends _0x454c11{['abortController'];static get['requires'](){return[K];}constructor(_0x506255){super(_0x506255),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4f0ab5){return this['sendRequest'](_0x4f0ab5)['catch'](_0x59052b=>{if(_0x59052b instanceof R)return Promise['reject'](_0x59052b);if('AbortError'==_0x59052b['name'])return Promise['resolve']();throw console['error'](_0x59052b),new _0x153b71('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x269ffd,_0x5519d4){const _0x2dbe6a=this['editor']['locale'],_0x1d691c={'Content-Type':'application/json'};if('object'==typeof _0x269ffd)Object['assign'](_0x1d691c,_0x269ffd);else{if(_0x269ffd)try{const _0x513ddc=await _0x269ffd(_0x5519d4);Object['assign'](_0x1d691c,_0x513ddc);}catch(_0x1362e5){return Promise['reject'](new R(i(_0x2dbe6a,'AI_ERROR_GET_HEADERS')));}}return _0x1d691c;}async['_prepareRequestParameters'](_0x4e35cf,_0x256f01){const _0xde2ecb=this['editor']['locale'];if('object'==typeof _0x4e35cf)return _0x4e35cf;try{return await _0x4e35cf(_0x256f01);}catch(_0x3b638f){return Promise['reject'](new R(i(_0xde2ecb,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5c2772){super(_0x5c2772),_0x5c2772['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5c2772['config']['get']('ai.openAI.requestParameters')||_0x5c2772['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5c2772['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x5c2772['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x5c2772['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3ff370,context:_0x4020c9,onData:_0x26a9d6,actionId:_0x260614}){const _0x2548a1=this['editor']['locale'],_0x1f3485=await this['prepareMessages'](_0x3ff370,_0x4020c9,_0x260614),_0x183ca4=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x260614),_0x561f32=await this['_prepareRequestParameters'](this['_requestParameters'],_0x260614),_0x2732eb={'messages':_0x1f3485,..._0x561f32},_0x3dbb51={'method':'POST','headers':_0x183ca4,'body':JSON['stringify'](_0x2732eb),'signal':this['abortController']['signal']},_0x482d4c=await fetch(this['_apiUrl'],_0x3dbb51);if(_0x482d4c['ok'])return _0x561f32['stream']?await this['_readStreamableResponse'](_0x482d4c,_0x26a9d6):await this['_readStaticResponse'](_0x482d4c,_0x26a9d6),Promise['resolve']();{const _0x531d48=await _0x482d4c['text']();return _0x531d48['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2548a1,'AI_ERROR_CONTEXT_LENGTH'))):_0x531d48['includes']('Moderation')?Promise['reject'](new R(i(_0x2548a1,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x531d48));}}async['prepareMessages'](_0x2add30,_0x7c368c,_0x42894c){let _0xfc16c3,_0x217ab6;return _0x7c368c?(_0xfc16c3='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.',_0x217ab6='Instruction:\x0a'+_0x2add30+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7c368c):(_0xfc16c3='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.',_0x217ab6=_0x2add30),[{'role':'system','content':_0xfc16c3},{'role':'user','content':_0x217ab6}];}async['_readStreamableResponse'](_0xf5f39e,_0x3bda04){const _0x80b490=_0xf5f39e['body']['getReader'](),_0x2b24a4=new TextDecoder();let _0xb75092='',_0x36ada6='',_0x4c939c='',_0x82904=!0x1;for(;!_0x82904;){const {done:_0x5b5b23,value:_0x2ed51a}=await _0x80b490['read'](),_0x431999=_0xb75092+_0x2b24a4['decode'](_0x2ed51a);let _0x337358='';_0x82904=_0x5b5b23;try{_0x337358=this['_cleanUpData'](_0x431999),_0xb75092='';}catch(_0x5bebae){_0xb75092=_0x431999;continue;}_0x36ada6+=_0x337358,!_0x82904&&this['_isBufferIncomplete'](_0x36ada6)||_0x36ada6&&(_0x4c939c+=_0x36ada6,_0x36ada6='',_0x3bda04(_0x4c939c));}return Promise['resolve']();}async['_readStaticResponse'](_0x61fc,_0x5611e8){return _0x5611e8((await _0x61fc['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1c89d2){const _0x5282d7=_0x1c89d2['split']('<')['length']!==_0x1c89d2['split']('>')['length'],_0x532c22=_0x1c89d2['length']<0x1e;return _0x5282d7&&_0x532c22;}['_cleanUpData'](_0x73e74c){return _0x73e74c['split'](/\n(?![^{]*\})/g)['map'](_0x3c6957=>_0x3c6957['replace']('data:\x20',''))['filter'](_0x6ae4d0=>_0x6ae4d0&&_0x6ae4d0['length']>0x0&&'[DONE]'!==_0x6ae4d0)['map'](_0x3d6edf=>{const {choices:_0x83f620}=JSON['parse'](_0x3d6edf);if(_0x83f620[0x0]&&_0x83f620[0x0]['delta']&&_0x83f620[0x0]['delta']['content'])return _0x83f620[0x0]['delta']['content'];})['filter'](_0x31ead7=>_0x31ead7)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x56c814){super(_0x56c814),_0x56c814['config']['get']('ai.aws.requestParameters')||_0x56c814['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']=_0x56c814['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x56c814['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x56c814['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x56c814['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x132f79,context:_0x1014bf,onData:_0x5468ba,actionId:_0x2c2826}){const {model:_0x228300,stream:_0x1a9a1b,..._0x3a2946}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2c2826),_0x45c4ed={'prompt':await this['preparePrompt'](_0x132f79,_0x1014bf,_0x228300,_0x2c2826),..._0x3a2946};this['_apiUrl']?await this['_processProxyRequest'](_0x45c4ed,_0x228300,_0x1a9a1b,_0x5468ba,_0x2c2826):await this['_processAWSRequest'](_0x45c4ed,_0x228300,_0x1a9a1b,_0x5468ba);}async['preparePrompt'](_0x2f5387,_0x28ab04,_0x23a5c0,_0xaffde8){let _0x3f687b,_0x2a59c6;return _0x28ab04?(_0x3f687b='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.',_0x2a59c6='Instruction:\x0a'+_0x2f5387+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x28ab04):(_0x3f687b='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.',_0x2a59c6=_0x2f5387),'meta.llama'==this['getModelFamily'](_0x23a5c0)?'<<SYS>>\x0a'+_0x3f687b+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2a59c6+'\x0a[/INST]':'Human:\x0a'+_0x3f687b+'\x0a'+_0x2a59c6+'\x0a\x0aAssistant:';}['getModelFamily'](_0x290f28){if(/^anthropic\.claude/['test'](_0x290f28))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x290f28))return'ai21.j2';if(/^cohere\.command/['test'](_0x290f28))return'cohere.command';if(/^meta\.llama/['test'](_0x290f28))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x290f28));}async['_processProxyRequest'](_0x386430,_0xffcc81,_0x591ed9,_0x7d377b,_0x58fc55){const _0x53db63={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x58fc55),'body':JSON['stringify']({..._0x386430,'model':_0xffcc81,'stream':_0x591ed9}),'signal':this['abortController']['signal']},_0x3a669d=await fetch(this['_apiUrl'],_0x53db63);_0x591ed9?await this['_readStreamableResponse'](_0x3a669d,_0xffcc81,_0x7d377b):await this['_readStaticResponse'](_0x3a669d,_0xffcc81,_0x7d377b);}async['_processAWSRequest'](_0x17e004,_0x4b2074,_0x51cf7f,_0x53662f){const _0x5482f6=new _0x56414c(this['_bedrockClientConfig']),_0x1bdca6={'body':JSON['stringify'](_0x17e004),'contentType':'application/json','accept':'application/json','modelId':_0x4b2074};let _0x2f9271;if(_0x51cf7f){const _0xeee46f=new _0x5194b5(_0x1bdca6);_0x2f9271=await _0x5482f6['send'](_0xeee46f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2f9271,_0x4b2074,_0x53662f);}else{const _0x5c9429=new _0x5e7f9a(_0x1bdca6);_0x2f9271=await _0x5482f6['send'](_0x5c9429,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2f9271,_0x4b2074,_0x53662f);}}async['_readAsyncIterableResponse'](_0xbd298f,_0x3f8719,_0x162cbb){const _0x2be00e=_0xbd298f['body'],_0x46339d=new TextDecoder('utf-8');let _0x43003e='';for await(const _0x4a326c of _0x2be00e)if(_0x4a326c['chunk']){const _0x2f3909=_0x46339d['decode'](_0x4a326c['chunk']['bytes']),_0x2ddd17=JSON['parse'](_0x2f3909);_0x43003e+=this['_getGeneratedText'](_0x2ddd17,_0x3f8719),_0x162cbb(_0x43003e);}return Promise['resolve']();}async['_readStreamableResponse'](_0x531cc3,_0x4a3c1b,_0x179998){const _0x315a49=_0x531cc3['body'],_0x199d43=new TextDecoder('utf-8'),_0x368a0c=_0x315a49['getReader']();let _0x164162='',_0x43fcf3='',_0x3680cb=!0x1;for(;!_0x3680cb;){const {done:_0x558925,value:_0xc4b1f8}=await _0x368a0c['read']();if(_0x3680cb=_0x558925,_0x3680cb)break;const _0x50fd1e=(_0x164162+_0x199d43['decode'](_0xc4b1f8))['split']('\x0a')['map'](_0x180741=>{try{return _0x164162='',JSON['parse'](_0x180741);}catch(_0x3f991a){return _0x164162=_0x180741,null;}})['filter'](_0x33a848=>null!==_0x33a848);_0x50fd1e['length']&&(_0x43fcf3+=_0x50fd1e['map'](_0x14ad5f=>this['_getGeneratedText'](_0x14ad5f,_0x4a3c1b))['join'](''),_0x179998(_0x43fcf3));}return Promise['resolve']();}async['_readStaticResponse'](_0x2112e9,_0x1410c3,_0x27fbcb){let _0x12ea11;return _0x12ea11=_0x2112e9 instanceof Response?await _0x2112e9['json']():JSON['parse'](Buffer['from'](_0x2112e9['body'])['toString']('utf8')),(_0x27fbcb(this['_getGeneratedText'](_0x12ea11,_0x1410c3)),Promise['resolve']());}['_getGeneratedText'](_0x56d11b,_0x179791){switch(this['getModelFamily'](_0x179791)){case'anthropic.claude':return _0x56d11b['completion'];case'ai21.j2':return _0x56d11b['completions'][0x0]['data']['text'];case'cohere.command':return _0x56d11b['generations'][0x0]['text'];case'meta.llama':return _0x56d11b['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x166283,Command as _0x46d2d6,icons as _0x1a0b68}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x4dbbf6,CKEditorError as _0xa8682e,ObservableMixin as _0x29a6a3,global as _0x2f87f3,isVisible as it,Rect as st,Collection as _0x2fcc60,FocusTracker as _0x57320c,KeystrokeHandler as ts,first as _0x24de88}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x317755,View as _0x51e4fd,SpinnerView as _0x2b7739,IconView as _0xb24c75,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x27b819,ButtonLabelView as te,FocusCycler as _0x138fca,createLabeledTextarea as _0x1188ea,Dialog as _0x4aebcd,createDropdown as _0x334429,addMenuToDropdown as _0x390a9c,MenuBarMenuView as _0x2cf723,MenuBarMenuListItemButtonView as _0x1b137b,DialogViewPosition as _0x55fa78,MenuBarMenuListView as _0x5cdd37,MenuBarMenuListItemView as _0x1226d5}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x1e09e9,ClipboardMarkersUtils as _0x45d88e}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x22c2f0,DataTransfer as _0x39a236,UpcastWriter as _0x31b1eb,Matcher as _0x1f2569}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0xc2d9dc,escape as _0x34c32d}from'lodash-es';import{BedrockRuntimeClient as _0x5df8b5,InvokeModelWithResponseStreamCommand as _0x595d99,InvokeModelCommand as _0x2c86a7}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x562826,_0x464f2a){const _0x46c1db=(0x0,_0x464f2a['t'])('Other');return _0x562826['length']?'groupId'in _0x562826[0x0]?_0x562826:[{'groupId':x,'groupLabel':_0x46c1db,'order':0x1/0x0,'commands':_0x562826}]:[{'groupId':x,'groupLabel':_0x46c1db,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x166283{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x9b1dee}=this,_0x34fe39=['ck-fake-ai-selection'];_0x9b1dee['config']['get']('ai.useTheme')&&_0x34fe39['push']('ck-ai-assistant-ui_theme'),_0x9b1dee['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x34fe39,'priority':0xc}}),_0x9b1dee['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x29c1ae,{writer:_0x5a99ba})=>{if(!_0x29c1ae['markerRange']['isCollapsed'])return null;const _0x2caec5=_0x5a99ba['createUIElement']('span');return _0x5a99ba['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x2caec5),_0x2caec5;}});}['afterInit'](){!async function(_0x54e501){const _0x154224=_0x2ab031([0x30,0x34,0x39,0x47,0x75,0x38,0x77,0x57,0x58,0x71,0x54,0x6e,0x6a,0x59,0x52,0x4f,0x31,0x6b,0x41,0x4b,0x5a,0x67,0x55,0x6d,0x36,0x73,0x7a,0x76,0x50,0x42,0x4a,0x6c,0x49,0x37,0x43,0x74,0x66,0x56,0x62,0x4d,0x79,0x35,0x51,0x45,0x32,0x64,0x65,0x4c,0x33,0x78,0x53,0x69,0x70,0x48,0x72,0x44,0x6f,0x46,0x4e,0x63,0x61,0x68]),_0x546b28=0x6243817c,_0x3519b8=0x6244dff4^_0x546b28,_0x98c8cb=window[_0x2ab031([0x44,0x61,0x74,0x65])][_0x2ab031([0x6e,0x6f,0x77])](),_0xa19a0e=_0x54e501[_0x2ab031([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x21a6be=new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x29350b=>{_0xa19a0e[_0x2ab031([0x6f,0x6e,0x63,0x65])](_0x2ab031([0x72,0x65,0x61,0x64,0x79]),_0x29350b);}),_0x445c6c={[_0x2ab031([0x6b,0x74,0x79])]:_0x2ab031([0x45,0x43]),[_0x2ab031([0x75,0x73,0x65])]:_0x2ab031([0x73,0x69,0x67]),[_0x2ab031([0x63,0x72,0x76])]:_0x2ab031([0x50,0x2d,0x32,0x35,0x36]),[_0x2ab031([0x78])]:_0x2ab031([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]),[_0x2ab031([0x79])]:_0x2ab031([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]),[_0x2ab031([0x61,0x6c,0x67])]:_0x2ab031([0x45,0x53,0x32,0x35,0x36])},_0x5cfa3b=_0xa19a0e[_0x2ab031([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2ab031([0x67,0x65,0x74])](_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x38eea5(){let _0x34e106,_0x54ec0c=null,_0x309591=null;try{if(_0x5cfa3b==_0x2ab031([0x47,0x50,0x4c]))return _0x2ab031([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x34e106=_0x3e03fe(),!_0x34e106)return _0x2ab031([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x34e106[_0x2ab031([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x309591=_0x1c89cf(_0x34e106[_0x2ab031([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x34e106[_0x2ab031([0x6a,0x74,0x69])])),await _0x2814e2()?_0x467dc0()?_0x5059da()?_0x2ab031([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2e31b9()?(_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2ab031([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x54ec0c=_0x5de118(_0x2ab031([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2ab031([0x74,0x72,0x69,0x61,0x6c])&&(_0x54ec0c=_0x5de118(_0x2ab031([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x414c87()):_0x2ab031([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2ab031([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2ab031([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x3a9dcf){return _0x2ab031([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5059da(){const _0x4e210e=[_0x2ab031([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2ab031([0x74,0x72,0x69,0x61,0x6c])][_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x98c8cb/0x3e8:0xe10*_0x3519b8;return _0x34e106[_0x2ab031([0x65,0x78,0x70])]<_0x4e210e;}function _0x467dc0(){const _0x3c5203=_0x34e106[_0x2ab031([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3c5203&&(!!_0x3c5203[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2ab031([0x2a]))||!!_0x3c5203[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2ab031([0x41,0x49])));}function _0x2e31b9(){const _0x245639=_0x34e106[_0x2ab031([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x245639||0x0==_0x245639[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x413885}=new URL(window[_0x2ab031([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x245639[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x413885))return!0x0;const _0x4f5363=_0x413885[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e]));return _0x245639[_0x2ab031([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2740dd=>_0x2740dd[_0x2ab031([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2ab031([0x2a])))[_0x2ab031([0x6d,0x61,0x70])](_0x59a718=>_0x59a718[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e])))[_0x2ab031([0x73,0x6f,0x6d,0x65])](_0x58d9f9=>_0x4f5363[_0x2ab031([0x65,0x76,0x65,0x72,0x79])]((_0x5d9355,_0x3212e2)=>_0x58d9f9[_0x3212e2]===_0x5d9355||_0x58d9f9[_0x3212e2]===_0x2ab031([0x2a])));}function _0x414c87(){return _0x54ec0c&&_0x309591?new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1d192b,_0x2f8633)=>{_0x54ec0c[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x1d192b,_0x2f8633),_0x309591[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x7d58c8=>{_0x7d58c8!=_0x2ab031([0x56,0x61,0x6c,0x69,0x64])&&_0x1d192b(_0x7d58c8);},_0x2f8633);}):_0x54ec0c||_0x309591||_0x2ab031([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1c89cf(_0x229e44,_0x3b5a44){return new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x39f990=>{if(_0x264ac7())return _0x39f990(_0x2ab031([0x56,0x61,0x6c,0x69,0x64]));_0x8c4be6(),_0xa19a0e[_0x2ab031([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2ab031([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1c0c3a=!0x1;const _0x337db6=_0x4dbbf6();function _0x559ab5(_0x3b13e7){return!!_0x3b13e7&&(typeof _0x3b13e7===_0x2ab031([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3b13e7===_0x2ab031([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3b13e7[_0x2ab031([0x74,0x68,0x65,0x6e])]===_0x2ab031([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3b13e7[_0x2ab031([0x63,0x61,0x74,0x63,0x68])]===_0x2ab031([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x3fb6ae(_0x1cac58){_0x2b0da5(_0x1cac58)[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x1f8b8e=>{if(!_0x1f8b8e||_0x1f8b8e[_0x2ab031([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2ab031([0x6f,0x6b]))return _0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x46a16b(_0x591451(_0x337db6+_0x3b5a44))!=_0x1f8b8e[_0x2ab031([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2ab031([0x56,0x61,0x6c,0x69,0x64]);})[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x16c4d0=>(_0x1613d5(),_0x16c4d0),()=>{const _0x5a052a=_0x892bb();return null==_0x5a052a?(_0x1613d5(),_0x2ab031([0x56,0x61,0x6c,0x69,0x64])):_0x2ab031(_0x98c8cb-_0x5a052a>(0x464f057c^_0x546b28)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x39f990)[_0x2ab031([0x63,0x61,0x74,0x63,0x68])](()=>{_0x39f990(_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xf85970=0x62756ffc^_0x546b28;function _0x1613d5(){const _0x22dea7=_0x2ab031([0x6c,0x6c,0x63,0x74,0x2d])+_0x46a16b(_0x591451(_0x229e44)),_0x3c1134=_0x3b3826(_0x46a16b(window[_0x2ab031([0x4d,0x61,0x74,0x68])][_0x2ab031([0x63,0x65,0x69,0x6c])](_0x98c8cb/_0xf85970)));window[_0x2ab031([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2ab031([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x22dea7,_0x3c1134);}function _0x892bb(){const _0x3cc4b9=_0x2ab031([0x6c,0x6c,0x63,0x74,0x2d])+_0x46a16b(_0x591451(_0x229e44)),_0x194f81=window[_0x2ab031([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2ab031([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3cc4b9);return _0x194f81?window[_0x2ab031([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3b3826(_0x194f81),0x10)*_0xf85970:null;}function _0x2b0da5(_0x115332){return new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a0e8e,_0x2ce5e1)=>{_0x115332[_0x2ab031([0x74,0x68,0x65,0x6e])](_0x4a0e8e,_0x2ce5e1),window[_0x2ab031([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2ce5e1,0x624255bc^_0x546b28);});}}_0xa19a0e[_0x2ab031([0x6f,0x6e])](_0x2ab031([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x37ddf1,_0x4a5e10)=>{if(_0x4a5e10[0x0]!=_0x229e44)return _0x39f990(_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4a5e10[0x1]={..._0x4a5e10[0x1],[_0x2ab031([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x337db6};},{[_0x2ab031([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2ab031([0x68,0x69,0x67,0x68])}),_0xa19a0e[_0x2ab031([0x6f,0x6e])](_0x2ab031([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x556256=>{_0x559ab5(_0x556256[_0x2ab031([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1c0c3a=!0x0,_0x3fb6ae(_0x556256[_0x2ab031([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2ab031([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2ab031([0x6c,0x6f,0x77])}),_0x21a6be[_0x2ab031([0x74,0x68,0x65,0x6e])](()=>{_0x1c0c3a||_0x39f990(_0x2ab031([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x264ac7(){return _0xa19a0e[_0x2ab031([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2ab031([0x76,0x69,0x65,0x77])][_0x2ab031([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2ab031([0x61,0x75,0x74,0x6f]);}function _0x8c4be6(){_0xa19a0e[_0x2ab031([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2ab031([0x76,0x69,0x65,0x77])][_0x2ab031([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2ab031([0x61,0x75,0x74,0x6f]);}}function _0x5de118(_0x281a7d){const _0x3e8922=[new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2d9e1d=>setTimeout(_0x2d9e1d,0x624abfb0^_0x546b28)),_0x21a6be[_0x2ab031([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x38fd73=>{let _0x38314e=0x0;_0xa19a0e[_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c])][_0x2ab031([0x6f,0x6e])](_0x2ab031([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x12c5b2,_0x30a505)=>{_0x30a505[0x0][_0x2ab031([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x38314e++,_0x38314e==(0x62438084^_0x546b28)&&(_0x38fd73(),_0x12c5b2[_0x2ab031([0x6f,0x66,0x66])]());});}))];return window[_0x2ab031([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2ab031([0x72,0x61,0x63,0x65])](_0x3e8922)[_0x2ab031([0x74,0x68,0x65,0x6e])](()=>_0x281a7d);}async function _0x1b2ee0(){await _0x21a6be,_0xa19a0e[_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c])][_0x2ab031([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x10659f,_0xa19a0e[_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c])][_0x2ab031([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x10659f,_0xa19a0e[_0x2ab031([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2ab031([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x82d8dc(_0x783b09){const _0xac2ed0=_0x57f63b();_0xa19a0e[_0xac2ed0]=_0x2ab031([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x783b09,_0x783b09!=_0x2ab031([0x56,0x61,0x6c,0x69,0x64])&&_0x1b2ee0();}function _0x57f63b(){const _0x552990=window[_0x2ab031([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2ab031([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2ab031([0x6e,0x6f,0x77])]())[_0x2ab031([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2ab031([0x2e]),'');let _0x126d91=_0x2ab031([0x47]);for(let _0x162caa=0x0;_0x162caa<_0x552990[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x162caa+=0x2){let _0x28298f=window[_0x2ab031([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x552990[_0x2ab031([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x162caa,_0x162caa+0x2));_0x28298f>=_0x154224[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x28298f-=_0x154224[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x126d91+=_0x154224[_0x28298f];}return _0x126d91;}function _0x3e03fe(){const _0xb08fb8=_0x5cfa3b[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e]));if(0x3!=_0xb08fb8[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4848de(_0xb08fb8[0x1]);function _0x4848de(_0x56a56d){const _0x3f3f58=_0xf5c5d9(_0x56a56d);return _0x3f3f58&&_0x2928a7()?_0x3f3f58:null;function _0x2928a7(){const _0x48db44=_0x3f3f58[_0x2ab031([0x6a,0x74,0x69])],_0x259874=window[_0x2ab031([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x48db44[_0x2ab031([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x48db44[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3761eb={..._0x3f3f58,[_0x2ab031([0x6a,0x74,0x69])]:_0x48db44[_0x2ab031([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x48db44[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3761eb[_0x2ab031([0x76,0x63])],_0x591451(_0x3761eb)==_0x259874;}}}async function _0x2814e2(){let _0x4a2ac0=!0x0;try{const _0x36242e=_0x5cfa3b[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])](_0x2ab031([0x2e])),[_0x110bfe,_0x15d35c,_0xf87d73]=_0x36242e;return _0x1c08b3(_0x110bfe),await _0x3f510e(_0x110bfe,_0x15d35c,_0xf87d73),_0x4a2ac0;}catch(_0x12d071){return!0x1;}function _0x1c08b3(_0x43476a){const _0x190ba3=_0xf5c5d9(_0x43476a);_0x190ba3&&_0x190ba3[_0x2ab031([0x61,0x6c,0x67])]==_0x2ab031([0x45,0x53,0x32,0x35,0x36])||(_0x4a2ac0=!0x1);}async function _0x3f510e(_0x15d84d,_0x15f5ca,_0x43c9f6){const _0x212b94=window[_0x2ab031([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2ab031([0x66,0x72,0x6f,0x6d])](_0xb03470(_0x43c9f6),_0x5da465=>_0x5da465[_0x2ab031([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0xe0e155=new window[(_0x2ab031([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2ab031([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x15d84d+_0x2ab031([0x2e])+_0x15f5ca),_0x16851e=window[_0x2ab031([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2ab031([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x16851e)return;const _0xf999df=await _0x16851e[_0x2ab031([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2ab031([0x6a,0x77,0x6b]),_0x445c6c,{[_0x2ab031([0x6e,0x61,0x6d,0x65])]:_0x2ab031([0x45,0x43,0x44,0x53,0x41]),[_0x2ab031([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2ab031([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2ab031([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x16851e[_0x2ab031([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2ab031([0x6e,0x61,0x6d,0x65])]:_0x2ab031([0x45,0x43,0x44,0x53,0x41]),[_0x2ab031([0x68,0x61,0x73,0x68])]:{[_0x2ab031([0x6e,0x61,0x6d,0x65])]:_0x2ab031([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xf999df,_0x212b94,_0xe0e155)||(_0x4a2ac0=!0x1);}}function _0xf5c5d9(_0x2bb110){return _0x2bb110[_0x2ab031([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2ab031([0x65,0x79]))?JSON[_0x2ab031([0x70,0x61,0x72,0x73,0x65])](_0xb03470(_0x2bb110)):null;}function _0xb03470(_0x4ea44a){return window[_0x2ab031([0x61,0x74,0x6f,0x62])](_0x4ea44a[_0x2ab031([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2ab031([0x2b]))[_0x2ab031([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2ab031([0x2f])));}function _0x591451(_0x2a1201){let _0x14a69f=0x1505;function _0x3b4124(_0x1b7852){for(let _0x104da1=0x0;_0x104da1<_0x1b7852[_0x2ab031([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x104da1++){const _0x3d650d=_0x1b7852[_0x2ab031([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x104da1);_0x14a69f=(_0x14a69f<<0x5)+_0x14a69f+_0x3d650d,_0x14a69f&=_0x14a69f;}}function _0x40a339(_0x872766){Array[_0x2ab031([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x872766)?_0x872766[_0x2ab031([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x40a339):_0x872766&&typeof _0x872766==_0x2ab031([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2ab031([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x872766)[_0x2ab031([0x73,0x6f,0x72,0x74])]()[_0x2ab031([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1d6152,_0x3bbd97])=>{_0x3b4124(_0x1d6152),_0x40a339(_0x3bbd97);}):_0x3b4124(window[_0x2ab031([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x872766));}return _0x40a339(_0x2a1201),_0x14a69f>>>0x0;}function _0x46a16b(_0x153407){return _0x153407[_0x2ab031([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2ab031([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2ab031([0x30]));}function _0x3b3826(_0x4c6feb){return _0x4c6feb[_0x2ab031([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2ab031([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2ab031([0x6a,0x6f,0x69,0x6e])]('');}function _0x10659f(){}function _0x2ab031(_0x566a08){return _0x566a08['map'](_0x2edf98=>String['fromCharCode'](_0x2edf98))['join']('');}_0x82d8dc(await _0x38eea5());}(this);}['showFakeVisualSelection'](){const _0x34aaf6=this['editor']['model'];_0x34aaf6['change'](_0x39c0d9=>{const _0x500d74=_0x34aaf6['document']['selection']['getRanges']();let _0x1ec854=0x0;for(const _0x443559 of _0x500d74){const _0x386e24=f+':'+_0x1ec854;if(_0x34aaf6['markers']['has'](_0x386e24))_0x39c0d9['updateMarker'](_0x386e24,{'range':_0x443559});else{if(_0x443559['start']['isAtEnd']){const _0x2f4bd2=_0x443559['start']['getLastMatchingPosition'](({item:_0x2be8fd})=>!_0x34aaf6['schema']['isContent'](_0x2be8fd),{'boundaries':_0x443559});_0x39c0d9['addMarker'](_0x386e24,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x39c0d9['createRange'](_0x2f4bd2,_0x443559['end'])});}else _0x39c0d9['addMarker'](_0x386e24,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x443559});}_0x1ec854++;}});}['hideFakeVisualSelection'](){const _0x349aca=this['editor']['model'],_0x14bb0d=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x14bb0d['length']&&_0x349aca['change'](_0x26ed6a=>{_0x14bb0d['forEach'](_0x5ba370=>{_0x26ed6a['removeMarker'](_0x5ba370);});});}['insertContent'](_0x5564f9,_0x4f14e1){const _0x1c5b64=this['_getAISelection'](),_0xb4f620=_0x4f14e1||_0x1c5b64['getFirstRange']();this['editor']['model']['canEditAt'](_0xb4f620)&&this['editor']['model']['change'](_0x1d10c5=>{this['hideFakeVisualSelection'](),_0x4f14e1||this['_resetContentOfSelectedTableCells'](_0x1d10c5,_0x1c5b64),this['_pasteHTMLUsingClipboard']({'insertAt':_0xb4f620,'writer':_0x1d10c5,'html':_0x5564f9});});}['insertContentBelow'](_0x10d382){const {model:_0x57ad1b}=this['editor'],_0x44a772=this['_getAISelection']();_0x57ad1b['change'](()=>{const _0x3d0c1d=this['_prepareTableInsertBelowPosition'](_0x10d382,_0x44a772)||this['_getDefaultInsertBelowPosition'](_0x44a772);this['insertContent'](_0x10d382,_0x3d0c1d);});}['_getAISelection'](){const _0xde2daa=this['editor']['model'],_0x36e042=Array['from'](_0xde2daa['markers']['getMarkersGroup'](f))['map'](_0x1af566=>_0x1af566['getRange']());return _0xde2daa['createSelection'](_0x36e042);}['_pasteHTMLUsingClipboard']({writer:_0x2739dd,html:_0x571568,insertAt:_0x3bb5be}){const {view:_0x5752fe}=this['editor']['editing'],_0x267617=this['editor']['plugins']['get'](_0x1e09e9),_0x18cfdb=new dt();_0x18cfdb['setData']('text/html',_0x571568);const _0x4a23d3=new ClipboardEvent('paste',{'clipboardData':_0x18cfdb}),_0x37fc54=new _0x22c2f0(_0x5752fe,_0x4a23d3,{'dataTransfer':new _0x39a236(_0x18cfdb)});_0x2739dd['setSelection'](_0x3bb5be);const _0x246fac=(_0x430cc4,_0x12ba37)=>{_0x12ba37['resultRange']&&_0x2739dd['setSelection'](_0x12ba37['resultRange']);};_0x267617['once']('contentInsertion',_0x246fac,{'priority':'lowest'}),_0x5752fe['document']['fire']('paste',_0x37fc54),_0x267617['off']('contentInsertion',_0x246fac);}['_getDefaultInsertBelowPosition'](_0x51ddfc){const {model:_0xd8cfa5}=this['editor'],_0x4da5ba=Array['from'](_0x51ddfc['getSelectedBlocks']());return _0x4da5ba['length']?_0xd8cfa5['createPositionAfter'](_0x4da5ba['pop']()):_0x51ddfc['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x49bb72,_0x4a8cc4){const {model:_0x18d7b3,plugins:_0x41e924}=this['editor'];if(_0x41e924['has']('TableUtils')){const _0x37a21=_0x41e924['get']('TableUtils')['getSelectedTableCells'](_0x4a8cc4);if(_0x37a21['length']){const _0x1ec5c6=this['_getTableRowCountFromContent'](_0x49bb72),_0x106b83=this['_createEmptyTableRows'](_0x37a21,_0x1ec5c6);return _0x18d7b3['createPositionAt'](_0x106b83,0x0);}}return null;}['_getTableRowCountFromContent'](_0x3a27ad){const _0x49d405=this['editor']['plugins']['get']('TableUtils'),_0x3c6a82=this['editor']['data']['parse'](_0x3a27ad),_0x1289ef=Array['from'](_0x3c6a82['getChildren']())['filter'](_0x2ed58d=>_0x2ed58d['is']('element','table'));let _0x16a1ac=0x0;return _0x1289ef['forEach'](_0x11dc7b=>{_0x16a1ac+=_0x49d405['getRows'](_0x11dc7b);}),_0x16a1ac;}['_createEmptyTableRows'](_0x3bd459,_0x3232b4){const _0x35d065=this['editor']['plugins']['get']('TableUtils'),_0x3e1c93=_0x35d065['getRowIndexes'](_0x3bd459),_0x4e3338=_0x35d065['getColumnIndexes'](_0x3bd459),_0x415535=_0x3e1c93['last']+0x1,_0x9e0e54=_0x4e3338['first'],_0x1d5e12=_0x3bd459[0x0]['findAncestor']('table');for(let _0x3ee06b=0x0;_0x3ee06b<_0x3232b4;_0x3ee06b++)_0x35d065['insertRows'](_0x1d5e12,{'at':_0x415535});return _0x1d5e12['getChild'](_0x415535)['getChild'](_0x9e0e54);}['_resetContentOfSelectedTableCells'](_0xf77bd8,_0x32b8fc){const {plugins:_0x3eecae}=this['editor'],{model:_0x3f36ee}=_0xf77bd8;if(!_0x3eecae['has']('TableUtils'))return;_0x3eecae['get']('TableUtils')['getSelectedTableCells'](_0x32b8fc)['length']&&_0x3f36ee['deleteContent'](_0x32b8fc);}}class K extends _0x166283{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xa8682e('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x5cfc89){super(_0x5cfc89),this['name']='AIRequestError';}}function i(_0x2d5955,_0x2d8447,_0x5e734c){const t=_0x2d5955['t'];switch(_0x2d8447){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',_0x5e734c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5e734c);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'},_0x5e734c);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 _0x2d8447;}}class E extends _0x46d2d6{['_commandDefinitions'];constructor(_0x526af2,_0x509810){super(_0x526af2),this['_commandDefinitions']=_0x509810,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4406a5,_0x5b7f0a,_0x140993)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x140993));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x24d317,_0x2a748a,_0x172602)=>{this['enabledCommandsIds']=_0x172602?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x2d1e46=this['editor']['model'];this['_hasContext']=function(_0x5d919e){const _0x9344c5=_0x5d919e['document']['selection'];return _0x9344c5['isCollapsed']?0x0!==[..._0x9344c5['getSelectedBlocks']()]['length']&&![..._0x9344c5['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x5d919e['hasContent'](_0x9344c5['getFirstRange']());}(_0x2d1e46);const _0x5b53fe=_0x2d1e46['document']['selection'],_0x15bd5a=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x3f9b93 of _0x5b53fe['getRanges']())for(const _0x1234cf of _0x3f9b93['getItems']())if(_0x1234cf['is']('element')&&_0x15bd5a['includes'](_0x1234cf['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x49fc81='',_0x1f432f='',_0x50e1ee='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x49fc81,_0x1f432f,_0x50e1ee);}}function G(_0x22cc80,_0x3f3338){const _0x5a26a9=new Set();for(const _0x4cd426 of _0x22cc80['values']())(_0x3f3338||!0x1===_0x4cd426['requiresContent'])&&_0x5a26a9['add'](_0x4cd426['id']);return Array['from'](_0x5a26a9);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x29a6a3(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x37966f,_0x220c52,_0x5eea76){super(),this['editor']=_0x37966f,this['textAdapter']=_0x220c52,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5eea76,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x514ce9,_0x1663c0,_0x1e3064)=>{this['view']['value']=this['_sanitizeHTML'](_0x1e3064);}),this['listenTo'](this['view'],'submitPrompt',(_0x1f4f32,_0x19a203)=>{const _0x42076b=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x19a203,_0x42076b,'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:_0x141389,query:_0x2f473c,htmlContent:_0x572e4d,label:_0x1e0a18,mainActionLabel:_0x3c0b60}){this['view']['prompt']=_0x1e0a18,this['view']['mainAction']=_0x3c0b60,this['initialContext']=_0x572e4d,_0x2f473c&&(this['view']['isRendered']?this['_handleQuery'](_0x2f473c,_0x572e4d,_0x141389,_0x1e0a18):this['view']['once']('render',()=>{this['_handleQuery'](_0x2f473c,_0x572e4d,_0x141389,_0x1e0a18);}));}['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'](_0x2e3e39,_0x2e90a2,_0x356db2,_0x190750){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2e90a2,this['previousQuery']=_0x2e3e39,this['previousLabel']=_0x190750||_0x2e3e39,this['previousActionId']=_0x356db2,new Promise(_0x2182e2=>{this['textAdapter']['makeRequest']({'query':_0x2e3e39,'context':_0x2e90a2,'onData':_0x2a57ce=>{this['currentResponse']=_0x2a57ce,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x356db2})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x369c7f=>{_0x369c7f instanceof R?this['view']['handleError'](_0x369c7f['message']):this['view']['handleError'](),_0x2182e2();})['finally'](()=>{this['stopProcessing'](),_0x2182e2();});});}['_parseAndNormalizeContent'](_0x483e5e,_0x5d6eb7=!0x1){const _0x246ffa=Z['exec'](_0x483e5e);_0x483e5e=_0x246ffa?_0x483e5e['substring'](_0x246ffa[0x1]['length']):_0x483e5e['length']<0x64&&!_0x5d6eb7?'':this['_stripMarkdownSyntax'](_0x483e5e);const _0x2993a1=this['_domParser']['parseFromString'](_0x483e5e,'text/html');if(_0x246ffa){const _0xe1b491=Array['from'](_0x2993a1['body']['childNodes']);_0xe1b491['reverse']();for(const _0x3975c7 of _0xe1b491){if(_0x3975c7['nodeType']==Node['ELEMENT_NODE'])break;_0x3975c7['remove']();}}const _0x179306=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2993a1['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x179306);const _0x3a462a=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x4bc3f6=this['editor']['data']['toModel'](_0x179306);return _0x3a462a||_0x4bc3f6['markers']['clear'](),this['editor']['data']['stringify'](_0x4bc3f6);}['_normalizeResponseHeadings'](_0x152935){const _0x738ec1=new _0x31b1eb(this['editor']['editing']['view']['document']),_0x125df8=new _0x1f2569({'name':/^h[1-5]$/}),_0x2c9803=[];let _0x1c8a81=!0x1;for(const _0x238b68 of _0x152935)_0x238b68['is']('element')&&_0x125df8['match'](_0x238b68)&&(_0x2c9803['push'](_0x238b68),'h1'==_0x238b68['name']&&(_0x1c8a81=!0x0));if(_0x1c8a81){for(const _0x28f0ff of _0x2c9803)_0x738ec1['rename']('h'+(parseInt(_0x28f0ff['name'][0x1])+0x1),_0x28f0ff);}}['_isH1TagSupportEnabled'](){const {data:_0x1cc7ab,editing:_0x8c426e}=this['editor'],_0x2d6212=_0x1cc7ab['htmlProcessor']['toView']('<h1></h1>'),_0x3a6df0=_0x1cc7ab['toView'](_0x1cc7ab['toModel'](_0x2d6212));return!!_0x8c426e['view']['domConverter']['viewToDom'](_0x3a6df0)['querySelector']('h1');}['_sanitizeHTML'](_0x315f0a){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x315f0a),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x52ea39){const _0x1a6065=_0x52ea39['trim']();return _0x1a6065['startsWith']('```html')?_0x1a6065['endsWith']('```')?_0x1a6065['substring'](0x7,_0x1a6065['length']-0x3):_0x1a6065['substring'](0x7):_0x52ea39;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x69d2ff){super(_0x69d2ff),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x455e10=>i(_0x69d2ff,'AI_'+_0x455e10['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x69d2ff,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x69d2ff,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x69d2ff,'Stop'));const _0xf2b601=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xf2b601['if']('isVisible','ck-hidden',_0x565790=>!_0x565790)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x4f71e0,_0x278eab){const _0x3e6cf3=new _0x317755(this['locale']);return _0x3e6cf3['set']({'label':_0x4f71e0,'class':_0x278eab||'','isVisible':!0x0,'withText':!0x0}),_0x3e6cf3;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x51e4fd{['contentFieldView'];['copyButtonView'];constructor(_0x3b53da,_0x2d78b3=''){super(_0x3b53da),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0xef705f=this['bindTemplate'];this['contentFieldView']=new mt(_0x3b53da,_0x2d78b3),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0xef705f['if']('isVisible','ck-hidden',_0x492c05=>!_0x492c05)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0xef705f['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 _0x43bed7=!0x1;this['on']('change:value',(_0xa3b2b9,_0x1d7e62,_0x23b80c)=>{const _0x1806a3=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x23b80c),this['isProcessing']&&_0x1806a3&&!_0x43bed7&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0xe46235,_0x3a5558,_0x12df98)=>{_0x43bed7=!0x1,_0x12df98?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x43bed7=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x43bed7=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1078e5=this['locale'],_0x4a8bd9=new _0x317755(this['locale']),_0x4f41d0='ck-ai-form__copy-button';return _0x4a8bd9['set']({'label':i(_0x1078e5,'Copy'),'icon':W,'class':_0x4f41d0,'tooltip':!0x0}),_0x4a8bd9['bind']('isVisible')['to'](this,'value',_0x2743bc=>!!_0x2743bc),_0x4a8bd9['bind']('isEnabled')['to'](this,'isProcessing',_0x49da1d=>!_0x49da1d),_0x4a8bd9['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4a8bd9['icon']=_0x1a0b68['check'],_0x4a8bd9['class']=_0x4f41d0+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4a8bd9['icon']=W,_0x4a8bd9['class']=_0x4f41d0;},0x3e8);}),_0x4a8bd9;}['_copyHTMLToClipboard'](_0x2f3ee3){const {window:_0x1b8de9,document:_0x22c83b}=_0x2f87f3;if(_0x1b8de9['ClipboardItem']){const {Blob:_0x5adac4,ClipboardItem:_0x1ea8e9}=_0x1b8de9,_0x556fdb=[new _0x1ea8e9({'text/html':new _0x5adac4([_0x2f3ee3['innerHTML']],{'type':'text/html'}),'text/plain':new _0x5adac4([_0x2f3ee3['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x556fdb);}else{const _0x23b17c=_0x22c83b['createElement']('div');_0x23b17c['style']['position']='absolute',_0x23b17c['style']['left']='-9999px',_0x23b17c['innerHTML']='<span>[</span>'+_0x2f3ee3['innerHTML']+'<span>]</span>',_0x22c83b['body']['appendChild'](_0x23b17c);const _0x5f252c=_0x22c83b['createRange']();_0x5f252c['setStartAfter'](_0x23b17c['firstElementChild']),_0x5f252c['setEndBefore'](_0x23b17c['lastElementChild']);const _0x5d7ddc=_0x1b8de9['getSelection']();_0x5d7ddc['removeAllRanges'](),_0x5d7ddc['addRange'](_0x5f252c),_0x22c83b['execCommand']('copy'),_0x23b17c['remove']();}}}class mt extends _0x51e4fd{constructor(_0x16d5c1,_0x267f7c=''){super(_0x16d5c1),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x267f7c,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1a425c){this['element']['innerHTML']=_0x1a425c;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2bd2e3=new _0x51e4fd(),_0x5212f4=this['locale'],_0x15f118=new _0x2b7739();return _0x15f118['isVisible']=!0x0,_0x2bd2e3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x15f118,{'text':i(_0x5212f4,'AI\x20is\x20writing...')}]}),_0x2bd2e3['render'](),_0x2bd2e3;}}class rt extends _0x51e4fd{constructor(_0x177c3f,_0x4c5a01=''){super(_0x177c3f);const _0x27b798=new _0xb24c75(),_0x27ef8e=this['bindTemplate'];this['set']('text',_0x4c5a01),_0x27b798['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':[_0x27b798,{'text':_0x27ef8e['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x4e9ad3,_0xa3ae27){super(_0x4e9ad3,_0xa3ae27),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',(_0xd8f13b,_0x3cabb7)=>{_0xd8f13b['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x3cabb7());});}['_createSubmitButton'](){const _0x1e89cc=new _0x317755(this['locale']),_0x4283f9=this['locale'];return _0x1e89cc['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(_0x4283f9,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1e89cc['on']('execute',()=>{this['submit']();}),_0x1e89cc['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3493b3,_0x513445)=>!_0x3493b3&&_0x513445),_0x1e89cc;}['_createShowHistoryButton'](){const _0x3d0cb1=new _0x317755(this['locale']),_0x526113=this['resultsView'],_0x1626d2=this['locale'];_0x3d0cb1['set']({'label':i(_0x1626d2,'History'),'withText':!0x1,'icon':_0x1a0b68['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x3d0cb1['bind']('isOn')['to'](_0x526113,'isVisible'),_0x3d0cb1['bind']('isEnabled')['to'](this,'isEnabled'),_0x3d0cb1['on']('execute',()=>{_0x526113['isVisible']=!_0x526113['isVisible'],_0x526113['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1bcf4a=()=>{_0x2f87f3['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x24d824=new st(this['queryView']['fieldView']['element']),_0x23f5a1=_0x24d824['width'],_0x19f0b6='rtl'===_0x1626d2['uiLanguageDirection']?'left':'right';_0x24d824['excludeScrollbarsAndBorders'](),_0x3d0cb1['element']['style'][_0x19f0b6]=_0x23f5a1-_0x24d824['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1bcf4a),this['on']('render',_0x1bcf4a),_0x3d0cb1;}['submit'](){const _0x5852ff=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5852ff);}['focus'](_0x4a706e){-0x1===_0x4a706e?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x17c6d8){super(_0x17c6d8),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x17c6d8,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x45183f=0x0;for(const _0xb021d0 of this['items'])_0x45183f+=_0xb021d0['items']['length'];return{'resultsCount':_0x45183f,'totalItemsCount':_0x45183f};}['_createClearHistoryButton'](){const _0x2db0c0=this['locale'],_0x12aa58=new _0x317755(this['locale']);return _0x12aa58['set']({'label':'('+i(_0x2db0c0,'Clear')+')','withText':!0x0}),_0x12aa58['on']('execute',()=>this['fire']('clearHistory')),_0x12aa58;}}class hs extends _0x27b819{constructor(_0x45f791){super();const _0x370e36=new te(),_0x35d16e=new _0x317755(this['locale'],_0x370e36);this['children']['add'](_0x35d16e),_0x35d16e['set']({'label':_0x45f791['prompt'],'withText':!0x0}),_0x35d16e['on']('execute',()=>{this['fire']('execute',{'value':_0xc2d9dc(_0x45f791['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x2fcc60{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x38892a,_0x4e98db)=>{const _0x326b81=Ss(_0x4e98db['prompt']);for(const _0x4d342d of this)if(_0x4d342d!=_0x4e98db&&Ss(_0x4d342d['prompt'])===_0x326b81){this['remove'](_0x4d342d);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x101f6b=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x101f6b));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x277dbf=>_0x277dbf)));}}function Ss(_0x23e2c2){return _0x23e2c2['toLowerCase']()['trim']();}class k extends _0x51e4fd{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2ae922,_0x253a10,_0x5d697e=''){super(_0x2ae922),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x2ae922),this['contentArea']=new X(_0x2ae922,_0x5d697e),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 _0x57320c(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x138fca({'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 _0x34e9ca=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x253a10],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x34e9ca['if']('isError','ck-hidden',_0x2b807b=>!_0x2b807b)]},'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'](_0x573646=0x1){-0x1===_0x573646?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 _0x204d98=this['locale'],_0x175d18=new ht(_0x204d98,{'queryView':{'label':i(_0x204d98,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1188ea,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x204d98,'Empty\x20history'),'secondary':i(_0x204d98,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x175d18['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x52a35a,_0x2c3518)=>_0x52a35a&&!_0x2c3518),this['listenTo'](_0x175d18,'submit',(_0xe15aea,_0x46d868)=>{this['prompt']=_0x46d868;const _0xdf2f5b=_0x34c32d(_0x46d868);this['fire']('submitPrompt',_0xdf2f5b),_0x46d868['trim']()&&this['_promptHistory']['add']({'prompt':_0xdf2f5b},0x0);},{'priority':'high'}),_0x175d18;}['_createHistoryView'](){const _0x119793=new rs(this['locale']);return _0x119793['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x119793['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x119793;}['_createToolbar'](){const _0x24caee=new at(this['locale']);return _0x24caee['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4b27bd,_0x268697,_0x3642e9)=>_0x4b27bd&&!_0x268697&&!!_0x3642e9),_0x24caee['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x24caee['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1173cb,_0x52000d,_0x2aa5fd)=>_0x1173cb&&!_0x52000d&&!!_0x2aa5fd),_0x24caee['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x24caee['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x47ae7b,_0x5d10d9)=>_0x47ae7b&&!_0x5d10d9),_0x24caee['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x24caee['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x24caee['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x24caee;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x548db7=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x548db7,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2704a2){const _0x11997f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2704a2||i(_0x11997f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x166283{['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[_0x45d88e,a,K,_0x4aebcd];}constructor(_0x5dbdf3){super(_0x5dbdf3),_0x5dbdf3['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5dbdf3['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x5dbdf3['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5dbdf3['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x1e8729}=this;this['_aiAdapter']=_0x1e8729['plugins']['get'](K),this['_dialog']=_0x1e8729['plugins']['get'](_0x4aebcd),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x560253=new E(_0x1e8729,Array['from'](this['_commandDefinitions']['values']()));_0x1e8729['commands']['add']('showAIAssistant',_0x560253),_0x1e8729['ui']['componentFactory']['add']('aiCommands',_0xae71eb=>{const _0x281649=_0x334429(_0xae71eb);return _0x281649['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x281649['buttonView']['set']({'label':i(_0xae71eb,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x281649['on']('execute',_0x27fe6e=>this['_onExecute'](_0x27fe6e['source']['id'])),_0x390a9c(_0x281649,_0x1e8729['ui']['view']['body'],function(_0x1295d0){const _0x39343a=o(_0x1295d0['config']['get']('ai.aiAssistant.commands'),_0x1295d0['locale']),_0x4f6d94=U(_0x1295d0,_0x39343a)['filter'](_0x580e29=>_0x580e29['commands']['length']);if(0x1===_0x4f6d94['length'])return U(_0x1295d0,_0x4f6d94[0x0]['commands'])['map'](_0x526cbd=>({'id':_0x526cbd['id'],'label':_0x526cbd['label']}));return _0x4f6d94['map'](_0x124d43=>{const {groupId:_0x42d10f,groupLabel:_0x310617,commands:_0x643fa1}=_0x124d43,_0x3c4726=U(_0x1295d0,_0x643fa1)['map'](_0x23d285=>({'id':_0x23d285['id'],'label':_0x23d285['label']}));return{'id':_0x42d10f,'menu':_0x310617||_0x42d10f,'children':_0x3c4726};});}(_0x1e8729),{'ariaLabel':i(_0xae71eb,'AI\x20Commands')}),_0x281649['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x560253['on']('change:enabledCommandsIds',_0x1d405d),_0x281649['menuView']['once']('render',_0x1d405d),_0x281649;function _0x1d405d(){_0x281649['isEnabled']=_0x560253['enabledCommandsIds']['length']>0x0;for(const _0x47b7b7 of _0x281649['menuView']['buttons'])_0x47b7b7['isEnabled']=_0x560253['enabledCommandsIds']['includes'](_0x47b7b7['id']);}}),_0x1e8729['ui']['componentFactory']['add']('menuBar:aiCommands',_0x30d85e=>{const _0x307dcf=new _0x2cf723(_0x30d85e);_0x307dcf['buttonView']['set']({'label':i(_0x30d85e,'AI\x20Commands'),'icon':T}),_0x307dcf['bind']('isEnabled')['to'](_0x560253,'enabledCommandsIds',_0x144841=>_0x144841['length']>0x0);const _0x4498fc=o(_0x1e8729['config']['get']('ai.aiAssistant.commands'),_0x30d85e);return this['_populateMenuBarMenu'](_0x560253,_0x307dcf,_0x4498fc,_0x11a428=>this['_onExecute'](_0x11a428)),_0x307dcf;}),_0x1e8729['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x8a565f=this['_createAIAssistantUIButton'](_0x317755);return _0x8a565f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x8a565f;}),_0x1e8729['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x54c56b=this['_createAIAssistantUIButton'](_0x1b137b);return _0x54c56b['set']({'role':'menuitemcheckbox'}),_0x54c56b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x540439=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x33d02e;for(const _0x330b39 in _0x540439){const _0x389366=_0x330b39,_0x4b0120=_0x540439[_0x389366];if('aiLicenseKeyValid'==_0x4b0120||'aiLicenseKeyInvalid'==_0x4b0120||'aiLicenseKeyExpired'==_0x4b0120||'aiLicenseKeyDomainLimit'==_0x4b0120||'aiLicenseKeyNotAllowed'==_0x4b0120||'aiLicenseKeyEvaluationLimit'==_0x4b0120||'aiLicenseKeyTrialLimit'==_0x4b0120||'aiLicenseKeyUsageLimit'==_0x4b0120){delete _0x540439[_0x389366],_0x33d02e=_0x4b0120,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x33d02e&&_0x540439['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x33d02e&&_0x540439['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x33d02e&&_0x540439['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x33d02e&&_0x540439['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x33d02e&&_0x540439['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x33d02e&&_0x540439['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x33d02e&&_0x540439['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x500ac9='',_0x3eaf64='',_0x2c05ec='custom'){const _0xd4578a=this['editor'],_0x3ab00e=_0xd4578a['editing']['view'],_0x179b20=_0xd4578a['plugins']['get'](a),_0x1e6923=_0xd4578a['plugins']['get'](_0x45d88e);_0x179b20['showFakeVisualSelection']();const _0x418e13=new w(),_0x550d03=new ClipboardEvent('copy',{'clipboardData':_0x418e13}),_0x58036e=new _0x39a236(_0x418e13),_0x56d1ed=new _0x22c2f0(_0x3ab00e,_0x550d03,{'dataTransfer':_0x58036e});_0x1e6923['_forceMarkersCopy']('comment',()=>{_0x3ab00e['document']['fire']('copy',_0x56d1ed);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xd4578a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x532a40=_0x58036e['getData']('text/html');const _0x7030fd=_0xd4578a['model']['document']['selection'],_0xe74fe2=Array['from'](_0x7030fd['getRanges']());0x1===_0xe74fe2['length']&&_0xe74fe2[0x0]['isFlat']&&!_0x7030fd['getSelectedElement']()&&''!==_0x532a40['replace'](/ /g,'')['trim']()&&(_0x532a40='<p>'+_0x532a40+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x2c05ec,'query':_0x500ac9,'htmlContent':_0x532a40,'label':_0x3eaf64,'mainActionLabel':M[_0xd4578a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x55fa78['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x179b20['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x14ba00=new Map(),_0x3b1eb5=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x30e2b9 of _0x3b1eb5)for(const _0x533735 of _0x30e2b9['commands'])_0x14ba00['set'](_0x533735['id'],{..._0x533735,'groupId':_0x30e2b9['groupId'],'groupLabel':_0x30e2b9['groupLabel']||_0x30e2b9['groupId']});return _0x14ba00;}['_createAIAssistantUIButton'](_0x3ea4a4){const _0x3ad0b5=this['editor'],_0x39153c=_0x3ad0b5['commands']['get']('showAIAssistant'),_0x5a500c=new _0x3ea4a4(_0x3ad0b5['locale']);return _0x5a500c['set']({'label':i(_0x3ad0b5['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x5a500c['bind']('isEnabled')['to'](_0x39153c),_0x5a500c['bind']('isOn')['to'](this['_dialog'],'id',_0x450f36=>'aiAssistant'===_0x450f36),this['listenTo'](_0x5a500c,'execute',()=>{_0x5a500c['isOn']?this['hideUI']():_0x39153c['execute']();}),_0x5a500c;}['_initView'](){const _0x3cc5a2=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',()=>{_0x3cc5a2['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3cc5a2['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x574b0e,ui:{ariaLiveAnnouncer:_0x160b43}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x16ceee,_0x33a26a,_0x7964bb)=>{const _0x2da6d2=this['_aiAssistantController']['currentContext'];_0x7964bb?_0x160b43['announce'](i(_0x574b0e,'AI\x20is\x20writing')):_0x2da6d2&&_0x160b43['announce'](i(_0x574b0e,'Generated\x20content:\x20%0',_0x2da6d2),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x183fe0,_0x19b00f,_0xfa6969)=>{if(_0xfa6969){const _0x55d73c=this['_formView']['errorView']['text'];_0x160b43['announce'](i(_0x574b0e,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x55d73c));}});}['_onExecute'](_0x1f841c){const _0x118afc=this['_commandDefinitions']['get'](_0x1f841c),_0x968df4=this['editor'],_0x43a931=_0x968df4['model']['document']['selection'],_0x3c7cef=_0x968df4['commands']['get']('showAIAssistant'),_0x450174=_0x968df4['plugins']['get'](a),_0x25d937=''+(_0x118afc['groupId']!==x?_0x118afc['groupLabel']+':\x20':'')+_0x118afc['label'];if(!0x1!==_0x118afc['requiresContent']&&_0x43a931['isCollapsed']){const _0x5dee13=_0x24de88(_0x43a931['getSelectedBlocks']())||_0x968df4['model']['schema']['getLimitElement'](_0x43a931);_0x968df4['model']['change'](_0x12cad0=>{_0x12cad0['setSelection'](_0x5dee13,'in');});}_0x450174['showFakeVisualSelection'](),_0x3c7cef['execute'](_0x118afc['prompt'],_0x25d937,'command:'+_0x1f841c);}['_populateMenuBarMenu'](_0x267ff9,_0x222e52,_0x2147a6,_0x19b73a){const _0x364ad3=this['editor'],_0x9b5063=_0x364ad3['locale'],_0x10c679=new _0x5cdd37(_0x9b5063),_0x947c70=U(_0x364ad3,_0x2147a6)['filter'](_0x532e70=>_0x532e70['commands']['length']);0x1===_0x947c70['length']?this['_getMenuBarGroupButtons']({'command':_0x267ff9,'commands':_0x947c70[0x0]['commands'],'parentMenuView':_0x222e52,'onExecute':_0x19b73a})['forEach'](_0x43452a=>_0x10c679['items']['add'](_0x43452a)):_0x947c70['forEach'](({groupId:_0x49f59c,groupLabel:_0x3101cf,commands:_0x16425b})=>{const _0x33afff=new _0x1226d5(_0x9b5063,_0x222e52),_0x1fe692=new _0x2cf723(_0x9b5063),_0x583a15=new _0x5cdd37(_0x9b5063),_0x528222=this['_getMenuBarGroupButtons']({'command':_0x267ff9,'commands':_0x16425b,'parentMenuView':_0x1fe692,'onExecute':_0x19b73a});_0x1fe692['buttonView']['set']({'label':_0x3101cf||_0x49f59c}),_0x1fe692['delegate']('execute')['to'](_0x222e52),_0x583a15['items']['addMany'](_0x528222),_0x1fe692['panelView']['children']['add'](_0x583a15),_0x33afff['children']['add'](_0x1fe692),_0x10c679['items']['add'](_0x33afff);}),_0x222e52['panelView']['children']['add'](_0x10c679);}['_getMenuBarGroupButtons']({command:_0x314162,commands:_0x305837,parentMenuView:_0x5974eb,onExecute:_0x26299e}){const _0x52e4f5=this['editor'],_0x511b6e=_0x52e4f5['locale'];return U(_0x52e4f5,_0x305837)['map'](_0x256728=>{const _0xd391a2=new _0x1226d5(_0x511b6e,_0x5974eb),_0x5e5a9a=new _0x1b137b(_0x511b6e);return _0x5e5a9a['set']({'label':_0x256728['label']}),_0x5e5a9a['delegate']('execute')['to'](_0x5974eb),_0x5e5a9a['on']('execute',()=>_0x26299e(_0x256728['id'])),_0x5e5a9a['bind']('isEnabled')['to'](_0x314162,'enabledCommandsIds',_0x25e5f0=>_0x25e5f0['includes'](_0x256728['id'])),_0xd391a2['children']['add'](_0x5e5a9a),_0xd391a2;});}}function B(_0x5d3f22,_0x27f04f){return void 0x0!==_0x5d3f22['order']&&void 0x0===_0x27f04f['order']?0x1:void 0x0===_0x5d3f22['order']&&void 0x0!==_0x27f04f['order']?-0x1:void 0x0!==_0x5d3f22['order']&&void 0x0!==_0x27f04f['order']?_0x5d3f22['order']-_0x27f04f['order']:0x0;}function U(_0x1fab65,_0x1ca1ce){_0x1ca1ce['sort'](B);const _0x656b9d={},_0x47250d=[];for(const _0x3a1eff of _0x1ca1ce)if(void 0x0!==_0x3a1eff['order']){if(_0x3a1eff['order']in _0x656b9d)throw new _0xa8682e('ai-commands-config-order-collision',_0x1fab65,{'conflictingDefinitions':[_0x3a1eff,_0x656b9d[_0x3a1eff['order']]]});_0x656b9d[_0x3a1eff['order']]=_0x3a1eff,_0x47250d['splice'](_0x3a1eff['order'],0x0,_0x3a1eff);}else _0x47250d['push'](_0x3a1eff);return _0x47250d;}class r extends _0x166283{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4bb1a5){super(_0x4bb1a5);const _0xef69aa=_0x4bb1a5['config'],_0x49ecec=_0x4bb1a5['locale'];_0xef69aa['define']('ai.aiAssistant.preserveComments',!0x0),_0xef69aa['define']('ai.aiAssistant.commands',function(_0x63980b){return[{'groupId':'editOrReview','groupLabel':i(_0x63980b,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x63980b,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x63980b,'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(_0x63980b,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x63980b,'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(_0x63980b,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x63980b,'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(_0x63980b,'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(_0x63980b,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x63980b,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x63980b,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x63980b,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x63980b,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x63980b,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x63980b,'Change\x20style'),'commands':[{'id':'business','label':i(_0x63980b,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x63980b,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x63980b,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x63980b,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x63980b,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x63980b,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x63980b,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x63980b,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x63980b,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x63980b,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x63980b,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x63980b,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x63980b,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x49ecec)),_0xef69aa['define']('ai.aiAssistant.extraCommandGroups',[]),_0xef69aa['define']('ai.aiAssistant.removeCommands',[]);let _0x2e5575=o(_0xef69aa['get']('ai.aiAssistant.commands'),_0x49ecec);const _0x158a3c=_0xef69aa['get']('ai.aiAssistant.extraCommandGroups'),_0x8e1e37=_0xef69aa['get']('ai.aiAssistant.removeCommands');_0x158a3c['forEach'](_0x25d039=>{const _0x4797d7=_0x2e5575['find'](_0x2e34cb=>_0x2e34cb['groupId']===_0x25d039['groupId']);_0x4797d7?_0x4797d7['commands']=_0x4797d7['commands']['concat'](_0x25d039['commands']):_0x2e5575['push'](_0x25d039);}),_0x2e5575=_0x2e5575['filter'](_0x3d2375=>!_0x8e1e37['includes'](_0x3d2375['groupId'])),_0x2e5575['forEach'](_0x1e1c66=>{_0x1e1c66['commands']=_0x1e1c66['commands']['filter'](_0x1860f2=>!_0x8e1e37['includes'](_0x1860f2['id']));}),_0xef69aa['set']('ai.aiAssistant.commands',_0x2e5575);}}class P extends _0x166283{['abortController'];static get['requires'](){return[K];}constructor(_0x522c49){super(_0x522c49),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x550e45){return this['sendRequest'](_0x550e45)['catch'](_0x14f847=>{if(_0x14f847 instanceof R)return Promise['reject'](_0x14f847);if('AbortError'==_0x14f847['name'])return Promise['resolve']();throw console['error'](_0x14f847),new _0xa8682e('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x3a8708,_0x2492af){const _0x1c4135=this['editor']['locale'],_0x500a92={'Content-Type':'application/json'};if('object'==typeof _0x3a8708)Object['assign'](_0x500a92,_0x3a8708);else{if(_0x3a8708)try{const _0x1f3650=await _0x3a8708(_0x2492af);Object['assign'](_0x500a92,_0x1f3650);}catch(_0x12c52b){return Promise['reject'](new R(i(_0x1c4135,'AI_ERROR_GET_HEADERS')));}}return _0x500a92;}async['_prepareRequestParameters'](_0x5dfc16,_0x2a2f20){const _0x48e010=this['editor']['locale'];if('object'==typeof _0x5dfc16)return _0x5dfc16;try{return await _0x5dfc16(_0x2a2f20);}catch(_0x33b02e){return Promise['reject'](new R(i(_0x48e010,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4f4b3c){super(_0x4f4b3c),_0x4f4b3c['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4f4b3c['config']['get']('ai.openAI.requestParameters')||_0x4f4b3c['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4f4b3c['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4f4b3c['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4f4b3c['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x38a678,context:_0x5cba7c,onData:_0xd5c973,actionId:_0x4f4bec}){const _0x3178f0=this['editor']['locale'],_0x5cac4a=await this['prepareMessages'](_0x38a678,_0x5cba7c,_0x4f4bec),_0x1e7caa=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4f4bec),_0x36f0ee=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4f4bec),_0xe52085={'messages':_0x5cac4a,..._0x36f0ee},_0xadbe2d={'method':'POST','headers':_0x1e7caa,'body':JSON['stringify'](_0xe52085),'signal':this['abortController']['signal']},_0x81ac04=await fetch(this['_apiUrl'],_0xadbe2d);if(_0x81ac04['ok'])return _0x36f0ee['stream']?await this['_readStreamableResponse'](_0x81ac04,_0xd5c973):await this['_readStaticResponse'](_0x81ac04,_0xd5c973),Promise['resolve']();{const _0x39e27a=await _0x81ac04['text']();return _0x39e27a['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3178f0,'AI_ERROR_CONTEXT_LENGTH'))):_0x39e27a['includes']('Moderation')?Promise['reject'](new R(i(_0x3178f0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x39e27a));}}async['prepareMessages'](_0x55d730,_0x18fe90,_0x58625b){let _0x2a797e,_0x46ad00;return _0x18fe90?(_0x2a797e='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.',_0x46ad00='Instruction:\x0a'+_0x55d730+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x18fe90):(_0x2a797e='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.',_0x46ad00=_0x55d730),[{'role':'system','content':_0x2a797e},{'role':'user','content':_0x46ad00}];}async['_readStreamableResponse'](_0xc2f179,_0x4a7dcf){const _0x1635a7=_0xc2f179['body']['getReader'](),_0x162384=new TextDecoder();let _0x4cdff2='',_0x30ca95='',_0xe24743='',_0x5f18a3=!0x1;for(;!_0x5f18a3;){const {done:_0x41d548,value:_0x2847e1}=await _0x1635a7['read'](),_0x522cc6=_0x4cdff2+_0x162384['decode'](_0x2847e1);let _0x37a927='';_0x5f18a3=_0x41d548;try{_0x37a927=this['_cleanUpData'](_0x522cc6),_0x4cdff2='';}catch(_0x202b2b){_0x4cdff2=_0x522cc6;continue;}_0x30ca95+=_0x37a927,!_0x5f18a3&&this['_isBufferIncomplete'](_0x30ca95)||_0x30ca95&&(_0xe24743+=_0x30ca95,_0x30ca95='',_0x4a7dcf(_0xe24743));}return Promise['resolve']();}async['_readStaticResponse'](_0x3945dd,_0x48ea16){return _0x48ea16((await _0x3945dd['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x12c553){const _0x4ba65a=_0x12c553['split']('<')['length']!==_0x12c553['split']('>')['length'],_0x25ac07=_0x12c553['length']<0x1e;return _0x4ba65a&&_0x25ac07;}['_cleanUpData'](_0x137ee3){return _0x137ee3['split'](/\n(?![^{]*\})/g)['map'](_0x3de5d9=>_0x3de5d9['replace']('data:\x20',''))['filter'](_0x28e6d1=>_0x28e6d1&&_0x28e6d1['length']>0x0&&'[DONE]'!==_0x28e6d1)['map'](_0x3b6130=>{const {choices:_0x237cc3}=JSON['parse'](_0x3b6130);if(_0x237cc3[0x0]&&_0x237cc3[0x0]['delta']&&_0x237cc3[0x0]['delta']['content'])return _0x237cc3[0x0]['delta']['content'];})['filter'](_0x577b13=>_0x577b13)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2b4b54){super(_0x2b4b54),_0x2b4b54['config']['get']('ai.aws.requestParameters')||_0x2b4b54['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']=_0x2b4b54['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2b4b54['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2b4b54['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2b4b54['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x217352,context:_0x57c8ea,onData:_0x40a5eb,actionId:_0x34d2d9}){const {model:_0x533525,stream:_0x58bd70,..._0x33c3c7}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x34d2d9),_0x27a45b={'prompt':await this['preparePrompt'](_0x217352,_0x57c8ea,_0x533525,_0x34d2d9),..._0x33c3c7};this['_apiUrl']?await this['_processProxyRequest'](_0x27a45b,_0x533525,_0x58bd70,_0x40a5eb,_0x34d2d9):await this['_processAWSRequest'](_0x27a45b,_0x533525,_0x58bd70,_0x40a5eb);}async['preparePrompt'](_0x317752,_0x8f3e60,_0x1cd141,_0x43b369){let _0x53db36,_0x3f227d;return _0x8f3e60?(_0x53db36='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.',_0x3f227d='Instruction:\x0a'+_0x317752+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x8f3e60):(_0x53db36='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.',_0x3f227d=_0x317752),'meta.llama'==this['getModelFamily'](_0x1cd141)?'<<SYS>>\x0a'+_0x53db36+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3f227d+'\x0a[/INST]':'Human:\x0a'+_0x53db36+'\x0a'+_0x3f227d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1cfd2c){if(/^anthropic\.claude/['test'](_0x1cfd2c))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1cfd2c))return'ai21.j2';if(/^cohere\.command/['test'](_0x1cfd2c))return'cohere.command';if(/^meta\.llama/['test'](_0x1cfd2c))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1cfd2c));}async['_processProxyRequest'](_0x9b2258,_0x220f72,_0x2dd78a,_0x4719ce,_0x5ceafe){const _0x260dde={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5ceafe),'body':JSON['stringify']({..._0x9b2258,'model':_0x220f72,'stream':_0x2dd78a}),'signal':this['abortController']['signal']},_0xd78e0f=await fetch(this['_apiUrl'],_0x260dde);_0x2dd78a?await this['_readStreamableResponse'](_0xd78e0f,_0x220f72,_0x4719ce):await this['_readStaticResponse'](_0xd78e0f,_0x220f72,_0x4719ce);}async['_processAWSRequest'](_0x1e7d80,_0x626fde,_0x34e2a4,_0x3c2046){const _0xd0112e=new _0x5df8b5(this['_bedrockClientConfig']),_0x305337={'body':JSON['stringify'](_0x1e7d80),'contentType':'application/json','accept':'application/json','modelId':_0x626fde};let _0x20f2ea;if(_0x34e2a4){const _0x4951b3=new _0x595d99(_0x305337);_0x20f2ea=await _0xd0112e['send'](_0x4951b3,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x20f2ea,_0x626fde,_0x3c2046);}else{const _0x1929a0=new _0x2c86a7(_0x305337);_0x20f2ea=await _0xd0112e['send'](_0x1929a0,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x20f2ea,_0x626fde,_0x3c2046);}}async['_readAsyncIterableResponse'](_0x13332f,_0xc834ea,_0x3533d2){const _0x29bf9a=_0x13332f['body'],_0x5cdd2b=new TextDecoder('utf-8');let _0x23afb8='';for await(const _0x671692 of _0x29bf9a)if(_0x671692['chunk']){const _0x25024d=_0x5cdd2b['decode'](_0x671692['chunk']['bytes']),_0x45cd3d=JSON['parse'](_0x25024d);_0x23afb8+=this['_getGeneratedText'](_0x45cd3d,_0xc834ea),_0x3533d2(_0x23afb8);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4be2b2,_0x54174c,_0x3847c3){const _0x7bfbd3=_0x4be2b2['body'],_0x67c1b0=new TextDecoder('utf-8'),_0x47f6dd=_0x7bfbd3['getReader']();let _0x27201b='',_0x118bf3='',_0x597bb6=!0x1;for(;!_0x597bb6;){const {done:_0x59f206,value:_0x10a300}=await _0x47f6dd['read']();if(_0x597bb6=_0x59f206,_0x597bb6)break;const _0x30bad3=(_0x27201b+_0x67c1b0['decode'](_0x10a300))['split']('\x0a')['map'](_0x1279b9=>{try{return _0x27201b='',JSON['parse'](_0x1279b9);}catch(_0x2fcf62){return _0x27201b=_0x1279b9,null;}})['filter'](_0x4f6b9a=>null!==_0x4f6b9a);_0x30bad3['length']&&(_0x118bf3+=_0x30bad3['map'](_0x2d0a35=>this['_getGeneratedText'](_0x2d0a35,_0x54174c))['join'](''),_0x3847c3(_0x118bf3));}return Promise['resolve']();}async['_readStaticResponse'](_0x1ac435,_0x34e3f5,_0x211703){let _0x5ebd2d;return _0x5ebd2d=_0x1ac435 instanceof Response?await _0x1ac435['json']():JSON['parse'](Buffer['from'](_0x1ac435['body'])['toString']('utf8')),(_0x211703(this['_getGeneratedText'](_0x5ebd2d,_0x34e3f5)),Promise['resolve']());}['_getGeneratedText'](_0x5d5ccc,_0x515d6a){switch(this['getModelFamily'](_0x515d6a)){case'anthropic.claude':return _0x5d5ccc['completion'];case'ai21.j2':return _0x5d5ccc['completions'][0x0]['data']['text'];case'cohere.command':return _0x5d5ccc['generations'][0x0]['text'];case'meta.llama':return _0x5d5ccc['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x383c04=>0x1!=_0x383c04}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x3612f7=>{const {af:{dictionary:_0x2ccf67,getPluralForm:_0x1d4fb3}}={'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':_0x4f2209=>0x1!=_0x4f2209}};_0x3612f7['af']||={'dictionary':{},'getPluralForm':null},_0x3612f7['af']['dictionary']=Object['assign'](_0x3612f7['af']['dictionary'],_0x2ccf67),_0x3612f7['af']['getPluralForm']=_0x1d4fb3;})(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':_0x244eec=>0x0==_0x244eec?0x0:0x1==_0x244eec?0x1:0x2==_0x244eec?0x2:_0x244eec%0x64>=0x3&&_0x244eec%0x64<=0xa?0x3:_0x244eec%0x64>=0xb?0x4:0x5}};
|