@ckeditor/ckeditor5-ai 46.0.1-alpha.10 → 46.0.1-alpha.12
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 _0x515c0a,Command as _0x11770b}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0xe75053,IconCheck as _0x4f032b,IconError as _0x773f81,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x34e489,IconRobotPencil as _0x3c77d6}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x329816,CKEditorError as _0xed27b5,ObservableMixin as _0x2c17f7,global as _0x9e473a,isVisible as _0x52bac2,Rect as _0x1b0bbc,Collection as _0x47cb6e,FocusTracker as et,KeystrokeHandler as rt,first as _0x556a6f}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x7a723e,View as _0x4351e1,SpinnerView as _0x54872b,IconView as _0x2a24ba,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x4a6f28,createDropdown as _0x502434,addMenuToDropdown as _0x27fba4,MenuBarMenuView as _0x1506d9,MenuBarMenuListItemButtonView as _0x34bfe7,DialogViewPosition as _0x3b370c,MenuBarMenuListView as _0x3cd171,MenuBarMenuListItemView as _0x2e2987}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x2ede65,ClipboardMarkersUtils as _0x114521}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x1ce5fe,ViewDataTransfer as _0x49a740,ViewUpcastWriter as _0x3668d2,Matcher as _0x59cd7f}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x261cf3,InvokeModelWithResponseStreamCommand as _0x3a8fdc,InvokeModelCommand as _0x343b6e}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x325dbb,_0x59d793){const _0x231980=(0x0,_0x59d793['t'])('Other');return _0x325dbb['length']?'groupId'in _0x325dbb[0x0]?_0x325dbb:[{'groupId':K,'groupLabel':_0x231980,'order':0x1/0x0,'commands':_0x325dbb}]:[{'groupId':K,'groupLabel':_0x231980,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x515c0a{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x5e5dd8}=this,_0x34f0e1=['ck-fake-ai-selection'];_0x5e5dd8['config']['get']('ai.useTheme')&&_0x34f0e1['push']('ck-ai-assistant-ui_theme'),_0x5e5dd8['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x34f0e1,'priority':0xc}}),_0x5e5dd8['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x33d1cd,{writer:_0x374241})=>{if(!_0x33d1cd['markerRange']['isCollapsed'])return null;const _0x4622f9=_0x374241['createUIElement']('span');return _0x374241['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x4622f9),_0x4622f9;}});}['afterInit'](){!async function(_0x510e9d){const _0x90eaf4=_0x3c52c2([0x6c,0x59,0x32,0x65,0x35,0x39,0x52,0x56,0x4b,0x4e,0x6e,0x77,0x6b,0x62,0x74,0x42,0x78,0x44,0x4f,0x48,0x66,0x55,0x67,0x61,0x7a,0x6d,0x5a,0x64,0x33,0x49,0x31,0x68,0x37,0x41,0x47,0x6f,0x51,0x70,0x73,0x38,0x50,0x46,0x69,0x58,0x43,0x57,0x6a,0x4c,0x45,0x76,0x36,0x72,0x71,0x75,0x34,0x79,0x4d,0x63,0x30,0x53,0x54,0x4a]),_0x33a273=0x2bfa557,_0x376750=0x2b8ca9f^_0x33a273,_0x33148b=window[_0x3c52c2([0x44,0x61,0x74,0x65])][_0x3c52c2([0x6e,0x6f,0x77])](),_0x435462=_0x510e9d[_0x3c52c2([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x341e86=new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x54f0db=>{_0x435462[_0x3c52c2([0x6f,0x6e,0x63,0x65])](_0x3c52c2([0x72,0x65,0x61,0x64,0x79]),_0x54f0db);}),_0x36f9b9={[_0x3c52c2([0x6b,0x74,0x79])]:_0x3c52c2([0x45,0x43]),[_0x3c52c2([0x75,0x73,0x65])]:_0x3c52c2([0x73,0x69,0x67]),[_0x3c52c2([0x63,0x72,0x76])]:_0x3c52c2([0x50,0x2d,0x32,0x35,0x36]),[_0x3c52c2([0x78])]:_0x3c52c2([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]),[_0x3c52c2([0x79])]:_0x3c52c2([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]),[_0x3c52c2([0x61,0x6c,0x67])]:_0x3c52c2([0x45,0x53,0x32,0x35,0x36])},_0x25e071=_0x435462[_0x3c52c2([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x3c52c2([0x67,0x65,0x74])](_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5b1d82(){let _0x21c749,_0x180a36=null,_0x3c3d80=null;try{if(_0x25e071==_0x3c52c2([0x47,0x50,0x4c]))return _0x3c52c2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x21c749=_0x32f7db(),!_0x21c749)return _0x3c52c2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x21c749[_0x3c52c2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3c3d80=_0x3d25d7(_0x21c749[_0x3c52c2([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x21c749[_0x3c52c2([0x6a,0x74,0x69])])),await _0x2170c1()?_0x1bcb64()?_0x46875b()?_0x3c52c2([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x1ae833()?(_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c52c2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x180a36=_0xddc0c9(_0x3c52c2([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x3c52c2([0x74,0x72,0x69,0x61,0x6c])&&(_0x180a36=_0xddc0c9(_0x3c52c2([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x3627b1()):_0x3c52c2([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x3c52c2([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x3c52c2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x3c52c2([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x46875b(){const _0x4bf9ad=[_0x3c52c2([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x3c52c2([0x74,0x72,0x69,0x61,0x6c])][_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x33148b/0x3e8:0xe10*_0x376750;return _0x21c749[_0x3c52c2([0x65,0x78,0x70])]<_0x4bf9ad;}function _0x1bcb64(){const _0x563339=_0x21c749[_0x3c52c2([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x563339&&(!!_0x563339[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c52c2([0x2a]))||!!_0x563339[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c52c2([0x41,0x49])));}function _0x1ae833(){const _0x5414dc=_0x21c749[_0x3c52c2([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x5414dc||0x0==_0x5414dc[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x4c4f31}=new URL(window[_0x3c52c2([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x5414dc[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x4c4f31))return!0x0;const _0x342eed=_0x4c4f31[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e]));return _0x5414dc[_0x3c52c2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x2b146a=>_0x2b146a[_0x3c52c2([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3c52c2([0x2a])))[_0x3c52c2([0x6d,0x61,0x70])](_0x5559e4=>_0x5559e4[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e])))[_0x3c52c2([0x66,0x69,0x6c,0x74,0x65,0x72])](_0xb6767d=>_0xb6767d[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x342eed[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c52c2([0x6d,0x61,0x70])](_0x2aa13c=>Array(_0x342eed[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x2aa13c[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x3c52c2([0x66,0x69,0x6c,0x6c])](_0x2aa13c[0x0]===_0x3c52c2([0x2a])?_0x3c52c2([0x2a]):'')[_0x3c52c2([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x2aa13c))[_0x3c52c2([0x73,0x6f,0x6d,0x65])](_0x4a9d9c=>_0x342eed[_0x3c52c2([0x65,0x76,0x65,0x72,0x79])]((_0x527f3c,_0x27a44e)=>_0x4a9d9c[_0x27a44e]===_0x527f3c||_0x4a9d9c[_0x27a44e]===_0x3c52c2([0x2a])));}function _0x3627b1(){return _0x180a36&&_0x3c3d80?new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x42a32e,_0x1510d9)=>{_0x180a36[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x42a32e,_0x1510d9),_0x3c3d80[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x35d315=>{_0x35d315!=_0x3c52c2([0x56,0x61,0x6c,0x69,0x64])&&_0x42a32e(_0x35d315);},_0x1510d9);}):_0x180a36||_0x3c3d80||_0x3c52c2([0x56,0x61,0x6c,0x69,0x64]);}}function _0x3d25d7(_0x373e3c,_0x578231){return new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x17cecd=>{if(_0x4fa37d())return _0x17cecd(_0x3c52c2([0x56,0x61,0x6c,0x69,0x64]));_0x186d2a(),_0x435462[_0x3c52c2([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x3c52c2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x297c88=!0x1;const _0xa4c8bf=_0x329816();function _0x3a4ca3(_0x1a7611){return!!_0x1a7611&&(typeof _0x1a7611===_0x3c52c2([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x1a7611===_0x3c52c2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x1a7611[_0x3c52c2([0x74,0x68,0x65,0x6e])]===_0x3c52c2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x1a7611[_0x3c52c2([0x63,0x61,0x74,0x63,0x68])]===_0x3c52c2([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x565182(_0x3ef71c){_0x99ebb7(_0x3ef71c)[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x3c3b42=>{if(!_0x3c3b42||_0x3c3b42[_0x3c52c2([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x3c52c2([0x6f,0x6b]))return _0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x1c0a61(_0x4ee7b5(_0xa4c8bf+_0x578231))!=_0x3c3b42[_0x3c52c2([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x3c52c2([0x56,0x61,0x6c,0x69,0x64]);})[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x467a52=>(_0x4b7e40(),_0x467a52),()=>{const _0x58f790=_0x440656();return null==_0x58f790?(_0x4b7e40(),_0x3c52c2([0x56,0x61,0x6c,0x69,0x64])):_0x3c52c2(_0x33148b-_0x58f790>(0x26b32157^_0x33a273)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x17cecd)[_0x3c52c2([0x63,0x61,0x74,0x63,0x68])](()=>{_0x17cecd(_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0xe74f3b=0x2894bd7^_0x33a273;function _0x4b7e40(){const _0x23bbad=_0x3c52c2([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c0a61(_0x4ee7b5(_0x373e3c)),_0x2ae4cc=_0x532b94(_0x1c0a61(window[_0x3c52c2([0x4d,0x61,0x74,0x68])][_0x3c52c2([0x63,0x65,0x69,0x6c])](_0x33148b/_0xe74f3b)));window[_0x3c52c2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c52c2([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x23bbad,_0x2ae4cc);}function _0x440656(){const _0x5a7888=_0x3c52c2([0x6c,0x6c,0x63,0x74,0x2d])+_0x1c0a61(_0x4ee7b5(_0x373e3c)),_0x25651e=window[_0x3c52c2([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x3c52c2([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x5a7888);return _0x25651e?window[_0x3c52c2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x532b94(_0x25651e),0x10)*_0xe74f3b:null;}function _0x99ebb7(_0x5e334b){return new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x26dbeb,_0x53adc3)=>{_0x5e334b[_0x3c52c2([0x74,0x68,0x65,0x6e])](_0x26dbeb,_0x53adc3),window[_0x3c52c2([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x53adc3,0x2be7197^_0x33a273);});}}_0x435462[_0x3c52c2([0x6f,0x6e])](_0x3c52c2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1bb633,_0x5e1acc)=>{if(_0x5e1acc[0x0]!=_0x373e3c)return _0x17cecd(_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5e1acc[0x1]={..._0x5e1acc[0x1],[_0x3c52c2([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0xa4c8bf};},{[_0x3c52c2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c52c2([0x68,0x69,0x67,0x68])}),_0x435462[_0x3c52c2([0x6f,0x6e])](_0x3c52c2([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x487f58=>{_0x3a4ca3(_0x487f58[_0x3c52c2([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x297c88=!0x0,_0x565182(_0x487f58[_0x3c52c2([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x3c52c2([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x3c52c2([0x6c,0x6f,0x77])}),_0x341e86[_0x3c52c2([0x74,0x68,0x65,0x6e])](()=>{_0x297c88||_0x17cecd(_0x3c52c2([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4fa37d(){return _0x435462[_0x3c52c2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c52c2([0x76,0x69,0x65,0x77])][_0x3c52c2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x3c52c2([0x61,0x75,0x74,0x6f]);}function _0x186d2a(){_0x435462[_0x3c52c2([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x3c52c2([0x76,0x69,0x65,0x77])][_0x3c52c2([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x3c52c2([0x61,0x75,0x74,0x6f]);}}function _0xddc0c9(_0x3b9d46){const _0x35a1e8=[new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5cf55b=>setTimeout(_0x5cf55b,0x2b69b9b^_0x33a273)),_0x341e86[_0x3c52c2([0x74,0x68,0x65,0x6e])](()=>new window[(_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x15b39e=>{let _0x485fba=0x0;_0x435462[_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c52c2([0x6f,0x6e])](_0x3c52c2([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3cfad1,_0x464690)=>{_0x464690[0x0][_0x3c52c2([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x485fba++,_0x485fba==(0x2bfa4af^_0x33a273)&&(_0x15b39e(),_0x3cfad1[_0x3c52c2([0x6f,0x66,0x66])]());});}))];return window[_0x3c52c2([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x3c52c2([0x72,0x61,0x63,0x65])](_0x35a1e8)[_0x3c52c2([0x74,0x68,0x65,0x6e])](()=>_0x3b9d46);}async function _0xbafdc4(){await _0x341e86,_0x435462[_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c52c2([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x16bd8e,_0x435462[_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c])][_0x3c52c2([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x16bd8e,_0x435462[_0x3c52c2([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x3c52c2([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x2e1e2b(_0x1ee75c){const _0x1d9676=_0x6303e3();_0x435462[_0x1d9676]=_0x3c52c2([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x1ee75c,_0x1ee75c!=_0x3c52c2([0x56,0x61,0x6c,0x69,0x64])&&_0xbafdc4();}function _0x6303e3(){const _0x1d3aa4=window[_0x3c52c2([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x3c52c2([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x3c52c2([0x6e,0x6f,0x77])]())[_0x3c52c2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x3c52c2([0x2e]),'');let _0x1edaab=_0x3c52c2([0x6c]);for(let _0x171e83=0x0;_0x171e83<_0x1d3aa4[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x171e83+=0x2){let _0xb0570d=window[_0x3c52c2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1d3aa4[_0x3c52c2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x171e83,_0x171e83+0x2));_0xb0570d>=_0x90eaf4[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0xb0570d-=_0x90eaf4[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1edaab+=_0x90eaf4[_0xb0570d];}return _0x1edaab;}function _0x32f7db(){const _0x7928f7=_0x25e071[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e]));if(0x3!=_0x7928f7[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x3b546e(_0x7928f7[0x1]);function _0x3b546e(_0x545ce6){const _0xe8ad10=_0x5c1c29(_0x545ce6);return _0xe8ad10&&_0x1b28c2()?_0xe8ad10:null;function _0x1b28c2(){const _0x7cec43=_0xe8ad10[_0x3c52c2([0x6a,0x74,0x69])],_0x2e51e2=window[_0x3c52c2([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x7cec43[_0x3c52c2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x7cec43[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x5e40d2={..._0xe8ad10,[_0x3c52c2([0x6a,0x74,0x69])]:_0x7cec43[_0x3c52c2([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x7cec43[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x5e40d2[_0x3c52c2([0x76,0x63])],_0x4ee7b5(_0x5e40d2)==_0x2e51e2;}}}async function _0x2170c1(){let _0x4537bb=!0x0;try{const _0x5efd5d=_0x25e071[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])](_0x3c52c2([0x2e])),[_0x527e2f,_0x48c0e7,_0x45b72b]=_0x5efd5d;return _0x58a9fe(_0x527e2f),await _0x18b16e(_0x527e2f,_0x48c0e7,_0x45b72b),_0x4537bb;}catch{return!0x1;}function _0x58a9fe(_0x2f9852){const _0x515490=_0x5c1c29(_0x2f9852);_0x515490&&_0x515490[_0x3c52c2([0x61,0x6c,0x67])]==_0x3c52c2([0x45,0x53,0x32,0x35,0x36])||(_0x4537bb=!0x1);}async function _0x18b16e(_0x1fb3b3,_0x10115b,_0x3c9dac){const _0x274813=window[_0x3c52c2([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x3c52c2([0x66,0x72,0x6f,0x6d])](_0x37c5fb(_0x3c9dac),_0x579cf7=>_0x579cf7[_0x3c52c2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x4d2884=new window[(_0x3c52c2([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x3c52c2([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x1fb3b3+_0x3c52c2([0x2e])+_0x10115b),_0x44aa0a=window[_0x3c52c2([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x3c52c2([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x44aa0a)return;const _0x18f8a1=await _0x44aa0a[_0x3c52c2([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x3c52c2([0x6a,0x77,0x6b]),_0x36f9b9,{[_0x3c52c2([0x6e,0x61,0x6d,0x65])]:_0x3c52c2([0x45,0x43,0x44,0x53,0x41]),[_0x3c52c2([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x3c52c2([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x3c52c2([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x44aa0a[_0x3c52c2([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x3c52c2([0x6e,0x61,0x6d,0x65])]:_0x3c52c2([0x45,0x43,0x44,0x53,0x41]),[_0x3c52c2([0x68,0x61,0x73,0x68])]:{[_0x3c52c2([0x6e,0x61,0x6d,0x65])]:_0x3c52c2([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x18f8a1,_0x274813,_0x4d2884)||(_0x4537bb=!0x1);}}function _0x5c1c29(_0x5427ea){return _0x5427ea[_0x3c52c2([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x3c52c2([0x65,0x79]))?JSON[_0x3c52c2([0x70,0x61,0x72,0x73,0x65])](_0x37c5fb(_0x5427ea)):null;}function _0x37c5fb(_0x2b5a25){return window[_0x3c52c2([0x61,0x74,0x6f,0x62])](_0x2b5a25[_0x3c52c2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x3c52c2([0x2b]))[_0x3c52c2([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x3c52c2([0x2f])));}function _0x4ee7b5(_0x278433){let _0x36b79c=0x1505;function _0x1a1046(_0x2d659b){for(let _0x434b80=0x0;_0x434b80<_0x2d659b[_0x3c52c2([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x434b80++){const _0x2e7aa0=_0x2d659b[_0x3c52c2([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x434b80);_0x36b79c=(_0x36b79c<<0x5)+_0x36b79c+_0x2e7aa0,_0x36b79c&=_0x36b79c;}}function _0x588ee5(_0xd60836){Array[_0x3c52c2([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0xd60836)?_0xd60836[_0x3c52c2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x588ee5):_0xd60836&&typeof _0xd60836==_0x3c52c2([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x3c52c2([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0xd60836)[_0x3c52c2([0x73,0x6f,0x72,0x74])]()[_0x3c52c2([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x373b43,_0x11a164])=>{_0x1a1046(_0x373b43),_0x588ee5(_0x11a164);}):_0x1a1046(window[_0x3c52c2([0x53,0x74,0x72,0x69,0x6e,0x67])](_0xd60836));}return _0x588ee5(_0x278433),_0x36b79c>>>0x0;}function _0x1c0a61(_0x4ae224){return _0x4ae224[_0x3c52c2([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x3c52c2([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x3c52c2([0x30]));}function _0x532b94(_0x19764c){return _0x19764c[_0x3c52c2([0x73,0x70,0x6c,0x69,0x74])]('')[_0x3c52c2([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x3c52c2([0x6a,0x6f,0x69,0x6e])]('');}function _0x16bd8e(){}function _0x3c52c2(_0x57a76b){return _0x57a76b['map'](_0xc3e1b=>String['fromCharCode'](_0xc3e1b))['join']('');}_0x2e1e2b(await _0x5b1d82());}(this);}['showFakeVisualSelection'](){const _0x1feb4c=this['editor']['model'];_0x1feb4c['change'](_0x5da3ce=>{const _0x31c6e8=_0x1feb4c['document']['selection']['getRanges']();let _0x394814=0x0;for(const _0x30470b of _0x31c6e8){const _0x9ee9a5=w+':'+_0x394814;if(_0x1feb4c['markers']['has'](_0x9ee9a5))_0x5da3ce['updateMarker'](_0x9ee9a5,{'range':_0x30470b});else{if(_0x30470b['start']['isAtEnd']){const _0x303a53=_0x30470b['start']['getLastMatchingPosition'](({item:_0x4377bb})=>!_0x1feb4c['schema']['isContent'](_0x4377bb),{'boundaries':_0x30470b});_0x5da3ce['addMarker'](_0x9ee9a5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x5da3ce['createRange'](_0x303a53,_0x30470b['end'])});}else _0x5da3ce['addMarker'](_0x9ee9a5,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x30470b});}_0x394814++;}});}['hideFakeVisualSelection'](){const _0xf15632=this['editor']['model'],_0x35b187=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x35b187['length']&&_0xf15632['change'](_0x1cf130=>{_0x35b187['forEach'](_0x35601a=>{_0x1cf130['removeMarker'](_0x35601a);});});}['insertContent'](_0x3121fe,_0x112b63){const _0x16405f=this['_getAISelection'](),_0x351ae4=_0x112b63||_0x16405f['getFirstRange']();this['editor']['model']['canEditAt'](_0x351ae4)&&this['editor']['model']['change'](_0x1681b9=>{this['hideFakeVisualSelection'](),_0x112b63||this['_resetContentOfSelectedTableCells'](_0x1681b9,_0x16405f),this['_pasteHTMLUsingClipboard']({'insertAt':_0x351ae4,'writer':_0x1681b9,'html':_0x3121fe});});}['insertContentBelow'](_0x3a970c){const {model:_0x488f95}=this['editor'],_0x539788=this['_getAISelection']();_0x488f95['change'](()=>{const _0x1bfb5a=this['_prepareTableInsertBelowPosition'](_0x3a970c,_0x539788)||this['_getDefaultInsertBelowPosition'](_0x539788);this['insertContent'](_0x3a970c,_0x1bfb5a);});}['_getAISelection'](){const _0x2fff9c=this['editor']['model'],_0x1e3177=Array['from'](_0x2fff9c['markers']['getMarkersGroup'](w))['map'](_0x159d35=>_0x159d35['getRange']());return _0x2fff9c['createSelection'](_0x1e3177);}['_pasteHTMLUsingClipboard']({writer:_0x1dd3f7,html:_0x231097,insertAt:_0x295100}){const {view:_0x3cc9bf}=this['editor']['editing'],_0x5ad345=this['editor']['plugins']['get'](_0x2ede65),_0x5165c2=new gt();_0x5165c2['setData']('text/html',_0x231097);const _0x41a049=new ClipboardEvent('paste',{'clipboardData':_0x5165c2}),_0x2dd061=new _0x1ce5fe(_0x3cc9bf,_0x41a049,{'dataTransfer':new _0x49a740(_0x5165c2)});_0x1dd3f7['setSelection'](_0x295100);const _0x52a5c7=(_0x42e3ac,_0x2036fb)=>{_0x2036fb['resultRange']&&_0x1dd3f7['setSelection'](_0x2036fb['resultRange']);};_0x5ad345['once']('contentInsertion',_0x52a5c7,{'priority':'lowest'}),_0x3cc9bf['document']['fire']('paste',_0x2dd061),_0x5ad345['off']('contentInsertion',_0x52a5c7);}['_getDefaultInsertBelowPosition'](_0x428a20){const {model:_0x99005a}=this['editor'],_0x5f4250=Array['from'](_0x428a20['getSelectedBlocks']());return _0x5f4250['length']?_0x99005a['createPositionAfter'](_0x5f4250['pop']()):_0x428a20['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x9129ec,_0x28315c){const {model:_0x35a2d5,plugins:_0x581fa8}=this['editor'];if(_0x581fa8['has']('TableUtils')){const _0x2f990b=_0x581fa8['get']('TableUtils')['getSelectedTableCells'](_0x28315c);if(_0x2f990b['length']){const _0x309bff=this['_getTableRowCountFromContent'](_0x9129ec),_0x6cedfe=this['_createEmptyTableRows'](_0x2f990b,_0x309bff);return _0x35a2d5['createPositionAt'](_0x6cedfe,0x0);}}return null;}['_getTableRowCountFromContent'](_0x295ee8){const _0x40aa2c=this['editor']['plugins']['get']('TableUtils'),_0x25e430=this['editor']['data']['parse'](_0x295ee8),_0x2e7abd=Array['from'](_0x25e430['getChildren']())['filter'](_0xcff0db=>_0xcff0db['is']('element','table'));let _0x2d8944=0x0;return _0x2e7abd['forEach'](_0x28332d=>{_0x2d8944+=_0x40aa2c['getRows'](_0x28332d);}),_0x2d8944;}['_createEmptyTableRows'](_0x8d750,_0x350ce0){const _0x96491a=this['editor']['plugins']['get']('TableUtils'),_0x2b91ff=_0x96491a['getRowIndexes'](_0x8d750),_0x3f01c2=_0x96491a['getColumnIndexes'](_0x8d750),_0xcdc051=_0x2b91ff['last']+0x1,_0x2a7c63=_0x3f01c2['first'],_0x54f5e0=_0x8d750[0x0]['findAncestor']('table');for(let _0x14ab6d=0x0;_0x14ab6d<_0x350ce0;_0x14ab6d++)_0x96491a['insertRows'](_0x54f5e0,{'at':_0xcdc051});return _0x54f5e0['getChild'](_0xcdc051)['getChild'](_0x2a7c63);}['_resetContentOfSelectedTableCells'](_0x44e416,_0x49fe8b){const {plugins:_0x1c7a18}=this['editor'],{model:_0x3247cf}=_0x44e416;if(!_0x1c7a18['has']('TableUtils'))return;_0x1c7a18['get']('TableUtils')['getSelectedTableCells'](_0x49fe8b)['length']&&_0x3247cf['deleteContent'](_0x49fe8b);}}class x extends _0x515c0a{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0xed27b5('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x2e0918){super(_0x2e0918),this['name']='AIRequestError';}}function i(_0x1ad05e,_0x4b02de,_0x1d2f2c){const t=_0x1ad05e['t'];switch(_0x4b02de){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',_0x1d2f2c);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1d2f2c);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'},_0x1d2f2c);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 _0x4b02de;}}class E extends _0x11770b{['_commandDefinitions'];constructor(_0x2d4a09,_0x16a8ff){super(_0x2d4a09),this['_commandDefinitions']=_0x16a8ff,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x39c886,_0x2577f6,_0x4d4e4f)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x4d4e4f));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x7ac9dd,_0x55a908,_0x30876b)=>{this['enabledCommandsIds']=_0x30876b?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x1513f2=this['editor']['model'];this['_hasContext']=function(_0x48f389){const _0x411746=_0x48f389['document']['selection'];return _0x411746['isCollapsed']?0x0!==[..._0x411746['getSelectedBlocks']()]['length']&&![..._0x411746['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x48f389['hasContent'](_0x411746['getFirstRange']());}(_0x1513f2);const _0x549087=_0x1513f2['document']['selection'],_0x169ede=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x117cd3 of _0x549087['getRanges']())for(const _0x2faf50 of _0x117cd3['getItems']())if(_0x2faf50['is']('element')&&_0x169ede['includes'](_0x2faf50['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x2f1101='',_0x48ec91='',_0x476e0a='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x2f1101,_0x48ec91,_0x476e0a);}}function F(_0xa94ebc,_0x13f74e){const _0x2209db=new Set();for(const _0x46a2e5 of _0xa94ebc['values']())(_0x13f74e||!0x1===_0x46a2e5['requiresContent'])&&_0x2209db['add'](_0x46a2e5['id']);return Array['from'](_0x2209db);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x2c17f7(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x47c1f3,_0x318e6b,_0x36135a){super(),this['editor']=_0x47c1f3,this['textAdapter']=_0x318e6b,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x36135a,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1fbb70,_0x5e1e,_0x35360e)=>{this['view']['value']=this['_sanitizeHTML'](_0x35360e);}),this['listenTo'](this['view'],'submitPrompt',(_0x1d5e72,_0x50b2c8)=>{const _0x5b56cc=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x50b2c8,_0x5b56cc,'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:_0x13b30c,query:_0x31011d,htmlContent:_0x10f5cf,label:_0x7aaa8a,mainActionLabel:_0x3271c1}){this['view']['prompt']=_0x7aaa8a,this['view']['mainAction']=_0x3271c1,this['initialContext']=_0x10f5cf,_0x31011d&&(this['view']['isRendered']?this['_handleQuery'](_0x31011d,_0x10f5cf,_0x13b30c,_0x7aaa8a):this['view']['once']('render',()=>{this['_handleQuery'](_0x31011d,_0x10f5cf,_0x13b30c,_0x7aaa8a);}));}['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'](_0x1a0e3c,_0x3f37cc,_0x46527d,_0x46c7ca){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3f37cc,this['previousQuery']=_0x1a0e3c,this['previousLabel']=_0x46c7ca||_0x1a0e3c,this['previousActionId']=_0x46527d,new Promise(_0x452785=>{this['textAdapter']['makeRequest']({'query':_0x1a0e3c,'context':_0x3f37cc,'onData':_0x935ca5=>{this['currentResponse']=_0x935ca5,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x46527d})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x540040=>{_0x540040 instanceof R?this['view']['handleError'](_0x540040['message']):this['view']['handleError'](),_0x452785();})['finally'](()=>{this['stopProcessing'](),_0x452785();});});}['_parseAndNormalizeContent'](_0x3e5bef,_0x59d2f2=!0x1){const _0x554283=Q['exec'](_0x3e5bef);_0x3e5bef=_0x554283?_0x3e5bef['substring'](_0x554283[0x1]['length']):_0x3e5bef['length']<0x64&&!_0x59d2f2?'':this['_stripMarkdownSyntax'](_0x3e5bef);const _0x2b3845=this['_domParser']['parseFromString'](_0x3e5bef,'text/html');if(_0x554283){const _0x1a2542=Array['from'](_0x2b3845['body']['childNodes']);_0x1a2542['reverse']();for(const _0x14b2ec of _0x1a2542){if(_0x14b2ec['nodeType']==Node['ELEMENT_NODE'])break;_0x14b2ec['remove']();}}const _0x1b7ed4=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x2b3845['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x1b7ed4);const _0x2c011e=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x4917d4=this['editor']['data']['toModel'](_0x1b7ed4);return _0x2c011e||_0x4917d4['markers']['clear'](),this['editor']['data']['stringify'](_0x4917d4);}['_normalizeResponseHeadings'](_0x5abd7e){const _0x16cae1=new _0x3668d2(this['editor']['editing']['view']['document']),_0x29b7bb=new _0x59cd7f({'name':/^h[1-5]$/}),_0x4dd4d9=[];let _0xc9ac6c=!0x1;for(const _0x47885b of _0x5abd7e)_0x47885b['is']('element')&&_0x29b7bb['match'](_0x47885b)&&(_0x4dd4d9['push'](_0x47885b),'h1'==_0x47885b['name']&&(_0xc9ac6c=!0x0));if(_0xc9ac6c){for(const _0x5cece2 of _0x4dd4d9)_0x16cae1['rename']('h'+(parseInt(_0x5cece2['name'][0x1])+0x1),_0x5cece2);}}['_isH1TagSupportEnabled'](){const {data:_0x5d53b2,editing:_0x59c3fc}=this['editor'],_0x15a7cc=_0x5d53b2['htmlProcessor']['toView']('<h1></h1>'),_0x693ca2=_0x5d53b2['toView'](_0x5d53b2['toModel'](_0x15a7cc));return!!_0x59c3fc['view']['domConverter']['viewToDom'](_0x693ca2)['querySelector']('h1');}['_sanitizeHTML'](_0x334128){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x334128),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x2aed4e){const _0x27b332=_0x2aed4e['trim']();return _0x27b332['startsWith']('```html')?_0x27b332['endsWith']('```')?_0x27b332['substring'](0x7,_0x27b332['length']-0x3):_0x27b332['substring'](0x7):_0x2aed4e;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x4037fb){super(_0x4037fb),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xd66335=>i(_0x4037fb,'AI_'+_0xd66335['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x4037fb,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x4037fb,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x4037fb,'Stop'));const _0x2c02bd=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x2c02bd['if']('isVisible','ck-hidden',_0x27a031=>!_0x27a031)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x1a477c,_0x31d112){const _0x552c00=new _0x7a723e(this['locale']);return _0x552c00['set']({'label':_0x1a477c,'class':_0x31d112||'','isVisible':!0x0,'withText':!0x0}),_0x552c00;}}class ct extends _0x4351e1{['contentFieldView'];['copyButtonView'];constructor(_0x5e7407,_0x379496=''){super(_0x5e7407),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1c5062=this['bindTemplate'];this['contentFieldView']=new bt(_0x5e7407,_0x379496),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1c5062['if']('isVisible','ck-hidden',_0x15241d=>!_0x15241d)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1c5062['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 _0x3b0f06=!0x1;this['on']('change:value',(_0x4126e4,_0x740fd3,_0x319bb1)=>{const _0x269083=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x319bb1),this['isProcessing']&&_0x269083&&!_0x3b0f06&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x4a954b,_0x36c12a,_0x52afeb)=>{_0x3b0f06=!0x1,_0x52afeb?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x3b0f06=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x3b0f06=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x20c228=this['locale'],_0xce09a8=new _0x7a723e(this['locale']),_0x5a3e53='ck-ai-form__copy-button';return _0xce09a8['set']({'label':i(_0x20c228,'Copy'),'icon':_0xe75053,'class':_0x5a3e53,'tooltip':!0x0}),_0xce09a8['bind']('isVisible')['to'](this,'value',_0x190372=>!!_0x190372),_0xce09a8['bind']('isEnabled')['to'](this,'isProcessing',_0xcf1ca4=>!_0xcf1ca4),_0xce09a8['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0xce09a8['icon']=_0x4f032b,_0xce09a8['class']=_0x5a3e53+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0xce09a8['icon']=_0xe75053,_0xce09a8['class']=_0x5a3e53;},0x3e8);}),_0xce09a8;}['_copyHTMLToClipboard'](_0x298eb8){const {window:_0x5a09a1,document:_0x292364}=_0x9e473a;if(_0x5a09a1['ClipboardItem']){const {Blob:_0x506c91,ClipboardItem:_0xaf8d81}=_0x5a09a1,_0x1fd15d=[new _0xaf8d81({'text/html':new _0x506c91([_0x298eb8['innerHTML']],{'type':'text/html'}),'text/plain':new _0x506c91([_0x298eb8['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x1fd15d);}else{const _0x1b0f38=_0x292364['createElement']('div');_0x1b0f38['style']['position']='absolute',_0x1b0f38['style']['left']='-9999px',_0x1b0f38['innerHTML']='<span>[</span>'+_0x298eb8['innerHTML']+'<span>]</span>',_0x292364['body']['appendChild'](_0x1b0f38);const _0x84cb87=_0x292364['createRange']();_0x84cb87['setStartAfter'](_0x1b0f38['firstElementChild']),_0x84cb87['setEndBefore'](_0x1b0f38['lastElementChild']);const _0x1bb0f3=_0x5a09a1['getSelection']();_0x1bb0f3['removeAllRanges'](),_0x1bb0f3['addRange'](_0x84cb87),_0x292364['execCommand']('copy'),_0x1b0f38['remove']();}}}class bt extends _0x4351e1{constructor(_0x5cb708,_0x361f24=''){super(_0x5cb708),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x361f24,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x37dfed){this['element']['innerHTML']=_0x37dfed;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x19621e=new _0x4351e1(),_0x22f1cf=this['locale'],_0x29bf5a=new _0x54872b();return _0x29bf5a['isVisible']=!0x0,_0x19621e['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x29bf5a,{'text':i(_0x22f1cf,'AI\x20is\x20writing...')}]}),_0x19621e['render'](),_0x19621e;}}class mt extends _0x4351e1{constructor(_0x234216,_0x5952d5=''){super(_0x234216);const _0x484264=new _0x2a24ba(),_0x1816cb=this['bindTemplate'];this['set']('text',_0x5952d5),_0x484264['content']=_0x773f81,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x484264,{'text':_0x1816cb['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x13a18f,_0x438ecc){super(_0x13a18f,_0x438ecc),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',(_0x14ddfa,_0x2e0d8c)=>{_0x14ddfa['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x2e0d8c());});}['_createSubmitButton'](){const _0x51d252=new _0x7a723e(this['locale']),_0x5491b0=this['locale'];return _0x51d252['set']({'icon':it,'label':i(_0x5491b0,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x51d252['on']('execute',()=>{this['submit']();}),_0x51d252['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x963a4e,_0x9e86e3)=>!_0x963a4e&&_0x9e86e3),_0x51d252;}['_createShowHistoryButton'](){const _0x514a1b=new _0x7a723e(this['locale']),_0x1135c4=this['resultsView'],_0x2f9f78=this['locale'];_0x514a1b['set']({'label':i(_0x2f9f78,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x514a1b['bind']('isOn')['to'](_0x1135c4,'isVisible'),_0x514a1b['bind']('isEnabled')['to'](this,'isEnabled'),_0x514a1b['on']('execute',()=>{_0x1135c4['isVisible']=!_0x1135c4['isVisible'],_0x1135c4['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x1f4778=()=>{_0x9e473a['window']['requestAnimationFrame'](()=>{if(_0x52bac2(this['element'])){const _0x33473b=new _0x1b0bbc(this['queryView']['fieldView']['element']),_0x856ec=_0x33473b['width'],_0x33d75c='rtl'===_0x2f9f78['uiLanguageDirection']?'left':'right';_0x33473b['excludeScrollbarsAndBorders'](),_0x514a1b['element']['style'][_0x33d75c]=_0x856ec-_0x33473b['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x1f4778),this['on']('render',_0x1f4778),_0x514a1b;}['submit'](){const _0x4cd415=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x4cd415);}['focus'](_0xdb3df4){-0x1===_0xdb3df4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x193979){super(_0x193979),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x193979,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x287d32=0x0;for(const _0x4f86b6 of this['items'])_0x287d32+=_0x4f86b6['items']['length'];return{'resultsCount':_0x287d32,'totalItemsCount':_0x287d32};}['_createClearHistoryButton'](){const _0x134ce8=this['locale'],_0x370e13=new _0x7a723e(this['locale']);return _0x370e13['set']({'label':'('+i(_0x134ce8,'Clear')+')','withText':!0x0}),_0x370e13['on']('execute',()=>this['fire']('clearHistory')),_0x370e13;}}class ut extends xt{constructor(_0x3d5a0d){super();const _0x4e6f65=new wt(),_0x812dda=new _0x7a723e(this['locale'],_0x4e6f65);this['children']['add'](_0x812dda),_0x812dda['set']({'label':_0x3d5a0d['prompt'],'withText':!0x0}),_0x812dda['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x3d5a0d['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x47cb6e{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x4e6043,_0x15943b)=>{const _0x464c69=os(_0x15943b['prompt']);for(const _0x38a814 of this)if(_0x38a814!=_0x15943b&&os(_0x38a814['prompt'])===_0x464c69){this['remove'](_0x38a814);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x1aa665=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x1aa665));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x14e5ec=>_0x14e5ec)));}}function os(_0x294c08){return _0x294c08['toLowerCase']()['trim']();}class k extends _0x4351e1{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x4df651,_0xcb3d6b,_0x104e29=''){super(_0x4df651),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x4df651),this['contentArea']=new ct(_0x4df651,_0x104e29),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x56f4=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xcb3d6b],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x56f4['if']('isError','ck-hidden',_0x12bc58=>!_0x12bc58)]},'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'](_0x57bd9b=0x1){-0x1===_0x57bd9b?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 _0x22ff83=this['locale'],_0x4f022b=new lt(_0x22ff83,{'queryView':{'label':i(_0x22ff83,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x22ff83,'Empty\x20history'),'secondary':i(_0x22ff83,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x4f022b['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x536874,_0x42ed12)=>_0x536874&&!_0x42ed12),this['listenTo'](_0x4f022b,'submit',(_0x3e0b8f,_0x2105fd)=>{this['prompt']=_0x2105fd;const _0x366991=ft(_0x2105fd);this['fire']('submitPrompt',_0x366991),_0x2105fd['trim']()&&this['_promptHistory']['add']({'prompt':_0x366991},0x0);},{'priority':'high'}),_0x4f022b;}['_createHistoryView'](){const _0x2bf272=new pt(this['locale']);return _0x2bf272['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x2bf272['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x2bf272;}['_createToolbar'](){const _0x29f245=new at(this['locale']);return _0x29f245['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1f164f,_0x112b5a,_0x1bb60b)=>_0x1f164f&&!_0x112b5a&&!!_0x1bb60b),_0x29f245['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x29f245['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x30d1af,_0x2b8339,_0x2c9378)=>_0x30d1af&&!_0x2b8339&&!!_0x2c9378),_0x29f245['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x29f245['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x1fc73c,_0x7684e9)=>_0x1fc73c&&!_0x7684e9),_0x29f245['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x29f245['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x29f245['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x29f245;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x1091fb=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x1091fb,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x29ec65){const _0x229465=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x29ec65||i(_0x229465,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x515c0a{['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[_0x114521,a,x,_0x4a6f28];}constructor(_0x123941){super(_0x123941),_0x123941['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x123941['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x123941['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x123941['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x5b7ff5}=this;this['_aiAdapter']=_0x5b7ff5['plugins']['get'](x),this['_dialog']=_0x5b7ff5['plugins']['get'](_0x4a6f28),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x3cbe99=new E(_0x5b7ff5,Array['from'](this['_commandDefinitions']['values']()));_0x5b7ff5['commands']['add']('showAIAssistant',_0x3cbe99),_0x5b7ff5['ui']['componentFactory']['add']('aiCommands',_0x4434ae=>{const _0x106262=_0x502434(_0x4434ae);return _0x106262['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x106262['buttonView']['set']({'label':i(_0x4434ae,'AI\x20Commands'),'icon':_0x34e489,'tooltip':!0x0}),_0x106262['on']('execute',_0x278c6f=>this['_onExecute'](_0x278c6f['source']['id'])),_0x27fba4(_0x106262,_0x5b7ff5['ui']['view']['body'],function(_0x5a0e03){const _0xbfa58c=o(_0x5a0e03['config']['get']('ai.aiAssistant.commands'),_0x5a0e03['locale']),_0x3d5045=U(_0x5a0e03,_0xbfa58c)['filter'](_0xaf5d99=>_0xaf5d99['commands']['length']);if(0x1===_0x3d5045['length'])return U(_0x5a0e03,_0x3d5045[0x0]['commands'])['map'](_0x10fccb=>({'id':_0x10fccb['id'],'label':_0x10fccb['label']}));return _0x3d5045['map'](_0x59e7c9=>{const {groupId:_0x4a7489,groupLabel:_0x5bf595,commands:_0x36f909}=_0x59e7c9,_0x1542f0=U(_0x5a0e03,_0x36f909)['map'](_0xc5fb65=>({'id':_0xc5fb65['id'],'label':_0xc5fb65['label']}));return{'id':_0x4a7489,'menu':_0x5bf595||_0x4a7489,'children':_0x1542f0};});}(_0x5b7ff5),{'ariaLabel':i(_0x4434ae,'AI\x20Commands')}),_0x106262['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x3cbe99['on']('change:enabledCommandsIds',_0x516f2c),_0x106262['menuView']['once']('render',_0x516f2c),_0x106262;function _0x516f2c(){_0x106262['isEnabled']=_0x3cbe99['enabledCommandsIds']['length']>0x0;for(const _0x5581c3 of _0x106262['menuView']['buttons'])_0x5581c3['isEnabled']=_0x3cbe99['enabledCommandsIds']['includes'](_0x5581c3['id']);}}),_0x5b7ff5['ui']['componentFactory']['add']('menuBar:aiCommands',_0x37a826=>{const _0x15aae7=new _0x1506d9(_0x37a826);_0x15aae7['buttonView']['set']({'label':i(_0x37a826,'AI\x20Commands'),'icon':_0x34e489}),_0x15aae7['bind']('isEnabled')['to'](_0x3cbe99,'enabledCommandsIds',_0x2ccd1d=>_0x2ccd1d['length']>0x0);const _0x168c03=o(_0x5b7ff5['config']['get']('ai.aiAssistant.commands'),_0x37a826);return this['_populateMenuBarMenu'](_0x3cbe99,_0x15aae7,_0x168c03,_0x5dff9a=>this['_onExecute'](_0x5dff9a)),_0x15aae7;}),_0x5b7ff5['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x16d5d6=this['_createAIAssistantUIButton'](_0x7a723e);return _0x16d5d6['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x16d5d6;}),_0x5b7ff5['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x16969b=this['_createAIAssistantUIButton'](_0x34bfe7);return _0x16969b['set']({'role':'menuitemcheckbox'}),_0x16969b;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x116de8=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x38102e;for(const _0x4fc825 in _0x116de8){const _0x3d19ab=_0x4fc825,_0x35d547=_0x116de8[_0x3d19ab];if('aiLicenseKeyValid'==_0x35d547||'aiLicenseKeyInvalid'==_0x35d547||'aiLicenseKeyExpired'==_0x35d547||'aiLicenseKeyDomainLimit'==_0x35d547||'aiLicenseKeyNotAllowed'==_0x35d547||'aiLicenseKeyEvaluationLimit'==_0x35d547||'aiLicenseKeyTrialLimit'==_0x35d547||'aiLicenseKeyUsageLimit'==_0x35d547){delete _0x116de8[_0x3d19ab],_0x38102e=_0x35d547,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x38102e&&_0x116de8['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x38102e&&_0x116de8['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x38102e&&_0x116de8['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x38102e&&_0x116de8['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x38102e&&_0x116de8['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x38102e&&_0x116de8['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x38102e&&_0x116de8['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x422065='',_0x27ae7c='',_0xcc07c='custom'){const _0x2c350b=this['editor'],_0x36a39e=_0x2c350b['editing']['view'],_0x28acc1=_0x2c350b['plugins']['get'](a),_0x35036a=_0x2c350b['plugins']['get'](_0x114521);_0x28acc1['showFakeVisualSelection']();const _0x482c10=new l(),_0x378957=new ClipboardEvent('copy',{'clipboardData':_0x482c10}),_0x5ec60c=new _0x49a740(_0x482c10),_0x3736d7=new _0x1ce5fe(_0x36a39e,_0x378957,{'dataTransfer':_0x5ec60c});_0x35036a['_forceMarkersCopy']('comment',()=>{_0x36a39e['document']['fire']('copy',_0x3736d7);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x2c350b,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x2d9161=_0x5ec60c['getData']('text/html');const _0x411ee3=_0x2c350b['model']['document']['selection'],_0x5a41ab=Array['from'](_0x411ee3['getRanges']());0x1===_0x5a41ab['length']&&_0x5a41ab[0x0]['isFlat']&&!_0x411ee3['getSelectedElement']()&&''!==_0x2d9161['replace'](/ /g,'')['trim']()&&(_0x2d9161='<p>'+_0x2d9161+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0xcc07c,'query':_0x422065,'htmlContent':_0x2d9161,'label':_0x27ae7c,'mainActionLabel':_[_0x2c350b['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x3c77d6,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3b370c['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x28acc1['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x44fd1d=new Map(),_0x588033=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x10008d of _0x588033)for(const _0x196b35 of _0x10008d['commands'])_0x44fd1d['set'](_0x196b35['id'],{..._0x196b35,'groupId':_0x10008d['groupId'],'groupLabel':_0x10008d['groupLabel']||_0x10008d['groupId']});return _0x44fd1d;}['_createAIAssistantUIButton'](_0x578e2c){const _0x11fdca=this['editor'],_0x3cd337=_0x11fdca['commands']['get']('showAIAssistant'),_0x29770c=new _0x578e2c(_0x11fdca['locale']);return _0x29770c['set']({'label':i(_0x11fdca['locale'],'AI\x20Assistant'),'icon':_0x3c77d6,'isToggleable':!0x0}),_0x29770c['bind']('isEnabled')['to'](_0x3cd337),_0x29770c['bind']('isOn')['to'](this['_dialog'],'id',_0x593f8c=>'aiAssistant'===_0x593f8c),this['listenTo'](_0x29770c,'execute',()=>{_0x29770c['isOn']?this['hideUI']():_0x3cd337['execute']();}),_0x29770c;}['_initView'](){const _0x3f496f=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x3f496f['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x3f496f['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x3ab150,ui:{ariaLiveAnnouncer:_0x13d9ce}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x48ca1f,_0x2973ea,_0x1189b8)=>{const _0x20a7c8=this['_aiAssistantController']['currentContext'];_0x1189b8?_0x13d9ce['announce'](i(_0x3ab150,'AI\x20is\x20writing')):_0x20a7c8&&_0x13d9ce['announce'](i(_0x3ab150,'Generated\x20content:\x20%0',_0x20a7c8),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1ed199,_0x5a5374,_0x3c46f6)=>{if(_0x3c46f6){const _0xcad9f=this['_formView']['errorView']['text'];_0x13d9ce['announce'](i(_0x3ab150,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xcad9f));}});}['_onExecute'](_0x3f63f0){const _0x5426c4=this['_commandDefinitions']['get'](_0x3f63f0),_0x18214b=this['editor'],_0x5daeee=_0x18214b['model']['document']['selection'],_0x280077=_0x18214b['commands']['get']('showAIAssistant'),_0x15df05=_0x18214b['plugins']['get'](a),_0x409848=''+(_0x5426c4['groupId']!==K?_0x5426c4['groupLabel']+':\x20':'')+_0x5426c4['label'];if(!0x1!==_0x5426c4['requiresContent']&&_0x5daeee['isCollapsed']){const _0x5add39=_0x556a6f(_0x5daeee['getSelectedBlocks']())||_0x18214b['model']['schema']['getLimitElement'](_0x5daeee);_0x18214b['model']['change'](_0x287741=>{_0x287741['setSelection'](_0x5add39,'in');});}_0x15df05['showFakeVisualSelection'](),_0x280077['execute'](_0x5426c4['prompt'],_0x409848,'command:'+_0x3f63f0);}['_populateMenuBarMenu'](_0x459da0,_0x1f31c1,_0x53d220,_0x1c2d4d){const _0x4bd154=this['editor'],_0x207951=_0x4bd154['locale'],_0x5a9de0=new _0x3cd171(_0x207951),_0x2edb82=U(_0x4bd154,_0x53d220)['filter'](_0x7c76f=>_0x7c76f['commands']['length']);0x1===_0x2edb82['length']?this['_getMenuBarGroupButtons']({'command':_0x459da0,'commands':_0x2edb82[0x0]['commands'],'parentMenuView':_0x1f31c1,'onExecute':_0x1c2d4d})['forEach'](_0x5a2ac3=>_0x5a9de0['items']['add'](_0x5a2ac3)):_0x2edb82['forEach'](({groupId:_0x14d98f,groupLabel:_0x551c08,commands:_0x23c87b})=>{const _0xc3f21e=new _0x2e2987(_0x207951,_0x1f31c1),_0x2b161e=new _0x1506d9(_0x207951),_0x527ebd=new _0x3cd171(_0x207951),_0x9ccaf7=this['_getMenuBarGroupButtons']({'command':_0x459da0,'commands':_0x23c87b,'parentMenuView':_0x2b161e,'onExecute':_0x1c2d4d});_0x2b161e['buttonView']['set']({'label':_0x551c08||_0x14d98f}),_0x2b161e['delegate']('execute')['to'](_0x1f31c1),_0x527ebd['items']['addMany'](_0x9ccaf7),_0x2b161e['panelView']['children']['add'](_0x527ebd),_0xc3f21e['children']['add'](_0x2b161e),_0x5a9de0['items']['add'](_0xc3f21e);}),_0x1f31c1['panelView']['children']['add'](_0x5a9de0);}['_getMenuBarGroupButtons']({command:_0x402415,commands:_0xadfc4c,parentMenuView:_0x5766ff,onExecute:_0x358d10}){const _0x3cd2f0=this['editor'],_0x84219d=_0x3cd2f0['locale'];return U(_0x3cd2f0,_0xadfc4c)['map'](_0x198520=>{const _0x250c0e=new _0x2e2987(_0x84219d,_0x5766ff),_0x497841=new _0x34bfe7(_0x84219d);return _0x497841['set']({'label':_0x198520['label']}),_0x497841['delegate']('execute')['to'](_0x5766ff),_0x497841['on']('execute',()=>_0x358d10(_0x198520['id'])),_0x497841['bind']('isEnabled')['to'](_0x402415,'enabledCommandsIds',_0x4ccf2a=>_0x4ccf2a['includes'](_0x198520['id'])),_0x250c0e['children']['add'](_0x497841),_0x250c0e;});}}function T(_0x32a03d,_0x1f3fb8){return void 0x0!==_0x32a03d['order']&&void 0x0===_0x1f3fb8['order']?0x1:void 0x0===_0x32a03d['order']&&void 0x0!==_0x1f3fb8['order']?-0x1:void 0x0!==_0x32a03d['order']&&void 0x0!==_0x1f3fb8['order']?_0x32a03d['order']-_0x1f3fb8['order']:0x0;}function U(_0x14ffae,_0x28609d){_0x28609d['sort'](T);const _0x32b60a={},_0x309f5f=[];for(const _0x2ea631 of _0x28609d)if(void 0x0!==_0x2ea631['order']){if(_0x2ea631['order']in _0x32b60a)throw new _0xed27b5('ai-commands-config-order-collision',_0x14ffae,{'conflictingDefinitions':[_0x2ea631,_0x32b60a[_0x2ea631['order']]]});_0x32b60a[_0x2ea631['order']]=_0x2ea631,_0x309f5f['splice'](_0x2ea631['order'],0x0,_0x2ea631);}else _0x309f5f['push'](_0x2ea631);return _0x309f5f;}class At extends _0x515c0a{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4397fc){super(_0x4397fc);const _0x1ec184=_0x4397fc['config'],_0x775f0d=_0x4397fc['locale'];_0x1ec184['define']('ai.aiAssistant.preserveComments',!0x0),_0x1ec184['define']('ai.aiAssistant.commands',_t(_0x775f0d)),_0x1ec184['define']('ai.aiAssistant.extraCommandGroups',[]),_0x1ec184['define']('ai.aiAssistant.removeCommands',[]);let _0x46e7cf=o(_0x1ec184['get']('ai.aiAssistant.commands'),_0x775f0d);const _0x49cd6=_0x1ec184['get']('ai.aiAssistant.extraCommandGroups'),_0x4dfb6e=_0x1ec184['get']('ai.aiAssistant.removeCommands');_0x49cd6['forEach'](_0x2f4e86=>{const _0x3601fb=_0x46e7cf['find'](_0x328ff6=>_0x328ff6['groupId']===_0x2f4e86['groupId']);_0x3601fb?_0x3601fb['commands']=_0x3601fb['commands']['concat'](_0x2f4e86['commands']):_0x46e7cf['push'](_0x2f4e86);}),_0x46e7cf=_0x46e7cf['filter'](_0x391e54=>!_0x4dfb6e['includes'](_0x391e54['groupId'])),_0x46e7cf['forEach'](_0x3e05ee=>{_0x3e05ee['commands']=_0x3e05ee['commands']['filter'](_0x1fade0=>!_0x4dfb6e['includes'](_0x1fade0['id']));}),_0x1ec184['set']('ai.aiAssistant.commands',_0x46e7cf);}}function _t(_0xe3b550){return[{'groupId':'editOrReview','groupLabel':i(_0xe3b550,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0xe3b550,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0xe3b550,'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(_0xe3b550,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0xe3b550,'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(_0xe3b550,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0xe3b550,'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(_0xe3b550,'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(_0xe3b550,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0xe3b550,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0xe3b550,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0xe3b550,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0xe3b550,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0xe3b550,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0xe3b550,'Change\x20style'),'commands':[{'id':'business','label':i(_0xe3b550,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0xe3b550,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0xe3b550,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0xe3b550,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0xe3b550,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0xe3b550,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0xe3b550,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0xe3b550,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0xe3b550,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0xe3b550,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0xe3b550,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0xe3b550,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0xe3b550,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x515c0a{['abortController'];static get['requires'](){return[x];}constructor(_0x1454d6){super(_0x1454d6),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x4be1b4){return this['sendRequest'](_0x4be1b4)['catch'](_0x545071=>{if(_0x545071 instanceof R)return Promise['reject'](_0x545071);if('AbortError'==_0x545071['name'])return Promise['resolve']();throw console['error'](_0x545071),new _0xed27b5('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x581d6b,_0x133305){const _0xe4a06e=this['editor']['locale'],_0x4a8d1a={'Content-Type':'application/json'};if('object'==typeof _0x581d6b)Object['assign'](_0x4a8d1a,_0x581d6b);else{if(_0x581d6b)try{const _0x1a9a45=await _0x581d6b(_0x133305);Object['assign'](_0x4a8d1a,_0x1a9a45);}catch{return Promise['reject'](new R(i(_0xe4a06e,'AI_ERROR_GET_HEADERS')));}}return _0x4a8d1a;}async['_prepareRequestParameters'](_0x45ba57,_0x1fe826){const _0x1a98df=this['editor']['locale'];if('object'==typeof _0x45ba57)return _0x45ba57;try{return await _0x45ba57(_0x1fe826);}catch{return Promise['reject'](new R(i(_0x1a98df,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x1b28e1){super(_0x1b28e1),_0x1b28e1['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x1b28e1['config']['get']('ai.openAI.requestParameters')||_0x1b28e1['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x1b28e1['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x1b28e1['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x1b28e1['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x35287e,context:_0x49cefa,onData:_0x1b7ec2,actionId:_0x46c4a6}){const _0x4e5652=this['editor']['locale'],_0x57b57a=await this['prepareMessages'](_0x35287e,_0x49cefa,_0x46c4a6),_0x22afbd=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x46c4a6),_0x165a8c=await this['_prepareRequestParameters'](this['_requestParameters'],_0x46c4a6),_0x2f9c92={'messages':_0x57b57a,..._0x165a8c},_0x500063={'method':'POST','headers':_0x22afbd,'body':JSON['stringify'](_0x2f9c92),'signal':this['abortController']['signal']},_0x57ac91=await fetch(this['_apiUrl'],_0x500063);if(_0x57ac91['ok'])return _0x165a8c['stream']?await this['_readStreamableResponse'](_0x57ac91,_0x1b7ec2):await this['_readStaticResponse'](_0x57ac91,_0x1b7ec2),Promise['resolve']();{const _0x77dcb=await _0x57ac91['text']();return _0x77dcb['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x4e5652,'AI_ERROR_CONTEXT_LENGTH'))):_0x77dcb['includes']('Moderation')?Promise['reject'](new R(i(_0x4e5652,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x77dcb));}}async['prepareMessages'](_0x4d2029,_0x345b1d,_0x5e432e){let _0x525575,_0x127fe3;return _0x345b1d?(_0x525575='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.',_0x127fe3='Instruction:\x0a'+_0x4d2029+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x345b1d):(_0x525575='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.',_0x127fe3=_0x4d2029),[{'role':'system','content':_0x525575},{'role':'user','content':_0x127fe3}];}async['_readStreamableResponse'](_0x43fabc,_0x5a52c1){const _0x1d430d=_0x43fabc['body']['getReader'](),_0x2e9e8=new TextDecoder();let _0x508eb6='',_0xe99b1='',_0x56fa2c='',_0x18dcbd=!0x1;for(;!_0x18dcbd;){const {done:_0x375458,value:_0x2e9f14}=await _0x1d430d['read'](),_0x393cbe=_0x508eb6+_0x2e9e8['decode'](_0x2e9f14);let _0x65c289='';_0x18dcbd=_0x375458;try{_0x65c289=this['_cleanUpData'](_0x393cbe),_0x508eb6='';}catch{_0x508eb6=_0x393cbe;continue;}_0xe99b1+=_0x65c289,!_0x18dcbd&&this['_isBufferIncomplete'](_0xe99b1)||_0xe99b1&&(_0x56fa2c+=_0xe99b1,_0xe99b1='',_0x5a52c1(_0x56fa2c));}return Promise['resolve']();}async['_readStaticResponse'](_0x37a7c2,_0x338095){return _0x338095((await _0x37a7c2['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x25710c){const _0x18ed95=_0x25710c['split']('<')['length']!==_0x25710c['split']('>')['length'],_0x12d204=_0x25710c['length']<0x1e;return _0x18ed95&&_0x12d204;}['_cleanUpData'](_0x542111){return _0x542111['split'](/\n(?![^{]*\})/g)['map'](_0x21ffdf=>_0x21ffdf['replace']('data:\x20',''))['filter'](_0x35514e=>_0x35514e&&_0x35514e['length']>0x0&&'[DONE]'!==_0x35514e)['map'](_0x3beb40=>{const {choices:_0xbd3a8a}=JSON['parse'](_0x3beb40);if(_0xbd3a8a[0x0]?.['delta']?.['content'])return _0xbd3a8a[0x0]['delta']['content'];})['filter'](_0x43651d=>_0x43651d)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5a166f){super(_0x5a166f),_0x5a166f['config']['get']('ai.aws.requestParameters')||_0x5a166f['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']=_0x5a166f['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5a166f['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5a166f['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5a166f['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x29d7fa,context:_0x1bbb61,onData:_0x11d89b,actionId:_0x1ede9c}){const {model:_0x2edbc3,stream:_0xd2df99,..._0x34f9c5}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1ede9c),_0x47610d={'prompt':await this['preparePrompt'](_0x29d7fa,_0x1bbb61,_0x2edbc3,_0x1ede9c),..._0x34f9c5};this['_apiUrl']?await this['_processProxyRequest'](_0x47610d,_0x2edbc3,_0xd2df99,_0x11d89b,_0x1ede9c):await this['_processAWSRequest'](_0x47610d,_0x2edbc3,_0xd2df99,_0x11d89b);}async['preparePrompt'](_0x73e65,_0x248c45,_0xb89f0,_0x1f53e6){let _0x3ecafc,_0x8877d;return _0x248c45?(_0x3ecafc='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.',_0x8877d='Instruction:\x0a'+_0x73e65+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x248c45):(_0x3ecafc='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.',_0x8877d=_0x73e65),'meta.llama'==this['getModelFamily'](_0xb89f0)?'<<SYS>>\x0a'+_0x3ecafc+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x8877d+'\x0a[/INST]':'Human:\x0a'+_0x3ecafc+'\x0a'+_0x8877d+'\x0a\x0aAssistant:';}['getModelFamily'](_0x561492){if(/^anthropic\.claude/['test'](_0x561492))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x561492))return'ai21.j2';if(/^cohere\.command/['test'](_0x561492))return'cohere.command';if(/^meta\.llama/['test'](_0x561492))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x561492));}async['_processProxyRequest'](_0x563046,_0x52a7f9,_0x5c88f2,_0x1b636d,_0x280acc){const _0x549d68={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x280acc),'body':JSON['stringify']({..._0x563046,'model':_0x52a7f9,'stream':_0x5c88f2}),'signal':this['abortController']['signal']},_0x33c90a=await fetch(this['_apiUrl'],_0x549d68);_0x5c88f2?await this['_readStreamableResponse'](_0x33c90a,_0x52a7f9,_0x1b636d):await this['_readStaticResponse'](_0x33c90a,_0x52a7f9,_0x1b636d);}async['_processAWSRequest'](_0x4b33bd,_0x536b6f,_0xddb77c,_0x4326c4){const _0x56ecf8=new _0x261cf3(this['_bedrockClientConfig']),_0x4bf9c1={'body':JSON['stringify'](_0x4b33bd),'contentType':'application/json','accept':'application/json','modelId':_0x536b6f};let _0x482542;if(_0xddb77c){const _0x4ca438=new _0x3a8fdc(_0x4bf9c1);_0x482542=await _0x56ecf8['send'](_0x4ca438,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x482542,_0x536b6f,_0x4326c4);}else{const _0xff13=new _0x343b6e(_0x4bf9c1);_0x482542=await _0x56ecf8['send'](_0xff13,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x482542,_0x536b6f,_0x4326c4);}}async['_readAsyncIterableResponse'](_0x354cc5,_0x504346,_0x2f59bf){const _0x31bc90=_0x354cc5['body'],_0x48461d=new TextDecoder('utf-8');let _0x335025='';for await(const _0x334f94 of _0x31bc90)if(_0x334f94['chunk']){const _0x23f09c=_0x48461d['decode'](_0x334f94['chunk']['bytes']),_0x26fa3c=JSON['parse'](_0x23f09c);_0x335025+=this['_getGeneratedText'](_0x26fa3c,_0x504346),_0x2f59bf(_0x335025);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4a6b9b,_0x1553ee,_0x1a6c86){const _0x2ed237=_0x4a6b9b['body'],_0x5e5832=new TextDecoder('utf-8'),_0x5b9363=_0x2ed237['getReader']();let _0x431aed='',_0x4ec806='',_0x44cb49=!0x1;for(;!_0x44cb49;){const {done:_0x3d93d4,value:_0x3c3375}=await _0x5b9363['read']();if(_0x44cb49=_0x3d93d4,_0x44cb49)break;const _0x394cbb=(_0x431aed+_0x5e5832['decode'](_0x3c3375))['split']('\x0a')['map'](_0x4c1b94=>{try{return _0x431aed='',JSON['parse'](_0x4c1b94);}catch{return _0x431aed=_0x4c1b94,null;}})['filter'](_0xc1c837=>null!==_0xc1c837);_0x394cbb['length']&&(_0x4ec806+=_0x394cbb['map'](_0x322687=>this['_getGeneratedText'](_0x322687,_0x1553ee))['join'](''),_0x1a6c86(_0x4ec806));}return Promise['resolve']();}async['_readStaticResponse'](_0x1223b5,_0x2f6dfe,_0x2bad61){let _0x473d7b;return _0x473d7b=_0x1223b5 instanceof Response?await _0x1223b5['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0x1223b5['body'])),(_0x2bad61(this['_getGeneratedText'](_0x473d7b,_0x2f6dfe)),Promise['resolve']());}['_getGeneratedText'](_0x46fa8f,_0x5d36d7){switch(this['getModelFamily'](_0x5d36d7)){case'anthropic.claude':return _0x46fa8f['completion'];case'ai21.j2':return _0x46fa8f['completions'][0x0]['data']['text'];case'cohere.command':return _0x46fa8f['generations'][0x0]['text'];case'meta.llama':return _0x46fa8f['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
|
23
|
+
import{Plugin as _0x29bd45,Command as _0x5646ef}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconCopy as _0x429393,IconCheck as _0x158af4,IconError as _0x192700,IconSubmit as it,IconHistory as tt,IconMagicWand as _0x2ca237,IconRobotPencil as _0x59657e}from'@ckeditor/ckeditor5-icons/dist/index.js';import{uid as _0x553dc4,CKEditorError as _0x40cdb9,ObservableMixin as _0x4b0a14,global as _0x100eae,isVisible as _0x11da0b,Rect as _0x15f76d,Collection as _0x3f9d89,FocusTracker as et,KeystrokeHandler as rt,first as _0x46b51c}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as ot,ButtonView as _0x3b2709,View as _0x224a57,SpinnerView as _0x1ba79e,IconView as _0x155397,AutocompleteView as st,ListView as yt,ListItemGroupView as Ct,ListItemView as xt,ButtonLabelView as wt,FocusCycler as ht,createLabeledTextarea as nt,Dialog as _0x50a1ff,createDropdown as _0x506fc8,addMenuToDropdown as _0x55b2b7,MenuBarMenuView as _0x53eca6,MenuBarMenuListItemButtonView as _0x5700d7,DialogViewPosition as _0x3acd8c,MenuBarMenuListView as _0x1f29e6,MenuBarMenuListItemView as _0x596962}from'@ckeditor/ckeditor5-ui/dist/index.js';import{ClipboardPipeline as _0x4244aa,ClipboardMarkersUtils as _0x4f6a0a}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{ViewDocumentDomEventData as _0x168cd6,ViewDataTransfer as _0x41db82,ViewUpcastWriter as _0x1e662c,Matcher as _0x55411c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as kt,escape as ft}from'es-toolkit/compat';import{BedrockRuntimeClient as _0x3c59b0,InvokeModelWithResponseStreamCommand as _0x3875c7,InvokeModelCommand as _0x23ebfb}from'@aws-sdk/client-bedrock-runtime';const K='_ungrouppedCommands';function o(_0x57ada7,_0x2346ab){const _0x2888b=(0x0,_0x2346ab['t'])('Other');return _0x57ada7['length']?'groupId'in _0x57ada7[0x0]?_0x57ada7:[{'groupId':K,'groupLabel':_0x2888b,'order':0x1/0x0,'commands':_0x57ada7}]:[{'groupId':K,'groupLabel':_0x2888b,'order':0x1/0x0,'commands':[]}];}const gt=globalThis['DataTransfer'],w='ai-ui';class a extends _0x29bd45{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0xefdf26}=this,_0x26fa50=['ck-fake-ai-selection'];_0xefdf26['config']['get']('ai.useTheme')&&_0x26fa50['push']('ck-ai-assistant-ui_theme'),_0xefdf26['conversion']['for']('editingDowncast')['markerToHighlight']({'model':w,'view':{'classes':_0x26fa50,'priority':0xc}}),_0xefdf26['conversion']['for']('editingDowncast')['markerToElement']({'model':w,'view':(_0x2ea92e,{writer:_0x12359f})=>{if(!_0x2ea92e['markerRange']['isCollapsed'])return null;const _0x3439e1=_0x12359f['createUIElement']('span');return _0x12359f['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x3439e1),_0x3439e1;}});}['afterInit'](){!async function(_0x20dc70){const _0x2ed1b2=_0xdb42bd([0x54,0x42,0x73,0x4c,0x38,0x6a,0x61,0x6b,0x41,0x6e,0x43,0x37,0x47,0x75,0x6c,0x6f,0x5a,0x7a,0x53,0x59,0x44,0x45,0x39,0x52,0x63,0x66,0x74,0x4d,0x4f,0x51,0x65,0x78,0x35,0x4b,0x70,0x31,0x58,0x67,0x57,0x6d,0x4e,0x55,0x62,0x50,0x36,0x4a,0x30,0x71,0x49,0x56,0x48,0x64,0x68,0x76,0x69,0x32,0x33,0x34,0x77,0x72,0x79,0x46]),_0x35e853=0x2861a6d9,_0x3b04a1=0x2866c921^_0x35e853,_0x329610=window[_0xdb42bd([0x44,0x61,0x74,0x65])][_0xdb42bd([0x6e,0x6f,0x77])](),_0x1dc6c0=_0x20dc70[_0xdb42bd([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x5940ce=new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x119dec=>{_0x1dc6c0[_0xdb42bd([0x6f,0x6e,0x63,0x65])](_0xdb42bd([0x72,0x65,0x61,0x64,0x79]),_0x119dec);}),_0x421e30={[_0xdb42bd([0x6b,0x74,0x79])]:_0xdb42bd([0x45,0x43]),[_0xdb42bd([0x75,0x73,0x65])]:_0xdb42bd([0x73,0x69,0x67]),[_0xdb42bd([0x63,0x72,0x76])]:_0xdb42bd([0x50,0x2d,0x32,0x35,0x36]),[_0xdb42bd([0x78])]:_0xdb42bd([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]),[_0xdb42bd([0x79])]:_0xdb42bd([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]),[_0xdb42bd([0x61,0x6c,0x67])]:_0xdb42bd([0x45,0x53,0x32,0x35,0x36])},_0x4eae7e=_0x1dc6c0[_0xdb42bd([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0xdb42bd([0x67,0x65,0x74])](_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5b63b8(){let _0x447dbe,_0x44dac1=null,_0x2cf535=null;try{if(_0x4eae7e==_0xdb42bd([0x47,0x50,0x4c]))return _0xdb42bd([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x447dbe=_0x574234(),!_0x447dbe)return _0xdb42bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x447dbe[_0xdb42bd([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x2cf535=_0x57df7a(_0x447dbe[_0xdb42bd([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x447dbe[_0xdb42bd([0x6a,0x74,0x69])])),await _0x530589()?_0x1f5bf0()?_0x5a2316()?_0xdb42bd([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x4d80ec()?(_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xdb42bd([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x44dac1=_0x34b8be(_0xdb42bd([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0xdb42bd([0x74,0x72,0x69,0x61,0x6c])&&(_0x44dac1=_0x34b8be(_0xdb42bd([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x541aa0()):_0xdb42bd([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0xdb42bd([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0xdb42bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0xdb42bd([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x5a2316(){const _0x2abc3e=[_0xdb42bd([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0xdb42bd([0x74,0x72,0x69,0x61,0x6c])][_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x329610/0x3e8:0xe10*_0x3b04a1;return _0x447dbe[_0xdb42bd([0x65,0x78,0x70])]<_0x2abc3e;}function _0x1f5bf0(){const _0x44ec63=_0x447dbe[_0xdb42bd([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x44ec63&&(!!_0x44ec63[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xdb42bd([0x2a]))||!!_0x44ec63[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xdb42bd([0x41,0x49])));}function _0x4d80ec(){const _0x325b62=_0x447dbe[_0xdb42bd([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x325b62||0x0==_0x325b62[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x7fb5fa}=new URL(window[_0xdb42bd([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x325b62[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x7fb5fa))return!0x0;const _0x283044=_0x7fb5fa[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e]));return _0x325b62[_0xdb42bd([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x3c7ab5=>_0x3c7ab5[_0xdb42bd([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0xdb42bd([0x2a])))[_0xdb42bd([0x6d,0x61,0x70])](_0x2b0db7=>_0x2b0db7[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e])))[_0xdb42bd([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x5a9330=>_0x5a9330[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x283044[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xdb42bd([0x6d,0x61,0x70])](_0x371a08=>Array(_0x283044[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x371a08[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0xdb42bd([0x66,0x69,0x6c,0x6c])](_0x371a08[0x0]===_0xdb42bd([0x2a])?_0xdb42bd([0x2a]):'')[_0xdb42bd([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x371a08))[_0xdb42bd([0x73,0x6f,0x6d,0x65])](_0x2131af=>_0x283044[_0xdb42bd([0x65,0x76,0x65,0x72,0x79])]((_0x8a1669,_0x33ffd2)=>_0x2131af[_0x33ffd2]===_0x8a1669||_0x2131af[_0x33ffd2]===_0xdb42bd([0x2a])));}function _0x541aa0(){return _0x44dac1&&_0x2cf535?new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4f82d0,_0x2aaa3f)=>{_0x44dac1[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x4f82d0,_0x2aaa3f),_0x2cf535[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x32cfde=>{_0x32cfde!=_0xdb42bd([0x56,0x61,0x6c,0x69,0x64])&&_0x4f82d0(_0x32cfde);},_0x2aaa3f);}):_0x44dac1||_0x2cf535||_0xdb42bd([0x56,0x61,0x6c,0x69,0x64]);}}function _0x57df7a(_0x45b0e0,_0x27e919){return new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4042fb=>{if(_0x4dae00())return _0x4042fb(_0xdb42bd([0x56,0x61,0x6c,0x69,0x64]));_0x44433f(),_0x1dc6c0[_0xdb42bd([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0xdb42bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xbec89f=!0x1;const _0x24e188=_0x553dc4();function _0x405850(_0x2ccdb1){return!!_0x2ccdb1&&(typeof _0x2ccdb1===_0xdb42bd([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x2ccdb1===_0xdb42bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x2ccdb1[_0xdb42bd([0x74,0x68,0x65,0x6e])]===_0xdb42bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x2ccdb1[_0xdb42bd([0x63,0x61,0x74,0x63,0x68])]===_0xdb42bd([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x4c9a5a(_0x360da3){_0x2dfb1b(_0x360da3)[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x27f328=>{if(!_0x27f328||_0x27f328[_0xdb42bd([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0xdb42bd([0x6f,0x6b]))return _0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xb4b0e7(_0x23d9dc(_0x24e188+_0x27e919))!=_0x27f328[_0xdb42bd([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0xdb42bd([0x56,0x61,0x6c,0x69,0x64]);})[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x2a60dc=>(_0x6933e4(),_0x2a60dc),()=>{const _0x2196a8=_0x5d9b5a();return null==_0x2196a8?(_0x6933e4(),_0xdb42bd([0x56,0x61,0x6c,0x69,0x64])):_0xdb42bd(_0x329610-_0x2196a8>(0xc6d22d9^_0x35e853)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x4042fb)[_0xdb42bd([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4042fb(_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x2ef24f=0x28574859^_0x35e853;function _0x6933e4(){const _0x4ee5be=_0xdb42bd([0x6c,0x6c,0x63,0x74,0x2d])+_0xb4b0e7(_0x23d9dc(_0x45b0e0)),_0x47016d=_0x1824f8(_0xb4b0e7(window[_0xdb42bd([0x4d,0x61,0x74,0x68])][_0xdb42bd([0x63,0x65,0x69,0x6c])](_0x329610/_0x2ef24f)));window[_0xdb42bd([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xdb42bd([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4ee5be,_0x47016d);}function _0x5d9b5a(){const _0x8c43ce=_0xdb42bd([0x6c,0x6c,0x63,0x74,0x2d])+_0xb4b0e7(_0x23d9dc(_0x45b0e0)),_0x429fc6=window[_0xdb42bd([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0xdb42bd([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x8c43ce);return _0x429fc6?window[_0xdb42bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1824f8(_0x429fc6),0x10)*_0x2ef24f:null;}function _0x2dfb1b(_0x202487){return new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x199dc9,_0x3e13a6)=>{_0x202487[_0xdb42bd([0x74,0x68,0x65,0x6e])](_0x199dc9,_0x3e13a6),window[_0xdb42bd([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x3e13a6,0x28607219^_0x35e853);});}}_0x1dc6c0[_0xdb42bd([0x6f,0x6e])](_0xdb42bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1c9477,_0x23e0ec)=>{if(_0x23e0ec[0x0]!=_0x45b0e0)return _0x4042fb(_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x23e0ec[0x1]={..._0x23e0ec[0x1],[_0xdb42bd([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x24e188};},{[_0xdb42bd([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xdb42bd([0x68,0x69,0x67,0x68])}),_0x1dc6c0[_0xdb42bd([0x6f,0x6e])](_0xdb42bd([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x5628d3=>{_0x405850(_0x5628d3[_0xdb42bd([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xbec89f=!0x0,_0x4c9a5a(_0x5628d3[_0xdb42bd([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0xdb42bd([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0xdb42bd([0x6c,0x6f,0x77])}),_0x5940ce[_0xdb42bd([0x74,0x68,0x65,0x6e])](()=>{_0xbec89f||_0x4042fb(_0xdb42bd([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4dae00(){return _0x1dc6c0[_0xdb42bd([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xdb42bd([0x76,0x69,0x65,0x77])][_0xdb42bd([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0xdb42bd([0x61,0x75,0x74,0x6f]);}function _0x44433f(){_0x1dc6c0[_0xdb42bd([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0xdb42bd([0x76,0x69,0x65,0x77])][_0xdb42bd([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0xdb42bd([0x61,0x75,0x74,0x6f]);}}function _0x34b8be(_0x3e4447){const _0x4d9969=[new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4ee5d2=>setTimeout(_0x4ee5d2,0x28689815^_0x35e853)),_0x5940ce[_0xdb42bd([0x74,0x68,0x65,0x6e])](()=>new window[(_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x32e352=>{let _0x349a27=0x0;_0x1dc6c0[_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c])][_0xdb42bd([0x6f,0x6e])](_0xdb42bd([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x40f691,_0x402a97)=>{_0x402a97[0x0][_0xdb42bd([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x349a27++,_0x349a27==(0x2861a721^_0x35e853)&&(_0x32e352(),_0x40f691[_0xdb42bd([0x6f,0x66,0x66])]());});}))];return window[_0xdb42bd([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0xdb42bd([0x72,0x61,0x63,0x65])](_0x4d9969)[_0xdb42bd([0x74,0x68,0x65,0x6e])](()=>_0x3e4447);}async function _0x1bb410(){await _0x5940ce,_0x1dc6c0[_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c])][_0xdb42bd([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x5ef224,_0x1dc6c0[_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c])][_0xdb42bd([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x5ef224,_0x1dc6c0[_0xdb42bd([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0xdb42bd([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3adbba(_0x4d7839){const _0x18a93b=_0x3b59e4();_0x1dc6c0[_0x18a93b]=_0xdb42bd([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x4d7839,_0x4d7839!=_0xdb42bd([0x56,0x61,0x6c,0x69,0x64])&&_0x1bb410();}function _0x3b59e4(){const _0x1b18a2=window[_0xdb42bd([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0xdb42bd([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0xdb42bd([0x6e,0x6f,0x77])]())[_0xdb42bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0xdb42bd([0x2e]),'');let _0x3c8a2c=_0xdb42bd([0x54]);for(let _0x1a0cca=0x0;_0x1a0cca<_0x1b18a2[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x1a0cca+=0x2){let _0x1f1fbd=window[_0xdb42bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1b18a2[_0xdb42bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x1a0cca,_0x1a0cca+0x2));_0x1f1fbd>=_0x2ed1b2[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1f1fbd-=_0x2ed1b2[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x3c8a2c+=_0x2ed1b2[_0x1f1fbd];}return _0x3c8a2c;}function _0x574234(){const _0x38471b=_0x4eae7e[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e]));if(0x3!=_0x38471b[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x369c1b(_0x38471b[0x1]);function _0x369c1b(_0xfe9a15){const _0x2c646c=_0x41e3fe(_0xfe9a15);return _0x2c646c&&_0x52c3ff()?_0x2c646c:null;function _0x52c3ff(){const _0x211049=_0x2c646c[_0xdb42bd([0x6a,0x74,0x69])],_0x23cc11=window[_0xdb42bd([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x211049[_0xdb42bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x211049[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x37baf8={..._0x2c646c,[_0xdb42bd([0x6a,0x74,0x69])]:_0x211049[_0xdb42bd([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x211049[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x37baf8[_0xdb42bd([0x76,0x63])],_0x23d9dc(_0x37baf8)==_0x23cc11;}}}async function _0x530589(){let _0x3d8e8b=!0x0;try{const _0x5516c3=_0x4eae7e[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])](_0xdb42bd([0x2e])),[_0x5af5ad,_0x7894d7,_0x5d5bb9]=_0x5516c3;return _0x1fd28a(_0x5af5ad),await _0x51f5f0(_0x5af5ad,_0x7894d7,_0x5d5bb9),_0x3d8e8b;}catch{return!0x1;}function _0x1fd28a(_0xba6978){const _0x9dea60=_0x41e3fe(_0xba6978);_0x9dea60&&_0x9dea60[_0xdb42bd([0x61,0x6c,0x67])]==_0xdb42bd([0x45,0x53,0x32,0x35,0x36])||(_0x3d8e8b=!0x1);}async function _0x51f5f0(_0xad0ab1,_0xfdc993,_0x34c26f){const _0x132791=window[_0xdb42bd([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0xdb42bd([0x66,0x72,0x6f,0x6d])](_0x36d54a(_0x34c26f),_0x1acd44=>_0x1acd44[_0xdb42bd([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2bd8c2=new window[(_0xdb42bd([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0xdb42bd([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xad0ab1+_0xdb42bd([0x2e])+_0xfdc993),_0x425166=window[_0xdb42bd([0x63,0x72,0x79,0x70,0x74,0x6f])][_0xdb42bd([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x425166)return;const _0x5d0323=await _0x425166[_0xdb42bd([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0xdb42bd([0x6a,0x77,0x6b]),_0x421e30,{[_0xdb42bd([0x6e,0x61,0x6d,0x65])]:_0xdb42bd([0x45,0x43,0x44,0x53,0x41]),[_0xdb42bd([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0xdb42bd([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0xdb42bd([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x425166[_0xdb42bd([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0xdb42bd([0x6e,0x61,0x6d,0x65])]:_0xdb42bd([0x45,0x43,0x44,0x53,0x41]),[_0xdb42bd([0x68,0x61,0x73,0x68])]:{[_0xdb42bd([0x6e,0x61,0x6d,0x65])]:_0xdb42bd([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5d0323,_0x132791,_0x2bd8c2)||(_0x3d8e8b=!0x1);}}function _0x41e3fe(_0x33e6e7){return _0x33e6e7[_0xdb42bd([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0xdb42bd([0x65,0x79]))?JSON[_0xdb42bd([0x70,0x61,0x72,0x73,0x65])](_0x36d54a(_0x33e6e7)):null;}function _0x36d54a(_0x312793){return window[_0xdb42bd([0x61,0x74,0x6f,0x62])](_0x312793[_0xdb42bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0xdb42bd([0x2b]))[_0xdb42bd([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0xdb42bd([0x2f])));}function _0x23d9dc(_0x3809ac){let _0x373ae5=0x1505;function _0x1be18d(_0x5a2bcf){for(let _0x54c31e=0x0;_0x54c31e<_0x5a2bcf[_0xdb42bd([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x54c31e++){const _0x44bcf8=_0x5a2bcf[_0xdb42bd([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x54c31e);_0x373ae5=(_0x373ae5<<0x5)+_0x373ae5+_0x44bcf8,_0x373ae5&=_0x373ae5;}}function _0x1ebfb2(_0x345f76){Array[_0xdb42bd([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x345f76)?_0x345f76[_0xdb42bd([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x1ebfb2):_0x345f76&&typeof _0x345f76==_0xdb42bd([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0xdb42bd([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x345f76)[_0xdb42bd([0x73,0x6f,0x72,0x74])]()[_0xdb42bd([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x52e678,_0x4258e7])=>{_0x1be18d(_0x52e678),_0x1ebfb2(_0x4258e7);}):_0x1be18d(window[_0xdb42bd([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x345f76));}return _0x1ebfb2(_0x3809ac),_0x373ae5>>>0x0;}function _0xb4b0e7(_0x1bd27b){return _0x1bd27b[_0xdb42bd([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0xdb42bd([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0xdb42bd([0x30]));}function _0x1824f8(_0x30b24d){return _0x30b24d[_0xdb42bd([0x73,0x70,0x6c,0x69,0x74])]('')[_0xdb42bd([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0xdb42bd([0x6a,0x6f,0x69,0x6e])]('');}function _0x5ef224(){}function _0xdb42bd(_0x55e730){return _0x55e730['map'](_0x1ea7bb=>String['fromCharCode'](_0x1ea7bb))['join']('');}_0x3adbba(await _0x5b63b8());}(this);}['showFakeVisualSelection'](){const _0x5ee019=this['editor']['model'];_0x5ee019['change'](_0x597005=>{const _0x262d15=_0x5ee019['document']['selection']['getRanges']();let _0x5f3d31=0x0;for(const _0x4abc43 of _0x262d15){const _0x3bda9f=w+':'+_0x5f3d31;if(_0x5ee019['markers']['has'](_0x3bda9f))_0x597005['updateMarker'](_0x3bda9f,{'range':_0x4abc43});else{if(_0x4abc43['start']['isAtEnd']){const _0x207da9=_0x4abc43['start']['getLastMatchingPosition'](({item:_0x1429bc})=>!_0x5ee019['schema']['isContent'](_0x1429bc),{'boundaries':_0x4abc43});_0x597005['addMarker'](_0x3bda9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x597005['createRange'](_0x207da9,_0x4abc43['end'])});}else _0x597005['addMarker'](_0x3bda9f,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x4abc43});}_0x5f3d31++;}});}['hideFakeVisualSelection'](){const _0x4262ff=this['editor']['model'],_0x4f662e=Array['from'](this['editor']['model']['markers']['getMarkersGroup'](w));_0x4f662e['length']&&_0x4262ff['change'](_0x1e71a2=>{_0x4f662e['forEach'](_0x332774=>{_0x1e71a2['removeMarker'](_0x332774);});});}['insertContent'](_0x2d09c2,_0x23a301){const _0x46ac13=this['_getAISelection'](),_0x339cc8=_0x23a301||_0x46ac13['getFirstRange']();this['editor']['model']['canEditAt'](_0x339cc8)&&this['editor']['model']['change'](_0x1a89eb=>{this['hideFakeVisualSelection'](),_0x23a301||this['_resetContentOfSelectedTableCells'](_0x1a89eb,_0x46ac13),this['_pasteHTMLUsingClipboard']({'insertAt':_0x339cc8,'writer':_0x1a89eb,'html':_0x2d09c2});});}['insertContentBelow'](_0x29274b){const {model:_0x212991}=this['editor'],_0x35b27b=this['_getAISelection']();_0x212991['change'](()=>{const _0x67f6b2=this['_prepareTableInsertBelowPosition'](_0x29274b,_0x35b27b)||this['_getDefaultInsertBelowPosition'](_0x35b27b);this['insertContent'](_0x29274b,_0x67f6b2);});}['_getAISelection'](){const _0x438c50=this['editor']['model'],_0x27f08e=Array['from'](_0x438c50['markers']['getMarkersGroup'](w))['map'](_0x5661b9=>_0x5661b9['getRange']());return _0x438c50['createSelection'](_0x27f08e);}['_pasteHTMLUsingClipboard']({writer:_0x36fc3f,html:_0x31e81b,insertAt:_0x248f22}){const {view:_0x2d70d2}=this['editor']['editing'],_0x4206bb=this['editor']['plugins']['get'](_0x4244aa),_0x2ff2d9=new gt();_0x2ff2d9['setData']('text/html',_0x31e81b);const _0x12f2b9=new ClipboardEvent('paste',{'clipboardData':_0x2ff2d9}),_0x31ddbe=new _0x168cd6(_0x2d70d2,_0x12f2b9,{'dataTransfer':new _0x41db82(_0x2ff2d9)});_0x36fc3f['setSelection'](_0x248f22);const _0x3ce001=(_0xc009e5,_0x3ada4a)=>{_0x3ada4a['resultRange']&&_0x36fc3f['setSelection'](_0x3ada4a['resultRange']);};_0x4206bb['once']('contentInsertion',_0x3ce001,{'priority':'lowest'}),_0x2d70d2['document']['fire']('paste',_0x31ddbe),_0x4206bb['off']('contentInsertion',_0x3ce001);}['_getDefaultInsertBelowPosition'](_0x16015b){const {model:_0x4382d3}=this['editor'],_0x4aee80=Array['from'](_0x16015b['getSelectedBlocks']());return _0x4aee80['length']?_0x4382d3['createPositionAfter'](_0x4aee80['pop']()):_0x16015b['getLastPosition']();}['_prepareTableInsertBelowPosition'](_0x267e51,_0xa16efb){const {model:_0x2d918d,plugins:_0x278ec4}=this['editor'];if(_0x278ec4['has']('TableUtils')){const _0x136ace=_0x278ec4['get']('TableUtils')['getSelectedTableCells'](_0xa16efb);if(_0x136ace['length']){const _0x11cbfc=this['_getTableRowCountFromContent'](_0x267e51),_0x534128=this['_createEmptyTableRows'](_0x136ace,_0x11cbfc);return _0x2d918d['createPositionAt'](_0x534128,0x0);}}return null;}['_getTableRowCountFromContent'](_0x365e30){const _0x425b7d=this['editor']['plugins']['get']('TableUtils'),_0x34a12b=this['editor']['data']['parse'](_0x365e30),_0x523f66=Array['from'](_0x34a12b['getChildren']())['filter'](_0x33152d=>_0x33152d['is']('element','table'));let _0x2bc893=0x0;return _0x523f66['forEach'](_0x22dbda=>{_0x2bc893+=_0x425b7d['getRows'](_0x22dbda);}),_0x2bc893;}['_createEmptyTableRows'](_0x2d7641,_0x498217){const _0x3ca44c=this['editor']['plugins']['get']('TableUtils'),_0x3856a8=_0x3ca44c['getRowIndexes'](_0x2d7641),_0x45a657=_0x3ca44c['getColumnIndexes'](_0x2d7641),_0x192f43=_0x3856a8['last']+0x1,_0x3f8bf7=_0x45a657['first'],_0x16992e=_0x2d7641[0x0]['findAncestor']('table');for(let _0x4c50bd=0x0;_0x4c50bd<_0x498217;_0x4c50bd++)_0x3ca44c['insertRows'](_0x16992e,{'at':_0x192f43});return _0x16992e['getChild'](_0x192f43)['getChild'](_0x3f8bf7);}['_resetContentOfSelectedTableCells'](_0x2450f2,_0x585264){const {plugins:_0x2384db}=this['editor'],{model:_0x528044}=_0x2450f2;if(!_0x2384db['has']('TableUtils'))return;_0x2384db['get']('TableUtils')['getSelectedTableCells'](_0x585264)['length']&&_0x528044['deleteContent'](_0x585264);}}class x extends _0x29bd45{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x40cdb9('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x212093){super(_0x212093),this['name']='AIRequestError';}}function i(_0x5c8a30,_0x344fbd,_0x5ef7c0){const t=_0x5c8a30['t'];switch(_0x344fbd){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',_0x5ef7c0);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x5ef7c0);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'},_0x5ef7c0);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 _0x344fbd;}}class E extends _0x5646ef{['_commandDefinitions'];constructor(_0x16d36d,_0x521d8b){super(_0x16d36d),this['_commandDefinitions']=_0x521d8b,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x46d916,_0x2aad4a,_0x2f220e)=>{this['isEnabled']&&(this['enabledCommandsIds']=F(this['_commandDefinitions'],_0x2f220e));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x480bb1,_0x11bcfa,_0x5a5cd1)=>{this['enabledCommandsIds']=_0x5a5cd1?F(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x25f676=this['editor']['model'];this['_hasContext']=function(_0x40f1dc){const _0x3521ce=_0x40f1dc['document']['selection'];return _0x3521ce['isCollapsed']?0x0!==[..._0x3521ce['getSelectedBlocks']()]['length']&&![..._0x3521ce['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x40f1dc['hasContent'](_0x3521ce['getFirstRange']());}(_0x25f676);const _0x3c6b7f=_0x25f676['document']['selection'],_0x3b65e0=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1512b7 of _0x3c6b7f['getRanges']())for(const _0x112ad4 of _0x1512b7['getItems']())if(_0x112ad4['is']('element')&&_0x3b65e0['includes'](_0x112ad4['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x7b8ad8='',_0x315c77='',_0x5adac2='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x7b8ad8,_0x315c77,_0x5adac2);}}function F(_0x13f61b,_0x3774b2){const _0xcc8a60=new Set();for(const _0x429877 of _0x13f61b['values']())(_0x3774b2||!0x1===_0x429877['requiresContent'])&&_0xcc8a60['add'](_0x429877['id']);return Array['from'](_0xcc8a60);}const Q=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x4b0a14(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4c649b,_0x6095e8,_0xf1832c){super(),this['editor']=_0x4c649b,this['textAdapter']=_0x6095e8,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0xf1832c,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x1feb31,_0x138fcc,_0x40ef41)=>{this['view']['value']=this['_sanitizeHTML'](_0x40ef41);}),this['listenTo'](this['view'],'submitPrompt',(_0x2c0195,_0x4012e1)=>{const _0x1ed873=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x4012e1,_0x1ed873,'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:_0x3984d7,query:_0x2ccd3f,htmlContent:_0x3c5368,label:_0x3b3ee7,mainActionLabel:_0x5c5ff8}){this['view']['prompt']=_0x3b3ee7,this['view']['mainAction']=_0x5c5ff8,this['initialContext']=_0x3c5368,_0x2ccd3f&&(this['view']['isRendered']?this['_handleQuery'](_0x2ccd3f,_0x3c5368,_0x3984d7,_0x3b3ee7):this['view']['once']('render',()=>{this['_handleQuery'](_0x2ccd3f,_0x3c5368,_0x3984d7,_0x3b3ee7);}));}['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'](_0x278aaf,_0x51e555,_0x47a3fe,_0x3bbc8e){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x51e555,this['previousQuery']=_0x278aaf,this['previousLabel']=_0x3bbc8e||_0x278aaf,this['previousActionId']=_0x47a3fe,new Promise(_0x282e4b=>{this['textAdapter']['makeRequest']({'query':_0x278aaf,'context':_0x51e555,'onData':_0x5bba74=>{this['currentResponse']=_0x5bba74,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x47a3fe})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x360979=>{_0x360979 instanceof R?this['view']['handleError'](_0x360979['message']):this['view']['handleError'](),_0x282e4b();})['finally'](()=>{this['stopProcessing'](),_0x282e4b();});});}['_parseAndNormalizeContent'](_0x4d56dc,_0x4e27bc=!0x1){const _0x3f3cdd=Q['exec'](_0x4d56dc);_0x4d56dc=_0x3f3cdd?_0x4d56dc['substring'](_0x3f3cdd[0x1]['length']):_0x4d56dc['length']<0x64&&!_0x4e27bc?'':this['_stripMarkdownSyntax'](_0x4d56dc);const _0x535b07=this['_domParser']['parseFromString'](_0x4d56dc,'text/html');if(_0x3f3cdd){const _0x446571=Array['from'](_0x535b07['body']['childNodes']);_0x446571['reverse']();for(const _0xa77a05 of _0x446571){if(_0xa77a05['nodeType']==Node['ELEMENT_NODE'])break;_0xa77a05['remove']();}}const _0x59df9f=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x535b07['body']));this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x59df9f);const _0x2dabac=this['editor']['config']['get']('ai.aiAssistant.preserveComments'),_0x85563e=this['editor']['data']['toModel'](_0x59df9f);return _0x2dabac||_0x85563e['markers']['clear'](),this['editor']['data']['stringify'](_0x85563e);}['_normalizeResponseHeadings'](_0x2c9d12){const _0x43ddaa=new _0x1e662c(this['editor']['editing']['view']['document']),_0x30679c=new _0x55411c({'name':/^h[1-5]$/}),_0x13ae7b=[];let _0x1177a7=!0x1;for(const _0x4bfa3f of _0x2c9d12)_0x4bfa3f['is']('element')&&_0x30679c['match'](_0x4bfa3f)&&(_0x13ae7b['push'](_0x4bfa3f),'h1'==_0x4bfa3f['name']&&(_0x1177a7=!0x0));if(_0x1177a7){for(const _0x4c5eed of _0x13ae7b)_0x43ddaa['rename']('h'+(parseInt(_0x4c5eed['name'][0x1])+0x1),_0x4c5eed);}}['_isH1TagSupportEnabled'](){const {data:_0x7fc011,editing:_0x23b794}=this['editor'],_0x2c931f=_0x7fc011['htmlProcessor']['toView']('<h1></h1>'),_0x25831f=_0x7fc011['toView'](_0x7fc011['toModel'](_0x2c931f));return!!_0x23b794['view']['domConverter']['viewToDom'](_0x25831f)['querySelector']('h1');}['_sanitizeHTML'](_0x36beef){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x36beef),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0xbb22a7){const _0x38f96d=_0xbb22a7['trim']();return _0x38f96d['startsWith']('```html')?_0x38f96d['endsWith']('```')?_0x38f96d['substring'](0x7,_0x38f96d['length']-0x3):_0x38f96d['substring'](0x7):_0xbb22a7;}}const _={'REPLACE':'replace','INSERT':'insert'};class at extends ot{constructor(_0x1af63a){super(_0x1af63a),this['set']('isVisible',!0x1),this['set']('mainAction',_['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x3db38c=>i(_0x1af63a,'AI_'+_0x3db38c['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x1af63a,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x1af63a,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x1af63a,'Stop'));const _0x27b6ab=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x27b6ab['if']('isVisible','ck-hidden',_0x3b8902=>!_0x3b8902)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x459852,_0x53d66c){const _0x93549=new _0x3b2709(this['locale']);return _0x93549['set']({'label':_0x459852,'class':_0x53d66c||'','isVisible':!0x0,'withText':!0x0}),_0x93549;}}class ct extends _0x224a57{['contentFieldView'];['copyButtonView'];constructor(_0x5d8c86,_0xde1262=''){super(_0x5d8c86),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x1027b2=this['bindTemplate'];this['contentFieldView']=new bt(_0x5d8c86,_0xde1262),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x1027b2['if']('isVisible','ck-hidden',_0x5b710a=>!_0x5b710a)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x1027b2['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 _0x229c14=!0x1;this['on']('change:value',(_0x45de1e,_0x3c3c58,_0x1fc0f8)=>{const _0x47009b=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x1fc0f8),this['isProcessing']&&_0x47009b&&!_0x229c14&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x3b9aea,_0x4095b9,_0x573e5e)=>{_0x229c14=!0x1,_0x573e5e?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x229c14=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x229c14=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x4b7d62=this['locale'],_0x5ee5db=new _0x3b2709(this['locale']),_0x592c9c='ck-ai-form__copy-button';return _0x5ee5db['set']({'label':i(_0x4b7d62,'Copy'),'icon':_0x429393,'class':_0x592c9c,'tooltip':!0x0}),_0x5ee5db['bind']('isVisible')['to'](this,'value',_0x1bd1e7=>!!_0x1bd1e7),_0x5ee5db['bind']('isEnabled')['to'](this,'isProcessing',_0x425077=>!_0x425077),_0x5ee5db['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x5ee5db['icon']=_0x158af4,_0x5ee5db['class']=_0x592c9c+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x5ee5db['icon']=_0x429393,_0x5ee5db['class']=_0x592c9c;},0x3e8);}),_0x5ee5db;}['_copyHTMLToClipboard'](_0x3fca0b){const {window:_0x28f5bc,document:_0xf822c7}=_0x100eae;if(_0x28f5bc['ClipboardItem']){const {Blob:_0x337829,ClipboardItem:_0x58748e}=_0x28f5bc,_0x207f52=[new _0x58748e({'text/html':new _0x337829([_0x3fca0b['innerHTML']],{'type':'text/html'}),'text/plain':new _0x337829([_0x3fca0b['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x207f52);}else{const _0x305edd=_0xf822c7['createElement']('div');_0x305edd['style']['position']='absolute',_0x305edd['style']['left']='-9999px',_0x305edd['innerHTML']='<span>[</span>'+_0x3fca0b['innerHTML']+'<span>]</span>',_0xf822c7['body']['appendChild'](_0x305edd);const _0x98b636=_0xf822c7['createRange']();_0x98b636['setStartAfter'](_0x305edd['firstElementChild']),_0x98b636['setEndBefore'](_0x305edd['lastElementChild']);const _0x13f58a=_0x28f5bc['getSelection']();_0x13f58a['removeAllRanges'](),_0x13f58a['addRange'](_0x98b636),_0xf822c7['execCommand']('copy'),_0x305edd['remove']();}}}class bt extends _0x224a57{constructor(_0xb06d8f,_0x51e9c7=''){super(_0xb06d8f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x51e9c7,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x4313e3){this['element']['innerHTML']=_0x4313e3;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x4f3197=new _0x224a57(),_0x383a88=this['locale'],_0x24b2c1=new _0x1ba79e();return _0x24b2c1['isVisible']=!0x0,_0x4f3197['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x24b2c1,{'text':i(_0x383a88,'AI\x20is\x20writing...')}]}),_0x4f3197['render'](),_0x4f3197;}}class mt extends _0x224a57{constructor(_0x238b06,_0x1a3c51=''){super(_0x238b06);const _0x30b961=new _0x155397(),_0x27f174=this['bindTemplate'];this['set']('text',_0x1a3c51),_0x30b961['content']=_0x192700,this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x30b961,{'text':_0x27f174['to']('text')}]});}}class lt extends st{['submitButtonView'];['showHistoryButtonView'];constructor(_0x14965f,_0x43ffec){super(_0x14965f,_0x43ffec),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',(_0xa034c9,_0x222833)=>{_0xa034c9['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x222833());});}['_createSubmitButton'](){const _0x1499da=new _0x3b2709(this['locale']),_0x151b91=this['locale'];return _0x1499da['set']({'icon':it,'label':i(_0x151b91,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1499da['on']('execute',()=>{this['submit']();}),_0x1499da['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x4e6ede,_0x2d332a)=>!_0x4e6ede&&_0x2d332a),_0x1499da;}['_createShowHistoryButton'](){const _0x2906be=new _0x3b2709(this['locale']),_0x5460ac=this['resultsView'],_0x26c364=this['locale'];_0x2906be['set']({'label':i(_0x26c364,'History'),'withText':!0x1,'icon':tt,'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x2906be['bind']('isOn')['to'](_0x5460ac,'isVisible'),_0x2906be['bind']('isEnabled')['to'](this,'isEnabled'),_0x2906be['on']('execute',()=>{_0x5460ac['isVisible']=!_0x5460ac['isVisible'],_0x5460ac['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x118299=()=>{_0x100eae['window']['requestAnimationFrame'](()=>{if(_0x11da0b(this['element'])){const _0x128f66=new _0x15f76d(this['queryView']['fieldView']['element']),_0x5c781e=_0x128f66['width'],_0xce7262='rtl'===_0x26c364['uiLanguageDirection']?'left':'right';_0x128f66['excludeScrollbarsAndBorders'](),_0x2906be['element']['style'][_0xce7262]=_0x5c781e-_0x128f66['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x118299),this['on']('render',_0x118299),_0x2906be;}['submit'](){const _0x26fe68=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x26fe68);}['focus'](_0x4ca6d4){-0x1===_0x4ca6d4?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class pt extends yt{['historyGroupView'];['clearHistoryButton'];constructor(_0x22c52d){super(_0x22c52d),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new Ct(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x22c52d,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x3fa10e=0x0;for(const _0x33f490 of this['items'])_0x3fa10e+=_0x33f490['items']['length'];return{'resultsCount':_0x3fa10e,'totalItemsCount':_0x3fa10e};}['_createClearHistoryButton'](){const _0x316e88=this['locale'],_0x55f763=new _0x3b2709(this['locale']);return _0x55f763['set']({'label':'('+i(_0x316e88,'Clear')+')','withText':!0x0}),_0x55f763['on']('execute',()=>this['fire']('clearHistory')),_0x55f763;}}class ut extends xt{constructor(_0x2598fc){super();const _0x7fb621=new wt(),_0x322ec5=new _0x3b2709(this['locale'],_0x7fb621);this['children']['add'](_0x322ec5),_0x322ec5['set']({'label':_0x2598fc['prompt'],'withText':!0x0}),_0x322ec5['on']('execute',()=>{this['fire']('execute',{'value':kt(_0x2598fc['prompt'])});});}}const ts='CKEditor/AIFormView/PromptHistory';class dt extends _0x3f9d89{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x2b936e,_0x84584a)=>{const _0x3ead90=os(_0x84584a['prompt']);for(const _0x5b7bad of this)if(_0x5b7bad!=_0x84584a&&os(_0x5b7bad['prompt'])===_0x3ead90){this['remove'](_0x5b7bad);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x1bd425=sessionStorage['getItem'](ts)||'[]';this['addMany'](JSON['parse'](_0x1bd425));}['_saveToSessionStorage'](){sessionStorage['setItem'](ts,JSON['stringify'](this['map'](_0x29038a=>_0x29038a)));}}function os(_0x331438){return _0x331438['toLowerCase']()['trim']();}class k extends _0x224a57{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x2ecabf,_0x22b6e4,_0x69f438=''){super(_0x2ecabf),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',_['REPLACE']),this['_promptHistory']=new dt(),this['errorView']=new mt(_0x2ecabf),this['contentArea']=new ct(_0x2ecabf,_0x69f438),this['contentArea']['bind']('isProcessing')['to'](this),this['contentArea']['bind']('value')['to'](this),this['toolbar']=this['_createToolbar'](),this['toolbar']['bind']('mainAction')['to'](this),this['promptView']=this['_createPromptView'](),this['focusTracker']=new et(),this['keystrokes']=new rt(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new ht({'focusables':this['_focusables'],'focusTracker':this['focusTracker'],'keystrokeHandler':this['keystrokes'],'actions':{'focusPrevious':'shift\x20+\x20tab','focusNext':'tab'}}),this['focusCycler']['chain'](this['promptView']['focusCycler']),this['promptView']['queryView']['fieldView']['bind']('value')['to'](this,'prompt');const _0x68a89b=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x22b6e4],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x68a89b['if']('isError','ck-hidden',_0x190b2f=>!_0x190b2f)]},'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'](_0x81eaa8=0x1){-0x1===_0x81eaa8?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 _0x19ca2c=this['locale'],_0x21a337=new lt(_0x19ca2c,{'queryView':{'label':i(_0x19ca2c,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':nt,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x19ca2c,'Empty\x20history'),'secondary':i(_0x19ca2c,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x21a337['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x4513f5,_0x593244)=>_0x4513f5&&!_0x593244),this['listenTo'](_0x21a337,'submit',(_0x5c8b92,_0x51d3f9)=>{this['prompt']=_0x51d3f9;const _0x72a13c=ft(_0x51d3f9);this['fire']('submitPrompt',_0x72a13c),_0x51d3f9['trim']()&&this['_promptHistory']['add']({'prompt':_0x72a13c},0x0);},{'priority':'high'}),_0x21a337;}['_createHistoryView'](){const _0x59cf94=new pt(this['locale']);return _0x59cf94['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](ut),_0x59cf94['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x59cf94;}['_createToolbar'](){const _0x121830=new at(this['locale']);return _0x121830['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x19d37e,_0x6c47f3,_0x593d1c)=>_0x19d37e&&!_0x6c47f3&&!!_0x593d1c),_0x121830['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x121830['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x1926d0,_0xaa96ad,_0x197700)=>_0x1926d0&&!_0xaa96ad&&!!_0x197700),_0x121830['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x121830['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x2ae7a0,_0x53e9db)=>_0x2ae7a0&&!_0x53e9db),_0x121830['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x121830['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x121830['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x121830;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x2cc09c=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x2cc09c,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x16b59c){const _0xf55367=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x16b59c||i(_0xf55367,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}const l=globalThis['DataTransfer'];class n extends _0x29bd45{['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[_0x4f6a0a,a,x,_0x50a1ff];}constructor(_0x3d496d){super(_0x3d496d),_0x3d496d['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x3d496d['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x3d496d['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x3d496d['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x4469d6}=this;this['_aiAdapter']=_0x4469d6['plugins']['get'](x),this['_dialog']=_0x4469d6['plugins']['get'](_0x50a1ff),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x1eb127=new E(_0x4469d6,Array['from'](this['_commandDefinitions']['values']()));_0x4469d6['commands']['add']('showAIAssistant',_0x1eb127),_0x4469d6['ui']['componentFactory']['add']('aiCommands',_0x41ff0d=>{const _0x330d56=_0x506fc8(_0x41ff0d);return _0x330d56['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x330d56['buttonView']['set']({'label':i(_0x41ff0d,'AI\x20Commands'),'icon':_0x2ca237,'tooltip':!0x0}),_0x330d56['on']('execute',_0x3189c3=>this['_onExecute'](_0x3189c3['source']['id'])),_0x55b2b7(_0x330d56,_0x4469d6['ui']['view']['body'],function(_0x2730e2){const _0x29b721=o(_0x2730e2['config']['get']('ai.aiAssistant.commands'),_0x2730e2['locale']),_0x151717=U(_0x2730e2,_0x29b721)['filter'](_0x5cb742=>_0x5cb742['commands']['length']);if(0x1===_0x151717['length'])return U(_0x2730e2,_0x151717[0x0]['commands'])['map'](_0x2a7156=>({'id':_0x2a7156['id'],'label':_0x2a7156['label']}));return _0x151717['map'](_0x473923=>{const {groupId:_0x43a022,groupLabel:_0x1add01,commands:_0x4495a2}=_0x473923,_0x65c925=U(_0x2730e2,_0x4495a2)['map'](_0x1a3f3e=>({'id':_0x1a3f3e['id'],'label':_0x1a3f3e['label']}));return{'id':_0x43a022,'menu':_0x1add01||_0x43a022,'children':_0x65c925};});}(_0x4469d6),{'ariaLabel':i(_0x41ff0d,'AI\x20Commands')}),_0x330d56['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x1eb127['on']('change:enabledCommandsIds',_0x2b45a2),_0x330d56['menuView']['once']('render',_0x2b45a2),_0x330d56;function _0x2b45a2(){_0x330d56['isEnabled']=_0x1eb127['enabledCommandsIds']['length']>0x0;for(const _0x3b384d of _0x330d56['menuView']['buttons'])_0x3b384d['isEnabled']=_0x1eb127['enabledCommandsIds']['includes'](_0x3b384d['id']);}}),_0x4469d6['ui']['componentFactory']['add']('menuBar:aiCommands',_0x4ca644=>{const _0x5519a9=new _0x53eca6(_0x4ca644);_0x5519a9['buttonView']['set']({'label':i(_0x4ca644,'AI\x20Commands'),'icon':_0x2ca237}),_0x5519a9['bind']('isEnabled')['to'](_0x1eb127,'enabledCommandsIds',_0xafb33f=>_0xafb33f['length']>0x0);const _0x44d41a=o(_0x4469d6['config']['get']('ai.aiAssistant.commands'),_0x4ca644);return this['_populateMenuBarMenu'](_0x1eb127,_0x5519a9,_0x44d41a,_0x68b283=>this['_onExecute'](_0x68b283)),_0x5519a9;}),_0x4469d6['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x4de04f=this['_createAIAssistantUIButton'](_0x3b2709);return _0x4de04f['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x4de04f;}),_0x4469d6['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x927b74=this['_createAIAssistantUIButton'](_0x5700d7);return _0x927b74['set']({'role':'menuitemcheckbox'}),_0x927b74;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4d3785=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2cac91;for(const _0x598e0a in _0x4d3785){const _0x1379a6=_0x598e0a,_0x37fce0=_0x4d3785[_0x1379a6];if('aiLicenseKeyValid'==_0x37fce0||'aiLicenseKeyInvalid'==_0x37fce0||'aiLicenseKeyExpired'==_0x37fce0||'aiLicenseKeyDomainLimit'==_0x37fce0||'aiLicenseKeyNotAllowed'==_0x37fce0||'aiLicenseKeyEvaluationLimit'==_0x37fce0||'aiLicenseKeyTrialLimit'==_0x37fce0||'aiLicenseKeyUsageLimit'==_0x37fce0){delete _0x4d3785[_0x1379a6],_0x2cac91=_0x37fce0,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2cac91&&_0x4d3785['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2cac91&&_0x4d3785['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2cac91&&_0x4d3785['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('trialLimit'),'aiLicenseKeyUsageLimit'==_0x2cac91&&_0x4d3785['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x54664a='',_0x99bc8a='',_0x4f0528='custom'){const _0x3905df=this['editor'],_0x4e6ef7=_0x3905df['editing']['view'],_0x19a051=_0x3905df['plugins']['get'](a),_0x5d9aac=_0x3905df['plugins']['get'](_0x4f6a0a);_0x19a051['showFakeVisualSelection']();const _0x46021e=new l(),_0x3e0747=new ClipboardEvent('copy',{'clipboardData':_0x46021e}),_0x1a3a4f=new _0x41db82(_0x46021e),_0xb66926=new _0x168cd6(_0x4e6ef7,_0x3e0747,{'dataTransfer':_0x1a3a4f});_0x5d9aac['_forceMarkersCopy']('comment',()=>{_0x4e6ef7['document']['fire']('copy',_0xb66926);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new j(_0x3905df,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x10dd4e=_0x1a3a4f['getData']('text/html');const _0xf89a60=_0x3905df['model']['document']['selection'],_0x5964e3=Array['from'](_0xf89a60['getRanges']());0x1===_0x5964e3['length']&&_0x5964e3[0x0]['isFlat']&&!_0xf89a60['getSelectedElement']()&&''!==_0x10dd4e['replace'](/ /g,'')['trim']()&&(_0x10dd4e='<p>'+_0x10dd4e+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x4f0528,'query':_0x54664a,'htmlContent':_0x10dd4e,'label':_0x99bc8a,'mainActionLabel':_[_0x3905df['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':_0x59657e,'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x3acd8c['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x19a051['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x6c52c3=new Map(),_0x4abd46=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x4606e5 of _0x4abd46)for(const _0x551132 of _0x4606e5['commands'])_0x6c52c3['set'](_0x551132['id'],{..._0x551132,'groupId':_0x4606e5['groupId'],'groupLabel':_0x4606e5['groupLabel']||_0x4606e5['groupId']});return _0x6c52c3;}['_createAIAssistantUIButton'](_0x4d9871){const _0x5f46a3=this['editor'],_0x1b814d=_0x5f46a3['commands']['get']('showAIAssistant'),_0x12a07b=new _0x4d9871(_0x5f46a3['locale']);return _0x12a07b['set']({'label':i(_0x5f46a3['locale'],'AI\x20Assistant'),'icon':_0x59657e,'isToggleable':!0x0}),_0x12a07b['bind']('isEnabled')['to'](_0x1b814d),_0x12a07b['bind']('isOn')['to'](this['_dialog'],'id',_0x32b847=>'aiAssistant'===_0x32b847),this['listenTo'](_0x12a07b,'execute',()=>{_0x12a07b['isOn']?this['hideUI']():_0x1b814d['execute']();}),_0x12a07b;}['_initView'](){const _0x4989e2=this['editor']['plugins']['get'](a);this['_formView']=new k(this['editor']['locale'],this['_uiCssClasses'],this['editor']['config']['get']('ai.aiAssistant.contentAreaCssClass')),this['_formView']['on']('change:value',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['_formView']['promptView']['queryView']['fieldView']['on']('update',()=>{this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}),this['listenTo'](this['_formView'],'replaceContent',()=>{_0x4989e2['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x4989e2['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x444442,ui:{ariaLiveAnnouncer:_0x25c9f4}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x5bdfb5,_0x459ac1,_0x405554)=>{const _0x6c84df=this['_aiAssistantController']['currentContext'];_0x405554?_0x25c9f4['announce'](i(_0x444442,'AI\x20is\x20writing')):_0x6c84df&&_0x25c9f4['announce'](i(_0x444442,'Generated\x20content:\x20%0',_0x6c84df),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x525f6d,_0x54a6a8,_0x5058a9)=>{if(_0x5058a9){const _0xdf327=this['_formView']['errorView']['text'];_0x25c9f4['announce'](i(_0x444442,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0xdf327));}});}['_onExecute'](_0x261ec2){const _0x2058f7=this['_commandDefinitions']['get'](_0x261ec2),_0x367d7a=this['editor'],_0x2df51a=_0x367d7a['model']['document']['selection'],_0x56ac59=_0x367d7a['commands']['get']('showAIAssistant'),_0x3e0845=_0x367d7a['plugins']['get'](a),_0x50d34e=''+(_0x2058f7['groupId']!==K?_0x2058f7['groupLabel']+':\x20':'')+_0x2058f7['label'];if(!0x1!==_0x2058f7['requiresContent']&&_0x2df51a['isCollapsed']){const _0x1db18b=_0x46b51c(_0x2df51a['getSelectedBlocks']())||_0x367d7a['model']['schema']['getLimitElement'](_0x2df51a);_0x367d7a['model']['change'](_0x450155=>{_0x450155['setSelection'](_0x1db18b,'in');});}_0x3e0845['showFakeVisualSelection'](),_0x56ac59['execute'](_0x2058f7['prompt'],_0x50d34e,'command:'+_0x261ec2);}['_populateMenuBarMenu'](_0x1b0ca8,_0x229e32,_0x109fa8,_0x42a41f){const _0x1d082a=this['editor'],_0x51d38d=_0x1d082a['locale'],_0x414b57=new _0x1f29e6(_0x51d38d),_0x333c62=U(_0x1d082a,_0x109fa8)['filter'](_0x533b6c=>_0x533b6c['commands']['length']);0x1===_0x333c62['length']?this['_getMenuBarGroupButtons']({'command':_0x1b0ca8,'commands':_0x333c62[0x0]['commands'],'parentMenuView':_0x229e32,'onExecute':_0x42a41f})['forEach'](_0x21e7b2=>_0x414b57['items']['add'](_0x21e7b2)):_0x333c62['forEach'](({groupId:_0x634050,groupLabel:_0x38d19d,commands:_0x59f703})=>{const _0xef9393=new _0x596962(_0x51d38d,_0x229e32),_0x262287=new _0x53eca6(_0x51d38d),_0x5c429a=new _0x1f29e6(_0x51d38d),_0x47c25f=this['_getMenuBarGroupButtons']({'command':_0x1b0ca8,'commands':_0x59f703,'parentMenuView':_0x262287,'onExecute':_0x42a41f});_0x262287['buttonView']['set']({'label':_0x38d19d||_0x634050}),_0x262287['delegate']('execute')['to'](_0x229e32),_0x5c429a['items']['addMany'](_0x47c25f),_0x262287['panelView']['children']['add'](_0x5c429a),_0xef9393['children']['add'](_0x262287),_0x414b57['items']['add'](_0xef9393);}),_0x229e32['panelView']['children']['add'](_0x414b57);}['_getMenuBarGroupButtons']({command:_0x640952,commands:_0xe495f3,parentMenuView:_0x1dcaf9,onExecute:_0x416efe}){const _0x4bcdea=this['editor'],_0x1d99e6=_0x4bcdea['locale'];return U(_0x4bcdea,_0xe495f3)['map'](_0x98af97=>{const _0x279576=new _0x596962(_0x1d99e6,_0x1dcaf9),_0x5d966b=new _0x5700d7(_0x1d99e6);return _0x5d966b['set']({'label':_0x98af97['label']}),_0x5d966b['delegate']('execute')['to'](_0x1dcaf9),_0x5d966b['on']('execute',()=>_0x416efe(_0x98af97['id'])),_0x5d966b['bind']('isEnabled')['to'](_0x640952,'enabledCommandsIds',_0x449e28=>_0x449e28['includes'](_0x98af97['id'])),_0x279576['children']['add'](_0x5d966b),_0x279576;});}}function T(_0x52f673,_0x5b2d03){return void 0x0!==_0x52f673['order']&&void 0x0===_0x5b2d03['order']?0x1:void 0x0===_0x52f673['order']&&void 0x0!==_0x5b2d03['order']?-0x1:void 0x0!==_0x52f673['order']&&void 0x0!==_0x5b2d03['order']?_0x52f673['order']-_0x5b2d03['order']:0x0;}function U(_0x7525f5,_0x4922cb){_0x4922cb['sort'](T);const _0x528f43={},_0x1547bf=[];for(const _0x3ae911 of _0x4922cb)if(void 0x0!==_0x3ae911['order']){if(_0x3ae911['order']in _0x528f43)throw new _0x40cdb9('ai-commands-config-order-collision',_0x7525f5,{'conflictingDefinitions':[_0x3ae911,_0x528f43[_0x3ae911['order']]]});_0x528f43[_0x3ae911['order']]=_0x3ae911,_0x1547bf['splice'](_0x3ae911['order'],0x0,_0x3ae911);}else _0x1547bf['push'](_0x3ae911);return _0x1547bf;}class At extends _0x29bd45{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x303856){super(_0x303856);const _0x9566db=_0x303856['config'],_0xe00220=_0x303856['locale'];_0x9566db['define']('ai.aiAssistant.preserveComments',!0x0),_0x9566db['define']('ai.aiAssistant.commands',_t(_0xe00220)),_0x9566db['define']('ai.aiAssistant.extraCommandGroups',[]),_0x9566db['define']('ai.aiAssistant.removeCommands',[]);let _0x457b1b=o(_0x9566db['get']('ai.aiAssistant.commands'),_0xe00220);const _0x1fedd6=_0x9566db['get']('ai.aiAssistant.extraCommandGroups'),_0x2f9dc4=_0x9566db['get']('ai.aiAssistant.removeCommands');_0x1fedd6['forEach'](_0x1485da=>{const _0x373595=_0x457b1b['find'](_0x5d6398=>_0x5d6398['groupId']===_0x1485da['groupId']);_0x373595?_0x373595['commands']=_0x373595['commands']['concat'](_0x1485da['commands']):_0x457b1b['push'](_0x1485da);}),_0x457b1b=_0x457b1b['filter'](_0x4d099c=>!_0x2f9dc4['includes'](_0x4d099c['groupId'])),_0x457b1b['forEach'](_0x5a5f8c=>{_0x5a5f8c['commands']=_0x5a5f8c['commands']['filter'](_0x376b3e=>!_0x2f9dc4['includes'](_0x376b3e['id']));}),_0x9566db['set']('ai.aiAssistant.commands',_0x457b1b);}}function _t(_0x26e98c){return[{'groupId':'editOrReview','groupLabel':i(_0x26e98c,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x26e98c,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x26e98c,'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(_0x26e98c,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x26e98c,'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(_0x26e98c,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x26e98c,'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(_0x26e98c,'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(_0x26e98c,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x26e98c,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x26e98c,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x26e98c,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x26e98c,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x26e98c,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x26e98c,'Change\x20style'),'commands':[{'id':'business','label':i(_0x26e98c,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x26e98c,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x26e98c,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x26e98c,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x26e98c,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x26e98c,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x26e98c,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x26e98c,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x26e98c,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x26e98c,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x26e98c,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x26e98c,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x26e98c,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}class S extends _0x29bd45{['abortController'];static get['requires'](){return[x];}constructor(_0x199d4a){super(_0x199d4a),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](x)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0xf12bf7){return this['sendRequest'](_0xf12bf7)['catch'](_0x42b7b1=>{if(_0x42b7b1 instanceof R)return Promise['reject'](_0x42b7b1);if('AbortError'==_0x42b7b1['name'])return Promise['resolve']();throw console['error'](_0x42b7b1),new _0x40cdb9('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x55f357,_0x20d12b){const _0x5a17f7=this['editor']['locale'],_0x35fd33={'Content-Type':'application/json'};if('object'==typeof _0x55f357)Object['assign'](_0x35fd33,_0x55f357);else{if(_0x55f357)try{const _0x5ab85f=await _0x55f357(_0x20d12b);Object['assign'](_0x35fd33,_0x5ab85f);}catch{return Promise['reject'](new R(i(_0x5a17f7,'AI_ERROR_GET_HEADERS')));}}return _0x35fd33;}async['_prepareRequestParameters'](_0x5f0908,_0x5f504e){const _0x58b2b6=this['editor']['locale'];if('object'==typeof _0x5f0908)return _0x5f0908;try{return await _0x5f0908(_0x5f504e);}catch{return Promise['reject'](new R(i(_0x58b2b6,'AI_ERROR_GET_PARAMETERS')));}}}class It extends S{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x4c5d3f){super(_0x4c5d3f),_0x4c5d3f['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x4c5d3f['config']['get']('ai.openAI.requestParameters')||_0x4c5d3f['config']['define']('ai.openAI.requestParameters',{'model':'gpt-4o','temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x4c5d3f['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x4c5d3f['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x4c5d3f['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x3524b5,context:_0x38c453,onData:_0x4b1fc9,actionId:_0x1a5678}){const _0x2b3301=this['editor']['locale'],_0x2ba5ae=await this['prepareMessages'](_0x3524b5,_0x38c453,_0x1a5678),_0x557874=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x1a5678),_0x41b85e=await this['_prepareRequestParameters'](this['_requestParameters'],_0x1a5678),_0x53d262={'messages':_0x2ba5ae,..._0x41b85e},_0x243eb6={'method':'POST','headers':_0x557874,'body':JSON['stringify'](_0x53d262),'signal':this['abortController']['signal']},_0x5a6681=await fetch(this['_apiUrl'],_0x243eb6);if(_0x5a6681['ok'])return _0x41b85e['stream']?await this['_readStreamableResponse'](_0x5a6681,_0x4b1fc9):await this['_readStaticResponse'](_0x5a6681,_0x4b1fc9),Promise['resolve']();{const _0x1d68c8=await _0x5a6681['text']();return _0x1d68c8['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2b3301,'AI_ERROR_CONTEXT_LENGTH'))):_0x1d68c8['includes']('Moderation')?Promise['reject'](new R(i(_0x2b3301,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1d68c8));}}async['prepareMessages'](_0x56991c,_0x7e671a,_0x2606b3){let _0x1b29aa,_0x8b975b;return _0x7e671a?(_0x1b29aa='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.',_0x8b975b='Instruction:\x0a'+_0x56991c+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x7e671a):(_0x1b29aa='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.',_0x8b975b=_0x56991c),[{'role':'system','content':_0x1b29aa},{'role':'user','content':_0x8b975b}];}async['_readStreamableResponse'](_0x1449f7,_0x545849){const _0x2efa4d=_0x1449f7['body']['getReader'](),_0x1e9aca=new TextDecoder();let _0x2160ff='',_0x27d2e6='',_0x573405='',_0x559dc1=!0x1;for(;!_0x559dc1;){const {done:_0x573834,value:_0x3e6522}=await _0x2efa4d['read'](),_0x4ad84f=_0x2160ff+_0x1e9aca['decode'](_0x3e6522);let _0x24e547='';_0x559dc1=_0x573834;try{_0x24e547=this['_cleanUpData'](_0x4ad84f),_0x2160ff='';}catch{_0x2160ff=_0x4ad84f;continue;}_0x27d2e6+=_0x24e547,!_0x559dc1&&this['_isBufferIncomplete'](_0x27d2e6)||_0x27d2e6&&(_0x573405+=_0x27d2e6,_0x27d2e6='',_0x545849(_0x573405));}return Promise['resolve']();}async['_readStaticResponse'](_0x52383d,_0x3d1aa3){return _0x3d1aa3((await _0x52383d['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x46e6ec){const _0x4c3ce2=_0x46e6ec['split']('<')['length']!==_0x46e6ec['split']('>')['length'],_0x170abe=_0x46e6ec['length']<0x1e;return _0x4c3ce2&&_0x170abe;}['_cleanUpData'](_0x2148fc){return _0x2148fc['split'](/\n(?![^{]*\})/g)['map'](_0x3856c8=>_0x3856c8['replace']('data:\x20',''))['filter'](_0x29686f=>_0x29686f&&_0x29686f['length']>0x0&&'[DONE]'!==_0x29686f)['map'](_0x1bcefe=>{const {choices:_0x15ad51}=JSON['parse'](_0x1bcefe);if(_0x15ad51[0x0]?.['delta']?.['content'])return _0x15ad51[0x0]['delta']['content'];})['filter'](_0x3dafb1=>_0x3dafb1)['join']('');}}class Et extends S{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x5baa89){super(_0x5baa89),_0x5baa89['config']['get']('ai.aws.requestParameters')||_0x5baa89['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']=_0x5baa89['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x5baa89['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x5baa89['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x5baa89['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x50419b,context:_0x420362,onData:_0x524438,actionId:_0xc741f2}){const {model:_0x36649e,stream:_0x1cef98,..._0x4d60ce}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xc741f2),_0x466f10={'prompt':await this['preparePrompt'](_0x50419b,_0x420362,_0x36649e,_0xc741f2),..._0x4d60ce};this['_apiUrl']?await this['_processProxyRequest'](_0x466f10,_0x36649e,_0x1cef98,_0x524438,_0xc741f2):await this['_processAWSRequest'](_0x466f10,_0x36649e,_0x1cef98,_0x524438);}async['preparePrompt'](_0x1283e7,_0x2566d0,_0x511819,_0x190f50){let _0xc60326,_0x2fb853;return _0x2566d0?(_0xc60326='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.',_0x2fb853='Instruction:\x0a'+_0x1283e7+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x2566d0):(_0xc60326='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.',_0x2fb853=_0x1283e7),'meta.llama'==this['getModelFamily'](_0x511819)?'<<SYS>>\x0a'+_0xc60326+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2fb853+'\x0a[/INST]':'Human:\x0a'+_0xc60326+'\x0a'+_0x2fb853+'\x0a\x0aAssistant:';}['getModelFamily'](_0x1166ce){if(/^anthropic\.claude/['test'](_0x1166ce))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x1166ce))return'ai21.j2';if(/^cohere\.command/['test'](_0x1166ce))return'cohere.command';if(/^meta\.llama/['test'](_0x1166ce))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x1166ce));}async['_processProxyRequest'](_0x2ba1f2,_0x4db421,_0x2bfebc,_0x469206,_0x44daa5){const _0x120733={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x44daa5),'body':JSON['stringify']({..._0x2ba1f2,'model':_0x4db421,'stream':_0x2bfebc}),'signal':this['abortController']['signal']},_0x5b550f=await fetch(this['_apiUrl'],_0x120733);_0x2bfebc?await this['_readStreamableResponse'](_0x5b550f,_0x4db421,_0x469206):await this['_readStaticResponse'](_0x5b550f,_0x4db421,_0x469206);}async['_processAWSRequest'](_0x4156a7,_0x132ff4,_0x330a7d,_0x17f2ce){const _0x40dbaf=new _0x3c59b0(this['_bedrockClientConfig']),_0x1ba464={'body':JSON['stringify'](_0x4156a7),'contentType':'application/json','accept':'application/json','modelId':_0x132ff4};let _0x3ab71e;if(_0x330a7d){const _0x1ec668=new _0x3875c7(_0x1ba464);_0x3ab71e=await _0x40dbaf['send'](_0x1ec668,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x3ab71e,_0x132ff4,_0x17f2ce);}else{const _0x38fd5f=new _0x23ebfb(_0x1ba464);_0x3ab71e=await _0x40dbaf['send'](_0x38fd5f,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x3ab71e,_0x132ff4,_0x17f2ce);}}async['_readAsyncIterableResponse'](_0x36b061,_0x2ce08c,_0x4cf62c){const _0x4b2cdc=_0x36b061['body'],_0x57a505=new TextDecoder('utf-8');let _0x465af6='';for await(const _0xfba06d of _0x4b2cdc)if(_0xfba06d['chunk']){const _0x208f8e=_0x57a505['decode'](_0xfba06d['chunk']['bytes']),_0x3777f0=JSON['parse'](_0x208f8e);_0x465af6+=this['_getGeneratedText'](_0x3777f0,_0x2ce08c),_0x4cf62c(_0x465af6);}return Promise['resolve']();}async['_readStreamableResponse'](_0xeed5c3,_0x206137,_0x1963fd){const _0x448644=_0xeed5c3['body'],_0x13156e=new TextDecoder('utf-8'),_0x408db6=_0x448644['getReader']();let _0x3f0ed1='',_0x336f9b='',_0x142ebc=!0x1;for(;!_0x142ebc;){const {done:_0x5c75bc,value:_0x4d09c1}=await _0x408db6['read']();if(_0x142ebc=_0x5c75bc,_0x142ebc)break;const _0x26117b=(_0x3f0ed1+_0x13156e['decode'](_0x4d09c1))['split']('\x0a')['map'](_0xbfbea6=>{try{return _0x3f0ed1='',JSON['parse'](_0xbfbea6);}catch{return _0x3f0ed1=_0xbfbea6,null;}})['filter'](_0x3932f2=>null!==_0x3932f2);_0x26117b['length']&&(_0x336f9b+=_0x26117b['map'](_0x197a3=>this['_getGeneratedText'](_0x197a3,_0x206137))['join'](''),_0x1963fd(_0x336f9b));}return Promise['resolve']();}async['_readStaticResponse'](_0xf49c2d,_0xc953a0,_0x590a90){let _0x3c5275;return _0x3c5275=_0xf49c2d instanceof Response?await _0xf49c2d['json']():JSON['parse'](new TextDecoder('utf-8')['decode'](_0xf49c2d['body'])),(_0x590a90(this['_getGeneratedText'](_0x3c5275,_0xc953a0)),Promise['resolve']());}['_getGeneratedText'](_0x5cdead,_0x21df74){switch(this['getModelFamily'](_0x21df74)){case'anthropic.claude':return _0x5cdead['completion'];case'ai21.j2':return _0x5cdead['completions'][0x0]['data']['text'];case'cohere.command':return _0x5cdead['generations'][0x0]['text'];case'meta.llama':return _0x5cdead['generation'];}}}export{x as AIAdapter,At as AIAssistant,n as AIAssistantUI,R as AIRequestError,S as AITextAdapter,Et as AWSTextAdapter,It as OpenAITextAdapter,E as ShowAIAssistantCommand,_t as getDefaultAICommands};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-ai",
|
|
3
|
-
"version": "46.0.1-alpha.
|
|
3
|
+
"version": "46.0.1-alpha.12",
|
|
4
4
|
"description": "AI Assistant feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@aws-sdk/client-bedrock-runtime": "3.823.0",
|
|
32
|
-
"@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.
|
|
33
|
-
"@ckeditor/ckeditor5-core": "46.0.1-alpha.
|
|
34
|
-
"@ckeditor/ckeditor5-engine": "46.0.1-alpha.
|
|
35
|
-
"@ckeditor/ckeditor5-icons": "46.0.1-alpha.
|
|
36
|
-
"@ckeditor/ckeditor5-table": "46.0.1-alpha.
|
|
37
|
-
"@ckeditor/ckeditor5-ui": "46.0.1-alpha.
|
|
38
|
-
"@ckeditor/ckeditor5-utils": "46.0.1-alpha.
|
|
39
|
-
"ckeditor5": "46.0.1-alpha.
|
|
32
|
+
"@ckeditor/ckeditor5-clipboard": "46.0.1-alpha.12",
|
|
33
|
+
"@ckeditor/ckeditor5-core": "46.0.1-alpha.12",
|
|
34
|
+
"@ckeditor/ckeditor5-engine": "46.0.1-alpha.12",
|
|
35
|
+
"@ckeditor/ckeditor5-icons": "46.0.1-alpha.12",
|
|
36
|
+
"@ckeditor/ckeditor5-table": "46.0.1-alpha.12",
|
|
37
|
+
"@ckeditor/ckeditor5-ui": "46.0.1-alpha.12",
|
|
38
|
+
"@ckeditor/ckeditor5-utils": "46.0.1-alpha.12",
|
|
39
|
+
"ckeditor5": "46.0.1-alpha.12",
|
|
40
40
|
"es-toolkit": "1.39.5"
|
|
41
41
|
},
|
|
42
42
|
"type": "module",
|