@ckeditor/ckeditor5-ai 45.2.1-alpha.9 → 46.0.0-alpha.0
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/be.js +1 -1
- package/dist/translations/be.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 +16 -11
- package/src/adapters/aiadapter.d.ts +2 -2
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.d.ts +4 -4
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.d.ts +7 -7
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.d.ts +6 -7
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.d.ts +11 -11
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.d.ts +3 -3
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.d.ts +3 -3
- package/src/aiassistantui.js +1 -1
- package/src/aiconfig.d.ts +4 -4
- package/src/augmentation.d.ts +6 -6
- package/src/index.d.ts +9 -6
- package/src/index.js +1 -1
- package/src/legacyerrors.js +1 -1
- package/src/ui/aiassistantcontroller.d.ts +3 -3
- package/src/ui/aiassistantcontroller.js +2 -2
- package/src/ui/form/aiformcontentarea.d.ts +1 -1
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.d.ts +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.d.ts +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.d.ts +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.d.ts +5 -5
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.d.ts +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.d.ts +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.d.ts +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.d.ts +3 -3
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/normalizecommandsconfig.d.ts +2 -2
- 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 _0x21cda4,Command as _0x3f25bd}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2e6853,IconCheck as _0x83c214,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0xafb348,IconRobotPencil as _0x30a012}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x203131,CKEditorError as _0x4f8769,ObservableMixin as _0x371884,global as _0x23e469,isVisible as ot,Rect as it,Collection as _0x4996bc,FocusTracker as mt,KeystrokeHandler as ut,first as _0x2abc6a}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x4d1286,View as _0x14fb67,SpinnerView as _0x47374c,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x4604ae,createDropdown as _0x464473,addMenuToDropdown as _0x16bd78,MenuBarMenuView as _0x37e0bb,MenuBarMenuListItemButtonView as _0x296cb0,DialogViewPosition as _0x474448,MenuBarMenuListView as _0x11ae37,MenuBarMenuListItemView as _0x130694}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1cad4b,ClipboardMarkersUtils as _0x338528}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x413423,DataTransfer as _0x3b504d,UpcastWriter as _0x21ff82,Matcher as _0x4a81f1}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5ba1a0,InvokeModelWithResponseStreamCommand as _0x4d12b3,InvokeModelCommand as _0x3f1736}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x15eea1,_0x3f2937){const _0x1e18d4=(0x0,_0x3f2937['t'])('Other');return _0x15eea1['length']?'groupId'in _0x15eea1[0x0]?_0x15eea1:[{'groupId':x,'groupLabel':_0x1e18d4,'order':0x1/0x0,'commands':_0x15eea1}]:[{'groupId':x,'groupLabel':_0x1e18d4,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x21cda4{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4984bb}=this,_0x4b10e7=['ck-fake-ai-selection'];_0x4984bb['config']['get']('ai.useTheme')&&_0x4b10e7['push']('ck-ai-assistant-ui_theme'),_0x4984bb['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x4b10e7,'priority':0xc}}),_0x4984bb['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0xd66fd5,{writer:_0x1cbcdd})=>{if(!_0xd66fd5['markerRange']['isCollapsed'])return null;const _0x42b2e5=_0x1cbcdd['createUIElement']('span');return _0x1cbcdd['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x42b2e5),_0x42b2e5;}});}['afterInit'](){!async function(_0x4b8f32){const _0xca57bf=_0x383644([0x69,0x4d,0x59,0x6a,0x79,0x78,0x56,0x48,0x72,0x58,0x4c,0x31,0x6c,0x43,0x61,0x67,0x6b,0x41,0x49,0x47,0x38,0x4b,0x71,0x6f,0x73,0x76,0x63,0x66,0x65,0x33,0x74,0x68,0x34,0x30,0x50,0x32,0x51,0x45,0x36,0x70,0x57,0x37,0x35,0x6d,0x77,0x4e,0x42,0x53,0x62,0x5a,0x44,0x6e,0x46,0x54,0x39,0x4f,0x4a,0x52,0x75,0x55,0x7a,0x64]),_0x3ed0ac=0x6e00b1c7,_0xa931ef=0x6e07da57^_0x3ed0ac,_0x510c44=window[_0x383644([0x44,0x61,0x74,0x65])][_0x383644([0x6e,0x6f,0x77])](),_0x4bd534=_0x4b8f32[_0x383644([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x1a4db0=new window[(_0x383644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c929=>{_0x4bd534[_0x383644([0x6f,0x6e,0x63,0x65])](_0x383644([0x72,0x65,0x61,0x64,0x79]),_0x3c929);}),_0x3697e9={[_0x383644([0x6b,0x74,0x79])]:_0x383644([0x45,0x43]),[_0x383644([0x75,0x73,0x65])]:_0x383644([0x73,0x69,0x67]),[_0x383644([0x63,0x72,0x76])]:_0x383644([0x50,0x2d,0x32,0x35,0x36]),[_0x383644([0x78])]:_0x383644([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]),[_0x383644([0x79])]:_0x383644([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]),[_0x383644([0x61,0x6c,0x67])]:_0x383644([0x45,0x53,0x32,0x35,0x36])},_0x230983=_0x4bd534[_0x383644([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x383644([0x67,0x65,0x74])](_0x383644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x393cdc(){let _0x58d214,_0x26b109=null,_0x48c2ef=null;try{if(_0x230983==_0x383644([0x47,0x50,0x4c]))return _0x383644([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x58d214=_0x391ac7(),!_0x58d214)return _0x383644([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x58d214[_0x383644([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x48c2ef=_0x5120f0(_0x58d214[_0x383644([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x58d214[_0x383644([0x6a,0x74,0x69])])),await _0x3b5588()?_0x88becf()?_0x1d0884()?_0x383644([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x347e04()?(_0x58d214[_0x383644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x383644([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x26b109=_0x36b08e(_0x383644([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x58d214[_0x383644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x383644([0x74,0x72,0x69,0x61,0x6c])&&(_0x26b109=_0x36b08e(_0x383644([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x115479()):_0x383644([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x383644([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x383644([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x383644([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1d0884(){const _0x485bca=[_0x383644([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x383644([0x74,0x72,0x69,0x61,0x6c])][_0x383644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x58d214[_0x383644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x510c44/0x3e8:0xe10*_0xa931ef;return _0x58d214[_0x383644([0x65,0x78,0x70])]<_0x485bca;}function _0x88becf(){const _0x5c084d=_0x58d214[_0x383644([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5c084d&&(!!_0x5c084d[_0x383644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x383644([0x2a]))||!!_0x5c084d[_0x383644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x383644([0x41,0x49])));}function _0x347e04(){const _0x1d6939=_0x58d214[_0x383644([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1d6939||0x0==_0x1d6939[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x3204e2}=new URL(window[_0x383644([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1d6939[_0x383644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3204e2))return!0x0;const _0xf99a1f=_0x3204e2[_0x383644([0x73,0x70,0x6c,0x69,0x74])](_0x383644([0x2e]));return _0x1d6939[_0x383644([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5b42ad=>_0x5b42ad[_0x383644([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x383644([0x2a])))[_0x383644([0x6d,0x61,0x70])](_0x139732=>_0x139732[_0x383644([0x73,0x70,0x6c,0x69,0x74])](_0x383644([0x2e])))[_0x383644([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x133a97=>_0x133a97[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0xf99a1f[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x383644([0x6d,0x61,0x70])](_0x5b8a7a=>Array(_0xf99a1f[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5b8a7a[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x383644([0x66,0x69,0x6c,0x6c])](_0x5b8a7a[0x0]===_0x383644([0x2a])?_0x383644([0x2a]):'')[_0x383644([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5b8a7a))[_0x383644([0x73,0x6f,0x6d,0x65])](_0x181e98=>_0xf99a1f[_0x383644([0x65,0x76,0x65,0x72,0x79])]((_0x5e762e,_0x394c0c)=>_0x181e98[_0x394c0c]===_0x5e762e||_0x181e98[_0x394c0c]===_0x383644([0x2a])));}function _0x115479(){return _0x26b109&&_0x48c2ef?new window[(_0x383644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a3cfa,_0x39c27a)=>{_0x26b109[_0x383644([0x74,0x68,0x65,0x6e])](_0x4a3cfa,_0x39c27a),_0x48c2ef[_0x383644([0x74,0x68,0x65,0x6e])](_0x3964ad=>{_0x3964ad!=_0x383644([0x56,0x61,0x6c,0x69,0x64])&&_0x4a3cfa(_0x3964ad);},_0x39c27a);}):_0x26b109||_0x48c2ef||_0x383644([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5120f0(_0x49c57b,_0x3ea86e){return new window[(_0x383644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xaa458f=>{if(_0x575a6c())return _0xaa458f(_0x383644([0x56,0x61,0x6c,0x69,0x64]));_0x7f17e2(),_0x4bd534[_0x383644([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x383644([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3e6a23=!0x1;const _0x1d5566=_0x203131();function _0x504ce5(_0x4f5e3f){return!!_0x4f5e3f&&(typeof _0x4f5e3f===_0x383644([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x4f5e3f===_0x383644([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x4f5e3f[_0x383644([0x74,0x68,0x65,0x6e])]===_0x383644([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x4f5e3f[_0x383644([0x63,0x61,0x74,0x63,0x68])]===_0x383644([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x7f6a9e(_0x2a0fe0){_0x1d0071(_0x2a0fe0)[_0x383644([0x74,0x68,0x65,0x6e])](_0x441f62=>{if(!_0x441f62||_0x441f62[_0x383644([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x383644([0x6f,0x6b]))return _0x383644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xf83a13(_0x9430a8(_0x1d5566+_0x3ea86e))!=_0x441f62[_0x383644([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x383644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x383644([0x56,0x61,0x6c,0x69,0x64]);})[_0x383644([0x74,0x68,0x65,0x6e])](_0x6cb673=>(_0x4af454(),_0x6cb673),()=>{const _0x5610b7=_0x1b61a0();return null==_0x5610b7?(_0x4af454(),_0x383644([0x56,0x61,0x6c,0x69,0x64])):_0x383644(_0x510c44-_0x5610b7>(0x4a0c35c7^_0x3ed0ac)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x383644([0x74,0x68,0x65,0x6e])](_0xaa458f)[_0x383644([0x63,0x61,0x74,0x63,0x68])](()=>{_0xaa458f(_0x383644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x56f0ba=0x6e365f47^_0x3ed0ac;function _0x4af454(){const _0x5881e9=_0x383644([0x6c,0x6c,0x63,0x74,0x2d])+_0xf83a13(_0x9430a8(_0x49c57b)),_0xb1b031=_0x4360c5(_0xf83a13(window[_0x383644([0x4d,0x61,0x74,0x68])][_0x383644([0x63,0x65,0x69,0x6c])](_0x510c44/_0x56f0ba)));window[_0x383644([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x383644([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5881e9,_0xb1b031);}function _0x1b61a0(){const _0xc9aa3b=_0x383644([0x6c,0x6c,0x63,0x74,0x2d])+_0xf83a13(_0x9430a8(_0x49c57b)),_0x74d032=window[_0x383644([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x383644([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0xc9aa3b);return _0x74d032?window[_0x383644([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4360c5(_0x74d032),0x10)*_0x56f0ba:null;}function _0x1d0071(_0x2932dc){return new window[(_0x383644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x26178c,_0xa81f50)=>{_0x2932dc[_0x383644([0x74,0x68,0x65,0x6e])](_0x26178c,_0xa81f50),window[_0x383644([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0xa81f50,0x6e016507^_0x3ed0ac);});}}_0x4bd534[_0x383644([0x6f,0x6e])](_0x383644([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5e3599,_0x30997f)=>{if(_0x30997f[0x0]!=_0x49c57b)return _0xaa458f(_0x383644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x30997f[0x1]={..._0x30997f[0x1],[_0x383644([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1d5566};},{[_0x383644([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x383644([0x68,0x69,0x67,0x68])}),_0x4bd534[_0x383644([0x6f,0x6e])](_0x383644([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x34cc99=>{_0x504ce5(_0x34cc99[_0x383644([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3e6a23=!0x0,_0x7f6a9e(_0x34cc99[_0x383644([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x383644([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x383644([0x6c,0x6f,0x77])}),_0x1a4db0[_0x383644([0x74,0x68,0x65,0x6e])](()=>{_0x3e6a23||_0xaa458f(_0x383644([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x575a6c(){return _0x4bd534[_0x383644([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x383644([0x76,0x69,0x65,0x77])][_0x383644([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x383644([0x61,0x75,0x74,0x6f]);}function _0x7f17e2(){_0x4bd534[_0x383644([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x383644([0x76,0x69,0x65,0x77])][_0x383644([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x383644([0x61,0x75,0x74,0x6f]);}}function _0x36b08e(_0xb1251){const _0x364b7a=[new window[(_0x383644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3b0b8e=>setTimeout(_0x3b0b8e,0x6e098f0b^_0x3ed0ac)),_0x1a4db0[_0x383644([0x74,0x68,0x65,0x6e])](()=>new window[(_0x383644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5c9119=>{let _0x146c0c=0x0;_0x4bd534[_0x383644([0x6d,0x6f,0x64,0x65,0x6c])][_0x383644([0x6f,0x6e])](_0x383644([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x29517c,_0x1cef8b)=>{_0x1cef8b[0x0][_0x383644([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x146c0c++,_0x146c0c==(0x6e00b03f^_0x3ed0ac)&&(_0x5c9119(),_0x29517c[_0x383644([0x6f,0x66,0x66])]());});}))];return window[_0x383644([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x383644([0x72,0x61,0x63,0x65])](_0x364b7a)[_0x383644([0x74,0x68,0x65,0x6e])](()=>_0xb1251);}async function _0x12a696(){await _0x1a4db0,_0x4bd534[_0x383644([0x6d,0x6f,0x64,0x65,0x6c])][_0x383644([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x214427,_0x4bd534[_0x383644([0x6d,0x6f,0x64,0x65,0x6c])][_0x383644([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x214427,_0x4bd534[_0x383644([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x383644([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x405b67(_0x10ac96){const _0x500025=_0x24be8a();_0x4bd534[_0x500025]=_0x383644([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x10ac96,_0x10ac96!=_0x383644([0x56,0x61,0x6c,0x69,0x64])&&_0x12a696();}function _0x24be8a(){const _0x548952=window[_0x383644([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x383644([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x383644([0x6e,0x6f,0x77])]())[_0x383644([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x383644([0x2e]),'');let _0x50f2b2=_0x383644([0x69]);for(let _0x356358=0x0;_0x356358<_0x548952[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x356358+=0x2){let _0x4f22fc=window[_0x383644([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x548952[_0x383644([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x356358,_0x356358+0x2));_0x4f22fc>=_0xca57bf[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4f22fc-=_0xca57bf[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x50f2b2+=_0xca57bf[_0x4f22fc];}return _0x50f2b2;}function _0x391ac7(){const _0x13130f=_0x230983[_0x383644([0x73,0x70,0x6c,0x69,0x74])](_0x383644([0x2e]));if(0x3!=_0x13130f[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x53b428(_0x13130f[0x1]);function _0x53b428(_0x1eddcd){const _0x664ea9=_0x1ec962(_0x1eddcd);return _0x664ea9&&_0x33297b()?_0x664ea9:null;function _0x33297b(){const _0x506c28=_0x664ea9[_0x383644([0x6a,0x74,0x69])],_0x49c816=window[_0x383644([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x506c28[_0x383644([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x506c28[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1cf998={..._0x664ea9,[_0x383644([0x6a,0x74,0x69])]:_0x506c28[_0x383644([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x506c28[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1cf998[_0x383644([0x76,0x63])],_0x9430a8(_0x1cf998)==_0x49c816;}}}async function _0x3b5588(){let _0x40d55f=!0x0;try{const _0x23c285=_0x230983[_0x383644([0x73,0x70,0x6c,0x69,0x74])](_0x383644([0x2e])),[_0x253d91,_0x59b512,_0x499175]=_0x23c285;return _0x10dd28(_0x253d91),await _0x2f8484(_0x253d91,_0x59b512,_0x499175),_0x40d55f;}catch{return!0x1;}function _0x10dd28(_0x25b57b){const _0x5d4c48=_0x1ec962(_0x25b57b);_0x5d4c48&&_0x5d4c48[_0x383644([0x61,0x6c,0x67])]==_0x383644([0x45,0x53,0x32,0x35,0x36])||(_0x40d55f=!0x1);}async function _0x2f8484(_0x18e254,_0xb263ca,_0xdd9e3){const _0x557bc9=window[_0x383644([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x383644([0x66,0x72,0x6f,0x6d])](_0x47d1ed(_0xdd9e3),_0x27cdcd=>_0x27cdcd[_0x383644([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4d97a3=new window[(_0x383644([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x383644([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x18e254+_0x383644([0x2e])+_0xb263ca),_0x5760e4=window[_0x383644([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x383644([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5760e4)return;const _0x33dc71=await _0x5760e4[_0x383644([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x383644([0x6a,0x77,0x6b]),_0x3697e9,{[_0x383644([0x6e,0x61,0x6d,0x65])]:_0x383644([0x45,0x43,0x44,0x53,0x41]),[_0x383644([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x383644([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x383644([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5760e4[_0x383644([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x383644([0x6e,0x61,0x6d,0x65])]:_0x383644([0x45,0x43,0x44,0x53,0x41]),[_0x383644([0x68,0x61,0x73,0x68])]:{[_0x383644([0x6e,0x61,0x6d,0x65])]:_0x383644([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x33dc71,_0x557bc9,_0x4d97a3)||(_0x40d55f=!0x1);}}function _0x1ec962(_0x1e04be){return _0x1e04be[_0x383644([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x383644([0x65,0x79]))?JSON[_0x383644([0x70,0x61,0x72,0x73,0x65])](_0x47d1ed(_0x1e04be)):null;}function _0x47d1ed(_0x181370){return window[_0x383644([0x61,0x74,0x6f,0x62])](_0x181370[_0x383644([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x383644([0x2b]))[_0x383644([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x383644([0x2f])));}function _0x9430a8(_0x4e57bc){let _0x22405e=0x1505;function _0x5908ea(_0xabfcaa){for(let _0x52d778=0x0;_0x52d778<_0xabfcaa[_0x383644([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x52d778++){const _0xdafd7=_0xabfcaa[_0x383644([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x52d778);_0x22405e=(_0x22405e<<0x5)+_0x22405e+_0xdafd7,_0x22405e&=_0x22405e;}}function _0x386d09(_0x4a551){Array[_0x383644([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x4a551)?_0x4a551[_0x383644([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x386d09):_0x4a551&&typeof _0x4a551==_0x383644([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x383644([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x4a551)[_0x383644([0x73,0x6f,0x72,0x74])]()[_0x383644([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x12faab,_0x38ac94])=>{_0x5908ea(_0x12faab),_0x386d09(_0x38ac94);}):_0x5908ea(window[_0x383644([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x4a551));}return _0x386d09(_0x4e57bc),_0x22405e>>>0x0;}function _0xf83a13(_0xcd4bf5){return _0xcd4bf5[_0x383644([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x383644([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x383644([0x30]));}function _0x4360c5(_0x7f5d9){return _0x7f5d9[_0x383644([0x73,0x70,0x6c,0x69,0x74])]('')[_0x383644([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x383644([0x6a,0x6f,0x69,0x6e])]('');}function _0x214427(){}function _0x383644(_0x1ad3bb){return _0x1ad3bb['map'](_0x3cbcdb=>String['fromCharCode'](_0x3cbcdb))['join']('');}_0x405b67(await _0x393cdc());}(this);}['showFakeVisualSelection'](){const _0x43327b=this['editor']['model'];_0x43327b['change'](_0x6ec290=>{const _0x2c7132=_0x43327b['document']['selection']['getRanges']();let _0x5c9d3e=0x0;for(const _0x54f566 of _0x2c7132){const _0x3823ab=f+':'+_0x5c9d3e;if(_0x43327b['markers']['has'](_0x3823ab))_0x6ec290['updateMarker'](_0x3823ab,{'range':_0x54f566});else{if(_0x54f566['start']['isAtEnd']){const _0x15b691=_0x54f566['start']['getLastMatchingPosition'](({item:_0xb4c4d2})=>!_0x43327b['schema']['isContent'](_0xb4c4d2),{'boundaries':_0x54f566});_0x6ec290['addMarker'](_0x3823ab,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x6ec290['createRange'](_0x15b691,_0x54f566['end'])});}else _0x6ec290['addMarker'](_0x3823ab,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x54f566});}_0x5c9d3e++;}});}['hideFakeVisualSelection'](){const _0x365048=this['editor']['model'],_0x56b255=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x56b255['length']&&_0x365048['change'](_0x52367b=>{_0x56b255['forEach'](_0xc6c559=>{_0x52367b['removeMarker'](_0xc6c559);});});}['insertContent'](_0x163774,_0x3bb6b4){const _0xe5643c=this['_getAISelection'](),_0x42636c=_0x3bb6b4||_0xe5643c['getFirstRange']();this['editor']['model']['canEditAt'](_0x42636c)&&this['editor']['model']['change'](_0x6ee63e=>{this['hideFakeVisualSelection'](),_0x3bb6b4||this['_resetContentOfSelectedTableCells'](_0x6ee63e,_0xe5643c),this['_pasteHTMLUsingClipboard']({'insertAt':_0x42636c,'writer':_0x6ee63e,'html':_0x163774});});}['insertContentBelow'](_0xf0b9e3){const {model:_0x39bde7}=this['editor'],_0x34d9da=this['_getAISelection']();_0x39bde7['change'](()=>{const _0x3ab0eb=this['_prepareTableInsertBelowPosition'](_0xf0b9e3,_0x34d9da)||this['_getDefaultInsertBelowPosition'](_0x34d9da);this['insertContent'](_0xf0b9e3,_0x3ab0eb);});}['_getAISelection'](){const _0x2b25ac=this['editor']['model'],_0x2a30bf=Array['from'](_0x2b25ac['markers']['getMarkersGroup'](f))['map'](_0x5eb0a6=>_0x5eb0a6['getRange']());return _0x2b25ac['createSelection'](_0x2a30bf);}['_pasteHTMLUsingClipboard']({writer:_0x34af07,html:_0x403e5a,insertAt:_0x4495cc}){const {view:_0xedd5b6}=this['editor']['editing'],_0x2f3100=this['editor']['plugins']['get'](_0x1cad4b),_0xde07c6=new gt();_0xde07c6['setData']('text/html',_0x403e5a);const _0x3e916c=new ClipboardEvent('paste',{'clipboardData':_0xde07c6}),_0x29ec9f=new _0x413423(_0xedd5b6,_0x3e916c,{'dataTransfer':new _0x3b504d(_0xde07c6)});_0x34af07['setSelection'](_0x4495cc);const _0x4ed799=(_0x42f0a9,_0x5e2ac7)=>{_0x5e2ac7['resultRange']&&_0x34af07['setSelection'](_0x5e2ac7['resultRange']);};_0x2f3100['once']('contentInsertion',_0x4ed799,{'priority':'lowest'}),_0xedd5b6['document']['fire']('paste',_0x29ec9f),_0x2f3100['off']('contentInsertion',_0x4ed799);}['_getDefaultInsertBelowPosition'](_0x1291f0){const {model:_0x57fa3d}=this['editor'],_0x6a8296=Array['from'](_0x1291f0['getSelectedBlocks']());return _0x6a8296['length']?_0x57fa3d['createPositionAfter'](_0x6a8296['pop']()):_0x1291f0['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2a6a49,_0x4ee7d5){const {model:_0x401bd8,plugins:_0x59303a}=this['editor'];if(_0x59303a['has']('TableUtils')){const _0x8f875=_0x59303a['get']('TableUtils')['getSelectedTableCells'](_0x4ee7d5);if(_0x8f875['length']){const _0xfb7074=this['_getTableRowCountFromContent'](_0x2a6a49),_0x2175e2=this['_createEmptyTableRows'](_0x8f875,_0xfb7074);return _0x401bd8['createPositionAt'](_0x2175e2,0x0);}}return null;}['_getTableRowCountFromContent'](_0x27e64d){const _0x3b5331=this['editor']['plugins']['get']('TableUtils'),_0x72a82e=this['editor']['data']['parse'](_0x27e64d),_0x4a8cc9=Array['from'](_0x72a82e['getChildren']())['filter'](_0x2fee29=>_0x2fee29['is']('element','table'));let _0x17f21f=0x0;return _0x4a8cc9['forEach'](_0x4556fb=>{_0x17f21f+=_0x3b5331['getRows'](_0x4556fb);}),_0x17f21f;}['_createEmptyTableRows'](_0x59c9af,_0x41d645){const _0x2727ce=this['editor']['plugins']['get']('TableUtils'),_0xac310c=_0x2727ce['getRowIndexes'](_0x59c9af),_0x438955=_0x2727ce['getColumnIndexes'](_0x59c9af),_0x2854fe=_0xac310c['last']+0x1,_0x3def2f=_0x438955['first'],_0x37832e=_0x59c9af[0x0]['findAncestor']('table');for(let _0x1399d7=0x0;_0x1399d7<_0x41d645;_0x1399d7++)_0x2727ce['insertRows'](_0x37832e,{'at':_0x2854fe});return _0x37832e['getChild'](_0x2854fe)['getChild'](_0x3def2f);}['_resetContentOfSelectedTableCells'](_0x5e6c8d,_0x266b24){const {plugins:_0x1a0e6f}=this['editor'],{model:_0x5027eb}=_0x5e6c8d;if(!_0x1a0e6f['has']('TableUtils'))return;_0x1a0e6f['get']('TableUtils')['getSelectedTableCells'](_0x266b24)['length']&&_0x5027eb['deleteContent'](_0x266b24);}}class E extends _0x21cda4{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x4f8769('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x10935d){super(_0x10935d),this['name']='AIRequestError';}}function i(_0x56c111,_0x4fd565,_0x23739a){const t=_0x56c111['t'];switch(_0x4fd565){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',_0x23739a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x23739a);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'},_0x23739a);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 _0x4fd565;}}class j extends _0x3f25bd{['_commandDefinitions'];constructor(_0xf33f89,_0x4580ff){super(_0xf33f89),this['_commandDefinitions']=_0x4580ff,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1ffc05,_0x1be177,_0xdbd448)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0xdbd448));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x5b3aee,_0x5f12b1,_0x148c7a)=>{this['enabledCommandsIds']=_0x148c7a?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x26f971=this['editor']['model'];this['_hasContext']=function(_0xcaff59){const _0x287514=_0xcaff59['document']['selection'];return _0x287514['isCollapsed']?0x0!==[..._0x287514['getSelectedBlocks']()]['length']&&![..._0x287514['getSelectedBlocks']()][0x0]['isEmpty']:!!_0xcaff59['hasContent'](_0x287514['getFirstRange']());}(_0x26f971);const _0x49064a=_0x26f971['document']['selection'],_0x52a46e=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x59f1a4 of _0x49064a['getRanges']())for(const _0x35055f of _0x59f1a4['getItems']())if(_0x35055f['is']('element')&&_0x52a46e['includes'](_0x35055f['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0xeb2e20='',_0x463608='',_0x50ae6e='custom'){this['editor']['plugins']['get'](n)['showUI'](_0xeb2e20,_0x463608,_0x50ae6e);}}function G(_0x41f1d4,_0x5f360b){const _0x45bb06=new Set();for(const _0x49a57d of _0x41f1d4['values']())(_0x5f360b||!0x1===_0x49a57d['requiresContent'])&&_0x45bb06['add'](_0x49a57d['id']);return Array['from'](_0x45bb06);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x371884(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1244b0,_0x1449f8,_0x23bc51){super(),this['editor']=_0x1244b0,this['textAdapter']=_0x1449f8,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x23bc51,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2c14db,_0x21f54f,_0x239f2e)=>{this['view']['value']=this['_sanitizeHTML'](_0x239f2e);}),this['listenTo'](this['view'],'submitPrompt',(_0x3fb803,_0x2dca61)=>{const _0x5d8ba7=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2dca61,_0x5d8ba7,'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:_0x4819cd,query:_0x436f8f,htmlContent:_0x36f7d8,label:_0x45bf1f,mainActionLabel:_0x507ede}){this['view']['prompt']=_0x45bf1f,this['view']['mainAction']=_0x507ede,this['initialContext']=_0x36f7d8,_0x436f8f&&(this['view']['isRendered']?this['_handleQuery'](_0x436f8f,_0x36f7d8,_0x4819cd,_0x45bf1f):this['view']['once']('render',()=>{this['_handleQuery'](_0x436f8f,_0x36f7d8,_0x4819cd,_0x45bf1f);}));}['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'](_0x1c9028,_0x51e09f,_0x5824dc,_0x4f7379){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x51e09f,this['previousQuery']=_0x1c9028,this['previousLabel']=_0x4f7379||_0x1c9028,this['previousActionId']=_0x5824dc,new Promise(_0x4124bf=>{this['textAdapter']['makeRequest']({'query':_0x1c9028,'context':_0x51e09f,'onData':_0xfd657f=>{this['currentResponse']=_0xfd657f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5824dc})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x33bb8d=>{_0x33bb8d instanceof R?this['view']['handleError'](_0x33bb8d['message']):this['view']['handleError'](),_0x4124bf();})['finally'](()=>{this['stopProcessing'](),_0x4124bf();});});}['_parseAndNormalizeContent'](_0x2808f3,_0x29f277=!0x1){const _0x537a8b=Z['exec'](_0x2808f3);_0x2808f3=_0x537a8b?_0x2808f3['substring'](_0x537a8b[0x1]['length']):_0x2808f3['length']<0x64&&!_0x29f277?'':this['_stripMarkdownSyntax'](_0x2808f3);const _0x396410=this['_domParser']['parseFromString'](_0x2808f3,'text/html');if(_0x537a8b){const _0x317b81=Array['from'](_0x396410['body']['childNodes']);_0x317b81['reverse']();for(const _0x47ea1f of _0x317b81){if(_0x47ea1f['nodeType']==Node['ELEMENT_NODE'])break;_0x47ea1f['remove']();}}const _0x1dac08=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x396410['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1dac08);const _0x350be3=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x319ee5=this['editor']['data']['toModel'](_0x1dac08);return _0x350be3||_0x319ee5['markers']['clear'](),this['editor']['data']['stringify'](_0x319ee5);}['_normalizeResponseHeadings'](_0x1b5637){const _0x5ae91e=new _0x21ff82(this['editor']['editing']['view']['document']),_0x37574e=new _0x4a81f1({'name':/^h[1-5]$/}),_0x242d4d=[];let _0x119681=!0x1;for(const _0x3eb3bc of _0x1b5637)_0x3eb3bc['is']('element')&&_0x37574e['match'](_0x3eb3bc)&&(_0x242d4d['push'](_0x3eb3bc),'h1'==_0x3eb3bc['name']&&(_0x119681=!0x0));if(_0x119681){for(const _0x107e8f of _0x242d4d)_0x5ae91e['rename']('h'+(parseInt(_0x107e8f['name'][0x1])+0x1),_0x107e8f);}}['_isH1TagSupportEnabled'](){const {data:_0x4322a5,editing:_0x369856}=this['editor'],_0x2c91a9=_0x4322a5['htmlProcessor']['toView']('<h1></h1>'),_0x33207e=_0x4322a5['toView'](_0x4322a5['toModel'](_0x2c91a9));return!!_0x369856['view']['domConverter']['viewToDom'](_0x33207e)['querySelector']('h1');}['_sanitizeHTML'](_0x56dd94){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x56dd94),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x39bed3){const _0x147ce7=_0x39bed3['trim']();return _0x147ce7['startsWith']('```html')?_0x147ce7['endsWith']('```')?_0x147ce7['substring'](0x7,_0x147ce7['length']-0x3):_0x147ce7['substring'](0x7):_0x39bed3;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x126c01){super(_0x126c01),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x6fe670=>i(_0x126c01,'AI_'+_0x6fe670['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x126c01,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x126c01,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x126c01,'Stop'));const _0x4a8902=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4a8902['if']('isVisible','ck-hidden',_0x1dbfab=>!_0x1dbfab)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x337bb8,_0x1af8fd){const _0x706295=new _0x4d1286(this['locale']);return _0x706295['set']({'label':_0x337bb8,'class':_0x1af8fd||'','isVisible':!0x0,'withText':!0x0}),_0x706295;}}class Y extends _0x14fb67{['contentFieldView'];['copyButtonView'];constructor(_0x21ed6d,_0x3d94d5=''){super(_0x21ed6d),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x47ecc4=this['bindTemplate'];this['contentFieldView']=new At(_0x21ed6d,_0x3d94d5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x47ecc4['if']('isVisible','ck-hidden',_0x2652a5=>!_0x2652a5)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x47ecc4['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 _0x47c623=!0x1;this['on']('change:value',(_0x382cea,_0x4648c1,_0x515cfe)=>{const _0x304221=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x515cfe),this['isProcessing']&&_0x304221&&!_0x47c623&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4ca583,_0x22c936,_0x5e7480)=>{_0x47c623=!0x1,_0x5e7480?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x47c623=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x47c623=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x35ddfa=this['locale'],_0x674130=new _0x4d1286(this['locale']),_0xa90172='ck-ai-form__copy-button';return _0x674130['set']({'label':i(_0x35ddfa,'Copy'),'icon':_0x2e6853,'class':_0xa90172,'tooltip':!0x0}),_0x674130['bind']('isVisible')['to'](this,'value',_0x435bc8=>!!_0x435bc8),_0x674130['bind']('isEnabled')['to'](this,'isProcessing',_0xe81079=>!_0xe81079),_0x674130['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x674130['icon']=_0x83c214,_0x674130['class']=_0xa90172+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x674130['icon']=_0x2e6853,_0x674130['class']=_0xa90172;},0x3e8);}),_0x674130;}['_copyHTMLToClipboard'](_0x2f1385){const {window:_0x1ff787,document:_0x12686f}=_0x23e469;if(_0x1ff787['ClipboardItem']){const {Blob:_0x3d4f6f,ClipboardItem:_0x1f8981}=_0x1ff787,_0x38d706=[new _0x1f8981({'text/html':new _0x3d4f6f([_0x2f1385['innerHTML']],{'type':'text/html'}),'text/plain':new _0x3d4f6f([_0x2f1385['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x38d706);}else{const _0x493211=_0x12686f['createElement']('div');_0x493211['style']['position']='absolute',_0x493211['style']['left']='-9999px',_0x493211['innerHTML']='<span>[</span>'+_0x2f1385['innerHTML']+'<span>]</span>',_0x12686f['body']['appendChild'](_0x493211);const _0xa198e0=_0x12686f['createRange']();_0xa198e0['setStartAfter'](_0x493211['firstElementChild']),_0xa198e0['setEndBefore'](_0x493211['lastElementChild']);const _0x1bd4d7=_0x1ff787['getSelection']();_0x1bd4d7['removeAllRanges'](),_0x1bd4d7['addRange'](_0xa198e0),_0x12686f['execCommand']('copy'),_0x493211['remove']();}}}class At extends _0x14fb67{constructor(_0x39d413,_0x5a6a88=''){super(_0x39d413),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x5a6a88,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xa05b79){this['element']['innerHTML']=_0xa05b79;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5dbaec=new _0x14fb67(),_0x50b04d=this['locale'],_0x388a96=new _0x47374c();return _0x388a96['isVisible']=!0x0,_0x5dbaec['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x388a96,{'text':i(_0x50b04d,'AI\x20is\x20writing...')}]}),_0x5dbaec['render'](),_0x5dbaec;}}class st extends _0x14fb67{constructor(_0x5db243,_0x18adab=''){super(_0x5db243);const _0x1b6581=new rt(),_0x14ee60=this['bindTemplate'];this['set']('text',_0x18adab),_0x1b6581['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x1b6581,{'text':_0x14ee60['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x51860e,_0x27d825){super(_0x51860e,_0x27d825),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',(_0x2d47a8,_0x1b7c22)=>{_0x2d47a8['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1b7c22());});}['_createSubmitButton'](){const _0x555771=new _0x4d1286(this['locale']),_0x11889f=this['locale'];return _0x555771['set']({'icon':ht,'label':i(_0x11889f,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x555771['on']('execute',()=>{this['submit']();}),_0x555771['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x56bc74,_0x3ee8c7)=>!_0x56bc74&&_0x3ee8c7),_0x555771;}['_createShowHistoryButton'](){const _0x325161=new _0x4d1286(this['locale']),_0x4c4973=this['resultsView'],_0x13779b=this['locale'];_0x325161['set']({'label':i(_0x13779b,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x325161['bind']('isOn')['to'](_0x4c4973,'isVisible'),_0x325161['bind']('isEnabled')['to'](this,'isEnabled'),_0x325161['on']('execute',()=>{_0x4c4973['isVisible']=!_0x4c4973['isVisible'],_0x4c4973['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x239b13=()=>{_0x23e469['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x5a54b8=new it(this['queryView']['fieldView']['element']),_0x16fb0e=_0x5a54b8['width'],_0x14dc47='rtl'===_0x13779b['uiLanguageDirection']?'left':'right';_0x5a54b8['excludeScrollbarsAndBorders'](),_0x325161['element']['style'][_0x14dc47]=_0x16fb0e-_0x5a54b8['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x239b13),this['on']('render',_0x239b13),_0x325161;}['submit'](){const _0x422929=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x422929);}['focus'](_0x293086){-0x1===_0x293086?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x432871){super(_0x432871),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x432871,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x5bfbd2=0x0;for(const _0xea119c of this['items'])_0x5bfbd2+=_0xea119c['items']['length'];return{'resultsCount':_0x5bfbd2,'totalItemsCount':_0x5bfbd2};}['_createClearHistoryButton'](){const _0x1aaff0=this['locale'],_0x40887a=new _0x4d1286(this['locale']);return _0x40887a['set']({'label':'('+i(_0x1aaff0,'Clear')+')','withText':!0x0}),_0x40887a['on']('execute',()=>this['fire']('clearHistory')),_0x40887a;}}class bt extends xt{constructor(_0x15d497){super();const _0x3dbd0b=new kt(),_0x137229=new _0x4d1286(this['locale'],_0x3dbd0b);this['children']['add'](_0x137229),_0x137229['set']({'label':_0x15d497['prompt'],'withText':!0x0}),_0x137229['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x15d497['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x4996bc{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x39bba5,_0x1798a5)=>{const _0x11e783=os(_0x1798a5['prompt']);for(const _0x148fc2 of this)if(_0x148fc2!=_0x1798a5&&os(_0x148fc2['prompt'])===_0x11e783){this['remove'](_0x148fc2);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x30d06e=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x30d06e));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x3bef4b=>_0x3bef4b)));}}function os(_0xe4c62a){return _0xe4c62a['toLowerCase']()['trim']();}class _ extends _0x14fb67{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x51a4d3,_0x38f2a0,_0x365975=''){super(_0x51a4d3),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 wt(),this['errorView']=new st(_0x51a4d3),this['contentArea']=new Y(_0x51a4d3,_0x365975),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 mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'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 _0x320b6a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x38f2a0],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x320b6a['if']('isError','ck-hidden',_0x3e237a=>!_0x3e237a)]},'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'](_0x50547b=0x1){-0x1===_0x50547b?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 _0x54739a=this['locale'],_0x27c7d3=new ct(_0x54739a,{'queryView':{'label':i(_0x54739a,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x54739a,'Empty\x20history'),'secondary':i(_0x54739a,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x27c7d3['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3cfa3f,_0x305f03)=>_0x3cfa3f&&!_0x305f03),this['listenTo'](_0x27c7d3,'submit',(_0x318765,_0x3343ed)=>{this['prompt']=_0x3343ed;const _0xa86bc=yt(_0x3343ed);this['fire']('submitPrompt',_0xa86bc),_0x3343ed['trim']()&&this['_promptHistory']['add']({'prompt':_0xa86bc},0x0);},{'priority':'high'}),_0x27c7d3;}['_createHistoryView'](){const _0x56bd11=new ft(this['locale']);return _0x56bd11['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x56bd11['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x56bd11;}['_createToolbar'](){const _0x521762=new lt(this['locale']);return _0x521762['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x26c7bd,_0x72ec51,_0x2e75c1)=>_0x26c7bd&&!_0x72ec51&&!!_0x2e75c1),_0x521762['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x521762['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3c1049,_0xf90114,_0x37110d)=>_0x3c1049&&!_0xf90114&&!!_0x37110d),_0x521762['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x521762['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x70838,_0x570a91)=>_0x70838&&!_0x570a91),_0x521762['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x521762['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x521762['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x521762;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1dfae7=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x1dfae7,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3359b){const _0x3a105d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3359b||i(_0x3a105d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x21cda4{['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[_0x338528,a,E,_0x4604ae];}constructor(_0x461b7c){super(_0x461b7c),_0x461b7c['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x461b7c['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x461b7c['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x461b7c['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x47ee05}=this;this['_aiAdapter']=_0x47ee05['plugins']['get'](E),this['_dialog']=_0x47ee05['plugins']['get'](_0x4604ae),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x390fe9=new j(_0x47ee05,Array['from'](this['_commandDefinitions']['values']()));_0x47ee05['commands']['add']('showAIAssistant',_0x390fe9),_0x47ee05['ui']['componentFactory']['add']('aiCommands',_0x3e131b=>{const _0x1af05d=_0x464473(_0x3e131b);return _0x1af05d['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1af05d['buttonView']['set']({'label':i(_0x3e131b,'AI\x20Commands'),'icon':_0xafb348,'tooltip':!0x0}),_0x1af05d['on']('execute',_0x3d032c=>this['_onExecute'](_0x3d032c['source']['id'])),_0x16bd78(_0x1af05d,_0x47ee05['ui']['view']['body'],function(_0x25e686){const _0x3167ee=o(_0x25e686['config']['get']('ai.aiAssistant.commands'),_0x25e686['locale']),_0x3d5b7b=U(_0x25e686,_0x3167ee)['filter'](_0xa73d84=>_0xa73d84['commands']['length']);if(0x1===_0x3d5b7b['length'])return U(_0x25e686,_0x3d5b7b[0x0]['commands'])['map'](_0x58a44f=>({'id':_0x58a44f['id'],'label':_0x58a44f['label']}));return _0x3d5b7b['map'](_0x5225ef=>{const {groupId:_0x2d587c,groupLabel:_0x41b287,commands:_0x11c1a0}=_0x5225ef,_0x3982b0=U(_0x25e686,_0x11c1a0)['map'](_0xe15690=>({'id':_0xe15690['id'],'label':_0xe15690['label']}));return{'id':_0x2d587c,'menu':_0x41b287||_0x2d587c,'children':_0x3982b0};});}(_0x47ee05),{'ariaLabel':i(_0x3e131b,'AI\x20Commands')}),_0x1af05d['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x390fe9['on']('change:enabledCommandsIds',_0x5cd718),_0x1af05d['menuView']['once']('render',_0x5cd718),_0x1af05d;function _0x5cd718(){_0x1af05d['isEnabled']=_0x390fe9['enabledCommandsIds']['length']>0x0;for(const _0x5bca17 of _0x1af05d['menuView']['buttons'])_0x5bca17['isEnabled']=_0x390fe9['enabledCommandsIds']['includes'](_0x5bca17['id']);}}),_0x47ee05['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3bd7cf=>{const _0x371831=new _0x37e0bb(_0x3bd7cf);_0x371831['buttonView']['set']({'label':i(_0x3bd7cf,'AI\x20Commands'),'icon':_0xafb348}),_0x371831['bind']('isEnabled')['to'](_0x390fe9,'enabledCommandsIds',_0x457763=>_0x457763['length']>0x0);const _0x89fe1a=o(_0x47ee05['config']['get']('ai.aiAssistant.commands'),_0x3bd7cf);return this['_populateMenuBarMenu'](_0x390fe9,_0x371831,_0x89fe1a,_0x1a6d4e=>this['_onExecute'](_0x1a6d4e)),_0x371831;}),_0x47ee05['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x388930=this['_createAIAssistantUIButton'](_0x4d1286);return _0x388930['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x388930;}),_0x47ee05['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x229c50=this['_createAIAssistantUIButton'](_0x296cb0);return _0x229c50['set']({'role':'menuitemcheckbox'}),_0x229c50;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3e2a98=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0xb1bc8a;for(const _0x37e9cf in _0x3e2a98){const _0x5e4e8c=_0x37e9cf,_0x55627c=_0x3e2a98[_0x5e4e8c];if('aiLicenseKeyValid'==_0x55627c||'aiLicenseKeyInvalid'==_0x55627c||'aiLicenseKeyExpired'==_0x55627c||'aiLicenseKeyDomainLimit'==_0x55627c||'aiLicenseKeyNotAllowed'==_0x55627c||'aiLicenseKeyEvaluationLimit'==_0x55627c||'aiLicenseKeyTrialLimit'==_0x55627c||'aiLicenseKeyUsageLimit'==_0x55627c){delete _0x3e2a98[_0x5e4e8c],_0xb1bc8a=_0x55627c,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0xb1bc8a&&_0x3e2a98['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0xb1bc8a&&_0x3e2a98['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0xb1bc8a&&_0x3e2a98['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0xb1bc8a&&_0x3e2a98['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0xb1bc8a&&_0x3e2a98['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0xb1bc8a&&_0x3e2a98['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0xb1bc8a&&_0x3e2a98['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x52ef35='',_0x8abe1a='',_0x463ee6='custom'){const _0x25f46a=this['editor'],_0xe737c8=_0x25f46a['editing']['view'],_0x356bf9=_0x25f46a['plugins']['get'](a),_0x245ebe=_0x25f46a['plugins']['get'](_0x338528);_0x356bf9['showFakeVisualSelection']();const _0xf00215=new w(),_0x3c6d04=new ClipboardEvent('copy',{'clipboardData':_0xf00215}),_0x4e9e55=new _0x3b504d(_0xf00215),_0x2afa74=new _0x413423(_0xe737c8,_0x3c6d04,{'dataTransfer':_0x4e9e55});_0x245ebe['_forceMarkersCopy']('comment',()=>{_0xe737c8['document']['fire']('copy',_0x2afa74);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x25f46a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5a0e6f=_0x4e9e55['getData']('text/html');const _0x1d93a2=_0x25f46a['model']['document']['selection'],_0x309053=Array['from'](_0x1d93a2['getRanges']());0x1===_0x309053['length']&&_0x309053[0x0]['isFlat']&&!_0x1d93a2['getSelectedElement']()&&''!==_0x5a0e6f['replace'](/ /g,'')['trim']()&&(_0x5a0e6f='<p>'+_0x5a0e6f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x463ee6,'query':_0x52ef35,'htmlContent':_0x5a0e6f,'label':_0x8abe1a,'mainActionLabel':M[_0x25f46a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x30a012,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x474448['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x356bf9['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x260524=new Map(),_0xd4f7ab=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0xa85df7 of _0xd4f7ab)for(const _0x428fde of _0xa85df7['commands'])_0x260524['set'](_0x428fde['id'],{..._0x428fde,'groupId':_0xa85df7['groupId'],'groupLabel':_0xa85df7['groupLabel']||_0xa85df7['groupId']});return _0x260524;}['_createAIAssistantUIButton'](_0x391582){const _0x563f51=this['editor'],_0x1264c4=_0x563f51['commands']['get']('showAIAssistant'),_0xf0ba6b=new _0x391582(_0x563f51['locale']);return _0xf0ba6b['set']({'label':i(_0x563f51['locale'],'AI\x20Assistant'),'icon':_0x30a012,'isToggleable':!0x0}),_0xf0ba6b['bind']('isEnabled')['to'](_0x1264c4),_0xf0ba6b['bind']('isOn')['to'](this['_dialog'],'id',_0x20f0b1=>'aiAssistant'===_0x20f0b1),this['listenTo'](_0xf0ba6b,'execute',()=>{_0xf0ba6b['isOn']?this['hideUI']():_0x1264c4['execute']();}),_0xf0ba6b;}['_initView'](){const _0x18994e=this['editor']['plugins']['get'](a);this['_formView']=new _(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',()=>{_0x18994e['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x18994e['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x516994,ui:{ariaLiveAnnouncer:_0xc648da}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x15a350,_0x542dce,_0x37b8e3)=>{const _0x10d390=this['_aiAssistantController']['currentContext'];_0x37b8e3?_0xc648da['announce'](i(_0x516994,'AI\x20is\x20writing')):_0x10d390&&_0xc648da['announce'](i(_0x516994,'Generated\x20content:\x20%0',_0x10d390),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x547070,_0x8e220a,_0x3839b8)=>{if(_0x3839b8){const _0x413f7e=this['_formView']['errorView']['text'];_0xc648da['announce'](i(_0x516994,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x413f7e));}});}['_onExecute'](_0x1b54f4){const _0x3fb62e=this['_commandDefinitions']['get'](_0x1b54f4),_0x3c636e=this['editor'],_0x14d23f=_0x3c636e['model']['document']['selection'],_0x4bbbab=_0x3c636e['commands']['get']('showAIAssistant'),_0x1a5cc3=_0x3c636e['plugins']['get'](a),_0x1d1423=''+(_0x3fb62e['groupId']!==x?_0x3fb62e['groupLabel']+':\x20':'')+_0x3fb62e['label'];if(!0x1!==_0x3fb62e['requiresContent']&&_0x14d23f['isCollapsed']){const _0x39a940=_0x2abc6a(_0x14d23f['getSelectedBlocks']())||_0x3c636e['model']['schema']['getLimitElement'](_0x14d23f);_0x3c636e['model']['change'](_0x27912d=>{_0x27912d['setSelection'](_0x39a940,'in');});}_0x1a5cc3['showFakeVisualSelection'](),_0x4bbbab['execute'](_0x3fb62e['prompt'],_0x1d1423,'command:'+_0x1b54f4);}['_populateMenuBarMenu'](_0x35b2b3,_0x4f4481,_0xbd40c0,_0x24a01d){const _0xdf32f9=this['editor'],_0x22fec3=_0xdf32f9['locale'],_0xd6750b=new _0x11ae37(_0x22fec3),_0x3e6571=U(_0xdf32f9,_0xbd40c0)['filter'](_0x4e62af=>_0x4e62af['commands']['length']);0x1===_0x3e6571['length']?this['_getMenuBarGroupButtons']({'command':_0x35b2b3,'commands':_0x3e6571[0x0]['commands'],'parentMenuView':_0x4f4481,'onExecute':_0x24a01d})['forEach'](_0x1260e2=>_0xd6750b['items']['add'](_0x1260e2)):_0x3e6571['forEach'](({groupId:_0x16cf8d,groupLabel:_0x540338,commands:_0x5cab29})=>{const _0x494216=new _0x130694(_0x22fec3,_0x4f4481),_0x16df98=new _0x37e0bb(_0x22fec3),_0x28f881=new _0x11ae37(_0x22fec3),_0x3b53f5=this['_getMenuBarGroupButtons']({'command':_0x35b2b3,'commands':_0x5cab29,'parentMenuView':_0x16df98,'onExecute':_0x24a01d});_0x16df98['buttonView']['set']({'label':_0x540338||_0x16cf8d}),_0x16df98['delegate']('execute')['to'](_0x4f4481),_0x28f881['items']['addMany'](_0x3b53f5),_0x16df98['panelView']['children']['add'](_0x28f881),_0x494216['children']['add'](_0x16df98),_0xd6750b['items']['add'](_0x494216);}),_0x4f4481['panelView']['children']['add'](_0xd6750b);}['_getMenuBarGroupButtons']({command:_0x2993b2,commands:_0x15dddb,parentMenuView:_0x271f93,onExecute:_0x23c86f}){const _0x1e9c9c=this['editor'],_0x2ccf91=_0x1e9c9c['locale'];return U(_0x1e9c9c,_0x15dddb)['map'](_0x4caab3=>{const _0x43d91f=new _0x130694(_0x2ccf91,_0x271f93),_0x1c3593=new _0x296cb0(_0x2ccf91);return _0x1c3593['set']({'label':_0x4caab3['label']}),_0x1c3593['delegate']('execute')['to'](_0x271f93),_0x1c3593['on']('execute',()=>_0x23c86f(_0x4caab3['id'])),_0x1c3593['bind']('isEnabled')['to'](_0x2993b2,'enabledCommandsIds',_0x536b31=>_0x536b31['includes'](_0x4caab3['id'])),_0x43d91f['children']['add'](_0x1c3593),_0x43d91f;});}}function B(_0x50ca44,_0xb117cb){return void 0x0!==_0x50ca44['order']&&void 0x0===_0xb117cb['order']?0x1:void 0x0===_0x50ca44['order']&&void 0x0!==_0xb117cb['order']?-0x1:void 0x0!==_0x50ca44['order']&&void 0x0!==_0xb117cb['order']?_0x50ca44['order']-_0xb117cb['order']:0x0;}function U(_0x618b91,_0x17aaa1){_0x17aaa1['sort'](B);const _0x36c809={},_0x1775f2=[];for(const _0x5b711f of _0x17aaa1)if(void 0x0!==_0x5b711f['order']){if(_0x5b711f['order']in _0x36c809)throw new _0x4f8769('ai-commands-config-order-collision',_0x618b91,{'conflictingDefinitions':[_0x5b711f,_0x36c809[_0x5b711f['order']]]});_0x36c809[_0x5b711f['order']]=_0x5b711f,_0x1775f2['splice'](_0x5b711f['order'],0x0,_0x5b711f);}else _0x1775f2['push'](_0x5b711f);return _0x1775f2;}class r extends _0x21cda4{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2a187c){super(_0x2a187c);const _0x3646e0=_0x2a187c['config'],_0x595f06=_0x2a187c['locale'];_0x3646e0['define']('ai.aiAssistant.preserveComments',!0x0),_0x3646e0['define']('ai.aiAssistant.commands',function(_0x1bb95c){return[{'groupId':'editOrReview','groupLabel':i(_0x1bb95c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1bb95c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1bb95c,'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(_0x1bb95c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1bb95c,'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(_0x1bb95c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1bb95c,'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(_0x1bb95c,'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(_0x1bb95c,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1bb95c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1bb95c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1bb95c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1bb95c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1bb95c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1bb95c,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1bb95c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1bb95c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1bb95c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1bb95c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1bb95c,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1bb95c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1bb95c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1bb95c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1bb95c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1bb95c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1bb95c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1bb95c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1bb95c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x595f06)),_0x3646e0['define']('ai.aiAssistant.extraCommandGroups',[]),_0x3646e0['define']('ai.aiAssistant.removeCommands',[]);let _0x1735c2=o(_0x3646e0['get']('ai.aiAssistant.commands'),_0x595f06);const _0x30f4a=_0x3646e0['get']('ai.aiAssistant.extraCommandGroups'),_0x31eacb=_0x3646e0['get']('ai.aiAssistant.removeCommands');_0x30f4a['forEach'](_0x4d6fcf=>{const _0x763f87=_0x1735c2['find'](_0x292acb=>_0x292acb['groupId']===_0x4d6fcf['groupId']);_0x763f87?_0x763f87['commands']=_0x763f87['commands']['concat'](_0x4d6fcf['commands']):_0x1735c2['push'](_0x4d6fcf);}),_0x1735c2=_0x1735c2['filter'](_0x4f8443=>!_0x31eacb['includes'](_0x4f8443['groupId'])),_0x1735c2['forEach'](_0xb86928=>{_0xb86928['commands']=_0xb86928['commands']['filter'](_0x59d8f8=>!_0x31eacb['includes'](_0x59d8f8['id']));}),_0x3646e0['set']('ai.aiAssistant.commands',_0x1735c2);}}class P extends _0x21cda4{['abortController'];static get['requires'](){return[E];}constructor(_0x4278b5){super(_0x4278b5),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x529dcb){return this['sendRequest'](_0x529dcb)['catch'](_0x2ca4ae=>{if(_0x2ca4ae instanceof R)return Promise['reject'](_0x2ca4ae);if('AbortError'==_0x2ca4ae['name'])return Promise['resolve']();throw console['error'](_0x2ca4ae),new _0x4f8769('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1efe2d,_0x27dcc8){const _0x108aa4=this['editor']['locale'],_0x2ba881={'Content-Type':'application/json'};if('object'==typeof _0x1efe2d)Object['assign'](_0x2ba881,_0x1efe2d);else{if(_0x1efe2d)try{const _0x54ab0d=await _0x1efe2d(_0x27dcc8);Object['assign'](_0x2ba881,_0x54ab0d);}catch{return Promise['reject'](new R(i(_0x108aa4,'AI_ERROR_GET_HEADERS')));}}return _0x2ba881;}async['_prepareRequestParameters'](_0x31d52e,_0x3727fc){const _0x447c14=this['editor']['locale'];if('object'==typeof _0x31d52e)return _0x31d52e;try{return await _0x31d52e(_0x3727fc);}catch{return Promise['reject'](new R(i(_0x447c14,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x35b206){super(_0x35b206),_0x35b206['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x35b206['config']['get']('ai.openAI.requestParameters')||_0x35b206['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x35b206['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x35b206['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x35b206['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x545c71,context:_0x3f4b51,onData:_0x32cc49,actionId:_0xeb4008}){const _0x9e6d5=this['editor']['locale'],_0x189a9c=await this['prepareMessages'](_0x545c71,_0x3f4b51,_0xeb4008),_0x2639da=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xeb4008),_0x4ba2e3=await this['_prepareRequestParameters'](this['_requestParameters'],_0xeb4008),_0x15706f={'messages':_0x189a9c,..._0x4ba2e3},_0x1bc1c0={'method':'POST','headers':_0x2639da,'body':JSON['stringify'](_0x15706f),'signal':this['abortController']['signal']},_0x53b412=await fetch(this['_apiUrl'],_0x1bc1c0);if(_0x53b412['ok'])return _0x4ba2e3['stream']?await this['_readStreamableResponse'](_0x53b412,_0x32cc49):await this['_readStaticResponse'](_0x53b412,_0x32cc49),Promise['resolve']();{const _0x27892a=await _0x53b412['text']();return _0x27892a['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x9e6d5,'AI_ERROR_CONTEXT_LENGTH'))):_0x27892a['includes']('Moderation')?Promise['reject'](new R(i(_0x9e6d5,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x27892a));}}async['prepareMessages'](_0x19099d,_0x5c87e5,_0x2d0b78){let _0x2f3c24,_0x5d3529;return _0x5c87e5?(_0x2f3c24='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.',_0x5d3529='Instruction:\x0a'+_0x19099d+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5c87e5):(_0x2f3c24='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.',_0x5d3529=_0x19099d),[{'role':'system','content':_0x2f3c24},{'role':'user','content':_0x5d3529}];}async['_readStreamableResponse'](_0x452cea,_0x310624){const _0x453383=_0x452cea['body']['getReader'](),_0x2a480f=new TextDecoder();let _0x5a5c50='',_0x497f44='',_0x53deba='',_0x20b46c=!0x1;for(;!_0x20b46c;){const {done:_0x4d441b,value:_0x3e14aa}=await _0x453383['read'](),_0x2a718a=_0x5a5c50+_0x2a480f['decode'](_0x3e14aa);let _0x33e38c='';_0x20b46c=_0x4d441b;try{_0x33e38c=this['_cleanUpData'](_0x2a718a),_0x5a5c50='';}catch{_0x5a5c50=_0x2a718a;continue;}_0x497f44+=_0x33e38c,!_0x20b46c&&this['_isBufferIncomplete'](_0x497f44)||_0x497f44&&(_0x53deba+=_0x497f44,_0x497f44='',_0x310624(_0x53deba));}return Promise['resolve']();}async['_readStaticResponse'](_0x32f5b2,_0x5b741c){return _0x5b741c((await _0x32f5b2['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1f2147){const _0x1f8e59=_0x1f2147['split']('<')['length']!==_0x1f2147['split']('>')['length'],_0x228a0b=_0x1f2147['length']<0x1e;return _0x1f8e59&&_0x228a0b;}['_cleanUpData'](_0x1f5cc6){return _0x1f5cc6['split'](/\n(?![^{]*\})/g)['map'](_0x1ad7e6=>_0x1ad7e6['replace']('data:\x20',''))['filter'](_0x314b1e=>_0x314b1e&&_0x314b1e['length']>0x0&&'[DONE]'!==_0x314b1e)['map'](_0x26084e=>{const {choices:_0x3bf1a9}=JSON['parse'](_0x26084e);if(_0x3bf1a9[0x0]?.['delta']?.['content'])return _0x3bf1a9[0x0]['delta']['content'];})['filter'](_0x485464=>_0x485464)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2528c0){super(_0x2528c0),_0x2528c0['config']['get']('ai.aws.requestParameters')||_0x2528c0['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']=_0x2528c0['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2528c0['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2528c0['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2528c0['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x38d373,context:_0xea98a4,onData:_0x147d9b,actionId:_0x19e3b9}){const {model:_0x4dbc61,stream:_0x50c47a,..._0x5984b3}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x19e3b9),_0x55470c={'prompt':await this['preparePrompt'](_0x38d373,_0xea98a4,_0x4dbc61,_0x19e3b9),..._0x5984b3};this['_apiUrl']?await this['_processProxyRequest'](_0x55470c,_0x4dbc61,_0x50c47a,_0x147d9b,_0x19e3b9):await this['_processAWSRequest'](_0x55470c,_0x4dbc61,_0x50c47a,_0x147d9b);}async['preparePrompt'](_0x506dd4,_0x5ad698,_0x4e2a83,_0x12cdb2){let _0x202118,_0x1b660b;return _0x5ad698?(_0x202118='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.',_0x1b660b='Instruction:\x0a'+_0x506dd4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5ad698):(_0x202118='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.',_0x1b660b=_0x506dd4),'meta.llama'==this['getModelFamily'](_0x4e2a83)?'<<SYS>>\x0a'+_0x202118+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x1b660b+'\x0a[/INST]':'Human:\x0a'+_0x202118+'\x0a'+_0x1b660b+'\x0a\x0aAssistant:';}['getModelFamily'](_0x56cb60){if(/^anthropic\.claude/['test'](_0x56cb60))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x56cb60))return'ai21.j2';if(/^cohere\.command/['test'](_0x56cb60))return'cohere.command';if(/^meta\.llama/['test'](_0x56cb60))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x56cb60));}async['_processProxyRequest'](_0x33d6cd,_0x1ef7af,_0x4610c6,_0x299dd2,_0x3885be){const _0x351e67={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3885be),'body':JSON['stringify']({..._0x33d6cd,'model':_0x1ef7af,'stream':_0x4610c6}),'signal':this['abortController']['signal']},_0xfc51ce=await fetch(this['_apiUrl'],_0x351e67);_0x4610c6?await this['_readStreamableResponse'](_0xfc51ce,_0x1ef7af,_0x299dd2):await this['_readStaticResponse'](_0xfc51ce,_0x1ef7af,_0x299dd2);}async['_processAWSRequest'](_0x52aeb6,_0x414c4b,_0x3ace29,_0x47e3e5){const _0x5ba46c=new _0x5ba1a0(this['_bedrockClientConfig']),_0x2d1bbd={'body':JSON['stringify'](_0x52aeb6),'contentType':'application/json','accept':'application/json','modelId':_0x414c4b};let _0x2510ed;if(_0x3ace29){const _0x19a972=new _0x4d12b3(_0x2d1bbd);_0x2510ed=await _0x5ba46c['send'](_0x19a972,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x2510ed,_0x414c4b,_0x47e3e5);}else{const _0x52f342=new _0x3f1736(_0x2d1bbd);_0x2510ed=await _0x5ba46c['send'](_0x52f342,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x2510ed,_0x414c4b,_0x47e3e5);}}async['_readAsyncIterableResponse'](_0x3c4324,_0x409185,_0x45124f){const _0x28f8cf=_0x3c4324['body'],_0x16e1b1=new TextDecoder('utf-8');let _0x5a2a4b='';for await(const _0x3001d9 of _0x28f8cf)if(_0x3001d9['chunk']){const _0x220a97=_0x16e1b1['decode'](_0x3001d9['chunk']['bytes']),_0x2a0a86=JSON['parse'](_0x220a97);_0x5a2a4b+=this['_getGeneratedText'](_0x2a0a86,_0x409185),_0x45124f(_0x5a2a4b);}return Promise['resolve']();}async['_readStreamableResponse'](_0x5ce90f,_0x26c055,_0x5ea313){const _0x3e1e9b=_0x5ce90f['body'],_0x3d2a3e=new TextDecoder('utf-8'),_0x1766f6=_0x3e1e9b['getReader']();let _0x59f132='',_0x20770c='',_0x32d0cd=!0x1;for(;!_0x32d0cd;){const {done:_0x1cfcd8,value:_0x28f387}=await _0x1766f6['read']();if(_0x32d0cd=_0x1cfcd8,_0x32d0cd)break;const _0x147347=(_0x59f132+_0x3d2a3e['decode'](_0x28f387))['split']('\x0a')['map'](_0x5ce655=>{try{return _0x59f132='',JSON['parse'](_0x5ce655);}catch{return _0x59f132=_0x5ce655,null;}})['filter'](_0x19a406=>null!==_0x19a406);_0x147347['length']&&(_0x20770c+=_0x147347['map'](_0x24a4ea=>this['_getGeneratedText'](_0x24a4ea,_0x26c055))['join'](''),_0x5ea313(_0x20770c));}return Promise['resolve']();}async['_readStaticResponse'](_0x191795,_0x3da6ed,_0x2063c4){let _0x499f58;return _0x499f58=_0x191795 instanceof Response?await _0x191795['json']():JSON['parse'](Buffer['from'](_0x191795['body'])['toString']('utf8')),(_0x2063c4(this['_getGeneratedText'](_0x499f58,_0x3da6ed)),Promise['resolve']());}['_getGeneratedText'](_0x580a38,_0x5a4208){switch(this['getModelFamily'](_0x5a4208)){case'anthropic.claude':return _0x580a38['completion'];case'ai21.j2':return _0x580a38['completions'][0x0]['data']['text'];case'cohere.command':return _0x580a38['generations'][0x0]['text'];case'meta.llama':return _0x580a38['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x10bc3a,Command as _0x15f716}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2a92e5,IconCheck as _0x1fe880,IconError as _0x4492c5,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x3fba16,IconRobotPencil as _0x13700b}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4fc4a8,CKEditorError as _0x392644,ObservableMixin as _0xd58f3b,global as _0x330e0d,isVisible as _0xeb7e24,Rect as _0xccd7cf,Collection as _0x316043,FocusTracker as et,KeystrokeHandler as rt,first as _0x44987d}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x4e6ac4,View as _0x23ffe4,SpinnerView as _0x50bc2a,IconView as _0x276037,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x243330,createDropdown as _0x3cb5fc,addMenuToDropdown as _0xd9c24b,MenuBarMenuView as _0x4e7f31,MenuBarMenuListItemButtonView as _0x26a9a5,DialogViewPosition as _0x546376,MenuBarMenuListView as _0x169506,MenuBarMenuListItemView as _0x581f49}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x165414,ClipboardMarkersUtils as _0x480aee}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x546334,ViewDataTransfer as _0x1610c3,ViewUpcastWriter as _0x598e62,Matcher as _0x5b879c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2f9aa6,InvokeModelWithResponseStreamCommand as _0x8108be,InvokeModelCommand as _0x5e0609}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x35ac57,_0x4ebe1f){const _0x13551b=(0x0,_0x4ebe1f['t'])('Other');return _0x35ac57['length']?'groupId'in _0x35ac57[0x0]?_0x35ac57:[{'groupId':K,'groupLabel':_0x13551b,'order':0x1/0x0,'commands':_0x35ac57}]:[{'groupId':K,'groupLabel':_0x13551b,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x10bc3a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x527101}=this,_0x2f9ddc=['ck-fake-ai-selection'];_0x527101['config']['get']('ai.useTheme')&&_0x2f9ddc['push']('ck-ai-assistant-ui_theme'),_0x527101['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x2f9ddc,'priority':0xc}}),_0x527101['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x437be3,{writer:_0x46df13})=>{if(!_0x437be3['markerRange']['isCollapsed'])return null;const _0x56ee1f=_0x46df13['createUIElement']('span');return _0x46df13['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x56ee1f),_0x56ee1f;}});}['afterInit'](){!async function(_0x28d872){const _0x579e8e=_0x13ec21([0x53,0x65,0x57,0x5a,0x6f,0x78,0x49,0x4c,0x50,0x35,0x74,0x42,0x68,0x32,0x31,0x58,0x6d,0x79,0x4d,0x6c,0x30,0x4e,0x52,0x64,0x33,0x54,0x51,0x48,0x45,0x73,0x6b,0x72,0x4a,0x76,0x43,0x77,0x47,0x71,0x55,0x61,0x63,0x56,0x44,0x4f,0x4b,0x46,0x37,0x59,0x62,0x67,0x70,0x34,0x38,0x75,0x66,0x36,0x6a,0x7a,0x41,0x6e,0x39,0x69]),_0x50588c=0x23b6d058,_0x344cc3=0x23b1bc08^_0x50588c,_0x56e8e4=window[_0x13ec21([0x44,0x61,0x74,0x65])][_0x13ec21([0x6e,0x6f,0x77])](),_0x146a9e=_0x28d872[_0x13ec21([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xe6d7c6=new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3eeb78=>{_0x146a9e[_0x13ec21([0x6f,0x6e,0x63,0x65])](_0x13ec21([0x72,0x65,0x61,0x64,0x79]),_0x3eeb78);}),_0x35f492={[_0x13ec21([0x6b,0x74,0x79])]:_0x13ec21([0x45,0x43]),[_0x13ec21([0x75,0x73,0x65])]:_0x13ec21([0x73,0x69,0x67]),[_0x13ec21([0x63,0x72,0x76])]:_0x13ec21([0x50,0x2d,0x32,0x35,0x36]),[_0x13ec21([0x78])]:_0x13ec21([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]),[_0x13ec21([0x79])]:_0x13ec21([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]),[_0x13ec21([0x61,0x6c,0x67])]:_0x13ec21([0x45,0x53,0x32,0x35,0x36])},_0xed7b59=_0x146a9e[_0x13ec21([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x13ec21([0x67,0x65,0x74])](_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x54d1f0(){let _0x49c81d,_0x4df27a=null,_0x151a01=null;try{if(_0xed7b59==_0x13ec21([0x47,0x50,0x4c]))return _0x13ec21([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x49c81d=_0x2534d1(),!_0x49c81d)return _0x13ec21([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x49c81d[_0x13ec21([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x151a01=_0x237bae(_0x49c81d[_0x13ec21([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x49c81d[_0x13ec21([0x6a,0x74,0x69])])),await _0x378bbb()?_0x367278()?_0x34571c()?_0x13ec21([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2d5dc7()?(_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x13ec21([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4df27a=_0x5e92dd(_0x13ec21([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x13ec21([0x74,0x72,0x69,0x61,0x6c])&&(_0x4df27a=_0x5e92dd(_0x13ec21([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4c3539()):_0x13ec21([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x13ec21([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x13ec21([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x13ec21([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x34571c(){const _0x537fc5=[_0x13ec21([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x13ec21([0x74,0x72,0x69,0x61,0x6c])][_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x56e8e4/0x3e8:0xe10*_0x344cc3;return _0x49c81d[_0x13ec21([0x65,0x78,0x70])]<_0x537fc5;}function _0x367278(){const _0x58b6f3=_0x49c81d[_0x13ec21([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x58b6f3&&(!!_0x58b6f3[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x13ec21([0x2a]))||!!_0x58b6f3[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x13ec21([0x41,0x49])));}function _0x2d5dc7(){const _0x5a27b3=_0x49c81d[_0x13ec21([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5a27b3||0x0==_0x5a27b3[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x400b92}=new URL(window[_0x13ec21([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5a27b3[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x400b92))return!0x0;const _0x545b89=_0x400b92[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e]));return _0x5a27b3[_0x13ec21([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x23758b=>_0x23758b[_0x13ec21([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x13ec21([0x2a])))[_0x13ec21([0x6d,0x61,0x70])](_0x491fe2=>_0x491fe2[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e])))[_0x13ec21([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1273b8=>_0x1273b8[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x545b89[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x13ec21([0x6d,0x61,0x70])](_0x341297=>Array(_0x545b89[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x341297[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x13ec21([0x66,0x69,0x6c,0x6c])](_0x341297[0x0]===_0x13ec21([0x2a])?_0x13ec21([0x2a]):'')[_0x13ec21([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x341297))[_0x13ec21([0x73,0x6f,0x6d,0x65])](_0x59d461=>_0x545b89[_0x13ec21([0x65,0x76,0x65,0x72,0x79])]((_0xc77027,_0x49023e)=>_0x59d461[_0x49023e]===_0xc77027||_0x59d461[_0x49023e]===_0x13ec21([0x2a])));}function _0x4c3539(){return _0x4df27a&&_0x151a01?new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2ddcd2,_0x537924)=>{_0x4df27a[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x2ddcd2,_0x537924),_0x151a01[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x4e6be7=>{_0x4e6be7!=_0x13ec21([0x56,0x61,0x6c,0x69,0x64])&&_0x2ddcd2(_0x4e6be7);},_0x537924);}):_0x4df27a||_0x151a01||_0x13ec21([0x56,0x61,0x6c,0x69,0x64]);}}function _0x237bae(_0x3ae74b,_0x2e4857){return new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x169859=>{if(_0xbeb935())return _0x169859(_0x13ec21([0x56,0x61,0x6c,0x69,0x64]));_0x58b53a(),_0x146a9e[_0x13ec21([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x13ec21([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x21d1d4=!0x1;const _0x3079ef=_0x4fc4a8();function _0x30bfca(_0x2cef7b){return!!_0x2cef7b&&(typeof _0x2cef7b===_0x13ec21([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2cef7b===_0x13ec21([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2cef7b[_0x13ec21([0x74,0x68,0x65,0x6e])]===_0x13ec21([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2cef7b[_0x13ec21([0x63,0x61,0x74,0x63,0x68])]===_0x13ec21([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5b4591(_0x3eed83){_0x39de67(_0x3eed83)[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x5fb0a5=>{if(!_0x5fb0a5||_0x5fb0a5[_0x13ec21([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x13ec21([0x6f,0x6b]))return _0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x37cf16(_0x544d61(_0x3079ef+_0x2e4857))!=_0x5fb0a5[_0x13ec21([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x13ec21([0x56,0x61,0x6c,0x69,0x64]);})[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x208bec=>(_0x10973c(),_0x208bec),()=>{const _0x2a80cd=_0x3b440c();return null==_0x2a80cd?(_0x10973c(),_0x13ec21([0x56,0x61,0x6c,0x69,0x64])):_0x13ec21(_0x56e8e4-_0x2a80cd>(0x7ba5458^_0x50588c)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x169859)[_0x13ec21([0x63,0x61,0x74,0x63,0x68])](()=>{_0x169859(_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2ede29=0x23803ed8^_0x50588c;function _0x10973c(){const _0x33a293=_0x13ec21([0x6c,0x6c,0x63,0x74,0x2d])+_0x37cf16(_0x544d61(_0x3ae74b)),_0x8b5c7e=_0x3f6a23(_0x37cf16(window[_0x13ec21([0x4d,0x61,0x74,0x68])][_0x13ec21([0x63,0x65,0x69,0x6c])](_0x56e8e4/_0x2ede29)));window[_0x13ec21([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x13ec21([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x33a293,_0x8b5c7e);}function _0x3b440c(){const _0x6417af=_0x13ec21([0x6c,0x6c,0x63,0x74,0x2d])+_0x37cf16(_0x544d61(_0x3ae74b)),_0x59f6c6=window[_0x13ec21([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x13ec21([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x6417af);return _0x59f6c6?window[_0x13ec21([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f6a23(_0x59f6c6),0x10)*_0x2ede29:null;}function _0x39de67(_0x501d97){return new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x174237,_0x37b621)=>{_0x501d97[_0x13ec21([0x74,0x68,0x65,0x6e])](_0x174237,_0x37b621),window[_0x13ec21([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x37b621,0x23b70498^_0x50588c);});}}_0x146a9e[_0x13ec21([0x6f,0x6e])](_0x13ec21([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x25ada5,_0x24a0bc)=>{if(_0x24a0bc[0x0]!=_0x3ae74b)return _0x169859(_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x24a0bc[0x1]={..._0x24a0bc[0x1],[_0x13ec21([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3079ef};},{[_0x13ec21([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x13ec21([0x68,0x69,0x67,0x68])}),_0x146a9e[_0x13ec21([0x6f,0x6e])](_0x13ec21([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x276ca1=>{_0x30bfca(_0x276ca1[_0x13ec21([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x21d1d4=!0x0,_0x5b4591(_0x276ca1[_0x13ec21([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x13ec21([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x13ec21([0x6c,0x6f,0x77])}),_0xe6d7c6[_0x13ec21([0x74,0x68,0x65,0x6e])](()=>{_0x21d1d4||_0x169859(_0x13ec21([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xbeb935(){return _0x146a9e[_0x13ec21([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x13ec21([0x76,0x69,0x65,0x77])][_0x13ec21([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x13ec21([0x61,0x75,0x74,0x6f]);}function _0x58b53a(){_0x146a9e[_0x13ec21([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x13ec21([0x76,0x69,0x65,0x77])][_0x13ec21([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x13ec21([0x61,0x75,0x74,0x6f]);}}function _0x5e92dd(_0x25e2d2){const _0x5ce047=[new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1f0d54=>setTimeout(_0x1f0d54,0x23bfee94^_0x50588c)),_0xe6d7c6[_0x13ec21([0x74,0x68,0x65,0x6e])](()=>new window[(_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x2407d7=>{let _0x1ef850=0x0;_0x146a9e[_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c])][_0x13ec21([0x6f,0x6e])](_0x13ec21([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3dc0ac,_0x4ddbcb)=>{_0x4ddbcb[0x0][_0x13ec21([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1ef850++,_0x1ef850==(0x23b6d1a0^_0x50588c)&&(_0x2407d7(),_0x3dc0ac[_0x13ec21([0x6f,0x66,0x66])]());});}))];return window[_0x13ec21([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x13ec21([0x72,0x61,0x63,0x65])](_0x5ce047)[_0x13ec21([0x74,0x68,0x65,0x6e])](()=>_0x25e2d2);}async function _0x23c061(){await _0xe6d7c6,_0x146a9e[_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c])][_0x13ec21([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x13dee9,_0x146a9e[_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c])][_0x13ec21([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x13dee9,_0x146a9e[_0x13ec21([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x13ec21([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x287a06(_0x546fa9){const _0x103f17=_0x1769aa();_0x146a9e[_0x103f17]=_0x13ec21([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x546fa9,_0x546fa9!=_0x13ec21([0x56,0x61,0x6c,0x69,0x64])&&_0x23c061();}function _0x1769aa(){const _0x2cb572=window[_0x13ec21([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x13ec21([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x13ec21([0x6e,0x6f,0x77])]())[_0x13ec21([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x13ec21([0x2e]),'');let _0x272ce7=_0x13ec21([0x53]);for(let _0x2eddfe=0x0;_0x2eddfe<_0x2cb572[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2eddfe+=0x2){let _0x32c114=window[_0x13ec21([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2cb572[_0x13ec21([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2eddfe,_0x2eddfe+0x2));_0x32c114>=_0x579e8e[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x32c114-=_0x579e8e[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x272ce7+=_0x579e8e[_0x32c114];}return _0x272ce7;}function _0x2534d1(){const _0xb34930=_0xed7b59[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e]));if(0x3!=_0xb34930[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4a4163(_0xb34930[0x1]);function _0x4a4163(_0x447245){const _0x4a6e43=_0x8a5e9b(_0x447245);return _0x4a6e43&&_0x84559d()?_0x4a6e43:null;function _0x84559d(){const _0x5a9bb3=_0x4a6e43[_0x13ec21([0x6a,0x74,0x69])],_0x1cf382=window[_0x13ec21([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5a9bb3[_0x13ec21([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5a9bb3[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2dc805={..._0x4a6e43,[_0x13ec21([0x6a,0x74,0x69])]:_0x5a9bb3[_0x13ec21([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x5a9bb3[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2dc805[_0x13ec21([0x76,0x63])],_0x544d61(_0x2dc805)==_0x1cf382;}}}async function _0x378bbb(){let _0x210070=!0x0;try{const _0x14f88b=_0xed7b59[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])](_0x13ec21([0x2e])),[_0x4d5c23,_0x6ee6f6,_0x27cd70]=_0x14f88b;return _0x445cc9(_0x4d5c23),await _0x488bac(_0x4d5c23,_0x6ee6f6,_0x27cd70),_0x210070;}catch{return!0x1;}function _0x445cc9(_0x4928b4){const _0x20bd66=_0x8a5e9b(_0x4928b4);_0x20bd66&&_0x20bd66[_0x13ec21([0x61,0x6c,0x67])]==_0x13ec21([0x45,0x53,0x32,0x35,0x36])||(_0x210070=!0x1);}async function _0x488bac(_0x203c0e,_0x207f3b,_0x2f653a){const _0x5673fb=window[_0x13ec21([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x13ec21([0x66,0x72,0x6f,0x6d])](_0x280c6f(_0x2f653a),_0x30f8e3=>_0x30f8e3[_0x13ec21([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x3c6c94=new window[(_0x13ec21([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x13ec21([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x203c0e+_0x13ec21([0x2e])+_0x207f3b),_0x1e38f9=window[_0x13ec21([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x13ec21([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1e38f9)return;const _0x3a4072=await _0x1e38f9[_0x13ec21([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x13ec21([0x6a,0x77,0x6b]),_0x35f492,{[_0x13ec21([0x6e,0x61,0x6d,0x65])]:_0x13ec21([0x45,0x43,0x44,0x53,0x41]),[_0x13ec21([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x13ec21([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x13ec21([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1e38f9[_0x13ec21([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x13ec21([0x6e,0x61,0x6d,0x65])]:_0x13ec21([0x45,0x43,0x44,0x53,0x41]),[_0x13ec21([0x68,0x61,0x73,0x68])]:{[_0x13ec21([0x6e,0x61,0x6d,0x65])]:_0x13ec21([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x3a4072,_0x5673fb,_0x3c6c94)||(_0x210070=!0x1);}}function _0x8a5e9b(_0x30fa4f){return _0x30fa4f[_0x13ec21([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x13ec21([0x65,0x79]))?JSON[_0x13ec21([0x70,0x61,0x72,0x73,0x65])](_0x280c6f(_0x30fa4f)):null;}function _0x280c6f(_0x4c6ca1){return window[_0x13ec21([0x61,0x74,0x6f,0x62])](_0x4c6ca1[_0x13ec21([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x13ec21([0x2b]))[_0x13ec21([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x13ec21([0x2f])));}function _0x544d61(_0x334146){let _0x18d6ec=0x1505;function _0xcd1811(_0x5e59cc){for(let _0x27e5c2=0x0;_0x27e5c2<_0x5e59cc[_0x13ec21([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x27e5c2++){const _0x94807e=_0x5e59cc[_0x13ec21([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x27e5c2);_0x18d6ec=(_0x18d6ec<<0x5)+_0x18d6ec+_0x94807e,_0x18d6ec&=_0x18d6ec;}}function _0x451f2d(_0x106abd){Array[_0x13ec21([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x106abd)?_0x106abd[_0x13ec21([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x451f2d):_0x106abd&&typeof _0x106abd==_0x13ec21([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x13ec21([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x106abd)[_0x13ec21([0x73,0x6f,0x72,0x74])]()[_0x13ec21([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x229b21,_0x5ebf1f])=>{_0xcd1811(_0x229b21),_0x451f2d(_0x5ebf1f);}):_0xcd1811(window[_0x13ec21([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x106abd));}return _0x451f2d(_0x334146),_0x18d6ec>>>0x0;}function _0x37cf16(_0x53731e){return _0x53731e[_0x13ec21([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x13ec21([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x13ec21([0x30]));}function _0x3f6a23(_0x2a3ae0){return _0x2a3ae0[_0x13ec21([0x73,0x70,0x6c,0x69,0x74])]('')[_0x13ec21([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x13ec21([0x6a,0x6f,0x69,0x6e])]('');}function _0x13dee9(){}function _0x13ec21(_0x26e9ef){return _0x26e9ef['map'](_0x1468a7=>String['fromCharCode'](_0x1468a7))['join']('');}_0x287a06(await _0x54d1f0());}(this);}['showFakeVisualSelection'](){const _0x9e2ea9=this['editor']['model'];_0x9e2ea9['change'](_0x496b33=>{const _0x7d0a02=_0x9e2ea9['document']['selection']['getRanges']();let _0x2d8455=0x0;for(const _0x196452 of _0x7d0a02){const _0xa9ecea=w+':'+_0x2d8455;if(_0x9e2ea9['markers']['has'](_0xa9ecea))_0x496b33['updateMarker'](_0xa9ecea,{'range':_0x196452});else{if(_0x196452['start']['isAtEnd']){const _0x2d1fee=_0x196452['start']['getLastMatchingPosition'](({item:_0x12b1d0})=>!_0x9e2ea9['schema']['isContent'](_0x12b1d0),{'boundaries':_0x196452});_0x496b33['addMarker'](_0xa9ecea,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x496b33['createRange'](_0x2d1fee,_0x196452['end'])});}else _0x496b33['addMarker'](_0xa9ecea,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x196452});}_0x2d8455++;}});}['hideFakeVisualSelection'](){const _0x556e37=this['editor']['model'],_0x402e7e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x402e7e['length']&&_0x556e37['change'](_0x3bad8b=>{_0x402e7e['forEach'](_0x16596f=>{_0x3bad8b['removeMarker'](_0x16596f);});});}['insertContent'](_0x4f5dcc,_0x3e7d0e){const _0xf75c87=this['_getAISelection'](),_0x3cb5cc=_0x3e7d0e||_0xf75c87['getFirstRange']();this['editor']['model']['canEditAt'](_0x3cb5cc)&&this['editor']['model']['change'](_0x1b0ed0=>{this['hideFakeVisualSelection'](),_0x3e7d0e||this['_resetContentOfSelectedTableCells'](_0x1b0ed0,_0xf75c87),this['_pasteHTMLUsingClipboard']({'insertAt':_0x3cb5cc,'writer':_0x1b0ed0,'html':_0x4f5dcc});});}['insertContentBelow'](_0x515ce2){const {model:_0x454001}=this['editor'],_0x2f75c7=this['_getAISelection']();_0x454001['change'](()=>{const _0x3cd3e9=this['_prepareTableInsertBelowPosition'](_0x515ce2,_0x2f75c7)||this['_getDefaultInsertBelowPosition'](_0x2f75c7);this['insertContent'](_0x515ce2,_0x3cd3e9);});}['_getAISelection'](){const _0x13b7a7=this['editor']['model'],_0x388bde=Array['from'](_0x13b7a7['markers']['getMarkersGroup'](w))['map'](_0x320011=>_0x320011['getRange']());return _0x13b7a7['createSelection'](_0x388bde);}['_pasteHTMLUsingClipboard']({writer:_0xeef652,html:_0x55a9f2,insertAt:_0x45dd33}){const {view:_0x432bb9}=this['editor']['editing'],_0x35d9ec=this['editor']['plugins']['get'](_0x165414),_0x228121=new gt();_0x228121['setData']('text/html',_0x55a9f2);const _0xf9908=new ClipboardEvent('paste',{'clipboardData':_0x228121}),_0x1cdb66=new _0x546334(_0x432bb9,_0xf9908,{'dataTransfer':new _0x1610c3(_0x228121)});_0xeef652['setSelection'](_0x45dd33);const _0x1a44fa=(_0x2ca4dc,_0x1bcb65)=>{_0x1bcb65['resultRange']&&_0xeef652['setSelection'](_0x1bcb65['resultRange']);};_0x35d9ec['once']('contentInsertion',_0x1a44fa,{'priority':'lowest'}),_0x432bb9['document']['fire']('paste',_0x1cdb66),_0x35d9ec['off']('contentInsertion',_0x1a44fa);}['_getDefaultInsertBelowPosition'](_0x283a83){const {model:_0x37a261}=this['editor'],_0x182428=Array['from'](_0x283a83['getSelectedBlocks']());return _0x182428['length']?_0x37a261['createPositionAfter'](_0x182428['pop']()):_0x283a83['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x52ab35,_0x5351ad){const {model:_0x381b96,plugins:_0x36760f}=this['editor'];if(_0x36760f['has']('TableUtils')){const _0x4af12d=_0x36760f['get']('TableUtils')['getSelectedTableCells'](_0x5351ad);if(_0x4af12d['length']){const _0x5ce86b=this['_getTableRowCountFromContent'](_0x52ab35),_0x27c11a=this['_createEmptyTableRows'](_0x4af12d,_0x5ce86b);return _0x381b96['createPositionAt'](_0x27c11a,0x0);}}return null;}['_getTableRowCountFromContent'](_0x5d7a32){const _0x48fb45=this['editor']['plugins']['get']('TableUtils'),_0x571d88=this['editor']['data']['parse'](_0x5d7a32),_0xcb4d22=Array['from'](_0x571d88['getChildren']())['filter'](_0x30ff53=>_0x30ff53['is']('element','table'));let _0x482fad=0x0;return _0xcb4d22['forEach'](_0x38b147=>{_0x482fad+=_0x48fb45['getRows'](_0x38b147);}),_0x482fad;}['_createEmptyTableRows'](_0x865792,_0x24427e){const _0x5cdf22=this['editor']['plugins']['get']('TableUtils'),_0x447fad=_0x5cdf22['getRowIndexes'](_0x865792),_0x34b9a4=_0x5cdf22['getColumnIndexes'](_0x865792),_0x38f133=_0x447fad['last']+0x1,_0x1f12b1=_0x34b9a4['first'],_0x869031=_0x865792[0x0]['findAncestor']('table');for(let _0x2b674d=0x0;_0x2b674d<_0x24427e;_0x2b674d++)_0x5cdf22['insertRows'](_0x869031,{'at':_0x38f133});return _0x869031['getChild'](_0x38f133)['getChild'](_0x1f12b1);}['_resetContentOfSelectedTableCells'](_0x2e8717,_0x5b2cc8){const {plugins:_0x1a0211}=this['editor'],{model:_0x1b2871}=_0x2e8717;if(!_0x1a0211['has']('TableUtils'))return;_0x1a0211['get']('TableUtils')['getSelectedTableCells'](_0x5b2cc8)['length']&&_0x1b2871['deleteContent'](_0x5b2cc8);}}class x extends _0x10bc3a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x392644('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x202478){super(_0x202478),this['name']='AIRequestError';}}function i(_0x5cec03,_0x474e16,_0x524e69){const t=_0x5cec03['t'];switch(_0x474e16){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',_0x524e69);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x524e69);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'},_0x524e69);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 _0x474e16;}}class E extends _0x15f716{['_commandDefinitions'];constructor(_0x301950,_0x5dc63e){super(_0x301950),this['_commandDefinitions']=_0x5dc63e,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x4410b6,_0x2c3e47,_0x5491a4)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x5491a4));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xfe2abf,_0x1a3e73,_0x52c09e)=>{this['enabledCommandsIds']=_0x52c09e?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x541636=this['editor']['model'];this['_hasContext']=function(_0x53135d){const _0x2bd9d2=_0x53135d['document']['selection'];return _0x2bd9d2['isCollapsed']?0x0!==[..._0x2bd9d2['getSelectedBlocks']()]['length']&&![..._0x2bd9d2['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x53135d['hasContent'](_0x2bd9d2['getFirstRange']());}(_0x541636);const _0x1068f9=_0x541636['document']['selection'],_0x23664c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x14b62c of _0x1068f9['getRanges']())for(const _0x2d908d of _0x14b62c['getItems']())if(_0x2d908d['is']('element')&&_0x23664c['includes'](_0x2d908d['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3111e0='',_0x4f6914='',_0x118cb2='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3111e0,_0x4f6914,_0x118cb2);}}function F(_0x4be0e8,_0x3f9f46){const _0x44d127=new Set();for(const _0x78f666 of _0x4be0e8['values']())(_0x3f9f46||!0x1===_0x78f666['requiresContent'])&&_0x44d127['add'](_0x78f666['id']);return Array['from'](_0x44d127);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0xd58f3b(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3fb2c5,_0x10798a,_0x2e1dcd){super(),this['editor']=_0x3fb2c5,this['textAdapter']=_0x10798a,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x2e1dcd,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x51653e,_0x4ffca9,_0x17fd1e)=>{this['view']['value']=this['_sanitizeHTML'](_0x17fd1e);}),this['listenTo'](this['view'],'submitPrompt',(_0x546b70,_0x1b4698)=>{const _0x5aba0c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1b4698,_0x5aba0c,'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:_0x569cbe,query:_0x1827b8,htmlContent:_0x4a17f9,label:_0x1de68d,mainActionLabel:_0x493125}){this['view']['prompt']=_0x1de68d,this['view']['mainAction']=_0x493125,this['initialContext']=_0x4a17f9,_0x1827b8&&(this['view']['isRendered']?this['_handleQuery'](_0x1827b8,_0x4a17f9,_0x569cbe,_0x1de68d):this['view']['once']('render',()=>{this['_handleQuery'](_0x1827b8,_0x4a17f9,_0x569cbe,_0x1de68d);}));}['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'](_0x4929c0,_0x42b8ff,_0x182ea5,_0x13bca4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x42b8ff,this['previousQuery']=_0x4929c0,this['previousLabel']=_0x13bca4||_0x4929c0,this['previousActionId']=_0x182ea5,new Promise(_0x3d9030=>{this['textAdapter']['makeRequest']({'query':_0x4929c0,'context':_0x42b8ff,'onData':_0x2e849b=>{this['currentResponse']=_0x2e849b,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x182ea5})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x355650=>{_0x355650 instanceof R?this['view']['handleError'](_0x355650['message']):this['view']['handleError'](),_0x3d9030();})['finally'](()=>{this['stopProcessing'](),_0x3d9030();});});}['_parseAndNormalizeContent'](_0x456d4d,_0x3e6eb1=!0x1){const _0x34232c=Q['exec'](_0x456d4d);_0x456d4d=_0x34232c?_0x456d4d['substring'](_0x34232c[0x1]['length']):_0x456d4d['length']<0x64&&!_0x3e6eb1?'':this['_stripMarkdownSyntax'](_0x456d4d);const _0x2ace00=this['_domParser']['parseFromString'](_0x456d4d,'text/html');if(_0x34232c){const _0x30bd83=Array['from'](_0x2ace00['body']['childNodes']);_0x30bd83['reverse']();for(const _0x3a51aa of _0x30bd83){if(_0x3a51aa['nodeType']==Node['ELEMENT_NODE'])break;_0x3a51aa['remove']();}}const _0x3d5d2e=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2ace00['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3d5d2e);const _0x21decc=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x5719dc=this['editor']['data']['toModel'](_0x3d5d2e);return _0x21decc||_0x5719dc['markers']['clear'](),this['editor']['data']['stringify'](_0x5719dc);}['_normalizeResponseHeadings'](_0x32f0db){const _0x4e8596=new _0x598e62(this['editor']['editing']['view']['document']),_0x943730=new _0x5b879c({'name':/^h[1-5]$/}),_0x41f86c=[];let _0xfa1c7f=!0x1;for(const _0x3c11d9 of _0x32f0db)_0x3c11d9['is']('element')&&_0x943730['match'](_0x3c11d9)&&(_0x41f86c['push'](_0x3c11d9),'h1'==_0x3c11d9['name']&&(_0xfa1c7f=!0x0));if(_0xfa1c7f){for(const _0x1eb612 of _0x41f86c)_0x4e8596['rename']('h'+(parseInt(_0x1eb612['name'][0x1])+0x1),_0x1eb612);}}['_isH1TagSupportEnabled'](){const {data:_0xe22769,editing:_0x54828c}=this['editor'],_0x21bac3=_0xe22769['htmlProcessor']['toView']('<h1></h1>'),_0x579bb6=_0xe22769['toView'](_0xe22769['toModel'](_0x21bac3));return!!_0x54828c['view']['domConverter']['viewToDom'](_0x579bb6)['querySelector']('h1');}['_sanitizeHTML'](_0x153ada){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x153ada),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x31c169){const _0x4e4ef8=_0x31c169['trim']();return _0x4e4ef8['startsWith']('```html')?_0x4e4ef8['endsWith']('```')?_0x4e4ef8['substring'](0x7,_0x4e4ef8['length']-0x3):_0x4e4ef8['substring'](0x7):_0x31c169;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x6635ec){super(_0x6635ec),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x243823=>i(_0x6635ec,'AI_'+_0x243823['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x6635ec,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x6635ec,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x6635ec,'Stop'));const _0x4d588a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4d588a['if']('isVisible','ck-hidden',_0x562e39=>!_0x562e39)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x224a94,_0xeaa9d6){const _0x19b4ab=new _0x4e6ac4(this['locale']);return _0x19b4ab['set']({'label':_0x224a94,'class':_0xeaa9d6||'','isVisible':!0x0,'withText':!0x0}),_0x19b4ab;}}class ct extends _0x23ffe4{['contentFieldView'];['copyButtonView'];constructor(_0x4ab29e,_0x368627=''){super(_0x4ab29e),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x28f503=this['bindTemplate'];this['contentFieldView']=new bt(_0x4ab29e,_0x368627),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x28f503['if']('isVisible','ck-hidden',_0x4b8102=>!_0x4b8102)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x28f503['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 _0x1fec87=!0x1;this['on']('change:value',(_0x20d1dc,_0x5e27e5,_0x3b8c4d)=>{const _0x44dae4=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3b8c4d),this['isProcessing']&&_0x44dae4&&!_0x1fec87&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x46ec86,_0x490ae2,_0xa11bcc)=>{_0x1fec87=!0x1,_0xa11bcc?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1fec87=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1fec87=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5dd025=this['locale'],_0x20fe0d=new _0x4e6ac4(this['locale']),_0x57d7c9='ck-ai-form__copy-button';return _0x20fe0d['set']({'label':i(_0x5dd025,'Copy'),'icon':_0x2a92e5,'class':_0x57d7c9,'tooltip':!0x0}),_0x20fe0d['bind']('isVisible')['to'](this,'value',_0x284c60=>!!_0x284c60),_0x20fe0d['bind']('isEnabled')['to'](this,'isProcessing',_0xac41ea=>!_0xac41ea),_0x20fe0d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x20fe0d['icon']=_0x1fe880,_0x20fe0d['class']=_0x57d7c9+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x20fe0d['icon']=_0x2a92e5,_0x20fe0d['class']=_0x57d7c9;},0x3e8);}),_0x20fe0d;}['_copyHTMLToClipboard'](_0x1d1f6f){const {window:_0xf73760,document:_0x336b86}=_0x330e0d;if(_0xf73760['ClipboardItem']){const {Blob:_0x4dfb82,ClipboardItem:_0x1bae22}=_0xf73760,_0x1cbc9e=[new _0x1bae22({'text/html':new _0x4dfb82([_0x1d1f6f['innerHTML']],{'type':'text/html'}),'text/plain':new _0x4dfb82([_0x1d1f6f['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1cbc9e);}else{const _0x538c59=_0x336b86['createElement']('div');_0x538c59['style']['position']='absolute',_0x538c59['style']['left']='-9999px',_0x538c59['innerHTML']='<span>[</span>'+_0x1d1f6f['innerHTML']+'<span>]</span>',_0x336b86['body']['appendChild'](_0x538c59);const _0x3c5285=_0x336b86['createRange']();_0x3c5285['setStartAfter'](_0x538c59['firstElementChild']),_0x3c5285['setEndBefore'](_0x538c59['lastElementChild']);const _0x39283f=_0xf73760['getSelection']();_0x39283f['removeAllRanges'](),_0x39283f['addRange'](_0x3c5285),_0x336b86['execCommand']('copy'),_0x538c59['remove']();}}}class bt extends _0x23ffe4{constructor(_0x474a45,_0x400ad1=''){super(_0x474a45),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x400ad1,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x10ab77){this['element']['innerHTML']=_0x10ab77;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x3dee50=new _0x23ffe4(),_0x567d07=this['locale'],_0x359bc8=new _0x50bc2a();return _0x359bc8['isVisible']=!0x0,_0x3dee50['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x359bc8,{'text':i(_0x567d07,'AI\x20is\x20writing...')}]}),_0x3dee50['render'](),_0x3dee50;}}class mt extends _0x23ffe4{constructor(_0x200295,_0x4536b6=''){super(_0x200295);const _0x4ddaf5=new _0x276037(),_0x8cb00e=this['bindTemplate'];this['set']('text',_0x4536b6),_0x4ddaf5['content']=_0x4492c5,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4ddaf5,{'text':_0x8cb00e['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2edd75,_0x2ce88e){super(_0x2edd75,_0x2ce88e),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',(_0x21b26d,_0x4b49ce)=>{_0x21b26d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4b49ce());});}['_createSubmitButton'](){const _0x1255a2=new _0x4e6ac4(this['locale']),_0x1892b6=this['locale'];return _0x1255a2['set']({'icon':it,'label':i(_0x1892b6,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1255a2['on']('execute',()=>{this['submit']();}),_0x1255a2['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x274b9f,_0x3e84e6)=>!_0x274b9f&&_0x3e84e6),_0x1255a2;}['_createShowHistoryButton'](){const _0xd0199b=new _0x4e6ac4(this['locale']),_0x10e13d=this['resultsView'],_0x1a00bf=this['locale'];_0xd0199b['set']({'label':i(_0x1a00bf,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0xd0199b['bind']('isOn')['to'](_0x10e13d,'isVisible'),_0xd0199b['bind']('isEnabled')['to'](this,'isEnabled'),_0xd0199b['on']('execute',()=>{_0x10e13d['isVisible']=!_0x10e13d['isVisible'],_0x10e13d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x512b8e=()=>{_0x330e0d['window']['requestAnimationFrame'](()=>{if(_0xeb7e24(this['element'])){const _0x1d6f87=new _0xccd7cf(this['queryView']['fieldView']['element']),_0x3cd11e=_0x1d6f87['width'],_0x3bb1df='rtl'===_0x1a00bf['uiLanguageDirection']?'left':'right';_0x1d6f87['excludeScrollbarsAndBorders'](),_0xd0199b['element']['style'][_0x3bb1df]=_0x3cd11e-_0x1d6f87['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x512b8e),this['on']('render',_0x512b8e),_0xd0199b;}['submit'](){const _0x4028de=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4028de);}['focus'](_0x482f6c){-0x1===_0x482f6c?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x2b2420){super(_0x2b2420),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x2b2420,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x113204=0x0;for(const _0x200c36 of this['items'])_0x113204+=_0x200c36['items']['length'];return{'resultsCount':_0x113204,'totalItemsCount':_0x113204};}['_createClearHistoryButton'](){const _0x455921=this['locale'],_0x1b61b3=new _0x4e6ac4(this['locale']);return _0x1b61b3['set']({'label':'('+i(_0x455921,'Clear')+')','withText':!0x0}),_0x1b61b3['on']('execute',()=>this['fire']('clearHistory')),_0x1b61b3;}}class ut extends xt{constructor(_0x5dff4d){super();const _0x2d89cd=new wt(),_0xa8c1dc=new _0x4e6ac4(this['locale'],_0x2d89cd);this['children']['add'](_0xa8c1dc),_0xa8c1dc['set']({'label':_0x5dff4d['prompt'],'withText':!0x0}),_0xa8c1dc['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x5dff4d['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x316043{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x11c6f4,_0x20d658)=>{const _0x5208f6=os(_0x20d658['prompt']);for(const _0x50028e of this)if(_0x50028e!=_0x20d658&&os(_0x50028e['prompt'])===_0x5208f6){this['remove'](_0x50028e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x42e358=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x42e358));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x32aaee=>_0x32aaee)));}}function os(_0x14576f){return _0x14576f['toLowerCase']()['trim']();}class k extends _0x23ffe4{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x24da3e,_0x4c2206,_0x34a55c=''){super(_0x24da3e),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x24da3e),this['contentArea']=new ct(_0x24da3e,_0x34a55c),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 et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'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 _0x3ba966=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4c2206],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x3ba966['if']('isError','ck-hidden',_0x1ceb13=>!_0x1ceb13)]},'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'](_0x3f2716=0x1){-0x1===_0x3f2716?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 _0x1b2865=this['locale'],_0x5a8b61=new lt(_0x1b2865,{'queryView':{'label':i(_0x1b2865,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1b2865,'Empty\x20history'),'secondary':i(_0x1b2865,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5a8b61['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x21e9c0,_0x57b1ea)=>_0x21e9c0&&!_0x57b1ea),this['listenTo'](_0x5a8b61,'submit',(_0x589ffb,_0x4dac29)=>{this['prompt']=_0x4dac29;const _0x7ece22=ft(_0x4dac29);this['fire']('submitPrompt',_0x7ece22),_0x4dac29['trim']()&&this['_promptHistory']['add']({'prompt':_0x7ece22},0x0);},{'priority':'high'}),_0x5a8b61;}['_createHistoryView'](){const _0x1efbcc=new pt(this['locale']);return _0x1efbcc['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x1efbcc['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x1efbcc;}['_createToolbar'](){const _0x1c5c63=new at(this['locale']);return _0x1c5c63['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2ca9bc,_0x49c955,_0x4cdcdd)=>_0x2ca9bc&&!_0x49c955&&!!_0x4cdcdd),_0x1c5c63['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x1c5c63['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x5d2350,_0x31eb1e,_0xce1b58)=>_0x5d2350&&!_0x31eb1e&&!!_0xce1b58),_0x1c5c63['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x1c5c63['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1af699,_0x110f76)=>_0x1af699&&!_0x110f76),_0x1c5c63['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x1c5c63['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x1c5c63['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x1c5c63;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1272b1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x1272b1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x3c3b14){const _0x122408=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x3c3b14||i(_0x122408,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x10bc3a{['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[_0x480aee,a,x,_0x243330];}constructor(_0x2e03f4){super(_0x2e03f4),_0x2e03f4['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2e03f4['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2e03f4['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2e03f4['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0xeab3e9}=this;this['_aiAdapter']=_0xeab3e9['plugins']['get'](x),this['_dialog']=_0xeab3e9['plugins']['get'](_0x243330),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x59dce5=new E(_0xeab3e9,Array['from'](this['_commandDefinitions']['values']()));_0xeab3e9['commands']['add']('showAIAssistant',_0x59dce5),_0xeab3e9['ui']['componentFactory']['add']('aiCommands',_0x2e9ec5=>{const _0x5a99b4=_0x3cb5fc(_0x2e9ec5);return _0x5a99b4['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x5a99b4['buttonView']['set']({'label':i(_0x2e9ec5,'AI\x20Commands'),'icon':_0x3fba16,'tooltip':!0x0}),_0x5a99b4['on']('execute',_0x136500=>this['_onExecute'](_0x136500['source']['id'])),_0xd9c24b(_0x5a99b4,_0xeab3e9['ui']['view']['body'],function(_0x263ed2){const _0x28c7bd=o(_0x263ed2['config']['get']('ai.aiAssistant.commands'),_0x263ed2['locale']),_0x6cc63=U(_0x263ed2,_0x28c7bd)['filter'](_0x3bc2dd=>_0x3bc2dd['commands']['length']);if(0x1===_0x6cc63['length'])return U(_0x263ed2,_0x6cc63[0x0]['commands'])['map'](_0x1681bc=>({'id':_0x1681bc['id'],'label':_0x1681bc['label']}));return _0x6cc63['map'](_0x2fa8ae=>{const {groupId:_0x242f2a,groupLabel:_0x54f0fd,commands:_0x2d4eac}=_0x2fa8ae,_0x48c849=U(_0x263ed2,_0x2d4eac)['map'](_0x67b491=>({'id':_0x67b491['id'],'label':_0x67b491['label']}));return{'id':_0x242f2a,'menu':_0x54f0fd||_0x242f2a,'children':_0x48c849};});}(_0xeab3e9),{'ariaLabel':i(_0x2e9ec5,'AI\x20Commands')}),_0x5a99b4['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x59dce5['on']('change:enabledCommandsIds',_0x7c09cf),_0x5a99b4['menuView']['once']('render',_0x7c09cf),_0x5a99b4;function _0x7c09cf(){_0x5a99b4['isEnabled']=_0x59dce5['enabledCommandsIds']['length']>0x0;for(const _0x348c2a of _0x5a99b4['menuView']['buttons'])_0x348c2a['isEnabled']=_0x59dce5['enabledCommandsIds']['includes'](_0x348c2a['id']);}}),_0xeab3e9['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2126d2=>{const _0x127e1e=new _0x4e7f31(_0x2126d2);_0x127e1e['buttonView']['set']({'label':i(_0x2126d2,'AI\x20Commands'),'icon':_0x3fba16}),_0x127e1e['bind']('isEnabled')['to'](_0x59dce5,'enabledCommandsIds',_0x21078e=>_0x21078e['length']>0x0);const _0x224a5f=o(_0xeab3e9['config']['get']('ai.aiAssistant.commands'),_0x2126d2);return this['_populateMenuBarMenu'](_0x59dce5,_0x127e1e,_0x224a5f,_0x45af32=>this['_onExecute'](_0x45af32)),_0x127e1e;}),_0xeab3e9['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5eda10=this['_createAIAssistantUIButton'](_0x4e6ac4);return _0x5eda10['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5eda10;}),_0xeab3e9['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x1b215a=this['_createAIAssistantUIButton'](_0x26a9a5);return _0x1b215a['set']({'role':'menuitemcheckbox'}),_0x1b215a;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x2100de=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x53cff2;for(const _0x13d5cd in _0x2100de){const _0x5e2668=_0x13d5cd,_0x102c80=_0x2100de[_0x5e2668];if('aiLicenseKeyValid'==_0x102c80||'aiLicenseKeyInvalid'==_0x102c80||'aiLicenseKeyExpired'==_0x102c80||'aiLicenseKeyDomainLimit'==_0x102c80||'aiLicenseKeyNotAllowed'==_0x102c80||'aiLicenseKeyEvaluationLimit'==_0x102c80||'aiLicenseKeyTrialLimit'==_0x102c80||'aiLicenseKeyUsageLimit'==_0x102c80){delete _0x2100de[_0x5e2668],_0x53cff2=_0x102c80,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x53cff2&&_0x2100de['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x53cff2&&_0x2100de['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x53cff2&&_0x2100de['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x53cff2&&_0x2100de['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x5582a0='',_0x593a2f='',_0x4e786d='custom'){const _0x584dfe=this['editor'],_0x3c2288=_0x584dfe['editing']['view'],_0x44a425=_0x584dfe['plugins']['get'](a),_0xe3b9be=_0x584dfe['plugins']['get'](_0x480aee);_0x44a425['showFakeVisualSelection']();const _0x1f5f2f=new l(),_0x1fa8a4=new ClipboardEvent('copy',{'clipboardData':_0x1f5f2f}),_0x3a4655=new _0x1610c3(_0x1f5f2f),_0x5ba150=new _0x546334(_0x3c2288,_0x1fa8a4,{'dataTransfer':_0x3a4655});_0xe3b9be['_forceMarkersCopy']('comment',()=>{_0x3c2288['document']['fire']('copy',_0x5ba150);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x584dfe,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x561cb3=_0x3a4655['getData']('text/html');const _0xef5fc7=_0x584dfe['model']['document']['selection'],_0x4e8517=Array['from'](_0xef5fc7['getRanges']());0x1===_0x4e8517['length']&&_0x4e8517[0x0]['isFlat']&&!_0xef5fc7['getSelectedElement']()&&''!==_0x561cb3['replace'](/ /g,'')['trim']()&&(_0x561cb3='<p>'+_0x561cb3+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4e786d,'query':_0x5582a0,'htmlContent':_0x561cb3,'label':_0x593a2f,'mainActionLabel':_[_0x584dfe['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x13700b,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x546376['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x44a425['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x29a370=new Map(),_0x31a29b=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3fac53 of _0x31a29b)for(const _0x21dca5 of _0x3fac53['commands'])_0x29a370['set'](_0x21dca5['id'],{..._0x21dca5,'groupId':_0x3fac53['groupId'],'groupLabel':_0x3fac53['groupLabel']||_0x3fac53['groupId']});return _0x29a370;}['_createAIAssistantUIButton'](_0xe5a59){const _0x546cae=this['editor'],_0x849fe6=_0x546cae['commands']['get']('showAIAssistant'),_0x5e965a=new _0xe5a59(_0x546cae['locale']);return _0x5e965a['set']({'label':i(_0x546cae['locale'],'AI\x20Assistant'),'icon':_0x13700b,'isToggleable':!0x0}),_0x5e965a['bind']('isEnabled')['to'](_0x849fe6),_0x5e965a['bind']('isOn')['to'](this['_dialog'],'id',_0x15c9ea=>'aiAssistant'===_0x15c9ea),this['listenTo'](_0x5e965a,'execute',()=>{_0x5e965a['isOn']?this['hideUI']():_0x849fe6['execute']();}),_0x5e965a;}['_initView'](){const _0x308065=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',()=>{_0x308065['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x308065['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x31831f,ui:{ariaLiveAnnouncer:_0x584142}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x16acab,_0x77ba2b,_0x550e65)=>{const _0x5969da=this['_aiAssistantController']['currentContext'];_0x550e65?_0x584142['announce'](i(_0x31831f,'AI\x20is\x20writing')):_0x5969da&&_0x584142['announce'](i(_0x31831f,'Generated\x20content:\x20%0',_0x5969da),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x22ac81,_0x4c20f8,_0x5c726d)=>{if(_0x5c726d){const _0x381917=this['_formView']['errorView']['text'];_0x584142['announce'](i(_0x31831f,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x381917));}});}['_onExecute'](_0x4e2a88){const _0x304461=this['_commandDefinitions']['get'](_0x4e2a88),_0x39dd81=this['editor'],_0x474a02=_0x39dd81['model']['document']['selection'],_0x4d17ac=_0x39dd81['commands']['get']('showAIAssistant'),_0x15d75f=_0x39dd81['plugins']['get'](a),_0x5c3b15=''+(_0x304461['groupId']!==K?_0x304461['groupLabel']+':\x20':'')+_0x304461['label'];if(!0x1!==_0x304461['requiresContent']&&_0x474a02['isCollapsed']){const _0x40b022=_0x44987d(_0x474a02['getSelectedBlocks']())||_0x39dd81['model']['schema']['getLimitElement'](_0x474a02);_0x39dd81['model']['change'](_0x1a6796=>{_0x1a6796['setSelection'](_0x40b022,'in');});}_0x15d75f['showFakeVisualSelection'](),_0x4d17ac['execute'](_0x304461['prompt'],_0x5c3b15,'command:'+_0x4e2a88);}['_populateMenuBarMenu'](_0x2a6e1d,_0x1dcd97,_0x10c559,_0x28018a){const _0xf37d9e=this['editor'],_0x5d931b=_0xf37d9e['locale'],_0x2c15d4=new _0x169506(_0x5d931b),_0x367f72=U(_0xf37d9e,_0x10c559)['filter'](_0x104518=>_0x104518['commands']['length']);0x1===_0x367f72['length']?this['_getMenuBarGroupButtons']({'command':_0x2a6e1d,'commands':_0x367f72[0x0]['commands'],'parentMenuView':_0x1dcd97,'onExecute':_0x28018a})['forEach'](_0x3cd007=>_0x2c15d4['items']['add'](_0x3cd007)):_0x367f72['forEach'](({groupId:_0x2c403e,groupLabel:_0x31e92a,commands:_0x5e6795})=>{const _0x56cb6e=new _0x581f49(_0x5d931b,_0x1dcd97),_0x4160aa=new _0x4e7f31(_0x5d931b),_0x5c71a2=new _0x169506(_0x5d931b),_0x4d7fc4=this['_getMenuBarGroupButtons']({'command':_0x2a6e1d,'commands':_0x5e6795,'parentMenuView':_0x4160aa,'onExecute':_0x28018a});_0x4160aa['buttonView']['set']({'label':_0x31e92a||_0x2c403e}),_0x4160aa['delegate']('execute')['to'](_0x1dcd97),_0x5c71a2['items']['addMany'](_0x4d7fc4),_0x4160aa['panelView']['children']['add'](_0x5c71a2),_0x56cb6e['children']['add'](_0x4160aa),_0x2c15d4['items']['add'](_0x56cb6e);}),_0x1dcd97['panelView']['children']['add'](_0x2c15d4);}['_getMenuBarGroupButtons']({command:_0x12adee,commands:_0x53cdac,parentMenuView:_0x39fa55,onExecute:_0x386196}){const _0x55259c=this['editor'],_0x1e8474=_0x55259c['locale'];return U(_0x55259c,_0x53cdac)['map'](_0x346e86=>{const _0x559c4d=new _0x581f49(_0x1e8474,_0x39fa55),_0x5378a9=new _0x26a9a5(_0x1e8474);return _0x5378a9['set']({'label':_0x346e86['label']}),_0x5378a9['delegate']('execute')['to'](_0x39fa55),_0x5378a9['on']('execute',()=>_0x386196(_0x346e86['id'])),_0x5378a9['bind']('isEnabled')['to'](_0x12adee,'enabledCommandsIds',_0x2921f4=>_0x2921f4['includes'](_0x346e86['id'])),_0x559c4d['children']['add'](_0x5378a9),_0x559c4d;});}}function T(_0x3e1177,_0x28d56a){return void 0x0!==_0x3e1177['order']&&void 0x0===_0x28d56a['order']?0x1:void 0x0===_0x3e1177['order']&&void 0x0!==_0x28d56a['order']?-0x1:void 0x0!==_0x3e1177['order']&&void 0x0!==_0x28d56a['order']?_0x3e1177['order']-_0x28d56a['order']:0x0;}function U(_0x17fe26,_0x1e5070){_0x1e5070['sort'](T);const _0x4976f9={},_0x47c076=[];for(const _0x5b4921 of _0x1e5070)if(void 0x0!==_0x5b4921['order']){if(_0x5b4921['order']in _0x4976f9)throw new _0x392644('ai-commands-config-order-collision',_0x17fe26,{'conflictingDefinitions':[_0x5b4921,_0x4976f9[_0x5b4921['order']]]});_0x4976f9[_0x5b4921['order']]=_0x5b4921,_0x47c076['splice'](_0x5b4921['order'],0x0,_0x5b4921);}else _0x47c076['push'](_0x5b4921);return _0x47c076;}class At extends _0x10bc3a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x58e0e4){super(_0x58e0e4);const _0x5d7afe=_0x58e0e4['config'],_0x315ba7=_0x58e0e4['locale'];_0x5d7afe['define']('ai.aiAssistant.preserveComments',!0x0),_0x5d7afe['define']('ai.aiAssistant.commands',_t(_0x315ba7)),_0x5d7afe['define']('ai.aiAssistant.extraCommandGroups',[]),_0x5d7afe['define']('ai.aiAssistant.removeCommands',[]);let _0x427f63=o(_0x5d7afe['get']('ai.aiAssistant.commands'),_0x315ba7);const _0x5ce764=_0x5d7afe['get']('ai.aiAssistant.extraCommandGroups'),_0x597d8b=_0x5d7afe['get']('ai.aiAssistant.removeCommands');_0x5ce764['forEach'](_0x2bc6ac=>{const _0x388b85=_0x427f63['find'](_0x249ce3=>_0x249ce3['groupId']===_0x2bc6ac['groupId']);_0x388b85?_0x388b85['commands']=_0x388b85['commands']['concat'](_0x2bc6ac['commands']):_0x427f63['push'](_0x2bc6ac);}),_0x427f63=_0x427f63['filter'](_0x16f4c5=>!_0x597d8b['includes'](_0x16f4c5['groupId'])),_0x427f63['forEach'](_0x3befbc=>{_0x3befbc['commands']=_0x3befbc['commands']['filter'](_0x1bfb8a=>!_0x597d8b['includes'](_0x1bfb8a['id']));}),_0x5d7afe['set']('ai.aiAssistant.commands',_0x427f63);}}function _t(_0x5d358f){return[{'groupId':'editOrReview','groupLabel':i(_0x5d358f,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x5d358f,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x5d358f,'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(_0x5d358f,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x5d358f,'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(_0x5d358f,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x5d358f,'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(_0x5d358f,'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(_0x5d358f,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x5d358f,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x5d358f,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x5d358f,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x5d358f,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x5d358f,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x5d358f,'Change\x20style'),'commands':[{'id':'business','label':i(_0x5d358f,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x5d358f,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x5d358f,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x5d358f,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x5d358f,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x5d358f,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x5d358f,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x5d358f,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x5d358f,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x5d358f,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x5d358f,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x5d358f,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x5d358f,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x10bc3a{['abortController'];static get['requires'](){return[x];}constructor(_0x329430){super(_0x329430),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1462ac){return this['sendRequest'](_0x1462ac)['catch'](_0x34c368=>{if(_0x34c368 instanceof R)return Promise['reject'](_0x34c368);if('AbortError'==_0x34c368['name'])return Promise['resolve']();throw console['error'](_0x34c368),new _0x392644('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x47e7fb,_0x473737){const _0xd2ee29=this['editor']['locale'],_0x34fb63={'Content-Type':'application/json'};if('object'==typeof _0x47e7fb)Object['assign'](_0x34fb63,_0x47e7fb);else{if(_0x47e7fb)try{const _0x4946fc=await _0x47e7fb(_0x473737);Object['assign'](_0x34fb63,_0x4946fc);}catch{return Promise['reject'](new R(i(_0xd2ee29,'AI_ERROR_GET_HEADERS')));}}return _0x34fb63;}async['_prepareRequestParameters'](_0x10d6c6,_0x334079){const _0x2f359d=this['editor']['locale'];if('object'==typeof _0x10d6c6)return _0x10d6c6;try{return await _0x10d6c6(_0x334079);}catch{return Promise['reject'](new R(i(_0x2f359d,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x52f4f){super(_0x52f4f),_0x52f4f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x52f4f['config']['get']('ai.openAI.requestParameters')||_0x52f4f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x52f4f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x52f4f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x52f4f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x37b55e,context:_0x529816,onData:_0x374caf,actionId:_0x36ecf0}){const _0x5027d0=this['editor']['locale'],_0x5e1484=await this['prepareMessages'](_0x37b55e,_0x529816,_0x36ecf0),_0x546a31=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x36ecf0),_0x5e02da=await this['_prepareRequestParameters'](this['_requestParameters'],_0x36ecf0),_0x32936a={'messages':_0x5e1484,..._0x5e02da},_0x1f4d7f={'method':'POST','headers':_0x546a31,'body':JSON['stringify'](_0x32936a),'signal':this['abortController']['signal']},_0x4f9c6b=await fetch(this['_apiUrl'],_0x1f4d7f);if(_0x4f9c6b['ok'])return _0x5e02da['stream']?await this['_readStreamableResponse'](_0x4f9c6b,_0x374caf):await this['_readStaticResponse'](_0x4f9c6b,_0x374caf),Promise['resolve']();{const _0x1779db=await _0x4f9c6b['text']();return _0x1779db['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x5027d0,'AI_ERROR_CONTEXT_LENGTH'))):_0x1779db['includes']('Moderation')?Promise['reject'](new R(i(_0x5027d0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1779db));}}async['prepareMessages'](_0x3bcf85,_0x7cd7bd,_0xc0ff0){let _0x468fde,_0x9eb7ed;return _0x7cd7bd?(_0x468fde='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.',_0x9eb7ed='Instruction:\x0a'+_0x3bcf85+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7cd7bd):(_0x468fde='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.',_0x9eb7ed=_0x3bcf85),[{'role':'system','content':_0x468fde},{'role':'user','content':_0x9eb7ed}];}async['_readStreamableResponse'](_0x4f0426,_0x3ddd96){const _0x831e70=_0x4f0426['body']['getReader'](),_0x2aee0b=new TextDecoder();let _0x4b299b='',_0x570464='',_0xa13d0a='',_0x4244f6=!0x1;for(;!_0x4244f6;){const {done:_0x41d02b,value:_0x1ae6f8}=await _0x831e70['read'](),_0x2f9ae9=_0x4b299b+_0x2aee0b['decode'](_0x1ae6f8);let _0x1502f7='';_0x4244f6=_0x41d02b;try{_0x1502f7=this['_cleanUpData'](_0x2f9ae9),_0x4b299b='';}catch{_0x4b299b=_0x2f9ae9;continue;}_0x570464+=_0x1502f7,!_0x4244f6&&this['_isBufferIncomplete'](_0x570464)||_0x570464&&(_0xa13d0a+=_0x570464,_0x570464='',_0x3ddd96(_0xa13d0a));}return Promise['resolve']();}async['_readStaticResponse'](_0x161e55,_0x2ac1d4){return _0x2ac1d4((await _0x161e55['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x318b1b){const _0x5aaf79=_0x318b1b['split']('<')['length']!==_0x318b1b['split']('>')['length'],_0xffe5be=_0x318b1b['length']<0x1e;return _0x5aaf79&&_0xffe5be;}['_cleanUpData'](_0x1a1d26){return _0x1a1d26['split'](/\n(?![^{]*\})/g)['map'](_0x227219=>_0x227219['replace']('data:\x20',''))['filter'](_0x420604=>_0x420604&&_0x420604['length']>0x0&&'[DONE]'!==_0x420604)['map'](_0x485211=>{const {choices:_0x40926a}=JSON['parse'](_0x485211);if(_0x40926a[0x0]?.['delta']?.['content'])return _0x40926a[0x0]['delta']['content'];})['filter'](_0x4953e5=>_0x4953e5)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x955bf6){super(_0x955bf6),_0x955bf6['config']['get']('ai.aws.requestParameters')||_0x955bf6['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']=_0x955bf6['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x955bf6['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x955bf6['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x955bf6['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x25becb,context:_0x5bdcef,onData:_0x4b7728,actionId:_0x4441e6}){const {model:_0x50e663,stream:_0x5d2deb,..._0x332db4}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4441e6),_0x482205={'prompt':await this['preparePrompt'](_0x25becb,_0x5bdcef,_0x50e663,_0x4441e6),..._0x332db4};this['_apiUrl']?await this['_processProxyRequest'](_0x482205,_0x50e663,_0x5d2deb,_0x4b7728,_0x4441e6):await this['_processAWSRequest'](_0x482205,_0x50e663,_0x5d2deb,_0x4b7728);}async['preparePrompt'](_0x128594,_0x2a2ccd,_0x2a97eb,_0x5aacd5){let _0x1a9798,_0x5cd63d;return _0x2a2ccd?(_0x1a9798='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.',_0x5cd63d='Instruction:\x0a'+_0x128594+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2a2ccd):(_0x1a9798='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.',_0x5cd63d=_0x128594),'meta.llama'==this['getModelFamily'](_0x2a97eb)?'<<SYS>>\x0a'+_0x1a9798+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x5cd63d+'\x0a[/INST]':'Human:\x0a'+_0x1a9798+'\x0a'+_0x5cd63d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x34ca27){if(/^anthropic\.claude/['test'](_0x34ca27))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x34ca27))return'ai21.j2';if(/^cohere\.command/['test'](_0x34ca27))return'cohere.command';if(/^meta\.llama/['test'](_0x34ca27))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x34ca27));}async['_processProxyRequest'](_0x4ea3e0,_0x315319,_0xfca598,_0x1527ed,_0x2384a0){const _0x1600b3={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2384a0),'body':JSON['stringify']({..._0x4ea3e0,'model':_0x315319,'stream':_0xfca598}),'signal':this['abortController']['signal']},_0x28f72d=await fetch(this['_apiUrl'],_0x1600b3);_0xfca598?await this['_readStreamableResponse'](_0x28f72d,_0x315319,_0x1527ed):await this['_readStaticResponse'](_0x28f72d,_0x315319,_0x1527ed);}async['_processAWSRequest'](_0x59303a,_0x9c363b,_0x556467,_0x357ead){const _0x2df322=new _0x2f9aa6(this['_bedrockClientConfig']),_0x4ee728={'body':JSON['stringify'](_0x59303a),'contentType':'application/json','accept':'application/json','modelId':_0x9c363b};let _0x9025b5;if(_0x556467){const _0x2199dc=new _0x8108be(_0x4ee728);_0x9025b5=await _0x2df322['send'](_0x2199dc,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x9025b5,_0x9c363b,_0x357ead);}else{const _0x16825b=new _0x5e0609(_0x4ee728);_0x9025b5=await _0x2df322['send'](_0x16825b,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x9025b5,_0x9c363b,_0x357ead);}}async['_readAsyncIterableResponse'](_0x2804fc,_0x41afa2,_0x347308){const _0x338682=_0x2804fc['body'],_0x23018d=new TextDecoder('utf-8');let _0x286917='';for await(const _0x57bc42 of _0x338682)if(_0x57bc42['chunk']){const _0x15ebff=_0x23018d['decode'](_0x57bc42['chunk']['bytes']),_0x2497b5=JSON['parse'](_0x15ebff);_0x286917+=this['_getGeneratedText'](_0x2497b5,_0x41afa2),_0x347308(_0x286917);}return Promise['resolve']();}async['_readStreamableResponse'](_0x185940,_0x58a448,_0x42ded6){const _0x1b8060=_0x185940['body'],_0x25e3f4=new TextDecoder('utf-8'),_0x37e2cb=_0x1b8060['getReader']();let _0x261115='',_0x496196='',_0x92c569=!0x1;for(;!_0x92c569;){const {done:_0x43555a,value:_0x285c02}=await _0x37e2cb['read']();if(_0x92c569=_0x43555a,_0x92c569)break;const _0x57f114=(_0x261115+_0x25e3f4['decode'](_0x285c02))['split']('\x0a')['map'](_0x5aac46=>{try{return _0x261115='',JSON['parse'](_0x5aac46);}catch{return _0x261115=_0x5aac46,null;}})['filter'](_0x21ed7e=>null!==_0x21ed7e);_0x57f114['length']&&(_0x496196+=_0x57f114['map'](_0x328c4e=>this['_getGeneratedText'](_0x328c4e,_0x58a448))['join'](''),_0x42ded6(_0x496196));}return Promise['resolve']();}async['_readStaticResponse'](_0x25c2de,_0x2806bc,_0x3091dd){let _0x565e45;return _0x565e45=_0x25c2de instanceof Response?await _0x25c2de['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x25c2de['body'])),(_0x3091dd(this['_getGeneratedText'](_0x565e45,_0x2806bc)),Promise['resolve']());}['_getGeneratedText'](_0x19287c,_0x44b3e4){switch(this['getModelFamily'](_0x44b3e4)){case'anthropic.claude':return _0x19287c['completion'];case'ai21.j2':return _0x19287c['completions'][0x0]['data']['text'];case'cohere.command':return _0x19287c['generations'][0x0]['text'];case'meta.llama':return _0x19287c['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
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':_0x2e1427=>0x1!=_0x2e1427}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x93c58f=>{const {af:{dictionary:_0x582206,getPluralForm:_0x33b5f6}}={'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':_0x4c78d4=>0x1!=_0x4c78d4}};_0x93c58f['af']||={'dictionary':{},'getPluralForm':null},_0x93c58f['af']['dictionary']=Object['assign'](_0x93c58f['af']['dictionary'],_0x582206),_0x93c58f['af']['getPluralForm']=_0x33b5f6;})(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':_0x7d8dd1=>0x0==_0x7d8dd1?0x0:0x1==_0x7d8dd1?0x1:0x2==_0x7d8dd1?0x2:_0x7d8dd1%0x64>=0x3&&_0x7d8dd1%0x64<=0xa?0x3:_0x7d8dd1%0x64>=0xb?0x4:0x5}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x998771=>{const {ar:{dictionary:_0x542b5a,getPluralForm:_0x42bc59}}={'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':_0x48e552=>0x0==_0x48e552?0x0:0x1==_0x48e552?0x1:0x2==_0x48e552?0x2:_0x48e552%0x64>=0x3&&_0x48e552%0x64<=0xa?0x3:_0x48e552%0x64>=0xb?0x4:0x5}};_0x998771['ar']||={'dictionary':{},'getPluralForm':null},_0x998771['ar']['dictionary']=Object['assign'](_0x998771['ar']['dictionary'],_0x542b5a),_0x998771['ar']['getPluralForm']=_0x42bc59;})(window['CKEDITOR_TRANSLATIONS']||={});
|