@ckeditor/ckeditor5-ai 44.3.0-alpha.2 → 44.3.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +9 -9
- package/src/adapters/aiadapter.js +1 -1
- package/src/adapters/aitextadapter.js +1 -1
- package/src/adapters/awstextadapter.js +1 -1
- package/src/adapters/openaitextadapter.js +1 -1
- package/src/aiassistant.js +1 -1
- package/src/aiassistantediting.js +1 -1
- package/src/aiassistantui.js +1 -1
- package/src/index.js +1 -1
- package/src/legacyerrors.js +1 -1
- package/src/ui/aiassistantcontroller.js +2 -2
- package/src/ui/form/aiformcontentarea.js +1 -1
- package/src/ui/form/aiformerrorview.js +1 -1
- package/src/ui/form/aiformpromptview.js +1 -1
- package/src/ui/form/aiformtoolbarview.js +1 -1
- package/src/ui/form/aiformview.js +1 -1
- package/src/ui/form/aihistorylistitemview.js +1 -1
- package/src/ui/form/aihistorylistview.js +1 -1
- package/src/ui/form/prompthistory.js +1 -1
- package/src/ui/showaiassistantcommand.js +1 -1
- package/src/utils/common-translations.js +1 -1
- package/src/utils/normalizecommandsconfig.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x2bfdda,Command as _0x563c24,icons as _0x59275f}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0xad9b60,CKEditorError as _0x1a9453,ObservableMixin as _0x5ab7e2,global as _0x17fc35,isVisible as it,Rect as st,Collection as _0x4a0113,FocusTracker as _0x126a18,KeystrokeHandler as ts,first as _0x3309b6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x52be94,View as _0x368bd2,SpinnerView as _0x23a3f6,IconView as _0x2a6867,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x41563c,ButtonLabelView as te,FocusCycler as _0x16d8d6,createLabeledTextarea as _0x2db248,Dialog as _0x5bf6d6,createDropdown as _0xf1ac4e,addMenuToDropdown as _0xd77474,MenuBarMenuView as _0x41ac76,MenuBarMenuListItemButtonView as _0x45d9f4,DialogViewPosition as _0x2b3f98,MenuBarMenuListView as _0x3ba367,MenuBarMenuListItemView as _0x94d296}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x69c7e9,ClipboardMarkersUtils as _0xc7e545}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x420495,DataTransfer as _0x5e0b09,UpcastWriter as _0x29e50c,Matcher as _0x5c5595}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1f1afa,escape as _0x5e1c34}from'lodash-es';import{BedrockRuntimeClient as _0x28658d,InvokeModelWithResponseStreamCommand as _0x2e0fcc,InvokeModelCommand as _0x56d5fb}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x3469b1,_0x56814b){const _0x4dc410=(0x0,_0x56814b['t'])('Other');return _0x3469b1['length']?'groupId'in _0x3469b1[0x0]?_0x3469b1:[{'groupId':x,'groupLabel':_0x4dc410,'order':0x1/0x0,'commands':_0x3469b1}]:[{'groupId':x,'groupLabel':_0x4dc410,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x2bfdda{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x13131a}=this,_0x43ea83=['ck-fake-ai-selection'];_0x13131a['config']['get']('ai.useTheme')&&_0x43ea83['push']('ck-ai-assistant-ui_theme'),_0x13131a['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x43ea83,'priority':0xc}}),_0x13131a['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x4c8e3b,{writer:_0x454d0f})=>{if(!_0x4c8e3b['markerRange']['isCollapsed'])return null;const _0xdfee93=_0x454d0f['createUIElement']('span');return _0x454d0f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0xdfee93),_0xdfee93;}});}['afterInit'](){!async function(_0x3cb2b8){const _0x5d89c8=_0x5cba1c([0x55,0x41,0x4b,0x37,0x76,0x59,0x68,0x6d,0x79,0x70,0x72,0x69,0x53,0x48,0x6b,0x78,0x62,0x36,0x6c,0x77,0x71,0x4c,0x44,0x6e,0x51,0x4d,0x45,0x7a,0x47,0x50,0x63,0x58,0x4f,0x64,0x74,0x61,0x39,0x67,0x38,0x34,0x52,0x42,0x57,0x73,0x43,0x6a,0x49,0x31,0x66,0x33,0x5a,0x4e,0x65,0x30,0x46,0x56,0x32,0x4a,0x6f,0x35,0x75,0x54]),_0x3cd9ac=0x66b4bf66,_0x8376e8=0x66b3dfae^_0x3cd9ac,_0x255704=window[_0x5cba1c([0x44,0x61,0x74,0x65])][_0x5cba1c([0x6e,0x6f,0x77])](),_0x249a25=_0x3cb2b8[_0x5cba1c([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x35255b=new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x335642=>{_0x249a25[_0x5cba1c([0x6f,0x6e,0x63,0x65])](_0x5cba1c([0x72,0x65,0x61,0x64,0x79]),_0x335642);}),_0x505afe={[_0x5cba1c([0x6b,0x74,0x79])]:_0x5cba1c([0x45,0x43]),[_0x5cba1c([0x75,0x73,0x65])]:_0x5cba1c([0x73,0x69,0x67]),[_0x5cba1c([0x63,0x72,0x76])]:_0x5cba1c([0x50,0x2d,0x32,0x35,0x36]),[_0x5cba1c([0x78])]:_0x5cba1c([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]),[_0x5cba1c([0x79])]:_0x5cba1c([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]),[_0x5cba1c([0x61,0x6c,0x67])]:_0x5cba1c([0x45,0x53,0x32,0x35,0x36])},_0x16ef81=_0x249a25[_0x5cba1c([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x5cba1c([0x67,0x65,0x74])](_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x26d702(){let _0x432055,_0x2000cd=null,_0x26049d=null;try{if(_0x16ef81==_0x5cba1c([0x47,0x50,0x4c]))return _0x5cba1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x432055=_0x242e0d(),!_0x432055)return _0x5cba1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x432055[_0x5cba1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x26049d=_0x549abb(_0x432055[_0x5cba1c([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x432055[_0x5cba1c([0x6a,0x74,0x69])])),await _0x19cc67()?_0x58c8ca()?_0x138972()?_0x5cba1c([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3fd079()?(_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5cba1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2000cd=_0x1c9ccc(_0x5cba1c([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x5cba1c([0x74,0x72,0x69,0x61,0x6c])&&(_0x2000cd=_0x1c9ccc(_0x5cba1c([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x11a929()):_0x5cba1c([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x5cba1c([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x5cba1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0xed1527){return _0x5cba1c([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x138972(){const _0x205d86=[_0x5cba1c([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x5cba1c([0x74,0x72,0x69,0x61,0x6c])][_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x255704/0x3e8:0xe10*_0x8376e8;return _0x432055[_0x5cba1c([0x65,0x78,0x70])]<_0x205d86;}function _0x58c8ca(){const _0x406a3b=_0x432055[_0x5cba1c([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x406a3b&&(!!_0x406a3b[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5cba1c([0x2a]))||!!_0x406a3b[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5cba1c([0x41,0x49])));}function _0x3fd079(){const _0x41deb9=_0x432055[_0x5cba1c([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x41deb9||0x0==_0x41deb9[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x331f8d}=new URL(window[_0x5cba1c([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x41deb9[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x331f8d))return!0x0;const _0xc2bf27=_0x331f8d[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e]));return _0x41deb9[_0x5cba1c([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2dfeee=>_0x2dfeee[_0x5cba1c([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x5cba1c([0x2a])))[_0x5cba1c([0x6d,0x61,0x70])](_0x7a4349=>_0x7a4349[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e])))[_0x5cba1c([0x73,0x6f,0x6d,0x65])](_0x414255=>_0xc2bf27[_0x5cba1c([0x65,0x76,0x65,0x72,0x79])]((_0x293c9,_0x2ff5ad)=>_0x414255[_0x2ff5ad]===_0x293c9||_0x414255[_0x2ff5ad]===_0x5cba1c([0x2a])));}function _0x11a929(){return _0x2000cd&&_0x26049d?new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5b6941,_0x55925d)=>{_0x2000cd[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x5b6941,_0x55925d),_0x26049d[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x366762=>{_0x366762!=_0x5cba1c([0x56,0x61,0x6c,0x69,0x64])&&_0x5b6941(_0x366762);},_0x55925d);}):_0x2000cd||_0x26049d||_0x5cba1c([0x56,0x61,0x6c,0x69,0x64]);}}function _0x549abb(_0x20f917,_0x53f232){return new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x180bbd=>{if(_0xf1f033())return _0x180bbd(_0x5cba1c([0x56,0x61,0x6c,0x69,0x64]));_0x2f6a1d(),_0x249a25[_0x5cba1c([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x5cba1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x13104d=!0x1;const _0x911bc=_0xad9b60();function _0x2d848b(_0x37d611){return!!_0x37d611&&(typeof _0x37d611===_0x5cba1c([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x37d611===_0x5cba1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x37d611[_0x5cba1c([0x74,0x68,0x65,0x6e])]===_0x5cba1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x37d611[_0x5cba1c([0x63,0x61,0x74,0x63,0x68])]===_0x5cba1c([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x43c46c(_0x527715){_0x1fca4e(_0x527715)[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x1aa3f9=>{if(!_0x1aa3f9||_0x1aa3f9[_0x5cba1c([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x5cba1c([0x6f,0x6b]))return _0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1292a8(_0x4fcefc(_0x911bc+_0x53f232))!=_0x1aa3f9[_0x5cba1c([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x5cba1c([0x56,0x61,0x6c,0x69,0x64]);})[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x3c1e75=>(_0x5dd217(),_0x3c1e75),()=>{const _0x37b207=_0xa49948();return null==_0x37b207?(_0x5dd217(),_0x5cba1c([0x56,0x61,0x6c,0x69,0x64])):_0x5cba1c(_0x255704-_0x37b207>(0x42b83b66^_0x3cd9ac)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x180bbd)[_0x5cba1c([0x63,0x61,0x74,0x63,0x68])](()=>{_0x180bbd(_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x19277b=0x668251e6^_0x3cd9ac;function _0x5dd217(){const _0x874ef3=_0x5cba1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1292a8(_0x4fcefc(_0x20f917)),_0xf3f058=_0x7f52b(_0x1292a8(window[_0x5cba1c([0x4d,0x61,0x74,0x68])][_0x5cba1c([0x63,0x65,0x69,0x6c])](_0x255704/_0x19277b)));window[_0x5cba1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5cba1c([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x874ef3,_0xf3f058);}function _0xa49948(){const _0x3a4c27=_0x5cba1c([0x6c,0x6c,0x63,0x74,0x2d])+_0x1292a8(_0x4fcefc(_0x20f917)),_0x4af488=window[_0x5cba1c([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x5cba1c([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3a4c27);return _0x4af488?window[_0x5cba1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x7f52b(_0x4af488),0x10)*_0x19277b:null;}function _0x1fca4e(_0x478b5b){return new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x453d44,_0x40b511)=>{_0x478b5b[_0x5cba1c([0x74,0x68,0x65,0x6e])](_0x453d44,_0x40b511),window[_0x5cba1c([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x40b511,0x66b56ba6^_0x3cd9ac);});}}_0x249a25[_0x5cba1c([0x6f,0x6e])](_0x5cba1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x270feb,_0x3ba81e)=>{if(_0x3ba81e[0x0]!=_0x20f917)return _0x180bbd(_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3ba81e[0x1]={..._0x3ba81e[0x1],[_0x5cba1c([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x911bc};},{[_0x5cba1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5cba1c([0x68,0x69,0x67,0x68])}),_0x249a25[_0x5cba1c([0x6f,0x6e])](_0x5cba1c([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x27e414=>{_0x2d848b(_0x27e414[_0x5cba1c([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x13104d=!0x0,_0x43c46c(_0x27e414[_0x5cba1c([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x5cba1c([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x5cba1c([0x6c,0x6f,0x77])}),_0x35255b[_0x5cba1c([0x74,0x68,0x65,0x6e])](()=>{_0x13104d||_0x180bbd(_0x5cba1c([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xf1f033(){return _0x249a25[_0x5cba1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5cba1c([0x76,0x69,0x65,0x77])][_0x5cba1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x5cba1c([0x61,0x75,0x74,0x6f]);}function _0x2f6a1d(){_0x249a25[_0x5cba1c([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x5cba1c([0x76,0x69,0x65,0x77])][_0x5cba1c([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x5cba1c([0x61,0x75,0x74,0x6f]);}}function _0x1c9ccc(_0x4f1abc){const _0x165a80=[new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x45fb68=>setTimeout(_0x45fb68,0x66bd81aa^_0x3cd9ac)),_0x35255b[_0x5cba1c([0x74,0x68,0x65,0x6e])](()=>new window[(_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x140fba=>{let _0x559509=0x0;_0x249a25[_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x5cba1c([0x6f,0x6e])](_0x5cba1c([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x17c19c,_0x2949c2)=>{_0x2949c2[0x0][_0x5cba1c([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x559509++,_0x559509==(0x66b4be9e^_0x3cd9ac)&&(_0x140fba(),_0x17c19c[_0x5cba1c([0x6f,0x66,0x66])]());});}))];return window[_0x5cba1c([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x5cba1c([0x72,0x61,0x63,0x65])](_0x165a80)[_0x5cba1c([0x74,0x68,0x65,0x6e])](()=>_0x4f1abc);}async function _0xa7fdab(){await _0x35255b,_0x249a25[_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x5cba1c([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x2a6e11,_0x249a25[_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c])][_0x5cba1c([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x2a6e11,_0x249a25[_0x5cba1c([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x5cba1c([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xfc0769(_0x23db7f){const _0x2d45a7=_0x257128();_0x249a25[_0x2d45a7]=_0x5cba1c([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x23db7f,_0x23db7f!=_0x5cba1c([0x56,0x61,0x6c,0x69,0x64])&&_0xa7fdab();}function _0x257128(){const _0x5a8326=window[_0x5cba1c([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x5cba1c([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x5cba1c([0x6e,0x6f,0x77])]())[_0x5cba1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x5cba1c([0x2e]),'');let _0xba7ea0=_0x5cba1c([0x55]);for(let _0x287d76=0x0;_0x287d76<_0x5a8326[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x287d76+=0x2){let _0x1045b3=window[_0x5cba1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x5a8326[_0x5cba1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x287d76,_0x287d76+0x2));_0x1045b3>=_0x5d89c8[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1045b3-=_0x5d89c8[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0xba7ea0+=_0x5d89c8[_0x1045b3];}return _0xba7ea0;}function _0x242e0d(){const _0x484fb3=_0x16ef81[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e]));if(0x3!=_0x484fb3[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2e2b33(_0x484fb3[0x1]);function _0x2e2b33(_0x4388d5){const _0x5779f0=_0xfdf3c6(_0x4388d5);return _0x5779f0&&_0x5bfb16()?_0x5779f0:null;function _0x5bfb16(){const _0x3f63e5=_0x5779f0[_0x5cba1c([0x6a,0x74,0x69])],_0x7186fc=window[_0x5cba1c([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f63e5[_0x5cba1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3f63e5[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x6756fb={..._0x5779f0,[_0x5cba1c([0x6a,0x74,0x69])]:_0x3f63e5[_0x5cba1c([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3f63e5[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x6756fb[_0x5cba1c([0x76,0x63])],_0x4fcefc(_0x6756fb)==_0x7186fc;}}}async function _0x19cc67(){let _0x3bc54a=!0x0;try{const _0x4fe8e0=_0x16ef81[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])](_0x5cba1c([0x2e])),[_0x38d47a,_0x201126,_0x18249c]=_0x4fe8e0;return _0x419db6(_0x38d47a),await _0xbede0e(_0x38d47a,_0x201126,_0x18249c),_0x3bc54a;}catch(_0x24c7e7){return!0x1;}function _0x419db6(_0x3a733c){const _0x45e9e4=_0xfdf3c6(_0x3a733c);_0x45e9e4&&_0x45e9e4[_0x5cba1c([0x61,0x6c,0x67])]==_0x5cba1c([0x45,0x53,0x32,0x35,0x36])||(_0x3bc54a=!0x1);}async function _0xbede0e(_0x126e2b,_0x5d2dca,_0x4d9627){const _0x33f310=window[_0x5cba1c([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x5cba1c([0x66,0x72,0x6f,0x6d])](_0x4eb9f0(_0x4d9627),_0x5048b6=>_0x5048b6[_0x5cba1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x28138b=new window[(_0x5cba1c([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x5cba1c([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x126e2b+_0x5cba1c([0x2e])+_0x5d2dca),_0x56918a=window[_0x5cba1c([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x5cba1c([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x56918a)return;const _0x144d08=await _0x56918a[_0x5cba1c([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x5cba1c([0x6a,0x77,0x6b]),_0x505afe,{[_0x5cba1c([0x6e,0x61,0x6d,0x65])]:_0x5cba1c([0x45,0x43,0x44,0x53,0x41]),[_0x5cba1c([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x5cba1c([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x5cba1c([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x56918a[_0x5cba1c([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x5cba1c([0x6e,0x61,0x6d,0x65])]:_0x5cba1c([0x45,0x43,0x44,0x53,0x41]),[_0x5cba1c([0x68,0x61,0x73,0x68])]:{[_0x5cba1c([0x6e,0x61,0x6d,0x65])]:_0x5cba1c([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x144d08,_0x33f310,_0x28138b)||(_0x3bc54a=!0x1);}}function _0xfdf3c6(_0x9a71d5){return _0x9a71d5[_0x5cba1c([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x5cba1c([0x65,0x79]))?JSON[_0x5cba1c([0x70,0x61,0x72,0x73,0x65])](_0x4eb9f0(_0x9a71d5)):null;}function _0x4eb9f0(_0x1975e4){return window[_0x5cba1c([0x61,0x74,0x6f,0x62])](_0x1975e4[_0x5cba1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x5cba1c([0x2b]))[_0x5cba1c([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x5cba1c([0x2f])));}function _0x4fcefc(_0x240de1){let _0x22b926=0x1505;function _0x26e8a7(_0xaf7716){for(let _0x2c391a=0x0;_0x2c391a<_0xaf7716[_0x5cba1c([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2c391a++){const _0x1fe044=_0xaf7716[_0x5cba1c([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2c391a);_0x22b926=(_0x22b926<<0x5)+_0x22b926+_0x1fe044,_0x22b926&=_0x22b926;}}function _0x39ab12(_0x261709){Array[_0x5cba1c([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x261709)?_0x261709[_0x5cba1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x39ab12):_0x261709&&typeof _0x261709==_0x5cba1c([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x5cba1c([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x261709)[_0x5cba1c([0x73,0x6f,0x72,0x74])]()[_0x5cba1c([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x53e3f4,_0x174340])=>{_0x26e8a7(_0x53e3f4),_0x39ab12(_0x174340);}):_0x26e8a7(window[_0x5cba1c([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x261709));}return _0x39ab12(_0x240de1),_0x22b926>>>0x0;}function _0x1292a8(_0x46c836){return _0x46c836[_0x5cba1c([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x5cba1c([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x5cba1c([0x30]));}function _0x7f52b(_0x44101f){return _0x44101f[_0x5cba1c([0x73,0x70,0x6c,0x69,0x74])]('')[_0x5cba1c([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x5cba1c([0x6a,0x6f,0x69,0x6e])]('');}function _0x2a6e11(){}function _0x5cba1c(_0x33f4d9){return _0x33f4d9['map'](_0x5f568c=>String['fromCharCode'](_0x5f568c))['join']('');}_0xfc0769(await _0x26d702());}(this);}['showFakeVisualSelection'](){const _0x4f5e91=this['editor']['model'];_0x4f5e91['change'](_0x2ca0a1=>{const _0x47187d=_0x4f5e91['document']['selection']['getRanges']();let _0x5e90cb=0x0;for(const _0x3d2ba0 of _0x47187d){const _0x20227d=f+':'+_0x5e90cb;if(_0x4f5e91['markers']['has'](_0x20227d))_0x2ca0a1['updateMarker'](_0x20227d,{'range':_0x3d2ba0});else{if(_0x3d2ba0['start']['isAtEnd']){const _0x59e3e8=_0x3d2ba0['start']['getLastMatchingPosition'](({item:_0x5bcc0b})=>!_0x4f5e91['schema']['isContent'](_0x5bcc0b),{'boundaries':_0x3d2ba0});_0x2ca0a1['addMarker'](_0x20227d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x2ca0a1['createRange'](_0x59e3e8,_0x3d2ba0['end'])});}else _0x2ca0a1['addMarker'](_0x20227d,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3d2ba0});}_0x5e90cb++;}});}['hideFakeVisualSelection'](){const _0x48d936=this['editor']['model'],_0x457b24=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x457b24['length']&&_0x48d936['change'](_0x248988=>{_0x457b24['forEach'](_0x275729=>{_0x248988['removeMarker'](_0x275729);});});}['insertContent'](_0x657926,_0x224243){const _0x20f325=this['_getAISelection'](),_0x5ac7e5=_0x224243||_0x20f325['getFirstRange']();this['editor']['model']['canEditAt'](_0x5ac7e5)&&this['editor']['model']['change'](_0x15275c=>{this['hideFakeVisualSelection'](),_0x224243||this['_resetContentOfSelectedTableCells'](_0x15275c,_0x20f325),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5ac7e5,'writer':_0x15275c,'html':_0x657926});});}['insertContentBelow'](_0x2235a7){const {model:_0x26a9ad}=this['editor'],_0xa85bf9=this['_getAISelection']();_0x26a9ad['change'](()=>{const _0x182058=this['_prepareTableInsertBelowPosition'](_0x2235a7,_0xa85bf9)||this['_getDefaultInsertBelowPosition'](_0xa85bf9);this['insertContent'](_0x2235a7,_0x182058);});}['_getAISelection'](){const _0x2b2aec=this['editor']['model'],_0xd6fb58=Array['from'](_0x2b2aec['markers']['getMarkersGroup'](f))['map'](_0x405899=>_0x405899['getRange']());return _0x2b2aec['createSelection'](_0xd6fb58);}['_pasteHTMLUsingClipboard']({writer:_0x2abf47,html:_0x30b823,insertAt:_0x4f9886}){const {view:_0x446bd1}=this['editor']['editing'],_0x554acb=this['editor']['plugins']['get'](_0x69c7e9),_0x47748c=new dt();_0x47748c['setData']('text/html',_0x30b823);const _0x57c930=new ClipboardEvent('paste',{'clipboardData':_0x47748c}),_0x5307b1=new _0x420495(_0x446bd1,_0x57c930,{'dataTransfer':new _0x5e0b09(_0x47748c)});_0x2abf47['setSelection'](_0x4f9886);const _0x325697=(_0xc5a60e,_0x5806f2)=>{_0x5806f2['resultRange']&&_0x2abf47['setSelection'](_0x5806f2['resultRange']);};_0x554acb['once']('contentInsertion',_0x325697,{'priority':'lowest'}),_0x446bd1['document']['fire']('paste',_0x5307b1),_0x554acb['off']('contentInsertion',_0x325697);}['_getDefaultInsertBelowPosition'](_0x2ee5cd){const {model:_0x493e8a}=this['editor'],_0x31cf7e=Array['from'](_0x2ee5cd['getSelectedBlocks']());return _0x31cf7e['length']?_0x493e8a['createPositionAfter'](_0x31cf7e['pop']()):_0x2ee5cd['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3f32b0,_0x1515ad){const {model:_0x46de98,plugins:_0x1bb7a4}=this['editor'];if(_0x1bb7a4['has']('TableUtils')){const _0x52bb3f=_0x1bb7a4['get']('TableUtils')['getSelectedTableCells'](_0x1515ad);if(_0x52bb3f['length']){const _0x54ab8a=this['_getTableRowCountFromContent'](_0x3f32b0),_0x4672a0=this['_createEmptyTableRows'](_0x52bb3f,_0x54ab8a);return _0x46de98['createPositionAt'](_0x4672a0,0x0);}}return null;}['_getTableRowCountFromContent'](_0x1a0dd4){const _0xb86e97=this['editor']['plugins']['get']('TableUtils'),_0x32f09e=this['editor']['data']['parse'](_0x1a0dd4),_0x347c5d=Array['from'](_0x32f09e['getChildren']())['filter'](_0x20434a=>_0x20434a['is']('element','table'));let _0x567d5e=0x0;return _0x347c5d['forEach'](_0x243376=>{_0x567d5e+=_0xb86e97['getRows'](_0x243376);}),_0x567d5e;}['_createEmptyTableRows'](_0x2a3743,_0x1bb8ed){const _0x4ced33=this['editor']['plugins']['get']('TableUtils'),_0x8861d2=_0x4ced33['getRowIndexes'](_0x2a3743),_0x3f55e5=_0x4ced33['getColumnIndexes'](_0x2a3743),_0x4605e4=_0x8861d2['last']+0x1,_0x3785c2=_0x3f55e5['first'],_0x40fe29=_0x2a3743[0x0]['findAncestor']('table');for(let _0x4b7fca=0x0;_0x4b7fca<_0x1bb8ed;_0x4b7fca++)_0x4ced33['insertRows'](_0x40fe29,{'at':_0x4605e4});return _0x40fe29['getChild'](_0x4605e4)['getChild'](_0x3785c2);}['_resetContentOfSelectedTableCells'](_0x2fa051,_0x4d5b32){const {plugins:_0x5bcc08}=this['editor'],{model:_0x4c3239}=_0x2fa051;if(!_0x5bcc08['has']('TableUtils'))return;_0x5bcc08['get']('TableUtils')['getSelectedTableCells'](_0x4d5b32)['length']&&_0x4c3239['deleteContent'](_0x4d5b32);}}class K extends _0x2bfdda{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1a9453('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x583a46){super(_0x583a46),this['name']='AIRequestError';}}function i(_0x5b837b,_0x34694,_0x4b12a5){const t=_0x5b837b['t'];switch(_0x34694){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',_0x4b12a5);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4b12a5);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'},_0x4b12a5);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 _0x34694;}}class E extends _0x563c24{['_commandDefinitions'];constructor(_0x2ce0ac,_0x4446f5){super(_0x2ce0ac),this['_commandDefinitions']=_0x4446f5,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x5db9c9,_0x410814,_0x2b951a)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x2b951a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x2e029c,_0xb4272b,_0x4065b4)=>{this['enabledCommandsIds']=_0x4065b4?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x158068=this['editor']['model'];this['_hasContext']=function(_0x34bc2b){const _0x471e56=_0x34bc2b['document']['selection'];return _0x471e56['isCollapsed']?0x0!==[..._0x471e56['getSelectedBlocks']()]['length']&&![..._0x471e56['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x34bc2b['hasContent'](_0x471e56['getFirstRange']());}(_0x158068);const _0x52fe4d=_0x158068['document']['selection'],_0xcec26f=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x13daa0 of _0x52fe4d['getRanges']())for(const _0x3ad9c7 of _0x13daa0['getItems']())if(_0x3ad9c7['is']('element')&&_0xcec26f['includes'](_0x3ad9c7['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x4f5cf0='',_0x51dbe0='',_0x4e8c85='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x4f5cf0,_0x51dbe0,_0x4e8c85);}}function G(_0x56ea02,_0x54955c){const _0x191052=new Set();for(const _0x5433bd of _0x56ea02['values']())(_0x54955c||!0x1===_0x5433bd['requiresContent'])&&_0x191052['add'](_0x5433bd['id']);return Array['from'](_0x191052);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x5ab7e2(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3a61ba,_0x342191,_0x18af10){super(),this['editor']=_0x3a61ba,this['textAdapter']=_0x342191,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x18af10,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x151e46,_0x121ff8,_0x4a19cd)=>{this['view']['value']=this['_sanitizeHTML'](_0x4a19cd);}),this['listenTo'](this['view'],'submitPrompt',(_0x1405d3,_0x544652)=>{const _0x583950=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x544652,_0x583950,'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:_0x54ab66,query:_0x396d3e,htmlContent:_0x1e87c5,label:_0x264504,mainActionLabel:_0x3910ff}){this['view']['prompt']=_0x264504,this['view']['mainAction']=_0x3910ff,this['initialContext']=_0x1e87c5,_0x396d3e&&(this['view']['isRendered']?this['_handleQuery'](_0x396d3e,_0x1e87c5,_0x54ab66,_0x264504):this['view']['once']('render',()=>{this['_handleQuery'](_0x396d3e,_0x1e87c5,_0x54ab66,_0x264504);}));}['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'](_0x1991ce,_0x257ec8,_0x411b97,_0x43adbe){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x257ec8,this['previousQuery']=_0x1991ce,this['previousLabel']=_0x43adbe||_0x1991ce,this['previousActionId']=_0x411b97,new Promise(_0x3670ee=>{this['textAdapter']['makeRequest']({'query':_0x1991ce,'context':_0x257ec8,'onData':_0x2f5e2c=>{this['currentResponse']=_0x2f5e2c,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x411b97})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3e9aaa=>{_0x3e9aaa instanceof R?this['view']['handleError'](_0x3e9aaa['message']):this['view']['handleError'](),_0x3670ee();})['finally'](()=>{this['stopProcessing'](),_0x3670ee();});});}['_parseAndNormalizeContent'](_0xac09d2,_0x36f50a=!0x1){const _0x23fb09=Z['exec'](_0xac09d2);_0xac09d2=_0x23fb09?_0xac09d2['substring'](_0x23fb09[0x1]['length']):_0xac09d2['length']<0x64&&!_0x36f50a?'':this['_stripMarkdownSyntax'](_0xac09d2);const _0x11b65f=this['_domParser']['parseFromString'](_0xac09d2,'text/html');if(_0x23fb09){const _0x2b7f7e=Array['from'](_0x11b65f['body']['childNodes']);_0x2b7f7e['reverse']();for(const _0x1f388b of _0x2b7f7e){if(_0x1f388b['nodeType']==Node['ELEMENT_NODE'])break;_0x1f388b['remove']();}}const _0x4ce373=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x11b65f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4ce373);const _0x167342=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x854863=this['editor']['data']['toModel'](_0x4ce373);return _0x167342||_0x854863['markers']['clear'](),this['editor']['data']['stringify'](_0x854863);}['_normalizeResponseHeadings'](_0x12d2c1){const _0x350bb6=new _0x29e50c(this['editor']['editing']['view']['document']),_0x189e0d=new _0x5c5595({'name':/^h[1-5]$/}),_0x5c7f36=[];let _0x22c973=!0x1;for(const _0x466fe6 of _0x12d2c1)_0x466fe6['is']('element')&&_0x189e0d['match'](_0x466fe6)&&(_0x5c7f36['push'](_0x466fe6),'h1'==_0x466fe6['name']&&(_0x22c973=!0x0));if(_0x22c973){for(const _0x375c79 of _0x5c7f36)_0x350bb6['rename']('h'+(parseInt(_0x375c79['name'][0x1])+0x1),_0x375c79);}}['_isH1TagSupportEnabled'](){const {data:_0x4ef133,editing:_0x311de0}=this['editor'],_0x4faf7f=_0x4ef133['htmlProcessor']['toView']('<h1></h1>'),_0x40e112=_0x4ef133['toView'](_0x4ef133['toModel'](_0x4faf7f));return!!_0x311de0['view']['domConverter']['viewToDom'](_0x40e112)['querySelector']('h1');}['_sanitizeHTML'](_0x3e1925){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3e1925),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x57e27f){const _0x220b3a=_0x57e27f['trim']();return _0x220b3a['startsWith']('```html')?_0x220b3a['endsWith']('```')?_0x220b3a['substring'](0x7,_0x220b3a['length']-0x3):_0x220b3a['substring'](0x7):_0x57e27f;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x9a671d){super(_0x9a671d),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x542379=>i(_0x9a671d,'AI_'+_0x542379['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x9a671d,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x9a671d,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x9a671d,'Stop'));const _0xb6d268=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0xb6d268['if']('isVisible','ck-hidden',_0x41fd33=>!_0x41fd33)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0xa56621,_0x57167e){const _0x380964=new _0x52be94(this['locale']);return _0x380964['set']({'label':_0xa56621,'class':_0x57167e||'','isVisible':!0x0,'withText':!0x0}),_0x380964;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x368bd2{['contentFieldView'];['copyButtonView'];constructor(_0x416066,_0x43b421=''){super(_0x416066),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x123d0f=this['bindTemplate'];this['contentFieldView']=new mt(_0x416066,_0x43b421),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x123d0f['if']('isVisible','ck-hidden',_0x5c422c=>!_0x5c422c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x123d0f['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 _0x54667a=!0x1;this['on']('change:value',(_0x1f0390,_0x56a0ee,_0x2c532c)=>{const _0x178a12=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x2c532c),this['isProcessing']&&_0x178a12&&!_0x54667a&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4c070c,_0x4cb78e,_0x3945c0)=>{_0x54667a=!0x1,_0x3945c0?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x54667a=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x54667a=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x1ab872=this['locale'],_0x39d32f=new _0x52be94(this['locale']),_0xdfcabc='ck-ai-form__copy-button';return _0x39d32f['set']({'label':i(_0x1ab872,'Copy'),'icon':W,'class':_0xdfcabc,'tooltip':!0x0}),_0x39d32f['bind']('isVisible')['to'](this,'value',_0x2c780c=>!!_0x2c780c),_0x39d32f['bind']('isEnabled')['to'](this,'isProcessing',_0xff24b9=>!_0xff24b9),_0x39d32f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x39d32f['icon']=_0x59275f['check'],_0x39d32f['class']=_0xdfcabc+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x39d32f['icon']=W,_0x39d32f['class']=_0xdfcabc;},0x3e8);}),_0x39d32f;}['_copyHTMLToClipboard'](_0x380bc0){const {window:_0x592f17,document:_0x2d3bb9}=_0x17fc35;if(_0x592f17['ClipboardItem']){const {Blob:_0x35271e,ClipboardItem:_0x434ac8}=_0x592f17,_0x2a4dff=[new _0x434ac8({'text/html':new _0x35271e([_0x380bc0['innerHTML']],{'type':'text/html'}),'text/plain':new _0x35271e([_0x380bc0['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x2a4dff);}else{const _0x15b26f=_0x2d3bb9['createElement']('div');_0x15b26f['style']['position']='absolute',_0x15b26f['style']['left']='-9999px',_0x15b26f['innerHTML']='<span>[</span>'+_0x380bc0['innerHTML']+'<span>]</span>',_0x2d3bb9['body']['appendChild'](_0x15b26f);const _0x3643e7=_0x2d3bb9['createRange']();_0x3643e7['setStartAfter'](_0x15b26f['firstElementChild']),_0x3643e7['setEndBefore'](_0x15b26f['lastElementChild']);const _0x3ff47d=_0x592f17['getSelection']();_0x3ff47d['removeAllRanges'](),_0x3ff47d['addRange'](_0x3643e7),_0x2d3bb9['execCommand']('copy'),_0x15b26f['remove']();}}}class mt extends _0x368bd2{constructor(_0x49a68b,_0xcede59=''){super(_0x49a68b),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0xcede59,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x3c5f09){this['element']['innerHTML']=_0x3c5f09;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x2a0f97=new _0x368bd2(),_0x31dcaf=this['locale'],_0x28345f=new _0x23a3f6();return _0x28345f['isVisible']=!0x0,_0x2a0f97['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x28345f,{'text':i(_0x31dcaf,'AI\x20is\x20writing...')}]}),_0x2a0f97['render'](),_0x2a0f97;}}class rt extends _0x368bd2{constructor(_0x25a84c,_0x27af95=''){super(_0x25a84c);const _0x2b40cc=new _0x2a6867(),_0x265f6e=this['bindTemplate'];this['set']('text',_0x27af95),_0x2b40cc['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2b40cc,{'text':_0x265f6e['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x7261bb,_0x13ebb3){super(_0x7261bb,_0x13ebb3),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',(_0x4bb3e9,_0xac45c2)=>{_0x4bb3e9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0xac45c2());});}['_createSubmitButton'](){const _0x304b7a=new _0x52be94(this['locale']),_0x39935d=this['locale'];return _0x304b7a['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x39935d,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x304b7a['on']('execute',()=>{this['submit']();}),_0x304b7a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x2d2794,_0x4b3948)=>!_0x2d2794&&_0x4b3948),_0x304b7a;}['_createShowHistoryButton'](){const _0x5e0902=new _0x52be94(this['locale']),_0x2f954d=this['resultsView'],_0x542970=this['locale'];_0x5e0902['set']({'label':i(_0x542970,'History'),'withText':!0x1,'icon':_0x59275f['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x5e0902['bind']('isOn')['to'](_0x2f954d,'isVisible'),_0x5e0902['bind']('isEnabled')['to'](this,'isEnabled'),_0x5e0902['on']('execute',()=>{_0x2f954d['isVisible']=!_0x2f954d['isVisible'],_0x2f954d['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x360efd=()=>{_0x17fc35['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x4bf243=new st(this['queryView']['fieldView']['element']),_0x1d84a1=_0x4bf243['width'],_0x14cb84='rtl'===_0x542970['uiLanguageDirection']?'left':'right';_0x4bf243['excludeScrollbarsAndBorders'](),_0x5e0902['element']['style'][_0x14cb84]=_0x1d84a1-_0x4bf243['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x360efd),this['on']('render',_0x360efd),_0x5e0902;}['submit'](){const _0x2da6dc=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x2da6dc);}['focus'](_0x1948cb){-0x1===_0x1948cb?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x29efd6){super(_0x29efd6),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x29efd6,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xc7c4=0x0;for(const _0x730d77 of this['items'])_0xc7c4+=_0x730d77['items']['length'];return{'resultsCount':_0xc7c4,'totalItemsCount':_0xc7c4};}['_createClearHistoryButton'](){const _0x48293a=this['locale'],_0x227c6e=new _0x52be94(this['locale']);return _0x227c6e['set']({'label':'('+i(_0x48293a,'Clear')+')','withText':!0x0}),_0x227c6e['on']('execute',()=>this['fire']('clearHistory')),_0x227c6e;}}class hs extends _0x41563c{constructor(_0x19bc49){super();const _0x360199=new te(),_0x98b375=new _0x52be94(this['locale'],_0x360199);this['children']['add'](_0x98b375),_0x98b375['set']({'label':_0x19bc49['prompt'],'withText':!0x0}),_0x98b375['on']('execute',()=>{this['fire']('execute',{'value':_0x1f1afa(_0x19bc49['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4a0113{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5e32cf,_0x4e6132)=>{const _0x3b061e=Ss(_0x4e6132['prompt']);for(const _0x5bacde of this)if(_0x5bacde!=_0x4e6132&&Ss(_0x5bacde['prompt'])===_0x3b061e){this['remove'](_0x5bacde);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x548f20=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x548f20));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x224b16=>_0x224b16)));}}function Ss(_0x399789){return _0x399789['toLowerCase']()['trim']();}class k extends _0x368bd2{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x5e0c50,_0x374e97,_0x2b65ca=''){super(_0x5e0c50),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x5e0c50),this['contentArea']=new X(_0x5e0c50,_0x2b65ca),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 _0x126a18(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x16d8d6({'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 _0x202740=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x374e97],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x202740['if']('isError','ck-hidden',_0x2b3aca=>!_0x2b3aca)]},'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'](_0x1cf54b=0x1){-0x1===_0x1cf54b?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 _0x1e08cd=this['locale'],_0x5bd6eb=new ht(_0x1e08cd,{'queryView':{'label':i(_0x1e08cd,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x2db248,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1e08cd,'Empty\x20history'),'secondary':i(_0x1e08cd,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5bd6eb['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2c5af9,_0x5421dd)=>_0x2c5af9&&!_0x5421dd),this['listenTo'](_0x5bd6eb,'submit',(_0x5bd1ce,_0x45a73f)=>{this['prompt']=_0x45a73f;const _0x597df9=_0x5e1c34(_0x45a73f);this['fire']('submitPrompt',_0x597df9),_0x45a73f['trim']()&&this['_promptHistory']['add']({'prompt':_0x597df9},0x0);},{'priority':'high'}),_0x5bd6eb;}['_createHistoryView'](){const _0x285f1f=new rs(this['locale']);return _0x285f1f['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x285f1f['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x285f1f;}['_createToolbar'](){const _0xb2b367=new at(this['locale']);return _0xb2b367['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3589c4,_0x3a9c7f,_0x22a886)=>_0x3589c4&&!_0x3a9c7f&&!!_0x22a886),_0xb2b367['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xb2b367['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x3634a5,_0xf8c1b5,_0x17d50b)=>_0x3634a5&&!_0xf8c1b5&&!!_0x17d50b),_0xb2b367['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xb2b367['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xe1aaf0,_0x38f61a)=>_0xe1aaf0&&!_0x38f61a),_0xb2b367['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xb2b367['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xb2b367['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xb2b367;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3ea1d1=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3ea1d1,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4ff772){const _0x345f63=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4ff772||i(_0x345f63,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x2bfdda{['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[_0xc7e545,a,K,_0x5bf6d6];}constructor(_0x57d248){super(_0x57d248),_0x57d248['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x57d248['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x57d248['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x57d248['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x460ca5}=this;this['_aiAdapter']=_0x460ca5['plugins']['get'](K),this['_dialog']=_0x460ca5['plugins']['get'](_0x5bf6d6),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1810e9=new E(_0x460ca5,Array['from'](this['_commandDefinitions']['values']()));_0x460ca5['commands']['add']('showAIAssistant',_0x1810e9),_0x460ca5['ui']['componentFactory']['add']('aiCommands',_0x27661=>{const _0x132815=_0xf1ac4e(_0x27661);return _0x132815['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x132815['buttonView']['set']({'label':i(_0x27661,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x132815['on']('execute',_0x5791d9=>this['_onExecute'](_0x5791d9['source']['id'])),_0xd77474(_0x132815,_0x460ca5['ui']['view']['body'],function(_0x3e34eb){const _0x324414=o(_0x3e34eb['config']['get']('ai.aiAssistant.commands'),_0x3e34eb['locale']),_0x26f44b=U(_0x3e34eb,_0x324414)['filter'](_0x5284fa=>_0x5284fa['commands']['length']);if(0x1===_0x26f44b['length'])return U(_0x3e34eb,_0x26f44b[0x0]['commands'])['map'](_0x226878=>({'id':_0x226878['id'],'label':_0x226878['label']}));return _0x26f44b['map'](_0x41232a=>{const {groupId:_0x6c075f,groupLabel:_0x402899,commands:_0x213051}=_0x41232a,_0x4c3905=U(_0x3e34eb,_0x213051)['map'](_0x29745a=>({'id':_0x29745a['id'],'label':_0x29745a['label']}));return{'id':_0x6c075f,'menu':_0x402899||_0x6c075f,'children':_0x4c3905};});}(_0x460ca5),{'ariaLabel':i(_0x27661,'AI\x20Commands')}),_0x132815['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1810e9['on']('change:enabledCommandsIds',_0x4135a6),_0x132815['menuView']['once']('render',_0x4135a6),_0x132815;function _0x4135a6(){_0x132815['isEnabled']=_0x1810e9['enabledCommandsIds']['length']>0x0;for(const _0x3c78a9 of _0x132815['menuView']['buttons'])_0x3c78a9['isEnabled']=_0x1810e9['enabledCommandsIds']['includes'](_0x3c78a9['id']);}}),_0x460ca5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4413c5=>{const _0x5ebf96=new _0x41ac76(_0x4413c5);_0x5ebf96['buttonView']['set']({'label':i(_0x4413c5,'AI\x20Commands'),'icon':T}),_0x5ebf96['bind']('isEnabled')['to'](_0x1810e9,'enabledCommandsIds',_0x23c990=>_0x23c990['length']>0x0);const _0x15ef7a=o(_0x460ca5['config']['get']('ai.aiAssistant.commands'),_0x4413c5);return this['_populateMenuBarMenu'](_0x1810e9,_0x5ebf96,_0x15ef7a,_0x500641=>this['_onExecute'](_0x500641)),_0x5ebf96;}),_0x460ca5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x5b5220=this['_createAIAssistantUIButton'](_0x52be94);return _0x5b5220['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x5b5220;}),_0x460ca5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4a98cf=this['_createAIAssistantUIButton'](_0x45d9f4);return _0x4a98cf['set']({'role':'menuitemcheckbox'}),_0x4a98cf;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x323b94=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x25a9d5;for(const _0x5d4221 in _0x323b94){const _0x4dd591=_0x5d4221,_0xd1f8a0=_0x323b94[_0x4dd591];if('aiLicenseKeyValid'==_0xd1f8a0||'aiLicenseKeyInvalid'==_0xd1f8a0||'aiLicenseKeyExpired'==_0xd1f8a0||'aiLicenseKeyDomainLimit'==_0xd1f8a0||'aiLicenseKeyNotAllowed'==_0xd1f8a0||'aiLicenseKeyEvaluationLimit'==_0xd1f8a0||'aiLicenseKeyTrialLimit'==_0xd1f8a0||'aiLicenseKeyUsageLimit'==_0xd1f8a0){delete _0x323b94[_0x4dd591],_0x25a9d5=_0xd1f8a0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x25a9d5&&_0x323b94['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x25a9d5&&_0x323b94['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x25a9d5&&_0x323b94['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x25a9d5&&_0x323b94['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x68f7ce='',_0x5e8010='',_0xc9bdad='custom'){const _0x108f91=this['editor'],_0x2078be=_0x108f91['editing']['view'],_0x7e434a=_0x108f91['plugins']['get'](a),_0x66af5b=_0x108f91['plugins']['get'](_0xc7e545);_0x7e434a['showFakeVisualSelection']();const _0x1b765d=new w(),_0x2c838e=new ClipboardEvent('copy',{'clipboardData':_0x1b765d}),_0x28fcd2=new _0x5e0b09(_0x1b765d),_0x286376=new _0x420495(_0x2078be,_0x2c838e,{'dataTransfer':_0x28fcd2});_0x66af5b['_forceMarkersCopy']('comment',()=>{_0x2078be['document']['fire']('copy',_0x286376);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x108f91,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x55ff74=_0x28fcd2['getData']('text/html');const _0x54bef7=_0x108f91['model']['document']['selection'],_0x4f6eb4=Array['from'](_0x54bef7['getRanges']());0x1===_0x4f6eb4['length']&&_0x4f6eb4[0x0]['isFlat']&&!_0x54bef7['getSelectedElement']()&&''!==_0x55ff74['replace'](/ /g,'')['trim']()&&(_0x55ff74='<p>'+_0x55ff74+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xc9bdad,'query':_0x68f7ce,'htmlContent':_0x55ff74,'label':_0x5e8010,'mainActionLabel':M[_0x108f91['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x2b3f98['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x7e434a['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x2a5d08=new Map(),_0x54a7db=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x473546 of _0x54a7db)for(const _0x3242bb of _0x473546['commands'])_0x2a5d08['set'](_0x3242bb['id'],{..._0x3242bb,'groupId':_0x473546['groupId'],'groupLabel':_0x473546['groupLabel']||_0x473546['groupId']});return _0x2a5d08;}['_createAIAssistantUIButton'](_0x801a6e){const _0x7f07bc=this['editor'],_0x34a481=_0x7f07bc['commands']['get']('showAIAssistant'),_0x48a734=new _0x801a6e(_0x7f07bc['locale']);return _0x48a734['set']({'label':i(_0x7f07bc['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x48a734['bind']('isEnabled')['to'](_0x34a481),_0x48a734['bind']('isOn')['to'](this['_dialog'],'id',_0x395976=>'aiAssistant'===_0x395976),this['listenTo'](_0x48a734,'execute',()=>{_0x48a734['isOn']?this['hideUI']():_0x34a481['execute']();}),_0x48a734;}['_initView'](){const _0x24e890=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',()=>{_0x24e890['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x24e890['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x383fd3,ui:{ariaLiveAnnouncer:_0x4c8fe8}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1401f8,_0x5f28ad,_0x599f65)=>{const _0x2a1b2f=this['_aiAssistantController']['currentContext'];_0x599f65?_0x4c8fe8['announce'](i(_0x383fd3,'AI\x20is\x20writing')):_0x2a1b2f&&_0x4c8fe8['announce'](i(_0x383fd3,'Generated\x20content:\x20%0',_0x2a1b2f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0xeedce2,_0x26ec9a,_0x48d377)=>{if(_0x48d377){const _0x2f29ee=this['_formView']['errorView']['text'];_0x4c8fe8['announce'](i(_0x383fd3,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2f29ee));}});}['_onExecute'](_0x4dc5f1){const _0x17bff5=this['_commandDefinitions']['get'](_0x4dc5f1),_0x595d78=this['editor'],_0x17bdec=_0x595d78['model']['document']['selection'],_0x3fa287=_0x595d78['commands']['get']('showAIAssistant'),_0x4f86fe=_0x595d78['plugins']['get'](a),_0x33dbf7=''+(_0x17bff5['groupId']!==x?_0x17bff5['groupLabel']+':\x20':'')+_0x17bff5['label'];if(!0x1!==_0x17bff5['requiresContent']&&_0x17bdec['isCollapsed']){const _0x6d4f47=_0x3309b6(_0x17bdec['getSelectedBlocks']())||_0x595d78['model']['schema']['getLimitElement'](_0x17bdec);_0x595d78['model']['change'](_0x5dde79=>{_0x5dde79['setSelection'](_0x6d4f47,'in');});}_0x4f86fe['showFakeVisualSelection'](),_0x3fa287['execute'](_0x17bff5['prompt'],_0x33dbf7,'command:'+_0x4dc5f1);}['_populateMenuBarMenu'](_0x32b2df,_0x558d27,_0x55f4ea,_0xcf7e22){const _0x237dd4=this['editor'],_0x39d4a5=_0x237dd4['locale'],_0x4930b2=new _0x3ba367(_0x39d4a5),_0x59489b=U(_0x237dd4,_0x55f4ea)['filter'](_0x15fe0f=>_0x15fe0f['commands']['length']);0x1===_0x59489b['length']?this['_getMenuBarGroupButtons']({'command':_0x32b2df,'commands':_0x59489b[0x0]['commands'],'parentMenuView':_0x558d27,'onExecute':_0xcf7e22})['forEach'](_0x269ea1=>_0x4930b2['items']['add'](_0x269ea1)):_0x59489b['forEach'](({groupId:_0x15fe4d,groupLabel:_0x433e24,commands:_0x19d4e3})=>{const _0x3a154e=new _0x94d296(_0x39d4a5,_0x558d27),_0xcde037=new _0x41ac76(_0x39d4a5),_0x1f4b15=new _0x3ba367(_0x39d4a5),_0x1602a8=this['_getMenuBarGroupButtons']({'command':_0x32b2df,'commands':_0x19d4e3,'parentMenuView':_0xcde037,'onExecute':_0xcf7e22});_0xcde037['buttonView']['set']({'label':_0x433e24||_0x15fe4d}),_0xcde037['delegate']('execute')['to'](_0x558d27),_0x1f4b15['items']['addMany'](_0x1602a8),_0xcde037['panelView']['children']['add'](_0x1f4b15),_0x3a154e['children']['add'](_0xcde037),_0x4930b2['items']['add'](_0x3a154e);}),_0x558d27['panelView']['children']['add'](_0x4930b2);}['_getMenuBarGroupButtons']({command:_0x5786ad,commands:_0x1d3d7e,parentMenuView:_0xa93041,onExecute:_0x1e29cd}){const _0x40c453=this['editor'],_0x440a92=_0x40c453['locale'];return U(_0x40c453,_0x1d3d7e)['map'](_0x4227e7=>{const _0x5890be=new _0x94d296(_0x440a92,_0xa93041),_0x1957f4=new _0x45d9f4(_0x440a92);return _0x1957f4['set']({'label':_0x4227e7['label']}),_0x1957f4['delegate']('execute')['to'](_0xa93041),_0x1957f4['on']('execute',()=>_0x1e29cd(_0x4227e7['id'])),_0x1957f4['bind']('isEnabled')['to'](_0x5786ad,'enabledCommandsIds',_0x3201d9=>_0x3201d9['includes'](_0x4227e7['id'])),_0x5890be['children']['add'](_0x1957f4),_0x5890be;});}}function B(_0xdc0e3b,_0x494868){return void 0x0!==_0xdc0e3b['order']&&void 0x0===_0x494868['order']?0x1:void 0x0===_0xdc0e3b['order']&&void 0x0!==_0x494868['order']?-0x1:void 0x0!==_0xdc0e3b['order']&&void 0x0!==_0x494868['order']?_0xdc0e3b['order']-_0x494868['order']:0x0;}function U(_0x246d89,_0x598d23){_0x598d23['sort'](B);const _0x532b56={},_0x2abdc8=[];for(const _0x4dd4ce of _0x598d23)if(void 0x0!==_0x4dd4ce['order']){if(_0x4dd4ce['order']in _0x532b56)throw new _0x1a9453('ai-commands-config-order-collision',_0x246d89,{'conflictingDefinitions':[_0x4dd4ce,_0x532b56[_0x4dd4ce['order']]]});_0x532b56[_0x4dd4ce['order']]=_0x4dd4ce,_0x2abdc8['splice'](_0x4dd4ce['order'],0x0,_0x4dd4ce);}else _0x2abdc8['push'](_0x4dd4ce);return _0x2abdc8;}class r extends _0x2bfdda{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x427996){super(_0x427996);const _0x4f2cfc=_0x427996['config'],_0x5b0672=_0x427996['locale'];_0x4f2cfc['define']('ai.aiAssistant.preserveComments',!0x0),_0x4f2cfc['define']('ai.aiAssistant.commands',function(_0x13fb4d){return[{'groupId':'editOrReview','groupLabel':i(_0x13fb4d,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x13fb4d,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x13fb4d,'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(_0x13fb4d,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x13fb4d,'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(_0x13fb4d,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x13fb4d,'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(_0x13fb4d,'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(_0x13fb4d,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x13fb4d,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x13fb4d,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x13fb4d,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x13fb4d,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x13fb4d,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x13fb4d,'Change\x20style'),'commands':[{'id':'business','label':i(_0x13fb4d,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x13fb4d,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x13fb4d,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x13fb4d,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x13fb4d,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x13fb4d,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x13fb4d,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x13fb4d,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x13fb4d,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x13fb4d,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x13fb4d,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x13fb4d,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x13fb4d,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x5b0672)),_0x4f2cfc['define']('ai.aiAssistant.extraCommandGroups',[]),_0x4f2cfc['define']('ai.aiAssistant.removeCommands',[]);let _0x59525e=o(_0x4f2cfc['get']('ai.aiAssistant.commands'),_0x5b0672);const _0x5a12e7=_0x4f2cfc['get']('ai.aiAssistant.extraCommandGroups'),_0x414f85=_0x4f2cfc['get']('ai.aiAssistant.removeCommands');_0x5a12e7['forEach'](_0x4a8e13=>{const _0x530f0d=_0x59525e['find'](_0xac3d83=>_0xac3d83['groupId']===_0x4a8e13['groupId']);_0x530f0d?_0x530f0d['commands']=_0x530f0d['commands']['concat'](_0x4a8e13['commands']):_0x59525e['push'](_0x4a8e13);}),_0x59525e=_0x59525e['filter'](_0x1b4cba=>!_0x414f85['includes'](_0x1b4cba['groupId'])),_0x59525e['forEach'](_0x1cbf4f=>{_0x1cbf4f['commands']=_0x1cbf4f['commands']['filter'](_0x3dbfe0=>!_0x414f85['includes'](_0x3dbfe0['id']));}),_0x4f2cfc['set']('ai.aiAssistant.commands',_0x59525e);}}class P extends _0x2bfdda{['abortController'];static get['requires'](){return[K];}constructor(_0x44a3a3){super(_0x44a3a3),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x104b7b){return this['sendRequest'](_0x104b7b)['catch'](_0x1b407e=>{if(_0x1b407e instanceof R)return Promise['reject'](_0x1b407e);if('AbortError'==_0x1b407e['name'])return Promise['resolve']();throw console['error'](_0x1b407e),new _0x1a9453('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x57e0a0,_0x1b6ec7){const _0x2b3b3e=this['editor']['locale'],_0x14c88b={'Content-Type':'application/json'};if('object'==typeof _0x57e0a0)Object['assign'](_0x14c88b,_0x57e0a0);else{if(_0x57e0a0)try{const _0x3d311f=await _0x57e0a0(_0x1b6ec7);Object['assign'](_0x14c88b,_0x3d311f);}catch(_0x415bde){return Promise['reject'](new R(i(_0x2b3b3e,'AI_ERROR_GET_HEADERS')));}}return _0x14c88b;}async['_prepareRequestParameters'](_0x529dc8,_0x4c60d1){const _0x4006b6=this['editor']['locale'];if('object'==typeof _0x529dc8)return _0x529dc8;try{return await _0x529dc8(_0x4c60d1);}catch(_0x30e1b4){return Promise['reject'](new R(i(_0x4006b6,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x49e183){super(_0x49e183),_0x49e183['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x49e183['config']['get']('ai.openAI.requestParameters')||_0x49e183['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x49e183['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x49e183['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x49e183['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x5e020d,context:_0x594d31,onData:_0x4901af,actionId:_0xf025a7}){const _0x4d5329=this['editor']['locale'],_0x31b3ea=await this['prepareMessages'](_0x5e020d,_0x594d31,_0xf025a7),_0x1c97a5=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xf025a7),_0x12ac3b=await this['_prepareRequestParameters'](this['_requestParameters'],_0xf025a7),_0x4a086a={'messages':_0x31b3ea,..._0x12ac3b},_0x3c76be={'method':'POST','headers':_0x1c97a5,'body':JSON['stringify'](_0x4a086a),'signal':this['abortController']['signal']},_0x34bc02=await fetch(this['_apiUrl'],_0x3c76be);if(_0x34bc02['ok'])return _0x12ac3b['stream']?await this['_readStreamableResponse'](_0x34bc02,_0x4901af):await this['_readStaticResponse'](_0x34bc02,_0x4901af),Promise['resolve']();{const _0x1a1068=await _0x34bc02['text']();return _0x1a1068['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4d5329,'AI_ERROR_CONTEXT_LENGTH'))):_0x1a1068['includes']('Moderation')?Promise['reject'](new R(i(_0x4d5329,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1a1068));}}async['prepareMessages'](_0x4c5cd2,_0x557d16,_0x5b29e1){let _0x4c3b1a,_0x52da8b;return _0x557d16?(_0x4c3b1a='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.',_0x52da8b='Instruction:\x0a'+_0x4c5cd2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x557d16):(_0x4c3b1a='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.',_0x52da8b=_0x4c5cd2),[{'role':'system','content':_0x4c3b1a},{'role':'user','content':_0x52da8b}];}async['_readStreamableResponse'](_0x40f825,_0x3fae05){const _0x205e70=_0x40f825['body']['getReader'](),_0x46b3f7=new TextDecoder();let _0x221b5b='',_0x4b3a15='',_0x4e8c8a='',_0x4323ea=!0x1;for(;!_0x4323ea;){const {done:_0x3aa35b,value:_0x1e7ba1}=await _0x205e70['read'](),_0x172197=_0x221b5b+_0x46b3f7['decode'](_0x1e7ba1);let _0x1b623b='';_0x4323ea=_0x3aa35b;try{_0x1b623b=this['_cleanUpData'](_0x172197),_0x221b5b='';}catch(_0x33985a){_0x221b5b=_0x172197;continue;}_0x4b3a15+=_0x1b623b,!_0x4323ea&&this['_isBufferIncomplete'](_0x4b3a15)||_0x4b3a15&&(_0x4e8c8a+=_0x4b3a15,_0x4b3a15='',_0x3fae05(_0x4e8c8a));}return Promise['resolve']();}async['_readStaticResponse'](_0x534235,_0x2828a6){return _0x2828a6((await _0x534235['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x1ad960){const _0x507367=_0x1ad960['split']('<')['length']!==_0x1ad960['split']('>')['length'],_0x5871e9=_0x1ad960['length']<0x1e;return _0x507367&&_0x5871e9;}['_cleanUpData'](_0x5c1405){return _0x5c1405['split'](/\n(?![^{]*\})/g)['map'](_0x74ad60=>_0x74ad60['replace']('data:\x20',''))['filter'](_0x15be39=>_0x15be39&&_0x15be39['length']>0x0&&'[DONE]'!==_0x15be39)['map'](_0x267a95=>{const {choices:_0x26ab89}=JSON['parse'](_0x267a95);if(_0x26ab89[0x0]&&_0x26ab89[0x0]['delta']&&_0x26ab89[0x0]['delta']['content'])return _0x26ab89[0x0]['delta']['content'];})['filter'](_0x9386bd=>_0x9386bd)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x3484e5){super(_0x3484e5),_0x3484e5['config']['get']('ai.aws.requestParameters')||_0x3484e5['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']=_0x3484e5['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x3484e5['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x3484e5['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x3484e5['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x1ef7ef,context:_0x4880d0,onData:_0x3d78e,actionId:_0x269165}){const {model:_0x4a0377,stream:_0x20f29a,..._0x1ed41e}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x269165),_0xfe5477={'prompt':await this['preparePrompt'](_0x1ef7ef,_0x4880d0,_0x4a0377,_0x269165),..._0x1ed41e};this['_apiUrl']?await this['_processProxyRequest'](_0xfe5477,_0x4a0377,_0x20f29a,_0x3d78e,_0x269165):await this['_processAWSRequest'](_0xfe5477,_0x4a0377,_0x20f29a,_0x3d78e);}async['preparePrompt'](_0x2f34df,_0x329ea0,_0x157b5a,_0x34de08){let _0x40457e,_0x45959e;return _0x329ea0?(_0x40457e='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.',_0x45959e='Instruction:\x0a'+_0x2f34df+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x329ea0):(_0x40457e='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.',_0x45959e=_0x2f34df),'meta.llama'==this['getModelFamily'](_0x157b5a)?'<<SYS>>\x0a'+_0x40457e+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x45959e+'\x0a[/INST]':'Human:\x0a'+_0x40457e+'\x0a'+_0x45959e+'\x0a\x0aAssistant:';}['getModelFamily'](_0x4725d2){if(/^anthropic\.claude/['test'](_0x4725d2))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x4725d2))return'ai21.j2';if(/^cohere\.command/['test'](_0x4725d2))return'cohere.command';if(/^meta\.llama/['test'](_0x4725d2))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x4725d2));}async['_processProxyRequest'](_0x32e8fa,_0x27f442,_0x2060b8,_0x5b9bcc,_0x3aa4e8){const _0x1fc8bb={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3aa4e8),'body':JSON['stringify']({..._0x32e8fa,'model':_0x27f442,'stream':_0x2060b8}),'signal':this['abortController']['signal']},_0x314538=await fetch(this['_apiUrl'],_0x1fc8bb);_0x2060b8?await this['_readStreamableResponse'](_0x314538,_0x27f442,_0x5b9bcc):await this['_readStaticResponse'](_0x314538,_0x27f442,_0x5b9bcc);}async['_processAWSRequest'](_0x5326ee,_0x252571,_0x4a23f5,_0x247fb9){const _0x4e30c7=new _0x28658d(this['_bedrockClientConfig']),_0x43fc87={'body':JSON['stringify'](_0x5326ee),'contentType':'application/json','accept':'application/json','modelId':_0x252571};let _0x45c137;if(_0x4a23f5){const _0x19dac3=new _0x2e0fcc(_0x43fc87);_0x45c137=await _0x4e30c7['send'](_0x19dac3,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x45c137,_0x252571,_0x247fb9);}else{const _0x18a710=new _0x56d5fb(_0x43fc87);_0x45c137=await _0x4e30c7['send'](_0x18a710,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x45c137,_0x252571,_0x247fb9);}}async['_readAsyncIterableResponse'](_0x449f6c,_0x4eec4e,_0x303f8d){const _0xbccc30=_0x449f6c['body'],_0x4960f1=new TextDecoder('utf-8');let _0x50aaeb='';for await(const _0x2c74aa of _0xbccc30)if(_0x2c74aa['chunk']){const _0x305fb=_0x4960f1['decode'](_0x2c74aa['chunk']['bytes']),_0x432756=JSON['parse'](_0x305fb);_0x50aaeb+=this['_getGeneratedText'](_0x432756,_0x4eec4e),_0x303f8d(_0x50aaeb);}return Promise['resolve']();}async['_readStreamableResponse'](_0x1fbb54,_0x274d9b,_0x303282){const _0x13c638=_0x1fbb54['body'],_0x41b42b=new TextDecoder('utf-8'),_0x2eecd9=_0x13c638['getReader']();let _0x3f2347='',_0x367f46='',_0x37c5da=!0x1;for(;!_0x37c5da;){const {done:_0x1f4e0f,value:_0x3b5347}=await _0x2eecd9['read']();if(_0x37c5da=_0x1f4e0f,_0x37c5da)break;const _0x384f8e=(_0x3f2347+_0x41b42b['decode'](_0x3b5347))['split']('\x0a')['map'](_0x5cbbd1=>{try{return _0x3f2347='',JSON['parse'](_0x5cbbd1);}catch(_0x5d1847){return _0x3f2347=_0x5cbbd1,null;}})['filter'](_0x4074b1=>null!==_0x4074b1);_0x384f8e['length']&&(_0x367f46+=_0x384f8e['map'](_0x3e47cf=>this['_getGeneratedText'](_0x3e47cf,_0x274d9b))['join'](''),_0x303282(_0x367f46));}return Promise['resolve']();}async['_readStaticResponse'](_0x145b16,_0x1270a4,_0xb54fdd){let _0x28009a;return _0x28009a=_0x145b16 instanceof Response?await _0x145b16['json']():JSON['parse'](Buffer['from'](_0x145b16['body'])['toString']('utf8')),(_0xb54fdd(this['_getGeneratedText'](_0x28009a,_0x1270a4)),Promise['resolve']());}['_getGeneratedText'](_0x41cfb2,_0x1a8690){switch(this['getModelFamily'](_0x1a8690)){case'anthropic.claude':return _0x41cfb2['completion'];case'ai21.j2':return _0x41cfb2['completions'][0x0]['data']['text'];case'cohere.command':return _0x41cfb2['generations'][0x0]['text'];case'meta.llama':return _0x41cfb2['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x168661,Command as _0x35ac5d,icons as _0x333562}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x56b11d,CKEditorError as _0x398ace,ObservableMixin as _0x2790c7,global as _0x5b9a8c,isVisible as it,Rect as st,Collection as _0x4aa76a,FocusTracker as _0x430094,KeystrokeHandler as ts,first as _0x193f29}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x199d88,View as _0x4e48f5,SpinnerView as _0x5a4df3,IconView as _0x544509,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0xb5146e,ButtonLabelView as te,FocusCycler as _0x43557f,createLabeledTextarea as _0x158201,Dialog as _0x444672,createDropdown as _0x492dc9,addMenuToDropdown as _0x551bc4,MenuBarMenuView as _0x5aa9c6,MenuBarMenuListItemButtonView as _0x1a42ca,DialogViewPosition as _0x279bd1,MenuBarMenuListView as _0x558ef1,MenuBarMenuListItemView as _0x448066}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x596e08,ClipboardMarkersUtils as _0x2f192a}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0xa654a1,DataTransfer as _0x1a7d11,UpcastWriter as _0x181f34,Matcher as _0x41b47d}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x5a21fa,escape as _0x510345}from'lodash-es';import{BedrockRuntimeClient as _0x331464,InvokeModelWithResponseStreamCommand as _0x37025e,InvokeModelCommand as _0x479582}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x4e1e11,_0x3f955a){const _0x420f40=(0x0,_0x3f955a['t'])('Other');return _0x4e1e11['length']?'groupId'in _0x4e1e11[0x0]?_0x4e1e11:[{'groupId':x,'groupLabel':_0x420f40,'order':0x1/0x0,'commands':_0x4e1e11}]:[{'groupId':x,'groupLabel':_0x420f40,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x168661{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x21368f}=this,_0x88e0d1=['ck-fake-ai-selection'];_0x21368f['config']['get']('ai.useTheme')&&_0x88e0d1['push']('ck-ai-assistant-ui_theme'),_0x21368f['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x88e0d1,'priority':0xc}}),_0x21368f['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x272df0,{writer:_0x28ab7d})=>{if(!_0x272df0['markerRange']['isCollapsed'])return null;const _0x311360=_0x28ab7d['createUIElement']('span');return _0x28ab7d['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x311360),_0x311360;}});}['afterInit'](){!async function(_0x1b3440){const _0x2a48a8=_0x596725([0x4d,0x78,0x65,0x46,0x53,0x62,0x56,0x55,0x41,0x33,0x70,0x36,0x63,0x66,0x74,0x6d,0x68,0x4f,0x49,0x4c,0x72,0x35,0x32,0x69,0x76,0x6a,0x34,0x48,0x71,0x58,0x6f,0x6e,0x37,0x39,0x67,0x73,0x4e,0x50,0x77,0x4b,0x5a,0x61,0x42,0x47,0x44,0x4a,0x38,0x30,0x54,0x45,0x57,0x43,0x79,0x59,0x52,0x7a,0x51,0x6b,0x6c,0x64,0x75,0x31]),_0x33de54=0x3cfc86f2,_0x37ffe9=0x3cfbe612^_0x33de54,_0xeaeeed=window[_0x596725([0x44,0x61,0x74,0x65])][_0x596725([0x6e,0x6f,0x77])](),_0xc4a562=_0x1b3440[_0x596725([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xa74894=new window[(_0x596725([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x206ff0=>{_0xc4a562[_0x596725([0x6f,0x6e,0x63,0x65])](_0x596725([0x72,0x65,0x61,0x64,0x79]),_0x206ff0);}),_0x1a1cec={[_0x596725([0x6b,0x74,0x79])]:_0x596725([0x45,0x43]),[_0x596725([0x75,0x73,0x65])]:_0x596725([0x73,0x69,0x67]),[_0x596725([0x63,0x72,0x76])]:_0x596725([0x50,0x2d,0x32,0x35,0x36]),[_0x596725([0x78])]:_0x596725([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]),[_0x596725([0x79])]:_0x596725([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]),[_0x596725([0x61,0x6c,0x67])]:_0x596725([0x45,0x53,0x32,0x35,0x36])},_0x2bbe9f=_0xc4a562[_0x596725([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x596725([0x67,0x65,0x74])](_0x596725([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1e946(){let _0x41d5a2,_0x1f50e1=null,_0x16fbe9=null;try{if(_0x2bbe9f==_0x596725([0x47,0x50,0x4c]))return _0x596725([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x41d5a2=_0x59cf20(),!_0x41d5a2)return _0x596725([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x41d5a2[_0x596725([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x16fbe9=_0x3e8826(_0x41d5a2[_0x596725([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x41d5a2[_0x596725([0x6a,0x74,0x69])])),await _0x687d92()?_0x563438()?_0x5a96b7()?_0x596725([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1d90a3()?(_0x41d5a2[_0x596725([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x596725([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x1f50e1=_0x153d3b(_0x596725([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x41d5a2[_0x596725([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x596725([0x74,0x72,0x69,0x61,0x6c])&&(_0x1f50e1=_0x153d3b(_0x596725([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2ecd80()):_0x596725([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x596725([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x596725([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x347e95){return _0x596725([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5a96b7(){const _0x20f948=[_0x596725([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x596725([0x74,0x72,0x69,0x61,0x6c])][_0x596725([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x41d5a2[_0x596725([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xeaeeed/0x3e8:0xe10*_0x37ffe9;return _0x41d5a2[_0x596725([0x65,0x78,0x70])]<_0x20f948;}function _0x563438(){const _0x1e7d3b=_0x41d5a2[_0x596725([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1e7d3b&&(!!_0x1e7d3b[_0x596725([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x596725([0x2a]))||!!_0x1e7d3b[_0x596725([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x596725([0x41,0x49])));}function _0x1d90a3(){const _0x5586b2=_0x41d5a2[_0x596725([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5586b2||0x0==_0x5586b2[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x26bdba}=new URL(window[_0x596725([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5586b2[_0x596725([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x26bdba))return!0x0;const _0x53db16=_0x26bdba[_0x596725([0x73,0x70,0x6c,0x69,0x74])](_0x596725([0x2e]));return _0x5586b2[_0x596725([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3dc45e=>_0x3dc45e[_0x596725([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x596725([0x2a])))[_0x596725([0x6d,0x61,0x70])](_0xbc34e5=>_0xbc34e5[_0x596725([0x73,0x70,0x6c,0x69,0x74])](_0x596725([0x2e])))[_0x596725([0x73,0x6f,0x6d,0x65])](_0x21f02d=>_0x53db16[_0x596725([0x65,0x76,0x65,0x72,0x79])]((_0x16084b,_0x2ae400)=>_0x21f02d[_0x2ae400]===_0x16084b||_0x21f02d[_0x2ae400]===_0x596725([0x2a])));}function _0x2ecd80(){return _0x1f50e1&&_0x16fbe9?new window[(_0x596725([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x2cb139,_0x1065b3)=>{_0x1f50e1[_0x596725([0x74,0x68,0x65,0x6e])](_0x2cb139,_0x1065b3),_0x16fbe9[_0x596725([0x74,0x68,0x65,0x6e])](_0xa0b26e=>{_0xa0b26e!=_0x596725([0x56,0x61,0x6c,0x69,0x64])&&_0x2cb139(_0xa0b26e);},_0x1065b3);}):_0x1f50e1||_0x16fbe9||_0x596725([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3e8826(_0x5374e9,_0x277282){return new window[(_0x596725([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4ea528=>{if(_0x42d8d8())return _0x4ea528(_0x596725([0x56,0x61,0x6c,0x69,0x64]));_0x2112c0(),_0xc4a562[_0x596725([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x596725([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xf72ab0=!0x1;const _0x438e9f=_0x56b11d();function _0x50f656(_0x128aa4){return!!_0x128aa4&&(typeof _0x128aa4===_0x596725([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x128aa4===_0x596725([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x128aa4[_0x596725([0x74,0x68,0x65,0x6e])]===_0x596725([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x128aa4[_0x596725([0x63,0x61,0x74,0x63,0x68])]===_0x596725([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x376174(_0x37d357){_0x1b5088(_0x37d357)[_0x596725([0x74,0x68,0x65,0x6e])](_0x4ac56e=>{if(!_0x4ac56e||_0x4ac56e[_0x596725([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x596725([0x6f,0x6b]))return _0x596725([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3a548f(_0x3e736f(_0x438e9f+_0x277282))!=_0x4ac56e[_0x596725([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x596725([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x596725([0x56,0x61,0x6c,0x69,0x64]);})[_0x596725([0x74,0x68,0x65,0x6e])](_0x2cd182=>(_0x4f3547(),_0x2cd182),()=>{const _0xc9d09a=_0x2f4dc4();return null==_0xc9d09a?(_0x4f3547(),_0x596725([0x56,0x61,0x6c,0x69,0x64])):_0x596725(_0xeaeeed-_0xc9d09a>(0x18f002f2^_0x33de54)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x596725([0x74,0x68,0x65,0x6e])](_0x4ea528)[_0x596725([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4ea528(_0x596725([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5d3b3d=0x3cca6872^_0x33de54;function _0x4f3547(){const _0x37c9c8=_0x596725([0x6c,0x6c,0x63,0x74,0x2d])+_0x3a548f(_0x3e736f(_0x5374e9)),_0x44c738=_0x4917df(_0x3a548f(window[_0x596725([0x4d,0x61,0x74,0x68])][_0x596725([0x63,0x65,0x69,0x6c])](_0xeaeeed/_0x5d3b3d)));window[_0x596725([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x596725([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x37c9c8,_0x44c738);}function _0x2f4dc4(){const _0x3e9d1e=_0x596725([0x6c,0x6c,0x63,0x74,0x2d])+_0x3a548f(_0x3e736f(_0x5374e9)),_0x1435df=window[_0x596725([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x596725([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3e9d1e);return _0x1435df?window[_0x596725([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4917df(_0x1435df),0x10)*_0x5d3b3d:null;}function _0x1b5088(_0x39e865){return new window[(_0x596725([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1bca7f,_0x29450e)=>{_0x39e865[_0x596725([0x74,0x68,0x65,0x6e])](_0x1bca7f,_0x29450e),window[_0x596725([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x29450e,0x3cfd5232^_0x33de54);});}}_0xc4a562[_0x596725([0x6f,0x6e])](_0x596725([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x3910fc,_0x5b5565)=>{if(_0x5b5565[0x0]!=_0x5374e9)return _0x4ea528(_0x596725([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5b5565[0x1]={..._0x5b5565[0x1],[_0x596725([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x438e9f};},{[_0x596725([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x596725([0x68,0x69,0x67,0x68])}),_0xc4a562[_0x596725([0x6f,0x6e])](_0x596725([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4fc48b=>{_0x50f656(_0x4fc48b[_0x596725([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xf72ab0=!0x0,_0x376174(_0x4fc48b[_0x596725([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x596725([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x596725([0x6c,0x6f,0x77])}),_0xa74894[_0x596725([0x74,0x68,0x65,0x6e])](()=>{_0xf72ab0||_0x4ea528(_0x596725([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x42d8d8(){return _0xc4a562[_0x596725([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x596725([0x76,0x69,0x65,0x77])][_0x596725([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x596725([0x61,0x75,0x74,0x6f]);}function _0x2112c0(){_0xc4a562[_0x596725([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x596725([0x76,0x69,0x65,0x77])][_0x596725([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x596725([0x61,0x75,0x74,0x6f]);}}function _0x153d3b(_0x23bb9a){const _0x3efa90=[new window[(_0x596725([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x137ea5=>setTimeout(_0x137ea5,0x3cf5b83e^_0x33de54)),_0xa74894[_0x596725([0x74,0x68,0x65,0x6e])](()=>new window[(_0x596725([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15593f=>{let _0x4ed854=0x0;_0xc4a562[_0x596725([0x6d,0x6f,0x64,0x65,0x6c])][_0x596725([0x6f,0x6e])](_0x596725([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xb18f72,_0x46e7ac)=>{_0x46e7ac[0x0][_0x596725([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4ed854++,_0x4ed854==(0x3cfc870a^_0x33de54)&&(_0x15593f(),_0xb18f72[_0x596725([0x6f,0x66,0x66])]());});}))];return window[_0x596725([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x596725([0x72,0x61,0x63,0x65])](_0x3efa90)[_0x596725([0x74,0x68,0x65,0x6e])](()=>_0x23bb9a);}async function _0x5a4e96(){await _0xa74894,_0xc4a562[_0x596725([0x6d,0x6f,0x64,0x65,0x6c])][_0x596725([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x3eccc9,_0xc4a562[_0x596725([0x6d,0x6f,0x64,0x65,0x6c])][_0x596725([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x3eccc9,_0xc4a562[_0x596725([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x596725([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x27f602(_0x3a667a){const _0x34012c=_0x3f2d4d();_0xc4a562[_0x34012c]=_0x596725([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x3a667a,_0x3a667a!=_0x596725([0x56,0x61,0x6c,0x69,0x64])&&_0x5a4e96();}function _0x3f2d4d(){const _0x587c92=window[_0x596725([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x596725([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x596725([0x6e,0x6f,0x77])]())[_0x596725([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x596725([0x2e]),'');let _0x3fe099=_0x596725([0x4d]);for(let _0x5bf2db=0x0;_0x5bf2db<_0x587c92[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5bf2db+=0x2){let _0x4bc702=window[_0x596725([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x587c92[_0x596725([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5bf2db,_0x5bf2db+0x2));_0x4bc702>=_0x2a48a8[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4bc702-=_0x2a48a8[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3fe099+=_0x2a48a8[_0x4bc702];}return _0x3fe099;}function _0x59cf20(){const _0x2a4d93=_0x2bbe9f[_0x596725([0x73,0x70,0x6c,0x69,0x74])](_0x596725([0x2e]));if(0x3!=_0x2a4d93[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1bc87c(_0x2a4d93[0x1]);function _0x1bc87c(_0x3fafd4){const _0x2eee84=_0x149121(_0x3fafd4);return _0x2eee84&&_0x29fba1()?_0x2eee84:null;function _0x29fba1(){const _0x4fd097=_0x2eee84[_0x596725([0x6a,0x74,0x69])],_0x10e484=window[_0x596725([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4fd097[_0x596725([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4fd097[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0xe498ce={..._0x2eee84,[_0x596725([0x6a,0x74,0x69])]:_0x4fd097[_0x596725([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4fd097[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0xe498ce[_0x596725([0x76,0x63])],_0x3e736f(_0xe498ce)==_0x10e484;}}}async function _0x687d92(){let _0x39ae31=!0x0;try{const _0x2c6614=_0x2bbe9f[_0x596725([0x73,0x70,0x6c,0x69,0x74])](_0x596725([0x2e])),[_0x4cb553,_0x5a6ac8,_0x594d9f]=_0x2c6614;return _0x47fac7(_0x4cb553),await _0x2a425(_0x4cb553,_0x5a6ac8,_0x594d9f),_0x39ae31;}catch(_0x2c365c){return!0x1;}function _0x47fac7(_0x3520ae){const _0x14b516=_0x149121(_0x3520ae);_0x14b516&&_0x14b516[_0x596725([0x61,0x6c,0x67])]==_0x596725([0x45,0x53,0x32,0x35,0x36])||(_0x39ae31=!0x1);}async function _0x2a425(_0x32beb2,_0x2e17b7,_0x54f569){const _0x2455c4=window[_0x596725([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x596725([0x66,0x72,0x6f,0x6d])](_0x1f925b(_0x54f569),_0x4f5e62=>_0x4f5e62[_0x596725([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x253ea7=new window[(_0x596725([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x596725([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x32beb2+_0x596725([0x2e])+_0x2e17b7),_0x3fdaac=window[_0x596725([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x596725([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x3fdaac)return;const _0x1c161d=await _0x3fdaac[_0x596725([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x596725([0x6a,0x77,0x6b]),_0x1a1cec,{[_0x596725([0x6e,0x61,0x6d,0x65])]:_0x596725([0x45,0x43,0x44,0x53,0x41]),[_0x596725([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x596725([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x596725([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x3fdaac[_0x596725([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x596725([0x6e,0x61,0x6d,0x65])]:_0x596725([0x45,0x43,0x44,0x53,0x41]),[_0x596725([0x68,0x61,0x73,0x68])]:{[_0x596725([0x6e,0x61,0x6d,0x65])]:_0x596725([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1c161d,_0x2455c4,_0x253ea7)||(_0x39ae31=!0x1);}}function _0x149121(_0x449e4b){return _0x449e4b[_0x596725([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x596725([0x65,0x79]))?JSON[_0x596725([0x70,0x61,0x72,0x73,0x65])](_0x1f925b(_0x449e4b)):null;}function _0x1f925b(_0x3403fe){return window[_0x596725([0x61,0x74,0x6f,0x62])](_0x3403fe[_0x596725([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x596725([0x2b]))[_0x596725([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x596725([0x2f])));}function _0x3e736f(_0x884294){let _0x54b75e=0x1505;function _0x1b1156(_0x2b09c9){for(let _0x4f91ce=0x0;_0x4f91ce<_0x2b09c9[_0x596725([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4f91ce++){const _0x559944=_0x2b09c9[_0x596725([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4f91ce);_0x54b75e=(_0x54b75e<<0x5)+_0x54b75e+_0x559944,_0x54b75e&=_0x54b75e;}}function _0x1a57c9(_0x270463){Array[_0x596725([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x270463)?_0x270463[_0x596725([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1a57c9):_0x270463&&typeof _0x270463==_0x596725([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x596725([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x270463)[_0x596725([0x73,0x6f,0x72,0x74])]()[_0x596725([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x1b158a,_0x336562])=>{_0x1b1156(_0x1b158a),_0x1a57c9(_0x336562);}):_0x1b1156(window[_0x596725([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x270463));}return _0x1a57c9(_0x884294),_0x54b75e>>>0x0;}function _0x3a548f(_0x677e1){return _0x677e1[_0x596725([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x596725([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x596725([0x30]));}function _0x4917df(_0x362c18){return _0x362c18[_0x596725([0x73,0x70,0x6c,0x69,0x74])]('')[_0x596725([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x596725([0x6a,0x6f,0x69,0x6e])]('');}function _0x3eccc9(){}function _0x596725(_0xf9da3a){return _0xf9da3a['map'](_0x439faf=>String['fromCharCode'](_0x439faf))['join']('');}_0x27f602(await _0x1e946());}(this);}['showFakeVisualSelection'](){const _0x1fa551=this['editor']['model'];_0x1fa551['change'](_0x1e5a85=>{const _0x4c900b=_0x1fa551['document']['selection']['getRanges']();let _0x198742=0x0;for(const _0x4bb71d of _0x4c900b){const _0x2755c3=f+':'+_0x198742;if(_0x1fa551['markers']['has'](_0x2755c3))_0x1e5a85['updateMarker'](_0x2755c3,{'range':_0x4bb71d});else{if(_0x4bb71d['start']['isAtEnd']){const _0xeca8ee=_0x4bb71d['start']['getLastMatchingPosition'](({item:_0x2ba1ad})=>!_0x1fa551['schema']['isContent'](_0x2ba1ad),{'boundaries':_0x4bb71d});_0x1e5a85['addMarker'](_0x2755c3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1e5a85['createRange'](_0xeca8ee,_0x4bb71d['end'])});}else _0x1e5a85['addMarker'](_0x2755c3,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4bb71d});}_0x198742++;}});}['hideFakeVisualSelection'](){const _0x2e6999=this['editor']['model'],_0x3858a0=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x3858a0['length']&&_0x2e6999['change'](_0x11a4f3=>{_0x3858a0['forEach'](_0x942a1a=>{_0x11a4f3['removeMarker'](_0x942a1a);});});}['insertContent'](_0x4dc770,_0x166fe1){const _0x436b6d=this['_getAISelection'](),_0x20c494=_0x166fe1||_0x436b6d['getFirstRange']();this['editor']['model']['canEditAt'](_0x20c494)&&this['editor']['model']['change'](_0x26b397=>{this['hideFakeVisualSelection'](),_0x166fe1||this['_resetContentOfSelectedTableCells'](_0x26b397,_0x436b6d),this['_pasteHTMLUsingClipboard']({'insertAt':_0x20c494,'writer':_0x26b397,'html':_0x4dc770});});}['insertContentBelow'](_0x44dbe9){const {model:_0x4bdcc5}=this['editor'],_0x34a955=this['_getAISelection']();_0x4bdcc5['change'](()=>{const _0xb5b94b=this['_prepareTableInsertBelowPosition'](_0x44dbe9,_0x34a955)||this['_getDefaultInsertBelowPosition'](_0x34a955);this['insertContent'](_0x44dbe9,_0xb5b94b);});}['_getAISelection'](){const _0x36ed6a=this['editor']['model'],_0x453867=Array['from'](_0x36ed6a['markers']['getMarkersGroup'](f))['map'](_0x367c91=>_0x367c91['getRange']());return _0x36ed6a['createSelection'](_0x453867);}['_pasteHTMLUsingClipboard']({writer:_0x4f1b4f,html:_0x56fe88,insertAt:_0x5bdd5f}){const {view:_0x4820dc}=this['editor']['editing'],_0x10106e=this['editor']['plugins']['get'](_0x596e08),_0x3783f3=new dt();_0x3783f3['setData']('text/html',_0x56fe88);const _0x74fa94=new ClipboardEvent('paste',{'clipboardData':_0x3783f3}),_0xd04777=new _0xa654a1(_0x4820dc,_0x74fa94,{'dataTransfer':new _0x1a7d11(_0x3783f3)});_0x4f1b4f['setSelection'](_0x5bdd5f);const _0x51960d=(_0x989474,_0x359083)=>{_0x359083['resultRange']&&_0x4f1b4f['setSelection'](_0x359083['resultRange']);};_0x10106e['once']('contentInsertion',_0x51960d,{'priority':'lowest'}),_0x4820dc['document']['fire']('paste',_0xd04777),_0x10106e['off']('contentInsertion',_0x51960d);}['_getDefaultInsertBelowPosition'](_0x166eb8){const {model:_0x5064c0}=this['editor'],_0x33101e=Array['from'](_0x166eb8['getSelectedBlocks']());return _0x33101e['length']?_0x5064c0['createPositionAfter'](_0x33101e['pop']()):_0x166eb8['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x248523,_0x12cee5){const {model:_0x5a210a,plugins:_0xedcd87}=this['editor'];if(_0xedcd87['has']('TableUtils')){const _0x2807d9=_0xedcd87['get']('TableUtils')['getSelectedTableCells'](_0x12cee5);if(_0x2807d9['length']){const _0x51f1da=this['_getTableRowCountFromContent'](_0x248523),_0x202cb2=this['_createEmptyTableRows'](_0x2807d9,_0x51f1da);return _0x5a210a['createPositionAt'](_0x202cb2,0x0);}}return null;}['_getTableRowCountFromContent'](_0x279698){const _0x105a77=this['editor']['plugins']['get']('TableUtils'),_0x1aaac7=this['editor']['data']['parse'](_0x279698),_0x218a3a=Array['from'](_0x1aaac7['getChildren']())['filter'](_0x41abbf=>_0x41abbf['is']('element','table'));let _0x1e18d5=0x0;return _0x218a3a['forEach'](_0x7be6d7=>{_0x1e18d5+=_0x105a77['getRows'](_0x7be6d7);}),_0x1e18d5;}['_createEmptyTableRows'](_0x2b954f,_0x16dc80){const _0x4640eb=this['editor']['plugins']['get']('TableUtils'),_0x44e89a=_0x4640eb['getRowIndexes'](_0x2b954f),_0x3201eb=_0x4640eb['getColumnIndexes'](_0x2b954f),_0x33badc=_0x44e89a['last']+0x1,_0x20a338=_0x3201eb['first'],_0x232816=_0x2b954f[0x0]['findAncestor']('table');for(let _0x1bff32=0x0;_0x1bff32<_0x16dc80;_0x1bff32++)_0x4640eb['insertRows'](_0x232816,{'at':_0x33badc});return _0x232816['getChild'](_0x33badc)['getChild'](_0x20a338);}['_resetContentOfSelectedTableCells'](_0x2bcd3e,_0x4edc62){const {plugins:_0x5b3c0b}=this['editor'],{model:_0x1df34c}=_0x2bcd3e;if(!_0x5b3c0b['has']('TableUtils'))return;_0x5b3c0b['get']('TableUtils')['getSelectedTableCells'](_0x4edc62)['length']&&_0x1df34c['deleteContent'](_0x4edc62);}}class K extends _0x168661{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x398ace('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x11667d){super(_0x11667d),this['name']='AIRequestError';}}function i(_0x33e749,_0x3e30fd,_0x45e44a){const t=_0x33e749['t'];switch(_0x3e30fd){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',_0x45e44a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x45e44a);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'},_0x45e44a);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 _0x3e30fd;}}class E extends _0x35ac5d{['_commandDefinitions'];constructor(_0x1e5b26,_0xfb5e4){super(_0x1e5b26),this['_commandDefinitions']=_0xfb5e4,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x544df3,_0x369ef5,_0x297e79)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x297e79));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0xfc4eb0,_0x5a7882,_0x398c80)=>{this['enabledCommandsIds']=_0x398c80?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x5a0eeb=this['editor']['model'];this['_hasContext']=function(_0x4dd1ff){const _0x4de8f5=_0x4dd1ff['document']['selection'];return _0x4de8f5['isCollapsed']?0x0!==[..._0x4de8f5['getSelectedBlocks']()]['length']&&![..._0x4de8f5['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4dd1ff['hasContent'](_0x4de8f5['getFirstRange']());}(_0x5a0eeb);const _0x3c99ad=_0x5a0eeb['document']['selection'],_0x341e74=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x30934f of _0x3c99ad['getRanges']())for(const _0x357048 of _0x30934f['getItems']())if(_0x357048['is']('element')&&_0x341e74['includes'](_0x357048['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x399d4b='',_0x4f16f3='',_0x516cec='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x399d4b,_0x4f16f3,_0x516cec);}}function G(_0x43c9bc,_0x3fa4e5){const _0x45b9ad=new Set();for(const _0x2e7690 of _0x43c9bc['values']())(_0x3fa4e5||!0x1===_0x2e7690['requiresContent'])&&_0x45b9ad['add'](_0x2e7690['id']);return Array['from'](_0x45b9ad);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x2790c7(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x49eb91,_0x2a205a,_0xeea4c9){super(),this['editor']=_0x49eb91,this['textAdapter']=_0x2a205a,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xeea4c9,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0xbfdc30,_0x2ee5b2,_0x488f0d)=>{this['view']['value']=this['_sanitizeHTML'](_0x488f0d);}),this['listenTo'](this['view'],'submitPrompt',(_0x48230f,_0x4b924b)=>{const _0x5a34f6=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4b924b,_0x5a34f6,'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:_0xdf298d,query:_0x12072e,htmlContent:_0x4b831c,label:_0x587009,mainActionLabel:_0x561890}){this['view']['prompt']=_0x587009,this['view']['mainAction']=_0x561890,this['initialContext']=_0x4b831c,_0x12072e&&(this['view']['isRendered']?this['_handleQuery'](_0x12072e,_0x4b831c,_0xdf298d,_0x587009):this['view']['once']('render',()=>{this['_handleQuery'](_0x12072e,_0x4b831c,_0xdf298d,_0x587009);}));}['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'](_0x108adf,_0x253280,_0x5a43a8,_0x10a458){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x253280,this['previousQuery']=_0x108adf,this['previousLabel']=_0x10a458||_0x108adf,this['previousActionId']=_0x5a43a8,new Promise(_0x23fabf=>{this['textAdapter']['makeRequest']({'query':_0x108adf,'context':_0x253280,'onData':_0x316570=>{this['currentResponse']=_0x316570,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5a43a8})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x5a1f26=>{_0x5a1f26 instanceof R?this['view']['handleError'](_0x5a1f26['message']):this['view']['handleError'](),_0x23fabf();})['finally'](()=>{this['stopProcessing'](),_0x23fabf();});});}['_parseAndNormalizeContent'](_0x253287,_0x4a5762=!0x1){const _0x169e07=Z['exec'](_0x253287);_0x253287=_0x169e07?_0x253287['substring'](_0x169e07[0x1]['length']):_0x253287['length']<0x64&&!_0x4a5762?'':this['_stripMarkdownSyntax'](_0x253287);const _0x33e954=this['_domParser']['parseFromString'](_0x253287,'text/html');if(_0x169e07){const _0x2bf304=Array['from'](_0x33e954['body']['childNodes']);_0x2bf304['reverse']();for(const _0x3d505d of _0x2bf304){if(_0x3d505d['nodeType']==Node['ELEMENT_NODE'])break;_0x3d505d['remove']();}}const _0xb6b498=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x33e954['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0xb6b498);const _0xa999ed=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x49c892=this['editor']['data']['toModel'](_0xb6b498);return _0xa999ed||_0x49c892['markers']['clear'](),this['editor']['data']['stringify'](_0x49c892);}['_normalizeResponseHeadings'](_0x216d69){const _0x3ef74c=new _0x181f34(this['editor']['editing']['view']['document']),_0x2d5e48=new _0x41b47d({'name':/^h[1-5]$/}),_0x5d0b8b=[];let _0x35e61f=!0x1;for(const _0x3db610 of _0x216d69)_0x3db610['is']('element')&&_0x2d5e48['match'](_0x3db610)&&(_0x5d0b8b['push'](_0x3db610),'h1'==_0x3db610['name']&&(_0x35e61f=!0x0));if(_0x35e61f){for(const _0x186dbe of _0x5d0b8b)_0x3ef74c['rename']('h'+(parseInt(_0x186dbe['name'][0x1])+0x1),_0x186dbe);}}['_isH1TagSupportEnabled'](){const {data:_0x234574,editing:_0x860d5e}=this['editor'],_0x417798=_0x234574['htmlProcessor']['toView']('<h1></h1>'),_0x4aaf05=_0x234574['toView'](_0x234574['toModel'](_0x417798));return!!_0x860d5e['view']['domConverter']['viewToDom'](_0x4aaf05)['querySelector']('h1');}['_sanitizeHTML'](_0x5a2842){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x5a2842),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x58194e){const _0x36f6f7=_0x58194e['trim']();return _0x36f6f7['startsWith']('```html')?_0x36f6f7['endsWith']('```')?_0x36f6f7['substring'](0x7,_0x36f6f7['length']-0x3):_0x36f6f7['substring'](0x7):_0x58194e;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x52449a){super(_0x52449a),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x473f71=>i(_0x52449a,'AI_'+_0x473f71['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x52449a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x52449a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x52449a,'Stop'));const _0x2d60c3=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2d60c3['if']('isVisible','ck-hidden',_0x33ea65=>!_0x33ea65)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x524385,_0x4e4e2c){const _0x2c87ba=new _0x199d88(this['locale']);return _0x2c87ba['set']({'label':_0x524385,'class':_0x4e4e2c||'','isVisible':!0x0,'withText':!0x0}),_0x2c87ba;}}var W='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class X extends _0x4e48f5{['contentFieldView'];['copyButtonView'];constructor(_0x55477c,_0x37adf2=''){super(_0x55477c),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x37c62f=this['bindTemplate'];this['contentFieldView']=new mt(_0x55477c,_0x37adf2),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x37c62f['if']('isVisible','ck-hidden',_0x956f74=>!_0x956f74)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x37c62f['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 _0x113f41=!0x1;this['on']('change:value',(_0x3070a5,_0x30bd07,_0x3f1f24)=>{const _0x132d26=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3f1f24),this['isProcessing']&&_0x132d26&&!_0x113f41&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x51698b,_0x331526,_0xefb642)=>{_0x113f41=!0x1,_0xefb642?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x113f41=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x113f41=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x5b1a93=this['locale'],_0x1eef87=new _0x199d88(this['locale']),_0x20172b='ck-ai-form__copy-button';return _0x1eef87['set']({'label':i(_0x5b1a93,'Copy'),'icon':W,'class':_0x20172b,'tooltip':!0x0}),_0x1eef87['bind']('isVisible')['to'](this,'value',_0x185233=>!!_0x185233),_0x1eef87['bind']('isEnabled')['to'](this,'isProcessing',_0x501c4f=>!_0x501c4f),_0x1eef87['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1eef87['icon']=_0x333562['check'],_0x1eef87['class']=_0x20172b+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1eef87['icon']=W,_0x1eef87['class']=_0x20172b;},0x3e8);}),_0x1eef87;}['_copyHTMLToClipboard'](_0x120f60){const {window:_0x5b7ed7,document:_0x26d685}=_0x5b9a8c;if(_0x5b7ed7['ClipboardItem']){const {Blob:_0xed123a,ClipboardItem:_0x4f0297}=_0x5b7ed7,_0x1a82df=[new _0x4f0297({'text/html':new _0xed123a([_0x120f60['innerHTML']],{'type':'text/html'}),'text/plain':new _0xed123a([_0x120f60['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1a82df);}else{const _0x345635=_0x26d685['createElement']('div');_0x345635['style']['position']='absolute',_0x345635['style']['left']='-9999px',_0x345635['innerHTML']='<span>[</span>'+_0x120f60['innerHTML']+'<span>]</span>',_0x26d685['body']['appendChild'](_0x345635);const _0x469caa=_0x26d685['createRange']();_0x469caa['setStartAfter'](_0x345635['firstElementChild']),_0x469caa['setEndBefore'](_0x345635['lastElementChild']);const _0x4ba46c=_0x5b7ed7['getSelection']();_0x4ba46c['removeAllRanges'](),_0x4ba46c['addRange'](_0x469caa),_0x26d685['execCommand']('copy'),_0x345635['remove']();}}}class mt extends _0x4e48f5{constructor(_0x1e4434,_0x383681=''){super(_0x1e4434),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x383681,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x245484){this['element']['innerHTML']=_0x245484;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x13bb0a=new _0x4e48f5(),_0x264b80=this['locale'],_0x966459=new _0x5a4df3();return _0x966459['isVisible']=!0x0,_0x13bb0a['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x966459,{'text':i(_0x264b80,'AI\x20is\x20writing...')}]}),_0x13bb0a['render'](),_0x13bb0a;}}class rt extends _0x4e48f5{constructor(_0x502982,_0x4b6a49=''){super(_0x502982);const _0x1fa431=new _0x544509(),_0x2cd492=this['bindTemplate'];this['set']('text',_0x4b6a49),_0x1fa431['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x1fa431,{'text':_0x2cd492['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3a39ae,_0x159ba3){super(_0x3a39ae,_0x159ba3),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',(_0x16c424,_0x4bcee5)=>{_0x16c424['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4bcee5());});}['_createSubmitButton'](){const _0x3272dd=new _0x199d88(this['locale']),_0x1c9590=this['locale'];return _0x3272dd['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x1c9590,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x3272dd['on']('execute',()=>{this['submit']();}),_0x3272dd['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x519c01,_0x47740e)=>!_0x519c01&&_0x47740e),_0x3272dd;}['_createShowHistoryButton'](){const _0x261b7a=new _0x199d88(this['locale']),_0x170789=this['resultsView'],_0x524299=this['locale'];_0x261b7a['set']({'label':i(_0x524299,'History'),'withText':!0x1,'icon':_0x333562['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x261b7a['bind']('isOn')['to'](_0x170789,'isVisible'),_0x261b7a['bind']('isEnabled')['to'](this,'isEnabled'),_0x261b7a['on']('execute',()=>{_0x170789['isVisible']=!_0x170789['isVisible'],_0x170789['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2596fb=()=>{_0x5b9a8c['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x522353=new st(this['queryView']['fieldView']['element']),_0x2d044d=_0x522353['width'],_0x3297f1='rtl'===_0x524299['uiLanguageDirection']?'left':'right';_0x522353['excludeScrollbarsAndBorders'](),_0x261b7a['element']['style'][_0x3297f1]=_0x2d044d-_0x522353['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2596fb),this['on']('render',_0x2596fb),_0x261b7a;}['submit'](){const _0x45223d=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x45223d);}['focus'](_0x3f6ca2){-0x1===_0x3f6ca2?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x204a57){super(_0x204a57),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x204a57,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x236ff1=0x0;for(const _0x1019a6 of this['items'])_0x236ff1+=_0x1019a6['items']['length'];return{'resultsCount':_0x236ff1,'totalItemsCount':_0x236ff1};}['_createClearHistoryButton'](){const _0x49071d=this['locale'],_0x1e28ab=new _0x199d88(this['locale']);return _0x1e28ab['set']({'label':'('+i(_0x49071d,'Clear')+')','withText':!0x0}),_0x1e28ab['on']('execute',()=>this['fire']('clearHistory')),_0x1e28ab;}}class hs extends _0xb5146e{constructor(_0x567119){super();const _0x41e2b1=new te(),_0x84b672=new _0x199d88(this['locale'],_0x41e2b1);this['children']['add'](_0x84b672),_0x84b672['set']({'label':_0x567119['prompt'],'withText':!0x0}),_0x84b672['on']('execute',()=>{this['fire']('execute',{'value':_0x5a21fa(_0x567119['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4aa76a{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x25676d,_0x1e25e6)=>{const _0x2f14a4=Ss(_0x1e25e6['prompt']);for(const _0x2d7fe5 of this)if(_0x2d7fe5!=_0x1e25e6&&Ss(_0x2d7fe5['prompt'])===_0x2f14a4){this['remove'](_0x2d7fe5);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x339367=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x339367));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x192409=>_0x192409)));}}function Ss(_0x399aba){return _0x399aba['toLowerCase']()['trim']();}class k extends _0x4e48f5{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x34e0cc,_0x2537ab,_0x55af5c=''){super(_0x34e0cc),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new rt(_0x34e0cc),this['contentArea']=new X(_0x34e0cc,_0x55af5c),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 _0x430094(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x43557f({'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 _0xbaa40b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x2537ab],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xbaa40b['if']('isError','ck-hidden',_0x2f3152=>!_0x2f3152)]},'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'](_0x5c205a=0x1){-0x1===_0x5c205a?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 _0x39bb91=this['locale'],_0x21b611=new ht(_0x39bb91,{'queryView':{'label':i(_0x39bb91,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x158201,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x39bb91,'Empty\x20history'),'secondary':i(_0x39bb91,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x21b611['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x546ba3,_0x3a49f7)=>_0x546ba3&&!_0x3a49f7),this['listenTo'](_0x21b611,'submit',(_0x3f6671,_0x2adc41)=>{this['prompt']=_0x2adc41;const _0x39a1e1=_0x510345(_0x2adc41);this['fire']('submitPrompt',_0x39a1e1),_0x2adc41['trim']()&&this['_promptHistory']['add']({'prompt':_0x39a1e1},0x0);},{'priority':'high'}),_0x21b611;}['_createHistoryView'](){const _0xfa3c99=new rs(this['locale']);return _0xfa3c99['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0xfa3c99['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xfa3c99;}['_createToolbar'](){const _0x4f77fa=new at(this['locale']);return _0x4f77fa['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x572241,_0x37ab4c,_0x221030)=>_0x572241&&!_0x37ab4c&&!!_0x221030),_0x4f77fa['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4f77fa['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x18a243,_0x828e08,_0x234903)=>_0x18a243&&!_0x828e08&&!!_0x234903),_0x4f77fa['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4f77fa['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4f5a64,_0x17369f)=>_0x4f5a64&&!_0x17369f),_0x4f77fa['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4f77fa['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4f77fa['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4f77fa;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x52473e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x52473e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0xd67d6d){const _0x44aa58=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0xd67d6d||i(_0x44aa58,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var T='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const w=globalThis['DataTransfer'];class n extends _0x168661{['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[_0x2f192a,a,K,_0x444672];}constructor(_0x40f449){super(_0x40f449),_0x40f449['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x40f449['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x40f449['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x40f449['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x69570f}=this;this['_aiAdapter']=_0x69570f['plugins']['get'](K),this['_dialog']=_0x69570f['plugins']['get'](_0x444672),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0xddeb93=new E(_0x69570f,Array['from'](this['_commandDefinitions']['values']()));_0x69570f['commands']['add']('showAIAssistant',_0xddeb93),_0x69570f['ui']['componentFactory']['add']('aiCommands',_0x3aa5ee=>{const _0x1309ae=_0x492dc9(_0x3aa5ee);return _0x1309ae['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x1309ae['buttonView']['set']({'label':i(_0x3aa5ee,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x1309ae['on']('execute',_0x38ef0e=>this['_onExecute'](_0x38ef0e['source']['id'])),_0x551bc4(_0x1309ae,_0x69570f['ui']['view']['body'],function(_0x1d3f30){const _0x315602=o(_0x1d3f30['config']['get']('ai.aiAssistant.commands'),_0x1d3f30['locale']),_0x328c73=U(_0x1d3f30,_0x315602)['filter'](_0x33ba18=>_0x33ba18['commands']['length']);if(0x1===_0x328c73['length'])return U(_0x1d3f30,_0x328c73[0x0]['commands'])['map'](_0xa1c378=>({'id':_0xa1c378['id'],'label':_0xa1c378['label']}));return _0x328c73['map'](_0x56832b=>{const {groupId:_0x199796,groupLabel:_0x4f4963,commands:_0x2d2ee3}=_0x56832b,_0x472e68=U(_0x1d3f30,_0x2d2ee3)['map'](_0x165621=>({'id':_0x165621['id'],'label':_0x165621['label']}));return{'id':_0x199796,'menu':_0x4f4963||_0x199796,'children':_0x472e68};});}(_0x69570f),{'ariaLabel':i(_0x3aa5ee,'AI\x20Commands')}),_0x1309ae['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0xddeb93['on']('change:enabledCommandsIds',_0x5111a4),_0x1309ae['menuView']['once']('render',_0x5111a4),_0x1309ae;function _0x5111a4(){_0x1309ae['isEnabled']=_0xddeb93['enabledCommandsIds']['length']>0x0;for(const _0x9b4d of _0x1309ae['menuView']['buttons'])_0x9b4d['isEnabled']=_0xddeb93['enabledCommandsIds']['includes'](_0x9b4d['id']);}}),_0x69570f['ui']['componentFactory']['add']('menuBar:aiCommands',_0x3455df=>{const _0x37bc46=new _0x5aa9c6(_0x3455df);_0x37bc46['buttonView']['set']({'label':i(_0x3455df,'AI\x20Commands'),'icon':T}),_0x37bc46['bind']('isEnabled')['to'](_0xddeb93,'enabledCommandsIds',_0x5b45d3=>_0x5b45d3['length']>0x0);const _0x477024=o(_0x69570f['config']['get']('ai.aiAssistant.commands'),_0x3455df);return this['_populateMenuBarMenu'](_0xddeb93,_0x37bc46,_0x477024,_0x4fc18f=>this['_onExecute'](_0x4fc18f)),_0x37bc46;}),_0x69570f['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1b8d8c=this['_createAIAssistantUIButton'](_0x199d88);return _0x1b8d8c['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1b8d8c;}),_0x69570f['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x48ce1b=this['_createAIAssistantUIButton'](_0x1a42ca);return _0x48ce1b['set']({'role':'menuitemcheckbox'}),_0x48ce1b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0xc72587=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1d2863;for(const _0x44ba68 in _0xc72587){const _0x55e338=_0x44ba68,_0xe70d0d=_0xc72587[_0x55e338];if('aiLicenseKeyValid'==_0xe70d0d||'aiLicenseKeyInvalid'==_0xe70d0d||'aiLicenseKeyExpired'==_0xe70d0d||'aiLicenseKeyDomainLimit'==_0xe70d0d||'aiLicenseKeyNotAllowed'==_0xe70d0d||'aiLicenseKeyEvaluationLimit'==_0xe70d0d||'aiLicenseKeyTrialLimit'==_0xe70d0d||'aiLicenseKeyUsageLimit'==_0xe70d0d){delete _0xc72587[_0x55e338],_0x1d2863=_0xe70d0d,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x1d2863&&_0xc72587['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x1d2863&&_0xc72587['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x1d2863&&_0xc72587['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x1d2863&&_0xc72587['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x1d2863&&_0xc72587['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x1d2863&&_0xc72587['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x1d2863&&_0xc72587['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x57b14='',_0x5739d9='',_0x6f47='custom'){const _0xebb4f7=this['editor'],_0x32cc1f=_0xebb4f7['editing']['view'],_0x392a94=_0xebb4f7['plugins']['get'](a),_0x4a143f=_0xebb4f7['plugins']['get'](_0x2f192a);_0x392a94['showFakeVisualSelection']();const _0x2d230d=new w(),_0x2ef9ee=new ClipboardEvent('copy',{'clipboardData':_0x2d230d}),_0x227bc6=new _0x1a7d11(_0x2d230d),_0x508fe5=new _0xa654a1(_0x32cc1f,_0x2ef9ee,{'dataTransfer':_0x227bc6});_0x4a143f['_forceMarkersCopy']('comment',()=>{_0x32cc1f['document']['fire']('copy',_0x508fe5);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0xebb4f7,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x33704c=_0x227bc6['getData']('text/html');const _0x50a677=_0xebb4f7['model']['document']['selection'],_0x3df444=Array['from'](_0x50a677['getRanges']());0x1===_0x3df444['length']&&_0x3df444[0x0]['isFlat']&&!_0x50a677['getSelectedElement']()&&''!==_0x33704c['replace'](/ /g,'')['trim']()&&(_0x33704c='<p>'+_0x33704c+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x6f47,'query':_0x57b14,'htmlContent':_0x33704c,'label':_0x5739d9,'mainActionLabel':M[_0xebb4f7['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':ct['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x279bd1['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x392a94['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xbb3d5=new Map(),_0x53b5ba=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x179a74 of _0x53b5ba)for(const _0xf137f7 of _0x179a74['commands'])_0xbb3d5['set'](_0xf137f7['id'],{..._0xf137f7,'groupId':_0x179a74['groupId'],'groupLabel':_0x179a74['groupLabel']||_0x179a74['groupId']});return _0xbb3d5;}['_createAIAssistantUIButton'](_0xad9628){const _0x4eac76=this['editor'],_0x11dba4=_0x4eac76['commands']['get']('showAIAssistant'),_0x7e0a35=new _0xad9628(_0x4eac76['locale']);return _0x7e0a35['set']({'label':i(_0x4eac76['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x7e0a35['bind']('isEnabled')['to'](_0x11dba4),_0x7e0a35['bind']('isOn')['to'](this['_dialog'],'id',_0x410def=>'aiAssistant'===_0x410def),this['listenTo'](_0x7e0a35,'execute',()=>{_0x7e0a35['isOn']?this['hideUI']():_0x11dba4['execute']();}),_0x7e0a35;}['_initView'](){const _0x53e1f8=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',()=>{_0x53e1f8['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x53e1f8['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x59582e,ui:{ariaLiveAnnouncer:_0x260388}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x519d73,_0xdb02a5,_0x2abcca)=>{const _0x4268e9=this['_aiAssistantController']['currentContext'];_0x2abcca?_0x260388['announce'](i(_0x59582e,'AI\x20is\x20writing')):_0x4268e9&&_0x260388['announce'](i(_0x59582e,'Generated\x20content:\x20%0',_0x4268e9),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1d997d,_0x3a6e00,_0x227fb4)=>{if(_0x227fb4){const _0x5b972d=this['_formView']['errorView']['text'];_0x260388['announce'](i(_0x59582e,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5b972d));}});}['_onExecute'](_0x5cabd9){const _0x388883=this['_commandDefinitions']['get'](_0x5cabd9),_0xa6a620=this['editor'],_0x4c9f65=_0xa6a620['model']['document']['selection'],_0x27d7c9=_0xa6a620['commands']['get']('showAIAssistant'),_0x28a152=_0xa6a620['plugins']['get'](a),_0x226ff7=''+(_0x388883['groupId']!==x?_0x388883['groupLabel']+':\x20':'')+_0x388883['label'];if(!0x1!==_0x388883['requiresContent']&&_0x4c9f65['isCollapsed']){const _0x4ef8cb=_0x193f29(_0x4c9f65['getSelectedBlocks']())||_0xa6a620['model']['schema']['getLimitElement'](_0x4c9f65);_0xa6a620['model']['change'](_0x33c8dc=>{_0x33c8dc['setSelection'](_0x4ef8cb,'in');});}_0x28a152['showFakeVisualSelection'](),_0x27d7c9['execute'](_0x388883['prompt'],_0x226ff7,'command:'+_0x5cabd9);}['_populateMenuBarMenu'](_0x6069d1,_0x5cd543,_0x3e6dca,_0x5129e8){const _0x14869f=this['editor'],_0x586b25=_0x14869f['locale'],_0x3de399=new _0x558ef1(_0x586b25),_0x5a830f=U(_0x14869f,_0x3e6dca)['filter'](_0x1cb50e=>_0x1cb50e['commands']['length']);0x1===_0x5a830f['length']?this['_getMenuBarGroupButtons']({'command':_0x6069d1,'commands':_0x5a830f[0x0]['commands'],'parentMenuView':_0x5cd543,'onExecute':_0x5129e8})['forEach'](_0x4c8ff2=>_0x3de399['items']['add'](_0x4c8ff2)):_0x5a830f['forEach'](({groupId:_0x2a9032,groupLabel:_0x256f30,commands:_0x550772})=>{const _0xb38b4b=new _0x448066(_0x586b25,_0x5cd543),_0x2e7b3=new _0x5aa9c6(_0x586b25),_0x1c366=new _0x558ef1(_0x586b25),_0x1f6ff4=this['_getMenuBarGroupButtons']({'command':_0x6069d1,'commands':_0x550772,'parentMenuView':_0x2e7b3,'onExecute':_0x5129e8});_0x2e7b3['buttonView']['set']({'label':_0x256f30||_0x2a9032}),_0x2e7b3['delegate']('execute')['to'](_0x5cd543),_0x1c366['items']['addMany'](_0x1f6ff4),_0x2e7b3['panelView']['children']['add'](_0x1c366),_0xb38b4b['children']['add'](_0x2e7b3),_0x3de399['items']['add'](_0xb38b4b);}),_0x5cd543['panelView']['children']['add'](_0x3de399);}['_getMenuBarGroupButtons']({command:_0x174a59,commands:_0x417814,parentMenuView:_0x523177,onExecute:_0xc58c79}){const _0x17e686=this['editor'],_0x130683=_0x17e686['locale'];return U(_0x17e686,_0x417814)['map'](_0x224d3c=>{const _0x2a2c27=new _0x448066(_0x130683,_0x523177),_0x102df8=new _0x1a42ca(_0x130683);return _0x102df8['set']({'label':_0x224d3c['label']}),_0x102df8['delegate']('execute')['to'](_0x523177),_0x102df8['on']('execute',()=>_0xc58c79(_0x224d3c['id'])),_0x102df8['bind']('isEnabled')['to'](_0x174a59,'enabledCommandsIds',_0x239bcb=>_0x239bcb['includes'](_0x224d3c['id'])),_0x2a2c27['children']['add'](_0x102df8),_0x2a2c27;});}}function B(_0x44d5a2,_0x33c097){return void 0x0!==_0x44d5a2['order']&&void 0x0===_0x33c097['order']?0x1:void 0x0===_0x44d5a2['order']&&void 0x0!==_0x33c097['order']?-0x1:void 0x0!==_0x44d5a2['order']&&void 0x0!==_0x33c097['order']?_0x44d5a2['order']-_0x33c097['order']:0x0;}function U(_0x25f62c,_0x215e88){_0x215e88['sort'](B);const _0x2c2adc={},_0x2d0a85=[];for(const _0x5285f6 of _0x215e88)if(void 0x0!==_0x5285f6['order']){if(_0x5285f6['order']in _0x2c2adc)throw new _0x398ace('ai-commands-config-order-collision',_0x25f62c,{'conflictingDefinitions':[_0x5285f6,_0x2c2adc[_0x5285f6['order']]]});_0x2c2adc[_0x5285f6['order']]=_0x5285f6,_0x2d0a85['splice'](_0x5285f6['order'],0x0,_0x5285f6);}else _0x2d0a85['push'](_0x5285f6);return _0x2d0a85;}class r extends _0x168661{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3d1db8){super(_0x3d1db8);const _0xaf5b8a=_0x3d1db8['config'],_0x397ff1=_0x3d1db8['locale'];_0xaf5b8a['define']('ai.aiAssistant.preserveComments',!0x0),_0xaf5b8a['define']('ai.aiAssistant.commands',function(_0x55ba95){return[{'groupId':'editOrReview','groupLabel':i(_0x55ba95,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x55ba95,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x55ba95,'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(_0x55ba95,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x55ba95,'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(_0x55ba95,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x55ba95,'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(_0x55ba95,'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(_0x55ba95,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x55ba95,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x55ba95,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x55ba95,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x55ba95,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x55ba95,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x55ba95,'Change\x20style'),'commands':[{'id':'business','label':i(_0x55ba95,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x55ba95,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x55ba95,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x55ba95,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x55ba95,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x55ba95,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x55ba95,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x55ba95,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x55ba95,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x55ba95,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x55ba95,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x55ba95,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x55ba95,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x397ff1)),_0xaf5b8a['define']('ai.aiAssistant.extraCommandGroups',[]),_0xaf5b8a['define']('ai.aiAssistant.removeCommands',[]);let _0x353e11=o(_0xaf5b8a['get']('ai.aiAssistant.commands'),_0x397ff1);const _0x4eca69=_0xaf5b8a['get']('ai.aiAssistant.extraCommandGroups'),_0x5b77df=_0xaf5b8a['get']('ai.aiAssistant.removeCommands');_0x4eca69['forEach'](_0x42a218=>{const _0x511b2b=_0x353e11['find'](_0x44e49a=>_0x44e49a['groupId']===_0x42a218['groupId']);_0x511b2b?_0x511b2b['commands']=_0x511b2b['commands']['concat'](_0x42a218['commands']):_0x353e11['push'](_0x42a218);}),_0x353e11=_0x353e11['filter'](_0x1b7e08=>!_0x5b77df['includes'](_0x1b7e08['groupId'])),_0x353e11['forEach'](_0x3fdf87=>{_0x3fdf87['commands']=_0x3fdf87['commands']['filter'](_0x284222=>!_0x5b77df['includes'](_0x284222['id']));}),_0xaf5b8a['set']('ai.aiAssistant.commands',_0x353e11);}}class P extends _0x168661{['abortController'];static get['requires'](){return[K];}constructor(_0x314645){super(_0x314645),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](K)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x5efe53){return this['sendRequest'](_0x5efe53)['catch'](_0x5030ca=>{if(_0x5030ca instanceof R)return Promise['reject'](_0x5030ca);if('AbortError'==_0x5030ca['name'])return Promise['resolve']();throw console['error'](_0x5030ca),new _0x398ace('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x271c4b,_0x55fc87){const _0x47de3c=this['editor']['locale'],_0x15d519={'Content-Type':'application/json'};if('object'==typeof _0x271c4b)Object['assign'](_0x15d519,_0x271c4b);else{if(_0x271c4b)try{const _0x502b86=await _0x271c4b(_0x55fc87);Object['assign'](_0x15d519,_0x502b86);}catch(_0x57a4bb){return Promise['reject'](new R(i(_0x47de3c,'AI_ERROR_GET_HEADERS')));}}return _0x15d519;}async['_prepareRequestParameters'](_0x17d10c,_0x2dcc5e){const _0x35e6b8=this['editor']['locale'];if('object'==typeof _0x17d10c)return _0x17d10c;try{return await _0x17d10c(_0x2dcc5e);}catch(_0x2ce9eb){return Promise['reject'](new R(i(_0x35e6b8,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x284849){super(_0x284849),_0x284849['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x284849['config']['get']('ai.openAI.requestParameters')||_0x284849['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x284849['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x284849['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x284849['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3cd9b2,context:_0x59f5bb,onData:_0x526c9b,actionId:_0x548313}){const _0x1eed60=this['editor']['locale'],_0x253aaf=await this['prepareMessages'](_0x3cd9b2,_0x59f5bb,_0x548313),_0x13e819=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x548313),_0x5e118b=await this['_prepareRequestParameters'](this['_requestParameters'],_0x548313),_0x4cd87a={'messages':_0x253aaf,..._0x5e118b},_0x2b94af={'method':'POST','headers':_0x13e819,'body':JSON['stringify'](_0x4cd87a),'signal':this['abortController']['signal']},_0xd27499=await fetch(this['_apiUrl'],_0x2b94af);if(_0xd27499['ok'])return _0x5e118b['stream']?await this['_readStreamableResponse'](_0xd27499,_0x526c9b):await this['_readStaticResponse'](_0xd27499,_0x526c9b),Promise['resolve']();{const _0x2db1e0=await _0xd27499['text']();return _0x2db1e0['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x1eed60,'AI_ERROR_CONTEXT_LENGTH'))):_0x2db1e0['includes']('Moderation')?Promise['reject'](new R(i(_0x1eed60,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2db1e0));}}async['prepareMessages'](_0x44f44e,_0x36ffbc,_0x4a8f9e){let _0x2ada83,_0x51354b;return _0x36ffbc?(_0x2ada83='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.',_0x51354b='Instruction:\x0a'+_0x44f44e+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x36ffbc):(_0x2ada83='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.',_0x51354b=_0x44f44e),[{'role':'system','content':_0x2ada83},{'role':'user','content':_0x51354b}];}async['_readStreamableResponse'](_0x1fcac1,_0xafd95d){const _0x1212bc=_0x1fcac1['body']['getReader'](),_0x3e98f1=new TextDecoder();let _0x2c1180='',_0x2b392a='',_0x115ba8='',_0x4b5d53=!0x1;for(;!_0x4b5d53;){const {done:_0x9ef27b,value:_0x30e51e}=await _0x1212bc['read'](),_0x5170d7=_0x2c1180+_0x3e98f1['decode'](_0x30e51e);let _0xdf402c='';_0x4b5d53=_0x9ef27b;try{_0xdf402c=this['_cleanUpData'](_0x5170d7),_0x2c1180='';}catch(_0x94b76a){_0x2c1180=_0x5170d7;continue;}_0x2b392a+=_0xdf402c,!_0x4b5d53&&this['_isBufferIncomplete'](_0x2b392a)||_0x2b392a&&(_0x115ba8+=_0x2b392a,_0x2b392a='',_0xafd95d(_0x115ba8));}return Promise['resolve']();}async['_readStaticResponse'](_0xdae08c,_0x4cf629){return _0x4cf629((await _0xdae08c['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x36e3a7){const _0x356359=_0x36e3a7['split']('<')['length']!==_0x36e3a7['split']('>')['length'],_0x31ffa2=_0x36e3a7['length']<0x1e;return _0x356359&&_0x31ffa2;}['_cleanUpData'](_0x524a00){return _0x524a00['split'](/\n(?![^{]*\})/g)['map'](_0xa1155c=>_0xa1155c['replace']('data:\x20',''))['filter'](_0x2c7543=>_0x2c7543&&_0x2c7543['length']>0x0&&'[DONE]'!==_0x2c7543)['map'](_0xe8af11=>{const {choices:_0x10cdc1}=JSON['parse'](_0xe8af11);if(_0x10cdc1[0x0]&&_0x10cdc1[0x0]['delta']&&_0x10cdc1[0x0]['delta']['content'])return _0x10cdc1[0x0]['delta']['content'];})['filter'](_0x4a65f8=>_0x4a65f8)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0xafbeb7){super(_0xafbeb7),_0xafbeb7['config']['get']('ai.aws.requestParameters')||_0xafbeb7['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']=_0xafbeb7['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0xafbeb7['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0xafbeb7['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0xafbeb7['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2f205b,context:_0x38b638,onData:_0x399588,actionId:_0x319f15}){const {model:_0x5b6573,stream:_0x20cd2a,..._0x4ae645}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x319f15),_0x86aec7={'prompt':await this['preparePrompt'](_0x2f205b,_0x38b638,_0x5b6573,_0x319f15),..._0x4ae645};this['_apiUrl']?await this['_processProxyRequest'](_0x86aec7,_0x5b6573,_0x20cd2a,_0x399588,_0x319f15):await this['_processAWSRequest'](_0x86aec7,_0x5b6573,_0x20cd2a,_0x399588);}async['preparePrompt'](_0x349afa,_0x4789a3,_0x582b72,_0x1d60df){let _0x24220c,_0x2a5d6f;return _0x4789a3?(_0x24220c='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.',_0x2a5d6f='Instruction:\x0a'+_0x349afa+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4789a3):(_0x24220c='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.',_0x2a5d6f=_0x349afa),'meta.llama'==this['getModelFamily'](_0x582b72)?'<<SYS>>\x0a'+_0x24220c+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2a5d6f+'\x0a[/INST]':'Human:\x0a'+_0x24220c+'\x0a'+_0x2a5d6f+'\x0a\x0aAssistant:';}['getModelFamily'](_0x582de5){if(/^anthropic\.claude/['test'](_0x582de5))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x582de5))return'ai21.j2';if(/^cohere\.command/['test'](_0x582de5))return'cohere.command';if(/^meta\.llama/['test'](_0x582de5))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x582de5));}async['_processProxyRequest'](_0x48c657,_0x2e0b0a,_0x5f8566,_0x38a2a5,_0x55c03d){const _0x252b73={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x55c03d),'body':JSON['stringify']({..._0x48c657,'model':_0x2e0b0a,'stream':_0x5f8566}),'signal':this['abortController']['signal']},_0x61db90=await fetch(this['_apiUrl'],_0x252b73);_0x5f8566?await this['_readStreamableResponse'](_0x61db90,_0x2e0b0a,_0x38a2a5):await this['_readStaticResponse'](_0x61db90,_0x2e0b0a,_0x38a2a5);}async['_processAWSRequest'](_0x2c22e7,_0x508046,_0x4178c3,_0x506d15){const _0x14722b=new _0x331464(this['_bedrockClientConfig']),_0x212ad1={'body':JSON['stringify'](_0x2c22e7),'contentType':'application/json','accept':'application/json','modelId':_0x508046};let _0xed19fa;if(_0x4178c3){const _0x103441=new _0x37025e(_0x212ad1);_0xed19fa=await _0x14722b['send'](_0x103441,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0xed19fa,_0x508046,_0x506d15);}else{const _0x2f9cb9=new _0x479582(_0x212ad1);_0xed19fa=await _0x14722b['send'](_0x2f9cb9,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0xed19fa,_0x508046,_0x506d15);}}async['_readAsyncIterableResponse'](_0x35d0bf,_0x424a45,_0x22b1eb){const _0x5a3065=_0x35d0bf['body'],_0x333fe9=new TextDecoder('utf-8');let _0x2b7c94='';for await(const _0x514eb6 of _0x5a3065)if(_0x514eb6['chunk']){const _0x129ea5=_0x333fe9['decode'](_0x514eb6['chunk']['bytes']),_0xec9cb3=JSON['parse'](_0x129ea5);_0x2b7c94+=this['_getGeneratedText'](_0xec9cb3,_0x424a45),_0x22b1eb(_0x2b7c94);}return Promise['resolve']();}async['_readStreamableResponse'](_0x15cdde,_0xdd4f1f,_0x50a031){const _0x106b5d=_0x15cdde['body'],_0x353fda=new TextDecoder('utf-8'),_0x4f22c2=_0x106b5d['getReader']();let _0x54596c='',_0x2048af='',_0x22b2a2=!0x1;for(;!_0x22b2a2;){const {done:_0x131e4d,value:_0x2e9cad}=await _0x4f22c2['read']();if(_0x22b2a2=_0x131e4d,_0x22b2a2)break;const _0xa0a87b=(_0x54596c+_0x353fda['decode'](_0x2e9cad))['split']('\x0a')['map'](_0x525df8=>{try{return _0x54596c='',JSON['parse'](_0x525df8);}catch(_0x34af50){return _0x54596c=_0x525df8,null;}})['filter'](_0x1535c2=>null!==_0x1535c2);_0xa0a87b['length']&&(_0x2048af+=_0xa0a87b['map'](_0x12243a=>this['_getGeneratedText'](_0x12243a,_0xdd4f1f))['join'](''),_0x50a031(_0x2048af));}return Promise['resolve']();}async['_readStaticResponse'](_0x57ebcf,_0x5eb49a,_0x5f49ee){let _0x4e5b4d;return _0x4e5b4d=_0x57ebcf instanceof Response?await _0x57ebcf['json']():JSON['parse'](Buffer['from'](_0x57ebcf['body'])['toString']('utf8')),(_0x5f49ee(this['_getGeneratedText'](_0x4e5b4d,_0x5eb49a)),Promise['resolve']());}['_getGeneratedText'](_0x4a9ce3,_0xe72914){switch(this['getModelFamily'](_0xe72914)){case'anthropic.claude':return _0x4a9ce3['completion'];case'ai21.j2':return _0x4a9ce3['completions'][0x0]['data']['text'];case'cohere.command':return _0x4a9ce3['generations'][0x0]['text'];case'meta.llama':return _0x4a9ce3['generation'];}}}export{K as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x15a698=>0x1!=_0x15a698}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x555e52=>{const {af:{dictionary:_0x393eea,getPluralForm:_0x2651d0}}={'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':_0x19a526=>0x1!=_0x19a526}};_0x555e52['af']||={'dictionary':{},'getPluralForm':null},_0x555e52['af']['dictionary']=Object['assign'](_0x555e52['af']['dictionary'],_0x393eea),_0x555e52['af']['getPluralForm']=_0x2651d0;})(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':_0x3df35b=>0x0==_0x3df35b?0x0:0x1==_0x3df35b?0x1:0x2==_0x3df35b?0x2:_0x3df35b%0x64>=0x3&&_0x3df35b%0x64<=0xa?0x3:_0x3df35b%0x64>=0xb?0x4:0x5}};
|