@ckeditor/ckeditor5-ai 44.2.0-alpha.9 → 44.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/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 _0x40d9f6,Command as _0x4997e8,icons as _0x22d41d}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x2483e0,CKEditorError as _0x504032,ObservableMixin as _0x4f9ea7,global as _0x266000,isVisible as it,Rect as st,Collection as _0x4a9192,FocusTracker as _0x48ec6c,KeystrokeHandler as ts,first as _0x45ead6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x5aa636,View as _0x34409b,SpinnerView as _0x2d1c37,IconView as _0x425587,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x31d8b6,ButtonLabelView as te,FocusCycler as _0xe29c3b,createLabeledTextarea as _0x1d2f3d,Dialog as _0x4d2dd2,createDropdown as _0x279645,addMenuToDropdown as _0x9fbfcd,MenuBarMenuView as _0x293cc5,MenuBarMenuListItemButtonView as _0x2a0b0f,DialogViewPosition as _0x1bd101,MenuBarMenuListView as _0x20387c,MenuBarMenuListItemView as _0xd4143c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x2ccd56,ClipboardMarkersUtils as _0x8a8690}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x21c908,DataTransfer as _0x4235d1,UpcastWriter as _0x3eb6b4,Matcher as _0x52762e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1ea632,escape as _0x577377}from'lodash-es';import{BedrockRuntimeClient as _0x2ad3ae,InvokeModelWithResponseStreamCommand as _0x43f8f6,InvokeModelCommand as _0x2e666d}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x28f62d,_0x3edf9b){const _0x46f648=(0x0,_0x3edf9b['t'])('Other');return _0x28f62d['length']?'groupId'in _0x28f62d[0x0]?_0x28f62d:[{'groupId':x,'groupLabel':_0x46f648,'order':0x1/0x0,'commands':_0x28f62d}]:[{'groupId':x,'groupLabel':_0x46f648,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x40d9f6{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x50cfaf}=this,_0x301c6b=['ck-fake-ai-selection'];_0x50cfaf['config']['get']('ai.useTheme')&&_0x301c6b['push']('ck-ai-assistant-ui_theme'),_0x50cfaf['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x301c6b,'priority':0xc}}),_0x50cfaf['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x36910d,{writer:_0x54eaae})=>{if(!_0x36910d['markerRange']['isCollapsed'])return null;const _0x395377=_0x54eaae['createUIElement']('span');return _0x54eaae['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x395377),_0x395377;}});}['afterInit'](){!async function(_0x3bc331){const _0x3daba6=_0x25526d([0x32,0x38,0x34,0x75,0x49,0x54,0x61,0x37,0x41,0x69,0x56,0x5a,0x64,0x67,0x43,0x44,0x70,0x73,0x4c,0x55,0x65,0x47,0x72,0x6c,0x6b,0x46,0x74,0x76,0x66,0x50,0x4a,0x78,0x52,0x79,0x4b,0x6f,0x7a,0x6a,0x39,0x77,0x57,0x4f,0x4e,0x58,0x6d,0x45,0x51,0x68,0x30,0x59,0x62,0x6e,0x4d,0x71,0x31,0x63,0x53,0x36,0x42,0x35,0x33,0x48]),_0x56611e=0x37361e6f,_0x55623e=0x373140cf^_0x56611e,_0x3b4463=window[_0x25526d([0x44,0x61,0x74,0x65])][_0x25526d([0x6e,0x6f,0x77])](),_0x77651c=_0x3bc331[_0x25526d([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x550dc6=new window[(_0x25526d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x23cd73=>{_0x77651c[_0x25526d([0x6f,0x6e,0x63,0x65])](_0x25526d([0x72,0x65,0x61,0x64,0x79]),_0x23cd73);}),_0x4f17a0={[_0x25526d([0x6b,0x74,0x79])]:_0x25526d([0x45,0x43]),[_0x25526d([0x75,0x73,0x65])]:_0x25526d([0x73,0x69,0x67]),[_0x25526d([0x63,0x72,0x76])]:_0x25526d([0x50,0x2d,0x32,0x35,0x36]),[_0x25526d([0x78])]:_0x25526d([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]),[_0x25526d([0x79])]:_0x25526d([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]),[_0x25526d([0x61,0x6c,0x67])]:_0x25526d([0x45,0x53,0x32,0x35,0x36])},_0x53ea5b=_0x77651c[_0x25526d([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x25526d([0x67,0x65,0x74])](_0x25526d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2f7669(){let _0x267ac0,_0x6e1f0=null,_0x5d02ab=null;try{if(_0x53ea5b==_0x25526d([0x47,0x50,0x4c]))return _0x25526d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x267ac0=_0x38943a(),!_0x267ac0)return _0x25526d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x267ac0[_0x25526d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5d02ab=_0x419745(_0x267ac0[_0x25526d([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x267ac0[_0x25526d([0x6a,0x74,0x69])])),await _0xa1c9c4()?_0x5efc71()?_0x2e6c28()?_0x25526d([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x334b82()?(_0x267ac0[_0x25526d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25526d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x6e1f0=_0x154719(_0x25526d([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x267ac0[_0x25526d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25526d([0x74,0x72,0x69,0x61,0x6c])&&(_0x6e1f0=_0x154719(_0x25526d([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x35025d()):_0x25526d([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x25526d([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x25526d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x4a28f3){return _0x25526d([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2e6c28(){const _0x4cf208=[_0x25526d([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x25526d([0x74,0x72,0x69,0x61,0x6c])][_0x25526d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x267ac0[_0x25526d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3b4463/0x3e8:0xe10*_0x55623e;return _0x267ac0[_0x25526d([0x65,0x78,0x70])]<_0x4cf208;}function _0x5efc71(){const _0x230076=_0x267ac0[_0x25526d([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x230076&&(!!_0x230076[_0x25526d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25526d([0x2a]))||!!_0x230076[_0x25526d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25526d([0x41,0x49])));}function _0x334b82(){const _0x27be25=_0x267ac0[_0x25526d([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x27be25||0x0==_0x27be25[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x377477}=new URL(window[_0x25526d([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x27be25[_0x25526d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x377477))return!0x0;const _0x1bf5ce=_0x377477[_0x25526d([0x73,0x70,0x6c,0x69,0x74])](_0x25526d([0x2e]));return _0x27be25[_0x25526d([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4a85bf=>_0x4a85bf[_0x25526d([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25526d([0x2a])))[_0x25526d([0x6d,0x61,0x70])](_0x33ce45=>_0x33ce45[_0x25526d([0x73,0x70,0x6c,0x69,0x74])](_0x25526d([0x2e])))[_0x25526d([0x73,0x6f,0x6d,0x65])](_0x33dfa1=>_0x1bf5ce[_0x25526d([0x65,0x76,0x65,0x72,0x79])]((_0x2a4046,_0x117409)=>_0x33dfa1[_0x117409]===_0x2a4046||_0x33dfa1[_0x117409]===_0x25526d([0x2a])));}function _0x35025d(){return _0x6e1f0&&_0x5d02ab?new window[(_0x25526d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5810b9,_0x245425)=>{_0x6e1f0[_0x25526d([0x74,0x68,0x65,0x6e])](_0x5810b9,_0x245425),_0x5d02ab[_0x25526d([0x74,0x68,0x65,0x6e])](_0x4ad08c=>{_0x4ad08c!=_0x25526d([0x56,0x61,0x6c,0x69,0x64])&&_0x5810b9(_0x4ad08c);},_0x245425);}):_0x6e1f0||_0x5d02ab||_0x25526d([0x56,0x61,0x6c,0x69,0x64]);}}function _0x419745(_0x127820,_0x47f779){return new window[(_0x25526d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x47c9b5=>{if(_0x5abf96())return _0x47c9b5(_0x25526d([0x56,0x61,0x6c,0x69,0x64]));_0x2b6f89(),_0x77651c[_0x25526d([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x25526d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1ddf66=!0x1;const _0x43445b=_0x2483e0();function _0x1956c5(_0x5be0dc){return!!_0x5be0dc&&(typeof _0x5be0dc===_0x25526d([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5be0dc===_0x25526d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5be0dc[_0x25526d([0x74,0x68,0x65,0x6e])]===_0x25526d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5be0dc[_0x25526d([0x63,0x61,0x74,0x63,0x68])]===_0x25526d([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1817d0(_0x2e9342){_0x2aae66(_0x2e9342)[_0x25526d([0x74,0x68,0x65,0x6e])](_0x11f330=>{if(!_0x11f330||_0x11f330[_0x25526d([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x25526d([0x6f,0x6b]))return _0x25526d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3302bc(_0x360e42(_0x43445b+_0x47f779))!=_0x11f330[_0x25526d([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x25526d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x25526d([0x56,0x61,0x6c,0x69,0x64]);})[_0x25526d([0x74,0x68,0x65,0x6e])](_0xfad381=>(_0x353eba(),_0xfad381),()=>{const _0x56b388=_0x37f145();return null==_0x56b388?(_0x353eba(),_0x25526d([0x56,0x61,0x6c,0x69,0x64])):_0x25526d(_0x3b4463-_0x56b388>(0x133a9a6f^_0x56611e)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x25526d([0x74,0x68,0x65,0x6e])](_0x47c9b5)[_0x25526d([0x63,0x61,0x74,0x63,0x68])](()=>{_0x47c9b5(_0x25526d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x56c44b=0x3700f0ef^_0x56611e;function _0x353eba(){const _0x188224=_0x25526d([0x6c,0x6c,0x63,0x74,0x2d])+_0x3302bc(_0x360e42(_0x127820)),_0x4f4100=_0x592d05(_0x3302bc(window[_0x25526d([0x4d,0x61,0x74,0x68])][_0x25526d([0x63,0x65,0x69,0x6c])](_0x3b4463/_0x56c44b)));window[_0x25526d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25526d([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x188224,_0x4f4100);}function _0x37f145(){const _0x587367=_0x25526d([0x6c,0x6c,0x63,0x74,0x2d])+_0x3302bc(_0x360e42(_0x127820)),_0x5e645e=window[_0x25526d([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25526d([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x587367);return _0x5e645e?window[_0x25526d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x592d05(_0x5e645e),0x10)*_0x56c44b:null;}function _0x2aae66(_0xaae962){return new window[(_0x25526d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4553e6,_0x3093c6)=>{_0xaae962[_0x25526d([0x74,0x68,0x65,0x6e])](_0x4553e6,_0x3093c6),window[_0x25526d([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3093c6,0x3737caaf^_0x56611e);});}}_0x77651c[_0x25526d([0x6f,0x6e])](_0x25526d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x445607,_0x1610fe)=>{if(_0x1610fe[0x0]!=_0x127820)return _0x47c9b5(_0x25526d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x1610fe[0x1]={..._0x1610fe[0x1],[_0x25526d([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x43445b};},{[_0x25526d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25526d([0x68,0x69,0x67,0x68])}),_0x77651c[_0x25526d([0x6f,0x6e])](_0x25526d([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1748c0=>{_0x1956c5(_0x1748c0[_0x25526d([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1ddf66=!0x0,_0x1817d0(_0x1748c0[_0x25526d([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x25526d([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25526d([0x6c,0x6f,0x77])}),_0x550dc6[_0x25526d([0x74,0x68,0x65,0x6e])](()=>{_0x1ddf66||_0x47c9b5(_0x25526d([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5abf96(){return _0x77651c[_0x25526d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25526d([0x76,0x69,0x65,0x77])][_0x25526d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x25526d([0x61,0x75,0x74,0x6f]);}function _0x2b6f89(){_0x77651c[_0x25526d([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25526d([0x76,0x69,0x65,0x77])][_0x25526d([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x25526d([0x61,0x75,0x74,0x6f]);}}function _0x154719(_0x280fdb){const _0x3df597=[new window[(_0x25526d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x491e15=>setTimeout(_0x491e15,0x373f20a3^_0x56611e)),_0x550dc6[_0x25526d([0x74,0x68,0x65,0x6e])](()=>new window[(_0x25526d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4bcf86=>{let _0x3497f2=0x0;_0x77651c[_0x25526d([0x6d,0x6f,0x64,0x65,0x6c])][_0x25526d([0x6f,0x6e])](_0x25526d([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x29ebf5,_0x52bbab)=>{_0x52bbab[0x0][_0x25526d([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3497f2++,_0x3497f2==(0x37361f97^_0x56611e)&&(_0x4bcf86(),_0x29ebf5[_0x25526d([0x6f,0x66,0x66])]());});}))];return window[_0x25526d([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x25526d([0x72,0x61,0x63,0x65])](_0x3df597)[_0x25526d([0x74,0x68,0x65,0x6e])](()=>_0x280fdb);}async function _0x237927(){await _0x550dc6,_0x77651c[_0x25526d([0x6d,0x6f,0x64,0x65,0x6c])][_0x25526d([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x108643,_0x77651c[_0x25526d([0x6d,0x6f,0x64,0x65,0x6c])][_0x25526d([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x108643,_0x77651c[_0x25526d([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x25526d([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x6ec3b6(_0x2506c8){const _0x1dae5a=_0x12c496();_0x77651c[_0x1dae5a]=_0x25526d([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x2506c8,_0x2506c8!=_0x25526d([0x56,0x61,0x6c,0x69,0x64])&&_0x237927();}function _0x12c496(){const _0x3d5fbf=window[_0x25526d([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x25526d([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x25526d([0x6e,0x6f,0x77])]())[_0x25526d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x25526d([0x2e]),'');let _0x1c1ce1=_0x25526d([0x75]);for(let _0x4cbc56=0x0;_0x4cbc56<_0x3d5fbf[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4cbc56+=0x2){let _0x5d9c38=window[_0x25526d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3d5fbf[_0x25526d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4cbc56,_0x4cbc56+0x2));_0x5d9c38>=_0x3daba6[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x5d9c38-=_0x3daba6[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1c1ce1+=_0x3daba6[_0x5d9c38];}return _0x1c1ce1;}function _0x38943a(){const _0x2118e8=_0x53ea5b[_0x25526d([0x73,0x70,0x6c,0x69,0x74])](_0x25526d([0x2e]));if(0x3!=_0x2118e8[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2a7d12(_0x2118e8[0x1]);function _0x2a7d12(_0x4a5919){const _0x46e81a=_0x33be68(_0x4a5919);return _0x46e81a&&_0x5d5401()?_0x46e81a:null;function _0x5d5401(){const _0x447449=_0x46e81a[_0x25526d([0x6a,0x74,0x69])],_0x5eb955=window[_0x25526d([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x447449[_0x25526d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x447449[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4f8c31={..._0x46e81a,[_0x25526d([0x6a,0x74,0x69])]:_0x447449[_0x25526d([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x447449[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4f8c31[_0x25526d([0x76,0x63])],_0x360e42(_0x4f8c31)==_0x5eb955;}}}async function _0xa1c9c4(){let _0x554b0d=!0x0;try{const _0x1e8e71=_0x53ea5b[_0x25526d([0x73,0x70,0x6c,0x69,0x74])](_0x25526d([0x2e])),[_0xa91e50,_0x14307d,_0x4e6c4d]=_0x1e8e71;return _0x33c192(_0xa91e50),await _0x345c32(_0xa91e50,_0x14307d,_0x4e6c4d),_0x554b0d;}catch(_0x2fada2){return!0x1;}function _0x33c192(_0x1c61e8){const _0xc42a0b=_0x33be68(_0x1c61e8);_0xc42a0b&&_0xc42a0b[_0x25526d([0x61,0x6c,0x67])]==_0x25526d([0x45,0x53,0x32,0x35,0x36])||(_0x554b0d=!0x1);}async function _0x345c32(_0xd7b608,_0x3fd377,_0x4d7c32){const _0x5af26a=window[_0x25526d([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x25526d([0x66,0x72,0x6f,0x6d])](_0x5ef59d(_0x4d7c32),_0x218e9a=>_0x218e9a[_0x25526d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x55b6c8=new window[(_0x25526d([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x25526d([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xd7b608+_0x25526d([0x2e])+_0x3fd377),_0x108d40=window[_0x25526d([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x25526d([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x108d40)return;const _0x5e8a3b=await _0x108d40[_0x25526d([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x25526d([0x6a,0x77,0x6b]),_0x4f17a0,{[_0x25526d([0x6e,0x61,0x6d,0x65])]:_0x25526d([0x45,0x43,0x44,0x53,0x41]),[_0x25526d([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x25526d([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x25526d([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x108d40[_0x25526d([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x25526d([0x6e,0x61,0x6d,0x65])]:_0x25526d([0x45,0x43,0x44,0x53,0x41]),[_0x25526d([0x68,0x61,0x73,0x68])]:{[_0x25526d([0x6e,0x61,0x6d,0x65])]:_0x25526d([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5e8a3b,_0x5af26a,_0x55b6c8)||(_0x554b0d=!0x1);}}function _0x33be68(_0x1eb1f9){return _0x1eb1f9[_0x25526d([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x25526d([0x65,0x79]))?JSON[_0x25526d([0x70,0x61,0x72,0x73,0x65])](_0x5ef59d(_0x1eb1f9)):null;}function _0x5ef59d(_0x539544){return window[_0x25526d([0x61,0x74,0x6f,0x62])](_0x539544[_0x25526d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x25526d([0x2b]))[_0x25526d([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x25526d([0x2f])));}function _0x360e42(_0x2887bf){let _0x3f2935=0x1505;function _0x5076b1(_0x16d4eb){for(let _0x2a5769=0x0;_0x2a5769<_0x16d4eb[_0x25526d([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x2a5769++){const _0x493eca=_0x16d4eb[_0x25526d([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x2a5769);_0x3f2935=(_0x3f2935<<0x5)+_0x3f2935+_0x493eca,_0x3f2935&=_0x3f2935;}}function _0x5d4764(_0x3713e9){Array[_0x25526d([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3713e9)?_0x3713e9[_0x25526d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x5d4764):_0x3713e9&&typeof _0x3713e9==_0x25526d([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x25526d([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3713e9)[_0x25526d([0x73,0x6f,0x72,0x74])]()[_0x25526d([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x198273,_0x12c54c])=>{_0x5076b1(_0x198273),_0x5d4764(_0x12c54c);}):_0x5076b1(window[_0x25526d([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3713e9));}return _0x5d4764(_0x2887bf),_0x3f2935>>>0x0;}function _0x3302bc(_0x2eece2){return _0x2eece2[_0x25526d([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x25526d([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x25526d([0x30]));}function _0x592d05(_0x236323){return _0x236323[_0x25526d([0x73,0x70,0x6c,0x69,0x74])]('')[_0x25526d([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x25526d([0x6a,0x6f,0x69,0x6e])]('');}function _0x108643(){}function _0x25526d(_0x472739){return _0x472739['map'](_0x41fda2=>String['fromCharCode'](_0x41fda2))['join']('');}_0x6ec3b6(await _0x2f7669());}(this);}['showFakeVisualSelection'](){const _0x5ebfc9=this['editor']['model'];_0x5ebfc9['change'](_0x3cca17=>{const _0x1586c5=_0x5ebfc9['document']['selection']['getRanges']();let _0x5aebf4=0x0;for(const _0x5a8523 of _0x1586c5){const _0x4d1666=f+':'+_0x5aebf4;if(_0x5ebfc9['markers']['has'](_0x4d1666))_0x3cca17['updateMarker'](_0x4d1666,{'range':_0x5a8523});else{if(_0x5a8523['start']['isAtEnd']){const _0x1aeffa=_0x5a8523['start']['getLastMatchingPosition'](({item:_0x3b3b8d})=>!_0x5ebfc9['schema']['isContent'](_0x3b3b8d),{'boundaries':_0x5a8523});_0x3cca17['addMarker'](_0x4d1666,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3cca17['createRange'](_0x1aeffa,_0x5a8523['end'])});}else _0x3cca17['addMarker'](_0x4d1666,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5a8523});}_0x5aebf4++;}});}['hideFakeVisualSelection'](){const _0x45aec6=this['editor']['model'],_0x37f442=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x37f442['length']&&_0x45aec6['change'](_0x56248a=>{_0x37f442['forEach'](_0x166256=>{_0x56248a['removeMarker'](_0x166256);});});}['insertContent'](_0x32b372,_0x2abaea){const _0x37487e=this['_getAISelection'](),_0x4e2790=_0x2abaea||_0x37487e['getFirstRange']();this['editor']['model']['canEditAt'](_0x4e2790)&&this['editor']['model']['change'](_0x32c34d=>{this['hideFakeVisualSelection'](),_0x2abaea||this['_resetContentOfSelectedTableCells'](_0x32c34d,_0x37487e),this['_pasteHTMLUsingClipboard']({'insertAt':_0x4e2790,'writer':_0x32c34d,'html':_0x32b372});});}['insertContentBelow'](_0x4ab23f){const {model:_0x581474}=this['editor'],_0x58badc=this['_getAISelection']();_0x581474['change'](()=>{const _0x207f18=this['_prepareTableInsertBelowPosition'](_0x4ab23f,_0x58badc)||this['_getDefaultInsertBelowPosition'](_0x58badc);this['insertContent'](_0x4ab23f,_0x207f18);});}['_getAISelection'](){const _0x2365a2=this['editor']['model'],_0x394456=Array['from'](_0x2365a2['markers']['getMarkersGroup'](f))['map'](_0xf4d2e1=>_0xf4d2e1['getRange']());return _0x2365a2['createSelection'](_0x394456);}['_pasteHTMLUsingClipboard']({writer:_0x4f2b4e,html:_0x480115,insertAt:_0x34a21d}){const {view:_0x32342f}=this['editor']['editing'],_0x358532=this['editor']['plugins']['get'](_0x2ccd56),_0xe4b663=new dt();_0xe4b663['setData']('text/html',_0x480115);const _0x2e6467=new ClipboardEvent('paste',{'clipboardData':_0xe4b663}),_0x3e9bb4=new _0x21c908(_0x32342f,_0x2e6467,{'dataTransfer':new _0x4235d1(_0xe4b663)});_0x4f2b4e['setSelection'](_0x34a21d);const _0x3b1ba0=(_0x14f456,_0x5efecb)=>{_0x5efecb['resultRange']&&_0x4f2b4e['setSelection'](_0x5efecb['resultRange']);};_0x358532['once']('contentInsertion',_0x3b1ba0,{'priority':'lowest'}),_0x32342f['document']['fire']('paste',_0x3e9bb4),_0x358532['off']('contentInsertion',_0x3b1ba0);}['_getDefaultInsertBelowPosition'](_0x4e5a98){const {model:_0x109fa6}=this['editor'],_0x4952b8=Array['from'](_0x4e5a98['getSelectedBlocks']());return _0x4952b8['length']?_0x109fa6['createPositionAfter'](_0x4952b8['pop']()):_0x4e5a98['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x5e91ad,_0x29f512){const {model:_0x1c9e47,plugins:_0x12101c}=this['editor'];if(_0x12101c['has']('TableUtils')){const _0x25ea05=_0x12101c['get']('TableUtils')['getSelectedTableCells'](_0x29f512);if(_0x25ea05['length']){const _0x508ac9=this['_getTableRowCountFromContent'](_0x5e91ad),_0x25592b=this['_createEmptyTableRows'](_0x25ea05,_0x508ac9);return _0x1c9e47['createPositionAt'](_0x25592b,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2c90da){const _0x38e5a7=this['editor']['plugins']['get']('TableUtils'),_0x180577=this['editor']['data']['parse'](_0x2c90da),_0x45319d=Array['from'](_0x180577['getChildren']())['filter'](_0x3cee2e=>_0x3cee2e['is']('element','table'));let _0xf89e52=0x0;return _0x45319d['forEach'](_0x3362be=>{_0xf89e52+=_0x38e5a7['getRows'](_0x3362be);}),_0xf89e52;}['_createEmptyTableRows'](_0xb79d83,_0x105a39){const _0x50d3f5=this['editor']['plugins']['get']('TableUtils'),_0x539048=_0x50d3f5['getRowIndexes'](_0xb79d83),_0x43bdc4=_0x50d3f5['getColumnIndexes'](_0xb79d83),_0x3b285a=_0x539048['last']+0x1,_0x45505c=_0x43bdc4['first'],_0x2e3d82=_0xb79d83[0x0]['findAncestor']('table');for(let _0x55dec3=0x0;_0x55dec3<_0x105a39;_0x55dec3++)_0x50d3f5['insertRows'](_0x2e3d82,{'at':_0x3b285a});return _0x2e3d82['getChild'](_0x3b285a)['getChild'](_0x45505c);}['_resetContentOfSelectedTableCells'](_0x3dadba,_0x2ade52){const {plugins:_0x58f0d5}=this['editor'],{model:_0x4a2a13}=_0x3dadba;if(!_0x58f0d5['has']('TableUtils'))return;_0x58f0d5['get']('TableUtils')['getSelectedTableCells'](_0x2ade52)['length']&&_0x4a2a13['deleteContent'](_0x2ade52);}}class K extends _0x40d9f6{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x504032('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x4284f3){super(_0x4284f3),this['name']='AIRequestError';}}function i(_0x29cdb4,_0x1ea0c6,_0x3d40b6){const t=_0x29cdb4['t'];switch(_0x1ea0c6){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',_0x3d40b6);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3d40b6);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'},_0x3d40b6);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 _0x1ea0c6;}}class E extends _0x4997e8{['_commandDefinitions'];constructor(_0x477e64,_0x4f9a4d){super(_0x477e64),this['_commandDefinitions']=_0x4f9a4d,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x39884d,_0x4c9fe1,_0x5be803)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x5be803));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x22e16c,_0x4cf6f1,_0x377048)=>{this['enabledCommandsIds']=_0x377048?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1313c1=this['editor']['model'];this['_hasContext']=function(_0x4eaaf6){const _0x523353=_0x4eaaf6['document']['selection'];return _0x523353['isCollapsed']?0x0!==[..._0x523353['getSelectedBlocks']()]['length']&&![..._0x523353['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4eaaf6['hasContent'](_0x523353['getFirstRange']());}(_0x1313c1);const _0x3585f4=_0x1313c1['document']['selection'],_0x145906=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x16e3ab of _0x3585f4['getRanges']())for(const _0x303558 of _0x16e3ab['getItems']())if(_0x303558['is']('element')&&_0x145906['includes'](_0x303558['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3acb40='',_0x4a1440='',_0x268707='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3acb40,_0x4a1440,_0x268707);}}function G(_0x40e523,_0x21ba94){const _0x43bdd2=new Set();for(const _0x2554d8 of _0x40e523['values']())(_0x21ba94||!0x1===_0x2554d8['requiresContent'])&&_0x43bdd2['add'](_0x2554d8['id']);return Array['from'](_0x43bdd2);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x4f9ea7(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x1b4f31,_0x239f17,_0x5bda1f){super(),this['editor']=_0x1b4f31,this['textAdapter']=_0x239f17,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x5bda1f,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0xecf126,_0x3a1e23,_0x2deac0)=>{this['view']['value']=this['_sanitizeHTML'](_0x2deac0);}),this['listenTo'](this['view'],'submitPrompt',(_0x41441f,_0x56ac27)=>{const _0x1ffcc9=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x56ac27,_0x1ffcc9,'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:_0x2a9f70,query:_0x1e5d6c,htmlContent:_0x1a8809,label:_0x59de1f,mainActionLabel:_0x3398b7}){this['view']['prompt']=_0x59de1f,this['view']['mainAction']=_0x3398b7,this['initialContext']=_0x1a8809,_0x1e5d6c&&(this['view']['isRendered']?this['_handleQuery'](_0x1e5d6c,_0x1a8809,_0x2a9f70,_0x59de1f):this['view']['once']('render',()=>{this['_handleQuery'](_0x1e5d6c,_0x1a8809,_0x2a9f70,_0x59de1f);}));}['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'](_0x279b07,_0x2b5a1f,_0x427360,_0x6841c4){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2b5a1f,this['previousQuery']=_0x279b07,this['previousLabel']=_0x6841c4||_0x279b07,this['previousActionId']=_0x427360,new Promise(_0x2e4105=>{this['textAdapter']['makeRequest']({'query':_0x279b07,'context':_0x2b5a1f,'onData':_0x554e47=>{this['currentResponse']=_0x554e47,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x427360})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x27c14f=>{_0x27c14f instanceof R?this['view']['handleError'](_0x27c14f['message']):this['view']['handleError'](),_0x2e4105();})['finally'](()=>{this['stopProcessing'](),_0x2e4105();});});}['_parseAndNormalizeContent'](_0x27b52f,_0x15abf7=!0x1){const _0x42765a=Z['exec'](_0x27b52f);_0x27b52f=_0x42765a?_0x27b52f['substring'](_0x42765a[0x1]['length']):_0x27b52f['length']<0x64&&!_0x15abf7?'':this['_stripMarkdownSyntax'](_0x27b52f);const _0x17b076=this['_domParser']['parseFromString'](_0x27b52f,'text/html');if(_0x42765a){const _0x460bd9=Array['from'](_0x17b076['body']['childNodes']);_0x460bd9['reverse']();for(const _0x1d4be8 of _0x460bd9){if(_0x1d4be8['nodeType']==Node['ELEMENT_NODE'])break;_0x1d4be8['remove']();}}const _0x3132a4=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x17b076['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3132a4);const _0x16e1ae=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0xe26751=this['editor']['data']['toModel'](_0x3132a4);return _0x16e1ae||_0xe26751['markers']['clear'](),this['editor']['data']['stringify'](_0xe26751);}['_normalizeResponseHeadings'](_0x596b0e){const _0x5ef41e=new _0x3eb6b4(this['editor']['editing']['view']['document']),_0x538e32=new _0x52762e({'name':/^h[1-5]$/}),_0x10d345=[];let _0x437002=!0x1;for(const _0x3b3617 of _0x596b0e)_0x3b3617['is']('element')&&_0x538e32['match'](_0x3b3617)&&(_0x10d345['push'](_0x3b3617),'h1'==_0x3b3617['name']&&(_0x437002=!0x0));if(_0x437002){for(const _0x3eae13 of _0x10d345)_0x5ef41e['rename']('h'+(parseInt(_0x3eae13['name'][0x1])+0x1),_0x3eae13);}}['_isH1TagSupportEnabled'](){const {data:_0x426e4e,editing:_0xd4fbb0}=this['editor'],_0x1e4c96=_0x426e4e['htmlProcessor']['toView']('<h1></h1>'),_0x3528fe=_0x426e4e['toView'](_0x426e4e['toModel'](_0x1e4c96));return!!_0xd4fbb0['view']['domConverter']['viewToDom'](_0x3528fe)['querySelector']('h1');}['_sanitizeHTML'](_0x554166){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x554166),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x1a9ec1){const _0x2ea290=_0x1a9ec1['trim']();return _0x2ea290['startsWith']('```html')?_0x2ea290['endsWith']('```')?_0x2ea290['substring'](0x7,_0x2ea290['length']-0x3):_0x2ea290['substring'](0x7):_0x1a9ec1;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x21be65){super(_0x21be65),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x4a8be5=>i(_0x21be65,'AI_'+_0x4a8be5['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x21be65,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x21be65,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x21be65,'Stop'));const _0x45bf3a=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x45bf3a['if']('isVisible','ck-hidden',_0x505f02=>!_0x505f02)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x426f51,_0x348575){const _0x190dd4=new _0x5aa636(this['locale']);return _0x190dd4['set']({'label':_0x426f51,'class':_0x348575||'','isVisible':!0x0,'withText':!0x0}),_0x190dd4;}}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 _0x34409b{['contentFieldView'];['copyButtonView'];constructor(_0x2bf677,_0x3bbc23=''){super(_0x2bf677),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x5f087c=this['bindTemplate'];this['contentFieldView']=new mt(_0x2bf677,_0x3bbc23),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x5f087c['if']('isVisible','ck-hidden',_0x18af38=>!_0x18af38)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x5f087c['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 _0x240613=!0x1;this['on']('change:value',(_0x1fadc5,_0x2ca94f,_0xd29e58)=>{const _0x32aa61=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0xd29e58),this['isProcessing']&&_0x32aa61&&!_0x240613&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3546e4,_0x2483e3,_0x19085a)=>{_0x240613=!0x1,_0x19085a?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x240613=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x240613=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x37373f=this['locale'],_0xa20e2f=new _0x5aa636(this['locale']),_0x279861='ck-ai-form__copy-button';return _0xa20e2f['set']({'label':i(_0x37373f,'Copy'),'icon':W,'class':_0x279861,'tooltip':!0x0}),_0xa20e2f['bind']('isVisible')['to'](this,'value',_0x56a512=>!!_0x56a512),_0xa20e2f['bind']('isEnabled')['to'](this,'isProcessing',_0x383703=>!_0x383703),_0xa20e2f['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xa20e2f['icon']=_0x22d41d['check'],_0xa20e2f['class']=_0x279861+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xa20e2f['icon']=W,_0xa20e2f['class']=_0x279861;},0x3e8);}),_0xa20e2f;}['_copyHTMLToClipboard'](_0x13aa17){const {window:_0x47c892,document:_0x29c812}=_0x266000;if(_0x47c892['ClipboardItem']){const {Blob:_0x1e853f,ClipboardItem:_0x453a09}=_0x47c892,_0x501256=[new _0x453a09({'text/html':new _0x1e853f([_0x13aa17['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1e853f([_0x13aa17['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x501256);}else{const _0x195c46=_0x29c812['createElement']('div');_0x195c46['style']['position']='absolute',_0x195c46['style']['left']='-9999px',_0x195c46['innerHTML']='<span>[</span>'+_0x13aa17['innerHTML']+'<span>]</span>',_0x29c812['body']['appendChild'](_0x195c46);const _0x3a6470=_0x29c812['createRange']();_0x3a6470['setStartAfter'](_0x195c46['firstElementChild']),_0x3a6470['setEndBefore'](_0x195c46['lastElementChild']);const _0x396c3e=_0x47c892['getSelection']();_0x396c3e['removeAllRanges'](),_0x396c3e['addRange'](_0x3a6470),_0x29c812['execCommand']('copy'),_0x195c46['remove']();}}}class mt extends _0x34409b{constructor(_0x54f353,_0x4cb003=''){super(_0x54f353),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4cb003,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x228b0f){this['element']['innerHTML']=_0x228b0f;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x47a640=new _0x34409b(),_0xc3f07d=this['locale'],_0x28032e=new _0x2d1c37();return _0x28032e['isVisible']=!0x0,_0x47a640['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x28032e,{'text':i(_0xc3f07d,'AI\x20is\x20writing...')}]}),_0x47a640['render'](),_0x47a640;}}class rt extends _0x34409b{constructor(_0x4ec8ad,_0xfbba73=''){super(_0x4ec8ad);const _0x3a0e65=new _0x425587(),_0x172f8b=this['bindTemplate'];this['set']('text',_0xfbba73),_0x3a0e65['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':[_0x3a0e65,{'text':_0x172f8b['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x41487c,_0x115b88){super(_0x41487c,_0x115b88),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',(_0x3a76a1,_0x52e690)=>{_0x3a76a1['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x52e690());});}['_createSubmitButton'](){const _0x182f8a=new _0x5aa636(this['locale']),_0x35405b=this['locale'];return _0x182f8a['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(_0x35405b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x182f8a['on']('execute',()=>{this['submit']();}),_0x182f8a['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3d220a,_0x3b585d)=>!_0x3d220a&&_0x3b585d),_0x182f8a;}['_createShowHistoryButton'](){const _0x4caf6b=new _0x5aa636(this['locale']),_0x1726e1=this['resultsView'],_0x474389=this['locale'];_0x4caf6b['set']({'label':i(_0x474389,'History'),'withText':!0x1,'icon':_0x22d41d['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4caf6b['bind']('isOn')['to'](_0x1726e1,'isVisible'),_0x4caf6b['bind']('isEnabled')['to'](this,'isEnabled'),_0x4caf6b['on']('execute',()=>{_0x1726e1['isVisible']=!_0x1726e1['isVisible'],_0x1726e1['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2aef01=()=>{_0x266000['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x626e7f=new st(this['queryView']['fieldView']['element']),_0x3dd31d=_0x626e7f['width'],_0x176179='rtl'===_0x474389['uiLanguageDirection']?'left':'right';_0x626e7f['excludeScrollbarsAndBorders'](),_0x4caf6b['element']['style'][_0x176179]=_0x3dd31d-_0x626e7f['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2aef01),this['on']('render',_0x2aef01),_0x4caf6b;}['submit'](){const _0x1fa9c2=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x1fa9c2);}['focus'](_0x46f6a3){-0x1===_0x46f6a3?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x390c3e){super(_0x390c3e),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x390c3e,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xefaba=0x0;for(const _0x37c04b of this['items'])_0xefaba+=_0x37c04b['items']['length'];return{'resultsCount':_0xefaba,'totalItemsCount':_0xefaba};}['_createClearHistoryButton'](){const _0x45faa8=this['locale'],_0x31a82d=new _0x5aa636(this['locale']);return _0x31a82d['set']({'label':'('+i(_0x45faa8,'Clear')+')','withText':!0x0}),_0x31a82d['on']('execute',()=>this['fire']('clearHistory')),_0x31a82d;}}class hs extends _0x31d8b6{constructor(_0x31f1bf){super();const _0x767574=new te(),_0xb55b8a=new _0x5aa636(this['locale'],_0x767574);this['children']['add'](_0xb55b8a),_0xb55b8a['set']({'label':_0x31f1bf['prompt'],'withText':!0x0}),_0xb55b8a['on']('execute',()=>{this['fire']('execute',{'value':_0x1ea632(_0x31f1bf['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x4a9192{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x5b8b5e,_0x47f34e)=>{const _0x24350a=Ss(_0x47f34e['prompt']);for(const _0x2d8aa of this)if(_0x2d8aa!=_0x47f34e&&Ss(_0x2d8aa['prompt'])===_0x24350a){this['remove'](_0x2d8aa);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x17b150=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x17b150));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x419b7c=>_0x419b7c)));}}function Ss(_0x3920d1){return _0x3920d1['toLowerCase']()['trim']();}class k extends _0x34409b{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4d6382,_0x405d9a,_0x15b8bc=''){super(_0x4d6382),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(_0x4d6382),this['contentArea']=new X(_0x4d6382,_0x15b8bc),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 _0x48ec6c(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0xe29c3b({'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 _0x2c0a8b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x405d9a],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x2c0a8b['if']('isError','ck-hidden',_0x556e58=>!_0x556e58)]},'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'](_0x168811=0x1){-0x1===_0x168811?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 _0xa33e9a=this['locale'],_0x1d064c=new ht(_0xa33e9a,{'queryView':{'label':i(_0xa33e9a,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x1d2f3d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0xa33e9a,'Empty\x20history'),'secondary':i(_0xa33e9a,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1d064c['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3fdfe6,_0x2cf52c)=>_0x3fdfe6&&!_0x2cf52c),this['listenTo'](_0x1d064c,'submit',(_0x21fb95,_0x5775e1)=>{this['prompt']=_0x5775e1;const _0x2aaad5=_0x577377(_0x5775e1);this['fire']('submitPrompt',_0x2aaad5),_0x5775e1['trim']()&&this['_promptHistory']['add']({'prompt':_0x2aaad5},0x0);},{'priority':'high'}),_0x1d064c;}['_createHistoryView'](){const _0x3276e6=new rs(this['locale']);return _0x3276e6['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x3276e6['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3276e6;}['_createToolbar'](){const _0xbb2023=new at(this['locale']);return _0xbb2023['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x477061,_0x50ff77,_0x5b8107)=>_0x477061&&!_0x50ff77&&!!_0x5b8107),_0xbb2023['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xbb2023['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x475805,_0x5afb0d,_0xdfef17)=>_0x475805&&!_0x5afb0d&&!!_0xdfef17),_0xbb2023['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xbb2023['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x46a369,_0x639c72)=>_0x46a369&&!_0x639c72),_0xbb2023['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xbb2023['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xbb2023['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xbb2023;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x267f04=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x267f04,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4bd64f){const _0x3c039b=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4bd64f||i(_0x3c039b,'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 _0x40d9f6{['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[_0x8a8690,a,K,_0x4d2dd2];}constructor(_0xd4755c){super(_0xd4755c),_0xd4755c['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0xd4755c['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0xd4755c['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xd4755c['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x29c497}=this;this['_aiAdapter']=_0x29c497['plugins']['get'](K),this['_dialog']=_0x29c497['plugins']['get'](_0x4d2dd2),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x5dc035=new E(_0x29c497,Array['from'](this['_commandDefinitions']['values']()));_0x29c497['commands']['add']('showAIAssistant',_0x5dc035),_0x29c497['ui']['componentFactory']['add']('aiCommands',_0x5448ce=>{const _0x41f954=_0x279645(_0x5448ce);return _0x41f954['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x41f954['buttonView']['set']({'label':i(_0x5448ce,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x41f954['on']('execute',_0x26af20=>this['_onExecute'](_0x26af20['source']['id'])),_0x9fbfcd(_0x41f954,_0x29c497['ui']['view']['body'],function(_0xb12cfa){const _0x3faa8e=o(_0xb12cfa['config']['get']('ai.aiAssistant.commands'),_0xb12cfa['locale']),_0x24fabd=U(_0xb12cfa,_0x3faa8e)['filter'](_0x1b58e4=>_0x1b58e4['commands']['length']);if(0x1===_0x24fabd['length'])return U(_0xb12cfa,_0x24fabd[0x0]['commands'])['map'](_0x3068d1=>({'id':_0x3068d1['id'],'label':_0x3068d1['label']}));return _0x24fabd['map'](_0x10c8fc=>{const {groupId:_0x42e047,groupLabel:_0x2981b7,commands:_0x296c6d}=_0x10c8fc,_0x43b0de=U(_0xb12cfa,_0x296c6d)['map'](_0x4f1a76=>({'id':_0x4f1a76['id'],'label':_0x4f1a76['label']}));return{'id':_0x42e047,'menu':_0x2981b7||_0x42e047,'children':_0x43b0de};});}(_0x29c497),{'ariaLabel':i(_0x5448ce,'AI\x20Commands')}),_0x41f954['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x5dc035['on']('change:enabledCommandsIds',_0x4511f3),_0x41f954['menuView']['once']('render',_0x4511f3),_0x41f954;function _0x4511f3(){_0x41f954['isEnabled']=_0x5dc035['enabledCommandsIds']['length']>0x0;for(const _0x470261 of _0x41f954['menuView']['buttons'])_0x470261['isEnabled']=_0x5dc035['enabledCommandsIds']['includes'](_0x470261['id']);}}),_0x29c497['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1ddf22=>{const _0x25961a=new _0x293cc5(_0x1ddf22);_0x25961a['buttonView']['set']({'label':i(_0x1ddf22,'AI\x20Commands'),'icon':T}),_0x25961a['bind']('isEnabled')['to'](_0x5dc035,'enabledCommandsIds',_0x51af54=>_0x51af54['length']>0x0);const _0x3ab42b=o(_0x29c497['config']['get']('ai.aiAssistant.commands'),_0x1ddf22);return this['_populateMenuBarMenu'](_0x5dc035,_0x25961a,_0x3ab42b,_0x5b2037=>this['_onExecute'](_0x5b2037)),_0x25961a;}),_0x29c497['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x35d4d2=this['_createAIAssistantUIButton'](_0x5aa636);return _0x35d4d2['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x35d4d2;}),_0x29c497['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x2d9b2f=this['_createAIAssistantUIButton'](_0x2a0b0f);return _0x2d9b2f['set']({'role':'menuitemcheckbox'}),_0x2d9b2f;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4d1c90=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4f993d;for(const _0x3b566a in _0x4d1c90){const _0x28dcb0=_0x3b566a,_0x1ebd6f=_0x4d1c90[_0x28dcb0];if('aiLicenseKeyValid'==_0x1ebd6f||'aiLicenseKeyInvalid'==_0x1ebd6f||'aiLicenseKeyExpired'==_0x1ebd6f||'aiLicenseKeyDomainLimit'==_0x1ebd6f||'aiLicenseKeyNotAllowed'==_0x1ebd6f||'aiLicenseKeyEvaluationLimit'==_0x1ebd6f||'aiLicenseKeyTrialLimit'==_0x1ebd6f||'aiLicenseKeyUsageLimit'==_0x1ebd6f){delete _0x4d1c90[_0x28dcb0],_0x4f993d=_0x1ebd6f,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4f993d&&_0x4d1c90['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4f993d&&_0x4d1c90['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4f993d&&_0x4d1c90['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4f993d&&_0x4d1c90['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4f993d&&_0x4d1c90['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4f993d&&_0x4d1c90['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x4f993d&&_0x4d1c90['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x210bb7='',_0x5a97c1='',_0xeb1d40='custom'){const _0x6a0e25=this['editor'],_0x5c9840=_0x6a0e25['editing']['view'],_0xe23ea4=_0x6a0e25['plugins']['get'](a),_0xb8ba6b=_0x6a0e25['plugins']['get'](_0x8a8690);_0xe23ea4['showFakeVisualSelection']();const _0xc31855=new w(),_0x3e3a73=new ClipboardEvent('copy',{'clipboardData':_0xc31855}),_0x18f793=new _0x4235d1(_0xc31855),_0x46fb0e=new _0x21c908(_0x5c9840,_0x3e3a73,{'dataTransfer':_0x18f793});_0xb8ba6b['_forceMarkersCopy']('comment',()=>{_0x5c9840['document']['fire']('copy',_0x46fb0e);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x6a0e25,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x271d0a=_0x18f793['getData']('text/html');const _0x27f5a8=_0x6a0e25['model']['document']['selection'],_0x545891=Array['from'](_0x27f5a8['getRanges']());0x1===_0x545891['length']&&_0x545891[0x0]['isFlat']&&!_0x27f5a8['getSelectedElement']()&&''!==_0x271d0a['replace'](/ /g,'')['trim']()&&(_0x271d0a='<p>'+_0x271d0a+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xeb1d40,'query':_0x210bb7,'htmlContent':_0x271d0a,'label':_0x5a97c1,'mainActionLabel':M[_0x6a0e25['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':_0x1bd101['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0xe23ea4['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xec31c=new Map(),_0x5734bf=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4a39d4 of _0x5734bf)for(const _0x51fa43 of _0x4a39d4['commands'])_0xec31c['set'](_0x51fa43['id'],{..._0x51fa43,'groupId':_0x4a39d4['groupId'],'groupLabel':_0x4a39d4['groupLabel']||_0x4a39d4['groupId']});return _0xec31c;}['_createAIAssistantUIButton'](_0x344cad){const _0x5d2515=this['editor'],_0x280c8a=_0x5d2515['commands']['get']('showAIAssistant'),_0x5b2164=new _0x344cad(_0x5d2515['locale']);return _0x5b2164['set']({'label':i(_0x5d2515['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x5b2164['bind']('isEnabled')['to'](_0x280c8a),_0x5b2164['bind']('isOn')['to'](this['_dialog'],'id',_0x47bc51=>'aiAssistant'===_0x47bc51),this['listenTo'](_0x5b2164,'execute',()=>{_0x5b2164['isOn']?this['hideUI']():_0x280c8a['execute']();}),_0x5b2164;}['_initView'](){const _0x273cbe=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',()=>{_0x273cbe['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x273cbe['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x383669,ui:{ariaLiveAnnouncer:_0x2140d2}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2fb8fd,_0x2d618d,_0x55254d)=>{const _0x43de7f=this['_aiAssistantController']['currentContext'];_0x55254d?_0x2140d2['announce'](i(_0x383669,'AI\x20is\x20writing')):_0x43de7f&&_0x2140d2['announce'](i(_0x383669,'Generated\x20content:\x20%0',_0x43de7f),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x108e05,_0x2ba955,_0x5be3c6)=>{if(_0x5be3c6){const _0x48ec08=this['_formView']['errorView']['text'];_0x2140d2['announce'](i(_0x383669,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x48ec08));}});}['_onExecute'](_0x3d71d6){const _0xcfcc1a=this['_commandDefinitions']['get'](_0x3d71d6),_0x2f33d9=this['editor'],_0xff006=_0x2f33d9['model']['document']['selection'],_0x1b66bc=_0x2f33d9['commands']['get']('showAIAssistant'),_0x441324=_0x2f33d9['plugins']['get'](a),_0x491faa=''+(_0xcfcc1a['groupId']!==x?_0xcfcc1a['groupLabel']+':\x20':'')+_0xcfcc1a['label'];if(!0x1!==_0xcfcc1a['requiresContent']&&_0xff006['isCollapsed']){const _0x21e728=_0x45ead6(_0xff006['getSelectedBlocks']())||_0x2f33d9['model']['schema']['getLimitElement'](_0xff006);_0x2f33d9['model']['change'](_0x1b8a1c=>{_0x1b8a1c['setSelection'](_0x21e728,'in');});}_0x441324['showFakeVisualSelection'](),_0x1b66bc['execute'](_0xcfcc1a['prompt'],_0x491faa,'command:'+_0x3d71d6);}['_populateMenuBarMenu'](_0x134aa8,_0x15efe0,_0x59021f,_0xa956ea){const _0x38947f=this['editor'],_0x18facb=_0x38947f['locale'],_0x288001=new _0x20387c(_0x18facb),_0x2e658e=U(_0x38947f,_0x59021f)['filter'](_0x2955e3=>_0x2955e3['commands']['length']);0x1===_0x2e658e['length']?this['_getMenuBarGroupButtons']({'command':_0x134aa8,'commands':_0x2e658e[0x0]['commands'],'parentMenuView':_0x15efe0,'onExecute':_0xa956ea})['forEach'](_0x5d9c39=>_0x288001['items']['add'](_0x5d9c39)):_0x2e658e['forEach'](({groupId:_0x43ccd2,groupLabel:_0x5af723,commands:_0x1135f4})=>{const _0x4a8da5=new _0xd4143c(_0x18facb,_0x15efe0),_0x350c68=new _0x293cc5(_0x18facb),_0x3843c0=new _0x20387c(_0x18facb),_0x435e5b=this['_getMenuBarGroupButtons']({'command':_0x134aa8,'commands':_0x1135f4,'parentMenuView':_0x350c68,'onExecute':_0xa956ea});_0x350c68['buttonView']['set']({'label':_0x5af723||_0x43ccd2}),_0x350c68['delegate']('execute')['to'](_0x15efe0),_0x3843c0['items']['addMany'](_0x435e5b),_0x350c68['panelView']['children']['add'](_0x3843c0),_0x4a8da5['children']['add'](_0x350c68),_0x288001['items']['add'](_0x4a8da5);}),_0x15efe0['panelView']['children']['add'](_0x288001);}['_getMenuBarGroupButtons']({command:_0x5c22eb,commands:_0x675b89,parentMenuView:_0x2705d5,onExecute:_0x538163}){const _0x4da3a5=this['editor'],_0x4bd301=_0x4da3a5['locale'];return U(_0x4da3a5,_0x675b89)['map'](_0x411add=>{const _0x24bb7a=new _0xd4143c(_0x4bd301,_0x2705d5),_0x126640=new _0x2a0b0f(_0x4bd301);return _0x126640['set']({'label':_0x411add['label']}),_0x126640['delegate']('execute')['to'](_0x2705d5),_0x126640['on']('execute',()=>_0x538163(_0x411add['id'])),_0x126640['bind']('isEnabled')['to'](_0x5c22eb,'enabledCommandsIds',_0x4ba94a=>_0x4ba94a['includes'](_0x411add['id'])),_0x24bb7a['children']['add'](_0x126640),_0x24bb7a;});}}function B(_0x3e2805,_0x101c81){return void 0x0!==_0x3e2805['order']&&void 0x0===_0x101c81['order']?0x1:void 0x0===_0x3e2805['order']&&void 0x0!==_0x101c81['order']?-0x1:void 0x0!==_0x3e2805['order']&&void 0x0!==_0x101c81['order']?_0x3e2805['order']-_0x101c81['order']:0x0;}function U(_0x2555bd,_0x318056){_0x318056['sort'](B);const _0x20ef5d={},_0x193c0a=[];for(const _0xb4e6f of _0x318056)if(void 0x0!==_0xb4e6f['order']){if(_0xb4e6f['order']in _0x20ef5d)throw new _0x504032('ai-commands-config-order-collision',_0x2555bd,{'conflictingDefinitions':[_0xb4e6f,_0x20ef5d[_0xb4e6f['order']]]});_0x20ef5d[_0xb4e6f['order']]=_0xb4e6f,_0x193c0a['splice'](_0xb4e6f['order'],0x0,_0xb4e6f);}else _0x193c0a['push'](_0xb4e6f);return _0x193c0a;}class r extends _0x40d9f6{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x407fc4){super(_0x407fc4);const _0x4a1140=_0x407fc4['config'],_0x3f4dc2=_0x407fc4['locale'];_0x4a1140['define']('ai.aiAssistant.preserveComments',!0x0),_0x4a1140['define']('ai.aiAssistant.commands',function(_0x4a0187){return[{'groupId':'editOrReview','groupLabel':i(_0x4a0187,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x4a0187,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x4a0187,'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(_0x4a0187,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x4a0187,'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(_0x4a0187,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x4a0187,'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(_0x4a0187,'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(_0x4a0187,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x4a0187,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x4a0187,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x4a0187,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x4a0187,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x4a0187,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x4a0187,'Change\x20style'),'commands':[{'id':'business','label':i(_0x4a0187,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x4a0187,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x4a0187,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x4a0187,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x4a0187,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x4a0187,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x4a0187,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x4a0187,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x4a0187,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x4a0187,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x4a0187,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x4a0187,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x4a0187,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3f4dc2)),_0x4a1140['define']('ai.aiAssistant.extraCommandGroups',[]),_0x4a1140['define']('ai.aiAssistant.removeCommands',[]);let _0xaad919=o(_0x4a1140['get']('ai.aiAssistant.commands'),_0x3f4dc2);const _0x3ed9b4=_0x4a1140['get']('ai.aiAssistant.extraCommandGroups'),_0x529419=_0x4a1140['get']('ai.aiAssistant.removeCommands');_0x3ed9b4['forEach'](_0x1ca5f6=>{const _0x24f55f=_0xaad919['find'](_0x35ad09=>_0x35ad09['groupId']===_0x1ca5f6['groupId']);_0x24f55f?_0x24f55f['commands']=_0x24f55f['commands']['concat'](_0x1ca5f6['commands']):_0xaad919['push'](_0x1ca5f6);}),_0xaad919=_0xaad919['filter'](_0x17b8f2=>!_0x529419['includes'](_0x17b8f2['groupId'])),_0xaad919['forEach'](_0x75c407=>{_0x75c407['commands']=_0x75c407['commands']['filter'](_0x4dfc8d=>!_0x529419['includes'](_0x4dfc8d['id']));}),_0x4a1140['set']('ai.aiAssistant.commands',_0xaad919);}}class P extends _0x40d9f6{['abortController'];static get['requires'](){return[K];}constructor(_0x3d6482){super(_0x3d6482),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'](_0x104e8c){return this['sendRequest'](_0x104e8c)['catch'](_0x24f6be=>{if(_0x24f6be instanceof R)return Promise['reject'](_0x24f6be);if('AbortError'==_0x24f6be['name'])return Promise['resolve']();throw console['error'](_0x24f6be),new _0x504032('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x18272b,_0x2d3785){const _0x32dd67=this['editor']['locale'],_0x52a708={'Content-Type':'application/json'};if('object'==typeof _0x18272b)Object['assign'](_0x52a708,_0x18272b);else{if(_0x18272b)try{const _0x1c5c8c=await _0x18272b(_0x2d3785);Object['assign'](_0x52a708,_0x1c5c8c);}catch(_0x334f3b){return Promise['reject'](new R(i(_0x32dd67,'AI_ERROR_GET_HEADERS')));}}return _0x52a708;}async['_prepareRequestParameters'](_0x168b05,_0x307e5e){const _0x2638e7=this['editor']['locale'];if('object'==typeof _0x168b05)return _0x168b05;try{return await _0x168b05(_0x307e5e);}catch(_0x1ac6e6){return Promise['reject'](new R(i(_0x2638e7,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1084de){super(_0x1084de),_0x1084de['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1084de['config']['get']('ai.openAI.requestParameters')||_0x1084de['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1084de['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x1084de['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x1084de['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x45b99e,context:_0x305287,onData:_0x50b1bd,actionId:_0xa63405}){const _0xabe539=this['editor']['locale'],_0x528644=await this['prepareMessages'](_0x45b99e,_0x305287,_0xa63405),_0x297a52=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xa63405),_0x177795=await this['_prepareRequestParameters'](this['_requestParameters'],_0xa63405),_0x9fa2f7={'messages':_0x528644,..._0x177795},_0x2bcb55={'method':'POST','headers':_0x297a52,'body':JSON['stringify'](_0x9fa2f7),'signal':this['abortController']['signal']},_0x226e50=await fetch(this['_apiUrl'],_0x2bcb55);if(_0x226e50['ok'])return _0x177795['stream']?await this['_readStreamableResponse'](_0x226e50,_0x50b1bd):await this['_readStaticResponse'](_0x226e50,_0x50b1bd),Promise['resolve']();{const _0xb6a349=await _0x226e50['text']();return _0xb6a349['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0xabe539,'AI_ERROR_CONTEXT_LENGTH'))):_0xb6a349['includes']('Moderation')?Promise['reject'](new R(i(_0xabe539,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0xb6a349));}}async['prepareMessages'](_0x5e8d4a,_0x3415f1,_0x5071fc){let _0x2d130b,_0x2fcc17;return _0x3415f1?(_0x2d130b='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.',_0x2fcc17='Instruction:\x0a'+_0x5e8d4a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3415f1):(_0x2d130b='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.',_0x2fcc17=_0x5e8d4a),[{'role':'system','content':_0x2d130b},{'role':'user','content':_0x2fcc17}];}async['_readStreamableResponse'](_0x254cf3,_0x1f20a1){const _0x19959c=_0x254cf3['body']['getReader'](),_0x1420e2=new TextDecoder();let _0x4bd569='',_0x224ada='',_0x28d11a='',_0x503c8d=!0x1;for(;!_0x503c8d;){const {done:_0x29dd72,value:_0x20bb14}=await _0x19959c['read'](),_0x3c0310=_0x4bd569+_0x1420e2['decode'](_0x20bb14);let _0x3941dc='';_0x503c8d=_0x29dd72;try{_0x3941dc=this['_cleanUpData'](_0x3c0310),_0x4bd569='';}catch(_0x1cdb9e){_0x4bd569=_0x3c0310;continue;}_0x224ada+=_0x3941dc,!_0x503c8d&&this['_isBufferIncomplete'](_0x224ada)||_0x224ada&&(_0x28d11a+=_0x224ada,_0x224ada='',_0x1f20a1(_0x28d11a));}return Promise['resolve']();}async['_readStaticResponse'](_0x4b0788,_0x229c3e){return _0x229c3e((await _0x4b0788['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x41e62d){const _0x22aa80=_0x41e62d['split']('<')['length']!==_0x41e62d['split']('>')['length'],_0x4e8ccd=_0x41e62d['length']<0x1e;return _0x22aa80&&_0x4e8ccd;}['_cleanUpData'](_0x28eb4c){return _0x28eb4c['split'](/\n(?![^{]*\})/g)['map'](_0xb4986b=>_0xb4986b['replace']('data:\x20',''))['filter'](_0x15b9fe=>_0x15b9fe&&_0x15b9fe['length']>0x0&&'[DONE]'!==_0x15b9fe)['map'](_0x16fb0c=>{const {choices:_0x558034}=JSON['parse'](_0x16fb0c);if(_0x558034[0x0]&&_0x558034[0x0]['delta']&&_0x558034[0x0]['delta']['content'])return _0x558034[0x0]['delta']['content'];})['filter'](_0x28dddf=>_0x28dddf)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1cbb9a){super(_0x1cbb9a),_0x1cbb9a['config']['get']('ai.aws.requestParameters')||_0x1cbb9a['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']=_0x1cbb9a['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1cbb9a['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1cbb9a['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1cbb9a['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x52de3a,context:_0x18d091,onData:_0xc3cc48,actionId:_0x2c3876}){const {model:_0x488f3e,stream:_0x3a7aa7,..._0x106281}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2c3876),_0x20ec88={'prompt':await this['preparePrompt'](_0x52de3a,_0x18d091,_0x488f3e,_0x2c3876),..._0x106281};this['_apiUrl']?await this['_processProxyRequest'](_0x20ec88,_0x488f3e,_0x3a7aa7,_0xc3cc48,_0x2c3876):await this['_processAWSRequest'](_0x20ec88,_0x488f3e,_0x3a7aa7,_0xc3cc48);}async['preparePrompt'](_0x52b8f8,_0x5a2af1,_0x520213,_0x52cc97){let _0x286335,_0x213e44;return _0x5a2af1?(_0x286335='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.',_0x213e44='Instruction:\x0a'+_0x52b8f8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x5a2af1):(_0x286335='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.',_0x213e44=_0x52b8f8),'meta.llama'==this['getModelFamily'](_0x520213)?'<<SYS>>\x0a'+_0x286335+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x213e44+'\x0a[/INST]':'Human:\x0a'+_0x286335+'\x0a'+_0x213e44+'\x0a\x0aAssistant:';}['getModelFamily'](_0x193103){if(/^anthropic\.claude/['test'](_0x193103))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x193103))return'ai21.j2';if(/^cohere\.command/['test'](_0x193103))return'cohere.command';if(/^meta\.llama/['test'](_0x193103))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x193103));}async['_processProxyRequest'](_0x525ceb,_0x5345a6,_0x2a054f,_0x3e4d23,_0x2c1b50){const _0x47bd52={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2c1b50),'body':JSON['stringify']({..._0x525ceb,'model':_0x5345a6,'stream':_0x2a054f}),'signal':this['abortController']['signal']},_0x1c4342=await fetch(this['_apiUrl'],_0x47bd52);_0x2a054f?await this['_readStreamableResponse'](_0x1c4342,_0x5345a6,_0x3e4d23):await this['_readStaticResponse'](_0x1c4342,_0x5345a6,_0x3e4d23);}async['_processAWSRequest'](_0x38088d,_0x1f2701,_0x2e42e7,_0x2c3261){const _0x4e034c=new _0x2ad3ae(this['_bedrockClientConfig']),_0x131344={'body':JSON['stringify'](_0x38088d),'contentType':'application/json','accept':'application/json','modelId':_0x1f2701};let _0x1b8cab;if(_0x2e42e7){const _0x1c8c9f=new _0x43f8f6(_0x131344);_0x1b8cab=await _0x4e034c['send'](_0x1c8c9f,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x1b8cab,_0x1f2701,_0x2c3261);}else{const _0x568f01=new _0x2e666d(_0x131344);_0x1b8cab=await _0x4e034c['send'](_0x568f01,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x1b8cab,_0x1f2701,_0x2c3261);}}async['_readAsyncIterableResponse'](_0x120c14,_0x592be6,_0x398f40){const _0x17630a=_0x120c14['body'],_0x6914dc=new TextDecoder('utf-8');let _0x568500='';for await(const _0x556e91 of _0x17630a)if(_0x556e91['chunk']){const _0x23319e=_0x6914dc['decode'](_0x556e91['chunk']['bytes']),_0x2b8b60=JSON['parse'](_0x23319e);_0x568500+=this['_getGeneratedText'](_0x2b8b60,_0x592be6),_0x398f40(_0x568500);}return Promise['resolve']();}async['_readStreamableResponse'](_0x525f84,_0x2e93d6,_0x1c7682){const _0x2c41d4=_0x525f84['body'],_0x17f314=new TextDecoder('utf-8'),_0x2a695a=_0x2c41d4['getReader']();let _0x8f177='',_0x131e17='',_0x4a457d=!0x1;for(;!_0x4a457d;){const {done:_0x3c1b18,value:_0x1bd4b4}=await _0x2a695a['read']();if(_0x4a457d=_0x3c1b18,_0x4a457d)break;const _0x14d418=(_0x8f177+_0x17f314['decode'](_0x1bd4b4))['split']('\x0a')['map'](_0x41e4fe=>{try{return _0x8f177='',JSON['parse'](_0x41e4fe);}catch(_0x507120){return _0x8f177=_0x41e4fe,null;}})['filter'](_0x45b5c7=>null!==_0x45b5c7);_0x14d418['length']&&(_0x131e17+=_0x14d418['map'](_0x592b7d=>this['_getGeneratedText'](_0x592b7d,_0x2e93d6))['join'](''),_0x1c7682(_0x131e17));}return Promise['resolve']();}async['_readStaticResponse'](_0x5e0b0a,_0x420242,_0x427e17){let _0x7ce26;return _0x7ce26=_0x5e0b0a instanceof Response?await _0x5e0b0a['json']():JSON['parse'](Buffer['from'](_0x5e0b0a['body'])['toString']('utf8')),(_0x427e17(this['_getGeneratedText'](_0x7ce26,_0x420242)),Promise['resolve']());}['_getGeneratedText'](_0x5fd5ed,_0xdd2742){switch(this['getModelFamily'](_0xdd2742)){case'anthropic.claude':return _0x5fd5ed['completion'];case'ai21.j2':return _0x5fd5ed['completions'][0x0]['data']['text'];case'cohere.command':return _0x5fd5ed['generations'][0x0]['text'];case'meta.llama':return _0x5fd5ed['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 _0x43c8eb,Command as _0x450b76,icons as _0x44adb6}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x2e3328,CKEditorError as _0x4c9cbe,ObservableMixin as _0x4affed,global as _0x2f7c0b,isVisible as it,Rect as st,Collection as _0x5a641f,FocusTracker as _0x3f6854,KeystrokeHandler as ts,first as _0x27e7bd}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as nt,ButtonView as _0x9d68df,View as _0x10ae76,SpinnerView as _0x28d8f2,IconView as _0x5d5b06,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x1701e2,ButtonLabelView as te,FocusCycler as _0x4921d3,createLabeledTextarea as _0x13830b,Dialog as _0x1578d5,createDropdown as _0x4d8827,addMenuToDropdown as _0x4e043b,MenuBarMenuView as _0x4aa2c8,MenuBarMenuListItemButtonView as _0x3b6759,DialogViewPosition as _0x41b3e6,MenuBarMenuListView as _0x741c4e,MenuBarMenuListItemView as _0x43c40c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as ct}from'ckeditor5-collaboration/dist/index.js';import{ClipboardPipeline as _0x581b4f,ClipboardMarkersUtils as _0x5771c3}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x2b5c36,DataTransfer as _0x5df0cb,UpcastWriter as _0x187ffb,Matcher as _0x2c2625}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x37d8cd,escape as _0x3ce171}from'lodash-es';import{BedrockRuntimeClient as _0x4792ed,InvokeModelWithResponseStreamCommand as _0x50c3b9,InvokeModelCommand as _0x2ea9dc}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x5b8289,_0x1b04eb){const _0x27c095=(0x0,_0x1b04eb['t'])('Other');return _0x5b8289['length']?'groupId'in _0x5b8289[0x0]?_0x5b8289:[{'groupId':x,'groupLabel':_0x27c095,'order':0x1/0x0,'commands':_0x5b8289}]:[{'groupId':x,'groupLabel':_0x27c095,'order':0x1/0x0,'commands':[]}];}const dt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x43c8eb{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1db8de}=this,_0x411863=['ck-fake-ai-selection'];_0x1db8de['config']['get']('ai.useTheme')&&_0x411863['push']('ck-ai-assistant-ui_theme'),_0x1db8de['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x411863,'priority':0xc}}),_0x1db8de['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x86c11f,{writer:_0x109145})=>{if(!_0x86c11f['markerRange']['isCollapsed'])return null;const _0x38ae35=_0x109145['createUIElement']('span');return _0x109145['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x38ae35),_0x38ae35;}});}['afterInit'](){!async function(_0x3976f4){const _0x50af1f=_0x14b547([0x6d,0x4c,0x57,0x4b,0x37,0x44,0x66,0x36,0x38,0x41,0x64,0x61,0x63,0x68,0x72,0x34,0x54,0x32,0x5a,0x47,0x6c,0x4d,0x55,0x75,0x4e,0x52,0x31,0x59,0x53,0x6a,0x77,0x4f,0x74,0x51,0x71,0x33,0x46,0x35,0x6b,0x70,0x6f,0x73,0x58,0x50,0x79,0x67,0x56,0x6e,0x43,0x39,0x49,0x76,0x4a,0x65,0x45,0x69,0x48,0x30,0x42,0x78,0x7a,0x62]),_0x31b399=0x1a84921,_0x49005b=0x1af1669^_0x31b399,_0x1c9e78=window[_0x14b547([0x44,0x61,0x74,0x65])][_0x14b547([0x6e,0x6f,0x77])](),_0x1269b0=_0x3976f4[_0x14b547([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2ae1c8=new window[(_0x14b547([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5af08e=>{_0x1269b0[_0x14b547([0x6f,0x6e,0x63,0x65])](_0x14b547([0x72,0x65,0x61,0x64,0x79]),_0x5af08e);}),_0x1d90f6={[_0x14b547([0x6b,0x74,0x79])]:_0x14b547([0x45,0x43]),[_0x14b547([0x75,0x73,0x65])]:_0x14b547([0x73,0x69,0x67]),[_0x14b547([0x63,0x72,0x76])]:_0x14b547([0x50,0x2d,0x32,0x35,0x36]),[_0x14b547([0x78])]:_0x14b547([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]),[_0x14b547([0x79])]:_0x14b547([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]),[_0x14b547([0x61,0x6c,0x67])]:_0x14b547([0x45,0x53,0x32,0x35,0x36])},_0x5200ae=_0x1269b0[_0x14b547([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x14b547([0x67,0x65,0x74])](_0x14b547([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x519603(){let _0x3dcba1,_0x49ede3=null,_0x150fcb=null;try{if(_0x5200ae==_0x14b547([0x47,0x50,0x4c]))return _0x14b547([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3dcba1=_0x7d8b39(),!_0x3dcba1)return _0x14b547([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3dcba1[_0x14b547([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x150fcb=_0x1be0ec(_0x3dcba1[_0x14b547([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3dcba1[_0x14b547([0x6a,0x74,0x69])])),await _0x233de9()?_0x430691()?_0x116fe0()?_0x14b547([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4c4b7b()?(_0x3dcba1[_0x14b547([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x14b547([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x49ede3=_0x2fc334(_0x14b547([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3dcba1[_0x14b547([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x14b547([0x74,0x72,0x69,0x61,0x6c])&&(_0x49ede3=_0x2fc334(_0x14b547([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x40db8b()):_0x14b547([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x14b547([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x14b547([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x230d01){return _0x14b547([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x116fe0(){const _0x12ebca=[_0x14b547([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x14b547([0x74,0x72,0x69,0x61,0x6c])][_0x14b547([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3dcba1[_0x14b547([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x1c9e78/0x3e8:0xe10*_0x49005b;return _0x3dcba1[_0x14b547([0x65,0x78,0x70])]<_0x12ebca;}function _0x430691(){const _0x28f077=_0x3dcba1[_0x14b547([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x28f077&&(!!_0x28f077[_0x14b547([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x14b547([0x2a]))||!!_0x28f077[_0x14b547([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x14b547([0x41,0x49])));}function _0x4c4b7b(){const _0x4667e0=_0x3dcba1[_0x14b547([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x4667e0||0x0==_0x4667e0[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x51e9c3}=new URL(window[_0x14b547([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x4667e0[_0x14b547([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x51e9c3))return!0x0;const _0xe16a30=_0x51e9c3[_0x14b547([0x73,0x70,0x6c,0x69,0x74])](_0x14b547([0x2e]));return _0x4667e0[_0x14b547([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x467764=>_0x467764[_0x14b547([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x14b547([0x2a])))[_0x14b547([0x6d,0x61,0x70])](_0x370fc6=>_0x370fc6[_0x14b547([0x73,0x70,0x6c,0x69,0x74])](_0x14b547([0x2e])))[_0x14b547([0x73,0x6f,0x6d,0x65])](_0x4f296e=>_0xe16a30[_0x14b547([0x65,0x76,0x65,0x72,0x79])]((_0x66e9b9,_0x42b2cb)=>_0x4f296e[_0x42b2cb]===_0x66e9b9||_0x4f296e[_0x42b2cb]===_0x14b547([0x2a])));}function _0x40db8b(){return _0x49ede3&&_0x150fcb?new window[(_0x14b547([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x7a46e2,_0x18932a)=>{_0x49ede3[_0x14b547([0x74,0x68,0x65,0x6e])](_0x7a46e2,_0x18932a),_0x150fcb[_0x14b547([0x74,0x68,0x65,0x6e])](_0x594ef3=>{_0x594ef3!=_0x14b547([0x56,0x61,0x6c,0x69,0x64])&&_0x7a46e2(_0x594ef3);},_0x18932a);}):_0x49ede3||_0x150fcb||_0x14b547([0x56,0x61,0x6c,0x69,0x64]);}}function _0x1be0ec(_0x3302d4,_0x273a03){return new window[(_0x14b547([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5566d6=>{if(_0x567daa())return _0x5566d6(_0x14b547([0x56,0x61,0x6c,0x69,0x64]));_0x178c5b(),_0x1269b0[_0x14b547([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x14b547([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x2a4e32=!0x1;const _0x3631dc=_0x2e3328();function _0x2d9601(_0x16b31e){return!!_0x16b31e&&(typeof _0x16b31e===_0x14b547([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x16b31e===_0x14b547([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x16b31e[_0x14b547([0x74,0x68,0x65,0x6e])]===_0x14b547([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x16b31e[_0x14b547([0x63,0x61,0x74,0x63,0x68])]===_0x14b547([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x21b49f(_0x17a743){_0x20af2c(_0x17a743)[_0x14b547([0x74,0x68,0x65,0x6e])](_0x316c40=>{if(!_0x316c40||_0x316c40[_0x14b547([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x14b547([0x6f,0x6b]))return _0x14b547([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1db271(_0x3c4ba2(_0x3631dc+_0x273a03))!=_0x316c40[_0x14b547([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x14b547([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x14b547([0x56,0x61,0x6c,0x69,0x64]);})[_0x14b547([0x74,0x68,0x65,0x6e])](_0x25804f=>(_0x55c97d(),_0x25804f),()=>{const _0x90e148=_0x5339b4();return null==_0x90e148?(_0x55c97d(),_0x14b547([0x56,0x61,0x6c,0x69,0x64])):_0x14b547(_0x1c9e78-_0x90e148>(0x25a4cd21^_0x31b399)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x14b547([0x74,0x68,0x65,0x6e])](_0x5566d6)[_0x14b547([0x63,0x61,0x74,0x63,0x68])](()=>{_0x5566d6(_0x14b547([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x15cf35=0x19ea7a1^_0x31b399;function _0x55c97d(){const _0x2364d3=_0x14b547([0x6c,0x6c,0x63,0x74,0x2d])+_0x1db271(_0x3c4ba2(_0x3302d4)),_0x6bd4c6=_0x21ac56(_0x1db271(window[_0x14b547([0x4d,0x61,0x74,0x68])][_0x14b547([0x63,0x65,0x69,0x6c])](_0x1c9e78/_0x15cf35)));window[_0x14b547([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x14b547([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2364d3,_0x6bd4c6);}function _0x5339b4(){const _0x201d2d=_0x14b547([0x6c,0x6c,0x63,0x74,0x2d])+_0x1db271(_0x3c4ba2(_0x3302d4)),_0x7a0c6f=window[_0x14b547([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x14b547([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x201d2d);return _0x7a0c6f?window[_0x14b547([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x21ac56(_0x7a0c6f),0x10)*_0x15cf35:null;}function _0x20af2c(_0xa5f19f){return new window[(_0x14b547([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5b0d5a,_0x33eece)=>{_0xa5f19f[_0x14b547([0x74,0x68,0x65,0x6e])](_0x5b0d5a,_0x33eece),window[_0x14b547([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x33eece,0x1a99de1^_0x31b399);});}}_0x1269b0[_0x14b547([0x6f,0x6e])](_0x14b547([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x405116,_0x4f5b55)=>{if(_0x4f5b55[0x0]!=_0x3302d4)return _0x5566d6(_0x14b547([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x4f5b55[0x1]={..._0x4f5b55[0x1],[_0x14b547([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x3631dc};},{[_0x14b547([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x14b547([0x68,0x69,0x67,0x68])}),_0x1269b0[_0x14b547([0x6f,0x6e])](_0x14b547([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x3783cb=>{_0x2d9601(_0x3783cb[_0x14b547([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x2a4e32=!0x0,_0x21b49f(_0x3783cb[_0x14b547([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x14b547([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x14b547([0x6c,0x6f,0x77])}),_0x2ae1c8[_0x14b547([0x74,0x68,0x65,0x6e])](()=>{_0x2a4e32||_0x5566d6(_0x14b547([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x567daa(){return _0x1269b0[_0x14b547([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x14b547([0x76,0x69,0x65,0x77])][_0x14b547([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x14b547([0x61,0x75,0x74,0x6f]);}function _0x178c5b(){_0x1269b0[_0x14b547([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x14b547([0x76,0x69,0x65,0x77])][_0x14b547([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x14b547([0x61,0x75,0x74,0x6f]);}}function _0x2fc334(_0x437665){const _0x4ddde7=[new window[(_0x14b547([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5faaab=>setTimeout(_0x5faaab,0x1a177ed^_0x31b399)),_0x2ae1c8[_0x14b547([0x74,0x68,0x65,0x6e])](()=>new window[(_0x14b547([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x11495=>{let _0x3a4f18=0x0;_0x1269b0[_0x14b547([0x6d,0x6f,0x64,0x65,0x6c])][_0x14b547([0x6f,0x6e])](_0x14b547([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x278926,_0x39c4ea)=>{_0x39c4ea[0x0][_0x14b547([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3a4f18++,_0x3a4f18==(0x1a848d9^_0x31b399)&&(_0x11495(),_0x278926[_0x14b547([0x6f,0x66,0x66])]());});}))];return window[_0x14b547([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x14b547([0x72,0x61,0x63,0x65])](_0x4ddde7)[_0x14b547([0x74,0x68,0x65,0x6e])](()=>_0x437665);}async function _0x7b7ce8(){await _0x2ae1c8,_0x1269b0[_0x14b547([0x6d,0x6f,0x64,0x65,0x6c])][_0x14b547([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x49819,_0x1269b0[_0x14b547([0x6d,0x6f,0x64,0x65,0x6c])][_0x14b547([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x49819,_0x1269b0[_0x14b547([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x14b547([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x1d6344(_0x502393){const _0x3fa1b7=_0x51e4e2();_0x1269b0[_0x3fa1b7]=_0x14b547([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x502393,_0x502393!=_0x14b547([0x56,0x61,0x6c,0x69,0x64])&&_0x7b7ce8();}function _0x51e4e2(){const _0x126da8=window[_0x14b547([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x14b547([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x14b547([0x6e,0x6f,0x77])]())[_0x14b547([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x14b547([0x2e]),'');let _0x158053=_0x14b547([0x6d]);for(let _0x5d4e67=0x0;_0x5d4e67<_0x126da8[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5d4e67+=0x2){let _0x38bf47=window[_0x14b547([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x126da8[_0x14b547([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5d4e67,_0x5d4e67+0x2));_0x38bf47>=_0x50af1f[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x38bf47-=_0x50af1f[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x158053+=_0x50af1f[_0x38bf47];}return _0x158053;}function _0x7d8b39(){const _0x4df9b0=_0x5200ae[_0x14b547([0x73,0x70,0x6c,0x69,0x74])](_0x14b547([0x2e]));if(0x3!=_0x4df9b0[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1a4cb8(_0x4df9b0[0x1]);function _0x1a4cb8(_0x4acd12){const _0x20ae2b=_0x1b5ed4(_0x4acd12);return _0x20ae2b&&_0x34a2a0()?_0x20ae2b:null;function _0x34a2a0(){const _0x4f9384=_0x20ae2b[_0x14b547([0x6a,0x74,0x69])],_0xabb32c=window[_0x14b547([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4f9384[_0x14b547([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4f9384[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4bd1e7={..._0x20ae2b,[_0x14b547([0x6a,0x74,0x69])]:_0x4f9384[_0x14b547([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4f9384[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4bd1e7[_0x14b547([0x76,0x63])],_0x3c4ba2(_0x4bd1e7)==_0xabb32c;}}}async function _0x233de9(){let _0x38e3e9=!0x0;try{const _0x3c8afe=_0x5200ae[_0x14b547([0x73,0x70,0x6c,0x69,0x74])](_0x14b547([0x2e])),[_0x5f0b8e,_0x331b5a,_0xbb4a9]=_0x3c8afe;return _0x1b0285(_0x5f0b8e),await _0x4f399e(_0x5f0b8e,_0x331b5a,_0xbb4a9),_0x38e3e9;}catch(_0x2daa68){return!0x1;}function _0x1b0285(_0x5e8f65){const _0x2719d6=_0x1b5ed4(_0x5e8f65);_0x2719d6&&_0x2719d6[_0x14b547([0x61,0x6c,0x67])]==_0x14b547([0x45,0x53,0x32,0x35,0x36])||(_0x38e3e9=!0x1);}async function _0x4f399e(_0x5ccf6a,_0x718dd8,_0x4c2acf){const _0x87fd6b=window[_0x14b547([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x14b547([0x66,0x72,0x6f,0x6d])](_0x13f373(_0x4c2acf),_0x4d480c=>_0x4d480c[_0x14b547([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x60f479=new window[(_0x14b547([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x14b547([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x5ccf6a+_0x14b547([0x2e])+_0x718dd8),_0x4fc2f0=window[_0x14b547([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x14b547([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x4fc2f0)return;const _0x5f16df=await _0x4fc2f0[_0x14b547([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x14b547([0x6a,0x77,0x6b]),_0x1d90f6,{[_0x14b547([0x6e,0x61,0x6d,0x65])]:_0x14b547([0x45,0x43,0x44,0x53,0x41]),[_0x14b547([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x14b547([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x14b547([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x4fc2f0[_0x14b547([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x14b547([0x6e,0x61,0x6d,0x65])]:_0x14b547([0x45,0x43,0x44,0x53,0x41]),[_0x14b547([0x68,0x61,0x73,0x68])]:{[_0x14b547([0x6e,0x61,0x6d,0x65])]:_0x14b547([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5f16df,_0x87fd6b,_0x60f479)||(_0x38e3e9=!0x1);}}function _0x1b5ed4(_0xfc089e){return _0xfc089e[_0x14b547([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x14b547([0x65,0x79]))?JSON[_0x14b547([0x70,0x61,0x72,0x73,0x65])](_0x13f373(_0xfc089e)):null;}function _0x13f373(_0xa0845d){return window[_0x14b547([0x61,0x74,0x6f,0x62])](_0xa0845d[_0x14b547([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x14b547([0x2b]))[_0x14b547([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x14b547([0x2f])));}function _0x3c4ba2(_0x3b4e5a){let _0x527c54=0x1505;function _0x526768(_0x5f03c7){for(let _0x51e9a3=0x0;_0x51e9a3<_0x5f03c7[_0x14b547([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x51e9a3++){const _0x4942d3=_0x5f03c7[_0x14b547([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x51e9a3);_0x527c54=(_0x527c54<<0x5)+_0x527c54+_0x4942d3,_0x527c54&=_0x527c54;}}function _0x599dba(_0x199329){Array[_0x14b547([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x199329)?_0x199329[_0x14b547([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x599dba):_0x199329&&typeof _0x199329==_0x14b547([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x14b547([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x199329)[_0x14b547([0x73,0x6f,0x72,0x74])]()[_0x14b547([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2ec2e9,_0x13b4aa])=>{_0x526768(_0x2ec2e9),_0x599dba(_0x13b4aa);}):_0x526768(window[_0x14b547([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x199329));}return _0x599dba(_0x3b4e5a),_0x527c54>>>0x0;}function _0x1db271(_0x4ef73d){return _0x4ef73d[_0x14b547([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x14b547([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x14b547([0x30]));}function _0x21ac56(_0xfdf11c){return _0xfdf11c[_0x14b547([0x73,0x70,0x6c,0x69,0x74])]('')[_0x14b547([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x14b547([0x6a,0x6f,0x69,0x6e])]('');}function _0x49819(){}function _0x14b547(_0x338812){return _0x338812['map'](_0x3c6508=>String['fromCharCode'](_0x3c6508))['join']('');}_0x1d6344(await _0x519603());}(this);}['showFakeVisualSelection'](){const _0x20d689=this['editor']['model'];_0x20d689['change'](_0x15197e=>{const _0x239e16=_0x20d689['document']['selection']['getRanges']();let _0x141147=0x0;for(const _0x379276 of _0x239e16){const _0x480f9f=f+':'+_0x141147;if(_0x20d689['markers']['has'](_0x480f9f))_0x15197e['updateMarker'](_0x480f9f,{'range':_0x379276});else{if(_0x379276['start']['isAtEnd']){const _0x17dc9e=_0x379276['start']['getLastMatchingPosition'](({item:_0x3c8bb8})=>!_0x20d689['schema']['isContent'](_0x3c8bb8),{'boundaries':_0x379276});_0x15197e['addMarker'](_0x480f9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x15197e['createRange'](_0x17dc9e,_0x379276['end'])});}else _0x15197e['addMarker'](_0x480f9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x379276});}_0x141147++;}});}['hideFakeVisualSelection'](){const _0x1bc3e7=this['editor']['model'],_0x3e891c=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x3e891c['length']&&_0x1bc3e7['change'](_0x4e1006=>{_0x3e891c['forEach'](_0x169535=>{_0x4e1006['removeMarker'](_0x169535);});});}['insertContent'](_0x189a8c,_0x30fc9b){const _0x1408f2=this['_getAISelection'](),_0xbf11fa=_0x30fc9b||_0x1408f2['getFirstRange']();this['editor']['model']['canEditAt'](_0xbf11fa)&&this['editor']['model']['change'](_0x327f3c=>{this['hideFakeVisualSelection'](),_0x30fc9b||this['_resetContentOfSelectedTableCells'](_0x327f3c,_0x1408f2),this['_pasteHTMLUsingClipboard']({'insertAt':_0xbf11fa,'writer':_0x327f3c,'html':_0x189a8c});});}['insertContentBelow'](_0x192afc){const {model:_0xbf9b8a}=this['editor'],_0x493eca=this['_getAISelection']();_0xbf9b8a['change'](()=>{const _0x1d936a=this['_prepareTableInsertBelowPosition'](_0x192afc,_0x493eca)||this['_getDefaultInsertBelowPosition'](_0x493eca);this['insertContent'](_0x192afc,_0x1d936a);});}['_getAISelection'](){const _0xadb9c8=this['editor']['model'],_0x597179=Array['from'](_0xadb9c8['markers']['getMarkersGroup'](f))['map'](_0x59d79c=>_0x59d79c['getRange']());return _0xadb9c8['createSelection'](_0x597179);}['_pasteHTMLUsingClipboard']({writer:_0x22a1bc,html:_0x181279,insertAt:_0x33e2f4}){const {view:_0x11cc9b}=this['editor']['editing'],_0x320225=this['editor']['plugins']['get'](_0x581b4f),_0xf38cf0=new dt();_0xf38cf0['setData']('text/html',_0x181279);const _0x737461=new ClipboardEvent('paste',{'clipboardData':_0xf38cf0}),_0x660f74=new _0x2b5c36(_0x11cc9b,_0x737461,{'dataTransfer':new _0x5df0cb(_0xf38cf0)});_0x22a1bc['setSelection'](_0x33e2f4);const _0x118477=(_0x14ee8e,_0x2222db)=>{_0x2222db['resultRange']&&_0x22a1bc['setSelection'](_0x2222db['resultRange']);};_0x320225['once']('contentInsertion',_0x118477,{'priority':'lowest'}),_0x11cc9b['document']['fire']('paste',_0x660f74),_0x320225['off']('contentInsertion',_0x118477);}['_getDefaultInsertBelowPosition'](_0x5a9ba3){const {model:_0x58d4bc}=this['editor'],_0x365179=Array['from'](_0x5a9ba3['getSelectedBlocks']());return _0x365179['length']?_0x58d4bc['createPositionAfter'](_0x365179['pop']()):_0x5a9ba3['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0xf28f70,_0x4870c4){const {model:_0x3f5278,plugins:_0x2210fc}=this['editor'];if(_0x2210fc['has']('TableUtils')){const _0x3f3f7a=_0x2210fc['get']('TableUtils')['getSelectedTableCells'](_0x4870c4);if(_0x3f3f7a['length']){const _0x2f9476=this['_getTableRowCountFromContent'](_0xf28f70),_0x443bf0=this['_createEmptyTableRows'](_0x3f3f7a,_0x2f9476);return _0x3f5278['createPositionAt'](_0x443bf0,0x0);}}return null;}['_getTableRowCountFromContent'](_0xf733ad){const _0x2aa0ea=this['editor']['plugins']['get']('TableUtils'),_0x3b6980=this['editor']['data']['parse'](_0xf733ad),_0x1698e2=Array['from'](_0x3b6980['getChildren']())['filter'](_0x539499=>_0x539499['is']('element','table'));let _0x39af36=0x0;return _0x1698e2['forEach'](_0x4b4651=>{_0x39af36+=_0x2aa0ea['getRows'](_0x4b4651);}),_0x39af36;}['_createEmptyTableRows'](_0x15c113,_0x41f09d){const _0x1e2f29=this['editor']['plugins']['get']('TableUtils'),_0x45a128=_0x1e2f29['getRowIndexes'](_0x15c113),_0x1b4578=_0x1e2f29['getColumnIndexes'](_0x15c113),_0x5f53fb=_0x45a128['last']+0x1,_0x2c1afe=_0x1b4578['first'],_0x2da5d6=_0x15c113[0x0]['findAncestor']('table');for(let _0x273a9c=0x0;_0x273a9c<_0x41f09d;_0x273a9c++)_0x1e2f29['insertRows'](_0x2da5d6,{'at':_0x5f53fb});return _0x2da5d6['getChild'](_0x5f53fb)['getChild'](_0x2c1afe);}['_resetContentOfSelectedTableCells'](_0x537121,_0x2eb8e9){const {plugins:_0x230d1d}=this['editor'],{model:_0x31e5d2}=_0x537121;if(!_0x230d1d['has']('TableUtils'))return;_0x230d1d['get']('TableUtils')['getSelectedTableCells'](_0x2eb8e9)['length']&&_0x31e5d2['deleteContent'](_0x2eb8e9);}}class K extends _0x43c8eb{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x4c9cbe('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2fc69f){super(_0x2fc69f),this['name']='AIRequestError';}}function i(_0x2b547d,_0xf96f74,_0x4b07bf){const t=_0x2b547d['t'];switch(_0xf96f74){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',_0x4b07bf);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x4b07bf);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'},_0x4b07bf);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 _0xf96f74;}}class E extends _0x450b76{['_commandDefinitions'];constructor(_0x3c1a4d,_0x1afb06){super(_0x3c1a4d),this['_commandDefinitions']=_0x1afb06,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x205536,_0x72e3c3,_0x1ae945)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x1ae945));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3b73d3,_0x5b3eb7,_0x2d9b27)=>{this['enabledCommandsIds']=_0x2d9b27?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x435200=this['editor']['model'];this['_hasContext']=function(_0x557b87){const _0x55136f=_0x557b87['document']['selection'];return _0x55136f['isCollapsed']?0x0!==[..._0x55136f['getSelectedBlocks']()]['length']&&![..._0x55136f['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x557b87['hasContent'](_0x55136f['getFirstRange']());}(_0x435200);const _0x4c8f92=_0x435200['document']['selection'],_0x9ee2df=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1ce712 of _0x4c8f92['getRanges']())for(const _0x3696b3 of _0x1ce712['getItems']())if(_0x3696b3['is']('element')&&_0x9ee2df['includes'](_0x3696b3['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x538703='',_0x596c59='',_0x4649eb='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x538703,_0x596c59,_0x4649eb);}}function G(_0x2cb532,_0xeaef59){const _0x49ce1c=new Set();for(const _0x2bf37e of _0x2cb532['values']())(_0xeaef59||!0x1===_0x2bf37e['requiresContent'])&&_0x49ce1c['add'](_0x2bf37e['id']);return Array['from'](_0x49ce1c);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x4affed(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x3645e8,_0x4fe80d,_0x37bcbe){super(),this['editor']=_0x3645e8,this['textAdapter']=_0x4fe80d,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x37bcbe,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0xfc1171,_0x2d9d0f,_0x12d5b8)=>{this['view']['value']=this['_sanitizeHTML'](_0x12d5b8);}),this['listenTo'](this['view'],'submitPrompt',(_0x25f680,_0x1fdfee)=>{const _0x37c626=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x1fdfee,_0x37c626,'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:_0x10d139,query:_0x418b03,htmlContent:_0x574ed0,label:_0x346e96,mainActionLabel:_0x3c5604}){this['view']['prompt']=_0x346e96,this['view']['mainAction']=_0x3c5604,this['initialContext']=_0x574ed0,_0x418b03&&(this['view']['isRendered']?this['_handleQuery'](_0x418b03,_0x574ed0,_0x10d139,_0x346e96):this['view']['once']('render',()=>{this['_handleQuery'](_0x418b03,_0x574ed0,_0x10d139,_0x346e96);}));}['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'](_0x4e92aa,_0x57642d,_0x17f3e3,_0x1e87bf){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x57642d,this['previousQuery']=_0x4e92aa,this['previousLabel']=_0x1e87bf||_0x4e92aa,this['previousActionId']=_0x17f3e3,new Promise(_0x1e1dae=>{this['textAdapter']['makeRequest']({'query':_0x4e92aa,'context':_0x57642d,'onData':_0x45ee26=>{this['currentResponse']=_0x45ee26,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x17f3e3})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x49d030=>{_0x49d030 instanceof R?this['view']['handleError'](_0x49d030['message']):this['view']['handleError'](),_0x1e1dae();})['finally'](()=>{this['stopProcessing'](),_0x1e1dae();});});}['_parseAndNormalizeContent'](_0x433900,_0x3643a8=!0x1){const _0x484b15=Z['exec'](_0x433900);_0x433900=_0x484b15?_0x433900['substring'](_0x484b15[0x1]['length']):_0x433900['length']<0x64&&!_0x3643a8?'':this['_stripMarkdownSyntax'](_0x433900);const _0x2c6f39=this['_domParser']['parseFromString'](_0x433900,'text/html');if(_0x484b15){const _0x47c27a=Array['from'](_0x2c6f39['body']['childNodes']);_0x47c27a['reverse']();for(const _0x1e3c41 of _0x47c27a){if(_0x1e3c41['nodeType']==Node['ELEMENT_NODE'])break;_0x1e3c41['remove']();}}const _0x38d6a4=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2c6f39['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x38d6a4);const _0x53cf12=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x330d8=this['editor']['data']['toModel'](_0x38d6a4);return _0x53cf12||_0x330d8['markers']['clear'](),this['editor']['data']['stringify'](_0x330d8);}['_normalizeResponseHeadings'](_0x54c3d5){const _0x31406c=new _0x187ffb(this['editor']['editing']['view']['document']),_0x388c31=new _0x2c2625({'name':/^h[1-5]$/}),_0xc25976=[];let _0x19daa2=!0x1;for(const _0x57949d of _0x54c3d5)_0x57949d['is']('element')&&_0x388c31['match'](_0x57949d)&&(_0xc25976['push'](_0x57949d),'h1'==_0x57949d['name']&&(_0x19daa2=!0x0));if(_0x19daa2){for(const _0x32c818 of _0xc25976)_0x31406c['rename']('h'+(parseInt(_0x32c818['name'][0x1])+0x1),_0x32c818);}}['_isH1TagSupportEnabled'](){const {data:_0x193cf1,editing:_0x47a600}=this['editor'],_0x4cef03=_0x193cf1['htmlProcessor']['toView']('<h1></h1>'),_0x32062a=_0x193cf1['toView'](_0x193cf1['toModel'](_0x4cef03));return!!_0x47a600['view']['domConverter']['viewToDom'](_0x32062a)['querySelector']('h1');}['_sanitizeHTML'](_0x435570){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x435570),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x464e93){const _0x1d4216=_0x464e93['trim']();return _0x1d4216['startsWith']('```html')?_0x1d4216['endsWith']('```')?_0x1d4216['substring'](0x7,_0x1d4216['length']-0x3):_0x1d4216['substring'](0x7):_0x464e93;}}const M={'REPLACE':'replace','INSERT':'insert'};class at extends nt{constructor(_0x5d03f3){super(_0x5d03f3),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3944ce=>i(_0x5d03f3,'AI_'+_0x3944ce['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x5d03f3,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x5d03f3,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x5d03f3,'Stop'));const _0x4a3513=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x4a3513['if']('isVisible','ck-hidden',_0x55ce96=>!_0x55ce96)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3e96d5,_0x103edf){const _0x345464=new _0x9d68df(this['locale']);return _0x345464['set']({'label':_0x3e96d5,'class':_0x103edf||'','isVisible':!0x0,'withText':!0x0}),_0x345464;}}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 _0x10ae76{['contentFieldView'];['copyButtonView'];constructor(_0x2c2c76,_0x23ee6a=''){super(_0x2c2c76),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1f26c3=this['bindTemplate'];this['contentFieldView']=new mt(_0x2c2c76,_0x23ee6a),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1f26c3['if']('isVisible','ck-hidden',_0x412c03=>!_0x412c03)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1f26c3['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 _0x1454ac=!0x1;this['on']('change:value',(_0x2ab026,_0xcb0480,_0x50e420)=>{const _0x4f9993=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x50e420),this['isProcessing']&&_0x4f9993&&!_0x1454ac&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x46c706,_0x17548a,_0x103d58)=>{_0x1454ac=!0x1,_0x103d58?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1454ac=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1454ac=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x9a7bd3=this['locale'],_0x5d866b=new _0x9d68df(this['locale']),_0x56eedd='ck-ai-form__copy-button';return _0x5d866b['set']({'label':i(_0x9a7bd3,'Copy'),'icon':W,'class':_0x56eedd,'tooltip':!0x0}),_0x5d866b['bind']('isVisible')['to'](this,'value',_0x44c87c=>!!_0x44c87c),_0x5d866b['bind']('isEnabled')['to'](this,'isProcessing',_0x1b5477=>!_0x1b5477),_0x5d866b['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5d866b['icon']=_0x44adb6['check'],_0x5d866b['class']=_0x56eedd+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5d866b['icon']=W,_0x5d866b['class']=_0x56eedd;},0x3e8);}),_0x5d866b;}['_copyHTMLToClipboard'](_0x2e70cf){const {window:_0x1f84b4,document:_0xb619af}=_0x2f7c0b;if(_0x1f84b4['ClipboardItem']){const {Blob:_0x1130f8,ClipboardItem:_0x27a9f8}=_0x1f84b4,_0x147273=[new _0x27a9f8({'text/html':new _0x1130f8([_0x2e70cf['innerHTML']],{'type':'text/html'}),'text/plain':new _0x1130f8([_0x2e70cf['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x147273);}else{const _0xa5a394=_0xb619af['createElement']('div');_0xa5a394['style']['position']='absolute',_0xa5a394['style']['left']='-9999px',_0xa5a394['innerHTML']='<span>[</span>'+_0x2e70cf['innerHTML']+'<span>]</span>',_0xb619af['body']['appendChild'](_0xa5a394);const _0x31e26d=_0xb619af['createRange']();_0x31e26d['setStartAfter'](_0xa5a394['firstElementChild']),_0x31e26d['setEndBefore'](_0xa5a394['lastElementChild']);const _0x338056=_0x1f84b4['getSelection']();_0x338056['removeAllRanges'](),_0x338056['addRange'](_0x31e26d),_0xb619af['execCommand']('copy'),_0xa5a394['remove']();}}}class mt extends _0x10ae76{constructor(_0x983820,_0x16c799=''){super(_0x983820),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x16c799,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x454273){this['element']['innerHTML']=_0x454273;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x1e3854=new _0x10ae76(),_0x1fbb66=this['locale'],_0x4ce319=new _0x28d8f2();return _0x4ce319['isVisible']=!0x0,_0x1e3854['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4ce319,{'text':i(_0x1fbb66,'AI\x20is\x20writing...')}]}),_0x1e3854['render'](),_0x1e3854;}}class rt extends _0x10ae76{constructor(_0x5cf7cf,_0x44c005=''){super(_0x5cf7cf);const _0x28ff8a=new _0x5d5b06(),_0x54ff65=this['bindTemplate'];this['set']('text',_0x44c005),_0x28ff8a['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':[_0x28ff8a,{'text':_0x54ff65['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x48e2c5,_0x127655){super(_0x48e2c5,_0x127655),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',(_0x519798,_0x5a4f8b)=>{_0x519798['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x5a4f8b());});}['_createSubmitButton'](){const _0x1da767=new _0x9d68df(this['locale']),_0x1de462=this['locale'];return _0x1da767['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(_0x1de462,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1da767['on']('execute',()=>{this['submit']();}),_0x1da767['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x5c21e9,_0x8d70ae)=>!_0x5c21e9&&_0x8d70ae),_0x1da767;}['_createShowHistoryButton'](){const _0x27af41=new _0x9d68df(this['locale']),_0x56615f=this['resultsView'],_0x53430a=this['locale'];_0x27af41['set']({'label':i(_0x53430a,'History'),'withText':!0x1,'icon':_0x44adb6['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x27af41['bind']('isOn')['to'](_0x56615f,'isVisible'),_0x27af41['bind']('isEnabled')['to'](this,'isEnabled'),_0x27af41['on']('execute',()=>{_0x56615f['isVisible']=!_0x56615f['isVisible'],_0x56615f['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x3c1dd6=()=>{_0x2f7c0b['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x2367f0=new st(this['queryView']['fieldView']['element']),_0x3bb2c9=_0x2367f0['width'],_0x4d2c8a='rtl'===_0x53430a['uiLanguageDirection']?'left':'right';_0x2367f0['excludeScrollbarsAndBorders'](),_0x27af41['element']['style'][_0x4d2c8a]=_0x3bb2c9-_0x2367f0['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x3c1dd6),this['on']('render',_0x3c1dd6),_0x27af41;}['submit'](){const _0x112130=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x112130);}['focus'](_0x1bef3f){-0x1===_0x1bef3f?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x289937){super(_0x289937),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x289937,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x4711b6=0x0;for(const _0x22ae84 of this['items'])_0x4711b6+=_0x22ae84['items']['length'];return{'resultsCount':_0x4711b6,'totalItemsCount':_0x4711b6};}['_createClearHistoryButton'](){const _0x41cfed=this['locale'],_0x6525f0=new _0x9d68df(this['locale']);return _0x6525f0['set']({'label':'('+i(_0x41cfed,'Clear')+')','withText':!0x0}),_0x6525f0['on']('execute',()=>this['fire']('clearHistory')),_0x6525f0;}}class hs extends _0x1701e2{constructor(_0x30cd66){super();const _0x6cb47f=new te(),_0x100060=new _0x9d68df(this['locale'],_0x6cb47f);this['children']['add'](_0x100060),_0x100060['set']({'label':_0x30cd66['prompt'],'withText':!0x0}),_0x100060['on']('execute',()=>{this['fire']('execute',{'value':_0x37d8cd(_0x30cd66['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x5a641f{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x1e6a3b,_0x2cf280)=>{const _0x434f4b=Ss(_0x2cf280['prompt']);for(const _0x410317 of this)if(_0x410317!=_0x2cf280&&Ss(_0x410317['prompt'])===_0x434f4b){this['remove'](_0x410317);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xcc85ee=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0xcc85ee));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x3456bb=>_0x3456bb)));}}function Ss(_0xcb464c){return _0xcb464c['toLowerCase']()['trim']();}class k extends _0x10ae76{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x36ea2b,_0x30d185,_0x38258c=''){super(_0x36ea2b),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(_0x36ea2b),this['contentArea']=new X(_0x36ea2b,_0x38258c),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 _0x3f6854(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x4921d3({'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 _0x33910b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x30d185],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x33910b['if']('isError','ck-hidden',_0x45e460=>!_0x45e460)]},'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'](_0x57e0b9=0x1){-0x1===_0x57e0b9?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 _0x4b1408=this['locale'],_0x5dddc9=new ht(_0x4b1408,{'queryView':{'label':i(_0x4b1408,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x13830b,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x4b1408,'Empty\x20history'),'secondary':i(_0x4b1408,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x5dddc9['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x35bca4,_0x3aba54)=>_0x35bca4&&!_0x3aba54),this['listenTo'](_0x5dddc9,'submit',(_0x4967fb,_0x3e50d6)=>{this['prompt']=_0x3e50d6;const _0xa2f90d=_0x3ce171(_0x3e50d6);this['fire']('submitPrompt',_0xa2f90d),_0x3e50d6['trim']()&&this['_promptHistory']['add']({'prompt':_0xa2f90d},0x0);},{'priority':'high'}),_0x5dddc9;}['_createHistoryView'](){const _0x3d6794=new rs(this['locale']);return _0x3d6794['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x3d6794['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3d6794;}['_createToolbar'](){const _0x5c1f58=new at(this['locale']);return _0x5c1f58['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4ded4e,_0x152db5,_0x519378)=>_0x4ded4e&&!_0x152db5&&!!_0x519378),_0x5c1f58['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5c1f58['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x34f918,_0x555e15,_0x3d9484)=>_0x34f918&&!_0x555e15&&!!_0x3d9484),_0x5c1f58['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5c1f58['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x31ebfe,_0x1e1758)=>_0x31ebfe&&!_0x1e1758),_0x5c1f58['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5c1f58['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5c1f58['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5c1f58;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2dd60e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2dd60e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4ecb0c){const _0x5ce624=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4ecb0c||i(_0x5ce624,'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 _0x43c8eb{['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[_0x5771c3,a,K,_0x1578d5];}constructor(_0x5b037c){super(_0x5b037c),_0x5b037c['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x5b037c['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x5b037c['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x5b037c['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x123334}=this;this['_aiAdapter']=_0x123334['plugins']['get'](K),this['_dialog']=_0x123334['plugins']['get'](_0x1578d5),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x23f0b1=new E(_0x123334,Array['from'](this['_commandDefinitions']['values']()));_0x123334['commands']['add']('showAIAssistant',_0x23f0b1),_0x123334['ui']['componentFactory']['add']('aiCommands',_0x1779fb=>{const _0x3e986f=_0x4d8827(_0x1779fb);return _0x3e986f['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3e986f['buttonView']['set']({'label':i(_0x1779fb,'AI\x20Commands'),'icon':T,'tooltip':!0x0}),_0x3e986f['on']('execute',_0xaa7ab8=>this['_onExecute'](_0xaa7ab8['source']['id'])),_0x4e043b(_0x3e986f,_0x123334['ui']['view']['body'],function(_0x4cf073){const _0x246cf4=o(_0x4cf073['config']['get']('ai.aiAssistant.commands'),_0x4cf073['locale']),_0x1678ab=U(_0x4cf073,_0x246cf4)['filter'](_0x13d367=>_0x13d367['commands']['length']);if(0x1===_0x1678ab['length'])return U(_0x4cf073,_0x1678ab[0x0]['commands'])['map'](_0x40229d=>({'id':_0x40229d['id'],'label':_0x40229d['label']}));return _0x1678ab['map'](_0xa1f0e3=>{const {groupId:_0x2f374b,groupLabel:_0x47b740,commands:_0x10772f}=_0xa1f0e3,_0x3b5ede=U(_0x4cf073,_0x10772f)['map'](_0x539b97=>({'id':_0x539b97['id'],'label':_0x539b97['label']}));return{'id':_0x2f374b,'menu':_0x47b740||_0x2f374b,'children':_0x3b5ede};});}(_0x123334),{'ariaLabel':i(_0x1779fb,'AI\x20Commands')}),_0x3e986f['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x23f0b1['on']('change:enabledCommandsIds',_0x476866),_0x3e986f['menuView']['once']('render',_0x476866),_0x3e986f;function _0x476866(){_0x3e986f['isEnabled']=_0x23f0b1['enabledCommandsIds']['length']>0x0;for(const _0x206828 of _0x3e986f['menuView']['buttons'])_0x206828['isEnabled']=_0x23f0b1['enabledCommandsIds']['includes'](_0x206828['id']);}}),_0x123334['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5af60d=>{const _0x415169=new _0x4aa2c8(_0x5af60d);_0x415169['buttonView']['set']({'label':i(_0x5af60d,'AI\x20Commands'),'icon':T}),_0x415169['bind']('isEnabled')['to'](_0x23f0b1,'enabledCommandsIds',_0xa1b89e=>_0xa1b89e['length']>0x0);const _0x4473c9=o(_0x123334['config']['get']('ai.aiAssistant.commands'),_0x5af60d);return this['_populateMenuBarMenu'](_0x23f0b1,_0x415169,_0x4473c9,_0x5ccd3f=>this['_onExecute'](_0x5ccd3f)),_0x415169;}),_0x123334['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x50b7d5=this['_createAIAssistantUIButton'](_0x9d68df);return _0x50b7d5['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x50b7d5;}),_0x123334['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x187305=this['_createAIAssistantUIButton'](_0x3b6759);return _0x187305['set']({'role':'menuitemcheckbox'}),_0x187305;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x1426e5=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x5ecc50;for(const _0x63a458 in _0x1426e5){const _0x20ee6c=_0x63a458,_0x2bdea1=_0x1426e5[_0x20ee6c];if('aiLicenseKeyValid'==_0x2bdea1||'aiLicenseKeyInvalid'==_0x2bdea1||'aiLicenseKeyExpired'==_0x2bdea1||'aiLicenseKeyDomainLimit'==_0x2bdea1||'aiLicenseKeyNotAllowed'==_0x2bdea1||'aiLicenseKeyEvaluationLimit'==_0x2bdea1||'aiLicenseKeyTrialLimit'==_0x2bdea1||'aiLicenseKeyUsageLimit'==_0x2bdea1){delete _0x1426e5[_0x20ee6c],_0x5ecc50=_0x2bdea1,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x5ecc50&&_0x1426e5['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x5ecc50&&_0x1426e5['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x5ecc50&&_0x1426e5['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x5ecc50&&_0x1426e5['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x5ecc50&&_0x1426e5['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x5ecc50&&_0x1426e5['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x5ecc50&&_0x1426e5['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3e07d9='',_0x18c157='',_0x106c32='custom'){const _0x487cf8=this['editor'],_0x4688a8=_0x487cf8['editing']['view'],_0x1d4299=_0x487cf8['plugins']['get'](a),_0x5c73c3=_0x487cf8['plugins']['get'](_0x5771c3);_0x1d4299['showFakeVisualSelection']();const _0x106ecf=new w(),_0x42d1c=new ClipboardEvent('copy',{'clipboardData':_0x106ecf}),_0x34ead3=new _0x5df0cb(_0x106ecf),_0x5322de=new _0x2b5c36(_0x4688a8,_0x42d1c,{'dataTransfer':_0x34ead3});_0x5c73c3['_forceMarkersCopy']('comment',()=>{_0x4688a8['document']['fire']('copy',_0x5322de);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x487cf8,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2f0e6f=_0x34ead3['getData']('text/html');const _0x546c36=_0x487cf8['model']['document']['selection'],_0x5dc666=Array['from'](_0x546c36['getRanges']());0x1===_0x5dc666['length']&&_0x5dc666[0x0]['isFlat']&&!_0x546c36['getSelectedElement']()&&''!==_0x2f0e6f['replace'](/ /g,'')['trim']()&&(_0x2f0e6f='<p>'+_0x2f0e6f+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x106c32,'query':_0x3e07d9,'htmlContent':_0x2f0e6f,'label':_0x18c157,'mainActionLabel':M[_0x487cf8['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':_0x41b3e6['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x1d4299['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x50dd3b=new Map(),_0x35a639=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1e74ef of _0x35a639)for(const _0x5e725f of _0x1e74ef['commands'])_0x50dd3b['set'](_0x5e725f['id'],{..._0x5e725f,'groupId':_0x1e74ef['groupId'],'groupLabel':_0x1e74ef['groupLabel']||_0x1e74ef['groupId']});return _0x50dd3b;}['_createAIAssistantUIButton'](_0x57c62e){const _0x4c43b5=this['editor'],_0x317900=_0x4c43b5['commands']['get']('showAIAssistant'),_0x45b1ff=new _0x57c62e(_0x4c43b5['locale']);return _0x45b1ff['set']({'label':i(_0x4c43b5['locale'],'AI\x20Assistant'),'icon':ct['robotPencil'],'isToggleable':!0x0}),_0x45b1ff['bind']('isEnabled')['to'](_0x317900),_0x45b1ff['bind']('isOn')['to'](this['_dialog'],'id',_0x4c7922=>'aiAssistant'===_0x4c7922),this['listenTo'](_0x45b1ff,'execute',()=>{_0x45b1ff['isOn']?this['hideUI']():_0x317900['execute']();}),_0x45b1ff;}['_initView'](){const _0xe53c66=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',()=>{_0xe53c66['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0xe53c66['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x569845,ui:{ariaLiveAnnouncer:_0x403dce}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2bc790,_0x5a0d46,_0x248f62)=>{const _0x405548=this['_aiAssistantController']['currentContext'];_0x248f62?_0x403dce['announce'](i(_0x569845,'AI\x20is\x20writing')):_0x405548&&_0x403dce['announce'](i(_0x569845,'Generated\x20content:\x20%0',_0x405548),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0xbcaab2,_0x3decf8,_0x20f26a)=>{if(_0x20f26a){const _0x3a0b35=this['_formView']['errorView']['text'];_0x403dce['announce'](i(_0x569845,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3a0b35));}});}['_onExecute'](_0x137f83){const _0x4d10d9=this['_commandDefinitions']['get'](_0x137f83),_0x1603d3=this['editor'],_0x33184a=_0x1603d3['model']['document']['selection'],_0x327044=_0x1603d3['commands']['get']('showAIAssistant'),_0xfbd483=_0x1603d3['plugins']['get'](a),_0x129713=''+(_0x4d10d9['groupId']!==x?_0x4d10d9['groupLabel']+':\x20':'')+_0x4d10d9['label'];if(!0x1!==_0x4d10d9['requiresContent']&&_0x33184a['isCollapsed']){const _0x16f916=_0x27e7bd(_0x33184a['getSelectedBlocks']())||_0x1603d3['model']['schema']['getLimitElement'](_0x33184a);_0x1603d3['model']['change'](_0x3c0864=>{_0x3c0864['setSelection'](_0x16f916,'in');});}_0xfbd483['showFakeVisualSelection'](),_0x327044['execute'](_0x4d10d9['prompt'],_0x129713,'command:'+_0x137f83);}['_populateMenuBarMenu'](_0x7edeef,_0xb48194,_0x2d3ac1,_0x306539){const _0x5c5bd1=this['editor'],_0x5dd8f7=_0x5c5bd1['locale'],_0x544b32=new _0x741c4e(_0x5dd8f7),_0x2082fb=U(_0x5c5bd1,_0x2d3ac1)['filter'](_0x161ba1=>_0x161ba1['commands']['length']);0x1===_0x2082fb['length']?this['_getMenuBarGroupButtons']({'command':_0x7edeef,'commands':_0x2082fb[0x0]['commands'],'parentMenuView':_0xb48194,'onExecute':_0x306539})['forEach'](_0x287bbf=>_0x544b32['items']['add'](_0x287bbf)):_0x2082fb['forEach'](({groupId:_0x23e2ba,groupLabel:_0x229c23,commands:_0x37bb25})=>{const _0x4d5ee7=new _0x43c40c(_0x5dd8f7,_0xb48194),_0x509d70=new _0x4aa2c8(_0x5dd8f7),_0x5c66de=new _0x741c4e(_0x5dd8f7),_0x39f623=this['_getMenuBarGroupButtons']({'command':_0x7edeef,'commands':_0x37bb25,'parentMenuView':_0x509d70,'onExecute':_0x306539});_0x509d70['buttonView']['set']({'label':_0x229c23||_0x23e2ba}),_0x509d70['delegate']('execute')['to'](_0xb48194),_0x5c66de['items']['addMany'](_0x39f623),_0x509d70['panelView']['children']['add'](_0x5c66de),_0x4d5ee7['children']['add'](_0x509d70),_0x544b32['items']['add'](_0x4d5ee7);}),_0xb48194['panelView']['children']['add'](_0x544b32);}['_getMenuBarGroupButtons']({command:_0x2dd0ea,commands:_0x2dee37,parentMenuView:_0x3943ea,onExecute:_0x322195}){const _0xc373a1=this['editor'],_0x5710cc=_0xc373a1['locale'];return U(_0xc373a1,_0x2dee37)['map'](_0x33eddc=>{const _0x1491dd=new _0x43c40c(_0x5710cc,_0x3943ea),_0x525c46=new _0x3b6759(_0x5710cc);return _0x525c46['set']({'label':_0x33eddc['label']}),_0x525c46['delegate']('execute')['to'](_0x3943ea),_0x525c46['on']('execute',()=>_0x322195(_0x33eddc['id'])),_0x525c46['bind']('isEnabled')['to'](_0x2dd0ea,'enabledCommandsIds',_0x48bbcb=>_0x48bbcb['includes'](_0x33eddc['id'])),_0x1491dd['children']['add'](_0x525c46),_0x1491dd;});}}function B(_0x364fee,_0x2efdec){return void 0x0!==_0x364fee['order']&&void 0x0===_0x2efdec['order']?0x1:void 0x0===_0x364fee['order']&&void 0x0!==_0x2efdec['order']?-0x1:void 0x0!==_0x364fee['order']&&void 0x0!==_0x2efdec['order']?_0x364fee['order']-_0x2efdec['order']:0x0;}function U(_0x333b7e,_0x5255f5){_0x5255f5['sort'](B);const _0x5cf957={},_0x98e182=[];for(const _0x5d8fce of _0x5255f5)if(void 0x0!==_0x5d8fce['order']){if(_0x5d8fce['order']in _0x5cf957)throw new _0x4c9cbe('ai-commands-config-order-collision',_0x333b7e,{'conflictingDefinitions':[_0x5d8fce,_0x5cf957[_0x5d8fce['order']]]});_0x5cf957[_0x5d8fce['order']]=_0x5d8fce,_0x98e182['splice'](_0x5d8fce['order'],0x0,_0x5d8fce);}else _0x98e182['push'](_0x5d8fce);return _0x98e182;}class r extends _0x43c8eb{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x284234){super(_0x284234);const _0x21390f=_0x284234['config'],_0x1fe7c7=_0x284234['locale'];_0x21390f['define']('ai.aiAssistant.preserveComments',!0x0),_0x21390f['define']('ai.aiAssistant.commands',function(_0x1a0f47){return[{'groupId':'editOrReview','groupLabel':i(_0x1a0f47,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1a0f47,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1a0f47,'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(_0x1a0f47,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1a0f47,'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(_0x1a0f47,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1a0f47,'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(_0x1a0f47,'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(_0x1a0f47,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1a0f47,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1a0f47,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1a0f47,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1a0f47,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1a0f47,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1a0f47,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1a0f47,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1a0f47,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1a0f47,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1a0f47,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1a0f47,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1a0f47,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1a0f47,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1a0f47,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1a0f47,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1a0f47,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1a0f47,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1a0f47,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1a0f47,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x1fe7c7)),_0x21390f['define']('ai.aiAssistant.extraCommandGroups',[]),_0x21390f['define']('ai.aiAssistant.removeCommands',[]);let _0x5d8321=o(_0x21390f['get']('ai.aiAssistant.commands'),_0x1fe7c7);const _0x3750c1=_0x21390f['get']('ai.aiAssistant.extraCommandGroups'),_0x824795=_0x21390f['get']('ai.aiAssistant.removeCommands');_0x3750c1['forEach'](_0x52cff0=>{const _0x28fc6a=_0x5d8321['find'](_0x32c575=>_0x32c575['groupId']===_0x52cff0['groupId']);_0x28fc6a?_0x28fc6a['commands']=_0x28fc6a['commands']['concat'](_0x52cff0['commands']):_0x5d8321['push'](_0x52cff0);}),_0x5d8321=_0x5d8321['filter'](_0x165ce2=>!_0x824795['includes'](_0x165ce2['groupId'])),_0x5d8321['forEach'](_0x3db528=>{_0x3db528['commands']=_0x3db528['commands']['filter'](_0x46aa51=>!_0x824795['includes'](_0x46aa51['id']));}),_0x21390f['set']('ai.aiAssistant.commands',_0x5d8321);}}class P extends _0x43c8eb{['abortController'];static get['requires'](){return[K];}constructor(_0x280795){super(_0x280795),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'](_0x49f788){return this['sendRequest'](_0x49f788)['catch'](_0x4c8cbe=>{if(_0x4c8cbe instanceof R)return Promise['reject'](_0x4c8cbe);if('AbortError'==_0x4c8cbe['name'])return Promise['resolve']();throw console['error'](_0x4c8cbe),new _0x4c9cbe('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x2b2955,_0x2c5761){const _0x166530=this['editor']['locale'],_0xa8f330={'Content-Type':'application/json'};if('object'==typeof _0x2b2955)Object['assign'](_0xa8f330,_0x2b2955);else{if(_0x2b2955)try{const _0x81f1fa=await _0x2b2955(_0x2c5761);Object['assign'](_0xa8f330,_0x81f1fa);}catch(_0x454bc1){return Promise['reject'](new R(i(_0x166530,'AI_ERROR_GET_HEADERS')));}}return _0xa8f330;}async['_prepareRequestParameters'](_0x2983f6,_0x35e015){const _0x409a3b=this['editor']['locale'];if('object'==typeof _0x2983f6)return _0x2983f6;try{return await _0x2983f6(_0x35e015);}catch(_0x5ea07c){return Promise['reject'](new R(i(_0x409a3b,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x33e40d){super(_0x33e40d),_0x33e40d['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x33e40d['config']['get']('ai.openAI.requestParameters')||_0x33e40d['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x33e40d['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x33e40d['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x33e40d['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x1578b6,context:_0x483f3b,onData:_0xe66edf,actionId:_0x2d5bbe}){const _0x2bdb44=this['editor']['locale'],_0x496906=await this['prepareMessages'](_0x1578b6,_0x483f3b,_0x2d5bbe),_0x1c247a=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2d5bbe),_0x46c05c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x2d5bbe),_0x31ed03={'messages':_0x496906,..._0x46c05c},_0xbf1f32={'method':'POST','headers':_0x1c247a,'body':JSON['stringify'](_0x31ed03),'signal':this['abortController']['signal']},_0x21039a=await fetch(this['_apiUrl'],_0xbf1f32);if(_0x21039a['ok'])return _0x46c05c['stream']?await this['_readStreamableResponse'](_0x21039a,_0xe66edf):await this['_readStaticResponse'](_0x21039a,_0xe66edf),Promise['resolve']();{const _0x2789e7=await _0x21039a['text']();return _0x2789e7['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2bdb44,'AI_ERROR_CONTEXT_LENGTH'))):_0x2789e7['includes']('Moderation')?Promise['reject'](new R(i(_0x2bdb44,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x2789e7));}}async['prepareMessages'](_0xe51297,_0x526c14,_0x177734){let _0x23ca10,_0x111c9b;return _0x526c14?(_0x23ca10='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.',_0x111c9b='Instruction:\x0a'+_0xe51297+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x526c14):(_0x23ca10='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.',_0x111c9b=_0xe51297),[{'role':'system','content':_0x23ca10},{'role':'user','content':_0x111c9b}];}async['_readStreamableResponse'](_0x16ba9e,_0x4b6400){const _0x3b9afb=_0x16ba9e['body']['getReader'](),_0x4129c5=new TextDecoder();let _0x55b507='',_0x38f4f3='',_0x208916='',_0x1be3d9=!0x1;for(;!_0x1be3d9;){const {done:_0x1fb34b,value:_0x5310cf}=await _0x3b9afb['read'](),_0x9082e7=_0x55b507+_0x4129c5['decode'](_0x5310cf);let _0x4dcf6f='';_0x1be3d9=_0x1fb34b;try{_0x4dcf6f=this['_cleanUpData'](_0x9082e7),_0x55b507='';}catch(_0x3ddca7){_0x55b507=_0x9082e7;continue;}_0x38f4f3+=_0x4dcf6f,!_0x1be3d9&&this['_isBufferIncomplete'](_0x38f4f3)||_0x38f4f3&&(_0x208916+=_0x38f4f3,_0x38f4f3='',_0x4b6400(_0x208916));}return Promise['resolve']();}async['_readStaticResponse'](_0x2865d3,_0x35592b){return _0x35592b((await _0x2865d3['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2c39d4){const _0x26abfd=_0x2c39d4['split']('<')['length']!==_0x2c39d4['split']('>')['length'],_0x1ccf1f=_0x2c39d4['length']<0x1e;return _0x26abfd&&_0x1ccf1f;}['_cleanUpData'](_0x336124){return _0x336124['split'](/\n(?![^{]*\})/g)['map'](_0x1106a3=>_0x1106a3['replace']('data:\x20',''))['filter'](_0x2397e6=>_0x2397e6&&_0x2397e6['length']>0x0&&'[DONE]'!==_0x2397e6)['map'](_0x15495d=>{const {choices:_0x12bd3c}=JSON['parse'](_0x15495d);if(_0x12bd3c[0x0]&&_0x12bd3c[0x0]['delta']&&_0x12bd3c[0x0]['delta']['content'])return _0x12bd3c[0x0]['delta']['content'];})['filter'](_0x4d423b=>_0x4d423b)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x45b481){super(_0x45b481),_0x45b481['config']['get']('ai.aws.requestParameters')||_0x45b481['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']=_0x45b481['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x45b481['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x45b481['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x45b481['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x43dc2f,context:_0x1c7eb9,onData:_0x19ecd4,actionId:_0x30c88e}){const {model:_0x227d6d,stream:_0x2da39b,..._0x36c06f}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x30c88e),_0x32cbf2={'prompt':await this['preparePrompt'](_0x43dc2f,_0x1c7eb9,_0x227d6d,_0x30c88e),..._0x36c06f};this['_apiUrl']?await this['_processProxyRequest'](_0x32cbf2,_0x227d6d,_0x2da39b,_0x19ecd4,_0x30c88e):await this['_processAWSRequest'](_0x32cbf2,_0x227d6d,_0x2da39b,_0x19ecd4);}async['preparePrompt'](_0x426f6a,_0xbe6fd6,_0x3d7560,_0x4736d8){let _0x4cf9ca,_0x3db88a;return _0xbe6fd6?(_0x4cf9ca='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.',_0x3db88a='Instruction:\x0a'+_0x426f6a+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xbe6fd6):(_0x4cf9ca='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.',_0x3db88a=_0x426f6a),'meta.llama'==this['getModelFamily'](_0x3d7560)?'<<SYS>>\x0a'+_0x4cf9ca+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3db88a+'\x0a[/INST]':'Human:\x0a'+_0x4cf9ca+'\x0a'+_0x3db88a+'\x0a\x0aAssistant:';}['getModelFamily'](_0x25c754){if(/^anthropic\.claude/['test'](_0x25c754))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x25c754))return'ai21.j2';if(/^cohere\.command/['test'](_0x25c754))return'cohere.command';if(/^meta\.llama/['test'](_0x25c754))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x25c754));}async['_processProxyRequest'](_0x1ce6b0,_0x5adc93,_0x465364,_0x2cc4a0,_0x2c4cfe){const _0x4b6c17={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x2c4cfe),'body':JSON['stringify']({..._0x1ce6b0,'model':_0x5adc93,'stream':_0x465364}),'signal':this['abortController']['signal']},_0x3b0010=await fetch(this['_apiUrl'],_0x4b6c17);_0x465364?await this['_readStreamableResponse'](_0x3b0010,_0x5adc93,_0x2cc4a0):await this['_readStaticResponse'](_0x3b0010,_0x5adc93,_0x2cc4a0);}async['_processAWSRequest'](_0x2a77a8,_0x2ec0d3,_0x558a7b,_0xd3b812){const _0x540acc=new _0x4792ed(this['_bedrockClientConfig']),_0x456c18={'body':JSON['stringify'](_0x2a77a8),'contentType':'application/json','accept':'application/json','modelId':_0x2ec0d3};let _0x4c388d;if(_0x558a7b){const _0xee692a=new _0x50c3b9(_0x456c18);_0x4c388d=await _0x540acc['send'](_0xee692a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x4c388d,_0x2ec0d3,_0xd3b812);}else{const _0x506475=new _0x2ea9dc(_0x456c18);_0x4c388d=await _0x540acc['send'](_0x506475,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x4c388d,_0x2ec0d3,_0xd3b812);}}async['_readAsyncIterableResponse'](_0x5a0dbc,_0x4bbd99,_0x592a82){const _0x51da70=_0x5a0dbc['body'],_0x5bb152=new TextDecoder('utf-8');let _0x4052ed='';for await(const _0x32b8e3 of _0x51da70)if(_0x32b8e3['chunk']){const _0x4db473=_0x5bb152['decode'](_0x32b8e3['chunk']['bytes']),_0x3a088b=JSON['parse'](_0x4db473);_0x4052ed+=this['_getGeneratedText'](_0x3a088b,_0x4bbd99),_0x592a82(_0x4052ed);}return Promise['resolve']();}async['_readStreamableResponse'](_0x3c1f96,_0x17a710,_0x4b0c76){const _0x48e4a4=_0x3c1f96['body'],_0x2e241d=new TextDecoder('utf-8'),_0x346e8e=_0x48e4a4['getReader']();let _0x3fa696='',_0x4360a1='',_0x1aeeb6=!0x1;for(;!_0x1aeeb6;){const {done:_0x5da204,value:_0x252b5a}=await _0x346e8e['read']();if(_0x1aeeb6=_0x5da204,_0x1aeeb6)break;const _0x1556f3=(_0x3fa696+_0x2e241d['decode'](_0x252b5a))['split']('\x0a')['map'](_0x1ee313=>{try{return _0x3fa696='',JSON['parse'](_0x1ee313);}catch(_0x4db1bc){return _0x3fa696=_0x1ee313,null;}})['filter'](_0x3f9d21=>null!==_0x3f9d21);_0x1556f3['length']&&(_0x4360a1+=_0x1556f3['map'](_0x481156=>this['_getGeneratedText'](_0x481156,_0x17a710))['join'](''),_0x4b0c76(_0x4360a1));}return Promise['resolve']();}async['_readStaticResponse'](_0x30e82b,_0x1539e0,_0x3f13f3){let _0x487f03;return _0x487f03=_0x30e82b instanceof Response?await _0x30e82b['json']():JSON['parse'](Buffer['from'](_0x30e82b['body'])['toString']('utf8')),(_0x3f13f3(this['_getGeneratedText'](_0x487f03,_0x1539e0)),Promise['resolve']());}['_getGeneratedText'](_0x2be3c7,_0x223521){switch(this['getModelFamily'](_0x223521)){case'anthropic.claude':return _0x2be3c7['completion'];case'ai21.j2':return _0x2be3c7['completions'][0x0]['data']['text'];case'cohere.command':return _0x2be3c7['generations'][0x0]['text'];case'meta.llama':return _0x2be3c7['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':_0x464dbf=>0x1!=_0x464dbf}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x519779=>{const {af:{dictionary:_0x1ab5fa,getPluralForm:_0x4c13c0}}={'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':_0xdc4aac=>0x1!=_0xdc4aac}};_0x519779['af']||={'dictionary':{},'getPluralForm':null},_0x519779['af']['dictionary']=Object['assign'](_0x519779['af']['dictionary'],_0x1ab5fa),_0x519779['af']['getPluralForm']=_0x4c13c0;})(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':_0x5d3623=>0x0==_0x5d3623?0x0:0x1==_0x5d3623?0x1:0x2==_0x5d3623?0x2:_0x5d3623%0x64>=0x3&&_0x5d3623%0x64<=0xa?0x3:_0x5d3623%0x64>=0xb?0x4:0x5}};
|