@ckeditor/ckeditor5-ai 46.0.3 → 46.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/package.json +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 _0x2d1d32,Command as _0x232af3}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3deb9c,IconCheck as _0x3c90d9,IconError as _0x5e3cca,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x2380a6,IconRobotPencil as _0x2d8fe9}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x5d18ab,CKEditorError as _0x5038d9,ObservableMixin as _0x8cf721,global as _0x10ddad,isVisible as _0x3d06cb,Rect as _0xf542e8,Collection as _0x50b992,FocusTracker as et,KeystrokeHandler as rt,first as _0x34c6dc}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x26e4f0,View as _0x4c348a,SpinnerView as _0x7b6e84,IconView as _0x520ab5,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x78ce67,createDropdown as _0x4943e6,addMenuToDropdown as _0x20359e,MenuBarMenuView as _0x2c51f0,MenuBarMenuListItemButtonView as _0x4b8772,DialogViewPosition as _0x52abdf,MenuBarMenuListView as _0x5255c6,MenuBarMenuListItemView as _0x20f208}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x16a737,ClipboardMarkersUtils as _0x324d39}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x565093,ViewDataTransfer as _0x2e0788,ViewUpcastWriter as _0x545b9b,Matcher as _0x21b667}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x5f2ebf,InvokeModelWithResponseStreamCommand as _0x46d9e4,InvokeModelCommand as _0xcfc9f2}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x5dfda9,_0x511f6a){const _0x49b2c9=(0x0,_0x511f6a['t'])('Other');return _0x5dfda9['length']?'groupId'in _0x5dfda9[0x0]?_0x5dfda9:[{'groupId':K,'groupLabel':_0x49b2c9,'order':0x1/0x0,'commands':_0x5dfda9}]:[{'groupId':K,'groupLabel':_0x49b2c9,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x2d1d32{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xcbe6c3}=this,_0x576e3f=['ck-fake-ai-selection'];_0xcbe6c3['config']['get']('ai.useTheme')&&_0x576e3f['push']('ck-ai-assistant-ui_theme'),_0xcbe6c3['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x576e3f,'priority':0xc}}),_0xcbe6c3['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x1401db,{writer:_0x46246b})=>{if(!_0x1401db['markerRange']['isCollapsed'])return null;const _0x516662=_0x46246b['createUIElement']('span');return _0x46246b['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x516662),_0x516662;}});}['afterInit'](){!async function(_0x333dfe){const _0x1f5533=_0x2f2679([0x58,0x7a,0x32,0x61,0x55,0x52,0x65,0x4d,0x6c,0x4f,0x63,0x38,0x57,0x6e,0x75,0x6a,0x45,0x67,0x62,0x41,0x49,0x6f,0x47,0x5a,0x33,0x71,0x59,0x48,0x34,0x46,0x76,0x77,0x72,0x31,0x78,0x56,0x39,0x66,0x44,0x4b,0x6b,0x35,0x36,0x37,0x69,0x73,0x53,0x42,0x6d,0x68,0x64,0x43,0x30,0x70,0x74,0x54,0x79,0x51,0x4c,0x4e,0x4a,0x50]),_0x46e3f8=0x63d77ec7,_0x3ac00e=0x63d00c97^_0x46e3f8,_0x2be294=window[_0x2f2679([0x44,0x61,0x74,0x65])][_0x2f2679([0x6e,0x6f,0x77])](),_0x19a014=_0x333dfe[_0x2f2679([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4a6e23=new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4722a3=>{_0x19a014[_0x2f2679([0x6f,0x6e,0x63,0x65])](_0x2f2679([0x72,0x65,0x61,0x64,0x79]),_0x4722a3);}),_0x42ccc7={[_0x2f2679([0x6b,0x74,0x79])]:_0x2f2679([0x45,0x43]),[_0x2f2679([0x75,0x73,0x65])]:_0x2f2679([0x73,0x69,0x67]),[_0x2f2679([0x63,0x72,0x76])]:_0x2f2679([0x50,0x2d,0x32,0x35,0x36]),[_0x2f2679([0x78])]:_0x2f2679([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]),[_0x2f2679([0x79])]:_0x2f2679([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]),[_0x2f2679([0x61,0x6c,0x67])]:_0x2f2679([0x45,0x53,0x32,0x35,0x36])},_0x269ec5=_0x19a014[_0x2f2679([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2f2679([0x67,0x65,0x74])](_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5ab2c0(){let _0x564948,_0x356dbf=null,_0x2a3899=null;try{if(_0x269ec5==_0x2f2679([0x47,0x50,0x4c]))return _0x2f2679([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x564948=_0x3ba6a3(),!_0x564948)return _0x2f2679([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x564948[_0x2f2679([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2a3899=_0x2a1074(_0x564948[_0x2f2679([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x564948[_0x2f2679([0x6a,0x74,0x69])])),await _0x3f9d9e()?_0x4a00e2()?_0x3f8b13()?_0x2f2679([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x75fc62()?(_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2f2679([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x356dbf=_0x676625(_0x2f2679([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2f2679([0x74,0x72,0x69,0x61,0x6c])&&(_0x356dbf=_0x676625(_0x2f2679([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x2a2a31()):_0x2f2679([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2f2679([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2f2679([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2f2679([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3f8b13(){const _0x25aa48=[_0x2f2679([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2f2679([0x74,0x72,0x69,0x61,0x6c])][_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x2be294/0x3e8:0xe10*_0x3ac00e;return _0x564948[_0x2f2679([0x65,0x78,0x70])]<_0x25aa48;}function _0x4a00e2(){const _0x4f6ef9=_0x564948[_0x2f2679([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4f6ef9&&(!!_0x4f6ef9[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f2679([0x2a]))||!!_0x4f6ef9[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f2679([0x41,0x49])));}function _0x75fc62(){const _0x52b5d9=_0x564948[_0x2f2679([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x52b5d9||0x0==_0x52b5d9[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2d48d2}=new URL(window[_0x2f2679([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x52b5d9[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2d48d2))return!0x0;const _0x207f77=_0x2d48d2[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e]));return _0x52b5d9[_0x2f2679([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4d4318=>_0x4d4318[_0x2f2679([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2f2679([0x2a])))[_0x2f2679([0x6d,0x61,0x70])](_0x39fb14=>_0x39fb14[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e])))[_0x2f2679([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4ef16d=>_0x4ef16d[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x207f77[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2f2679([0x6d,0x61,0x70])](_0x7c2ec1=>Array(_0x207f77[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x7c2ec1[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2f2679([0x66,0x69,0x6c,0x6c])](_0x7c2ec1[0x0]===_0x2f2679([0x2a])?_0x2f2679([0x2a]):'')[_0x2f2679([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x7c2ec1))[_0x2f2679([0x73,0x6f,0x6d,0x65])](_0x2217ca=>_0x207f77[_0x2f2679([0x65,0x76,0x65,0x72,0x79])]((_0x4beb45,_0x5db224)=>_0x2217ca[_0x5db224]===_0x4beb45||_0x2217ca[_0x5db224]===_0x2f2679([0x2a])));}function _0x2a2a31(){return _0x356dbf&&_0x2a3899?new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x394493,_0x423ed9)=>{_0x356dbf[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x394493,_0x423ed9),_0x2a3899[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x272ea0=>{_0x272ea0!=_0x2f2679([0x56,0x61,0x6c,0x69,0x64])&&_0x394493(_0x272ea0);},_0x423ed9);}):_0x356dbf||_0x2a3899||_0x2f2679([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2a1074(_0x3bfbe9,_0x4428ab){return new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ec275=>{if(_0x5bbb9b())return _0x3ec275(_0x2f2679([0x56,0x61,0x6c,0x69,0x64]));_0x2b6d1f(),_0x19a014[_0x2f2679([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2f2679([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x46316b=!0x1;const _0x1d6eac=_0x5d18ab();function _0x3d96bc(_0x460232){return!!_0x460232&&(typeof _0x460232===_0x2f2679([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x460232===_0x2f2679([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x460232[_0x2f2679([0x74,0x68,0x65,0x6e])]===_0x2f2679([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x460232[_0x2f2679([0x63,0x61,0x74,0x63,0x68])]===_0x2f2679([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x2a0ad0(_0x375f29){_0x24d5eb(_0x375f29)[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x221b62=>{if(!_0x221b62||_0x221b62[_0x2f2679([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2f2679([0x6f,0x6b]))return _0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x33ca4f(_0x55cb30(_0x1d6eac+_0x4428ab))!=_0x221b62[_0x2f2679([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2f2679([0x56,0x61,0x6c,0x69,0x64]);})[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x371d67=>(_0x3879b4(),_0x371d67),()=>{const _0x4d7da4=_0x642579();return null==_0x4d7da4?(_0x3879b4(),_0x2f2679([0x56,0x61,0x6c,0x69,0x64])):_0x2f2679(_0x2be294-_0x4d7da4>(0x47dbfac7^_0x46e3f8)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x3ec275)[_0x2f2679([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3ec275(_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x52310e=0x63e19047^_0x46e3f8;function _0x3879b4(){const _0x3d9929=_0x2f2679([0x6c,0x6c,0x63,0x74,0x2d])+_0x33ca4f(_0x55cb30(_0x3bfbe9)),_0x3c67e3=_0x11264d(_0x33ca4f(window[_0x2f2679([0x4d,0x61,0x74,0x68])][_0x2f2679([0x63,0x65,0x69,0x6c])](_0x2be294/_0x52310e)));window[_0x2f2679([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2f2679([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3d9929,_0x3c67e3);}function _0x642579(){const _0x170a75=_0x2f2679([0x6c,0x6c,0x63,0x74,0x2d])+_0x33ca4f(_0x55cb30(_0x3bfbe9)),_0x1c97ea=window[_0x2f2679([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2f2679([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x170a75);return _0x1c97ea?window[_0x2f2679([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x11264d(_0x1c97ea),0x10)*_0x52310e:null;}function _0x24d5eb(_0x3b20f2){return new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x461b06,_0x4ff657)=>{_0x3b20f2[_0x2f2679([0x74,0x68,0x65,0x6e])](_0x461b06,_0x4ff657),window[_0x2f2679([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4ff657,0x63d6aa07^_0x46e3f8);});}}_0x19a014[_0x2f2679([0x6f,0x6e])](_0x2f2679([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x19c899,_0x15fc9a)=>{if(_0x15fc9a[0x0]!=_0x3bfbe9)return _0x3ec275(_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x15fc9a[0x1]={..._0x15fc9a[0x1],[_0x2f2679([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x1d6eac};},{[_0x2f2679([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2f2679([0x68,0x69,0x67,0x68])}),_0x19a014[_0x2f2679([0x6f,0x6e])](_0x2f2679([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x521d7e=>{_0x3d96bc(_0x521d7e[_0x2f2679([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x46316b=!0x0,_0x2a0ad0(_0x521d7e[_0x2f2679([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2f2679([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2f2679([0x6c,0x6f,0x77])}),_0x4a6e23[_0x2f2679([0x74,0x68,0x65,0x6e])](()=>{_0x46316b||_0x3ec275(_0x2f2679([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x5bbb9b(){return _0x19a014[_0x2f2679([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2f2679([0x76,0x69,0x65,0x77])][_0x2f2679([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2f2679([0x61,0x75,0x74,0x6f]);}function _0x2b6d1f(){_0x19a014[_0x2f2679([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2f2679([0x76,0x69,0x65,0x77])][_0x2f2679([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2f2679([0x61,0x75,0x74,0x6f]);}}function _0x676625(_0x50529b){const _0x4d01db=[new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xaaf6ab=>setTimeout(_0xaaf6ab,0x63de400b^_0x46e3f8)),_0x4a6e23[_0x2f2679([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xd7ed05=>{let _0x2bb1f8=0x0;_0x19a014[_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f2679([0x6f,0x6e])](_0x2f2679([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x24f4ca,_0x3b5706)=>{_0x3b5706[0x0][_0x2f2679([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2bb1f8++,_0x2bb1f8==(0x63d77f3f^_0x46e3f8)&&(_0xd7ed05(),_0x24f4ca[_0x2f2679([0x6f,0x66,0x66])]());});}))];return window[_0x2f2679([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2f2679([0x72,0x61,0x63,0x65])](_0x4d01db)[_0x2f2679([0x74,0x68,0x65,0x6e])](()=>_0x50529b);}async function _0x2224b4(){await _0x4a6e23,_0x19a014[_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f2679([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5b00b1,_0x19a014[_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c])][_0x2f2679([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5b00b1,_0x19a014[_0x2f2679([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2f2679([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5827f1(_0x5a196f){const _0xde98ee=_0x2f0886();_0x19a014[_0xde98ee]=_0x2f2679([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5a196f,_0x5a196f!=_0x2f2679([0x56,0x61,0x6c,0x69,0x64])&&_0x2224b4();}function _0x2f0886(){const _0x2ce37f=window[_0x2f2679([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2f2679([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2f2679([0x6e,0x6f,0x77])]())[_0x2f2679([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2f2679([0x2e]),'');let _0x220a05=_0x2f2679([0x58]);for(let _0x363f8c=0x0;_0x363f8c<_0x2ce37f[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x363f8c+=0x2){let _0x4216dc=window[_0x2f2679([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2ce37f[_0x2f2679([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x363f8c,_0x363f8c+0x2));_0x4216dc>=_0x1f5533[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4216dc-=_0x1f5533[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x220a05+=_0x1f5533[_0x4216dc];}return _0x220a05;}function _0x3ba6a3(){const _0x509546=_0x269ec5[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e]));if(0x3!=_0x509546[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x46fee0(_0x509546[0x1]);function _0x46fee0(_0x7f053c){const _0x10dca4=_0x450790(_0x7f053c);return _0x10dca4&&_0x3200d3()?_0x10dca4:null;function _0x3200d3(){const _0x3b2bf9=_0x10dca4[_0x2f2679([0x6a,0x74,0x69])],_0xd31e60=window[_0x2f2679([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3b2bf9[_0x2f2679([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x3b2bf9[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4a8f32={..._0x10dca4,[_0x2f2679([0x6a,0x74,0x69])]:_0x3b2bf9[_0x2f2679([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x3b2bf9[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4a8f32[_0x2f2679([0x76,0x63])],_0x55cb30(_0x4a8f32)==_0xd31e60;}}}async function _0x3f9d9e(){let _0x46417b=!0x0;try{const _0x128a86=_0x269ec5[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])](_0x2f2679([0x2e])),[_0x4cae80,_0x6c7c32,_0x3ab113]=_0x128a86;return _0x5ce64b(_0x4cae80),await _0x3275e8(_0x4cae80,_0x6c7c32,_0x3ab113),_0x46417b;}catch{return!0x1;}function _0x5ce64b(_0x3d30dc){const _0x51c12c=_0x450790(_0x3d30dc);_0x51c12c&&_0x51c12c[_0x2f2679([0x61,0x6c,0x67])]==_0x2f2679([0x45,0x53,0x32,0x35,0x36])||(_0x46417b=!0x1);}async function _0x3275e8(_0x312542,_0x484dab,_0x49b677){const _0x168a72=window[_0x2f2679([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2f2679([0x66,0x72,0x6f,0x6d])](_0xd0a8(_0x49b677),_0x181446=>_0x181446[_0x2f2679([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x489380=new window[(_0x2f2679([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2f2679([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x312542+_0x2f2679([0x2e])+_0x484dab),_0x47a7f3=window[_0x2f2679([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2f2679([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x47a7f3)return;const _0x2a5764=await _0x47a7f3[_0x2f2679([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2f2679([0x6a,0x77,0x6b]),_0x42ccc7,{[_0x2f2679([0x6e,0x61,0x6d,0x65])]:_0x2f2679([0x45,0x43,0x44,0x53,0x41]),[_0x2f2679([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2f2679([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2f2679([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x47a7f3[_0x2f2679([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2f2679([0x6e,0x61,0x6d,0x65])]:_0x2f2679([0x45,0x43,0x44,0x53,0x41]),[_0x2f2679([0x68,0x61,0x73,0x68])]:{[_0x2f2679([0x6e,0x61,0x6d,0x65])]:_0x2f2679([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2a5764,_0x168a72,_0x489380)||(_0x46417b=!0x1);}}function _0x450790(_0x41f0a1){return _0x41f0a1[_0x2f2679([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2f2679([0x65,0x79]))?JSON[_0x2f2679([0x70,0x61,0x72,0x73,0x65])](_0xd0a8(_0x41f0a1)):null;}function _0xd0a8(_0x2c4f88){return window[_0x2f2679([0x61,0x74,0x6f,0x62])](_0x2c4f88[_0x2f2679([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2f2679([0x2b]))[_0x2f2679([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2f2679([0x2f])));}function _0x55cb30(_0x492f99){let _0x2c72a1=0x1505;function _0x5a65b5(_0x8bff1c){for(let _0x184e33=0x0;_0x184e33<_0x8bff1c[_0x2f2679([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x184e33++){const _0x3330ca=_0x8bff1c[_0x2f2679([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x184e33);_0x2c72a1=(_0x2c72a1<<0x5)+_0x2c72a1+_0x3330ca,_0x2c72a1&=_0x2c72a1;}}function _0x47ad0b(_0x1ee14b){Array[_0x2f2679([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1ee14b)?_0x1ee14b[_0x2f2679([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x47ad0b):_0x1ee14b&&typeof _0x1ee14b==_0x2f2679([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2f2679([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1ee14b)[_0x2f2679([0x73,0x6f,0x72,0x74])]()[_0x2f2679([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x409c9a,_0x4a997c])=>{_0x5a65b5(_0x409c9a),_0x47ad0b(_0x4a997c);}):_0x5a65b5(window[_0x2f2679([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1ee14b));}return _0x47ad0b(_0x492f99),_0x2c72a1>>>0x0;}function _0x33ca4f(_0x34e1ee){return _0x34e1ee[_0x2f2679([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2f2679([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2f2679([0x30]));}function _0x11264d(_0x961f8d){return _0x961f8d[_0x2f2679([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2f2679([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2f2679([0x6a,0x6f,0x69,0x6e])]('');}function _0x5b00b1(){}function _0x2f2679(_0x4899a2){return _0x4899a2['map'](_0x31bd55=>String['fromCharCode'](_0x31bd55))['join']('');}_0x5827f1(await _0x5ab2c0());}(this);}['showFakeVisualSelection'](){const _0x399d92=this['editor']['model'];_0x399d92['change'](_0x3c0334=>{const _0x2bb164=_0x399d92['document']['selection']['getRanges']();let _0x3a40a7=0x0;for(const _0xa11d2b of _0x2bb164){const _0x3e4a32=w+':'+_0x3a40a7;if(_0x399d92['markers']['has'](_0x3e4a32))_0x3c0334['updateMarker'](_0x3e4a32,{'range':_0xa11d2b});else{if(_0xa11d2b['start']['isAtEnd']){const _0x5e25cb=_0xa11d2b['start']['getLastMatchingPosition'](({item:_0x4d6373})=>!_0x399d92['schema']['isContent'](_0x4d6373),{'boundaries':_0xa11d2b});_0x3c0334['addMarker'](_0x3e4a32,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3c0334['createRange'](_0x5e25cb,_0xa11d2b['end'])});}else _0x3c0334['addMarker'](_0x3e4a32,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xa11d2b});}_0x3a40a7++;}});}['hideFakeVisualSelection'](){const _0x4d6e4c=this['editor']['model'],_0x5a98cb=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x5a98cb['length']&&_0x4d6e4c['change'](_0x29bc67=>{_0x5a98cb['forEach'](_0xeb1cf8=>{_0x29bc67['removeMarker'](_0xeb1cf8);});});}['insertContent'](_0x26eadf,_0x1976a7){const _0xa15539=this['_getAISelection'](),_0x5d21ba=_0x1976a7||_0xa15539['getFirstRange']();this['editor']['model']['canEditAt'](_0x5d21ba)&&this['editor']['model']['change'](_0x210997=>{this['hideFakeVisualSelection'](),_0x1976a7||this['_resetContentOfSelectedTableCells'](_0x210997,_0xa15539),this['_pasteHTMLUsingClipboard']({'insertAt':_0x5d21ba,'writer':_0x210997,'html':_0x26eadf});});}['insertContentBelow'](_0x3c8d7a){const {model:_0x3ce2f2}=this['editor'],_0x3031b1=this['_getAISelection']();_0x3ce2f2['change'](()=>{const _0x4ebd47=this['_prepareTableInsertBelowPosition'](_0x3c8d7a,_0x3031b1)||this['_getDefaultInsertBelowPosition'](_0x3031b1);this['insertContent'](_0x3c8d7a,_0x4ebd47);});}['_getAISelection'](){const _0x41a8a3=this['editor']['model'],_0x368cd9=Array['from'](_0x41a8a3['markers']['getMarkersGroup'](w))['map'](_0x2ee88c=>_0x2ee88c['getRange']());return _0x41a8a3['createSelection'](_0x368cd9);}['_pasteHTMLUsingClipboard']({writer:_0x120ff8,html:_0x58b394,insertAt:_0x162ee1}){const {view:_0x264c16}=this['editor']['editing'],_0x11069e=this['editor']['plugins']['get'](_0x16a737),_0x2c42d0=new gt();_0x2c42d0['setData']('text/html',_0x58b394);const _0x24d2d1=new ClipboardEvent('paste',{'clipboardData':_0x2c42d0}),_0x2a3f9e=new _0x565093(_0x264c16,_0x24d2d1,{'dataTransfer':new _0x2e0788(_0x2c42d0)});_0x120ff8['setSelection'](_0x162ee1);const _0x76830f=(_0x1e0790,_0x14353e)=>{_0x14353e['resultRange']&&_0x120ff8['setSelection'](_0x14353e['resultRange']);};_0x11069e['once']('contentInsertion',_0x76830f,{'priority':'lowest'}),_0x264c16['document']['fire']('paste',_0x2a3f9e),_0x11069e['off']('contentInsertion',_0x76830f);}['_getDefaultInsertBelowPosition'](_0x2b830c){const {model:_0x98db23}=this['editor'],_0x30b2d2=Array['from'](_0x2b830c['getSelectedBlocks']());return _0x30b2d2['length']?_0x98db23['createPositionAfter'](_0x30b2d2['pop']()):_0x2b830c['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x2f963a,_0x22f387){const {model:_0x39f2d3,plugins:_0x4e8f05}=this['editor'];if(_0x4e8f05['has']('TableUtils')){const _0x40d105=_0x4e8f05['get']('TableUtils')['getSelectedTableCells'](_0x22f387);if(_0x40d105['length']){const _0x4dd917=this['_getTableRowCountFromContent'](_0x2f963a),_0x6bd350=this['_createEmptyTableRows'](_0x40d105,_0x4dd917);return _0x39f2d3['createPositionAt'](_0x6bd350,0x0);}}return null;}['_getTableRowCountFromContent'](_0x486356){const _0x23d6e2=this['editor']['plugins']['get']('TableUtils'),_0x230fd3=this['editor']['data']['parse'](_0x486356),_0x485302=Array['from'](_0x230fd3['getChildren']())['filter'](_0x200fd1=>_0x200fd1['is']('element','table'));let _0x1319e7=0x0;return _0x485302['forEach'](_0x2eb7f3=>{_0x1319e7+=_0x23d6e2['getRows'](_0x2eb7f3);}),_0x1319e7;}['_createEmptyTableRows'](_0x235889,_0x28d4b6){const _0x169171=this['editor']['plugins']['get']('TableUtils'),_0x4b0634=_0x169171['getRowIndexes'](_0x235889),_0x20497d=_0x169171['getColumnIndexes'](_0x235889),_0x4c541c=_0x4b0634['last']+0x1,_0x2cb2a1=_0x20497d['first'],_0x16d0ae=_0x235889[0x0]['findAncestor']('table');for(let _0x2c2a09=0x0;_0x2c2a09<_0x28d4b6;_0x2c2a09++)_0x169171['insertRows'](_0x16d0ae,{'at':_0x4c541c});return _0x16d0ae['getChild'](_0x4c541c)['getChild'](_0x2cb2a1);}['_resetContentOfSelectedTableCells'](_0x2f1240,_0x19eedb){const {plugins:_0x4408e3}=this['editor'],{model:_0x23647f}=_0x2f1240;if(!_0x4408e3['has']('TableUtils'))return;_0x4408e3['get']('TableUtils')['getSelectedTableCells'](_0x19eedb)['length']&&_0x23647f['deleteContent'](_0x19eedb);}}class x extends _0x2d1d32{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x5038d9('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x29c0df){super(_0x29c0df),this['name']='AIRequestError';}}function i(_0x444b47,_0x494140,_0x2744ca){const t=_0x444b47['t'];switch(_0x494140){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',_0x2744ca);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2744ca);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'},_0x2744ca);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 _0x494140;}}class E extends _0x232af3{['_commandDefinitions'];constructor(_0x1e632c,_0x2ce60b){super(_0x1e632c),this['_commandDefinitions']=_0x2ce60b,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x3c3578,_0x565f56,_0x113ddf)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x113ddf));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x11c362,_0x1acba7,_0x291ddd)=>{this['enabledCommandsIds']=_0x291ddd?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x54e5d2=this['editor']['model'];this['_hasContext']=function(_0x4f5f9e){const _0x3ccb77=_0x4f5f9e['document']['selection'];return _0x3ccb77['isCollapsed']?0x0!==[..._0x3ccb77['getSelectedBlocks']()]['length']&&![..._0x3ccb77['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4f5f9e['hasContent'](_0x3ccb77['getFirstRange']());}(_0x54e5d2);const _0x11422b=_0x54e5d2['document']['selection'],_0x37aa92=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1d5bc4 of _0x11422b['getRanges']())for(const _0x5392fd of _0x1d5bc4['getItems']())if(_0x5392fd['is']('element')&&_0x37aa92['includes'](_0x5392fd['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x25d0d6='',_0x9225e7='',_0x244351='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x25d0d6,_0x9225e7,_0x244351);}}function F(_0x240b0d,_0x5d66b0){const _0x4d1d01=new Set();for(const _0x478fe9 of _0x240b0d['values']())(_0x5d66b0||!0x1===_0x478fe9['requiresContent'])&&_0x4d1d01['add'](_0x478fe9['id']);return Array['from'](_0x4d1d01);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x8cf721(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4f89f5,_0x42359e,_0x3ad26a){super(),this['editor']=_0x4f89f5,this['textAdapter']=_0x42359e,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3ad26a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x315aa2,_0x10e2db,_0x196f2d)=>{this['view']['value']=this['_sanitizeHTML'](_0x196f2d);}),this['listenTo'](this['view'],'submitPrompt',(_0x596534,_0x51cca9)=>{const _0x5d481c=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x51cca9,_0x5d481c,'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:_0x3f2191,query:_0x14312a,htmlContent:_0x3caa69,label:_0x50acc0,mainActionLabel:_0x385585}){this['view']['prompt']=_0x50acc0,this['view']['mainAction']=_0x385585,this['initialContext']=_0x3caa69,_0x14312a&&(this['view']['isRendered']?this['_handleQuery'](_0x14312a,_0x3caa69,_0x3f2191,_0x50acc0):this['view']['once']('render',()=>{this['_handleQuery'](_0x14312a,_0x3caa69,_0x3f2191,_0x50acc0);}));}['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'](_0x2515c3,_0x1a6cc4,_0x5bc3f4,_0x2ce31b){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x1a6cc4,this['previousQuery']=_0x2515c3,this['previousLabel']=_0x2ce31b||_0x2515c3,this['previousActionId']=_0x5bc3f4,new Promise(_0x1418e2=>{this['textAdapter']['makeRequest']({'query':_0x2515c3,'context':_0x1a6cc4,'onData':_0xc4bc2f=>{this['currentResponse']=_0xc4bc2f,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5bc3f4})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x242585=>{_0x242585 instanceof R?this['view']['handleError'](_0x242585['message']):this['view']['handleError'](),_0x1418e2();})['finally'](()=>{this['stopProcessing'](),_0x1418e2();});});}['_parseAndNormalizeContent'](_0x1622f0,_0x39d6c7=!0x1){const _0x49b65a=Q['exec'](_0x1622f0);_0x1622f0=_0x49b65a?_0x1622f0['substring'](_0x49b65a[0x1]['length']):_0x1622f0['length']<0x64&&!_0x39d6c7?'':this['_stripMarkdownSyntax'](_0x1622f0);const _0x56d0e3=this['_domParser']['parseFromString'](_0x1622f0,'text/html');if(_0x49b65a){const _0xbc1bf5=Array['from'](_0x56d0e3['body']['childNodes']);_0xbc1bf5['reverse']();for(const _0x2ad54a of _0xbc1bf5){if(_0x2ad54a['nodeType']==Node['ELEMENT_NODE'])break;_0x2ad54a['remove']();}}const _0x4f1cd1=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x56d0e3['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x4f1cd1);const _0x338886=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x42d194=this['editor']['data']['toModel'](_0x4f1cd1);return _0x338886||_0x42d194['markers']['clear'](),this['editor']['data']['stringify'](_0x42d194);}['_normalizeResponseHeadings'](_0x2aacca){const _0xa4baef=new _0x545b9b(this['editor']['editing']['view']['document']),_0x4dc590=new _0x21b667({'name':/^h[1-5]$/}),_0x329642=[];let _0x4a671f=!0x1;for(const _0x4545da of _0x2aacca)_0x4545da['is']('element')&&_0x4dc590['match'](_0x4545da)&&(_0x329642['push'](_0x4545da),'h1'==_0x4545da['name']&&(_0x4a671f=!0x0));if(_0x4a671f){for(const _0x217018 of _0x329642)_0xa4baef['rename']('h'+(parseInt(_0x217018['name'][0x1])+0x1),_0x217018);}}['_isH1TagSupportEnabled'](){const {data:_0x23984e,editing:_0x2e32fc}=this['editor'],_0x43ace4=_0x23984e['htmlProcessor']['toView']('<h1></h1>'),_0x1df1e8=_0x23984e['toView'](_0x23984e['toModel'](_0x43ace4));return!!_0x2e32fc['view']['domConverter']['viewToDom'](_0x1df1e8)['querySelector']('h1');}['_sanitizeHTML'](_0x541f01){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x541f01),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xffdccb){const _0x33ff39=_0xffdccb['trim']();return _0x33ff39['startsWith']('```html')?_0x33ff39['endsWith']('```')?_0x33ff39['substring'](0x7,_0x33ff39['length']-0x3):_0x33ff39['substring'](0x7):_0xffdccb;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x195e77){super(_0x195e77),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xfe7fae=>i(_0x195e77,'AI_'+_0xfe7fae['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x195e77,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x195e77,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x195e77,'Stop'));const _0x133b52=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x133b52['if']('isVisible','ck-hidden',_0x1349b9=>!_0x1349b9)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x489795,_0x18f18c){const _0x4ea4d7=new _0x26e4f0(this['locale']);return _0x4ea4d7['set']({'label':_0x489795,'class':_0x18f18c||'','isVisible':!0x0,'withText':!0x0}),_0x4ea4d7;}}class ct extends _0x4c348a{['contentFieldView'];['copyButtonView'];constructor(_0x46b285,_0x139984=''){super(_0x46b285),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1eea58=this['bindTemplate'];this['contentFieldView']=new bt(_0x46b285,_0x139984),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1eea58['if']('isVisible','ck-hidden',_0xf785d8=>!_0xf785d8)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1eea58['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 _0x112214=!0x1;this['on']('change:value',(_0x473520,_0x113229,_0x8ce73f)=>{const _0x2604e0=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x8ce73f),this['isProcessing']&&_0x2604e0&&!_0x112214&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x1060bb,_0xa6146a,_0x3a4b88)=>{_0x112214=!0x1,_0x3a4b88?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x112214=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x112214=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x40651b=this['locale'],_0x1c991d=new _0x26e4f0(this['locale']),_0x8a85ef='ck-ai-form__copy-button';return _0x1c991d['set']({'label':i(_0x40651b,'Copy'),'icon':_0x3deb9c,'class':_0x8a85ef,'tooltip':!0x0}),_0x1c991d['bind']('isVisible')['to'](this,'value',_0x56ec8e=>!!_0x56ec8e),_0x1c991d['bind']('isEnabled')['to'](this,'isProcessing',_0x192a04=>!_0x192a04),_0x1c991d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x1c991d['icon']=_0x3c90d9,_0x1c991d['class']=_0x8a85ef+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x1c991d['icon']=_0x3deb9c,_0x1c991d['class']=_0x8a85ef;},0x3e8);}),_0x1c991d;}['_copyHTMLToClipboard'](_0x5221a8){const {window:_0x4567c7,document:_0x4afd7c}=_0x10ddad;if(_0x4567c7['ClipboardItem']){const {Blob:_0x116332,ClipboardItem:_0x5199ee}=_0x4567c7,_0x118888=[new _0x5199ee({'text/html':new _0x116332([_0x5221a8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x116332([_0x5221a8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x118888);}else{const _0x57ef89=_0x4afd7c['createElement']('div');_0x57ef89['style']['position']='absolute',_0x57ef89['style']['left']='-9999px',_0x57ef89['innerHTML']='<span>[</span>'+_0x5221a8['innerHTML']+'<span>]</span>',_0x4afd7c['body']['appendChild'](_0x57ef89);const _0x3ccc6e=_0x4afd7c['createRange']();_0x3ccc6e['setStartAfter'](_0x57ef89['firstElementChild']),_0x3ccc6e['setEndBefore'](_0x57ef89['lastElementChild']);const _0x299226=_0x4567c7['getSelection']();_0x299226['removeAllRanges'](),_0x299226['addRange'](_0x3ccc6e),_0x4afd7c['execCommand']('copy'),_0x57ef89['remove']();}}}class bt extends _0x4c348a{constructor(_0x5c493e,_0x174d0f=''){super(_0x5c493e),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x174d0f,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x4992f9){this['element']['innerHTML']=_0x4992f9;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4602e3=new _0x4c348a(),_0x1d0ba6=this['locale'],_0x3b5813=new _0x7b6e84();return _0x3b5813['isVisible']=!0x0,_0x4602e3['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3b5813,{'text':i(_0x1d0ba6,'AI\x20is\x20writing...')}]}),_0x4602e3['render'](),_0x4602e3;}}class mt extends _0x4c348a{constructor(_0x2448a0,_0x23ef23=''){super(_0x2448a0);const _0x4cb31c=new _0x520ab5(),_0x110973=this['bindTemplate'];this['set']('text',_0x23ef23),_0x4cb31c['content']=_0x5e3cca,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x4cb31c,{'text':_0x110973['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x2fd757,_0x4e4b96){super(_0x2fd757,_0x4e4b96),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',(_0x40f3e6,_0x2466f7)=>{_0x40f3e6['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2466f7());});}['_createSubmitButton'](){const _0x4aec8e=new _0x26e4f0(this['locale']),_0x3b71c8=this['locale'];return _0x4aec8e['set']({'icon':it,'label':i(_0x3b71c8,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4aec8e['on']('execute',()=>{this['submit']();}),_0x4aec8e['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4d489c,_0x942c02)=>!_0x4d489c&&_0x942c02),_0x4aec8e;}['_createShowHistoryButton'](){const _0x362bc4=new _0x26e4f0(this['locale']),_0x11f740=this['resultsView'],_0x5952b2=this['locale'];_0x362bc4['set']({'label':i(_0x5952b2,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x362bc4['bind']('isOn')['to'](_0x11f740,'isVisible'),_0x362bc4['bind']('isEnabled')['to'](this,'isEnabled'),_0x362bc4['on']('execute',()=>{_0x11f740['isVisible']=!_0x11f740['isVisible'],_0x11f740['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x33efe5=()=>{_0x10ddad['window']['requestAnimationFrame'](()=>{if(_0x3d06cb(this['element'])){const _0x311a29=new _0xf542e8(this['queryView']['fieldView']['element']),_0x59d2d2=_0x311a29['width'],_0x2d51fe='rtl'===_0x5952b2['uiLanguageDirection']?'left':'right';_0x311a29['excludeScrollbarsAndBorders'](),_0x362bc4['element']['style'][_0x2d51fe]=_0x59d2d2-_0x311a29['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x33efe5),this['on']('render',_0x33efe5),_0x362bc4;}['submit'](){const _0x581ede=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x581ede);}['focus'](_0x467bf0){-0x1===_0x467bf0?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x39ca3a){super(_0x39ca3a),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x39ca3a,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x2b8e58=0x0;for(const _0x59b1a2 of this['items'])_0x2b8e58+=_0x59b1a2['items']['length'];return{'resultsCount':_0x2b8e58,'totalItemsCount':_0x2b8e58};}['_createClearHistoryButton'](){const _0x1b3396=this['locale'],_0x471883=new _0x26e4f0(this['locale']);return _0x471883['set']({'label':'('+i(_0x1b3396,'Clear')+')','withText':!0x0}),_0x471883['on']('execute',()=>this['fire']('clearHistory')),_0x471883;}}class ut extends xt{constructor(_0x3fdcc8){super();const _0x422f1a=new wt(),_0x18f0f0=new _0x26e4f0(this['locale'],_0x422f1a);this['children']['add'](_0x18f0f0),_0x18f0f0['set']({'label':_0x3fdcc8['prompt'],'withText':!0x0}),_0x18f0f0['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3fdcc8['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x50b992{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x46920c,_0xdfe2bd)=>{const _0x46cb42=os(_0xdfe2bd['prompt']);for(const _0x3f072e of this)if(_0x3f072e!=_0xdfe2bd&&os(_0x3f072e['prompt'])===_0x46cb42){this['remove'](_0x3f072e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x5ec535=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x5ec535));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x25ac87=>_0x25ac87)));}}function os(_0x56cf9f){return _0x56cf9f['toLowerCase']()['trim']();}class k extends _0x4c348a{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2adf17,_0x4affc5,_0x132200=''){super(_0x2adf17),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x2adf17),this['contentArea']=new ct(_0x2adf17,_0x132200),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x21122c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4affc5],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x21122c['if']('isError','ck-hidden',_0x44a1ba=>!_0x44a1ba)]},'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'](_0x1a5bb8=0x1){-0x1===_0x1a5bb8?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 _0x5e4bf4=this['locale'],_0x52c0be=new lt(_0x5e4bf4,{'queryView':{'label':i(_0x5e4bf4,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x5e4bf4,'Empty\x20history'),'secondary':i(_0x5e4bf4,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x52c0be['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x432720,_0x599fec)=>_0x432720&&!_0x599fec),this['listenTo'](_0x52c0be,'submit',(_0x1874cd,_0x35dad0)=>{this['prompt']=_0x35dad0;const _0x58efec=ft(_0x35dad0);this['fire']('submitPrompt',_0x58efec),_0x35dad0['trim']()&&this['_promptHistory']['add']({'prompt':_0x58efec},0x0);},{'priority':'high'}),_0x52c0be;}['_createHistoryView'](){const _0x430d49=new pt(this['locale']);return _0x430d49['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x430d49['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x430d49;}['_createToolbar'](){const _0x2026f1=new at(this['locale']);return _0x2026f1['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x20fdc7,_0x80d35f,_0x29a049)=>_0x20fdc7&&!_0x80d35f&&!!_0x29a049),_0x2026f1['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x2026f1['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x4f3810,_0x290ea2,_0x1ed44b)=>_0x4f3810&&!_0x290ea2&&!!_0x1ed44b),_0x2026f1['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x2026f1['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x409112,_0x487526)=>_0x409112&&!_0x487526),_0x2026f1['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x2026f1['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x2026f1['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x2026f1;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x5ca913=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x5ca913,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x41d54){const _0x3137dd=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x41d54||i(_0x3137dd,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x2d1d32{['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[_0x324d39,a,x,_0x78ce67];}constructor(_0x14f5c1){super(_0x14f5c1),_0x14f5c1['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x14f5c1['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x14f5c1['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x14f5c1['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x466386}=this;this['_aiAdapter']=_0x466386['plugins']['get'](x),this['_dialog']=_0x466386['plugins']['get'](_0x78ce67),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x14cd0b=new E(_0x466386,Array['from'](this['_commandDefinitions']['values']()));_0x466386['commands']['add']('showAIAssistant',_0x14cd0b),_0x466386['ui']['componentFactory']['add']('aiCommands',_0x29f878=>{const _0x3fcc67=_0x4943e6(_0x29f878);return _0x3fcc67['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x3fcc67['buttonView']['set']({'label':i(_0x29f878,'AI\x20Commands'),'icon':_0x2380a6,'tooltip':!0x0}),_0x3fcc67['on']('execute',_0x47ea61=>this['_onExecute'](_0x47ea61['source']['id'])),_0x20359e(_0x3fcc67,_0x466386['ui']['view']['body'],function(_0x3c13c6){const _0x1050ba=o(_0x3c13c6['config']['get']('ai.aiAssistant.commands'),_0x3c13c6['locale']),_0x5d1c81=U(_0x3c13c6,_0x1050ba)['filter'](_0x49a7f6=>_0x49a7f6['commands']['length']);if(0x1===_0x5d1c81['length'])return U(_0x3c13c6,_0x5d1c81[0x0]['commands'])['map'](_0x5e6385=>({'id':_0x5e6385['id'],'label':_0x5e6385['label']}));return _0x5d1c81['map'](_0x372e13=>{const {groupId:_0x5d2ec8,groupLabel:_0xb84e63,commands:_0x4c7356}=_0x372e13,_0x35dd61=U(_0x3c13c6,_0x4c7356)['map'](_0x15c518=>({'id':_0x15c518['id'],'label':_0x15c518['label']}));return{'id':_0x5d2ec8,'menu':_0xb84e63||_0x5d2ec8,'children':_0x35dd61};});}(_0x466386),{'ariaLabel':i(_0x29f878,'AI\x20Commands')}),_0x3fcc67['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x14cd0b['on']('change:enabledCommandsIds',_0x53b476),_0x3fcc67['menuView']['once']('render',_0x53b476),_0x3fcc67;function _0x53b476(){_0x3fcc67['isEnabled']=_0x14cd0b['enabledCommandsIds']['length']>0x0;for(const _0x22b999 of _0x3fcc67['menuView']['buttons'])_0x22b999['isEnabled']=_0x14cd0b['enabledCommandsIds']['includes'](_0x22b999['id']);}}),_0x466386['ui']['componentFactory']['add']('menuBar:aiCommands',_0x50fb94=>{const _0xa6c704=new _0x2c51f0(_0x50fb94);_0xa6c704['buttonView']['set']({'label':i(_0x50fb94,'AI\x20Commands'),'icon':_0x2380a6}),_0xa6c704['bind']('isEnabled')['to'](_0x14cd0b,'enabledCommandsIds',_0x575e6=>_0x575e6['length']>0x0);const _0x5e3183=o(_0x466386['config']['get']('ai.aiAssistant.commands'),_0x50fb94);return this['_populateMenuBarMenu'](_0x14cd0b,_0xa6c704,_0x5e3183,_0x11bf23=>this['_onExecute'](_0x11bf23)),_0xa6c704;}),_0x466386['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4d70a0=this['_createAIAssistantUIButton'](_0x26e4f0);return _0x4d70a0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4d70a0;}),_0x466386['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x38be26=this['_createAIAssistantUIButton'](_0x4b8772);return _0x38be26['set']({'role':'menuitemcheckbox'}),_0x38be26;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x203cb2=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x43467f;for(const _0x128f10 in _0x203cb2){const _0x463d6a=_0x128f10,_0x3cc568=_0x203cb2[_0x463d6a];if('aiLicenseKeyValid'==_0x3cc568||'aiLicenseKeyInvalid'==_0x3cc568||'aiLicenseKeyExpired'==_0x3cc568||'aiLicenseKeyDomainLimit'==_0x3cc568||'aiLicenseKeyNotAllowed'==_0x3cc568||'aiLicenseKeyEvaluationLimit'==_0x3cc568||'aiLicenseKeyTrialLimit'==_0x3cc568||'aiLicenseKeyUsageLimit'==_0x3cc568){delete _0x203cb2[_0x463d6a],_0x43467f=_0x3cc568,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x43467f&&_0x203cb2['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x43467f&&_0x203cb2['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x43467f&&_0x203cb2['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x43467f&&_0x203cb2['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x70dc1f='',_0x269f61='',_0x442fad='custom'){const _0x53c1b6=this['editor'],_0x3b4d93=_0x53c1b6['editing']['view'],_0x4ef457=_0x53c1b6['plugins']['get'](a),_0x16352f=_0x53c1b6['plugins']['get'](_0x324d39);_0x4ef457['showFakeVisualSelection']();const _0x44d642=new l(),_0x549797=new ClipboardEvent('copy',{'clipboardData':_0x44d642}),_0x27ba92=new _0x2e0788(_0x44d642),_0x38fb5b=new _0x565093(_0x3b4d93,_0x549797,{'dataTransfer':_0x27ba92});_0x16352f['_forceMarkersCopy']('comment',()=>{_0x3b4d93['document']['fire']('copy',_0x38fb5b);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x53c1b6,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x245da0=_0x27ba92['getData']('text/html');const _0x14e1d0=_0x53c1b6['model']['document']['selection'],_0x17f268=Array['from'](_0x14e1d0['getRanges']());0x1===_0x17f268['length']&&_0x17f268[0x0]['isFlat']&&!_0x14e1d0['getSelectedElement']()&&''!==_0x245da0['replace'](/ /g,'')['trim']()&&(_0x245da0='<p>'+_0x245da0+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x442fad,'query':_0x70dc1f,'htmlContent':_0x245da0,'label':_0x269f61,'mainActionLabel':_[_0x53c1b6['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x2d8fe9,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x52abdf['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x4ef457['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x11648d=new Map(),_0x1cc9da=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x3d004b of _0x1cc9da)for(const _0x2f2650 of _0x3d004b['commands'])_0x11648d['set'](_0x2f2650['id'],{..._0x2f2650,'groupId':_0x3d004b['groupId'],'groupLabel':_0x3d004b['groupLabel']||_0x3d004b['groupId']});return _0x11648d;}['_createAIAssistantUIButton'](_0x546be5){const _0xbd3e9e=this['editor'],_0xb6443c=_0xbd3e9e['commands']['get']('showAIAssistant'),_0x1dd4f3=new _0x546be5(_0xbd3e9e['locale']);return _0x1dd4f3['set']({'label':i(_0xbd3e9e['locale'],'AI\x20Assistant'),'icon':_0x2d8fe9,'isToggleable':!0x0}),_0x1dd4f3['bind']('isEnabled')['to'](_0xb6443c),_0x1dd4f3['bind']('isOn')['to'](this['_dialog'],'id',_0x33efa6=>'aiAssistant'===_0x33efa6),this['listenTo'](_0x1dd4f3,'execute',()=>{_0x1dd4f3['isOn']?this['hideUI']():_0xb6443c['execute']();}),_0x1dd4f3;}['_initView'](){const _0x2a29f9=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',()=>{_0x2a29f9['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2a29f9['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x5bfec7,ui:{ariaLiveAnnouncer:_0x574245}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x57cb18,_0x1370f9,_0x391775)=>{const _0x3ac406=this['_aiAssistantController']['currentContext'];_0x391775?_0x574245['announce'](i(_0x5bfec7,'AI\x20is\x20writing')):_0x3ac406&&_0x574245['announce'](i(_0x5bfec7,'Generated\x20content:\x20%0',_0x3ac406),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5a59d7,_0x385244,_0x2a2bd1)=>{if(_0x2a2bd1){const _0x564abd=this['_formView']['errorView']['text'];_0x574245['announce'](i(_0x5bfec7,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x564abd));}});}['_onExecute'](_0x2c3847){const _0x5b4cef=this['_commandDefinitions']['get'](_0x2c3847),_0x119bc4=this['editor'],_0x2fd200=_0x119bc4['model']['document']['selection'],_0x53b646=_0x119bc4['commands']['get']('showAIAssistant'),_0x5a2bca=_0x119bc4['plugins']['get'](a),_0x384599=''+(_0x5b4cef['groupId']!==K?_0x5b4cef['groupLabel']+':\x20':'')+_0x5b4cef['label'];if(!0x1!==_0x5b4cef['requiresContent']&&_0x2fd200['isCollapsed']){const _0x1999fb=_0x34c6dc(_0x2fd200['getSelectedBlocks']())||_0x119bc4['model']['schema']['getLimitElement'](_0x2fd200);_0x119bc4['model']['change'](_0x5ea379=>{_0x5ea379['setSelection'](_0x1999fb,'in');});}_0x5a2bca['showFakeVisualSelection'](),_0x53b646['execute'](_0x5b4cef['prompt'],_0x384599,'command:'+_0x2c3847);}['_populateMenuBarMenu'](_0x684b59,_0x39954a,_0xae1328,_0x21177f){const _0x2125da=this['editor'],_0x2d9067=_0x2125da['locale'],_0x2e826b=new _0x5255c6(_0x2d9067),_0x3fd722=U(_0x2125da,_0xae1328)['filter'](_0x2fa57a=>_0x2fa57a['commands']['length']);0x1===_0x3fd722['length']?this['_getMenuBarGroupButtons']({'command':_0x684b59,'commands':_0x3fd722[0x0]['commands'],'parentMenuView':_0x39954a,'onExecute':_0x21177f})['forEach'](_0x427571=>_0x2e826b['items']['add'](_0x427571)):_0x3fd722['forEach'](({groupId:_0xd96408,groupLabel:_0x6c3412,commands:_0x4c62c8})=>{const _0x16f138=new _0x20f208(_0x2d9067,_0x39954a),_0x2fd5a0=new _0x2c51f0(_0x2d9067),_0xcd7c6b=new _0x5255c6(_0x2d9067),_0x1fde1c=this['_getMenuBarGroupButtons']({'command':_0x684b59,'commands':_0x4c62c8,'parentMenuView':_0x2fd5a0,'onExecute':_0x21177f});_0x2fd5a0['buttonView']['set']({'label':_0x6c3412||_0xd96408}),_0x2fd5a0['delegate']('execute')['to'](_0x39954a),_0xcd7c6b['items']['addMany'](_0x1fde1c),_0x2fd5a0['panelView']['children']['add'](_0xcd7c6b),_0x16f138['children']['add'](_0x2fd5a0),_0x2e826b['items']['add'](_0x16f138);}),_0x39954a['panelView']['children']['add'](_0x2e826b);}['_getMenuBarGroupButtons']({command:_0x52fc28,commands:_0x52650d,parentMenuView:_0x417b04,onExecute:_0x91eb79}){const _0x422833=this['editor'],_0x55087c=_0x422833['locale'];return U(_0x422833,_0x52650d)['map'](_0x320a17=>{const _0x450467=new _0x20f208(_0x55087c,_0x417b04),_0x23bc1a=new _0x4b8772(_0x55087c);return _0x23bc1a['set']({'label':_0x320a17['label']}),_0x23bc1a['delegate']('execute')['to'](_0x417b04),_0x23bc1a['on']('execute',()=>_0x91eb79(_0x320a17['id'])),_0x23bc1a['bind']('isEnabled')['to'](_0x52fc28,'enabledCommandsIds',_0x25ce52=>_0x25ce52['includes'](_0x320a17['id'])),_0x450467['children']['add'](_0x23bc1a),_0x450467;});}}function T(_0x5eff33,_0x3e979b){return void 0x0!==_0x5eff33['order']&&void 0x0===_0x3e979b['order']?0x1:void 0x0===_0x5eff33['order']&&void 0x0!==_0x3e979b['order']?-0x1:void 0x0!==_0x5eff33['order']&&void 0x0!==_0x3e979b['order']?_0x5eff33['order']-_0x3e979b['order']:0x0;}function U(_0x6cee38,_0x3c2b23){_0x3c2b23['sort'](T);const _0xc30e9a={},_0x241717=[];for(const _0x4be3d9 of _0x3c2b23)if(void 0x0!==_0x4be3d9['order']){if(_0x4be3d9['order']in _0xc30e9a)throw new _0x5038d9('ai-commands-config-order-collision',_0x6cee38,{'conflictingDefinitions':[_0x4be3d9,_0xc30e9a[_0x4be3d9['order']]]});_0xc30e9a[_0x4be3d9['order']]=_0x4be3d9,_0x241717['splice'](_0x4be3d9['order'],0x0,_0x4be3d9);}else _0x241717['push'](_0x4be3d9);return _0x241717;}class At extends _0x2d1d32{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x237821){super(_0x237821);const _0x274b38=_0x237821['config'],_0x2f6e04=_0x237821['locale'];_0x274b38['define']('ai.aiAssistant.preserveComments',!0x0),_0x274b38['define']('ai.aiAssistant.commands',_t(_0x2f6e04)),_0x274b38['define']('ai.aiAssistant.extraCommandGroups',[]),_0x274b38['define']('ai.aiAssistant.removeCommands',[]);let _0x50270d=o(_0x274b38['get']('ai.aiAssistant.commands'),_0x2f6e04);const _0x35288d=_0x274b38['get']('ai.aiAssistant.extraCommandGroups'),_0x47f419=_0x274b38['get']('ai.aiAssistant.removeCommands');_0x35288d['forEach'](_0x13a45b=>{const _0x4c3b7e=_0x50270d['find'](_0x5f2756=>_0x5f2756['groupId']===_0x13a45b['groupId']);_0x4c3b7e?_0x4c3b7e['commands']=_0x4c3b7e['commands']['concat'](_0x13a45b['commands']):_0x50270d['push'](_0x13a45b);}),_0x50270d=_0x50270d['filter'](_0xaa837e=>!_0x47f419['includes'](_0xaa837e['groupId'])),_0x50270d['forEach'](_0x2d4898=>{_0x2d4898['commands']=_0x2d4898['commands']['filter'](_0x14769c=>!_0x47f419['includes'](_0x14769c['id']));}),_0x274b38['set']('ai.aiAssistant.commands',_0x50270d);}}function _t(_0x18d4f7){return[{'groupId':'editOrReview','groupLabel':i(_0x18d4f7,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x18d4f7,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x18d4f7,'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(_0x18d4f7,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x18d4f7,'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(_0x18d4f7,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x18d4f7,'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(_0x18d4f7,'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(_0x18d4f7,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x18d4f7,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x18d4f7,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x18d4f7,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x18d4f7,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x18d4f7,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x18d4f7,'Change\x20style'),'commands':[{'id':'business','label':i(_0x18d4f7,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x18d4f7,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x18d4f7,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x18d4f7,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x18d4f7,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x18d4f7,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x18d4f7,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x18d4f7,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x18d4f7,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x18d4f7,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x18d4f7,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x18d4f7,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x18d4f7,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x2d1d32{['abortController'];static get['requires'](){return[x];}constructor(_0xcc9321){super(_0xcc9321),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x1c6185){return this['sendRequest'](_0x1c6185)['catch'](_0x4c3927=>{if(_0x4c3927 instanceof R)return Promise['reject'](_0x4c3927);if('AbortError'==_0x4c3927['name'])return Promise['resolve']();throw console['error'](_0x4c3927),new _0x5038d9('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x1c248d,_0x239056){const _0x39d172=this['editor']['locale'],_0x510dad={'Content-Type':'application/json'};if('object'==typeof _0x1c248d)Object['assign'](_0x510dad,_0x1c248d);else{if(_0x1c248d)try{const _0xa1db3d=await _0x1c248d(_0x239056);Object['assign'](_0x510dad,_0xa1db3d);}catch{return Promise['reject'](new R(i(_0x39d172,'AI_ERROR_GET_HEADERS')));}}return _0x510dad;}async['_prepareRequestParameters'](_0x45e471,_0x24be91){const _0x44ad12=this['editor']['locale'];if('object'==typeof _0x45e471)return _0x45e471;try{return await _0x45e471(_0x24be91);}catch{return Promise['reject'](new R(i(_0x44ad12,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x45bab7){super(_0x45bab7),_0x45bab7['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x45bab7['config']['get']('ai.openAI.requestParameters')||_0x45bab7['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x45bab7['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x45bab7['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x45bab7['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x2bdf14,context:_0x2d9d8d,onData:_0x2fca13,actionId:_0xf4e260}){const _0x468b9d=this['editor']['locale'],_0x478a9a=await this['prepareMessages'](_0x2bdf14,_0x2d9d8d,_0xf4e260),_0x4da1c7=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xf4e260),_0x486837=await this['_prepareRequestParameters'](this['_requestParameters'],_0xf4e260),_0x286e53={'messages':_0x478a9a,..._0x486837},_0x54c989={'method':'POST','headers':_0x4da1c7,'body':JSON['stringify'](_0x286e53),'signal':this['abortController']['signal']},_0x10a1db=await fetch(this['_apiUrl'],_0x54c989);if(_0x10a1db['ok'])return _0x486837['stream']?await this['_readStreamableResponse'](_0x10a1db,_0x2fca13):await this['_readStaticResponse'](_0x10a1db,_0x2fca13),Promise['resolve']();{const _0x69fe2b=await _0x10a1db['text']();return _0x69fe2b['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x468b9d,'AI_ERROR_CONTEXT_LENGTH'))):_0x69fe2b['includes']('Moderation')?Promise['reject'](new R(i(_0x468b9d,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x69fe2b));}}async['prepareMessages'](_0xf7c261,_0x3514b2,_0x1ec362){let _0x5c8e08,_0x26e6c1;return _0x3514b2?(_0x5c8e08='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.',_0x26e6c1='Instruction:\x0a'+_0xf7c261+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3514b2):(_0x5c8e08='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.',_0x26e6c1=_0xf7c261),[{'role':'system','content':_0x5c8e08},{'role':'user','content':_0x26e6c1}];}async['_readStreamableResponse'](_0x1faf2e,_0x54e60b){const _0x82a8c2=_0x1faf2e['body']['getReader'](),_0x68e0f3=new TextDecoder();let _0x57c63e='',_0x5e65a='',_0xffaa6a='',_0x4f53fd=!0x1;for(;!_0x4f53fd;){const {done:_0x40f10e,value:_0x30b109}=await _0x82a8c2['read'](),_0x538183=_0x57c63e+_0x68e0f3['decode'](_0x30b109);let _0x3c3a55='';_0x4f53fd=_0x40f10e;try{_0x3c3a55=this['_cleanUpData'](_0x538183),_0x57c63e='';}catch{_0x57c63e=_0x538183;continue;}_0x5e65a+=_0x3c3a55,!_0x4f53fd&&this['_isBufferIncomplete'](_0x5e65a)||_0x5e65a&&(_0xffaa6a+=_0x5e65a,_0x5e65a='',_0x54e60b(_0xffaa6a));}return Promise['resolve']();}async['_readStaticResponse'](_0x280c0e,_0x5c744e){return _0x5c744e((await _0x280c0e['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x248566){const _0x335c8f=_0x248566['split']('<')['length']!==_0x248566['split']('>')['length'],_0xa89b07=_0x248566['length']<0x1e;return _0x335c8f&&_0xa89b07;}['_cleanUpData'](_0xcd962c){return _0xcd962c['split'](/\n(?![^{]*\})/g)['map'](_0x27d1e8=>_0x27d1e8['replace']('data:\x20',''))['filter'](_0x1fdf23=>_0x1fdf23&&_0x1fdf23['length']>0x0&&'[DONE]'!==_0x1fdf23)['map'](_0xb0580e=>{const {choices:_0x27b8e0}=JSON['parse'](_0xb0580e);if(_0x27b8e0[0x0]?.['delta']?.['content'])return _0x27b8e0[0x0]['delta']['content'];})['filter'](_0x39dc82=>_0x39dc82)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x1fd5df){super(_0x1fd5df),_0x1fd5df['config']['get']('ai.aws.requestParameters')||_0x1fd5df['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']=_0x1fd5df['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x1fd5df['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x1fd5df['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x1fd5df['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x2bbe49,context:_0x5e79f5,onData:_0x26b728,actionId:_0x55cf55}){const {model:_0x435ff8,stream:_0x1f8bc4,..._0x16e803}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x55cf55),_0x603392={'prompt':await this['preparePrompt'](_0x2bbe49,_0x5e79f5,_0x435ff8,_0x55cf55),..._0x16e803};this['_apiUrl']?await this['_processProxyRequest'](_0x603392,_0x435ff8,_0x1f8bc4,_0x26b728,_0x55cf55):await this['_processAWSRequest'](_0x603392,_0x435ff8,_0x1f8bc4,_0x26b728);}async['preparePrompt'](_0x385fd8,_0x462924,_0x501c65,_0x291fde){let _0x3eded1,_0x46c7a2;return _0x462924?(_0x3eded1='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.',_0x46c7a2='Instruction:\x0a'+_0x385fd8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x462924):(_0x3eded1='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.',_0x46c7a2=_0x385fd8),'meta.llama'==this['getModelFamily'](_0x501c65)?'<<SYS>>\x0a'+_0x3eded1+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x46c7a2+'\x0a[/INST]':'Human:\x0a'+_0x3eded1+'\x0a'+_0x46c7a2+'\x0a\x0aAssistant:';}['getModelFamily'](_0x3474f1){if(/^anthropic\.claude/['test'](_0x3474f1))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x3474f1))return'ai21.j2';if(/^cohere\.command/['test'](_0x3474f1))return'cohere.command';if(/^meta\.llama/['test'](_0x3474f1))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x3474f1));}async['_processProxyRequest'](_0x50d8e0,_0x39c056,_0x559b99,_0x2ddf76,_0x5ee426){const _0x4a2e7c={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5ee426),'body':JSON['stringify']({..._0x50d8e0,'model':_0x39c056,'stream':_0x559b99}),'signal':this['abortController']['signal']},_0x837dc7=await fetch(this['_apiUrl'],_0x4a2e7c);_0x559b99?await this['_readStreamableResponse'](_0x837dc7,_0x39c056,_0x2ddf76):await this['_readStaticResponse'](_0x837dc7,_0x39c056,_0x2ddf76);}async['_processAWSRequest'](_0x2b28dc,_0x15f7a6,_0x57a9d1,_0x24fdb9){const _0x501dc7=new _0x5f2ebf(this['_bedrockClientConfig']),_0x58de46={'body':JSON['stringify'](_0x2b28dc),'contentType':'application/json','accept':'application/json','modelId':_0x15f7a6};let _0x305dbf;if(_0x57a9d1){const _0x57961a=new _0x46d9e4(_0x58de46);_0x305dbf=await _0x501dc7['send'](_0x57961a,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x305dbf,_0x15f7a6,_0x24fdb9);}else{const _0x485420=new _0xcfc9f2(_0x58de46);_0x305dbf=await _0x501dc7['send'](_0x485420,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x305dbf,_0x15f7a6,_0x24fdb9);}}async['_readAsyncIterableResponse'](_0x4bc629,_0x3e678c,_0xf358a4){const _0x2c7a74=_0x4bc629['body'],_0x28f2e4=new TextDecoder('utf-8');let _0x499352='';for await(const _0xfad7fa of _0x2c7a74)if(_0xfad7fa['chunk']){const _0x7efff9=_0x28f2e4['decode'](_0xfad7fa['chunk']['bytes']),_0x167d20=JSON['parse'](_0x7efff9);_0x499352+=this['_getGeneratedText'](_0x167d20,_0x3e678c),_0xf358a4(_0x499352);}return Promise['resolve']();}async['_readStreamableResponse'](_0x2cafc2,_0xb9d0e7,_0x284fd3){const _0x4768d2=_0x2cafc2['body'],_0x7338c2=new TextDecoder('utf-8'),_0x4b987b=_0x4768d2['getReader']();let _0x24dd7c='',_0x4092d4='',_0xf44aa2=!0x1;for(;!_0xf44aa2;){const {done:_0x222c22,value:_0x493419}=await _0x4b987b['read']();if(_0xf44aa2=_0x222c22,_0xf44aa2)break;const _0x31200c=(_0x24dd7c+_0x7338c2['decode'](_0x493419))['split']('\x0a')['map'](_0x39c474=>{try{return _0x24dd7c='',JSON['parse'](_0x39c474);}catch{return _0x24dd7c=_0x39c474,null;}})['filter'](_0x3dfcdc=>null!==_0x3dfcdc);_0x31200c['length']&&(_0x4092d4+=_0x31200c['map'](_0x43bb60=>this['_getGeneratedText'](_0x43bb60,_0xb9d0e7))['join'](''),_0x284fd3(_0x4092d4));}return Promise['resolve']();}async['_readStaticResponse'](_0x70a69d,_0x48aace,_0x42506d){let _0x45a464;return _0x45a464=_0x70a69d instanceof Response?await _0x70a69d['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x70a69d['body'])),(_0x42506d(this['_getGeneratedText'](_0x45a464,_0x48aace)),Promise['resolve']());}['_getGeneratedText'](_0x34e22d,_0x1972b0){switch(this['getModelFamily'](_0x1972b0)){case'anthropic.claude':return _0x34e22d['completion'];case'ai21.j2':return _0x34e22d['completions'][0x0]['data']['text'];case'cohere.command':return _0x34e22d['generations'][0x0]['text'];case'meta.llama':return _0x34e22d['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x443adc,Command as _0x1685d3}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2737fc,IconCheck as _0x26aec3,IconError as _0x3cc690,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x5e1e0e,IconRobotPencil as _0x196726}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x184693,CKEditorError as _0x1adb01,ObservableMixin as _0x5f4525,global as _0x56076d,isVisible as _0x11c64c,Rect as _0x558749,Collection as _0x32d571,FocusTracker as et,KeystrokeHandler as rt,first as _0x2dfd84}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x4967ca,View as _0x8e7cbe,SpinnerView as _0x5f0dd3,IconView as _0x5d9c88,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x3a4118,createDropdown as _0x5b544d,addMenuToDropdown as _0xfc202c,MenuBarMenuView as _0x5b79ba,MenuBarMenuListItemButtonView as _0x1af9c7,DialogViewPosition as _0x5772d5,MenuBarMenuListView as _0x5614ca,MenuBarMenuListItemView as _0x3c4287}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4e14ed,ClipboardMarkersUtils as _0x19a578}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1c58fc,ViewDataTransfer as _0x35f253,ViewUpcastWriter as _0x3099c0,Matcher as _0x583335}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x412014,InvokeModelWithResponseStreamCommand as _0x37a045,InvokeModelCommand as _0x4d7356}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x24dd4f,_0x5480b0){const _0x23ad82=(0x0,_0x5480b0['t'])('Other');return _0x24dd4f['length']?'groupId'in _0x24dd4f[0x0]?_0x24dd4f:[{'groupId':K,'groupLabel':_0x23ad82,'order':0x1/0x0,'commands':_0x24dd4f}]:[{'groupId':K,'groupLabel':_0x23ad82,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x443adc{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x3d5064}=this,_0x370969=['ck-fake-ai-selection'];_0x3d5064['config']['get']('ai.useTheme')&&_0x370969['push']('ck-ai-assistant-ui_theme'),_0x3d5064['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x370969,'priority':0xc}}),_0x3d5064['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x747251,{writer:_0x572394})=>{if(!_0x747251['markerRange']['isCollapsed'])return null;const _0x3dfb96=_0x572394['createUIElement']('span');return _0x572394['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3dfb96),_0x3dfb96;}});}['afterInit'](){!async function(_0x1b7ee6){const _0x19deca=_0x1c0490([0x6e,0x41,0x37,0x79,0x75,0x72,0x67,0x4f,0x48,0x62,0x5a,0x76,0x44,0x70,0x6c,0x52,0x6b,0x4a,0x73,0x63,0x64,0x49,0x43,0x6d,0x38,0x36,0x6f,0x50,0x57,0x78,0x39,0x32,0x66,0x31,0x71,0x46,0x30,0x4c,0x61,0x53,0x58,0x33,0x4e,0x47,0x77,0x54,0x4d,0x4b,0x34,0x6a,0x56,0x74,0x59,0x55,0x42,0x51,0x69,0x35,0x7a,0x68,0x65,0x45]),_0x219175=0x3dffc4e1,_0x5469af=0x3df8b601^_0x219175,_0xe43d15=window[_0x1c0490([0x44,0x61,0x74,0x65])][_0x1c0490([0x6e,0x6f,0x77])](),_0x369fba=_0x1b7ee6[_0x1c0490([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x74a3fc=new window[(_0x1c0490([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3dd5cd=>{_0x369fba[_0x1c0490([0x6f,0x6e,0x63,0x65])](_0x1c0490([0x72,0x65,0x61,0x64,0x79]),_0x3dd5cd);}),_0xae713b={[_0x1c0490([0x6b,0x74,0x79])]:_0x1c0490([0x45,0x43]),[_0x1c0490([0x75,0x73,0x65])]:_0x1c0490([0x73,0x69,0x67]),[_0x1c0490([0x63,0x72,0x76])]:_0x1c0490([0x50,0x2d,0x32,0x35,0x36]),[_0x1c0490([0x78])]:_0x1c0490([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]),[_0x1c0490([0x79])]:_0x1c0490([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]),[_0x1c0490([0x61,0x6c,0x67])]:_0x1c0490([0x45,0x53,0x32,0x35,0x36])},_0x8dbba=_0x369fba[_0x1c0490([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1c0490([0x67,0x65,0x74])](_0x1c0490([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x430051(){let _0x3bf174,_0x23f828=null,_0x358b2b=null;try{if(_0x8dbba==_0x1c0490([0x47,0x50,0x4c]))return _0x1c0490([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3bf174=_0x42102b(),!_0x3bf174)return _0x1c0490([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3bf174[_0x1c0490([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x358b2b=_0x5ca8ae(_0x3bf174[_0x1c0490([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3bf174[_0x1c0490([0x6a,0x74,0x69])])),await _0x1aef01()?_0x531db2()?_0x50a906()?_0x1c0490([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xa2be79()?(_0x3bf174[_0x1c0490([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1c0490([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x23f828=_0x567667(_0x1c0490([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x3bf174[_0x1c0490([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1c0490([0x74,0x72,0x69,0x61,0x6c])&&(_0x23f828=_0x567667(_0x1c0490([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5df6b5()):_0x1c0490([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1c0490([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1c0490([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1c0490([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x50a906(){const _0xc7b204=[_0x1c0490([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1c0490([0x74,0x72,0x69,0x61,0x6c])][_0x1c0490([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3bf174[_0x1c0490([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xe43d15/0x3e8:0xe10*_0x5469af;return _0x3bf174[_0x1c0490([0x65,0x78,0x70])]<_0xc7b204;}function _0x531db2(){const _0x3edf3d=_0x3bf174[_0x1c0490([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3edf3d&&(!!_0x3edf3d[_0x1c0490([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1c0490([0x2a]))||!!_0x3edf3d[_0x1c0490([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1c0490([0x41,0x49])));}function _0xa2be79(){const _0x53b54b=_0x3bf174[_0x1c0490([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x53b54b||0x0==_0x53b54b[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x55216b}=new URL(window[_0x1c0490([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x53b54b[_0x1c0490([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x55216b))return!0x0;const _0x3c5285=_0x55216b[_0x1c0490([0x73,0x70,0x6c,0x69,0x74])](_0x1c0490([0x2e]));return _0x53b54b[_0x1c0490([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xa13c64=>_0xa13c64[_0x1c0490([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1c0490([0x2a])))[_0x1c0490([0x6d,0x61,0x70])](_0x19e0ee=>_0x19e0ee[_0x1c0490([0x73,0x70,0x6c,0x69,0x74])](_0x1c0490([0x2e])))[_0x1c0490([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3a0db9=>_0x3a0db9[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x3c5285[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1c0490([0x6d,0x61,0x70])](_0x2284b8=>Array(_0x3c5285[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2284b8[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1c0490([0x66,0x69,0x6c,0x6c])](_0x2284b8[0x0]===_0x1c0490([0x2a])?_0x1c0490([0x2a]):'')[_0x1c0490([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2284b8))[_0x1c0490([0x73,0x6f,0x6d,0x65])](_0x1113ad=>_0x3c5285[_0x1c0490([0x65,0x76,0x65,0x72,0x79])]((_0x5cb321,_0x4cf704)=>_0x1113ad[_0x4cf704]===_0x5cb321||_0x1113ad[_0x4cf704]===_0x1c0490([0x2a])));}function _0x5df6b5(){return _0x23f828&&_0x358b2b?new window[(_0x1c0490([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x42d9ff,_0x5942ff)=>{_0x23f828[_0x1c0490([0x74,0x68,0x65,0x6e])](_0x42d9ff,_0x5942ff),_0x358b2b[_0x1c0490([0x74,0x68,0x65,0x6e])](_0x4b8b10=>{_0x4b8b10!=_0x1c0490([0x56,0x61,0x6c,0x69,0x64])&&_0x42d9ff(_0x4b8b10);},_0x5942ff);}):_0x23f828||_0x358b2b||_0x1c0490([0x56,0x61,0x6c,0x69,0x64]);}}function _0x5ca8ae(_0x1210be,_0x1c9afa){return new window[(_0x1c0490([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x491f3f=>{if(_0x10e639())return _0x491f3f(_0x1c0490([0x56,0x61,0x6c,0x69,0x64]));_0x414f5e(),_0x369fba[_0x1c0490([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1c0490([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x1efa32=!0x1;const _0x522712=_0x184693();function _0x4ca9e1(_0xd1846f){return!!_0xd1846f&&(typeof _0xd1846f===_0x1c0490([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0xd1846f===_0x1c0490([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0xd1846f[_0x1c0490([0x74,0x68,0x65,0x6e])]===_0x1c0490([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0xd1846f[_0x1c0490([0x63,0x61,0x74,0x63,0x68])]===_0x1c0490([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x5cb2d8(_0x127eb9){_0x4f3cbd(_0x127eb9)[_0x1c0490([0x74,0x68,0x65,0x6e])](_0x195fb6=>{if(!_0x195fb6||_0x195fb6[_0x1c0490([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1c0490([0x6f,0x6b]))return _0x1c0490([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x52e6a3(_0x57f384(_0x522712+_0x1c9afa))!=_0x195fb6[_0x1c0490([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1c0490([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1c0490([0x56,0x61,0x6c,0x69,0x64]);})[_0x1c0490([0x74,0x68,0x65,0x6e])](_0x4bb8e9=>(_0x299b3f(),_0x4bb8e9),()=>{const _0x11ab77=_0x21a69b();return null==_0x11ab77?(_0x299b3f(),_0x1c0490([0x56,0x61,0x6c,0x69,0x64])):_0x1c0490(_0xe43d15-_0x11ab77>(0x19f340e1^_0x219175)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1c0490([0x74,0x68,0x65,0x6e])](_0x491f3f)[_0x1c0490([0x63,0x61,0x74,0x63,0x68])](()=>{_0x491f3f(_0x1c0490([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3ddec1=0x3dc92a61^_0x219175;function _0x299b3f(){const _0x19ac8c=_0x1c0490([0x6c,0x6c,0x63,0x74,0x2d])+_0x52e6a3(_0x57f384(_0x1210be)),_0x1fd009=_0x30542f(_0x52e6a3(window[_0x1c0490([0x4d,0x61,0x74,0x68])][_0x1c0490([0x63,0x65,0x69,0x6c])](_0xe43d15/_0x3ddec1)));window[_0x1c0490([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1c0490([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x19ac8c,_0x1fd009);}function _0x21a69b(){const _0x21528f=_0x1c0490([0x6c,0x6c,0x63,0x74,0x2d])+_0x52e6a3(_0x57f384(_0x1210be)),_0x308c70=window[_0x1c0490([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1c0490([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x21528f);return _0x308c70?window[_0x1c0490([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x30542f(_0x308c70),0x10)*_0x3ddec1:null;}function _0x4f3cbd(_0x397467){return new window[(_0x1c0490([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5c5af9,_0x24d0b0)=>{_0x397467[_0x1c0490([0x74,0x68,0x65,0x6e])](_0x5c5af9,_0x24d0b0),window[_0x1c0490([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x24d0b0,0x3dfe1021^_0x219175);});}}_0x369fba[_0x1c0490([0x6f,0x6e])](_0x1c0490([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5487e1,_0x53e0cb)=>{if(_0x53e0cb[0x0]!=_0x1210be)return _0x491f3f(_0x1c0490([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x53e0cb[0x1]={..._0x53e0cb[0x1],[_0x1c0490([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x522712};},{[_0x1c0490([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1c0490([0x68,0x69,0x67,0x68])}),_0x369fba[_0x1c0490([0x6f,0x6e])](_0x1c0490([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1200f5=>{_0x4ca9e1(_0x1200f5[_0x1c0490([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x1efa32=!0x0,_0x5cb2d8(_0x1200f5[_0x1c0490([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1c0490([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1c0490([0x6c,0x6f,0x77])}),_0x74a3fc[_0x1c0490([0x74,0x68,0x65,0x6e])](()=>{_0x1efa32||_0x491f3f(_0x1c0490([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x10e639(){return _0x369fba[_0x1c0490([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1c0490([0x76,0x69,0x65,0x77])][_0x1c0490([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1c0490([0x61,0x75,0x74,0x6f]);}function _0x414f5e(){_0x369fba[_0x1c0490([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1c0490([0x76,0x69,0x65,0x77])][_0x1c0490([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1c0490([0x61,0x75,0x74,0x6f]);}}function _0x567667(_0x306a1e){const _0x49b31b=[new window[(_0x1c0490([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x258203=>setTimeout(_0x258203,0x3df6fa2d^_0x219175)),_0x74a3fc[_0x1c0490([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1c0490([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xc01316=>{let _0x3e8b2b=0x0;_0x369fba[_0x1c0490([0x6d,0x6f,0x64,0x65,0x6c])][_0x1c0490([0x6f,0x6e])](_0x1c0490([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3e498e,_0x2e780a)=>{_0x2e780a[0x0][_0x1c0490([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3e8b2b++,_0x3e8b2b==(0x3dffc519^_0x219175)&&(_0xc01316(),_0x3e498e[_0x1c0490([0x6f,0x66,0x66])]());});}))];return window[_0x1c0490([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1c0490([0x72,0x61,0x63,0x65])](_0x49b31b)[_0x1c0490([0x74,0x68,0x65,0x6e])](()=>_0x306a1e);}async function _0x396666(){await _0x74a3fc,_0x369fba[_0x1c0490([0x6d,0x6f,0x64,0x65,0x6c])][_0x1c0490([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x29b4d1,_0x369fba[_0x1c0490([0x6d,0x6f,0x64,0x65,0x6c])][_0x1c0490([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x29b4d1,_0x369fba[_0x1c0490([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1c0490([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x49b81f(_0x20eebd){const _0x16e7a1=_0x25fe52();_0x369fba[_0x16e7a1]=_0x1c0490([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x20eebd,_0x20eebd!=_0x1c0490([0x56,0x61,0x6c,0x69,0x64])&&_0x396666();}function _0x25fe52(){const _0x344119=window[_0x1c0490([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1c0490([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1c0490([0x6e,0x6f,0x77])]())[_0x1c0490([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1c0490([0x2e]),'');let _0x176755=_0x1c0490([0x6e]);for(let _0x1c8439=0x0;_0x1c8439<_0x344119[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1c8439+=0x2){let _0x48f04f=window[_0x1c0490([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x344119[_0x1c0490([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1c8439,_0x1c8439+0x2));_0x48f04f>=_0x19deca[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x48f04f-=_0x19deca[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x176755+=_0x19deca[_0x48f04f];}return _0x176755;}function _0x42102b(){const _0x89c537=_0x8dbba[_0x1c0490([0x73,0x70,0x6c,0x69,0x74])](_0x1c0490([0x2e]));if(0x3!=_0x89c537[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x2c14b4(_0x89c537[0x1]);function _0x2c14b4(_0x38915d){const _0x3aa6b5=_0x26bf34(_0x38915d);return _0x3aa6b5&&_0x58be79()?_0x3aa6b5:null;function _0x58be79(){const _0x22dc79=_0x3aa6b5[_0x1c0490([0x6a,0x74,0x69])],_0x3177d8=window[_0x1c0490([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x22dc79[_0x1c0490([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x22dc79[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3a81b6={..._0x3aa6b5,[_0x1c0490([0x6a,0x74,0x69])]:_0x22dc79[_0x1c0490([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x22dc79[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3a81b6[_0x1c0490([0x76,0x63])],_0x57f384(_0x3a81b6)==_0x3177d8;}}}async function _0x1aef01(){let _0x3e5c4a=!0x0;try{const _0x867305=_0x8dbba[_0x1c0490([0x73,0x70,0x6c,0x69,0x74])](_0x1c0490([0x2e])),[_0x27654e,_0x2e86a4,_0x39b6fb]=_0x867305;return _0x43635b(_0x27654e),await _0x35e530(_0x27654e,_0x2e86a4,_0x39b6fb),_0x3e5c4a;}catch{return!0x1;}function _0x43635b(_0x2fee01){const _0x5e89ce=_0x26bf34(_0x2fee01);_0x5e89ce&&_0x5e89ce[_0x1c0490([0x61,0x6c,0x67])]==_0x1c0490([0x45,0x53,0x32,0x35,0x36])||(_0x3e5c4a=!0x1);}async function _0x35e530(_0x3a60c9,_0x38b071,_0x254c0a){const _0x13f659=window[_0x1c0490([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1c0490([0x66,0x72,0x6f,0x6d])](_0x1a0640(_0x254c0a),_0xd29faa=>_0xd29faa[_0x1c0490([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x42be86=new window[(_0x1c0490([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1c0490([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3a60c9+_0x1c0490([0x2e])+_0x38b071),_0x257a29=window[_0x1c0490([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1c0490([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x257a29)return;const _0x1c6a0a=await _0x257a29[_0x1c0490([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1c0490([0x6a,0x77,0x6b]),_0xae713b,{[_0x1c0490([0x6e,0x61,0x6d,0x65])]:_0x1c0490([0x45,0x43,0x44,0x53,0x41]),[_0x1c0490([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1c0490([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1c0490([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x257a29[_0x1c0490([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1c0490([0x6e,0x61,0x6d,0x65])]:_0x1c0490([0x45,0x43,0x44,0x53,0x41]),[_0x1c0490([0x68,0x61,0x73,0x68])]:{[_0x1c0490([0x6e,0x61,0x6d,0x65])]:_0x1c0490([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1c6a0a,_0x13f659,_0x42be86)||(_0x3e5c4a=!0x1);}}function _0x26bf34(_0x561bd8){return _0x561bd8[_0x1c0490([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1c0490([0x65,0x79]))?JSON[_0x1c0490([0x70,0x61,0x72,0x73,0x65])](_0x1a0640(_0x561bd8)):null;}function _0x1a0640(_0x258dc9){return window[_0x1c0490([0x61,0x74,0x6f,0x62])](_0x258dc9[_0x1c0490([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1c0490([0x2b]))[_0x1c0490([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1c0490([0x2f])));}function _0x57f384(_0x3e32fc){let _0x8140e1=0x1505;function _0xfd469d(_0x3536e3){for(let _0x8acaa4=0x0;_0x8acaa4<_0x3536e3[_0x1c0490([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x8acaa4++){const _0x12d45d=_0x3536e3[_0x1c0490([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x8acaa4);_0x8140e1=(_0x8140e1<<0x5)+_0x8140e1+_0x12d45d,_0x8140e1&=_0x8140e1;}}function _0x3f67e1(_0x8936f){Array[_0x1c0490([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x8936f)?_0x8936f[_0x1c0490([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3f67e1):_0x8936f&&typeof _0x8936f==_0x1c0490([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1c0490([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x8936f)[_0x1c0490([0x73,0x6f,0x72,0x74])]()[_0x1c0490([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2aece3,_0x1bc7cf])=>{_0xfd469d(_0x2aece3),_0x3f67e1(_0x1bc7cf);}):_0xfd469d(window[_0x1c0490([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x8936f));}return _0x3f67e1(_0x3e32fc),_0x8140e1>>>0x0;}function _0x52e6a3(_0x4c7cdf){return _0x4c7cdf[_0x1c0490([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1c0490([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1c0490([0x30]));}function _0x30542f(_0xb19417){return _0xb19417[_0x1c0490([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1c0490([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1c0490([0x6a,0x6f,0x69,0x6e])]('');}function _0x29b4d1(){}function _0x1c0490(_0x185ac0){return _0x185ac0['map'](_0x408315=>String['fromCharCode'](_0x408315))['join']('');}_0x49b81f(await _0x430051());}(this);}['showFakeVisualSelection'](){const _0x480e58=this['editor']['model'];_0x480e58['change'](_0xb4fbb8=>{const _0x2ceda5=_0x480e58['document']['selection']['getRanges']();let _0x34df51=0x0;for(const _0x349b28 of _0x2ceda5){const _0x49772a=w+':'+_0x34df51;if(_0x480e58['markers']['has'](_0x49772a))_0xb4fbb8['updateMarker'](_0x49772a,{'range':_0x349b28});else{if(_0x349b28['start']['isAtEnd']){const _0x128dcc=_0x349b28['start']['getLastMatchingPosition'](({item:_0x3ba42b})=>!_0x480e58['schema']['isContent'](_0x3ba42b),{'boundaries':_0x349b28});_0xb4fbb8['addMarker'](_0x49772a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0xb4fbb8['createRange'](_0x128dcc,_0x349b28['end'])});}else _0xb4fbb8['addMarker'](_0x49772a,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x349b28});}_0x34df51++;}});}['hideFakeVisualSelection'](){const _0x51eb4b=this['editor']['model'],_0x432d8e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x432d8e['length']&&_0x51eb4b['change'](_0x2972da=>{_0x432d8e['forEach'](_0x10393f=>{_0x2972da['removeMarker'](_0x10393f);});});}['insertContent'](_0x5a04d9,_0x4960d9){const _0x5c7e32=this['_getAISelection'](),_0x346a44=_0x4960d9||_0x5c7e32['getFirstRange']();this['editor']['model']['canEditAt'](_0x346a44)&&this['editor']['model']['change'](_0x5a93f7=>{this['hideFakeVisualSelection'](),_0x4960d9||this['_resetContentOfSelectedTableCells'](_0x5a93f7,_0x5c7e32),this['_pasteHTMLUsingClipboard']({'insertAt':_0x346a44,'writer':_0x5a93f7,'html':_0x5a04d9});});}['insertContentBelow'](_0x2b75cf){const {model:_0x5e9ed0}=this['editor'],_0x5bd32d=this['_getAISelection']();_0x5e9ed0['change'](()=>{const _0x35e795=this['_prepareTableInsertBelowPosition'](_0x2b75cf,_0x5bd32d)||this['_getDefaultInsertBelowPosition'](_0x5bd32d);this['insertContent'](_0x2b75cf,_0x35e795);});}['_getAISelection'](){const _0x503f68=this['editor']['model'],_0x268915=Array['from'](_0x503f68['markers']['getMarkersGroup'](w))['map'](_0x55d09a=>_0x55d09a['getRange']());return _0x503f68['createSelection'](_0x268915);}['_pasteHTMLUsingClipboard']({writer:_0x1c2b18,html:_0x58bceb,insertAt:_0x27e2cd}){const {view:_0x41a81d}=this['editor']['editing'],_0x393fa=this['editor']['plugins']['get'](_0x4e14ed),_0x350934=new gt();_0x350934['setData']('text/html',_0x58bceb);const _0x28a82b=new ClipboardEvent('paste',{'clipboardData':_0x350934}),_0x2420e0=new _0x1c58fc(_0x41a81d,_0x28a82b,{'dataTransfer':new _0x35f253(_0x350934)});_0x1c2b18['setSelection'](_0x27e2cd);const _0x2380b3=(_0x208e66,_0x4099fd)=>{_0x4099fd['resultRange']&&_0x1c2b18['setSelection'](_0x4099fd['resultRange']);};_0x393fa['once']('contentInsertion',_0x2380b3,{'priority':'lowest'}),_0x41a81d['document']['fire']('paste',_0x2420e0),_0x393fa['off']('contentInsertion',_0x2380b3);}['_getDefaultInsertBelowPosition'](_0x40af2d){const {model:_0x43557c}=this['editor'],_0x35b947=Array['from'](_0x40af2d['getSelectedBlocks']());return _0x35b947['length']?_0x43557c['createPositionAfter'](_0x35b947['pop']()):_0x40af2d['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x7aaece,_0x5d829a){const {model:_0x5ebd48,plugins:_0x2bd516}=this['editor'];if(_0x2bd516['has']('TableUtils')){const _0x4f36f2=_0x2bd516['get']('TableUtils')['getSelectedTableCells'](_0x5d829a);if(_0x4f36f2['length']){const _0x1a6e71=this['_getTableRowCountFromContent'](_0x7aaece),_0x384f36=this['_createEmptyTableRows'](_0x4f36f2,_0x1a6e71);return _0x5ebd48['createPositionAt'](_0x384f36,0x0);}}return null;}['_getTableRowCountFromContent'](_0x2bee5a){const _0x672158=this['editor']['plugins']['get']('TableUtils'),_0x4cbeb8=this['editor']['data']['parse'](_0x2bee5a),_0x234c1c=Array['from'](_0x4cbeb8['getChildren']())['filter'](_0x4efbcb=>_0x4efbcb['is']('element','table'));let _0x261ee0=0x0;return _0x234c1c['forEach'](_0x23be3f=>{_0x261ee0+=_0x672158['getRows'](_0x23be3f);}),_0x261ee0;}['_createEmptyTableRows'](_0x2cdd8d,_0x16a06e){const _0xb6ae67=this['editor']['plugins']['get']('TableUtils'),_0x2247c2=_0xb6ae67['getRowIndexes'](_0x2cdd8d),_0x28a826=_0xb6ae67['getColumnIndexes'](_0x2cdd8d),_0xd509da=_0x2247c2['last']+0x1,_0x535ec=_0x28a826['first'],_0x129521=_0x2cdd8d[0x0]['findAncestor']('table');for(let _0xbb9b79=0x0;_0xbb9b79<_0x16a06e;_0xbb9b79++)_0xb6ae67['insertRows'](_0x129521,{'at':_0xd509da});return _0x129521['getChild'](_0xd509da)['getChild'](_0x535ec);}['_resetContentOfSelectedTableCells'](_0x20a57c,_0x1282cb){const {plugins:_0x3bedc6}=this['editor'],{model:_0x525fe9}=_0x20a57c;if(!_0x3bedc6['has']('TableUtils'))return;_0x3bedc6['get']('TableUtils')['getSelectedTableCells'](_0x1282cb)['length']&&_0x525fe9['deleteContent'](_0x1282cb);}}class x extends _0x443adc{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x1adb01('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1947cb){super(_0x1947cb),this['name']='AIRequestError';}}function i(_0x221b51,_0x46a3da,_0x52ad09){const t=_0x221b51['t'];switch(_0x46a3da){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',_0x52ad09);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x52ad09);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'},_0x52ad09);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 _0x46a3da;}}class E extends _0x1685d3{['_commandDefinitions'];constructor(_0x57075e,_0x5b491d){super(_0x57075e),this['_commandDefinitions']=_0x5b491d,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x1df140,_0x4e35fe,_0x3aa072)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x3aa072));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x32af74,_0x4c58f3,_0x234b55)=>{this['enabledCommandsIds']=_0x234b55?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x32f44c=this['editor']['model'];this['_hasContext']=function(_0x4ad463){const _0x40b218=_0x4ad463['document']['selection'];return _0x40b218['isCollapsed']?0x0!==[..._0x40b218['getSelectedBlocks']()]['length']&&![..._0x40b218['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4ad463['hasContent'](_0x40b218['getFirstRange']());}(_0x32f44c);const _0x158e4b=_0x32f44c['document']['selection'],_0x54b61c=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x23f466 of _0x158e4b['getRanges']())for(const _0x5b9131 of _0x23f466['getItems']())if(_0x5b9131['is']('element')&&_0x54b61c['includes'](_0x5b9131['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x452a53='',_0xc48f87='',_0x435e78='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x452a53,_0xc48f87,_0x435e78);}}function F(_0x87778e,_0x4bc6bc){const _0x8adb82=new Set();for(const _0x486eab of _0x87778e['values']())(_0x4bc6bc||!0x1===_0x486eab['requiresContent'])&&_0x8adb82['add'](_0x486eab['id']);return Array['from'](_0x8adb82);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x5f4525(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0xdf5914,_0x32b172,_0x12b2d8){super(),this['editor']=_0xdf5914,this['textAdapter']=_0x32b172,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x12b2d8,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x2cd3b3,_0x1169ae,_0x4289b9)=>{this['view']['value']=this['_sanitizeHTML'](_0x4289b9);}),this['listenTo'](this['view'],'submitPrompt',(_0x467cfa,_0xaa4328)=>{const _0x3172f6=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xaa4328,_0x3172f6,'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:_0x39aef9,query:_0x3cec44,htmlContent:_0x5cba64,label:_0x27eea0,mainActionLabel:_0x465a91}){this['view']['prompt']=_0x27eea0,this['view']['mainAction']=_0x465a91,this['initialContext']=_0x5cba64,_0x3cec44&&(this['view']['isRendered']?this['_handleQuery'](_0x3cec44,_0x5cba64,_0x39aef9,_0x27eea0):this['view']['once']('render',()=>{this['_handleQuery'](_0x3cec44,_0x5cba64,_0x39aef9,_0x27eea0);}));}['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'](_0x5f4f6f,_0x61278e,_0x5baf4d,_0x36e679){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x61278e,this['previousQuery']=_0x5f4f6f,this['previousLabel']=_0x36e679||_0x5f4f6f,this['previousActionId']=_0x5baf4d,new Promise(_0x39d127=>{this['textAdapter']['makeRequest']({'query':_0x5f4f6f,'context':_0x61278e,'onData':_0x233dc5=>{this['currentResponse']=_0x233dc5,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x5baf4d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3581e5=>{_0x3581e5 instanceof R?this['view']['handleError'](_0x3581e5['message']):this['view']['handleError'](),_0x39d127();})['finally'](()=>{this['stopProcessing'](),_0x39d127();});});}['_parseAndNormalizeContent'](_0x3443a3,_0x5cc62c=!0x1){const _0x6496ba=Q['exec'](_0x3443a3);_0x3443a3=_0x6496ba?_0x3443a3['substring'](_0x6496ba[0x1]['length']):_0x3443a3['length']<0x64&&!_0x5cc62c?'':this['_stripMarkdownSyntax'](_0x3443a3);const _0x5a1d1f=this['_domParser']['parseFromString'](_0x3443a3,'text/html');if(_0x6496ba){const _0x51d708=Array['from'](_0x5a1d1f['body']['childNodes']);_0x51d708['reverse']();for(const _0x32de25 of _0x51d708){if(_0x32de25['nodeType']==Node['ELEMENT_NODE'])break;_0x32de25['remove']();}}const _0xd585da=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x5a1d1f['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0xd585da);const _0x4febf6=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x316331=this['editor']['data']['toModel'](_0xd585da);return _0x4febf6||_0x316331['markers']['clear'](),this['editor']['data']['stringify'](_0x316331);}['_normalizeResponseHeadings'](_0x37c9bb){const _0x30f457=new _0x3099c0(this['editor']['editing']['view']['document']),_0x4d2e7b=new _0x583335({'name':/^h[1-5]$/}),_0x22c910=[];let _0x251fb7=!0x1;for(const _0x342736 of _0x37c9bb)_0x342736['is']('element')&&_0x4d2e7b['match'](_0x342736)&&(_0x22c910['push'](_0x342736),'h1'==_0x342736['name']&&(_0x251fb7=!0x0));if(_0x251fb7){for(const _0x42bd97 of _0x22c910)_0x30f457['rename']('h'+(parseInt(_0x42bd97['name'][0x1])+0x1),_0x42bd97);}}['_isH1TagSupportEnabled'](){const {data:_0x251163,editing:_0x3422ca}=this['editor'],_0x5c7c79=_0x251163['htmlProcessor']['toView']('<h1></h1>'),_0x3cb700=_0x251163['toView'](_0x251163['toModel'](_0x5c7c79));return!!_0x3422ca['view']['domConverter']['viewToDom'](_0x3cb700)['querySelector']('h1');}['_sanitizeHTML'](_0x1457d5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x1457d5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x13c9ab){const _0xe276c2=_0x13c9ab['trim']();return _0xe276c2['startsWith']('```html')?_0xe276c2['endsWith']('```')?_0xe276c2['substring'](0x7,_0xe276c2['length']-0x3):_0xe276c2['substring'](0x7):_0x13c9ab;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x14e7e5){super(_0x14e7e5),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x5155c4=>i(_0x14e7e5,'AI_'+_0x5155c4['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x14e7e5,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x14e7e5,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x14e7e5,'Stop'));const _0x35fc90=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x35fc90['if']('isVisible','ck-hidden',_0x554bea=>!_0x554bea)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x2f0053,_0x49cff5){const _0x49a3ba=new _0x4967ca(this['locale']);return _0x49a3ba['set']({'label':_0x2f0053,'class':_0x49cff5||'','isVisible':!0x0,'withText':!0x0}),_0x49a3ba;}}class ct extends _0x8e7cbe{['contentFieldView'];['copyButtonView'];constructor(_0x504635,_0x14b411=''){super(_0x504635),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1ea12e=this['bindTemplate'];this['contentFieldView']=new bt(_0x504635,_0x14b411),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1ea12e['if']('isVisible','ck-hidden',_0x56e486=>!_0x56e486)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1ea12e['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 _0x1dec3b=!0x1;this['on']('change:value',(_0x194e25,_0xbcb49d,_0x477306)=>{const _0x1e9daa=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x477306),this['isProcessing']&&_0x1e9daa&&!_0x1dec3b&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x28c267,_0x1ec478,_0x5e44f5)=>{_0x1dec3b=!0x1,_0x5e44f5?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x1dec3b=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x1dec3b=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x37a41d=this['locale'],_0x3a4f6d=new _0x4967ca(this['locale']),_0x347e53='ck-ai-form__copy-button';return _0x3a4f6d['set']({'label':i(_0x37a41d,'Copy'),'icon':_0x2737fc,'class':_0x347e53,'tooltip':!0x0}),_0x3a4f6d['bind']('isVisible')['to'](this,'value',_0x532f55=>!!_0x532f55),_0x3a4f6d['bind']('isEnabled')['to'](this,'isProcessing',_0x49a051=>!_0x49a051),_0x3a4f6d['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x3a4f6d['icon']=_0x26aec3,_0x3a4f6d['class']=_0x347e53+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x3a4f6d['icon']=_0x2737fc,_0x3a4f6d['class']=_0x347e53;},0x3e8);}),_0x3a4f6d;}['_copyHTMLToClipboard'](_0x4283d7){const {window:_0x1bfe24,document:_0x34d057}=_0x56076d;if(_0x1bfe24['ClipboardItem']){const {Blob:_0x2c0190,ClipboardItem:_0x1c6043}=_0x1bfe24,_0x33b1fc=[new _0x1c6043({'text/html':new _0x2c0190([_0x4283d7['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2c0190([_0x4283d7['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x33b1fc);}else{const _0x37d888=_0x34d057['createElement']('div');_0x37d888['style']['position']='absolute',_0x37d888['style']['left']='-9999px',_0x37d888['innerHTML']='<span>[</span>'+_0x4283d7['innerHTML']+'<span>]</span>',_0x34d057['body']['appendChild'](_0x37d888);const _0x1360c2=_0x34d057['createRange']();_0x1360c2['setStartAfter'](_0x37d888['firstElementChild']),_0x1360c2['setEndBefore'](_0x37d888['lastElementChild']);const _0x3d1b8b=_0x1bfe24['getSelection']();_0x3d1b8b['removeAllRanges'](),_0x3d1b8b['addRange'](_0x1360c2),_0x34d057['execCommand']('copy'),_0x37d888['remove']();}}}class bt extends _0x8e7cbe{constructor(_0xedb7c6,_0x47ab32=''){super(_0xedb7c6),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x47ab32,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x27fba9){this['element']['innerHTML']=_0x27fba9;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x5cf391=new _0x8e7cbe(),_0x37885d=this['locale'],_0x1b0e9b=new _0x5f0dd3();return _0x1b0e9b['isVisible']=!0x0,_0x5cf391['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x1b0e9b,{'text':i(_0x37885d,'AI\x20is\x20writing...')}]}),_0x5cf391['render'](),_0x5cf391;}}class mt extends _0x8e7cbe{constructor(_0x253778,_0x523b56=''){super(_0x253778);const _0x7f6b8c=new _0x5d9c88(),_0x348ead=this['bindTemplate'];this['set']('text',_0x523b56),_0x7f6b8c['content']=_0x3cc690,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x7f6b8c,{'text':_0x348ead['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x14f3c6,_0x8371f1){super(_0x14f3c6,_0x8371f1),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',(_0x3c49ce,_0x4b938f)=>{_0x3c49ce['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4b938f());});}['_createSubmitButton'](){const _0x1b8c50=new _0x4967ca(this['locale']),_0x283350=this['locale'];return _0x1b8c50['set']({'icon':it,'label':i(_0x283350,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1b8c50['on']('execute',()=>{this['submit']();}),_0x1b8c50['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x3691de,_0x28b028)=>!_0x3691de&&_0x28b028),_0x1b8c50;}['_createShowHistoryButton'](){const _0x92bd8d=new _0x4967ca(this['locale']),_0x1488f2=this['resultsView'],_0x313c4b=this['locale'];_0x92bd8d['set']({'label':i(_0x313c4b,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x92bd8d['bind']('isOn')['to'](_0x1488f2,'isVisible'),_0x92bd8d['bind']('isEnabled')['to'](this,'isEnabled'),_0x92bd8d['on']('execute',()=>{_0x1488f2['isVisible']=!_0x1488f2['isVisible'],_0x1488f2['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4a1a96=()=>{_0x56076d['window']['requestAnimationFrame'](()=>{if(_0x11c64c(this['element'])){const _0x412ee5=new _0x558749(this['queryView']['fieldView']['element']),_0x3c8bd6=_0x412ee5['width'],_0x497f16='rtl'===_0x313c4b['uiLanguageDirection']?'left':'right';_0x412ee5['excludeScrollbarsAndBorders'](),_0x92bd8d['element']['style'][_0x497f16]=_0x3c8bd6-_0x412ee5['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4a1a96),this['on']('render',_0x4a1a96),_0x92bd8d;}['submit'](){const _0xb30341=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xb30341);}['focus'](_0x4e10bd){-0x1===_0x4e10bd?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x3696dd){super(_0x3696dd),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x3696dd,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x290110=0x0;for(const _0x4fedc5 of this['items'])_0x290110+=_0x4fedc5['items']['length'];return{'resultsCount':_0x290110,'totalItemsCount':_0x290110};}['_createClearHistoryButton'](){const _0x34e95f=this['locale'],_0xf7a0b2=new _0x4967ca(this['locale']);return _0xf7a0b2['set']({'label':'('+i(_0x34e95f,'Clear')+')','withText':!0x0}),_0xf7a0b2['on']('execute',()=>this['fire']('clearHistory')),_0xf7a0b2;}}class ut extends xt{constructor(_0x3a5394){super();const _0x444a3e=new wt(),_0x3a5936=new _0x4967ca(this['locale'],_0x444a3e);this['children']['add'](_0x3a5936),_0x3a5936['set']({'label':_0x3a5394['prompt'],'withText':!0x0}),_0x3a5936['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3a5394['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x32d571{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2295d3,_0x2784a4)=>{const _0xb225a7=os(_0x2784a4['prompt']);for(const _0x3faa7e of this)if(_0x3faa7e!=_0x2784a4&&os(_0x3faa7e['prompt'])===_0xb225a7){this['remove'](_0x3faa7e);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x45862f=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x45862f));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x289201=>_0x289201)));}}function os(_0x5bcfc6){return _0x5bcfc6['toLowerCase']()['trim']();}class k extends _0x8e7cbe{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x34cd00,_0x4f8941,_0x595f8a=''){super(_0x34cd00),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x34cd00),this['contentArea']=new ct(_0x34cd00,_0x595f8a),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0xcb3096=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x4f8941],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0xcb3096['if']('isError','ck-hidden',_0x5d1957=>!_0x5d1957)]},'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'](_0x2e458e=0x1){-0x1===_0x2e458e?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 _0xcac38d=this['locale'],_0xf178a9=new lt(_0xcac38d,{'queryView':{'label':i(_0xcac38d,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0xcac38d,'Empty\x20history'),'secondary':i(_0xcac38d,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0xf178a9['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x554cb,_0x411ec2)=>_0x554cb&&!_0x411ec2),this['listenTo'](_0xf178a9,'submit',(_0x1a6783,_0x561bea)=>{this['prompt']=_0x561bea;const _0x202081=ft(_0x561bea);this['fire']('submitPrompt',_0x202081),_0x561bea['trim']()&&this['_promptHistory']['add']({'prompt':_0x202081},0x0);},{'priority':'high'}),_0xf178a9;}['_createHistoryView'](){const _0xacd64=new pt(this['locale']);return _0xacd64['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0xacd64['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xacd64;}['_createToolbar'](){const _0x31ab4f=new at(this['locale']);return _0x31ab4f['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x302ebe,_0x4f785f,_0x4f7592)=>_0x302ebe&&!_0x4f785f&&!!_0x4f7592),_0x31ab4f['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x31ab4f['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xeba25,_0x137817,_0x23f6a8)=>_0xeba25&&!_0x137817&&!!_0x23f6a8),_0x31ab4f['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x31ab4f['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4f02e0,_0xff47d9)=>_0x4f02e0&&!_0xff47d9),_0x31ab4f['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x31ab4f['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x31ab4f['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x31ab4f;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x583446=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x583446,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x35ed32){const _0x44031d=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x35ed32||i(_0x44031d,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x443adc{['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[_0x19a578,a,x,_0x3a4118];}constructor(_0x1372ce){super(_0x1372ce),_0x1372ce['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1372ce['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1372ce['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1372ce['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4012e5}=this;this['_aiAdapter']=_0x4012e5['plugins']['get'](x),this['_dialog']=_0x4012e5['plugins']['get'](_0x3a4118),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x5617c6=new E(_0x4012e5,Array['from'](this['_commandDefinitions']['values']()));_0x4012e5['commands']['add']('showAIAssistant',_0x5617c6),_0x4012e5['ui']['componentFactory']['add']('aiCommands',_0x20728b=>{const _0x154aa0=_0x5b544d(_0x20728b);return _0x154aa0['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x154aa0['buttonView']['set']({'label':i(_0x20728b,'AI\x20Commands'),'icon':_0x5e1e0e,'tooltip':!0x0}),_0x154aa0['on']('execute',_0x4a2cd3=>this['_onExecute'](_0x4a2cd3['source']['id'])),_0xfc202c(_0x154aa0,_0x4012e5['ui']['view']['body'],function(_0x44c4a5){const _0x4d81f7=o(_0x44c4a5['config']['get']('ai.aiAssistant.commands'),_0x44c4a5['locale']),_0x55247f=U(_0x44c4a5,_0x4d81f7)['filter'](_0x3f0506=>_0x3f0506['commands']['length']);if(0x1===_0x55247f['length'])return U(_0x44c4a5,_0x55247f[0x0]['commands'])['map'](_0xacc8c5=>({'id':_0xacc8c5['id'],'label':_0xacc8c5['label']}));return _0x55247f['map'](_0x487f4f=>{const {groupId:_0x281632,groupLabel:_0x2d206d,commands:_0x581ade}=_0x487f4f,_0x1a2f5b=U(_0x44c4a5,_0x581ade)['map'](_0x1ecfe3=>({'id':_0x1ecfe3['id'],'label':_0x1ecfe3['label']}));return{'id':_0x281632,'menu':_0x2d206d||_0x281632,'children':_0x1a2f5b};});}(_0x4012e5),{'ariaLabel':i(_0x20728b,'AI\x20Commands')}),_0x154aa0['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x5617c6['on']('change:enabledCommandsIds',_0x4d67d6),_0x154aa0['menuView']['once']('render',_0x4d67d6),_0x154aa0;function _0x4d67d6(){_0x154aa0['isEnabled']=_0x5617c6['enabledCommandsIds']['length']>0x0;for(const _0xac71e0 of _0x154aa0['menuView']['buttons'])_0xac71e0['isEnabled']=_0x5617c6['enabledCommandsIds']['includes'](_0xac71e0['id']);}}),_0x4012e5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x5239d2=>{const _0x9eecda=new _0x5b79ba(_0x5239d2);_0x9eecda['buttonView']['set']({'label':i(_0x5239d2,'AI\x20Commands'),'icon':_0x5e1e0e}),_0x9eecda['bind']('isEnabled')['to'](_0x5617c6,'enabledCommandsIds',_0x4185a5=>_0x4185a5['length']>0x0);const _0x327d27=o(_0x4012e5['config']['get']('ai.aiAssistant.commands'),_0x5239d2);return this['_populateMenuBarMenu'](_0x5617c6,_0x9eecda,_0x327d27,_0xead418=>this['_onExecute'](_0xead418)),_0x9eecda;}),_0x4012e5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x29d6c4=this['_createAIAssistantUIButton'](_0x4967ca);return _0x29d6c4['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x29d6c4;}),_0x4012e5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x423735=this['_createAIAssistantUIButton'](_0x1af9c7);return _0x423735['set']({'role':'menuitemcheckbox'}),_0x423735;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x22a7fc=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x248e03;for(const _0x25c36b in _0x22a7fc){const _0x5badcb=_0x25c36b,_0x5129c5=_0x22a7fc[_0x5badcb];if('aiLicenseKeyValid'==_0x5129c5||'aiLicenseKeyInvalid'==_0x5129c5||'aiLicenseKeyExpired'==_0x5129c5||'aiLicenseKeyDomainLimit'==_0x5129c5||'aiLicenseKeyNotAllowed'==_0x5129c5||'aiLicenseKeyEvaluationLimit'==_0x5129c5||'aiLicenseKeyTrialLimit'==_0x5129c5||'aiLicenseKeyUsageLimit'==_0x5129c5){delete _0x22a7fc[_0x5badcb],_0x248e03=_0x5129c5,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x248e03&&_0x22a7fc['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x248e03&&_0x22a7fc['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x248e03&&_0x22a7fc['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x248e03&&_0x22a7fc['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x248e03&&_0x22a7fc['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x248e03&&_0x22a7fc['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x248e03&&_0x22a7fc['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x522f1c='',_0x3000b2='',_0x533ca6='custom'){const _0x13db2f=this['editor'],_0x1bca4f=_0x13db2f['editing']['view'],_0x5eb06d=_0x13db2f['plugins']['get'](a),_0x418d62=_0x13db2f['plugins']['get'](_0x19a578);_0x5eb06d['showFakeVisualSelection']();const _0x29ea1d=new l(),_0x38e561=new ClipboardEvent('copy',{'clipboardData':_0x29ea1d}),_0x210889=new _0x35f253(_0x29ea1d),_0x30e2a4=new _0x1c58fc(_0x1bca4f,_0x38e561,{'dataTransfer':_0x210889});_0x418d62['_forceMarkersCopy']('comment',()=>{_0x1bca4f['document']['fire']('copy',_0x30e2a4);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x13db2f,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x20f649=_0x210889['getData']('text/html');const _0x4fd6a4=_0x13db2f['model']['document']['selection'],_0x4496fd=Array['from'](_0x4fd6a4['getRanges']());0x1===_0x4496fd['length']&&_0x4496fd[0x0]['isFlat']&&!_0x4fd6a4['getSelectedElement']()&&''!==_0x20f649['replace'](/ /g,'')['trim']()&&(_0x20f649='<p>'+_0x20f649+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x533ca6,'query':_0x522f1c,'htmlContent':_0x20f649,'label':_0x3000b2,'mainActionLabel':_[_0x13db2f['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x196726,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x5772d5['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x5eb06d['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x23023f=new Map(),_0x55a9dd=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x23de4e of _0x55a9dd)for(const _0x4a44b3 of _0x23de4e['commands'])_0x23023f['set'](_0x4a44b3['id'],{..._0x4a44b3,'groupId':_0x23de4e['groupId'],'groupLabel':_0x23de4e['groupLabel']||_0x23de4e['groupId']});return _0x23023f;}['_createAIAssistantUIButton'](_0xb8b040){const _0x76b72c=this['editor'],_0x20a503=_0x76b72c['commands']['get']('showAIAssistant'),_0x5536ec=new _0xb8b040(_0x76b72c['locale']);return _0x5536ec['set']({'label':i(_0x76b72c['locale'],'AI\x20Assistant'),'icon':_0x196726,'isToggleable':!0x0}),_0x5536ec['bind']('isEnabled')['to'](_0x20a503),_0x5536ec['bind']('isOn')['to'](this['_dialog'],'id',_0x1780b4=>'aiAssistant'===_0x1780b4),this['listenTo'](_0x5536ec,'execute',()=>{_0x5536ec['isOn']?this['hideUI']():_0x20a503['execute']();}),_0x5536ec;}['_initView'](){const _0x40b153=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',()=>{_0x40b153['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x40b153['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x1283dd,ui:{ariaLiveAnnouncer:_0x4264a9}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xd9c97b,_0x5698f4,_0xb73ddc)=>{const _0x3863f6=this['_aiAssistantController']['currentContext'];_0xb73ddc?_0x4264a9['announce'](i(_0x1283dd,'AI\x20is\x20writing')):_0x3863f6&&_0x4264a9['announce'](i(_0x1283dd,'Generated\x20content:\x20%0',_0x3863f6),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x5efee4,_0x166ba7,_0x438071)=>{if(_0x438071){const _0x6a788e=this['_formView']['errorView']['text'];_0x4264a9['announce'](i(_0x1283dd,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x6a788e));}});}['_onExecute'](_0x3f844a){const _0x434368=this['_commandDefinitions']['get'](_0x3f844a),_0x550b58=this['editor'],_0x565d13=_0x550b58['model']['document']['selection'],_0x111901=_0x550b58['commands']['get']('showAIAssistant'),_0x213254=_0x550b58['plugins']['get'](a),_0x4257e7=''+(_0x434368['groupId']!==K?_0x434368['groupLabel']+':\x20':'')+_0x434368['label'];if(!0x1!==_0x434368['requiresContent']&&_0x565d13['isCollapsed']){const _0x5ebba3=_0x2dfd84(_0x565d13['getSelectedBlocks']())||_0x550b58['model']['schema']['getLimitElement'](_0x565d13);_0x550b58['model']['change'](_0x4f46da=>{_0x4f46da['setSelection'](_0x5ebba3,'in');});}_0x213254['showFakeVisualSelection'](),_0x111901['execute'](_0x434368['prompt'],_0x4257e7,'command:'+_0x3f844a);}['_populateMenuBarMenu'](_0x13a00a,_0x386264,_0x387b2e,_0x17c021){const _0x54e913=this['editor'],_0xb44244=_0x54e913['locale'],_0x1ff460=new _0x5614ca(_0xb44244),_0xdb2e85=U(_0x54e913,_0x387b2e)['filter'](_0x27606a=>_0x27606a['commands']['length']);0x1===_0xdb2e85['length']?this['_getMenuBarGroupButtons']({'command':_0x13a00a,'commands':_0xdb2e85[0x0]['commands'],'parentMenuView':_0x386264,'onExecute':_0x17c021})['forEach'](_0x5f0390=>_0x1ff460['items']['add'](_0x5f0390)):_0xdb2e85['forEach'](({groupId:_0x5d07ec,groupLabel:_0x4f306a,commands:_0x5f395a})=>{const _0x4b92ae=new _0x3c4287(_0xb44244,_0x386264),_0x17bc65=new _0x5b79ba(_0xb44244),_0x3ee969=new _0x5614ca(_0xb44244),_0x3c1e19=this['_getMenuBarGroupButtons']({'command':_0x13a00a,'commands':_0x5f395a,'parentMenuView':_0x17bc65,'onExecute':_0x17c021});_0x17bc65['buttonView']['set']({'label':_0x4f306a||_0x5d07ec}),_0x17bc65['delegate']('execute')['to'](_0x386264),_0x3ee969['items']['addMany'](_0x3c1e19),_0x17bc65['panelView']['children']['add'](_0x3ee969),_0x4b92ae['children']['add'](_0x17bc65),_0x1ff460['items']['add'](_0x4b92ae);}),_0x386264['panelView']['children']['add'](_0x1ff460);}['_getMenuBarGroupButtons']({command:_0x1a1149,commands:_0x633848,parentMenuView:_0x75d915,onExecute:_0x5e5bf5}){const _0x4e27a9=this['editor'],_0x2ff5cd=_0x4e27a9['locale'];return U(_0x4e27a9,_0x633848)['map'](_0x1be444=>{const _0x369623=new _0x3c4287(_0x2ff5cd,_0x75d915),_0x41bbc2=new _0x1af9c7(_0x2ff5cd);return _0x41bbc2['set']({'label':_0x1be444['label']}),_0x41bbc2['delegate']('execute')['to'](_0x75d915),_0x41bbc2['on']('execute',()=>_0x5e5bf5(_0x1be444['id'])),_0x41bbc2['bind']('isEnabled')['to'](_0x1a1149,'enabledCommandsIds',_0x23f37d=>_0x23f37d['includes'](_0x1be444['id'])),_0x369623['children']['add'](_0x41bbc2),_0x369623;});}}function T(_0x529c1e,_0x5590df){return void 0x0!==_0x529c1e['order']&&void 0x0===_0x5590df['order']?0x1:void 0x0===_0x529c1e['order']&&void 0x0!==_0x5590df['order']?-0x1:void 0x0!==_0x529c1e['order']&&void 0x0!==_0x5590df['order']?_0x529c1e['order']-_0x5590df['order']:0x0;}function U(_0x3024a6,_0x11f3bc){_0x11f3bc['sort'](T);const _0xcba2bb={},_0x4ea957=[];for(const _0x27afa9 of _0x11f3bc)if(void 0x0!==_0x27afa9['order']){if(_0x27afa9['order']in _0xcba2bb)throw new _0x1adb01('ai-commands-config-order-collision',_0x3024a6,{'conflictingDefinitions':[_0x27afa9,_0xcba2bb[_0x27afa9['order']]]});_0xcba2bb[_0x27afa9['order']]=_0x27afa9,_0x4ea957['splice'](_0x27afa9['order'],0x0,_0x27afa9);}else _0x4ea957['push'](_0x27afa9);return _0x4ea957;}class At extends _0x443adc{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4e1b82){super(_0x4e1b82);const _0x389ff7=_0x4e1b82['config'],_0x427aee=_0x4e1b82['locale'];_0x389ff7['define']('ai.aiAssistant.preserveComments',!0x0),_0x389ff7['define']('ai.aiAssistant.commands',_t(_0x427aee)),_0x389ff7['define']('ai.aiAssistant.extraCommandGroups',[]),_0x389ff7['define']('ai.aiAssistant.removeCommands',[]);let _0x565daa=o(_0x389ff7['get']('ai.aiAssistant.commands'),_0x427aee);const _0x1e147b=_0x389ff7['get']('ai.aiAssistant.extraCommandGroups'),_0x40b199=_0x389ff7['get']('ai.aiAssistant.removeCommands');_0x1e147b['forEach'](_0x3f43d4=>{const _0x5abc45=_0x565daa['find'](_0x248054=>_0x248054['groupId']===_0x3f43d4['groupId']);_0x5abc45?_0x5abc45['commands']=_0x5abc45['commands']['concat'](_0x3f43d4['commands']):_0x565daa['push'](_0x3f43d4);}),_0x565daa=_0x565daa['filter'](_0x5af0e8=>!_0x40b199['includes'](_0x5af0e8['groupId'])),_0x565daa['forEach'](_0x3816e2=>{_0x3816e2['commands']=_0x3816e2['commands']['filter'](_0x1a1a67=>!_0x40b199['includes'](_0x1a1a67['id']));}),_0x389ff7['set']('ai.aiAssistant.commands',_0x565daa);}}function _t(_0xed335e){return[{'groupId':'editOrReview','groupLabel':i(_0xed335e,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0xed335e,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0xed335e,'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(_0xed335e,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0xed335e,'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(_0xed335e,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0xed335e,'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(_0xed335e,'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(_0xed335e,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0xed335e,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0xed335e,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0xed335e,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0xed335e,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0xed335e,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0xed335e,'Change\x20style'),'commands':[{'id':'business','label':i(_0xed335e,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0xed335e,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0xed335e,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0xed335e,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0xed335e,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0xed335e,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0xed335e,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0xed335e,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0xed335e,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0xed335e,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0xed335e,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0xed335e,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0xed335e,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x443adc{['abortController'];static get['requires'](){return[x];}constructor(_0x231701){super(_0x231701),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x47bec1){return this['sendRequest'](_0x47bec1)['catch'](_0x5ca798=>{if(_0x5ca798 instanceof R)return Promise['reject'](_0x5ca798);if('AbortError'==_0x5ca798['name'])return Promise['resolve']();throw console['error'](_0x5ca798),new _0x1adb01('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x5742e2,_0x5f2c9a){const _0x457baf=this['editor']['locale'],_0x8170ed={'Content-Type':'application/json'};if('object'==typeof _0x5742e2)Object['assign'](_0x8170ed,_0x5742e2);else{if(_0x5742e2)try{const _0x447a4f=await _0x5742e2(_0x5f2c9a);Object['assign'](_0x8170ed,_0x447a4f);}catch{return Promise['reject'](new R(i(_0x457baf,'AI_ERROR_GET_HEADERS')));}}return _0x8170ed;}async['_prepareRequestParameters'](_0x26d38c,_0x1600c3){const _0x382a4c=this['editor']['locale'];if('object'==typeof _0x26d38c)return _0x26d38c;try{return await _0x26d38c(_0x1600c3);}catch{return Promise['reject'](new R(i(_0x382a4c,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x37affe){super(_0x37affe),_0x37affe['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x37affe['config']['get']('ai.openAI.requestParameters')||_0x37affe['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x37affe['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x37affe['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x37affe['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x1d4f9f,context:_0x3d3071,onData:_0x1e78a3,actionId:_0x731f71}){const _0x153889=this['editor']['locale'],_0x42c737=await this['prepareMessages'](_0x1d4f9f,_0x3d3071,_0x731f71),_0x467050=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x731f71),_0x4b9213=await this['_prepareRequestParameters'](this['_requestParameters'],_0x731f71),_0x26ecce={'messages':_0x42c737,..._0x4b9213},_0x59ca3d={'method':'POST','headers':_0x467050,'body':JSON['stringify'](_0x26ecce),'signal':this['abortController']['signal']},_0x2108a3=await fetch(this['_apiUrl'],_0x59ca3d);if(_0x2108a3['ok'])return _0x4b9213['stream']?await this['_readStreamableResponse'](_0x2108a3,_0x1e78a3):await this['_readStaticResponse'](_0x2108a3,_0x1e78a3),Promise['resolve']();{const _0x3be6da=await _0x2108a3['text']();return _0x3be6da['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x153889,'AI_ERROR_CONTEXT_LENGTH'))):_0x3be6da['includes']('Moderation')?Promise['reject'](new R(i(_0x153889,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3be6da));}}async['prepareMessages'](_0x6090e4,_0x339620,_0x46a466){let _0x3171c7,_0xf9a91d;return _0x339620?(_0x3171c7='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.',_0xf9a91d='Instruction:\x0a'+_0x6090e4+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x339620):(_0x3171c7='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.',_0xf9a91d=_0x6090e4),[{'role':'system','content':_0x3171c7},{'role':'user','content':_0xf9a91d}];}async['_readStreamableResponse'](_0x37d713,_0x11f75c){const _0x19255e=_0x37d713['body']['getReader'](),_0x1f7674=new TextDecoder();let _0x377c6a='',_0x50e735='',_0x111c55='',_0x4c9c5e=!0x1;for(;!_0x4c9c5e;){const {done:_0x48e846,value:_0x5d4534}=await _0x19255e['read'](),_0x52d28c=_0x377c6a+_0x1f7674['decode'](_0x5d4534);let _0x3aebbd='';_0x4c9c5e=_0x48e846;try{_0x3aebbd=this['_cleanUpData'](_0x52d28c),_0x377c6a='';}catch{_0x377c6a=_0x52d28c;continue;}_0x50e735+=_0x3aebbd,!_0x4c9c5e&&this['_isBufferIncomplete'](_0x50e735)||_0x50e735&&(_0x111c55+=_0x50e735,_0x50e735='',_0x11f75c(_0x111c55));}return Promise['resolve']();}async['_readStaticResponse'](_0x946954,_0x5f1f8b){return _0x5f1f8b((await _0x946954['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x2d6864){const _0x2600ce=_0x2d6864['split']('<')['length']!==_0x2d6864['split']('>')['length'],_0x610066=_0x2d6864['length']<0x1e;return _0x2600ce&&_0x610066;}['_cleanUpData'](_0x32c1c7){return _0x32c1c7['split'](/\n(?![^{]*\})/g)['map'](_0x2f8335=>_0x2f8335['replace']('data:\x20',''))['filter'](_0x227d1a=>_0x227d1a&&_0x227d1a['length']>0x0&&'[DONE]'!==_0x227d1a)['map'](_0x4fdf4c=>{const {choices:_0x13c115}=JSON['parse'](_0x4fdf4c);if(_0x13c115[0x0]?.['delta']?.['content'])return _0x13c115[0x0]['delta']['content'];})['filter'](_0x506f91=>_0x506f91)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2fbf46){super(_0x2fbf46),_0x2fbf46['config']['get']('ai.aws.requestParameters')||_0x2fbf46['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']=_0x2fbf46['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2fbf46['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2fbf46['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2fbf46['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x4a337e,context:_0x57308f,onData:_0x346f56,actionId:_0x1e0ed3}){const {model:_0x488cb1,stream:_0x2459d1,..._0x3a41b8}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1e0ed3),_0x1d2db8={'prompt':await this['preparePrompt'](_0x4a337e,_0x57308f,_0x488cb1,_0x1e0ed3),..._0x3a41b8};this['_apiUrl']?await this['_processProxyRequest'](_0x1d2db8,_0x488cb1,_0x2459d1,_0x346f56,_0x1e0ed3):await this['_processAWSRequest'](_0x1d2db8,_0x488cb1,_0x2459d1,_0x346f56);}async['preparePrompt'](_0x57e1ca,_0x3efa97,_0x596ae7,_0x3234b6){let _0x20fda0,_0x2748ac;return _0x3efa97?(_0x20fda0='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.',_0x2748ac='Instruction:\x0a'+_0x57e1ca+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3efa97):(_0x20fda0='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.',_0x2748ac=_0x57e1ca),'meta.llama'==this['getModelFamily'](_0x596ae7)?'<<SYS>>\x0a'+_0x20fda0+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2748ac+'\x0a[/INST]':'Human:\x0a'+_0x20fda0+'\x0a'+_0x2748ac+'\x0a\x0aAssistant:';}['getModelFamily'](_0x373187){if(/^anthropic\.claude/['test'](_0x373187))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x373187))return'ai21.j2';if(/^cohere\.command/['test'](_0x373187))return'cohere.command';if(/^meta\.llama/['test'](_0x373187))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x373187));}async['_processProxyRequest'](_0x7665fa,_0x567818,_0x933a9,_0x516e93,_0x33b5fe){const _0x288c9d={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x33b5fe),'body':JSON['stringify']({..._0x7665fa,'model':_0x567818,'stream':_0x933a9}),'signal':this['abortController']['signal']},_0x48aec6=await fetch(this['_apiUrl'],_0x288c9d);_0x933a9?await this['_readStreamableResponse'](_0x48aec6,_0x567818,_0x516e93):await this['_readStaticResponse'](_0x48aec6,_0x567818,_0x516e93);}async['_processAWSRequest'](_0x154d11,_0x2c9afd,_0x23df45,_0x4d5f07){const _0x5d2a8d=new _0x412014(this['_bedrockClientConfig']),_0x30357e={'body':JSON['stringify'](_0x154d11),'contentType':'application/json','accept':'application/json','modelId':_0x2c9afd};let _0x209eee;if(_0x23df45){const _0x369fc1=new _0x37a045(_0x30357e);_0x209eee=await _0x5d2a8d['send'](_0x369fc1,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x209eee,_0x2c9afd,_0x4d5f07);}else{const _0x288e6f=new _0x4d7356(_0x30357e);_0x209eee=await _0x5d2a8d['send'](_0x288e6f,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x209eee,_0x2c9afd,_0x4d5f07);}}async['_readAsyncIterableResponse'](_0xbb6d0f,_0xf61d7,_0x11160f){const _0xcf95c1=_0xbb6d0f['body'],_0x1bc8cd=new TextDecoder('utf-8');let _0x48c024='';for await(const _0x292cbc of _0xcf95c1)if(_0x292cbc['chunk']){const _0x21675a=_0x1bc8cd['decode'](_0x292cbc['chunk']['bytes']),_0x106579=JSON['parse'](_0x21675a);_0x48c024+=this['_getGeneratedText'](_0x106579,_0xf61d7),_0x11160f(_0x48c024);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4f8531,_0x59d8f1,_0x5e8291){const _0x511e91=_0x4f8531['body'],_0x394b0b=new TextDecoder('utf-8'),_0x5c3d8d=_0x511e91['getReader']();let _0x208952='',_0x4f80ec='',_0x328ae9=!0x1;for(;!_0x328ae9;){const {done:_0x226544,value:_0x356ec5}=await _0x5c3d8d['read']();if(_0x328ae9=_0x226544,_0x328ae9)break;const _0x160fe3=(_0x208952+_0x394b0b['decode'](_0x356ec5))['split']('\x0a')['map'](_0x4f975e=>{try{return _0x208952='',JSON['parse'](_0x4f975e);}catch{return _0x208952=_0x4f975e,null;}})['filter'](_0x4ae098=>null!==_0x4ae098);_0x160fe3['length']&&(_0x4f80ec+=_0x160fe3['map'](_0x504482=>this['_getGeneratedText'](_0x504482,_0x59d8f1))['join'](''),_0x5e8291(_0x4f80ec));}return Promise['resolve']();}async['_readStaticResponse'](_0x45c1a1,_0x289b67,_0x104c26){let _0x4615d7;return _0x4615d7=_0x45c1a1 instanceof Response?await _0x45c1a1['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x45c1a1['body'])),(_0x104c26(this['_getGeneratedText'](_0x4615d7,_0x289b67)),Promise['resolve']());}['_getGeneratedText'](_0xb7fd3d,_0x176ee5){switch(this['getModelFamily'](_0x176ee5)){case'anthropic.claude':return _0xb7fd3d['completion'];case'ai21.j2':return _0xb7fd3d['completions'][0x0]['data']['text'];case'cohere.command':return _0xb7fd3d['generations'][0x0]['text'];case'meta.llama':return _0xb7fd3d['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
package/dist/translations/af.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':
|
|
23
|
+
export default{'af':{'dictionary':{'Edit\x20or\x20review':'','Improve\x20writing':'','Make\x20shorter':'','Make\x20longer':'','Simplify\x20language':'','Generate\x20from\x20selection':'','Summarize':'','Continue':'','Change\x20tone':'','Professional':'','Casual':'','Direct':'','Confident':'','Friendly':'','Change\x20style':'','Business':'','Legal':'','Journalism':'','Poetic':'','Translate':'','English':'','Spanish':'','German':'','Portuguese':'','French':'','Simplified\x20Chinese':'','Hindi':'','Arabic':'','AI\x20Assistant':'','AI\x20Commands':'','Ask\x20AI\x20to\x20edit\x20or\x20generate':'','Ask\x20AI\x20to\x20improve\x20generated\x20text':'','Copy':'','Submit':'Indien','Insert\x20below':'','Try\x20again':'','Stop':'','AI\x20is\x20writing...':'','AI\x20is\x20writing':'','Generated\x20content:\x20%0':'','Error\x20during\x20AI\x20content\x20generation:\x20%0':'','History':'','Empty\x20history':'','Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.':'','Prompt\x20history':'','AI_REPLACE_CONTENT':'Vervang','AI_INSERT_CONTENT':'','AI_ERROR_GET_HEADERS':'','AI_ERROR_GET_PARAMETERS':'','AI_ERROR_UNSUPPORTED_MODEL':'','AI_ERROR_CONTEXT_LENGTH':'','AI_ERROR_MODERATION':'','AI_ERROR_FAILED':'','Other':''},'getPluralForm':_0x268f46=>0x1!=_0x268f46}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x5297f8=>{const {af:{dictionary:_0x4a900f,getPluralForm:_0x4b5180}}={'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':_0x2d9014=>0x1!=_0x2d9014}};_0x5297f8['af']||={'dictionary':{},'getPluralForm':null},_0x5297f8['af']['dictionary']=Object['assign'](_0x5297f8['af']['dictionary'],_0x4a900f),_0x5297f8['af']['getPluralForm']=_0x4b5180;})(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':_0x39648a=>0x0==_0x39648a?0x0:0x1==_0x39648a?0x1:0x2==_0x39648a?0x2:_0x39648a%0x64>=0x3&&_0x39648a%0x64<=0xa?0x3:_0x39648a%0x64>=0xb?0x4:0x5}};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
(
|
|
23
|
+
(_0x12ea6c=>{const {ar:{dictionary:_0x1ff458,getPluralForm:_0x3e0b30}}={'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':_0x20cc05=>0x0==_0x20cc05?0x0:0x1==_0x20cc05?0x1:0x2==_0x20cc05?0x2:_0x20cc05%0x64>=0x3&&_0x20cc05%0x64<=0xa?0x3:_0x20cc05%0x64>=0xb?0x4:0x5}};_0x12ea6c['ar']||={'dictionary':{},'getPluralForm':null},_0x12ea6c['ar']['dictionary']=Object['assign'](_0x12ea6c['ar']['dictionary'],_0x1ff458),_0x12ea6c['ar']['getPluralForm']=_0x3e0b30;})(window['CKEDITOR_TRANSLATIONS']||={});
|