@ckeditor/ckeditor5-ai 45.2.1-alpha.5 → 45.2.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ai.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +9 -9
- package/src/aiassistantediting.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x1e8a11,Command as _0x320064}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x3736ca,IconCheck as _0x361fde,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3e651d,IconRobotPencil as _0x1fd953}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x496c79,CKEditorError as _0x149dfa,ObservableMixin as _0x447e28,global as _0x301865,isVisible as ot,Rect as it,Collection as _0x2aeb58,FocusTracker as mt,KeystrokeHandler as ut,first as _0x4c7b68}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x490fba,View as _0x2981c6,SpinnerView as _0x1dd543,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x20dd0b,createDropdown as _0x56cff,addMenuToDropdown as _0x2b8a0b,MenuBarMenuView as _0x26dcd7,MenuBarMenuListItemButtonView as _0x841fe8,DialogViewPosition as _0x64ed72,MenuBarMenuListView as _0x27cfab,MenuBarMenuListItemView as _0x202b41}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4ec368,ClipboardMarkersUtils as _0x14dfda}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x460c8f,DataTransfer as _0x361b43,UpcastWriter as _0x251c1b,Matcher as _0xce2739}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x57a40a,InvokeModelWithResponseStreamCommand as _0x14d061,InvokeModelCommand as _0x2824dd}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x430601,_0x1d56ec){const _0x2236dd=(0x0,_0x1d56ec['t'])('Other');return _0x430601['length']?'groupId'in _0x430601[0x0]?_0x430601:[{'groupId':x,'groupLabel':_0x2236dd,'order':0x1/0x0,'commands':_0x430601}]:[{'groupId':x,'groupLabel':_0x2236dd,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x1e8a11{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x64f139}=this,_0x56b382=['ck-fake-ai-selection'];_0x64f139['config']['get']('ai.useTheme')&&_0x56b382['push']('ck-ai-assistant-ui_theme'),_0x64f139['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x56b382,'priority':0xc}}),_0x64f139['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x2132cc,{writer:_0x1ada19})=>{if(!_0x2132cc['markerRange']['isCollapsed'])return null;const _0x137635=_0x1ada19['createUIElement']('span');return _0x1ada19['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x137635),_0x137635;}});}['afterInit'](){!async function(_0x9a0331){const _0x5e06bc=_0x2bc310([0x4a,0x56,0x62,0x68,0x78,0x51,0x42,0x6c,0x70,0x38,0x6b,0x30,0x48,0x49,0x7a,0x59,0x36,0x34,0x55,0x63,0x6a,0x77,0x35,0x64,0x32,0x71,0x37,0x4f,0x52,0x41,0x46,0x67,0x6f,0x69,0x75,0x74,0x72,0x73,0x4c,0x76,0x6e,0x4d,0x44,0x4b,0x6d,0x45,0x79,0x47,0x54,0x33,0x65,0x50,0x43,0x53,0x31,0x57,0x5a,0x4e,0x39,0x58,0x66,0x61]),_0x251e36=0x3a03af5,_0x3483e7=0x3a751c5^_0x251e36,_0x84fc43=window[_0x2bc310([0x44,0x61,0x74,0x65])][_0x2bc310([0x6e,0x6f,0x77])](),_0x3e21e8=_0x9a0331[_0x2bc310([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x318edf=new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3bea1e=>{_0x3e21e8[_0x2bc310([0x6f,0x6e,0x63,0x65])](_0x2bc310([0x72,0x65,0x61,0x64,0x79]),_0x3bea1e);}),_0x11f998={[_0x2bc310([0x6b,0x74,0x79])]:_0x2bc310([0x45,0x43]),[_0x2bc310([0x75,0x73,0x65])]:_0x2bc310([0x73,0x69,0x67]),[_0x2bc310([0x63,0x72,0x76])]:_0x2bc310([0x50,0x2d,0x32,0x35,0x36]),[_0x2bc310([0x78])]:_0x2bc310([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]),[_0x2bc310([0x79])]:_0x2bc310([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]),[_0x2bc310([0x61,0x6c,0x67])]:_0x2bc310([0x45,0x53,0x32,0x35,0x36])},_0x49ed8f=_0x3e21e8[_0x2bc310([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2bc310([0x67,0x65,0x74])](_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2e3531(){let _0x4cb3e5,_0x4a6e23=null,_0x24a068=null;try{if(_0x49ed8f==_0x2bc310([0x47,0x50,0x4c]))return _0x2bc310([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x4cb3e5=_0x589aed(),!_0x4cb3e5)return _0x2bc310([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x4cb3e5[_0x2bc310([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x24a068=_0x2246b6(_0x4cb3e5[_0x2bc310([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x4cb3e5[_0x2bc310([0x6a,0x74,0x69])])),await _0x54c386()?_0x4e1429()?_0x4f10df()?_0x2bc310([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x12df89()?(_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2bc310([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4a6e23=_0x98b2d0(_0x2bc310([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2bc310([0x74,0x72,0x69,0x61,0x6c])&&(_0x4a6e23=_0x98b2d0(_0x2bc310([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x380f96()):_0x2bc310([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2bc310([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2bc310([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2bc310([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x4f10df(){const _0x57aec8=[_0x2bc310([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2bc310([0x74,0x72,0x69,0x61,0x6c])][_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x84fc43/0x3e8:0xe10*_0x3483e7;return _0x4cb3e5[_0x2bc310([0x65,0x78,0x70])]<_0x57aec8;}function _0x4e1429(){const _0x1d8184=_0x4cb3e5[_0x2bc310([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1d8184&&(!!_0x1d8184[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc310([0x2a]))||!!_0x1d8184[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc310([0x41,0x49])));}function _0x12df89(){const _0x325dc7=_0x4cb3e5[_0x2bc310([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x325dc7||0x0==_0x325dc7[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4f68a5}=new URL(window[_0x2bc310([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x325dc7[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4f68a5))return!0x0;const _0x483217=_0x4f68a5[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e]));return _0x325dc7[_0x2bc310([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xafdb15=>_0xafdb15[_0x2bc310([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2bc310([0x2a])))[_0x2bc310([0x6d,0x61,0x70])](_0x47321b=>_0x47321b[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e])))[_0x2bc310([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x423b08=>_0x423b08[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x483217[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2bc310([0x6d,0x61,0x70])](_0x5c5f46=>Array(_0x483217[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5c5f46[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2bc310([0x66,0x69,0x6c,0x6c])](_0x5c5f46[0x0]===_0x2bc310([0x2a])?_0x2bc310([0x2a]):'')[_0x2bc310([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5c5f46))[_0x2bc310([0x73,0x6f,0x6d,0x65])](_0x4661e7=>_0x483217[_0x2bc310([0x65,0x76,0x65,0x72,0x79])]((_0x3d7973,_0x47e149)=>_0x4661e7[_0x47e149]===_0x3d7973||_0x4661e7[_0x47e149]===_0x2bc310([0x2a])));}function _0x380f96(){return _0x4a6e23&&_0x24a068?new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x58aaea,_0xb48176)=>{_0x4a6e23[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x58aaea,_0xb48176),_0x24a068[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x1bb23f=>{_0x1bb23f!=_0x2bc310([0x56,0x61,0x6c,0x69,0x64])&&_0x58aaea(_0x1bb23f);},_0xb48176);}):_0x4a6e23||_0x24a068||_0x2bc310([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2246b6(_0x3faf8d,_0x8acc59){return new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c51df=>{if(_0x23be64())return _0x3c51df(_0x2bc310([0x56,0x61,0x6c,0x69,0x64]));_0x21b488(),_0x3e21e8[_0x2bc310([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2bc310([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x129ed=!0x1;const _0x54a988=_0x496c79();function _0x26695a(_0x59f3fb){return!!_0x59f3fb&&(typeof _0x59f3fb===_0x2bc310([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x59f3fb===_0x2bc310([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x59f3fb[_0x2bc310([0x74,0x68,0x65,0x6e])]===_0x2bc310([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x59f3fb[_0x2bc310([0x63,0x61,0x74,0x63,0x68])]===_0x2bc310([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0xb70089(_0x10f32d){_0x2535e7(_0x10f32d)[_0x2bc310([0x74,0x68,0x65,0x6e])](_0xfc8b8e=>{if(!_0xfc8b8e||_0xfc8b8e[_0x2bc310([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2bc310([0x6f,0x6b]))return _0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x3d65db(_0xc29279(_0x54a988+_0x8acc59))!=_0xfc8b8e[_0x2bc310([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2bc310([0x56,0x61,0x6c,0x69,0x64]);})[_0x2bc310([0x74,0x68,0x65,0x6e])](_0xa846e=>(_0x41f73c(),_0xa846e),()=>{const _0x25c92b=_0x5b5930();return null==_0x25c92b?(_0x41f73c(),_0x2bc310([0x56,0x61,0x6c,0x69,0x64])):_0x2bc310(_0x84fc43-_0x25c92b>(0x27acbef5^_0x251e36)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x3c51df)[_0x2bc310([0x63,0x61,0x74,0x63,0x68])](()=>{_0x3c51df(_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x597206=0x396d475^_0x251e36;function _0x41f73c(){const _0x4225ae=_0x2bc310([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d65db(_0xc29279(_0x3faf8d)),_0x28cd13=_0x9749da(_0x3d65db(window[_0x2bc310([0x4d,0x61,0x74,0x68])][_0x2bc310([0x63,0x65,0x69,0x6c])](_0x84fc43/_0x597206)));window[_0x2bc310([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2bc310([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4225ae,_0x28cd13);}function _0x5b5930(){const _0x206bb8=_0x2bc310([0x6c,0x6c,0x63,0x74,0x2d])+_0x3d65db(_0xc29279(_0x3faf8d)),_0x41b067=window[_0x2bc310([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2bc310([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x206bb8);return _0x41b067?window[_0x2bc310([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x9749da(_0x41b067),0x10)*_0x597206:null;}function _0x2535e7(_0x4b746a){return new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x22357b,_0x4af012)=>{_0x4b746a[_0x2bc310([0x74,0x68,0x65,0x6e])](_0x22357b,_0x4af012),window[_0x2bc310([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4af012,0x3a1ee35^_0x251e36);});}}_0x3e21e8[_0x2bc310([0x6f,0x6e])](_0x2bc310([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x4c99ad,_0x250af3)=>{if(_0x250af3[0x0]!=_0x3faf8d)return _0x3c51df(_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x250af3[0x1]={..._0x250af3[0x1],[_0x2bc310([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x54a988};},{[_0x2bc310([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2bc310([0x68,0x69,0x67,0x68])}),_0x3e21e8[_0x2bc310([0x6f,0x6e])](_0x2bc310([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1a82c8=>{_0x26695a(_0x1a82c8[_0x2bc310([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x129ed=!0x0,_0xb70089(_0x1a82c8[_0x2bc310([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2bc310([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2bc310([0x6c,0x6f,0x77])}),_0x318edf[_0x2bc310([0x74,0x68,0x65,0x6e])](()=>{_0x129ed||_0x3c51df(_0x2bc310([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x23be64(){return _0x3e21e8[_0x2bc310([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2bc310([0x76,0x69,0x65,0x77])][_0x2bc310([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2bc310([0x61,0x75,0x74,0x6f]);}function _0x21b488(){_0x3e21e8[_0x2bc310([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2bc310([0x76,0x69,0x65,0x77])][_0x2bc310([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2bc310([0x61,0x75,0x74,0x6f]);}}function _0x98b2d0(_0x191848){const _0x25ec08=[new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x295154=>setTimeout(_0x295154,0x3a90439^_0x251e36)),_0x318edf[_0x2bc310([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x266a78=>{let _0x26022e=0x0;_0x3e21e8[_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc310([0x6f,0x6e])](_0x2bc310([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x17a396,_0x122ea8)=>{_0x122ea8[0x0][_0x2bc310([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x26022e++,_0x26022e==(0x3a03b0d^_0x251e36)&&(_0x266a78(),_0x17a396[_0x2bc310([0x6f,0x66,0x66])]());});}))];return window[_0x2bc310([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2bc310([0x72,0x61,0x63,0x65])](_0x25ec08)[_0x2bc310([0x74,0x68,0x65,0x6e])](()=>_0x191848);}async function _0x2183d7(){await _0x318edf,_0x3e21e8[_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc310([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x4ae912,_0x3e21e8[_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c])][_0x2bc310([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x4ae912,_0x3e21e8[_0x2bc310([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2bc310([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xd5170d(_0x519512){const _0xb6081=_0xda139d();_0x3e21e8[_0xb6081]=_0x2bc310([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x519512,_0x519512!=_0x2bc310([0x56,0x61,0x6c,0x69,0x64])&&_0x2183d7();}function _0xda139d(){const _0x6ef2d5=window[_0x2bc310([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2bc310([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2bc310([0x6e,0x6f,0x77])]())[_0x2bc310([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2bc310([0x2e]),'');let _0x1973b7=_0x2bc310([0x4a]);for(let _0x1c5611=0x0;_0x1c5611<_0x6ef2d5[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1c5611+=0x2){let _0x272aaa=window[_0x2bc310([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x6ef2d5[_0x2bc310([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1c5611,_0x1c5611+0x2));_0x272aaa>=_0x5e06bc[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x272aaa-=_0x5e06bc[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1973b7+=_0x5e06bc[_0x272aaa];}return _0x1973b7;}function _0x589aed(){const _0x26460f=_0x49ed8f[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e]));if(0x3!=_0x26460f[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xfd3ee6(_0x26460f[0x1]);function _0xfd3ee6(_0x332149){const _0xe2bbc6=_0x30cac2(_0x332149);return _0xe2bbc6&&_0x23f684()?_0xe2bbc6:null;function _0x23f684(){const _0x10d583=_0xe2bbc6[_0x2bc310([0x6a,0x74,0x69])],_0x34ad01=window[_0x2bc310([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x10d583[_0x2bc310([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x10d583[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x594083={..._0xe2bbc6,[_0x2bc310([0x6a,0x74,0x69])]:_0x10d583[_0x2bc310([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x10d583[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x594083[_0x2bc310([0x76,0x63])],_0xc29279(_0x594083)==_0x34ad01;}}}async function _0x54c386(){let _0x4f95eb=!0x0;try{const _0x3e61e5=_0x49ed8f[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])](_0x2bc310([0x2e])),[_0x57c6f8,_0xe39fb5,_0x1440d4]=_0x3e61e5;return _0x103098(_0x57c6f8),await _0x352327(_0x57c6f8,_0xe39fb5,_0x1440d4),_0x4f95eb;}catch{return!0x1;}function _0x103098(_0x41614d){const _0x513503=_0x30cac2(_0x41614d);_0x513503&&_0x513503[_0x2bc310([0x61,0x6c,0x67])]==_0x2bc310([0x45,0x53,0x32,0x35,0x36])||(_0x4f95eb=!0x1);}async function _0x352327(_0x3e81f5,_0x322100,_0x1089f2){const _0x4a0869=window[_0x2bc310([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2bc310([0x66,0x72,0x6f,0x6d])](_0x254db4(_0x1089f2),_0x1c1686=>_0x1c1686[_0x2bc310([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5a9e3f=new window[(_0x2bc310([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2bc310([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x3e81f5+_0x2bc310([0x2e])+_0x322100),_0x2f883d=window[_0x2bc310([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2bc310([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2f883d)return;const _0x39c6f4=await _0x2f883d[_0x2bc310([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2bc310([0x6a,0x77,0x6b]),_0x11f998,{[_0x2bc310([0x6e,0x61,0x6d,0x65])]:_0x2bc310([0x45,0x43,0x44,0x53,0x41]),[_0x2bc310([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2bc310([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2bc310([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2f883d[_0x2bc310([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2bc310([0x6e,0x61,0x6d,0x65])]:_0x2bc310([0x45,0x43,0x44,0x53,0x41]),[_0x2bc310([0x68,0x61,0x73,0x68])]:{[_0x2bc310([0x6e,0x61,0x6d,0x65])]:_0x2bc310([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x39c6f4,_0x4a0869,_0x5a9e3f)||(_0x4f95eb=!0x1);}}function _0x30cac2(_0x2951c7){return _0x2951c7[_0x2bc310([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2bc310([0x65,0x79]))?JSON[_0x2bc310([0x70,0x61,0x72,0x73,0x65])](_0x254db4(_0x2951c7)):null;}function _0x254db4(_0x21567c){return window[_0x2bc310([0x61,0x74,0x6f,0x62])](_0x21567c[_0x2bc310([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2bc310([0x2b]))[_0x2bc310([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2bc310([0x2f])));}function _0xc29279(_0x499726){let _0x5f41fc=0x1505;function _0x438b1e(_0x21d0f8){for(let _0x9c2139=0x0;_0x9c2139<_0x21d0f8[_0x2bc310([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x9c2139++){const _0x397046=_0x21d0f8[_0x2bc310([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x9c2139);_0x5f41fc=(_0x5f41fc<<0x5)+_0x5f41fc+_0x397046,_0x5f41fc&=_0x5f41fc;}}function _0x251298(_0x56492f){Array[_0x2bc310([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x56492f)?_0x56492f[_0x2bc310([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x251298):_0x56492f&&typeof _0x56492f==_0x2bc310([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2bc310([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x56492f)[_0x2bc310([0x73,0x6f,0x72,0x74])]()[_0x2bc310([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x3433b4,_0x3f59e8])=>{_0x438b1e(_0x3433b4),_0x251298(_0x3f59e8);}):_0x438b1e(window[_0x2bc310([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x56492f));}return _0x251298(_0x499726),_0x5f41fc>>>0x0;}function _0x3d65db(_0x88ad9a){return _0x88ad9a[_0x2bc310([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2bc310([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2bc310([0x30]));}function _0x9749da(_0x58f5a1){return _0x58f5a1[_0x2bc310([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2bc310([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2bc310([0x6a,0x6f,0x69,0x6e])]('');}function _0x4ae912(){}function _0x2bc310(_0x1d5b69){return _0x1d5b69['map'](_0x90ce9f=>String['fromCharCode'](_0x90ce9f))['join']('');}_0xd5170d(await _0x2e3531());}(this);}['showFakeVisualSelection'](){const _0x49bfc5=this['editor']['model'];_0x49bfc5['change'](_0x1bf106=>{const _0x1317f4=_0x49bfc5['document']['selection']['getRanges']();let _0x2c14b8=0x0;for(const _0x1049e9 of _0x1317f4){const _0x443beb=f+':'+_0x2c14b8;if(_0x49bfc5['markers']['has'](_0x443beb))_0x1bf106['updateMarker'](_0x443beb,{'range':_0x1049e9});else{if(_0x1049e9['start']['isAtEnd']){const _0x5a0116=_0x1049e9['start']['getLastMatchingPosition'](({item:_0x1b102f})=>!_0x49bfc5['schema']['isContent'](_0x1b102f),{'boundaries':_0x1049e9});_0x1bf106['addMarker'](_0x443beb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1bf106['createRange'](_0x5a0116,_0x1049e9['end'])});}else _0x1bf106['addMarker'](_0x443beb,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x1049e9});}_0x2c14b8++;}});}['hideFakeVisualSelection'](){const _0x27effb=this['editor']['model'],_0xb9c348=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0xb9c348['length']&&_0x27effb['change'](_0x4421ff=>{_0xb9c348['forEach'](_0xc542c3=>{_0x4421ff['removeMarker'](_0xc542c3);});});}['insertContent'](_0x243941,_0x8b2ebb){const _0x37d286=this['_getAISelection'](),_0x339ee1=_0x8b2ebb||_0x37d286['getFirstRange']();this['editor']['model']['canEditAt'](_0x339ee1)&&this['editor']['model']['change'](_0x3a30af=>{this['hideFakeVisualSelection'](),_0x8b2ebb||this['_resetContentOfSelectedTableCells'](_0x3a30af,_0x37d286),this['_pasteHTMLUsingClipboard']({'insertAt':_0x339ee1,'writer':_0x3a30af,'html':_0x243941});});}['insertContentBelow'](_0xaa6269){const {model:_0x3f4507}=this['editor'],_0x4699b0=this['_getAISelection']();_0x3f4507['change'](()=>{const _0x242fcc=this['_prepareTableInsertBelowPosition'](_0xaa6269,_0x4699b0)||this['_getDefaultInsertBelowPosition'](_0x4699b0);this['insertContent'](_0xaa6269,_0x242fcc);});}['_getAISelection'](){const _0x822ecf=this['editor']['model'],_0x14fb5d=Array['from'](_0x822ecf['markers']['getMarkersGroup'](f))['map'](_0x3a5e56=>_0x3a5e56['getRange']());return _0x822ecf['createSelection'](_0x14fb5d);}['_pasteHTMLUsingClipboard']({writer:_0x324e8f,html:_0x47e449,insertAt:_0x35d2cd}){const {view:_0x2ae43b}=this['editor']['editing'],_0x341628=this['editor']['plugins']['get'](_0x4ec368),_0x4a600f=new gt();_0x4a600f['setData']('text/html',_0x47e449);const _0x472e59=new ClipboardEvent('paste',{'clipboardData':_0x4a600f}),_0x1924e2=new _0x460c8f(_0x2ae43b,_0x472e59,{'dataTransfer':new _0x361b43(_0x4a600f)});_0x324e8f['setSelection'](_0x35d2cd);const _0x172c16=(_0x1764a9,_0x2323f2)=>{_0x2323f2['resultRange']&&_0x324e8f['setSelection'](_0x2323f2['resultRange']);};_0x341628['once']('contentInsertion',_0x172c16,{'priority':'lowest'}),_0x2ae43b['document']['fire']('paste',_0x1924e2),_0x341628['off']('contentInsertion',_0x172c16);}['_getDefaultInsertBelowPosition'](_0x57769f){const {model:_0x5866e3}=this['editor'],_0x270b47=Array['from'](_0x57769f['getSelectedBlocks']());return _0x270b47['length']?_0x5866e3['createPositionAfter'](_0x270b47['pop']()):_0x57769f['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x3c972a,_0x14d6fa){const {model:_0x468ee3,plugins:_0x5af526}=this['editor'];if(_0x5af526['has']('TableUtils')){const _0x2650e1=_0x5af526['get']('TableUtils')['getSelectedTableCells'](_0x14d6fa);if(_0x2650e1['length']){const _0x55e296=this['_getTableRowCountFromContent'](_0x3c972a),_0x486198=this['_createEmptyTableRows'](_0x2650e1,_0x55e296);return _0x468ee3['createPositionAt'](_0x486198,0x0);}}return null;}['_getTableRowCountFromContent'](_0x50ce17){const _0x21e0f4=this['editor']['plugins']['get']('TableUtils'),_0x52376a=this['editor']['data']['parse'](_0x50ce17),_0x49a146=Array['from'](_0x52376a['getChildren']())['filter'](_0x18cf96=>_0x18cf96['is']('element','table'));let _0x7d84bc=0x0;return _0x49a146['forEach'](_0x56bd65=>{_0x7d84bc+=_0x21e0f4['getRows'](_0x56bd65);}),_0x7d84bc;}['_createEmptyTableRows'](_0x3ebdf5,_0xe3a789){const _0x5b9ab8=this['editor']['plugins']['get']('TableUtils'),_0x91e191=_0x5b9ab8['getRowIndexes'](_0x3ebdf5),_0x21c8ab=_0x5b9ab8['getColumnIndexes'](_0x3ebdf5),_0x131919=_0x91e191['last']+0x1,_0x5d2953=_0x21c8ab['first'],_0x40b149=_0x3ebdf5[0x0]['findAncestor']('table');for(let _0x118a19=0x0;_0x118a19<_0xe3a789;_0x118a19++)_0x5b9ab8['insertRows'](_0x40b149,{'at':_0x131919});return _0x40b149['getChild'](_0x131919)['getChild'](_0x5d2953);}['_resetContentOfSelectedTableCells'](_0x6717ce,_0x2c9dff){const {plugins:_0x57c5bd}=this['editor'],{model:_0x4fa221}=_0x6717ce;if(!_0x57c5bd['has']('TableUtils'))return;_0x57c5bd['get']('TableUtils')['getSelectedTableCells'](_0x2c9dff)['length']&&_0x4fa221['deleteContent'](_0x2c9dff);}}class E extends _0x1e8a11{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x149dfa('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1e4d73){super(_0x1e4d73),this['name']='AIRequestError';}}function i(_0xbcdcd1,_0xa484e,_0x2b626a){const t=_0xbcdcd1['t'];switch(_0xa484e){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',_0x2b626a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x2b626a);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'},_0x2b626a);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 _0xa484e;}}class j extends _0x320064{['_commandDefinitions'];constructor(_0x3dc0a1,_0x21edd1){super(_0x3dc0a1),this['_commandDefinitions']=_0x21edd1,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x564193,_0x18eb26,_0x4531b7)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x4531b7));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x1da78b,_0x114ca3,_0x26968e)=>{this['enabledCommandsIds']=_0x26968e?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x3a4673=this['editor']['model'];this['_hasContext']=function(_0x696747){const _0x5374dc=_0x696747['document']['selection'];return _0x5374dc['isCollapsed']?0x0!==[..._0x5374dc['getSelectedBlocks']()]['length']&&![..._0x5374dc['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x696747['hasContent'](_0x5374dc['getFirstRange']());}(_0x3a4673);const _0x248cbe=_0x3a4673['document']['selection'],_0x27fc27=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x62b56 of _0x248cbe['getRanges']())for(const _0x52cc7b of _0x62b56['getItems']())if(_0x52cc7b['is']('element')&&_0x27fc27['includes'](_0x52cc7b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x395d1c='',_0x2ab1ba='',_0x15bf60='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x395d1c,_0x2ab1ba,_0x15bf60);}}function G(_0x344462,_0x52914f){const _0x1d33cd=new Set();for(const _0xc44ea0 of _0x344462['values']())(_0x52914f||!0x1===_0xc44ea0['requiresContent'])&&_0x1d33cd['add'](_0xc44ea0['id']);return Array['from'](_0x1d33cd);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x447e28(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x5abfcf,_0x21fa95,_0xa5f507){super(),this['editor']=_0x5abfcf,this['textAdapter']=_0x21fa95,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xa5f507,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1b8699,_0x34c9d1,_0x15fcd0)=>{this['view']['value']=this['_sanitizeHTML'](_0x15fcd0);}),this['listenTo'](this['view'],'submitPrompt',(_0xf322bb,_0x2670e9)=>{const _0x47895f=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x2670e9,_0x47895f,'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:_0x25df62,query:_0x253bcd,htmlContent:_0x269939,label:_0x26371a,mainActionLabel:_0x2ddcdc}){this['view']['prompt']=_0x26371a,this['view']['mainAction']=_0x2ddcdc,this['initialContext']=_0x269939,_0x253bcd&&(this['view']['isRendered']?this['_handleQuery'](_0x253bcd,_0x269939,_0x25df62,_0x26371a):this['view']['once']('render',()=>{this['_handleQuery'](_0x253bcd,_0x269939,_0x25df62,_0x26371a);}));}['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'](_0x42dc2b,_0x23d41d,_0x4ec141,_0x51aa92){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x23d41d,this['previousQuery']=_0x42dc2b,this['previousLabel']=_0x51aa92||_0x42dc2b,this['previousActionId']=_0x4ec141,new Promise(_0x39aec1=>{this['textAdapter']['makeRequest']({'query':_0x42dc2b,'context':_0x23d41d,'onData':_0x13bb59=>{this['currentResponse']=_0x13bb59,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x4ec141})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x430830=>{_0x430830 instanceof R?this['view']['handleError'](_0x430830['message']):this['view']['handleError'](),_0x39aec1();})['finally'](()=>{this['stopProcessing'](),_0x39aec1();});});}['_parseAndNormalizeContent'](_0x25842a,_0xa53cb7=!0x1){const _0x13515f=Z['exec'](_0x25842a);_0x25842a=_0x13515f?_0x25842a['substring'](_0x13515f[0x1]['length']):_0x25842a['length']<0x64&&!_0xa53cb7?'':this['_stripMarkdownSyntax'](_0x25842a);const _0x146558=this['_domParser']['parseFromString'](_0x25842a,'text/html');if(_0x13515f){const _0xfa1ca6=Array['from'](_0x146558['body']['childNodes']);_0xfa1ca6['reverse']();for(const _0x504591 of _0xfa1ca6){if(_0x504591['nodeType']==Node['ELEMENT_NODE'])break;_0x504591['remove']();}}const _0x29ac53=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x146558['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x29ac53);const _0x1c97dd=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x1a5e9d=this['editor']['data']['toModel'](_0x29ac53);return _0x1c97dd||_0x1a5e9d['markers']['clear'](),this['editor']['data']['stringify'](_0x1a5e9d);}['_normalizeResponseHeadings'](_0x4c7cb8){const _0x15f2e9=new _0x251c1b(this['editor']['editing']['view']['document']),_0x331a64=new _0xce2739({'name':/^h[1-5]$/}),_0x3c20b7=[];let _0x525432=!0x1;for(const _0x47daa0 of _0x4c7cb8)_0x47daa0['is']('element')&&_0x331a64['match'](_0x47daa0)&&(_0x3c20b7['push'](_0x47daa0),'h1'==_0x47daa0['name']&&(_0x525432=!0x0));if(_0x525432){for(const _0x1869f1 of _0x3c20b7)_0x15f2e9['rename']('h'+(parseInt(_0x1869f1['name'][0x1])+0x1),_0x1869f1);}}['_isH1TagSupportEnabled'](){const {data:_0x318ad4,editing:_0x258681}=this['editor'],_0xbea855=_0x318ad4['htmlProcessor']['toView']('<h1></h1>'),_0xc295d0=_0x318ad4['toView'](_0x318ad4['toModel'](_0xbea855));return!!_0x258681['view']['domConverter']['viewToDom'](_0xc295d0)['querySelector']('h1');}['_sanitizeHTML'](_0x3a189c){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3a189c),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4718d7){const _0x5f3fe9=_0x4718d7['trim']();return _0x5f3fe9['startsWith']('```html')?_0x5f3fe9['endsWith']('```')?_0x5f3fe9['substring'](0x7,_0x5f3fe9['length']-0x3):_0x5f3fe9['substring'](0x7):_0x4718d7;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x236519){super(_0x236519),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x444114=>i(_0x236519,'AI_'+_0x444114['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x236519,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x236519,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x236519,'Stop'));const _0x820f52=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x820f52['if']('isVisible','ck-hidden',_0x2659f5=>!_0x2659f5)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x12dfc0,_0x3dc115){const _0x14f46e=new _0x490fba(this['locale']);return _0x14f46e['set']({'label':_0x12dfc0,'class':_0x3dc115||'','isVisible':!0x0,'withText':!0x0}),_0x14f46e;}}class Y extends _0x2981c6{['contentFieldView'];['copyButtonView'];constructor(_0x3152f1,_0x16f3da=''){super(_0x3152f1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x10e168=this['bindTemplate'];this['contentFieldView']=new At(_0x3152f1,_0x16f3da),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x10e168['if']('isVisible','ck-hidden',_0x5b8dcc=>!_0x5b8dcc)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x10e168['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 _0x5dbcc7=!0x1;this['on']('change:value',(_0x45c8b6,_0x278140,_0x3f3e33)=>{const _0x5ad55c=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x3f3e33),this['isProcessing']&&_0x5ad55c&&!_0x5dbcc7&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3dd7bd,_0x255287,_0x1bd93f)=>{_0x5dbcc7=!0x1,_0x1bd93f?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x5dbcc7=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x5dbcc7=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x6d7131=this['locale'],_0x4d4b22=new _0x490fba(this['locale']),_0xf6c75='ck-ai-form__copy-button';return _0x4d4b22['set']({'label':i(_0x6d7131,'Copy'),'icon':_0x3736ca,'class':_0xf6c75,'tooltip':!0x0}),_0x4d4b22['bind']('isVisible')['to'](this,'value',_0x2969b4=>!!_0x2969b4),_0x4d4b22['bind']('isEnabled')['to'](this,'isProcessing',_0x377b21=>!_0x377b21),_0x4d4b22['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x4d4b22['icon']=_0x361fde,_0x4d4b22['class']=_0xf6c75+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x4d4b22['icon']=_0x3736ca,_0x4d4b22['class']=_0xf6c75;},0x3e8);}),_0x4d4b22;}['_copyHTMLToClipboard'](_0x2d4fce){const {window:_0x5930bc,document:_0x566065}=_0x301865;if(_0x5930bc['ClipboardItem']){const {Blob:_0x53ab32,ClipboardItem:_0x3a992f}=_0x5930bc,_0x15fa47=[new _0x3a992f({'text/html':new _0x53ab32([_0x2d4fce['innerHTML']],{'type':'text/html'}),'text/plain':new _0x53ab32([_0x2d4fce['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x15fa47);}else{const _0x139e36=_0x566065['createElement']('div');_0x139e36['style']['position']='absolute',_0x139e36['style']['left']='-9999px',_0x139e36['innerHTML']='<span>[</span>'+_0x2d4fce['innerHTML']+'<span>]</span>',_0x566065['body']['appendChild'](_0x139e36);const _0x512f93=_0x566065['createRange']();_0x512f93['setStartAfter'](_0x139e36['firstElementChild']),_0x512f93['setEndBefore'](_0x139e36['lastElementChild']);const _0x4e1a5e=_0x5930bc['getSelection']();_0x4e1a5e['removeAllRanges'](),_0x4e1a5e['addRange'](_0x512f93),_0x566065['execCommand']('copy'),_0x139e36['remove']();}}}class At extends _0x2981c6{constructor(_0x17951c,_0x4df1db=''){super(_0x17951c),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x4df1db,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x571411){this['element']['innerHTML']=_0x571411;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4e650c=new _0x2981c6(),_0x4762e8=this['locale'],_0x599a6c=new _0x1dd543();return _0x599a6c['isVisible']=!0x0,_0x4e650c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x599a6c,{'text':i(_0x4762e8,'AI\x20is\x20writing...')}]}),_0x4e650c['render'](),_0x4e650c;}}class st extends _0x2981c6{constructor(_0x1b0f8a,_0x2560b6=''){super(_0x1b0f8a);const _0x2785a4=new rt(),_0x10ffb9=this['bindTemplate'];this['set']('text',_0x2560b6),_0x2785a4['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x2785a4,{'text':_0x10ffb9['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x442458,_0x173c4f){super(_0x442458,_0x173c4f),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',(_0x5d3ae3,_0x4e395a)=>{_0x5d3ae3['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4e395a());});}['_createSubmitButton'](){const _0x4fa642=new _0x490fba(this['locale']),_0x22e15b=this['locale'];return _0x4fa642['set']({'icon':ht,'label':i(_0x22e15b,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x4fa642['on']('execute',()=>{this['submit']();}),_0x4fa642['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x1ec282,_0x4ae404)=>!_0x1ec282&&_0x4ae404),_0x4fa642;}['_createShowHistoryButton'](){const _0x582ddd=new _0x490fba(this['locale']),_0x4b24d6=this['resultsView'],_0x1352ad=this['locale'];_0x582ddd['set']({'label':i(_0x1352ad,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x582ddd['bind']('isOn')['to'](_0x4b24d6,'isVisible'),_0x582ddd['bind']('isEnabled')['to'](this,'isEnabled'),_0x582ddd['on']('execute',()=>{_0x4b24d6['isVisible']=!_0x4b24d6['isVisible'],_0x4b24d6['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x28965a=()=>{_0x301865['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x42457a=new it(this['queryView']['fieldView']['element']),_0x3c60ba=_0x42457a['width'],_0x27e3a9='rtl'===_0x1352ad['uiLanguageDirection']?'left':'right';_0x42457a['excludeScrollbarsAndBorders'](),_0x582ddd['element']['style'][_0x27e3a9]=_0x3c60ba-_0x42457a['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x28965a),this['on']('render',_0x28965a),_0x582ddd;}['submit'](){const _0x27959b=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x27959b);}['focus'](_0x594118){-0x1===_0x594118?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x35ac9c){super(_0x35ac9c),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x35ac9c,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x37b192=0x0;for(const _0x3aa7bd of this['items'])_0x37b192+=_0x3aa7bd['items']['length'];return{'resultsCount':_0x37b192,'totalItemsCount':_0x37b192};}['_createClearHistoryButton'](){const _0xe3d420=this['locale'],_0x1059e3=new _0x490fba(this['locale']);return _0x1059e3['set']({'label':'('+i(_0xe3d420,'Clear')+')','withText':!0x0}),_0x1059e3['on']('execute',()=>this['fire']('clearHistory')),_0x1059e3;}}class bt extends xt{constructor(_0x507db7){super();const _0x2c29c2=new kt(),_0x2231d1=new _0x490fba(this['locale'],_0x2c29c2);this['children']['add'](_0x2231d1),_0x2231d1['set']({'label':_0x507db7['prompt'],'withText':!0x0}),_0x2231d1['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x507db7['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x2aeb58{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2a1429,_0x1bb753)=>{const _0x48b023=os(_0x1bb753['prompt']);for(const _0x118ea0 of this)if(_0x118ea0!=_0x1bb753&&os(_0x118ea0['prompt'])===_0x48b023){this['remove'](_0x118ea0);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x503f33=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x503f33));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x56c19f=>_0x56c19f)));}}function os(_0x11938a){return _0x11938a['toLowerCase']()['trim']();}class _ extends _0x2981c6{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0xe05db7,_0x3191de,_0x729375=''){super(_0xe05db7),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0xe05db7),this['contentArea']=new Y(_0xe05db7,_0x729375),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x402e61=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x3191de],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x402e61['if']('isError','ck-hidden',_0x3154f4=>!_0x3154f4)]},'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'](_0x5da540=0x1){-0x1===_0x5da540?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 _0xdd4140=this['locale'],_0x1bba46=new ct(_0xdd4140,{'queryView':{'label':i(_0xdd4140,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0xdd4140,'Empty\x20history'),'secondary':i(_0xdd4140,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x1bba46['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x141407,_0x2f8448)=>_0x141407&&!_0x2f8448),this['listenTo'](_0x1bba46,'submit',(_0x297dae,_0x110084)=>{this['prompt']=_0x110084;const _0x1fabf4=yt(_0x110084);this['fire']('submitPrompt',_0x1fabf4),_0x110084['trim']()&&this['_promptHistory']['add']({'prompt':_0x1fabf4},0x0);},{'priority':'high'}),_0x1bba46;}['_createHistoryView'](){const _0x31be30=new ft(this['locale']);return _0x31be30['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x31be30['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x31be30;}['_createToolbar'](){const _0x3ce865=new lt(this['locale']);return _0x3ce865['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x448d01,_0x247d00,_0x37140f)=>_0x448d01&&!_0x247d00&&!!_0x37140f),_0x3ce865['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x3ce865['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x286491,_0x1cc747,_0x3f3503)=>_0x286491&&!_0x1cc747&&!!_0x3f3503),_0x3ce865['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x3ce865['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3cffe3,_0x107234)=>_0x3cffe3&&!_0x107234),_0x3ce865['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x3ce865['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x3ce865['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x3ce865;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x4545e5=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x4545e5,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2213bb){const _0x525ce1=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2213bb||i(_0x525ce1,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x1e8a11{['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[_0x14dfda,a,E,_0x20dd0b];}constructor(_0x1a4df6){super(_0x1a4df6),_0x1a4df6['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x1a4df6['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x1a4df6['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x1a4df6['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x306389}=this;this['_aiAdapter']=_0x306389['plugins']['get'](E),this['_dialog']=_0x306389['plugins']['get'](_0x20dd0b),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x4c590c=new j(_0x306389,Array['from'](this['_commandDefinitions']['values']()));_0x306389['commands']['add']('showAIAssistant',_0x4c590c),_0x306389['ui']['componentFactory']['add']('aiCommands',_0x5b7b92=>{const _0x143b93=_0x56cff(_0x5b7b92);return _0x143b93['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x143b93['buttonView']['set']({'label':i(_0x5b7b92,'AI\x20Commands'),'icon':_0x3e651d,'tooltip':!0x0}),_0x143b93['on']('execute',_0x314d6c=>this['_onExecute'](_0x314d6c['source']['id'])),_0x2b8a0b(_0x143b93,_0x306389['ui']['view']['body'],function(_0x3cab71){const _0x7dbbf0=o(_0x3cab71['config']['get']('ai.aiAssistant.commands'),_0x3cab71['locale']),_0x3d33ed=U(_0x3cab71,_0x7dbbf0)['filter'](_0x4186ef=>_0x4186ef['commands']['length']);if(0x1===_0x3d33ed['length'])return U(_0x3cab71,_0x3d33ed[0x0]['commands'])['map'](_0x5c471c=>({'id':_0x5c471c['id'],'label':_0x5c471c['label']}));return _0x3d33ed['map'](_0x377ed5=>{const {groupId:_0x2fe1ee,groupLabel:_0x581bc1,commands:_0x11308b}=_0x377ed5,_0x8ac86e=U(_0x3cab71,_0x11308b)['map'](_0x29cdb4=>({'id':_0x29cdb4['id'],'label':_0x29cdb4['label']}));return{'id':_0x2fe1ee,'menu':_0x581bc1||_0x2fe1ee,'children':_0x8ac86e};});}(_0x306389),{'ariaLabel':i(_0x5b7b92,'AI\x20Commands')}),_0x143b93['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x4c590c['on']('change:enabledCommandsIds',_0xea9a69),_0x143b93['menuView']['once']('render',_0xea9a69),_0x143b93;function _0xea9a69(){_0x143b93['isEnabled']=_0x4c590c['enabledCommandsIds']['length']>0x0;for(const _0x1acfc0 of _0x143b93['menuView']['buttons'])_0x1acfc0['isEnabled']=_0x4c590c['enabledCommandsIds']['includes'](_0x1acfc0['id']);}}),_0x306389['ui']['componentFactory']['add']('menuBar:aiCommands',_0x1722da=>{const _0x1ba094=new _0x26dcd7(_0x1722da);_0x1ba094['buttonView']['set']({'label':i(_0x1722da,'AI\x20Commands'),'icon':_0x3e651d}),_0x1ba094['bind']('isEnabled')['to'](_0x4c590c,'enabledCommandsIds',_0x4865d1=>_0x4865d1['length']>0x0);const _0x30a177=o(_0x306389['config']['get']('ai.aiAssistant.commands'),_0x1722da);return this['_populateMenuBarMenu'](_0x4c590c,_0x1ba094,_0x30a177,_0x245a31=>this['_onExecute'](_0x245a31)),_0x1ba094;}),_0x306389['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x1784d3=this['_createAIAssistantUIButton'](_0x490fba);return _0x1784d3['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x1784d3;}),_0x306389['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xb0f33=this['_createAIAssistantUIButton'](_0x841fe8);return _0xb0f33['set']({'role':'menuitemcheckbox'}),_0xb0f33;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x37bfe2=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x10e7f6;for(const _0x5e287a in _0x37bfe2){const _0x3e6538=_0x5e287a,_0x370356=_0x37bfe2[_0x3e6538];if('aiLicenseKeyValid'==_0x370356||'aiLicenseKeyInvalid'==_0x370356||'aiLicenseKeyExpired'==_0x370356||'aiLicenseKeyDomainLimit'==_0x370356||'aiLicenseKeyNotAllowed'==_0x370356||'aiLicenseKeyEvaluationLimit'==_0x370356||'aiLicenseKeyTrialLimit'==_0x370356||'aiLicenseKeyUsageLimit'==_0x370356){delete _0x37bfe2[_0x3e6538],_0x10e7f6=_0x370356,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x10e7f6&&_0x37bfe2['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x3299d3='',_0x418520='',_0x360b1e='custom'){const _0x1a524a=this['editor'],_0x526e19=_0x1a524a['editing']['view'],_0x2e59b8=_0x1a524a['plugins']['get'](a),_0x2a514c=_0x1a524a['plugins']['get'](_0x14dfda);_0x2e59b8['showFakeVisualSelection']();const _0xd0bcc1=new w(),_0x3d2f28=new ClipboardEvent('copy',{'clipboardData':_0xd0bcc1}),_0x3a2ede=new _0x361b43(_0xd0bcc1),_0x33753a=new _0x460c8f(_0x526e19,_0x3d2f28,{'dataTransfer':_0x3a2ede});_0x2a514c['_forceMarkersCopy']('comment',()=>{_0x526e19['document']['fire']('copy',_0x33753a);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x1a524a,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x5d249b=_0x3a2ede['getData']('text/html');const _0x40776a=_0x1a524a['model']['document']['selection'],_0x5e513f=Array['from'](_0x40776a['getRanges']());0x1===_0x5e513f['length']&&_0x5e513f[0x0]['isFlat']&&!_0x40776a['getSelectedElement']()&&''!==_0x5d249b['replace'](/ /g,'')['trim']()&&(_0x5d249b='<p>'+_0x5d249b+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x360b1e,'query':_0x3299d3,'htmlContent':_0x5d249b,'label':_0x418520,'mainActionLabel':M[_0x1a524a['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1fd953,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x64ed72['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x2e59b8['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x3d4808=new Map(),_0x252737=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0xbb8056 of _0x252737)for(const _0x3d81cf of _0xbb8056['commands'])_0x3d4808['set'](_0x3d81cf['id'],{..._0x3d81cf,'groupId':_0xbb8056['groupId'],'groupLabel':_0xbb8056['groupLabel']||_0xbb8056['groupId']});return _0x3d4808;}['_createAIAssistantUIButton'](_0x492512){const _0x5b24bd=this['editor'],_0x5531e2=_0x5b24bd['commands']['get']('showAIAssistant'),_0x4dd537=new _0x492512(_0x5b24bd['locale']);return _0x4dd537['set']({'label':i(_0x5b24bd['locale'],'AI\x20Assistant'),'icon':_0x1fd953,'isToggleable':!0x0}),_0x4dd537['bind']('isEnabled')['to'](_0x5531e2),_0x4dd537['bind']('isOn')['to'](this['_dialog'],'id',_0x120694=>'aiAssistant'===_0x120694),this['listenTo'](_0x4dd537,'execute',()=>{_0x4dd537['isOn']?this['hideUI']():_0x5531e2['execute']();}),_0x4dd537;}['_initView'](){const _0x22fb74=this['editor']['plugins']['get'](a);this['_formView']=new _(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x22fb74['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x22fb74['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3b205d,ui:{ariaLiveAnnouncer:_0x72dd28}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x1a3def,_0x1a2cd8,_0x9ccab8)=>{const _0x81701b=this['_aiAssistantController']['currentContext'];_0x9ccab8?_0x72dd28['announce'](i(_0x3b205d,'AI\x20is\x20writing')):_0x81701b&&_0x72dd28['announce'](i(_0x3b205d,'Generated\x20content:\x20%0',_0x81701b),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x9400bd,_0x180f7a,_0x16d2f8)=>{if(_0x16d2f8){const _0x530300=this['_formView']['errorView']['text'];_0x72dd28['announce'](i(_0x3b205d,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x530300));}});}['_onExecute'](_0x2e55ac){const _0x1727c9=this['_commandDefinitions']['get'](_0x2e55ac),_0x2f49b2=this['editor'],_0x13f353=_0x2f49b2['model']['document']['selection'],_0x5baa88=_0x2f49b2['commands']['get']('showAIAssistant'),_0xb82712=_0x2f49b2['plugins']['get'](a),_0xc74944=''+(_0x1727c9['groupId']!==x?_0x1727c9['groupLabel']+':\x20':'')+_0x1727c9['label'];if(!0x1!==_0x1727c9['requiresContent']&&_0x13f353['isCollapsed']){const _0x4a3aaa=_0x4c7b68(_0x13f353['getSelectedBlocks']())||_0x2f49b2['model']['schema']['getLimitElement'](_0x13f353);_0x2f49b2['model']['change'](_0x57b9a6=>{_0x57b9a6['setSelection'](_0x4a3aaa,'in');});}_0xb82712['showFakeVisualSelection'](),_0x5baa88['execute'](_0x1727c9['prompt'],_0xc74944,'command:'+_0x2e55ac);}['_populateMenuBarMenu'](_0x53101f,_0x1d8275,_0x405f30,_0x2ea096){const _0x317409=this['editor'],_0x283323=_0x317409['locale'],_0x41c0e6=new _0x27cfab(_0x283323),_0x4beb01=U(_0x317409,_0x405f30)['filter'](_0x435709=>_0x435709['commands']['length']);0x1===_0x4beb01['length']?this['_getMenuBarGroupButtons']({'command':_0x53101f,'commands':_0x4beb01[0x0]['commands'],'parentMenuView':_0x1d8275,'onExecute':_0x2ea096})['forEach'](_0x3693bb=>_0x41c0e6['items']['add'](_0x3693bb)):_0x4beb01['forEach'](({groupId:_0x317777,groupLabel:_0x532111,commands:_0x4bdc84})=>{const _0x3d039a=new _0x202b41(_0x283323,_0x1d8275),_0x285497=new _0x26dcd7(_0x283323),_0x52db42=new _0x27cfab(_0x283323),_0x2bc92e=this['_getMenuBarGroupButtons']({'command':_0x53101f,'commands':_0x4bdc84,'parentMenuView':_0x285497,'onExecute':_0x2ea096});_0x285497['buttonView']['set']({'label':_0x532111||_0x317777}),_0x285497['delegate']('execute')['to'](_0x1d8275),_0x52db42['items']['addMany'](_0x2bc92e),_0x285497['panelView']['children']['add'](_0x52db42),_0x3d039a['children']['add'](_0x285497),_0x41c0e6['items']['add'](_0x3d039a);}),_0x1d8275['panelView']['children']['add'](_0x41c0e6);}['_getMenuBarGroupButtons']({command:_0x39a4a7,commands:_0x2562df,parentMenuView:_0x1a0969,onExecute:_0x27672f}){const _0x8714b4=this['editor'],_0x13ab5a=_0x8714b4['locale'];return U(_0x8714b4,_0x2562df)['map'](_0x2788ed=>{const _0x45db1d=new _0x202b41(_0x13ab5a,_0x1a0969),_0x4bd6f1=new _0x841fe8(_0x13ab5a);return _0x4bd6f1['set']({'label':_0x2788ed['label']}),_0x4bd6f1['delegate']('execute')['to'](_0x1a0969),_0x4bd6f1['on']('execute',()=>_0x27672f(_0x2788ed['id'])),_0x4bd6f1['bind']('isEnabled')['to'](_0x39a4a7,'enabledCommandsIds',_0x134050=>_0x134050['includes'](_0x2788ed['id'])),_0x45db1d['children']['add'](_0x4bd6f1),_0x45db1d;});}}function B(_0x5a29fa,_0x3d0a33){return void 0x0!==_0x5a29fa['order']&&void 0x0===_0x3d0a33['order']?0x1:void 0x0===_0x5a29fa['order']&&void 0x0!==_0x3d0a33['order']?-0x1:void 0x0!==_0x5a29fa['order']&&void 0x0!==_0x3d0a33['order']?_0x5a29fa['order']-_0x3d0a33['order']:0x0;}function U(_0x16c934,_0x506f79){_0x506f79['sort'](B);const _0x56aae4={},_0xd03570=[];for(const _0x5af433 of _0x506f79)if(void 0x0!==_0x5af433['order']){if(_0x5af433['order']in _0x56aae4)throw new _0x149dfa('ai-commands-config-order-collision',_0x16c934,{'conflictingDefinitions':[_0x5af433,_0x56aae4[_0x5af433['order']]]});_0x56aae4[_0x5af433['order']]=_0x5af433,_0xd03570['splice'](_0x5af433['order'],0x0,_0x5af433);}else _0xd03570['push'](_0x5af433);return _0xd03570;}class r extends _0x1e8a11{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xdbdb03){super(_0xdbdb03);const _0x18a097=_0xdbdb03['config'],_0x10f219=_0xdbdb03['locale'];_0x18a097['define']('ai.aiAssistant.preserveComments',!0x0),_0x18a097['define']('ai.aiAssistant.commands',function(_0x2ef590){return[{'groupId':'editOrReview','groupLabel':i(_0x2ef590,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x2ef590,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x2ef590,'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(_0x2ef590,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x2ef590,'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(_0x2ef590,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x2ef590,'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(_0x2ef590,'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(_0x2ef590,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x2ef590,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x2ef590,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x2ef590,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x2ef590,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x2ef590,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x2ef590,'Change\x20style'),'commands':[{'id':'business','label':i(_0x2ef590,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x2ef590,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x2ef590,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x2ef590,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x2ef590,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x2ef590,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x2ef590,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x2ef590,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x2ef590,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x2ef590,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x2ef590,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x2ef590,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x2ef590,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x10f219)),_0x18a097['define']('ai.aiAssistant.extraCommandGroups',[]),_0x18a097['define']('ai.aiAssistant.removeCommands',[]);let _0x3822ab=o(_0x18a097['get']('ai.aiAssistant.commands'),_0x10f219);const _0xa67db1=_0x18a097['get']('ai.aiAssistant.extraCommandGroups'),_0x691d71=_0x18a097['get']('ai.aiAssistant.removeCommands');_0xa67db1['forEach'](_0x4a9837=>{const _0x5b11c1=_0x3822ab['find'](_0x4b582c=>_0x4b582c['groupId']===_0x4a9837['groupId']);_0x5b11c1?_0x5b11c1['commands']=_0x5b11c1['commands']['concat'](_0x4a9837['commands']):_0x3822ab['push'](_0x4a9837);}),_0x3822ab=_0x3822ab['filter'](_0x319382=>!_0x691d71['includes'](_0x319382['groupId'])),_0x3822ab['forEach'](_0x3ce5e7=>{_0x3ce5e7['commands']=_0x3ce5e7['commands']['filter'](_0x3d2e69=>!_0x691d71['includes'](_0x3d2e69['id']));}),_0x18a097['set']('ai.aiAssistant.commands',_0x3822ab);}}class P extends _0x1e8a11{['abortController'];static get['requires'](){return[E];}constructor(_0x54d109){super(_0x54d109),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x17436c){return this['sendRequest'](_0x17436c)['catch'](_0x17564f=>{if(_0x17564f instanceof R)return Promise['reject'](_0x17564f);if('AbortError'==_0x17564f['name'])return Promise['resolve']();throw console['error'](_0x17564f),new _0x149dfa('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4e015f,_0x1a9e59){const _0x14b60d=this['editor']['locale'],_0x2fcdd1={'Content-Type':'application/json'};if('object'==typeof _0x4e015f)Object['assign'](_0x2fcdd1,_0x4e015f);else{if(_0x4e015f)try{const _0x41002d=await _0x4e015f(_0x1a9e59);Object['assign'](_0x2fcdd1,_0x41002d);}catch{return Promise['reject'](new R(i(_0x14b60d,'AI_ERROR_GET_HEADERS')));}}return _0x2fcdd1;}async['_prepareRequestParameters'](_0x229d5a,_0x1d503b){const _0x533ab8=this['editor']['locale'];if('object'==typeof _0x229d5a)return _0x229d5a;try{return await _0x229d5a(_0x1d503b);}catch{return Promise['reject'](new R(i(_0x533ab8,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4b7f05){super(_0x4b7f05),_0x4b7f05['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4b7f05['config']['get']('ai.openAI.requestParameters')||_0x4b7f05['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4b7f05['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4b7f05['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4b7f05['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x5cbc81,context:_0x5ea50c,onData:_0x2680d7,actionId:_0x4097d2}){const _0x3febbf=this['editor']['locale'],_0x2adbd1=await this['prepareMessages'](_0x5cbc81,_0x5ea50c,_0x4097d2),_0xc1f6e3=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4097d2),_0x106f49=await this['_prepareRequestParameters'](this['_requestParameters'],_0x4097d2),_0xf58571={'messages':_0x2adbd1,..._0x106f49},_0x186499={'method':'POST','headers':_0xc1f6e3,'body':JSON['stringify'](_0xf58571),'signal':this['abortController']['signal']},_0x43deb6=await fetch(this['_apiUrl'],_0x186499);if(_0x43deb6['ok'])return _0x106f49['stream']?await this['_readStreamableResponse'](_0x43deb6,_0x2680d7):await this['_readStaticResponse'](_0x43deb6,_0x2680d7),Promise['resolve']();{const _0x50753c=await _0x43deb6['text']();return _0x50753c['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x3febbf,'AI_ERROR_CONTEXT_LENGTH'))):_0x50753c['includes']('Moderation')?Promise['reject'](new R(i(_0x3febbf,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x50753c));}}async['prepareMessages'](_0x1ee360,_0x13c2b6,_0x305233){let _0x53d7dc,_0x256abd;return _0x13c2b6?(_0x53d7dc='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.',_0x256abd='Instruction:\x0a'+_0x1ee360+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x13c2b6):(_0x53d7dc='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.',_0x256abd=_0x1ee360),[{'role':'system','content':_0x53d7dc},{'role':'user','content':_0x256abd}];}async['_readStreamableResponse'](_0x196b02,_0xeb93c9){const _0x38b5a6=_0x196b02['body']['getReader'](),_0x666163=new TextDecoder();let _0x1b308c='',_0x372924='',_0x2f6d35='',_0x33e03b=!0x1;for(;!_0x33e03b;){const {done:_0x12aa04,value:_0x273e61}=await _0x38b5a6['read'](),_0x952365=_0x1b308c+_0x666163['decode'](_0x273e61);let _0x1d1a7f='';_0x33e03b=_0x12aa04;try{_0x1d1a7f=this['_cleanUpData'](_0x952365),_0x1b308c='';}catch{_0x1b308c=_0x952365;continue;}_0x372924+=_0x1d1a7f,!_0x33e03b&&this['_isBufferIncomplete'](_0x372924)||_0x372924&&(_0x2f6d35+=_0x372924,_0x372924='',_0xeb93c9(_0x2f6d35));}return Promise['resolve']();}async['_readStaticResponse'](_0x1f1dc1,_0x272372){return _0x272372((await _0x1f1dc1['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x232c44){const _0xbf82d2=_0x232c44['split']('<')['length']!==_0x232c44['split']('>')['length'],_0x54dbe8=_0x232c44['length']<0x1e;return _0xbf82d2&&_0x54dbe8;}['_cleanUpData'](_0x38f156){return _0x38f156['split'](/\n(?![^{]*\})/g)['map'](_0xda940f=>_0xda940f['replace']('data:\x20',''))['filter'](_0x1510f0=>_0x1510f0&&_0x1510f0['length']>0x0&&'[DONE]'!==_0x1510f0)['map'](_0x335721=>{const {choices:_0x44d9e0}=JSON['parse'](_0x335721);if(_0x44d9e0[0x0]?.['delta']?.['content'])return _0x44d9e0[0x0]['delta']['content'];})['filter'](_0x3813c0=>_0x3813c0)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5d0bfb){super(_0x5d0bfb),_0x5d0bfb['config']['get']('ai.aws.requestParameters')||_0x5d0bfb['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']=_0x5d0bfb['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5d0bfb['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5d0bfb['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5d0bfb['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5cd96f,context:_0x250b8f,onData:_0x29e893,actionId:_0x58f04b}){const {model:_0x497660,stream:_0x455e0f,..._0x4fd187}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x58f04b),_0x32c4df={'prompt':await this['preparePrompt'](_0x5cd96f,_0x250b8f,_0x497660,_0x58f04b),..._0x4fd187};this['_apiUrl']?await this['_processProxyRequest'](_0x32c4df,_0x497660,_0x455e0f,_0x29e893,_0x58f04b):await this['_processAWSRequest'](_0x32c4df,_0x497660,_0x455e0f,_0x29e893);}async['preparePrompt'](_0x553760,_0x49cfce,_0x24fd47,_0xb71793){let _0x4d3db7,_0x26b0af;return _0x49cfce?(_0x4d3db7='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.',_0x26b0af='Instruction:\x0a'+_0x553760+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x49cfce):(_0x4d3db7='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.',_0x26b0af=_0x553760),'meta.llama'==this['getModelFamily'](_0x24fd47)?'<<SYS>>\x0a'+_0x4d3db7+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x26b0af+'\x0a[/INST]':'Human:\x0a'+_0x4d3db7+'\x0a'+_0x26b0af+'\x0a\x0aAssistant:';}['getModelFamily'](_0x100a41){if(/^anthropic\.claude/['test'](_0x100a41))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x100a41))return'ai21.j2';if(/^cohere\.command/['test'](_0x100a41))return'cohere.command';if(/^meta\.llama/['test'](_0x100a41))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x100a41));}async['_processProxyRequest'](_0x1c77c3,_0x3af2a4,_0x5c96cd,_0x39bb5c,_0x4101c5){const _0x1bae64={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x4101c5),'body':JSON['stringify']({..._0x1c77c3,'model':_0x3af2a4,'stream':_0x5c96cd}),'signal':this['abortController']['signal']},_0x316c56=await fetch(this['_apiUrl'],_0x1bae64);_0x5c96cd?await this['_readStreamableResponse'](_0x316c56,_0x3af2a4,_0x39bb5c):await this['_readStaticResponse'](_0x316c56,_0x3af2a4,_0x39bb5c);}async['_processAWSRequest'](_0x8e9600,_0x18d071,_0x3b4f97,_0x38e06a){const _0x46e28d=new _0x57a40a(this['_bedrockClientConfig']),_0x49d478={'body':JSON['stringify'](_0x8e9600),'contentType':'application/json','accept':'application/json','modelId':_0x18d071};let _0x3cf8c9;if(_0x3b4f97){const _0x37fe56=new _0x14d061(_0x49d478);_0x3cf8c9=await _0x46e28d['send'](_0x37fe56,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3cf8c9,_0x18d071,_0x38e06a);}else{const _0x433d0f=new _0x2824dd(_0x49d478);_0x3cf8c9=await _0x46e28d['send'](_0x433d0f,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3cf8c9,_0x18d071,_0x38e06a);}}async['_readAsyncIterableResponse'](_0x48a324,_0xca4359,_0x138efa){const _0x2a0886=_0x48a324['body'],_0x411af5=new TextDecoder('utf-8');let _0x29afef='';for await(const _0x17d434 of _0x2a0886)if(_0x17d434['chunk']){const _0x5604b4=_0x411af5['decode'](_0x17d434['chunk']['bytes']),_0xbf0175=JSON['parse'](_0x5604b4);_0x29afef+=this['_getGeneratedText'](_0xbf0175,_0xca4359),_0x138efa(_0x29afef);}return Promise['resolve']();}async['_readStreamableResponse'](_0x506072,_0x4c0acf,_0x459984){const _0x280845=_0x506072['body'],_0x22de11=new TextDecoder('utf-8'),_0x60496d=_0x280845['getReader']();let _0x1a846b='',_0x5d6b3c='',_0x52603f=!0x1;for(;!_0x52603f;){const {done:_0x427219,value:_0x1341e4}=await _0x60496d['read']();if(_0x52603f=_0x427219,_0x52603f)break;const _0x5380ea=(_0x1a846b+_0x22de11['decode'](_0x1341e4))['split']('\x0a')['map'](_0x3613fe=>{try{return _0x1a846b='',JSON['parse'](_0x3613fe);}catch{return _0x1a846b=_0x3613fe,null;}})['filter'](_0x3ca423=>null!==_0x3ca423);_0x5380ea['length']&&(_0x5d6b3c+=_0x5380ea['map'](_0x3aaa94=>this['_getGeneratedText'](_0x3aaa94,_0x4c0acf))['join'](''),_0x459984(_0x5d6b3c));}return Promise['resolve']();}async['_readStaticResponse'](_0x30c70e,_0x3c8624,_0x36723c){let _0x3b66c6;return _0x3b66c6=_0x30c70e instanceof Response?await _0x30c70e['json']():JSON['parse'](Buffer['from'](_0x30c70e['body'])['toString']('utf8')),(_0x36723c(this['_getGeneratedText'](_0x3b66c6,_0x3c8624)),Promise['resolve']());}['_getGeneratedText'](_0x2658f9,_0x41df50){switch(this['getModelFamily'](_0x41df50)){case'anthropic.claude':return _0x2658f9['completion'];case'ai21.j2':return _0x2658f9['completions'][0x0]['data']['text'];case'cohere.command':return _0x2658f9['generations'][0x0]['text'];case'meta.llama':return _0x2658f9['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
|
|
23
|
+
import{Plugin as _0x1e2b58,Command as _0x47a6d3}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x2ddf29,IconCheck as _0x13e6e8,IconError as tt,IconSubmit as ht,IconHistory as et,IconMagicWand as _0x3c14dd,IconRobotPencil as _0x1a4d4e}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x4c5d0a,CKEditorError as _0x271694,ObservableMixin as _0x2da1bc,global as _0x19855c,isVisible as ot,Rect as it,Collection as _0x1ff90d,FocusTracker as mt,KeystrokeHandler as ut,first as _0x5a0ab6}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as at,ButtonView as _0x3c3b6c,View as _0x126e09,SpinnerView as _0x70fd7d,IconView as rt,AutocompleteView as nt,ListView as Ct,ListItemGroupView as Ht,ListItemView as xt,ButtonLabelView as kt,FocusCycler as pt,createLabeledTextarea as dt,Dialog as _0x3458e5,createDropdown as _0x52e179,addMenuToDropdown as _0x5d11f4,MenuBarMenuView as _0x257147,MenuBarMenuListItemButtonView as _0x29430b,DialogViewPosition as _0xba30db,MenuBarMenuListView as _0x1cb3da,MenuBarMenuListItemView as _0x54032c}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x1e10a4,ClipboardMarkersUtils as _0x5f2f58}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{DomEventData as _0x32a673,DataTransfer as _0x4dc71,UpcastWriter as _0x3766df,Matcher as _0x50216e}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as jt,escape as yt}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x2fa226,InvokeModelWithResponseStreamCommand as _0x35d92d,InvokeModelCommand as _0x3eb9e5}from'@aws-sdk/client-bedrock-runtime';const x='_ungrouppedCommands';function o(_0x570115,_0x48fb3a){const _0x5ce2a2=(0x0,_0x48fb3a['t'])('Other');return _0x570115['length']?'groupId'in _0x570115[0x0]?_0x570115:[{'groupId':x,'groupLabel':_0x5ce2a2,'order':0x1/0x0,'commands':_0x570115}]:[{'groupId':x,'groupLabel':_0x5ce2a2,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],f='ai-ui';class a extends _0x1e2b58{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1cff98}=this,_0x471ab3=['ck-fake-ai-selection'];_0x1cff98['config']['get']('ai.useTheme')&&_0x471ab3['push']('ck-ai-assistant-ui_theme'),_0x1cff98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':f,'view':{'classes':_0x471ab3,'priority':0xc}}),_0x1cff98['conversion']['for']('editingDowncast')['markerToElement']({'model':f,'view':(_0x221e5d,{writer:_0x5481d1})=>{if(!_0x221e5d['markerRange']['isCollapsed'])return null;const _0x37dc00=_0x5481d1['createUIElement']('span');return _0x5481d1['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x37dc00),_0x37dc00;}});}['afterInit'](){!async function(_0xafacf8){const _0x2ffe47=_0x494760([0x75,0x4a,0x41,0x37,0x57,0x67,0x72,0x70,0x6e,0x6f,0x51,0x38,0x34,0x4d,0x43,0x31,0x62,0x79,0x49,0x63,0x59,0x74,0x4f,0x76,0x45,0x44,0x5a,0x61,0x50,0x36,0x4b,0x33,0x58,0x68,0x6a,0x53,0x56,0x54,0x30,0x69,0x46,0x7a,0x35,0x42,0x73,0x6b,0x65,0x48,0x47,0x39,0x77,0x32,0x4e,0x71,0x6d,0x52,0x78,0x55,0x4c,0x6c,0x64,0x66]),_0x4a5cb0=0x12fedfd5,_0x1661b3=0x12f9b4b5^_0x4a5cb0,_0x503f5d=window[_0x494760([0x44,0x61,0x74,0x65])][_0x494760([0x6e,0x6f,0x77])](),_0x4892de=_0xafacf8[_0x494760([0x65,0x64,0x69,0x74,0x6f,0x72])],_0xf0d644=new window[(_0x494760([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x50d4e4=>{_0x4892de[_0x494760([0x6f,0x6e,0x63,0x65])](_0x494760([0x72,0x65,0x61,0x64,0x79]),_0x50d4e4);}),_0x28cf4f={[_0x494760([0x6b,0x74,0x79])]:_0x494760([0x45,0x43]),[_0x494760([0x75,0x73,0x65])]:_0x494760([0x73,0x69,0x67]),[_0x494760([0x63,0x72,0x76])]:_0x494760([0x50,0x2d,0x32,0x35,0x36]),[_0x494760([0x78])]:_0x494760([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]),[_0x494760([0x79])]:_0x494760([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]),[_0x494760([0x61,0x6c,0x67])]:_0x494760([0x45,0x53,0x32,0x35,0x36])},_0x31504f=_0x4892de[_0x494760([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x494760([0x67,0x65,0x74])](_0x494760([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x1274c0(){let _0x21ed10,_0x3b680e=null,_0x3d1e37=null;try{if(_0x31504f==_0x494760([0x47,0x50,0x4c]))return _0x494760([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x21ed10=_0x29f984(),!_0x21ed10)return _0x494760([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x21ed10[_0x494760([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3d1e37=_0x4e5a8e(_0x21ed10[_0x494760([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x21ed10[_0x494760([0x6a,0x74,0x69])])),await _0x57d924()?_0x2ea941()?_0x1b1ea2()?_0x494760([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4fb781()?(_0x21ed10[_0x494760([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x494760([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x3b680e=_0x4c3af8(_0x494760([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x21ed10[_0x494760([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x494760([0x74,0x72,0x69,0x61,0x6c])&&(_0x3b680e=_0x4c3af8(_0x494760([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3e1f20()):_0x494760([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x494760([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x494760([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x494760([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x1b1ea2(){const _0x2bb48f=[_0x494760([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x494760([0x74,0x72,0x69,0x61,0x6c])][_0x494760([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21ed10[_0x494760([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x503f5d/0x3e8:0xe10*_0x1661b3;return _0x21ed10[_0x494760([0x65,0x78,0x70])]<_0x2bb48f;}function _0x2ea941(){const _0x3b5e68=_0x21ed10[_0x494760([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3b5e68&&(!!_0x3b5e68[_0x494760([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x494760([0x2a]))||!!_0x3b5e68[_0x494760([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x494760([0x41,0x49])));}function _0x4fb781(){const _0x1f6991=_0x21ed10[_0x494760([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x1f6991||0x0==_0x1f6991[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x30325f}=new URL(window[_0x494760([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x1f6991[_0x494760([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x30325f))return!0x0;const _0x5161c4=_0x30325f[_0x494760([0x73,0x70,0x6c,0x69,0x74])](_0x494760([0x2e]));return _0x1f6991[_0x494760([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x57e771=>_0x57e771[_0x494760([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x494760([0x2a])))[_0x494760([0x6d,0x61,0x70])](_0x49483c=>_0x49483c[_0x494760([0x73,0x70,0x6c,0x69,0x74])](_0x494760([0x2e])))[_0x494760([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3ce89e=>_0x3ce89e[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5161c4[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x494760([0x6d,0x61,0x70])](_0x2332f0=>Array(_0x5161c4[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2332f0[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x494760([0x66,0x69,0x6c,0x6c])](_0x2332f0[0x0]===_0x494760([0x2a])?_0x494760([0x2a]):'')[_0x494760([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2332f0))[_0x494760([0x73,0x6f,0x6d,0x65])](_0x379b4f=>_0x5161c4[_0x494760([0x65,0x76,0x65,0x72,0x79])]((_0x9a456c,_0x393ed4)=>_0x379b4f[_0x393ed4]===_0x9a456c||_0x379b4f[_0x393ed4]===_0x494760([0x2a])));}function _0x3e1f20(){return _0x3b680e&&_0x3d1e37?new window[(_0x494760([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1b0280,_0x1b3316)=>{_0x3b680e[_0x494760([0x74,0x68,0x65,0x6e])](_0x1b0280,_0x1b3316),_0x3d1e37[_0x494760([0x74,0x68,0x65,0x6e])](_0x1f9ebe=>{_0x1f9ebe!=_0x494760([0x56,0x61,0x6c,0x69,0x64])&&_0x1b0280(_0x1f9ebe);},_0x1b3316);}):_0x3b680e||_0x3d1e37||_0x494760([0x56,0x61,0x6c,0x69,0x64]);}}function _0x4e5a8e(_0x46c8f1,_0x1ceb40){return new window[(_0x494760([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x32dbb8=>{if(_0x231490())return _0x32dbb8(_0x494760([0x56,0x61,0x6c,0x69,0x64]));_0x3a6d5c(),_0x4892de[_0x494760([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x494760([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x4cbae5=!0x1;const _0x467d25=_0x4c5d0a();function _0x4d2070(_0x42cbc9){return!!_0x42cbc9&&(typeof _0x42cbc9===_0x494760([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x42cbc9===_0x494760([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x42cbc9[_0x494760([0x74,0x68,0x65,0x6e])]===_0x494760([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x42cbc9[_0x494760([0x63,0x61,0x74,0x63,0x68])]===_0x494760([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x536666(_0x511188){_0x24d8dd(_0x511188)[_0x494760([0x74,0x68,0x65,0x6e])](_0x1c32c5=>{if(!_0x1c32c5||_0x1c32c5[_0x494760([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x494760([0x6f,0x6b]))return _0x494760([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x33c6f7(_0x1ce23d(_0x467d25+_0x1ceb40))!=_0x1c32c5[_0x494760([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x494760([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x494760([0x56,0x61,0x6c,0x69,0x64]);})[_0x494760([0x74,0x68,0x65,0x6e])](_0x5e93d7=>(_0x388d2d(),_0x5e93d7),()=>{const _0x52337e=_0x2f7bf2();return null==_0x52337e?(_0x388d2d(),_0x494760([0x56,0x61,0x6c,0x69,0x64])):_0x494760(_0x503f5d-_0x52337e>(0x36f25bd5^_0x4a5cb0)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x494760([0x74,0x68,0x65,0x6e])](_0x32dbb8)[_0x494760([0x63,0x61,0x74,0x63,0x68])](()=>{_0x32dbb8(_0x494760([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xf3ce14=0x12c83155^_0x4a5cb0;function _0x388d2d(){const _0x31efe1=_0x494760([0x6c,0x6c,0x63,0x74,0x2d])+_0x33c6f7(_0x1ce23d(_0x46c8f1)),_0xf653cf=_0x4e9f14(_0x33c6f7(window[_0x494760([0x4d,0x61,0x74,0x68])][_0x494760([0x63,0x65,0x69,0x6c])](_0x503f5d/_0xf3ce14)));window[_0x494760([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x494760([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x31efe1,_0xf653cf);}function _0x2f7bf2(){const _0x1b70a0=_0x494760([0x6c,0x6c,0x63,0x74,0x2d])+_0x33c6f7(_0x1ce23d(_0x46c8f1)),_0x2512d4=window[_0x494760([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x494760([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1b70a0);return _0x2512d4?window[_0x494760([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4e9f14(_0x2512d4),0x10)*_0xf3ce14:null;}function _0x24d8dd(_0x3d79bd){return new window[(_0x494760([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x12b532,_0x3bdf25)=>{_0x3d79bd[_0x494760([0x74,0x68,0x65,0x6e])](_0x12b532,_0x3bdf25),window[_0x494760([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3bdf25,0x12ff0b15^_0x4a5cb0);});}}_0x4892de[_0x494760([0x6f,0x6e])](_0x494760([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2bfef3,_0xa264b8)=>{if(_0xa264b8[0x0]!=_0x46c8f1)return _0x32dbb8(_0x494760([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0xa264b8[0x1]={..._0xa264b8[0x1],[_0x494760([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x467d25};},{[_0x494760([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x494760([0x68,0x69,0x67,0x68])}),_0x4892de[_0x494760([0x6f,0x6e])](_0x494760([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x4776f0=>{_0x4d2070(_0x4776f0[_0x494760([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x4cbae5=!0x0,_0x536666(_0x4776f0[_0x494760([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x494760([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x494760([0x6c,0x6f,0x77])}),_0xf0d644[_0x494760([0x74,0x68,0x65,0x6e])](()=>{_0x4cbae5||_0x32dbb8(_0x494760([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x231490(){return _0x4892de[_0x494760([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x494760([0x76,0x69,0x65,0x77])][_0x494760([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x494760([0x61,0x75,0x74,0x6f]);}function _0x3a6d5c(){_0x4892de[_0x494760([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x494760([0x76,0x69,0x65,0x77])][_0x494760([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x494760([0x61,0x75,0x74,0x6f]);}}function _0x4c3af8(_0x2e7184){const _0x35b7cb=[new window[(_0x494760([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x240ca0=>setTimeout(_0x240ca0,0x12f7e119^_0x4a5cb0)),_0xf0d644[_0x494760([0x74,0x68,0x65,0x6e])](()=>new window[(_0x494760([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0xbd66ed=>{let _0x1b8435=0x0;_0x4892de[_0x494760([0x6d,0x6f,0x64,0x65,0x6c])][_0x494760([0x6f,0x6e])](_0x494760([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4eb082,_0xdb9f36)=>{_0xdb9f36[0x0][_0x494760([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x1b8435++,_0x1b8435==(0x12fede2d^_0x4a5cb0)&&(_0xbd66ed(),_0x4eb082[_0x494760([0x6f,0x66,0x66])]());});}))];return window[_0x494760([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x494760([0x72,0x61,0x63,0x65])](_0x35b7cb)[_0x494760([0x74,0x68,0x65,0x6e])](()=>_0x2e7184);}async function _0x255a74(){await _0xf0d644,_0x4892de[_0x494760([0x6d,0x6f,0x64,0x65,0x6c])][_0x494760([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x255088,_0x4892de[_0x494760([0x6d,0x6f,0x64,0x65,0x6c])][_0x494760([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x255088,_0x4892de[_0x494760([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x494760([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x51752e(_0x5b9e3d){const _0xf274f5=_0x324ff1();_0x4892de[_0xf274f5]=_0x494760([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x5b9e3d,_0x5b9e3d!=_0x494760([0x56,0x61,0x6c,0x69,0x64])&&_0x255a74();}function _0x324ff1(){const _0x389de2=window[_0x494760([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x494760([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x494760([0x6e,0x6f,0x77])]())[_0x494760([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x494760([0x2e]),'');let _0x30f885=_0x494760([0x75]);for(let _0x55a733=0x0;_0x55a733<_0x389de2[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x55a733+=0x2){let _0x251d5a=window[_0x494760([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x389de2[_0x494760([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x55a733,_0x55a733+0x2));_0x251d5a>=_0x2ffe47[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x251d5a-=_0x2ffe47[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x30f885+=_0x2ffe47[_0x251d5a];}return _0x30f885;}function _0x29f984(){const _0x20d928=_0x31504f[_0x494760([0x73,0x70,0x6c,0x69,0x74])](_0x494760([0x2e]));if(0x3!=_0x20d928[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x20ff23(_0x20d928[0x1]);function _0x20ff23(_0x3b7461){const _0x384a65=_0x4b5221(_0x3b7461);return _0x384a65&&_0x30314f()?_0x384a65:null;function _0x30314f(){const _0x4f7429=_0x384a65[_0x494760([0x6a,0x74,0x69])],_0x320e8b=window[_0x494760([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4f7429[_0x494760([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4f7429[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x586d5a={..._0x384a65,[_0x494760([0x6a,0x74,0x69])]:_0x4f7429[_0x494760([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4f7429[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x586d5a[_0x494760([0x76,0x63])],_0x1ce23d(_0x586d5a)==_0x320e8b;}}}async function _0x57d924(){let _0x47a0a9=!0x0;try{const _0x19510c=_0x31504f[_0x494760([0x73,0x70,0x6c,0x69,0x74])](_0x494760([0x2e])),[_0x8ba395,_0x55bda2,_0x398035]=_0x19510c;return _0x3695e5(_0x8ba395),await _0x53a846(_0x8ba395,_0x55bda2,_0x398035),_0x47a0a9;}catch{return!0x1;}function _0x3695e5(_0x429bf3){const _0x3cd190=_0x4b5221(_0x429bf3);_0x3cd190&&_0x3cd190[_0x494760([0x61,0x6c,0x67])]==_0x494760([0x45,0x53,0x32,0x35,0x36])||(_0x47a0a9=!0x1);}async function _0x53a846(_0x268f23,_0x59f18f,_0x20082b){const _0x2bb167=window[_0x494760([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x494760([0x66,0x72,0x6f,0x6d])](_0x2c9c16(_0x20082b),_0x4ba1fe=>_0x4ba1fe[_0x494760([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x180b3f=new window[(_0x494760([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x494760([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x268f23+_0x494760([0x2e])+_0x59f18f),_0x396fff=window[_0x494760([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x494760([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x396fff)return;const _0x2cd400=await _0x396fff[_0x494760([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x494760([0x6a,0x77,0x6b]),_0x28cf4f,{[_0x494760([0x6e,0x61,0x6d,0x65])]:_0x494760([0x45,0x43,0x44,0x53,0x41]),[_0x494760([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x494760([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x494760([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x396fff[_0x494760([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x494760([0x6e,0x61,0x6d,0x65])]:_0x494760([0x45,0x43,0x44,0x53,0x41]),[_0x494760([0x68,0x61,0x73,0x68])]:{[_0x494760([0x6e,0x61,0x6d,0x65])]:_0x494760([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2cd400,_0x2bb167,_0x180b3f)||(_0x47a0a9=!0x1);}}function _0x4b5221(_0x250537){return _0x250537[_0x494760([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x494760([0x65,0x79]))?JSON[_0x494760([0x70,0x61,0x72,0x73,0x65])](_0x2c9c16(_0x250537)):null;}function _0x2c9c16(_0x1e2382){return window[_0x494760([0x61,0x74,0x6f,0x62])](_0x1e2382[_0x494760([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x494760([0x2b]))[_0x494760([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x494760([0x2f])));}function _0x1ce23d(_0x24909e){let _0x3dbf85=0x1505;function _0x1bcec3(_0x30a725){for(let _0x115192=0x0;_0x115192<_0x30a725[_0x494760([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x115192++){const _0x512cc9=_0x30a725[_0x494760([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x115192);_0x3dbf85=(_0x3dbf85<<0x5)+_0x3dbf85+_0x512cc9,_0x3dbf85&=_0x3dbf85;}}function _0x3986e0(_0x6f088b){Array[_0x494760([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x6f088b)?_0x6f088b[_0x494760([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x3986e0):_0x6f088b&&typeof _0x6f088b==_0x494760([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x494760([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x6f088b)[_0x494760([0x73,0x6f,0x72,0x74])]()[_0x494760([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x270e20,_0x294cdd])=>{_0x1bcec3(_0x270e20),_0x3986e0(_0x294cdd);}):_0x1bcec3(window[_0x494760([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x6f088b));}return _0x3986e0(_0x24909e),_0x3dbf85>>>0x0;}function _0x33c6f7(_0x188ec0){return _0x188ec0[_0x494760([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x494760([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x494760([0x30]));}function _0x4e9f14(_0x4d27c9){return _0x4d27c9[_0x494760([0x73,0x70,0x6c,0x69,0x74])]('')[_0x494760([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x494760([0x6a,0x6f,0x69,0x6e])]('');}function _0x255088(){}function _0x494760(_0x2a2d36){return _0x2a2d36['map'](_0x4efd8a=>String['fromCharCode'](_0x4efd8a))['join']('');}_0x51752e(await _0x1274c0());}(this);}['showFakeVisualSelection'](){const _0x1f62f4=this['editor']['model'];_0x1f62f4['change'](_0x3e319a=>{const _0x1be811=_0x1f62f4['document']['selection']['getRanges']();let _0xa2f271=0x0;for(const _0x57e4b9 of _0x1be811){const _0x324c4f=f+':'+_0xa2f271;if(_0x1f62f4['markers']['has'](_0x324c4f))_0x3e319a['updateMarker'](_0x324c4f,{'range':_0x57e4b9});else{if(_0x57e4b9['start']['isAtEnd']){const _0x2dc2fc=_0x57e4b9['start']['getLastMatchingPosition'](({item:_0x593fd2})=>!_0x1f62f4['schema']['isContent'](_0x593fd2),{'boundaries':_0x57e4b9});_0x3e319a['addMarker'](_0x324c4f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x3e319a['createRange'](_0x2dc2fc,_0x57e4b9['end'])});}else _0x3e319a['addMarker'](_0x324c4f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x57e4b9});}_0xa2f271++;}});}['hideFakeVisualSelection'](){const _0xdba998=this['editor']['model'],_0x110351=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](f));_0x110351['length']&&_0xdba998['change'](_0x580eb1=>{_0x110351['forEach'](_0x3f3983=>{_0x580eb1['removeMarker'](_0x3f3983);});});}['insertContent'](_0x3e5576,_0x19c3a7){const _0x516146=this['_getAISelection'](),_0xf130=_0x19c3a7||_0x516146['getFirstRange']();this['editor']['model']['canEditAt'](_0xf130)&&this['editor']['model']['change'](_0x1ebff8=>{this['hideFakeVisualSelection'](),_0x19c3a7||this['_resetContentOfSelectedTableCells'](_0x1ebff8,_0x516146),this['_pasteHTMLUsingClipboard']({'insertAt':_0xf130,'writer':_0x1ebff8,'html':_0x3e5576});});}['insertContentBelow'](_0x2eb283){const {model:_0x3e54f5}=this['editor'],_0x10e696=this['_getAISelection']();_0x3e54f5['change'](()=>{const _0x448bb3=this['_prepareTableInsertBelowPosition'](_0x2eb283,_0x10e696)||this['_getDefaultInsertBelowPosition'](_0x10e696);this['insertContent'](_0x2eb283,_0x448bb3);});}['_getAISelection'](){const _0x1e1569=this['editor']['model'],_0x17f311=Array['from'](_0x1e1569['markers']['getMarkersGroup'](f))['map'](_0x2f9bf3=>_0x2f9bf3['getRange']());return _0x1e1569['createSelection'](_0x17f311);}['_pasteHTMLUsingClipboard']({writer:_0x2d1f2b,html:_0x5a9473,insertAt:_0x32f4d3}){const {view:_0x256ddc}=this['editor']['editing'],_0x58acea=this['editor']['plugins']['get'](_0x1e10a4),_0x51285c=new gt();_0x51285c['setData']('text/html',_0x5a9473);const _0x484aa4=new ClipboardEvent('paste',{'clipboardData':_0x51285c}),_0x1704fb=new _0x32a673(_0x256ddc,_0x484aa4,{'dataTransfer':new _0x4dc71(_0x51285c)});_0x2d1f2b['setSelection'](_0x32f4d3);const _0x1f03c1=(_0x33e688,_0x100978)=>{_0x100978['resultRange']&&_0x2d1f2b['setSelection'](_0x100978['resultRange']);};_0x58acea['once']('contentInsertion',_0x1f03c1,{'priority':'lowest'}),_0x256ddc['document']['fire']('paste',_0x1704fb),_0x58acea['off']('contentInsertion',_0x1f03c1);}['_getDefaultInsertBelowPosition'](_0x577d1a){const {model:_0x166b0b}=this['editor'],_0x1559ca=Array['from'](_0x577d1a['getSelectedBlocks']());return _0x1559ca['length']?_0x166b0b['createPositionAfter'](_0x1559ca['pop']()):_0x577d1a['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x9253f1,_0x5a4e5d){const {model:_0x1c20ea,plugins:_0x16f3bf}=this['editor'];if(_0x16f3bf['has']('TableUtils')){const _0x2cb24c=_0x16f3bf['get']('TableUtils')['getSelectedTableCells'](_0x5a4e5d);if(_0x2cb24c['length']){const _0x208659=this['_getTableRowCountFromContent'](_0x9253f1),_0x30f569=this['_createEmptyTableRows'](_0x2cb24c,_0x208659);return _0x1c20ea['createPositionAt'](_0x30f569,0x0);}}return null;}['_getTableRowCountFromContent'](_0x596aa3){const _0xe53292=this['editor']['plugins']['get']('TableUtils'),_0x461d41=this['editor']['data']['parse'](_0x596aa3),_0x3040a2=Array['from'](_0x461d41['getChildren']())['filter'](_0x260cdd=>_0x260cdd['is']('element','table'));let _0x4ce0c2=0x0;return _0x3040a2['forEach'](_0x419ac4=>{_0x4ce0c2+=_0xe53292['getRows'](_0x419ac4);}),_0x4ce0c2;}['_createEmptyTableRows'](_0x5ecb73,_0x2a5abf){const _0x24b5b1=this['editor']['plugins']['get']('TableUtils'),_0x3b8f4b=_0x24b5b1['getRowIndexes'](_0x5ecb73),_0x352fba=_0x24b5b1['getColumnIndexes'](_0x5ecb73),_0x297e76=_0x3b8f4b['last']+0x1,_0x4bd59b=_0x352fba['first'],_0x4e30d4=_0x5ecb73[0x0]['findAncestor']('table');for(let _0x1cfe98=0x0;_0x1cfe98<_0x2a5abf;_0x1cfe98++)_0x24b5b1['insertRows'](_0x4e30d4,{'at':_0x297e76});return _0x4e30d4['getChild'](_0x297e76)['getChild'](_0x4bd59b);}['_resetContentOfSelectedTableCells'](_0x25551e,_0x564b03){const {plugins:_0x5000d9}=this['editor'],{model:_0x2fdd4e}=_0x25551e;if(!_0x5000d9['has']('TableUtils'))return;_0x5000d9['get']('TableUtils')['getSelectedTableCells'](_0x564b03)['length']&&_0x2fdd4e['deleteContent'](_0x564b03);}}class E extends _0x1e2b58{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x271694('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x57c7ae){super(_0x57c7ae),this['name']='AIRequestError';}}function i(_0x2c1e2f,_0x34e7ba,_0x438251){const t=_0x2c1e2f['t'];switch(_0x34e7ba){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',_0x438251);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x438251);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'},_0x438251);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 _0x34e7ba;}}class j extends _0x47a6d3{['_commandDefinitions'];constructor(_0x31dae4,_0x1f2e99){super(_0x31dae4),this['_commandDefinitions']=_0x1f2e99,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x26db16,_0x4f4cee,_0x3cb2d5)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x3cb2d5));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x53ad98,_0x50bddf,_0x349c8b)=>{this['enabledCommandsIds']=_0x349c8b?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x57e959=this['editor']['model'];this['_hasContext']=function(_0x3207e8){const _0x2b81b9=_0x3207e8['document']['selection'];return _0x2b81b9['isCollapsed']?0x0!==[..._0x2b81b9['getSelectedBlocks']()]['length']&&![..._0x2b81b9['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x3207e8['hasContent'](_0x2b81b9['getFirstRange']());}(_0x57e959);const _0x9cf691=_0x57e959['document']['selection'],_0x27f8da=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x4f3aa7 of _0x9cf691['getRanges']())for(const _0x31e115 of _0x4f3aa7['getItems']())if(_0x31e115['is']('element')&&_0x27f8da['includes'](_0x31e115['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3603cc='',_0x2b4547='',_0x1fd37f='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3603cc,_0x2b4547,_0x1fd37f);}}function G(_0x14904b,_0x2e99c4){const _0xd6a251=new Set();for(const _0x28ee68 of _0x14904b['values']())(_0x2e99c4||!0x1===_0x28ee68['requiresContent'])&&_0xd6a251['add'](_0x28ee68['id']);return Array['from'](_0xd6a251);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class k extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x2da1bc(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x308670,_0x3bbe76,_0x3032ad){super(),this['editor']=_0x308670,this['textAdapter']=_0x3bbe76,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x3032ad,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x4d3dc0,_0x1a0de2,_0x6b7101)=>{this['view']['value']=this['_sanitizeHTML'](_0x6b7101);}),this['listenTo'](this['view'],'submitPrompt',(_0xb98703,_0x3115b6)=>{const _0x2e7f37=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3115b6,_0x2e7f37,'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:_0x37d921,query:_0x3acffc,htmlContent:_0xa2fc72,label:_0x51e472,mainActionLabel:_0x21e474}){this['view']['prompt']=_0x51e472,this['view']['mainAction']=_0x21e474,this['initialContext']=_0xa2fc72,_0x3acffc&&(this['view']['isRendered']?this['_handleQuery'](_0x3acffc,_0xa2fc72,_0x37d921,_0x51e472):this['view']['once']('render',()=>{this['_handleQuery'](_0x3acffc,_0xa2fc72,_0x37d921,_0x51e472);}));}['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'](_0x58e763,_0x882a62,_0x28bf08,_0x57e617){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x882a62,this['previousQuery']=_0x58e763,this['previousLabel']=_0x57e617||_0x58e763,this['previousActionId']=_0x28bf08,new Promise(_0x10672f=>{this['textAdapter']['makeRequest']({'query':_0x58e763,'context':_0x882a62,'onData':_0x468431=>{this['currentResponse']=_0x468431,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x28bf08})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x1fd6ad=>{_0x1fd6ad instanceof R?this['view']['handleError'](_0x1fd6ad['message']):this['view']['handleError'](),_0x10672f();})['finally'](()=>{this['stopProcessing'](),_0x10672f();});});}['_parseAndNormalizeContent'](_0x1eb4e5,_0x58fc81=!0x1){const _0x466d8c=Z['exec'](_0x1eb4e5);_0x1eb4e5=_0x466d8c?_0x1eb4e5['substring'](_0x466d8c[0x1]['length']):_0x1eb4e5['length']<0x64&&!_0x58fc81?'':this['_stripMarkdownSyntax'](_0x1eb4e5);const _0x47900d=this['_domParser']['parseFromString'](_0x1eb4e5,'text/html');if(_0x466d8c){const _0x5503bb=Array['from'](_0x47900d['body']['childNodes']);_0x5503bb['reverse']();for(const _0x37a90e of _0x5503bb){if(_0x37a90e['nodeType']==Node['ELEMENT_NODE'])break;_0x37a90e['remove']();}}const _0x3aea0b=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x47900d['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x3aea0b);const _0x8274e8=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x34323c=this['editor']['data']['toModel'](_0x3aea0b);return _0x8274e8||_0x34323c['markers']['clear'](),this['editor']['data']['stringify'](_0x34323c);}['_normalizeResponseHeadings'](_0x3d87c4){const _0x3768b6=new _0x3766df(this['editor']['editing']['view']['document']),_0x1c5b9e=new _0x50216e({'name':/^h[1-5]$/}),_0x129ce0=[];let _0x26b33d=!0x1;for(const _0x9d285a of _0x3d87c4)_0x9d285a['is']('element')&&_0x1c5b9e['match'](_0x9d285a)&&(_0x129ce0['push'](_0x9d285a),'h1'==_0x9d285a['name']&&(_0x26b33d=!0x0));if(_0x26b33d){for(const _0x285364 of _0x129ce0)_0x3768b6['rename']('h'+(parseInt(_0x285364['name'][0x1])+0x1),_0x285364);}}['_isH1TagSupportEnabled'](){const {data:_0x1ef10c,editing:_0x4ab5ac}=this['editor'],_0x5b52ae=_0x1ef10c['htmlProcessor']['toView']('<h1></h1>'),_0x6e4c1f=_0x1ef10c['toView'](_0x1ef10c['toModel'](_0x5b52ae));return!!_0x4ab5ac['view']['domConverter']['viewToDom'](_0x6e4c1f)['querySelector']('h1');}['_sanitizeHTML'](_0x436181){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x436181),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4e8050){const _0x11e64f=_0x4e8050['trim']();return _0x11e64f['startsWith']('```html')?_0x11e64f['endsWith']('```')?_0x11e64f['substring'](0x7,_0x11e64f['length']-0x3):_0x11e64f['substring'](0x7):_0x4e8050;}}const M={'REPLACE':'replace','INSERT':'insert'};class lt extends at{constructor(_0x558b44){super(_0x558b44),this['set']('isVisible',!0x1),this['set']('mainAction',M['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x186389=>i(_0x558b44,'AI_'+_0x186389['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x558b44,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x558b44,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x558b44,'Stop'));const _0x418f20=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x418f20['if']('isVisible','ck-hidden',_0x3c4e83=>!_0x3c4e83)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x3b597e,_0x5ecdc8){const _0x54ca71=new _0x3c3b6c(this['locale']);return _0x54ca71['set']({'label':_0x3b597e,'class':_0x5ecdc8||'','isVisible':!0x0,'withText':!0x0}),_0x54ca71;}}class Y extends _0x126e09{['contentFieldView'];['copyButtonView'];constructor(_0x27d4e1,_0x4831f5=''){super(_0x27d4e1),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x124a3a=this['bindTemplate'];this['contentFieldView']=new At(_0x27d4e1,_0x4831f5),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x124a3a['if']('isVisible','ck-hidden',_0x106b9c=>!_0x106b9c)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x124a3a['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 _0x4bd1b0=!0x1;this['on']('change:value',(_0xa0158a,_0x146b50,_0x4899af)=>{const _0x273c76=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x4899af),this['isProcessing']&&_0x273c76&&!_0x4bd1b0&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4c3398,_0x14ddfe,_0x174ce0)=>{_0x4bd1b0=!0x1,_0x174ce0?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4bd1b0=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4bd1b0=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x3d9b1c=this['locale'],_0x5c0306=new _0x3c3b6c(this['locale']),_0x29a430='ck-ai-form__copy-button';return _0x5c0306['set']({'label':i(_0x3d9b1c,'Copy'),'icon':_0x2ddf29,'class':_0x29a430,'tooltip':!0x0}),_0x5c0306['bind']('isVisible')['to'](this,'value',_0x283584=>!!_0x283584),_0x5c0306['bind']('isEnabled')['to'](this,'isProcessing',_0x1c402b=>!_0x1c402b),_0x5c0306['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5c0306['icon']=_0x13e6e8,_0x5c0306['class']=_0x29a430+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5c0306['icon']=_0x2ddf29,_0x5c0306['class']=_0x29a430;},0x3e8);}),_0x5c0306;}['_copyHTMLToClipboard'](_0x2ee249){const {window:_0x3a47a8,document:_0x5b231a}=_0x19855c;if(_0x3a47a8['ClipboardItem']){const {Blob:_0x476e9b,ClipboardItem:_0x2d3df8}=_0x3a47a8,_0x169754=[new _0x2d3df8({'text/html':new _0x476e9b([_0x2ee249['innerHTML']],{'type':'text/html'}),'text/plain':new _0x476e9b([_0x2ee249['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x169754);}else{const _0x30c977=_0x5b231a['createElement']('div');_0x30c977['style']['position']='absolute',_0x30c977['style']['left']='-9999px',_0x30c977['innerHTML']='<span>[</span>'+_0x2ee249['innerHTML']+'<span>]</span>',_0x5b231a['body']['appendChild'](_0x30c977);const _0x23b231=_0x5b231a['createRange']();_0x23b231['setStartAfter'](_0x30c977['firstElementChild']),_0x23b231['setEndBefore'](_0x30c977['lastElementChild']);const _0x2393f3=_0x3a47a8['getSelection']();_0x2393f3['removeAllRanges'](),_0x2393f3['addRange'](_0x23b231),_0x5b231a['execCommand']('copy'),_0x30c977['remove']();}}}class At extends _0x126e09{constructor(_0x5ba342,_0x2b359d=''){super(_0x5ba342),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x2b359d,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0xb0c31d){this['element']['innerHTML']=_0xb0c31d;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4f09bd=new _0x126e09(),_0x5123a2=this['locale'],_0x5d2620=new _0x70fd7d();return _0x5d2620['isVisible']=!0x0,_0x4f09bd['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x5d2620,{'text':i(_0x5123a2,'AI\x20is\x20writing...')}]}),_0x4f09bd['render'](),_0x4f09bd;}}class st extends _0x126e09{constructor(_0x1c8e6e,_0x58ea9f=''){super(_0x1c8e6e);const _0x320cc3=new rt(),_0x114531=this['bindTemplate'];this['set']('text',_0x58ea9f),_0x320cc3['content']=tt,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x320cc3,{'text':_0x114531['to']('text')}]});}}class ct extends nt{['submitButtonView'];['showHistoryButtonView'];constructor(_0x3371d6,_0x2c9bbb){super(_0x3371d6,_0x2c9bbb),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',(_0x592e2d,_0x8a9d3)=>{_0x592e2d['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x8a9d3());});}['_createSubmitButton'](){const _0x2b06ad=new _0x3c3b6c(this['locale']),_0xd5cc86=this['locale'];return _0x2b06ad['set']({'icon':ht,'label':i(_0xd5cc86,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x2b06ad['on']('execute',()=>{this['submit']();}),_0x2b06ad['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4a0d7a,_0x14e955)=>!_0x4a0d7a&&_0x14e955),_0x2b06ad;}['_createShowHistoryButton'](){const _0x453a59=new _0x3c3b6c(this['locale']),_0x4cfdf4=this['resultsView'],_0x465963=this['locale'];_0x453a59['set']({'label':i(_0x465963,'History'),'withText':!0x1,'icon':et,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x453a59['bind']('isOn')['to'](_0x4cfdf4,'isVisible'),_0x453a59['bind']('isEnabled')['to'](this,'isEnabled'),_0x453a59['on']('execute',()=>{_0x4cfdf4['isVisible']=!_0x4cfdf4['isVisible'],_0x4cfdf4['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x58f8c6=()=>{_0x19855c['window']['requestAnimationFrame'](()=>{if(ot(this['element'])){const _0x48a4d2=new it(this['queryView']['fieldView']['element']),_0x14a4a3=_0x48a4d2['width'],_0x5f3894='rtl'===_0x465963['uiLanguageDirection']?'left':'right';_0x48a4d2['excludeScrollbarsAndBorders'](),_0x453a59['element']['style'][_0x5f3894]=_0x14a4a3-_0x48a4d2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x58f8c6),this['on']('render',_0x58f8c6),_0x453a59;}['submit'](){const _0x5807b8=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x5807b8);}['focus'](_0x10e339){-0x1===_0x10e339?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class ft extends Ct{['historyGroupView'];['clearHistoryButton'];constructor(_0x4a3a9e){super(_0x4a3a9e),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ht(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x4a3a9e,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x157496=0x0;for(const _0x308b1e of this['items'])_0x157496+=_0x308b1e['items']['length'];return{'resultsCount':_0x157496,'totalItemsCount':_0x157496};}['_createClearHistoryButton'](){const _0x249bc5=this['locale'],_0x2ed8fe=new _0x3c3b6c(this['locale']);return _0x2ed8fe['set']({'label':'('+i(_0x249bc5,'Clear')+')','withText':!0x0}),_0x2ed8fe['on']('execute',()=>this['fire']('clearHistory')),_0x2ed8fe;}}class bt extends xt{constructor(_0x304e80){super();const _0x1c58a3=new kt(),_0x476e14=new _0x3c3b6c(this['locale'],_0x1c58a3);this['children']['add'](_0x476e14),_0x476e14['set']({'label':_0x304e80['prompt'],'withText':!0x0}),_0x476e14['on']('execute',()=>{this['fire']('execute',{'value':jt(_0x304e80['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class wt extends _0x1ff90d{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x290cf1,_0x1a4250)=>{const _0x2dab19=os(_0x1a4250['prompt']);for(const _0x81f698 of this)if(_0x81f698!=_0x1a4250&&os(_0x81f698['prompt'])===_0x2dab19){this['remove'](_0x81f698);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x4951f8=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x4951f8));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x30dfb3=>_0x30dfb3)));}}function os(_0x5a7152){return _0x5a7152['toLowerCase']()['trim']();}class _ extends _0x126e09{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x1c7369,_0x1026aa,_0x38ab4f=''){super(_0x1c7369),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',M['REPLACE']),this['_promptHistory']=new wt(),this['errorView']=new st(_0x1c7369),this['contentArea']=new Y(_0x1c7369,_0x38ab4f),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new mt(),this['keystrokes']=new ut(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new pt({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x5eaf60=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x1026aa],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x5eaf60['if']('isError','ck-hidden',_0x230e63=>!_0x230e63)]},'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'](_0x3bef71=0x1){-0x1===_0x3bef71?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 _0x5b1a96=this['locale'],_0x101d1d=new ct(_0x5b1a96,{'queryView':{'label':i(_0x5b1a96,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':dt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x5b1a96,'Empty\x20history'),'secondary':i(_0x5b1a96,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x101d1d['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x5a20b5,_0x224a0a)=>_0x5a20b5&&!_0x224a0a),this['listenTo'](_0x101d1d,'submit',(_0x2a7fdb,_0x519075)=>{this['prompt']=_0x519075;const _0x32a16c=yt(_0x519075);this['fire']('submitPrompt',_0x32a16c),_0x519075['trim']()&&this['_promptHistory']['add']({'prompt':_0x32a16c},0x0);},{'priority':'high'}),_0x101d1d;}['_createHistoryView'](){const _0x2e60c7=new ft(this['locale']);return _0x2e60c7['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](bt),_0x2e60c7['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2e60c7;}['_createToolbar'](){const _0x5a9697=new lt(this['locale']);return _0x5a9697['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1da855,_0xe6b653,_0x53fff0)=>_0x1da855&&!_0xe6b653&&!!_0x53fff0),_0x5a9697['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x5a9697['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x2de23a,_0x19d593,_0x28e86d)=>_0x2de23a&&!_0x19d593&&!!_0x28e86d),_0x5a9697['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x5a9697['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x3457a7,_0x3a2e04)=>_0x3457a7&&!_0x3a2e04),_0x5a9697['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x5a9697['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x5a9697['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x5a9697;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x39bd29=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x39bd29,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x2fb11c){const _0xd82062=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x2fb11c||i(_0xd82062,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const w=globalThis['DataTransfer'];class n extends _0x1e2b58{['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[_0x5f2f58,a,E,_0x3458e5];}constructor(_0x2ba1f3){super(_0x2ba1f3),_0x2ba1f3['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x2ba1f3['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x2ba1f3['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x2ba1f3['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4be351}=this;this['_aiAdapter']=_0x4be351['plugins']['get'](E),this['_dialog']=_0x4be351['plugins']['get'](_0x3458e5),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x241779=new j(_0x4be351,Array['from'](this['_commandDefinitions']['values']()));_0x4be351['commands']['add']('showAIAssistant',_0x241779),_0x4be351['ui']['componentFactory']['add']('aiCommands',_0x23bc19=>{const _0x25f2b1=_0x52e179(_0x23bc19);return _0x25f2b1['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x25f2b1['buttonView']['set']({'label':i(_0x23bc19,'AI\x20Commands'),'icon':_0x3c14dd,'tooltip':!0x0}),_0x25f2b1['on']('execute',_0x47c743=>this['_onExecute'](_0x47c743['source']['id'])),_0x5d11f4(_0x25f2b1,_0x4be351['ui']['view']['body'],function(_0xa67305){const _0x586da3=o(_0xa67305['config']['get']('ai.aiAssistant.commands'),_0xa67305['locale']),_0x2c53df=U(_0xa67305,_0x586da3)['filter'](_0x3a9984=>_0x3a9984['commands']['length']);if(0x1===_0x2c53df['length'])return U(_0xa67305,_0x2c53df[0x0]['commands'])['map'](_0x5de286=>({'id':_0x5de286['id'],'label':_0x5de286['label']}));return _0x2c53df['map'](_0x3d9c7a=>{const {groupId:_0x584f48,groupLabel:_0x1c07c7,commands:_0x321627}=_0x3d9c7a,_0x437dce=U(_0xa67305,_0x321627)['map'](_0x384321=>({'id':_0x384321['id'],'label':_0x384321['label']}));return{'id':_0x584f48,'menu':_0x1c07c7||_0x584f48,'children':_0x437dce};});}(_0x4be351),{'ariaLabel':i(_0x23bc19,'AI\x20Commands')}),_0x25f2b1['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x241779['on']('change:enabledCommandsIds',_0xad8603),_0x25f2b1['menuView']['once']('render',_0xad8603),_0x25f2b1;function _0xad8603(){_0x25f2b1['isEnabled']=_0x241779['enabledCommandsIds']['length']>0x0;for(const _0x4ea4c5 of _0x25f2b1['menuView']['buttons'])_0x4ea4c5['isEnabled']=_0x241779['enabledCommandsIds']['includes'](_0x4ea4c5['id']);}}),_0x4be351['ui']['componentFactory']['add']('menuBar:aiCommands',_0x16a3d8=>{const _0x4062ad=new _0x257147(_0x16a3d8);_0x4062ad['buttonView']['set']({'label':i(_0x16a3d8,'AI\x20Commands'),'icon':_0x3c14dd}),_0x4062ad['bind']('isEnabled')['to'](_0x241779,'enabledCommandsIds',_0x90b312=>_0x90b312['length']>0x0);const _0x2ca4aa=o(_0x4be351['config']['get']('ai.aiAssistant.commands'),_0x16a3d8);return this['_populateMenuBarMenu'](_0x241779,_0x4062ad,_0x2ca4aa,_0x40e6f3=>this['_onExecute'](_0x40e6f3)),_0x4062ad;}),_0x4be351['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x21616a=this['_createAIAssistantUIButton'](_0x3c3b6c);return _0x21616a['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x21616a;}),_0x4be351['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x4e8794=this['_createAIAssistantUIButton'](_0x29430b);return _0x4e8794['set']({'role':'menuitemcheckbox'}),_0x4e8794;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x596bb1=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x30234b;for(const _0x6d0435 in _0x596bb1){const _0x4dff46=_0x6d0435,_0x18a271=_0x596bb1[_0x4dff46];if('aiLicenseKeyValid'==_0x18a271||'aiLicenseKeyInvalid'==_0x18a271||'aiLicenseKeyExpired'==_0x18a271||'aiLicenseKeyDomainLimit'==_0x18a271||'aiLicenseKeyNotAllowed'==_0x18a271||'aiLicenseKeyEvaluationLimit'==_0x18a271||'aiLicenseKeyTrialLimit'==_0x18a271||'aiLicenseKeyUsageLimit'==_0x18a271){delete _0x596bb1[_0x4dff46],_0x30234b=_0x18a271,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x30234b&&_0x596bb1['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x30234b&&_0x596bb1['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x30234b&&_0x596bb1['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x30234b&&_0x596bb1['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x30234b&&_0x596bb1['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x30234b&&_0x596bb1['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x30234b&&_0x596bb1['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2d8bec='',_0x54de31='',_0x906023='custom'){const _0x46fa2b=this['editor'],_0x3e7a1d=_0x46fa2b['editing']['view'],_0x487fb6=_0x46fa2b['plugins']['get'](a),_0x434e23=_0x46fa2b['plugins']['get'](_0x5f2f58);_0x487fb6['showFakeVisualSelection']();const _0x325ec6=new w(),_0x1fa009=new ClipboardEvent('copy',{'clipboardData':_0x325ec6}),_0x5e3202=new _0x4dc71(_0x325ec6),_0x331134=new _0x32a673(_0x3e7a1d,_0x1fa009,{'dataTransfer':_0x5e3202});_0x434e23['_forceMarkersCopy']('comment',()=>{_0x3e7a1d['document']['fire']('copy',_0x331134);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new k(_0x46fa2b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2dc607=_0x5e3202['getData']('text/html');const _0x3b0d03=_0x46fa2b['model']['document']['selection'],_0x3b93b6=Array['from'](_0x3b0d03['getRanges']());0x1===_0x3b93b6['length']&&_0x3b93b6[0x0]['isFlat']&&!_0x3b0d03['getSelectedElement']()&&''!==_0x2dc607['replace'](/ /g,'')['trim']()&&(_0x2dc607='<p>'+_0x2dc607+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x906023,'query':_0x2d8bec,'htmlContent':_0x2dc607,'label':_0x54de31,'mainActionLabel':M[_0x46fa2b['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x1a4d4e,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0xba30db['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x487fb6['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0xc1912c=new Map(),_0x31b7f5=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4e5e1c of _0x31b7f5)for(const _0x5db348 of _0x4e5e1c['commands'])_0xc1912c['set'](_0x5db348['id'],{..._0x5db348,'groupId':_0x4e5e1c['groupId'],'groupLabel':_0x4e5e1c['groupLabel']||_0x4e5e1c['groupId']});return _0xc1912c;}['_createAIAssistantUIButton'](_0x2fd9f0){const _0x1fccd1=this['editor'],_0x2e4e57=_0x1fccd1['commands']['get']('showAIAssistant'),_0x44d51d=new _0x2fd9f0(_0x1fccd1['locale']);return _0x44d51d['set']({'label':i(_0x1fccd1['locale'],'AI\x20Assistant'),'icon':_0x1a4d4e,'isToggleable':!0x0}),_0x44d51d['bind']('isEnabled')['to'](_0x2e4e57),_0x44d51d['bind']('isOn')['to'](this['_dialog'],'id',_0x43301c=>'aiAssistant'===_0x43301c),this['listenTo'](_0x44d51d,'execute',()=>{_0x44d51d['isOn']?this['hideUI']():_0x2e4e57['execute']();}),_0x44d51d;}['_initView'](){const _0x467ca5=this['editor']['plugins']['get'](a);this['_formView']=new _(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x467ca5['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x467ca5['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2a7418,ui:{ariaLiveAnnouncer:_0xc4f61c}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0xf21124,_0x3329ca,_0x10aaec)=>{const _0x22e938=this['_aiAssistantController']['currentContext'];_0x10aaec?_0xc4f61c['announce'](i(_0x2a7418,'AI\x20is\x20writing')):_0x22e938&&_0xc4f61c['announce'](i(_0x2a7418,'Generated\x20content:\x20%0',_0x22e938),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x8054da,_0x5c4097,_0x2f4c03)=>{if(_0x2f4c03){const _0x44923a=this['_formView']['errorView']['text'];_0xc4f61c['announce'](i(_0x2a7418,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x44923a));}});}['_onExecute'](_0x54ab39){const _0x2ab59f=this['_commandDefinitions']['get'](_0x54ab39),_0x21b6a4=this['editor'],_0x74653a=_0x21b6a4['model']['document']['selection'],_0x155bb2=_0x21b6a4['commands']['get']('showAIAssistant'),_0x2938f0=_0x21b6a4['plugins']['get'](a),_0x5715eb=''+(_0x2ab59f['groupId']!==x?_0x2ab59f['groupLabel']+':\x20':'')+_0x2ab59f['label'];if(!0x1!==_0x2ab59f['requiresContent']&&_0x74653a['isCollapsed']){const _0x5c59dd=_0x5a0ab6(_0x74653a['getSelectedBlocks']())||_0x21b6a4['model']['schema']['getLimitElement'](_0x74653a);_0x21b6a4['model']['change'](_0x576cc0=>{_0x576cc0['setSelection'](_0x5c59dd,'in');});}_0x2938f0['showFakeVisualSelection'](),_0x155bb2['execute'](_0x2ab59f['prompt'],_0x5715eb,'command:'+_0x54ab39);}['_populateMenuBarMenu'](_0x1de054,_0x1d867a,_0x71c7e9,_0x5e77b8){const _0x206ba0=this['editor'],_0x4f458d=_0x206ba0['locale'],_0x593088=new _0x1cb3da(_0x4f458d),_0xbf66ef=U(_0x206ba0,_0x71c7e9)['filter'](_0x57dbcf=>_0x57dbcf['commands']['length']);0x1===_0xbf66ef['length']?this['_getMenuBarGroupButtons']({'command':_0x1de054,'commands':_0xbf66ef[0x0]['commands'],'parentMenuView':_0x1d867a,'onExecute':_0x5e77b8})['forEach'](_0x2e80d2=>_0x593088['items']['add'](_0x2e80d2)):_0xbf66ef['forEach'](({groupId:_0x2dc207,groupLabel:_0x1542ee,commands:_0x4f40d4})=>{const _0x1d553d=new _0x54032c(_0x4f458d,_0x1d867a),_0x548197=new _0x257147(_0x4f458d),_0x5bd9c4=new _0x1cb3da(_0x4f458d),_0x42a136=this['_getMenuBarGroupButtons']({'command':_0x1de054,'commands':_0x4f40d4,'parentMenuView':_0x548197,'onExecute':_0x5e77b8});_0x548197['buttonView']['set']({'label':_0x1542ee||_0x2dc207}),_0x548197['delegate']('execute')['to'](_0x1d867a),_0x5bd9c4['items']['addMany'](_0x42a136),_0x548197['panelView']['children']['add'](_0x5bd9c4),_0x1d553d['children']['add'](_0x548197),_0x593088['items']['add'](_0x1d553d);}),_0x1d867a['panelView']['children']['add'](_0x593088);}['_getMenuBarGroupButtons']({command:_0x531c32,commands:_0x42086a,parentMenuView:_0x57795b,onExecute:_0xe12c57}){const _0x2fb408=this['editor'],_0x5936fa=_0x2fb408['locale'];return U(_0x2fb408,_0x42086a)['map'](_0x4a25f0=>{const _0x27919b=new _0x54032c(_0x5936fa,_0x57795b),_0x4b9aa7=new _0x29430b(_0x5936fa);return _0x4b9aa7['set']({'label':_0x4a25f0['label']}),_0x4b9aa7['delegate']('execute')['to'](_0x57795b),_0x4b9aa7['on']('execute',()=>_0xe12c57(_0x4a25f0['id'])),_0x4b9aa7['bind']('isEnabled')['to'](_0x531c32,'enabledCommandsIds',_0x28411d=>_0x28411d['includes'](_0x4a25f0['id'])),_0x27919b['children']['add'](_0x4b9aa7),_0x27919b;});}}function B(_0x2bae3e,_0x320bb8){return void 0x0!==_0x2bae3e['order']&&void 0x0===_0x320bb8['order']?0x1:void 0x0===_0x2bae3e['order']&&void 0x0!==_0x320bb8['order']?-0x1:void 0x0!==_0x2bae3e['order']&&void 0x0!==_0x320bb8['order']?_0x2bae3e['order']-_0x320bb8['order']:0x0;}function U(_0x1ea48b,_0x19cdc3){_0x19cdc3['sort'](B);const _0x4fdaa5={},_0x12aa04=[];for(const _0x3b3a6f of _0x19cdc3)if(void 0x0!==_0x3b3a6f['order']){if(_0x3b3a6f['order']in _0x4fdaa5)throw new _0x271694('ai-commands-config-order-collision',_0x1ea48b,{'conflictingDefinitions':[_0x3b3a6f,_0x4fdaa5[_0x3b3a6f['order']]]});_0x4fdaa5[_0x3b3a6f['order']]=_0x3b3a6f,_0x12aa04['splice'](_0x3b3a6f['order'],0x0,_0x3b3a6f);}else _0x12aa04['push'](_0x3b3a6f);return _0x12aa04;}class r extends _0x1e2b58{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0xd5699b){super(_0xd5699b);const _0x392e07=_0xd5699b['config'],_0x57da09=_0xd5699b['locale'];_0x392e07['define']('ai.aiAssistant.preserveComments',!0x0),_0x392e07['define']('ai.aiAssistant.commands',function(_0x19b1c5){return[{'groupId':'editOrReview','groupLabel':i(_0x19b1c5,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x19b1c5,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x19b1c5,'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(_0x19b1c5,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x19b1c5,'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(_0x19b1c5,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x19b1c5,'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(_0x19b1c5,'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(_0x19b1c5,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x19b1c5,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x19b1c5,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x19b1c5,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x19b1c5,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x19b1c5,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x19b1c5,'Change\x20style'),'commands':[{'id':'business','label':i(_0x19b1c5,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x19b1c5,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x19b1c5,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x19b1c5,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x19b1c5,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x19b1c5,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x19b1c5,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x19b1c5,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x19b1c5,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x19b1c5,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x19b1c5,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x19b1c5,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x19b1c5,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x57da09)),_0x392e07['define']('ai.aiAssistant.extraCommandGroups',[]),_0x392e07['define']('ai.aiAssistant.removeCommands',[]);let _0xc7800=o(_0x392e07['get']('ai.aiAssistant.commands'),_0x57da09);const _0xf77288=_0x392e07['get']('ai.aiAssistant.extraCommandGroups'),_0x5f537f=_0x392e07['get']('ai.aiAssistant.removeCommands');_0xf77288['forEach'](_0x1959f6=>{const _0x3b7ce3=_0xc7800['find'](_0x5173cd=>_0x5173cd['groupId']===_0x1959f6['groupId']);_0x3b7ce3?_0x3b7ce3['commands']=_0x3b7ce3['commands']['concat'](_0x1959f6['commands']):_0xc7800['push'](_0x1959f6);}),_0xc7800=_0xc7800['filter'](_0x48935d=>!_0x5f537f['includes'](_0x48935d['groupId'])),_0xc7800['forEach'](_0x484d14=>{_0x484d14['commands']=_0x484d14['commands']['filter'](_0x3e4a06=>!_0x5f537f['includes'](_0x3e4a06['id']));}),_0x392e07['set']('ai.aiAssistant.commands',_0xc7800);}}class P extends _0x1e2b58{['abortController'];static get['requires'](){return[E];}constructor(_0x10303b){super(_0x10303b),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](E)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4c0f2c){return this['sendRequest'](_0x4c0f2c)['catch'](_0x3139ee=>{if(_0x3139ee instanceof R)return Promise['reject'](_0x3139ee);if('AbortError'==_0x3139ee['name'])return Promise['resolve']();throw console['error'](_0x3139ee),new _0x271694('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x7a1713,_0x4d06e7){const _0x3f58b7=this['editor']['locale'],_0x1a6709={'Content-Type':'application/json'};if('object'==typeof _0x7a1713)Object['assign'](_0x1a6709,_0x7a1713);else{if(_0x7a1713)try{const _0x120fae=await _0x7a1713(_0x4d06e7);Object['assign'](_0x1a6709,_0x120fae);}catch{return Promise['reject'](new R(i(_0x3f58b7,'AI_ERROR_GET_HEADERS')));}}return _0x1a6709;}async['_prepareRequestParameters'](_0x973551,_0x3f21f2){const _0x568add=this['editor']['locale'];if('object'==typeof _0x973551)return _0x973551;try{return await _0x973551(_0x3f21f2);}catch{return Promise['reject'](new R(i(_0x568add,'AI_ERROR_GET_PARAMETERS')));}}}class O extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x25cfc5){super(_0x25cfc5),_0x25cfc5['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x25cfc5['config']['get']('ai.openAI.requestParameters')||_0x25cfc5['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x25cfc5['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x25cfc5['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x25cfc5['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x482211,context:_0xf3b280,onData:_0x3a8550,actionId:_0x1e4418}){const _0xdfb1e=this['editor']['locale'],_0x3da51e=await this['prepareMessages'](_0x482211,_0xf3b280,_0x1e4418),_0x32e218=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1e4418),_0x4639b9=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1e4418),_0x2c6999={'messages':_0x3da51e,..._0x4639b9},_0xdcc512={'method':'POST','headers':_0x32e218,'body':JSON['stringify'](_0x2c6999),'signal':this['abortController']['signal']},_0x4d5311=await fetch(this['_apiUrl'],_0xdcc512);if(_0x4d5311['ok'])return _0x4639b9['stream']?await this['_readStreamableResponse'](_0x4d5311,_0x3a8550):await this['_readStaticResponse'](_0x4d5311,_0x3a8550),Promise['resolve']();{const _0x3c15ee=await _0x4d5311['text']();return _0x3c15ee['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0xdfb1e,'AI_ERROR_CONTEXT_LENGTH'))):_0x3c15ee['includes']('Moderation')?Promise['reject'](new R(i(_0xdfb1e,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x3c15ee));}}async['prepareMessages'](_0x8b64d2,_0x462ba2,_0x2d0965){let _0x54e160,_0x20b002;return _0x462ba2?(_0x54e160='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.',_0x20b002='Instruction:\x0a'+_0x8b64d2+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x462ba2):(_0x54e160='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.',_0x20b002=_0x8b64d2),[{'role':'system','content':_0x54e160},{'role':'user','content':_0x20b002}];}async['_readStreamableResponse'](_0x59fb44,_0x58c4a3){const _0x273225=_0x59fb44['body']['getReader'](),_0x4095e5=new TextDecoder();let _0x3770b5='',_0x5236e3='',_0x353321='',_0x29bb20=!0x1;for(;!_0x29bb20;){const {done:_0x30af9e,value:_0x1f6168}=await _0x273225['read'](),_0x1eddd8=_0x3770b5+_0x4095e5['decode'](_0x1f6168);let _0x4e22b2='';_0x29bb20=_0x30af9e;try{_0x4e22b2=this['_cleanUpData'](_0x1eddd8),_0x3770b5='';}catch{_0x3770b5=_0x1eddd8;continue;}_0x5236e3+=_0x4e22b2,!_0x29bb20&&this['_isBufferIncomplete'](_0x5236e3)||_0x5236e3&&(_0x353321+=_0x5236e3,_0x5236e3='',_0x58c4a3(_0x353321));}return Promise['resolve']();}async['_readStaticResponse'](_0x3b1446,_0x5f1c4c){return _0x5f1c4c((await _0x3b1446['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x349dd6){const _0x5a8d75=_0x349dd6['split']('<')['length']!==_0x349dd6['split']('>')['length'],_0x2896ee=_0x349dd6['length']<0x1e;return _0x5a8d75&&_0x2896ee;}['_cleanUpData'](_0x2b93f1){return _0x2b93f1['split'](/\n(?![^{]*\})/g)['map'](_0xa4758e=>_0xa4758e['replace']('data:\x20',''))['filter'](_0x712d47=>_0x712d47&&_0x712d47['length']>0x0&&'[DONE]'!==_0x712d47)['map'](_0x353467=>{const {choices:_0x5e51a0}=JSON['parse'](_0x353467);if(_0x5e51a0[0x0]?.['delta']?.['content'])return _0x5e51a0[0x0]['delta']['content'];})['filter'](_0x3431dd=>_0x3431dd)['join']('');}}class D extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x4c8eda){super(_0x4c8eda),_0x4c8eda['config']['get']('ai.aws.requestParameters')||_0x4c8eda['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']=_0x4c8eda['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x4c8eda['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x4c8eda['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x4c8eda['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5256a1,context:_0x15cf16,onData:_0x3ba470,actionId:_0x5f49e4}){const {model:_0x666513,stream:_0x32d23a,..._0x3b35e3}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5f49e4),_0x45a51d={'prompt':await this['preparePrompt'](_0x5256a1,_0x15cf16,_0x666513,_0x5f49e4),..._0x3b35e3};this['_apiUrl']?await this['_processProxyRequest'](_0x45a51d,_0x666513,_0x32d23a,_0x3ba470,_0x5f49e4):await this['_processAWSRequest'](_0x45a51d,_0x666513,_0x32d23a,_0x3ba470);}async['preparePrompt'](_0x1e7f35,_0x4d42b5,_0x1b211c,_0x6744e1){let _0x112b87,_0x4012f7;return _0x4d42b5?(_0x112b87='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.',_0x4012f7='Instruction:\x0a'+_0x1e7f35+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x4d42b5):(_0x112b87='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.',_0x4012f7=_0x1e7f35),'meta.llama'==this['getModelFamily'](_0x1b211c)?'<<SYS>>\x0a'+_0x112b87+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x4012f7+'\x0a[/INST]':'Human:\x0a'+_0x112b87+'\x0a'+_0x4012f7+'\x0a\x0aAssistant:';}['getModelFamily'](_0x5f9db2){if(/^anthropic\.claude/['test'](_0x5f9db2))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x5f9db2))return'ai21.j2';if(/^cohere\.command/['test'](_0x5f9db2))return'cohere.command';if(/^meta\.llama/['test'](_0x5f9db2))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x5f9db2));}async['_processProxyRequest'](_0x3c1284,_0xf4808f,_0x47792b,_0x2cfd4b,_0xa35279){const _0xf03ef={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0xa35279),'body':JSON['stringify']({..._0x3c1284,'model':_0xf4808f,'stream':_0x47792b}),'signal':this['abortController']['signal']},_0xe656fe=await fetch(this['_apiUrl'],_0xf03ef);_0x47792b?await this['_readStreamableResponse'](_0xe656fe,_0xf4808f,_0x2cfd4b):await this['_readStaticResponse'](_0xe656fe,_0xf4808f,_0x2cfd4b);}async['_processAWSRequest'](_0x39036a,_0x547619,_0x1ba092,_0x561ca7){const _0x4d0bd2=new _0x2fa226(this['_bedrockClientConfig']),_0x5c165b={'body':JSON['stringify'](_0x39036a),'contentType':'application/json','accept':'application/json','modelId':_0x547619};let _0x488aa7;if(_0x1ba092){const _0x42edd9=new _0x35d92d(_0x5c165b);_0x488aa7=await _0x4d0bd2['send'](_0x42edd9,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x488aa7,_0x547619,_0x561ca7);}else{const _0x435276=new _0x3eb9e5(_0x5c165b);_0x488aa7=await _0x4d0bd2['send'](_0x435276,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x488aa7,_0x547619,_0x561ca7);}}async['_readAsyncIterableResponse'](_0x2cb041,_0x2d00d9,_0x4e2277){const _0x5940f0=_0x2cb041['body'],_0x45fd32=new TextDecoder('utf-8');let _0x54f529='';for await(const _0x39744c of _0x5940f0)if(_0x39744c['chunk']){const _0x497c5e=_0x45fd32['decode'](_0x39744c['chunk']['bytes']),_0x2a4216=JSON['parse'](_0x497c5e);_0x54f529+=this['_getGeneratedText'](_0x2a4216,_0x2d00d9),_0x4e2277(_0x54f529);}return Promise['resolve']();}async['_readStreamableResponse'](_0x58cd28,_0x4d2638,_0x3a84c9){const _0x5330f2=_0x58cd28['body'],_0x416b5e=new TextDecoder('utf-8'),_0x2d4ff2=_0x5330f2['getReader']();let _0x492598='',_0x5f20ed='',_0x1c8fcd=!0x1;for(;!_0x1c8fcd;){const {done:_0x4d8f1b,value:_0xa660cd}=await _0x2d4ff2['read']();if(_0x1c8fcd=_0x4d8f1b,_0x1c8fcd)break;const _0x5e4b95=(_0x492598+_0x416b5e['decode'](_0xa660cd))['split']('\x0a')['map'](_0x5f3447=>{try{return _0x492598='',JSON['parse'](_0x5f3447);}catch{return _0x492598=_0x5f3447,null;}})['filter'](_0xd9a6ea=>null!==_0xd9a6ea);_0x5e4b95['length']&&(_0x5f20ed+=_0x5e4b95['map'](_0x30f1b6=>this['_getGeneratedText'](_0x30f1b6,_0x4d2638))['join'](''),_0x3a84c9(_0x5f20ed));}return Promise['resolve']();}async['_readStaticResponse'](_0xeab469,_0x1f4014,_0x2578ac){let _0x4e8628;return _0x4e8628=_0xeab469 instanceof Response?await _0xeab469['json']():JSON['parse'](Buffer['from'](_0xeab469['body'])['toString']('utf8')),(_0x2578ac(this['_getGeneratedText'](_0x4e8628,_0x1f4014)),Promise['resolve']());}['_getGeneratedText'](_0x536da5,_0x215bb9){switch(this['getModelFamily'](_0x215bb9)){case'anthropic.claude':return _0x536da5['completion'];case'ai21.j2':return _0x536da5['completions'][0x0]['data']['text'];case'cohere.command':return _0x536da5['generations'][0x0]['text'];case'meta.llama':return _0x536da5['generation'];}}}export{E as AIAdapter,r as AIAssistant,n as AIAssistantUI,R as AIRequestError,P as AITextAdapter,D as AWSTextAdapter,O as OpenAITextAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "45.2.1-alpha.
|
|
3
|
+
"version": "45.2.1-alpha.7",
|
|
4
4
|
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@aws-sdk/client-bedrock-runtime": "3.621.0",
|
|
27
|
-
"@ckeditor/ckeditor5-clipboard": "45.2.1-alpha.
|
|
28
|
-
"@ckeditor/ckeditor5-core": "45.2.1-alpha.
|
|
29
|
-
"@ckeditor/ckeditor5-engine": "45.2.1-alpha.
|
|
30
|
-
"@ckeditor/ckeditor5-icons": "45.2.1-alpha.
|
|
31
|
-
"@ckeditor/ckeditor5-table": "45.2.1-alpha.
|
|
32
|
-
"@ckeditor/ckeditor5-ui": "45.2.1-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-utils": "45.2.1-alpha.
|
|
34
|
-
"ckeditor5": "45.2.1-alpha.
|
|
27
|
+
"@ckeditor/ckeditor5-clipboard": "45.2.1-alpha.7",
|
|
28
|
+
"@ckeditor/ckeditor5-core": "45.2.1-alpha.7",
|
|
29
|
+
"@ckeditor/ckeditor5-engine": "45.2.1-alpha.7",
|
|
30
|
+
"@ckeditor/ckeditor5-icons": "45.2.1-alpha.7",
|
|
31
|
+
"@ckeditor/ckeditor5-table": "45.2.1-alpha.7",
|
|
32
|
+
"@ckeditor/ckeditor5-ui": "45.2.1-alpha.7",
|
|
33
|
+
"@ckeditor/ckeditor5-utils": "45.2.1-alpha.7",
|
|
34
|
+
"ckeditor5": "45.2.1-alpha.7",
|
|
35
35
|
"es-toolkit": "1.32.0"
|
|
36
36
|
},
|
|
37
37
|
"type": "module",
|