@ckeditor/ckeditor5-ai 44.1.0-alpha.4 → 44.1.0-alpha.5

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/dist/index.js CHANGED
@@ -20,5 +20,5 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x4097de,Command as _0x4bc799,icons as _0x4e4c41}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x8c83f3,CKEditorError as _0x15cabc,ObservableMixin as _0x389154,global as _0xe6d08,isVisible as it,Rect as st,Collection as _0x1349b0,FocusTracker as _0x33bee8,KeystrokeHandler as ts,first as _0x40ce29}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x11867e,View as _0x3cb695,SpinnerView as _0x314fa5,IconView as _0x36f35d,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x577b51,ButtonLabelView as te,FocusCycler as _0x429aab,createLabeledTextarea as _0xb2848d,Dialog as _0x58721c,createDropdown as _0x379768,addMenuToDropdown as _0x3c8dce,MenuBarMenuView as _0x1151e9,MenuBarMenuListItemButtonView as _0x157c5f,DialogViewPosition as _0x55461a,MenuBarMenuListView as _0x2618d0,MenuBarMenuListItemView as _0x3f14ed}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x283057,Matcher as _0x2dea52,DataTransfer as _0x44a842,DomEventData as _0x2e117c}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x69b3b3,escape as _0x45846c}from'lodash-es';import{ClipboardMarkersUtils as _0x9b6142}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x1962cd,InvokeModelWithResponseStreamCommand as _0x322a48,InvokeModelCommand as _0x2034e4}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x18c453,_0x17a8aa){const _0x15f46c=(0x0,_0x17a8aa['t'])('Other');return _0x18c453['length']?'groupId'in _0x18c453[0x0]?_0x18c453:[{'groupId':I,'groupLabel':_0x15f46c,'order':0x1/0x0,'commands':_0x18c453}]:[{'groupId':I,'groupLabel':_0x15f46c,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x4097de{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x42af98}=this,_0x3db6ba=['ck-fake-ai-selection'];_0x42af98['config']['get']('ai.useTheme')&&_0x3db6ba['push']('ck-ai-assistant-ui_theme'),_0x42af98['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x3db6ba,'priority':0xc}}),_0x42af98['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x32dc45,{writer:_0x480f85})=>{if(!_0x32dc45['markerRange']['isCollapsed'])return null;const _0x1078bc=_0x480f85['createUIElement']('span');return _0x480f85['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x1078bc),_0x1078bc;}});}['afterInit'](){!async function(_0xb68ee8){const _0x4079e7=_0x1447f6([0x4c,0x76,0x74,0x6c,0x50,0x48,0x43,0x58,0x44,0x49,0x6d,0x42,0x39,0x4d,0x65,0x5a,0x79,0x45,0x52,0x78,0x33,0x51,0x6e,0x41,0x75,0x62,0x7a,0x71,0x67,0x30,0x69,0x34,0x6f,0x47,0x77,0x4f,0x46,0x73,0x4e,0x4b,0x55,0x72,0x56,0x31,0x59,0x61,0x38,0x64,0x35,0x37,0x6a,0x66,0x32,0x36,0x57,0x63,0x70,0x54,0x53,0x4a,0x68,0x6b]),_0x322a08=0x4b230e41,_0x7acb79=0x4b245781^_0x322a08,_0xa85d87=window[_0x1447f6([0x44,0x61,0x74,0x65])][_0x1447f6([0x6e,0x6f,0x77])](),_0x186b06=_0xb68ee8[_0x1447f6([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x13c768=new window[(_0x1447f6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x5d5842=>{_0x186b06[_0x1447f6([0x6f,0x6e,0x63,0x65])](_0x1447f6([0x72,0x65,0x61,0x64,0x79]),_0x5d5842);}),_0x568ec2={[_0x1447f6([0x6b,0x74,0x79])]:_0x1447f6([0x45,0x43]),[_0x1447f6([0x75,0x73,0x65])]:_0x1447f6([0x73,0x69,0x67]),[_0x1447f6([0x63,0x72,0x76])]:_0x1447f6([0x50,0x2d,0x32,0x35,0x36]),[_0x1447f6([0x78])]:_0x1447f6([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]),[_0x1447f6([0x79])]:_0x1447f6([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]),[_0x1447f6([0x61,0x6c,0x67])]:_0x1447f6([0x45,0x53,0x32,0x35,0x36])},_0x14dda=_0x186b06[_0x1447f6([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1447f6([0x67,0x65,0x74])](_0x1447f6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x5ba1a4(){let _0x238140,_0x38e4a8=null,_0x3a5435=null;try{if(_0x14dda==_0x1447f6([0x47,0x50,0x4c]))return _0x1447f6([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x238140=_0x564154(),!_0x238140)return _0x1447f6([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x238140[_0x1447f6([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x3a5435=_0x224643(_0x238140[_0x1447f6([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x238140[_0x1447f6([0x6a,0x74,0x69])])),await _0x3a552a()?_0x512063()?_0x2f02b9()?_0x1447f6([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2ea89f()?(_0x238140[_0x1447f6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1447f6([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x38e4a8=_0x24b93e(_0x1447f6([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x238140[_0x1447f6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1447f6([0x74,0x72,0x69,0x61,0x6c])&&(_0x38e4a8=_0x24b93e(_0x1447f6([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x238140[_0x1447f6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1447f6([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x38e4a8=_0x24b93e(_0x1447f6([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0xc5d3ee()):_0x1447f6([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1447f6([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1447f6([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x43a117){return _0x1447f6([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2f02b9(){const _0x1801ef=[_0x1447f6([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1447f6([0x74,0x72,0x69,0x61,0x6c])][_0x1447f6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x238140[_0x1447f6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xa85d87/0x3e8:0xe10*_0x7acb79;return _0x238140[_0x1447f6([0x65,0x78,0x70])]<_0x1801ef;}function _0x512063(){const _0x479461=_0x238140[_0x1447f6([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x479461&&(!!_0x479461[_0x1447f6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1447f6([0x2a]))||!!_0x479461[_0x1447f6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1447f6([0x41,0x49])));}function _0x2ea89f(){const _0x3e3e2e=_0x238140[_0x1447f6([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3e3e2e||0x0==_0x3e3e2e[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x22a316}=new URL(window[_0x1447f6([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3e3e2e[_0x1447f6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x22a316))return!0x0;const _0x2d7235=_0x22a316[_0x1447f6([0x73,0x70,0x6c,0x69,0x74])](_0x1447f6([0x2e]));return _0x3e3e2e[_0x1447f6([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x58d2c3=>_0x58d2c3[_0x1447f6([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1447f6([0x2a])))[_0x1447f6([0x6d,0x61,0x70])](_0x3f94da=>_0x3f94da[_0x1447f6([0x73,0x70,0x6c,0x69,0x74])](_0x1447f6([0x2e])))[_0x1447f6([0x73,0x6f,0x6d,0x65])](_0x2cce80=>_0x2d7235[_0x1447f6([0x65,0x76,0x65,0x72,0x79])]((_0x5d80fe,_0x3ed67b)=>_0x2cce80[_0x3ed67b]===_0x5d80fe||_0x2cce80[_0x3ed67b]===_0x1447f6([0x2a])));}function _0xc5d3ee(){return _0x38e4a8&&_0x3a5435?new window[(_0x1447f6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x5f32de,_0x4f3dbd)=>{_0x38e4a8[_0x1447f6([0x74,0x68,0x65,0x6e])](_0x5f32de,_0x4f3dbd),_0x3a5435[_0x1447f6([0x74,0x68,0x65,0x6e])](_0x46f4d9=>{_0x46f4d9!=_0x1447f6([0x56,0x61,0x6c,0x69,0x64])&&_0x5f32de(_0x46f4d9);},_0x4f3dbd);}):_0x38e4a8||_0x3a5435||_0x1447f6([0x56,0x61,0x6c,0x69,0x64]);}}function _0x224643(_0x20d027,_0x34d626){return new window[(_0x1447f6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1a2e34=>{if(_0x1cc8da())return _0x1a2e34(_0x1447f6([0x56,0x61,0x6c,0x69,0x64]));_0x4aba7a(),_0x186b06[_0x1447f6([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1447f6([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3e4e48=!0x1;const _0x4d3a90=_0x8c83f3();function _0x3bb0f6(_0x157b91){return!!_0x157b91&&(typeof _0x157b91===_0x1447f6([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x157b91===_0x1447f6([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x157b91[_0x1447f6([0x74,0x68,0x65,0x6e])]===_0x1447f6([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x157b91[_0x1447f6([0x63,0x61,0x74,0x63,0x68])]===_0x1447f6([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x25fa9e(_0x14cc94){_0x223274(_0x14cc94)[_0x1447f6([0x74,0x68,0x65,0x6e])](_0x3fca1e=>{if(!_0x3fca1e||_0x3fca1e[_0x1447f6([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1447f6([0x6f,0x6b]))return _0x1447f6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0xf074fc(_0x218ac7(_0x4d3a90+_0x34d626))!=_0x3fca1e[_0x1447f6([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1447f6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1447f6([0x56,0x61,0x6c,0x69,0x64]);})[_0x1447f6([0x74,0x68,0x65,0x6e])](_0x1509b3=>(_0x2bcd23(),_0x1509b3),()=>{const _0x41c410=_0x1a2685();return null==_0x41c410?(_0x2bcd23(),_0x1447f6([0x56,0x61,0x6c,0x69,0x64])):_0x1447f6(_0xa85d87-_0x41c410>(0x6f2f8a41^_0x322a08)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1447f6([0x74,0x68,0x65,0x6e])](_0x1a2e34)[_0x1447f6([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1a2e34(_0x1447f6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x5a1cbe=0x4b15e0c1^_0x322a08;function _0x2bcd23(){const _0x4f5266=_0x1447f6([0x6c,0x6c,0x63,0x74,0x2d])+_0xf074fc(_0x218ac7(_0x20d027)),_0x42794d=_0x294ce0(_0xf074fc(window[_0x1447f6([0x4d,0x61,0x74,0x68])][_0x1447f6([0x63,0x65,0x69,0x6c])](_0xa85d87/_0x5a1cbe)));window[_0x1447f6([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1447f6([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4f5266,_0x42794d);}function _0x1a2685(){const _0x3ab112=_0x1447f6([0x6c,0x6c,0x63,0x74,0x2d])+_0xf074fc(_0x218ac7(_0x20d027)),_0x300514=window[_0x1447f6([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1447f6([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3ab112);return _0x300514?window[_0x1447f6([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x294ce0(_0x300514),0x10)*_0x5a1cbe:null;}function _0x223274(_0x2a7c1d){return new window[(_0x1447f6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x511570,_0x457eb4)=>{_0x2a7c1d[_0x1447f6([0x74,0x68,0x65,0x6e])](_0x511570,_0x457eb4),window[_0x1447f6([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x457eb4,0x4b22da81^_0x322a08);});}}_0x186b06[_0x1447f6([0x6f,0x6e])](_0x1447f6([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x1df22f,_0x3fbef7)=>{if(_0x3fbef7[0x0]!=_0x20d027)return _0x1a2e34(_0x1447f6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3fbef7[0x1]={..._0x3fbef7[0x1],[_0x1447f6([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4d3a90};},{[_0x1447f6([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1447f6([0x68,0x69,0x67,0x68])}),_0x186b06[_0x1447f6([0x6f,0x6e])](_0x1447f6([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x50ca8c=>{_0x3bb0f6(_0x50ca8c[_0x1447f6([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3e4e48=!0x0,_0x25fa9e(_0x50ca8c[_0x1447f6([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1447f6([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1447f6([0x6c,0x6f,0x77])}),_0x13c768[_0x1447f6([0x74,0x68,0x65,0x6e])](()=>{_0x3e4e48||_0x1a2e34(_0x1447f6([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x1cc8da(){return _0x186b06[_0x1447f6([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1447f6([0x76,0x69,0x65,0x77])][_0x1447f6([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1447f6([0x61,0x75,0x74,0x6f]);}function _0x4aba7a(){_0x186b06[_0x1447f6([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1447f6([0x76,0x69,0x65,0x77])][_0x1447f6([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1447f6([0x61,0x75,0x74,0x6f]);}}function _0x24b93e(_0x586c91){const _0x2a5ff9=[new window[(_0x1447f6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1566e7=>setTimeout(_0x1566e7,0x4b2a308d^_0x322a08)),_0x13c768[_0x1447f6([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1447f6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x19aa6a=>{let _0x2f0622=0x0;_0x186b06[_0x1447f6([0x6d,0x6f,0x64,0x65,0x6c])][_0x1447f6([0x6f,0x6e])](_0x1447f6([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x3afafc,_0x3b58c5)=>{_0x3b58c5[0x0][_0x1447f6([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x2f0622++,_0x2f0622==(0x4b230fb9^_0x322a08)&&(_0x19aa6a(),_0x3afafc[_0x1447f6([0x6f,0x66,0x66])]());});}))];return window[_0x1447f6([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1447f6([0x72,0x61,0x63,0x65])](_0x2a5ff9)[_0x1447f6([0x74,0x68,0x65,0x6e])](()=>_0x586c91);}async function _0xa83927(){await _0x13c768,_0x186b06[_0x1447f6([0x6d,0x6f,0x64,0x65,0x6c])][_0x1447f6([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0xc908c,_0x186b06[_0x1447f6([0x6d,0x6f,0x64,0x65,0x6c])][_0x1447f6([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0xc908c,_0x186b06[_0x1447f6([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1447f6([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x314849(_0x58f4e7){const _0x4e4308=_0xe7ff8e();_0x186b06[_0x4e4308]=_0x1447f6([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x58f4e7,_0x58f4e7!=_0x1447f6([0x56,0x61,0x6c,0x69,0x64])&&_0xa83927();}function _0xe7ff8e(){const _0x43283a=window[_0x1447f6([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1447f6([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1447f6([0x6e,0x6f,0x77])]())[_0x1447f6([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1447f6([0x2e]),'');let _0x2249df=_0x1447f6([0x4c]);for(let _0x5691c8=0x0;_0x5691c8<_0x43283a[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x5691c8+=0x2){let _0x4497af=window[_0x1447f6([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x43283a[_0x1447f6([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x5691c8,_0x5691c8+0x2));_0x4497af>=_0x4079e7[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x4497af-=_0x4079e7[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x2249df+=_0x4079e7[_0x4497af];}return _0x2249df;}function _0x564154(){const _0x30f9ac=_0x14dda[_0x1447f6([0x73,0x70,0x6c,0x69,0x74])](_0x1447f6([0x2e]));if(0x3!=_0x30f9ac[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x1d83c0(_0x30f9ac[0x1]);function _0x1d83c0(_0x489b5b){const _0x300ed1=_0x59bdcf(_0x489b5b);return _0x300ed1&&_0x25f522()?_0x300ed1:null;function _0x25f522(){const _0x2067e9=_0x300ed1[_0x1447f6([0x6a,0x74,0x69])],_0x2eb430=window[_0x1447f6([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2067e9[_0x1447f6([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x2067e9[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x1451c6={..._0x300ed1,[_0x1447f6([0x6a,0x74,0x69])]:_0x2067e9[_0x1447f6([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x2067e9[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x1451c6[_0x1447f6([0x76,0x63])],_0x218ac7(_0x1451c6)==_0x2eb430;}}}async function _0x3a552a(){let _0x3ad12d=!0x0;try{const _0x3fa2e3=_0x14dda[_0x1447f6([0x73,0x70,0x6c,0x69,0x74])](_0x1447f6([0x2e])),[_0x2e4d2f,_0x230781,_0x5b3e2c]=_0x3fa2e3;return _0x3a15b7(_0x2e4d2f),await _0x2264d3(_0x2e4d2f,_0x230781,_0x5b3e2c),_0x3ad12d;}catch(_0x12a3bd){return!0x1;}function _0x3a15b7(_0x593a85){const _0x37f9b4=_0x59bdcf(_0x593a85);_0x37f9b4&&_0x37f9b4[_0x1447f6([0x61,0x6c,0x67])]==_0x1447f6([0x45,0x53,0x32,0x35,0x36])||(_0x3ad12d=!0x1);}async function _0x2264d3(_0xad9783,_0x565f45,_0x484df9){const _0x505d75=window[_0x1447f6([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1447f6([0x66,0x72,0x6f,0x6d])](_0xb66359(_0x484df9),_0x2e34a2=>_0x2e34a2[_0x1447f6([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x5a3958=new window[(_0x1447f6([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1447f6([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0xad9783+_0x1447f6([0x2e])+_0x565f45),_0x5d7cbf=window[_0x1447f6([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1447f6([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x5d7cbf)return;const _0x2ced97=await _0x5d7cbf[_0x1447f6([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1447f6([0x6a,0x77,0x6b]),_0x568ec2,{[_0x1447f6([0x6e,0x61,0x6d,0x65])]:_0x1447f6([0x45,0x43,0x44,0x53,0x41]),[_0x1447f6([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1447f6([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1447f6([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x5d7cbf[_0x1447f6([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1447f6([0x6e,0x61,0x6d,0x65])]:_0x1447f6([0x45,0x43,0x44,0x53,0x41]),[_0x1447f6([0x68,0x61,0x73,0x68])]:{[_0x1447f6([0x6e,0x61,0x6d,0x65])]:_0x1447f6([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x2ced97,_0x505d75,_0x5a3958)||(_0x3ad12d=!0x1);}}function _0x59bdcf(_0x4d60a5){return _0x4d60a5[_0x1447f6([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1447f6([0x65,0x79]))?JSON[_0x1447f6([0x70,0x61,0x72,0x73,0x65])](_0xb66359(_0x4d60a5)):null;}function _0xb66359(_0x23e29e){return window[_0x1447f6([0x61,0x74,0x6f,0x62])](_0x23e29e[_0x1447f6([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1447f6([0x2b]))[_0x1447f6([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1447f6([0x2f])));}function _0x218ac7(_0x2fb6c5){let _0x280f67=0x1505;function _0x39ae11(_0x5c8548){for(let _0x4b7549=0x0;_0x4b7549<_0x5c8548[_0x1447f6([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4b7549++){const _0x809bb2=_0x5c8548[_0x1447f6([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x4b7549);_0x280f67=(_0x280f67<<0x5)+_0x280f67+_0x809bb2,_0x280f67&=_0x280f67;}}function _0x131889(_0x2f29bb){Array[_0x1447f6([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2f29bb)?_0x2f29bb[_0x1447f6([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x131889):_0x2f29bb&&typeof _0x2f29bb==_0x1447f6([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1447f6([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2f29bb)[_0x1447f6([0x73,0x6f,0x72,0x74])]()[_0x1447f6([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x38de7b,_0x207e80])=>{_0x39ae11(_0x38de7b),_0x131889(_0x207e80);}):_0x39ae11(window[_0x1447f6([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2f29bb));}return _0x131889(_0x2fb6c5),_0x280f67>>>0x0;}function _0xf074fc(_0x458392){return _0x458392[_0x1447f6([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1447f6([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1447f6([0x30]));}function _0x294ce0(_0x5448bb){return _0x5448bb[_0x1447f6([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1447f6([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1447f6([0x6a,0x6f,0x69,0x6e])]('');}function _0xc908c(){}function _0x1447f6(_0x6588b5){return _0x6588b5['map'](_0x57651b=>String['fromCharCode'](_0x57651b))['join']('');}_0x314849(await _0x5ba1a4());}(this);}['showFakeVisualSelection'](){const _0x523284=this['editor']['model'];_0x523284['change'](_0x43599b=>{const _0x49e121=_0x523284['document']['selection']['getFirstRange']();if(_0x523284['markers']['has'](u))_0x43599b['updateMarker'](u,{'range':_0x49e121});else{if(_0x49e121['start']['isAtEnd']){const _0x225dee=_0x49e121['start']['getLastMatchingPosition'](({item:_0x2e47df})=>!_0x523284['schema']['isContent'](_0x2e47df),{'boundaries':_0x49e121});_0x43599b['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x43599b['createRange'](_0x225dee,_0x49e121['end'])});}else _0x43599b['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x49e121});}});}['hideFakeVisualSelection'](){const _0x314bca=this['editor']['model'];_0x314bca['markers']['has'](u)&&_0x314bca['change'](_0x383df9=>{_0x383df9['removeMarker'](u);});}['insertContent'](_0x48c147,_0x49fad0){const _0x487d95=_0x49fad0||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x487d95))return;const _0x23eb36=this['editor']['data']['processor']['toView'](_0x48c147),_0x49fd42=this['editor']['data']['toModel'](_0x23eb36);this['editor']['model']['change'](_0x58ba01=>{this['hideFakeVisualSelection']();const _0x283f65=this['editor']['model']['insertContent'](_0x49fd42,_0x487d95);_0x283f65&&_0x58ba01['setSelection'](_0x283f65);});}['insertContentBelow'](_0x28f4e5){const {model:_0x3bfce3}=this['editor'],_0x197684=Array['from'](_0x3bfce3['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x341545=_0x197684['length']?_0x3bfce3['createPositionAfter'](_0x197684['pop']()):_0x3bfce3['document']['selection']['getLastPosition']();this['insertContent'](_0x28f4e5,_0x341545);}}class v extends _0x4097de{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x15cabc('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x1f1e40){super(_0x1f1e40),this['name']='AIRequestError';}}function i(_0x1b379c,_0xb1bdd1,_0x1e4233){const t=_0x1b379c['t'];switch(_0xb1bdd1){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',_0x1e4233);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x1e4233);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'},_0x1e4233);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 _0xb1bdd1;}}class y extends _0x4bc799{['_commandDefinitions'];constructor(_0x885051,_0x13badb){super(_0x885051),this['_commandDefinitions']=_0x13badb,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x15d78d,_0x2954a7,_0x55384a)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x55384a));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x3f2bcd,_0x56f869,_0x22d699)=>{this['enabledCommandsIds']=_0x22d699?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x18c1f1=this['editor']['model'];this['_hasContext']=function(_0x4ee212){const _0x616c9=_0x4ee212['document']['selection'];return _0x616c9['isCollapsed']?0x0!==[..._0x616c9['getSelectedBlocks']()]['length']&&![..._0x616c9['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x4ee212['hasContent'](_0x616c9['getFirstRange']());}(_0x18c1f1);const _0x4889b0=_0x18c1f1['document']['selection'],_0x45e7b1=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x1031aa of _0x4889b0['getRanges']())for(const _0x5ec01b of _0x1031aa['getItems']())if(_0x5ec01b['is']('element')&&_0x45e7b1['includes'](_0x5ec01b['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x3acbbd='',_0x3eb23c='',_0x183515='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x3acbbd,_0x3eb23c,_0x183515);}}function G(_0x501716,_0x57ed67){const _0x59a280=new Set();for(const _0x259c39 of _0x501716['values']())(_0x57ed67||!0x1===_0x259c39['requiresContent'])&&_0x59a280['add'](_0x259c39['id']);return Array['from'](_0x59a280);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
24
- _0x389154(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x4e29a6,_0x3ab0c3,_0x52e525){super(),this['editor']=_0x4e29a6,this['textAdapter']=_0x3ab0c3,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x52e525,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x16cd3e,_0x3f4513,_0x44766a)=>{this['view']['value']=this['_sanitizeHTML'](_0x44766a);}),this['listenTo'](this['view'],'submitPrompt',(_0x1f2605,_0xf86d77)=>{const _0xdb2410=this['currentContext']||this['initialContext'];this['_handleQuery'](_0xf86d77,_0xdb2410,'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:_0x33fcd5,query:_0x5c783e,htmlContent:_0x3cc535,label:_0x1fdc54,mainActionLabel:_0x3aef1f}){this['view']['prompt']=_0x1fdc54,this['view']['mainAction']=_0x3aef1f,this['initialContext']=_0x3cc535,_0x5c783e&&(this['view']['isRendered']?this['_handleQuery'](_0x5c783e,_0x3cc535,_0x33fcd5,_0x1fdc54):this['view']['once']('render',()=>{this['_handleQuery'](_0x5c783e,_0x3cc535,_0x33fcd5,_0x1fdc54);}));}['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'](_0x5613dc,_0x2c05e5,_0x296774,_0x93a40f){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x2c05e5,this['previousQuery']=_0x5613dc,this['previousLabel']=_0x93a40f||_0x5613dc,this['previousActionId']=_0x296774,new Promise(_0x3c7439=>{this['textAdapter']['makeRequest']({'query':_0x5613dc,'context':_0x2c05e5,'onData':_0x21ec58=>{this['currentResponse']=_0x21ec58,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x296774})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x3370f1=>{_0x3370f1 instanceof R?this['view']['handleError'](_0x3370f1['message']):this['view']['handleError'](),_0x3c7439();})['finally'](()=>{this['stopProcessing'](),_0x3c7439();});});}['_parseAndNormalizeContent'](_0x4a80f3,_0x3a28da=!0x1){const _0x3f02ae=Z['exec'](_0x4a80f3);_0x4a80f3=_0x3f02ae?_0x4a80f3['substring'](_0x3f02ae[0x1]['length']):_0x4a80f3['length']<0x64&&!_0x3a28da?'':this['_stripMarkdownSyntax'](_0x4a80f3);const _0x387754=this['_domParser']['parseFromString'](_0x4a80f3,'text/html');if(_0x3f02ae){const _0x205552=Array['from'](_0x387754['body']['childNodes']);_0x205552['reverse']();for(const _0x3974aa of _0x205552){if(_0x3974aa['nodeType']==Node['ELEMENT_NODE'])break;_0x3974aa['remove']();}}const _0x50199f=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x387754['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x50199f),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x50199f));}['_normalizeResponseHeadings'](_0x343bfa){const _0x1ac9ea=new _0x283057(this['editor']['editing']['view']['document']),_0x34d9bf=new _0x2dea52({'name':/^h[1-5]$/}),_0x5a7945=[];let _0x1e0341=!0x1;for(const _0x3cd72c of _0x343bfa)_0x3cd72c['is']('element')&&_0x34d9bf['match'](_0x3cd72c)&&(_0x5a7945['push'](_0x3cd72c),'h1'==_0x3cd72c['name']&&(_0x1e0341=!0x0));if(_0x1e0341){for(const _0x56634 of _0x5a7945)_0x1ac9ea['rename']('h'+(parseInt(_0x56634['name'][0x1])+0x1),_0x56634);}}['_isH1TagSupportEnabled'](){const {data:_0x3f2625,editing:_0x3ba532}=this['editor'],_0x2d92ba=_0x3f2625['htmlProcessor']['toView']('<h1></h1>'),_0x4728fe=_0x3f2625['toView'](_0x3f2625['toModel'](_0x2d92ba));return!!_0x3ba532['view']['domConverter']['viewToDom'](_0x4728fe)['querySelector']('h1');}['_sanitizeHTML'](_0x294fc5){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x294fc5),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4b35f1){const _0x32fa34=_0x4b35f1['trim']();return _0x32fa34['startsWith']('```html')?_0x32fa34['endsWith']('```')?_0x32fa34['substring'](0x7,_0x32fa34['length']-0x3):_0x32fa34['substring'](0x7):_0x4b35f1;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x3717ee){super(_0x3717ee),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0xbfd74=>i(_0x3717ee,'AI_'+_0xbfd74['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x3717ee,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x3717ee,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x3717ee,'Stop'));const _0x52fc0d=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x52fc0d['if']('isVisible','ck-hidden',_0x494226=>!_0x494226)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x20ec4f,_0x558c95){const _0x2910be=new _0x11867e(this['locale']);return _0x2910be['set']({'label':_0x20ec4f,'class':_0x558c95||'','isVisible':!0x0,'withText':!0x0}),_0x2910be;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x3cb695{['contentFieldView'];['copyButtonView'];constructor(_0x16ba9d,_0x495889=''){super(_0x16ba9d),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x3cf6d4=this['bindTemplate'];this['contentFieldView']=new ct(_0x16ba9d,_0x495889),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x3cf6d4['if']('isVisible','ck-hidden',_0x568ae9=>!_0x568ae9)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x3cf6d4['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 _0x4dbf74=!0x1;this['on']('change:value',(_0x5d159,_0x5d9bb8,_0x7a8b1e)=>{const _0x4a7cc3=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x7a8b1e),this['isProcessing']&&_0x4a7cc3&&!_0x4dbf74&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x10060c,_0x5f2d91,_0x42810d)=>{_0x4dbf74=!0x1,_0x42810d?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x4dbf74=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x4dbf74=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x178076=this['locale'],_0x49595e=new _0x11867e(this['locale']),_0xae78f8='ck-ai-form__copy-button';return _0x49595e['set']({'label':i(_0x178076,'Copy'),'icon':U,'class':_0xae78f8,'tooltip':!0x0}),_0x49595e['bind']('isVisible')['to'](this,'value',_0xab47d1=>!!_0xab47d1),_0x49595e['bind']('isEnabled')['to'](this,'isProcessing',_0x7965c4=>!_0x7965c4),_0x49595e['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x49595e['icon']=_0x4e4c41['check'],_0x49595e['class']=_0xae78f8+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x49595e['icon']=U,_0x49595e['class']=_0xae78f8;},0x3e8);}),_0x49595e;}['_copyHTMLToClipboard'](_0x2000e6){const {window:_0xf486a8,document:_0x8f0c0b}=_0xe6d08;if(_0xf486a8['ClipboardItem']){const {Blob:_0x2aa75e,ClipboardItem:_0x2f34a4}=_0xf486a8,_0x4d1afb=[new _0x2f34a4({'text/html':new _0x2aa75e([_0x2000e6['innerHTML']],{'type':'text/html'}),'text/plain':new _0x2aa75e([_0x2000e6['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x4d1afb);}else{const _0xb80a73=_0x8f0c0b['createElement']('div');_0xb80a73['style']['position']='absolute',_0xb80a73['style']['left']='-9999px',_0xb80a73['innerHTML']='<span>[</span>'+_0x2000e6['innerHTML']+'<span>]</span>',_0x8f0c0b['body']['appendChild'](_0xb80a73);const _0x586400=_0x8f0c0b['createRange']();_0x586400['setStartAfter'](_0xb80a73['firstElementChild']),_0x586400['setEndBefore'](_0xb80a73['lastElementChild']);const _0x314b49=_0xf486a8['getSelection']();_0x314b49['removeAllRanges'](),_0x314b49['addRange'](_0x586400),_0x8f0c0b['execCommand']('copy'),_0xb80a73['remove']();}}}class ct extends _0x3cb695{constructor(_0x380acb,_0x1d4a1b=''){super(_0x380acb),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x1d4a1b,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x1cbbe9){this['element']['innerHTML']=_0x1cbbe9;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0xbe349c=new _0x3cb695(),_0x36c6bf=this['locale'],_0x3bbcbe=new _0x314fa5();return _0x3bbcbe['isVisible']=!0x0,_0xbe349c['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x3bbcbe,{'text':i(_0x36c6bf,'AI\x20is\x20writing...')}]}),_0xbe349c['render'](),_0xbe349c;}}class tt extends _0x3cb695{constructor(_0x4bd782,_0x3af68b=''){super(_0x4bd782);const _0x57d62e=new _0x36f35d(),_0x43c1be=this['bindTemplate'];this['set']('text',_0x3af68b),_0x57d62e['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x57d62e,{'text':_0x43c1be['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0xb19736,_0x4f1aaa){super(_0xb19736,_0x4f1aaa),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',(_0x5e6367,_0x4c90d4)=>{_0x5e6367['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x4c90d4());});}['_createSubmitButton'](){const _0x1c3ecd=new _0x11867e(this['locale']),_0x4f0f44=this['locale'];return _0x1c3ecd['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x4f0f44,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x1c3ecd['on']('execute',()=>{this['submit']();}),_0x1c3ecd['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x543b6e,_0x522dd0)=>!_0x543b6e&&_0x522dd0),_0x1c3ecd;}['_createShowHistoryButton'](){const _0x4b10bd=new _0x11867e(this['locale']),_0xb8bc20=this['resultsView'],_0x2750c2=this['locale'];_0x4b10bd['set']({'label':i(_0x2750c2,'History'),'withText':!0x1,'icon':_0x4e4c41['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x4b10bd['bind']('isOn')['to'](_0xb8bc20,'isVisible'),_0x4b10bd['bind']('isEnabled')['to'](this,'isEnabled'),_0x4b10bd['on']('execute',()=>{_0xb8bc20['isVisible']=!_0xb8bc20['isVisible'],_0xb8bc20['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x4f09cb=()=>{_0xe6d08['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x2827c2=new st(this['queryView']['fieldView']['element']),_0x5f4226=_0x2827c2['width'],_0x50ac85='rtl'===_0x2750c2['uiLanguageDirection']?'left':'right';_0x2827c2['excludeScrollbarsAndBorders'](),_0x4b10bd['element']['style'][_0x50ac85]=_0x5f4226-_0x2827c2['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x4f09cb),this['on']('render',_0x4f09cb),_0x4b10bd;}['submit'](){const _0x300a1f=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0x300a1f);}['focus'](_0x2e782d){-0x1===_0x2e782d?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x3cbec0){super(_0x3cbec0),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x3cbec0,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0x9e47cb=0x0;for(const _0x9bda0 of this['items'])_0x9e47cb+=_0x9bda0['items']['length'];return{'resultsCount':_0x9e47cb,'totalItemsCount':_0x9e47cb};}['_createClearHistoryButton'](){const _0x282d19=this['locale'],_0x3a978f=new _0x11867e(this['locale']);return _0x3a978f['set']({'label':'('+i(_0x282d19,'Clear')+')','withText':!0x0}),_0x3a978f['on']('execute',()=>this['fire']('clearHistory')),_0x3a978f;}}class hs extends _0x577b51{constructor(_0x515779){super();const _0x45bee2=new te(),_0x16f920=new _0x11867e(this['locale'],_0x45bee2);this['children']['add'](_0x16f920),_0x16f920['set']({'label':_0x515779['prompt'],'withText':!0x0}),_0x16f920['on']('execute',()=>{this['fire']('execute',{'value':_0x69b3b3(_0x515779['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x1349b0{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x3fa4ab,_0x26866a)=>{const _0x292c81=Ss(_0x26866a['prompt']);for(const _0x250c98 of this)if(_0x250c98!=_0x26866a&&Ss(_0x250c98['prompt'])===_0x292c81){this['remove'](_0x250c98);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0xe922b8=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0xe922b8));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0xb6d3f1=>_0xb6d3f1)));}}function Ss(_0x4bc0b3){return _0x4bc0b3['toLowerCase']()['trim']();}class K extends _0x3cb695{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x3b8fd6,_0xc36be,_0x1fa4b0=''){super(_0x3b8fd6),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x3b8fd6),this['contentArea']=new W(_0x3b8fd6,_0x1fa4b0),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 _0x33bee8(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x429aab({'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 _0x27bcb0=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0xc36be],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x27bcb0['if']('isError','ck-hidden',_0x4fbaa3=>!_0x4fbaa3)]},'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'](_0x7a2a55=0x1){-0x1===_0x7a2a55?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 _0x3b526e=this['locale'],_0x17c813=new ht(_0x3b526e,{'queryView':{'label':i(_0x3b526e,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0xb2848d,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x3b526e,'Empty\x20history'),'secondary':i(_0x3b526e,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x17c813['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0xa4ebda,_0xf29755)=>_0xa4ebda&&!_0xf29755),this['listenTo'](_0x17c813,'submit',(_0x5e2768,_0x808cea)=>{this['prompt']=_0x808cea;const _0x59d018=_0x45846c(_0x808cea);this['fire']('submitPrompt',_0x59d018),_0x808cea['trim']()&&this['_promptHistory']['add']({'prompt':_0x59d018},0x0);},{'priority':'high'}),_0x17c813;}['_createHistoryView'](){const _0x3aa492=new rs(this['locale']);return _0x3aa492['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0x3aa492['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0x3aa492;}['_createToolbar'](){const _0x4db979=new nt(this['locale']);return _0x4db979['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0xb69393,_0x3af4d9,_0x466536)=>_0xb69393&&!_0x3af4d9&&!!_0x466536),_0x4db979['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0x4db979['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x379e36,_0x3fafbf,_0x362274)=>_0x379e36&&!_0x3fafbf&&!!_0x362274),_0x4db979['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0x4db979['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x17de86,_0x19b0cb)=>_0x17de86&&!_0x19b0cb),_0x4db979['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0x4db979['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0x4db979['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0x4db979;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x3aeb3e=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x3aeb3e,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x4adf17){const _0x5ccdd5=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x4adf17||i(_0x5ccdd5,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x4097de{['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[_0x9b6142,a,v,_0x58721c];}constructor(_0x527178){super(_0x527178),_0x527178['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0x527178['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0x527178['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0x527178['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x2a5e85}=this;this['_aiAdapter']=_0x2a5e85['plugins']['get'](v),this['_dialog']=_0x2a5e85['plugins']['get'](_0x58721c),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2899ae=new y(_0x2a5e85,Array['from'](this['_commandDefinitions']['values']()));_0x2a5e85['commands']['add']('showAIAssistant',_0x2899ae),_0x2a5e85['ui']['componentFactory']['add']('aiCommands',_0x431281=>{const _0x133a1a=_0x379768(_0x431281);return _0x133a1a['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0x133a1a['buttonView']['set']({'label':i(_0x431281,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0x133a1a['on']('execute',_0x405670=>this['_onExecute'](_0x405670['source']['id'])),_0x3c8dce(_0x133a1a,_0x2a5e85['ui']['view']['body'],function(_0x2d4b86){const _0x5f4590=o(_0x2d4b86['config']['get']('ai.aiAssistant.commands'),_0x2d4b86['locale']),_0x366bdd=B(_0x2d4b86,_0x5f4590)['filter'](_0x24e3e3=>_0x24e3e3['commands']['length']);if(0x1===_0x366bdd['length'])return B(_0x2d4b86,_0x366bdd[0x0]['commands'])['map'](_0xccbd8c=>({'id':_0xccbd8c['id'],'label':_0xccbd8c['label']}));return _0x366bdd['map'](_0x5c7e16=>{const {groupId:_0x5ca03c,groupLabel:_0x4f8957,commands:_0x2edb1a}=_0x5c7e16,_0x400be2=B(_0x2d4b86,_0x2edb1a)['map'](_0x1dd047=>({'id':_0x1dd047['id'],'label':_0x1dd047['label']}));return{'id':_0x5ca03c,'menu':_0x4f8957||_0x5ca03c,'children':_0x400be2};});}(_0x2a5e85),{'ariaLabel':i(_0x431281,'AI\x20Commands')}),_0x133a1a['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2899ae['on']('change:enabledCommandsIds',_0x1ed5ff),_0x133a1a['menuView']['once']('render',_0x1ed5ff),_0x133a1a;function _0x1ed5ff(){_0x133a1a['isEnabled']=_0x2899ae['enabledCommandsIds']['length']>0x0;for(const _0x1237e5 of _0x133a1a['menuView']['buttons'])_0x1237e5['isEnabled']=_0x2899ae['enabledCommandsIds']['includes'](_0x1237e5['id']);}}),_0x2a5e85['ui']['componentFactory']['add']('menuBar:aiCommands',_0x2d074f=>{const _0x1d4823=new _0x1151e9(_0x2d074f);_0x1d4823['buttonView']['set']({'label':i(_0x2d074f,'AI\x20Commands'),'icon':E}),_0x1d4823['bind']('isEnabled')['to'](_0x2899ae,'enabledCommandsIds',_0xca4cfb=>_0xca4cfb['length']>0x0);const _0x297843=o(_0x2a5e85['config']['get']('ai.aiAssistant.commands'),_0x2d074f);return this['_populateMenuBarMenu'](_0x2899ae,_0x1d4823,_0x297843,_0x3c058f=>this['_onExecute'](_0x3c058f)),_0x1d4823;}),_0x2a5e85['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x284fc0=this['_createAIAssistantUIButton'](_0x11867e);return _0x284fc0['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x284fc0;}),_0x2a5e85['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0x357697=this['_createAIAssistantUIButton'](_0x157c5f);return _0x357697['set']({'role':'menuitemcheckbox'}),_0x357697;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x4c1057=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x2eed9b;for(const _0x5cce8d in _0x4c1057){const _0xe56173=_0x5cce8d,_0x5a96da=_0x4c1057[_0xe56173];if('aiLicenseKeyValid'==_0x5a96da||'aiLicenseKeyInvalid'==_0x5a96da||'aiLicenseKeyExpired'==_0x5a96da||'aiLicenseKeyDomainLimit'==_0x5a96da||'aiLicenseKeyNotAllowed'==_0x5a96da||'aiLicenseKeyEvaluationLimit'==_0x5a96da||'aiLicenseKeyTrialLimit'==_0x5a96da||'aiLicenseKeyDevelopmentLimit'==_0x5a96da||'aiLicenseKeyUsageLimit'==_0x5a96da){delete _0x4c1057[_0xe56173],_0x2eed9b=_0x5a96da,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x2eed9b&&_0x4c1057['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x2eed9b&&_0x4c1057['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x2eed9b&&_0x4c1057['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x2eed9b&&_0x4c1057['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x2eed9b&&_0x4c1057['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x2eed9b&&_0x4c1057['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x2eed9b&&_0x4c1057['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x2eed9b&&_0x4c1057['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0x2e7df1='',_0x154329='',_0x26108d='custom'){const _0x1570b2=this['editor'],_0x261feb=_0x1570b2['editing']['view'],_0x14b205=_0x1570b2['plugins']['get'](a),_0x292468=_0x1570b2['plugins']['get'](_0x9b6142);_0x14b205['showFakeVisualSelection']();const _0x1ff27b=new j(),_0x869fe6=new ClipboardEvent('copy',{'clipboardData':_0x1ff27b}),_0xb1ccf3=new _0x44a842(_0x1ff27b),_0x195ffb=new _0x2e117c(_0x261feb,_0x869fe6,{'dataTransfer':_0xb1ccf3});_0x292468['_forceMarkersCopy']('comment',()=>{_0x261feb['document']['fire']('copy',_0x195ffb);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x1570b2,this['_aiAdapter']['textAdapter'],this['_formView']));let _0xb38959=_0xb1ccf3['getData']('text/html');const _0x394088=_0x1570b2['model']['document']['selection'],_0x3a7340=Array['from'](_0x394088['getRanges']());0x1===_0x3a7340['length']&&_0x3a7340[0x0]['isFlat']&&!_0x394088['getSelectedElement']()&&''!==_0xb38959['replace'](/&nbsp;/g,'')['trim']()&&(_0xb38959='<p>'+_0xb38959+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x26108d,'query':_0x2e7df1,'htmlContent':_0xb38959,'label':_0x154329,'mainActionLabel':x[_0x1570b2['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x55461a['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x14b205['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x53c7b2=new Map(),_0x2cab6d=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x47c150 of _0x2cab6d)for(const _0x5953be of _0x47c150['commands'])_0x53c7b2['set'](_0x5953be['id'],{..._0x5953be,'groupId':_0x47c150['groupId'],'groupLabel':_0x47c150['groupLabel']||_0x47c150['groupId']});return _0x53c7b2;}['_createAIAssistantUIButton'](_0x37c2a){const _0x4bdb7a=this['editor'],_0x3fce7b=_0x4bdb7a['commands']['get']('showAIAssistant'),_0x1ea65e=new _0x37c2a(_0x4bdb7a['locale']);return _0x1ea65e['set']({'label':i(_0x4bdb7a['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x1ea65e['bind']('isEnabled')['to'](_0x3fce7b),_0x1ea65e['bind']('isOn')['to'](this['_dialog'],'id',_0x1f5c35=>'aiAssistant'===_0x1f5c35),this['listenTo'](_0x1ea65e,'execute',()=>{_0x1ea65e['isOn']?this['hideUI']():_0x3fce7b['execute']();}),_0x1ea65e;}['_initView'](){const _0x2f29dd=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',()=>{_0x2f29dd['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x2f29dd['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x2289e1,ui:{ariaLiveAnnouncer:_0x444dba}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x2c96ce,_0x78cc5e,_0x48a197)=>{const _0xcb53be=this['_aiAssistantController']['currentContext'];_0x48a197?_0x444dba['announce'](i(_0x2289e1,'AI\x20is\x20writing')):_0xcb53be&&_0x444dba['announce'](i(_0x2289e1,'Generated\x20content:\x20%0',_0xcb53be),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x517af5,_0x3d55d8,_0x4dc48a)=>{if(_0x4dc48a){const _0x25d195=this['_formView']['errorView']['text'];_0x444dba['announce'](i(_0x2289e1,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x25d195));}});}['_onExecute'](_0x26bc80){const _0x38c779=this['_commandDefinitions']['get'](_0x26bc80),_0x27a578=this['editor'],_0x13296e=_0x27a578['model']['document']['selection'],_0x24593b=_0x27a578['commands']['get']('showAIAssistant'),_0x60673=_0x27a578['plugins']['get'](a),_0x322d8d=''+(_0x38c779['groupId']!==I?_0x38c779['groupLabel']+':\x20':'')+_0x38c779['label'];if(!0x1!==_0x38c779['requiresContent']&&_0x13296e['isCollapsed']){const _0x253fb9=_0x40ce29(_0x13296e['getSelectedBlocks']())||_0x27a578['model']['schema']['getLimitElement'](_0x13296e);_0x27a578['model']['change'](_0x31a6bd=>{_0x31a6bd['setSelection'](_0x253fb9,'in');});}_0x60673['showFakeVisualSelection'](),_0x24593b['execute'](_0x38c779['prompt'],_0x322d8d,'command:'+_0x26bc80);}['_populateMenuBarMenu'](_0x47652a,_0xf07cf7,_0x7245a0,_0xf9ebc7){const _0x2cfc65=this['editor'],_0x19f04=_0x2cfc65['locale'],_0x1a5925=new _0x2618d0(_0x19f04),_0x419ee9=B(_0x2cfc65,_0x7245a0)['filter'](_0x49aaa6=>_0x49aaa6['commands']['length']);0x1===_0x419ee9['length']?this['_getMenuBarGroupButtons']({'command':_0x47652a,'commands':_0x419ee9[0x0]['commands'],'parentMenuView':_0xf07cf7,'onExecute':_0xf9ebc7})['forEach'](_0x52b8e6=>_0x1a5925['items']['add'](_0x52b8e6)):_0x419ee9['forEach'](({groupId:_0x250e2e,groupLabel:_0x9b71a1,commands:_0x8f8894})=>{const _0x3ffb01=new _0x3f14ed(_0x19f04,_0xf07cf7),_0x18bfce=new _0x1151e9(_0x19f04),_0x3408ca=new _0x2618d0(_0x19f04),_0x2cb86c=this['_getMenuBarGroupButtons']({'command':_0x47652a,'commands':_0x8f8894,'parentMenuView':_0x18bfce,'onExecute':_0xf9ebc7});_0x18bfce['buttonView']['set']({'label':_0x9b71a1||_0x250e2e}),_0x18bfce['delegate']('execute')['to'](_0xf07cf7),_0x3408ca['items']['addMany'](_0x2cb86c),_0x18bfce['panelView']['children']['add'](_0x3408ca),_0x3ffb01['children']['add'](_0x18bfce),_0x1a5925['items']['add'](_0x3ffb01);}),_0xf07cf7['panelView']['children']['add'](_0x1a5925);}['_getMenuBarGroupButtons']({command:_0x1fcf90,commands:_0x331e19,parentMenuView:_0x537950,onExecute:_0x2d42d5}){const _0x2f1c2e=this['editor'],_0x440281=_0x2f1c2e['locale'];return B(_0x2f1c2e,_0x331e19)['map'](_0x278c7c=>{const _0x12fc52=new _0x3f14ed(_0x440281,_0x537950),_0x55d5d8=new _0x157c5f(_0x440281);return _0x55d5d8['set']({'label':_0x278c7c['label']}),_0x55d5d8['delegate']('execute')['to'](_0x537950),_0x55d5d8['on']('execute',()=>_0x2d42d5(_0x278c7c['id'])),_0x55d5d8['bind']('isEnabled')['to'](_0x1fcf90,'enabledCommandsIds',_0x9c2b9e=>_0x9c2b9e['includes'](_0x278c7c['id'])),_0x12fc52['children']['add'](_0x55d5d8),_0x12fc52;});}}function _(_0x5da408,_0x58b2bc){return void 0x0!==_0x5da408['order']&&void 0x0===_0x58b2bc['order']?0x1:void 0x0===_0x5da408['order']&&void 0x0!==_0x58b2bc['order']?-0x1:void 0x0!==_0x5da408['order']&&void 0x0!==_0x58b2bc['order']?_0x5da408['order']-_0x58b2bc['order']:0x0;}function B(_0x1aa3c5,_0x45b570){_0x45b570['sort'](_);const _0x2953a4={},_0x62a5e=[];for(const _0x50e5a2 of _0x45b570)if(void 0x0!==_0x50e5a2['order']){if(_0x50e5a2['order']in _0x2953a4)throw new _0x15cabc('ai-commands-config-order-collision',_0x1aa3c5,{'conflictingDefinitions':[_0x50e5a2,_0x2953a4[_0x50e5a2['order']]]});_0x2953a4[_0x50e5a2['order']]=_0x50e5a2,_0x62a5e['splice'](_0x50e5a2['order'],0x0,_0x50e5a2);}else _0x62a5e['push'](_0x50e5a2);return _0x62a5e;}class r extends _0x4097de{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x4296e8){super(_0x4296e8);const _0x31a139=_0x4296e8['config'],_0x3a53a1=_0x4296e8['locale'];_0x31a139['define']('ai.aiAssistant.commands',function(_0x1c3e8d){return[{'groupId':'editOrReview','groupLabel':i(_0x1c3e8d,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x1c3e8d,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x1c3e8d,'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(_0x1c3e8d,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x1c3e8d,'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(_0x1c3e8d,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x1c3e8d,'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(_0x1c3e8d,'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(_0x1c3e8d,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x1c3e8d,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x1c3e8d,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x1c3e8d,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x1c3e8d,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x1c3e8d,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x1c3e8d,'Change\x20style'),'commands':[{'id':'business','label':i(_0x1c3e8d,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x1c3e8d,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x1c3e8d,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x1c3e8d,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x1c3e8d,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x1c3e8d,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x1c3e8d,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x1c3e8d,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x1c3e8d,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x1c3e8d,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x1c3e8d,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x1c3e8d,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x1c3e8d,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3a53a1)),_0x31a139['define']('ai.aiAssistant.extraCommandGroups',[]),_0x31a139['define']('ai.aiAssistant.removeCommands',[]);const _0x136f96=o(_0x31a139['get']('ai.aiAssistant.commands'),_0x3a53a1),_0x1fa844=_0x31a139['get']('ai.aiAssistant.extraCommandGroups'),_0x58c074=_0x31a139['get']('ai.aiAssistant.removeCommands');_0x1fa844['forEach'](_0x334b2a=>{const _0x569b8f=_0x136f96['find'](_0x162061=>_0x162061['groupId']===_0x334b2a['groupId']);_0x569b8f?_0x569b8f['commands']=_0x569b8f['commands']['concat'](_0x334b2a['commands']):_0x136f96['push'](_0x334b2a);}),_0x136f96['forEach'](_0x612422=>{_0x612422['commands']=_0x612422['commands']['filter'](_0x2edf4b=>!_0x58c074['includes'](_0x2edf4b['id']));}),_0x31a139['set']('ai.aiAssistant.commands',_0x136f96);}}class P extends _0x4097de{['abortController'];static get['requires'](){return[v];}constructor(_0x19789d){super(_0x19789d),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x57f13b){return this['sendRequest'](_0x57f13b)['catch'](_0x382f45=>{if(_0x382f45 instanceof R)return Promise['reject'](_0x382f45);if('AbortError'==_0x382f45['name'])return Promise['resolve']();throw console['error'](_0x382f45),new _0x15cabc('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x4c5a6a,_0x258dc9){const _0x1729e9=this['editor']['locale'],_0x22efc7={'Content-Type':'application/json'};if('object'==typeof _0x4c5a6a)Object['assign'](_0x22efc7,_0x4c5a6a);else{if(_0x4c5a6a)try{const _0x17a2d2=await _0x4c5a6a(_0x258dc9);Object['assign'](_0x22efc7,_0x17a2d2);}catch(_0x9e516c){return Promise['reject'](new R(i(_0x1729e9,'AI_ERROR_GET_HEADERS')));}}return _0x22efc7;}async['_prepareRequestParameters'](_0x10e6c1,_0x38a6e5){const _0xff1c6c=this['editor']['locale'];if('object'==typeof _0x10e6c1)return _0x10e6c1;try{return await _0x10e6c1(_0x38a6e5);}catch(_0x18e329){return Promise['reject'](new R(i(_0xff1c6c,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5a1239){super(_0x5a1239),_0x5a1239['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5a1239['config']['get']('ai.openAI.requestParameters')||_0x5a1239['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5a1239['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x5a1239['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x5a1239['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0xbefc68,context:_0x2d8eb3,onData:_0x104f9e,actionId:_0x34784f}){const _0x18e8f0=this['editor']['locale'],_0xe2a187=await this['prepareMessages'](_0xbefc68,_0x2d8eb3,_0x34784f),_0x466d8e=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x34784f),_0x17ad28=await this['_prepareRequestParameters'](this['_requestParameters'],_0x34784f),_0x16163f={'messages':_0xe2a187,..._0x17ad28},_0x5f4e19={'method':'POST','headers':_0x466d8e,'body':JSON['stringify'](_0x16163f),'signal':this['abortController']['signal']},_0x20673f=await fetch(this['_apiUrl'],_0x5f4e19);if(_0x20673f['ok'])return _0x17ad28['stream']?await this['_readStreamableResponse'](_0x20673f,_0x104f9e):await this['_readStaticResponse'](_0x20673f,_0x104f9e),Promise['resolve']();{const _0x85defb=await _0x20673f['text']();return _0x85defb['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x18e8f0,'AI_ERROR_CONTEXT_LENGTH'))):_0x85defb['includes']('Moderation')?Promise['reject'](new R(i(_0x18e8f0,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x85defb));}}async['prepareMessages'](_0x33f6d3,_0x482bda,_0x5ee823){let _0x52c5bd,_0x311722;return _0x482bda?(_0x52c5bd='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.',_0x311722='Instruction:\x0a'+_0x33f6d3+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x482bda):(_0x52c5bd='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.',_0x311722=_0x33f6d3),[{'role':'system','content':_0x52c5bd},{'role':'user','content':_0x311722}];}async['_readStreamableResponse'](_0x24f593,_0x129e04){const _0x3a8d38=_0x24f593['body']['getReader'](),_0x15bc36=new TextDecoder();let _0x65e4ad='',_0x28ffb9='',_0x1040b1='',_0x4a7209=!0x1;for(;!_0x4a7209;){const {done:_0x1fb9b5,value:_0x34d5f3}=await _0x3a8d38['read'](),_0x2b90d3=_0x65e4ad+_0x15bc36['decode'](_0x34d5f3);let _0x3321a4='';_0x4a7209=_0x1fb9b5;try{_0x3321a4=this['_cleanUpData'](_0x2b90d3),_0x65e4ad='';}catch(_0x4d01fb){_0x65e4ad=_0x2b90d3;continue;}_0x28ffb9+=_0x3321a4,!_0x4a7209&&this['_isBufferIncomplete'](_0x28ffb9)||_0x28ffb9&&(_0x1040b1+=_0x28ffb9,_0x28ffb9='',_0x129e04(_0x1040b1));}return Promise['resolve']();}async['_readStaticResponse'](_0xadf071,_0xd1b361){return _0xd1b361((await _0xadf071['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x158347){const _0x2d373e=_0x158347['split']('<')['length']!==_0x158347['split']('>')['length'],_0x27a16b=_0x158347['length']<0x1e;return _0x2d373e&&_0x27a16b;}['_cleanUpData'](_0x431b89){return _0x431b89['split'](/\n(?![^{]*\})/g)['map'](_0x5b5d05=>_0x5b5d05['replace']('data:\x20',''))['filter'](_0x3eb37b=>_0x3eb37b&&_0x3eb37b['length']>0x0&&'[DONE]'!==_0x3eb37b)['map'](_0x1ea157=>{const {choices:_0x23941d}=JSON['parse'](_0x1ea157);if(_0x23941d[0x0]&&_0x23941d[0x0]['delta']&&_0x23941d[0x0]['delta']['content'])return _0x23941d[0x0]['delta']['content'];})['filter'](_0x51fc58=>_0x51fc58)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x2d2cc0){super(_0x2d2cc0),_0x2d2cc0['config']['get']('ai.aws.requestParameters')||_0x2d2cc0['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']=_0x2d2cc0['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x2d2cc0['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x2d2cc0['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x2d2cc0['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x5f5d8a,context:_0x2155ad,onData:_0x5e7a80,actionId:_0xf89023}){const {model:_0x529204,stream:_0x27619c,..._0x1063f3}=await this['_prepareRequestParameters'](this['_requestParameters'],_0xf89023),_0xcfe52b={'prompt':await this['preparePrompt'](_0x5f5d8a,_0x2155ad,_0x529204,_0xf89023),..._0x1063f3};this['_apiUrl']?await this['_processProxyRequest'](_0xcfe52b,_0x529204,_0x27619c,_0x5e7a80,_0xf89023):await this['_processAWSRequest'](_0xcfe52b,_0x529204,_0x27619c,_0x5e7a80);}async['preparePrompt'](_0x9fdc21,_0x3988db,_0x445b68,_0x554b24){let _0x22f4f5,_0x3ee7be;return _0x3988db?(_0x22f4f5='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.',_0x3ee7be='Instruction:\x0a'+_0x9fdc21+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x3988db):(_0x22f4f5='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.',_0x3ee7be=_0x9fdc21),'meta.llama'==this['getModelFamily'](_0x445b68)?'<<SYS>>\x0a'+_0x22f4f5+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x3ee7be+'\x0a[/INST]':'Human:\x0a'+_0x22f4f5+'\x0a'+_0x3ee7be+'\x0a\x0aAssistant:';}['getModelFamily'](_0x370acc){if(/^anthropic\.claude/['test'](_0x370acc))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x370acc))return'ai21.j2';if(/^cohere\.command/['test'](_0x370acc))return'cohere.command';if(/^meta\.llama/['test'](_0x370acc))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x370acc));}async['_processProxyRequest'](_0x471c41,_0x1a2981,_0x131c86,_0x5b4883,_0x3ef08b){const _0x10b693={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x3ef08b),'body':JSON['stringify']({..._0x471c41,'model':_0x1a2981,'stream':_0x131c86}),'signal':this['abortController']['signal']},_0x5d84b9=await fetch(this['_apiUrl'],_0x10b693);_0x131c86?await this['_readStreamableResponse'](_0x5d84b9,_0x1a2981,_0x5b4883):await this['_readStaticResponse'](_0x5d84b9,_0x1a2981,_0x5b4883);}async['_processAWSRequest'](_0x57c4b5,_0xaf66a5,_0x5b355f,_0xfa9e6c){const _0x14aa64=new _0x1962cd(this['_bedrockClientConfig']),_0x348fe9={'body':JSON['stringify'](_0x57c4b5),'contentType':'application/json','accept':'application/json','modelId':_0xaf66a5};let _0x178371;if(_0x5b355f){const _0x3e6d1e=new _0x322a48(_0x348fe9);_0x178371=await _0x14aa64['send'](_0x3e6d1e,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x178371,_0xaf66a5,_0xfa9e6c);}else{const _0xfbf9cc=new _0x2034e4(_0x348fe9);_0x178371=await _0x14aa64['send'](_0xfbf9cc,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x178371,_0xaf66a5,_0xfa9e6c);}}async['_readAsyncIterableResponse'](_0x47b58b,_0x4480d6,_0x3ca91c){const _0x3f9d73=_0x47b58b['body'],_0x864a7b=new TextDecoder('utf-8');let _0x48f481='';for await(const _0x4b62d8 of _0x3f9d73)if(_0x4b62d8['chunk']){const _0x369423=_0x864a7b['decode'](_0x4b62d8['chunk']['bytes']),_0x186fe6=JSON['parse'](_0x369423);_0x48f481+=this['_getGeneratedText'](_0x186fe6,_0x4480d6),_0x3ca91c(_0x48f481);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4ae19b,_0xb83d3e,_0x5b4e1f){const _0x2fcf32=_0x4ae19b['body'],_0x13ab43=new TextDecoder('utf-8'),_0x1e5bbd=_0x2fcf32['getReader']();let _0x45b39a='',_0x28adb4='',_0x508693=!0x1;for(;!_0x508693;){const {done:_0x279869,value:_0x1c5038}=await _0x1e5bbd['read']();if(_0x508693=_0x279869,_0x508693)break;const _0x37a451=(_0x45b39a+_0x13ab43['decode'](_0x1c5038))['split']('\x0a')['map'](_0x2b5539=>{try{return _0x45b39a='',JSON['parse'](_0x2b5539);}catch(_0x1ad104){return _0x45b39a=_0x2b5539,null;}})['filter'](_0x5233e9=>null!==_0x5233e9);_0x37a451['length']&&(_0x28adb4+=_0x37a451['map'](_0x2b5a77=>this['_getGeneratedText'](_0x2b5a77,_0xb83d3e))['join'](''),_0x5b4e1f(_0x28adb4));}return Promise['resolve']();}async['_readStaticResponse'](_0x4b3bed,_0x546407,_0x4b2e91){let _0x55c00a;return _0x55c00a=_0x4b3bed instanceof Response?await _0x4b3bed['json']():JSON['parse'](Buffer['from'](_0x4b3bed['body'])['toString']('utf8')),(_0x4b2e91(this['_getGeneratedText'](_0x55c00a,_0x546407)),Promise['resolve']());}['_getGeneratedText'](_0x27ffae,_0x54b48){switch(this['getModelFamily'](_0x54b48)){case'anthropic.claude':return _0x27ffae['completion'];case'ai21.j2':return _0x27ffae['completions'][0x0]['data']['text'];case'cohere.command':return _0x27ffae['generations'][0x0]['text'];case'meta.llama':return _0x27ffae['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
23
+ import{Plugin as _0x3161c5,Command as _0x4fed47,icons as _0x17066c}from'@ckeditor/ckeditor5-core/dist/index.js';import{uid as _0x118f7c,CKEditorError as _0x3cb6d1,ObservableMixin as _0x9cea87,global as _0x445842,isVisible as it,Rect as st,Collection as _0x415f3e,FocusTracker as _0x53fe92,KeystrokeHandler as ts,first as _0x55706b}from'@ckeditor/ckeditor5-utils/dist/index.js';import{ToolbarView as rt,ButtonView as _0x5653f8,View as _0x368bf7,SpinnerView as _0x13f2a8,IconView as _0xbc43cd,AutocompleteView as ot,ListView as lt,ListItemGroupView as ut,ListItemView as _0x19e678,ButtonLabelView as te,FocusCycler as _0x53f0b8,createLabeledTextarea as _0x587a80,Dialog as _0x58d003,createDropdown as _0x5abca7,addMenuToDropdown as _0x4b49b0,MenuBarMenuView as _0x26e97a,MenuBarMenuListItemButtonView as _0x1766be,DialogViewPosition as _0x1faabc,MenuBarMenuListView as _0x1ce8fc,MenuBarMenuListItemView as _0x188147}from'@ckeditor/ckeditor5-ui/dist/index.js';import{icons as at}from'ckeditor5-collaboration/dist/index.js';import{UpcastWriter as _0x508a31,Matcher as _0x16dd6c,DataTransfer as _0x31b5e3,DomEventData as _0x26b03b}from'@ckeditor/ckeditor5-engine/dist/index.js';import{unescape as _0x1aaa8a,escape as _0x592ed9}from'lodash-es';import{ClipboardMarkersUtils as _0xbd19d3}from'@ckeditor/ckeditor5-clipboard/dist/index.js';import{BedrockRuntimeClient as _0x5f54e7,InvokeModelWithResponseStreamCommand as _0x19794c,InvokeModelCommand as _0x128ba0}from'@aws-sdk/client-bedrock-runtime';const I='_ungrouppedCommands';function o(_0x4f000d,_0x482c10){const _0x1cbca6=(0x0,_0x482c10['t'])('Other');return _0x4f000d['length']?'groupId'in _0x4f000d[0x0]?_0x4f000d:[{'groupId':I,'groupLabel':_0x1cbca6,'order':0x1/0x0,'commands':_0x4f000d}]:[{'groupId':I,'groupLabel':_0x1cbca6,'order':0x1/0x0,'commands':[]}];}const u='ai-ui';class a extends _0x3161c5{static get['pluginName'](){return'AIAssistantEditing';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x1a4e90}=this,_0x2a4e38=['ck-fake-ai-selection'];_0x1a4e90['config']['get']('ai.useTheme')&&_0x2a4e38['push']('ck-ai-assistant-ui_theme'),_0x1a4e90['conversion']['for']('editingDowncast')['markerToHighlight']({'model':u,'view':{'classes':_0x2a4e38,'priority':0xc}}),_0x1a4e90['conversion']['for']('editingDowncast')['markerToElement']({'model':u,'view':(_0x77af61,{writer:_0x39a551})=>{if(!_0x77af61['markerRange']['isCollapsed'])return null;const _0x329d63=_0x39a551['createUIElement']('span');return _0x39a551['addClass'](['ck-fake-ai-selection','ck-fake-ai-selection_collapsed'],_0x329d63),_0x329d63;}});}['afterInit'](){!async function(_0x512a8d){const _0x295532=_0x25d248([0x38,0x46,0x41,0x64,0x57,0x32,0x30,0x43,0x42,0x4b,0x76,0x5a,0x31,0x6e,0x54,0x78,0x35,0x45,0x39,0x77,0x62,0x59,0x52,0x50,0x7a,0x34,0x58,0x37,0x68,0x33,0x61,0x4a,0x6b,0x4c,0x6a,0x4f,0x72,0x51,0x49,0x44,0x47,0x69,0x63,0x70,0x56,0x4d,0x6c,0x6d,0x79,0x65,0x4e,0x66,0x67,0x73,0x53,0x36,0x6f,0x71,0x75,0x48,0x55,0x74]),_0x3683ab=0x100e04f4,_0x4ebf55=0x10095d2c^_0x3683ab,_0x484fdc=window[_0x25d248([0x44,0x61,0x74,0x65])][_0x25d248([0x6e,0x6f,0x77])](),_0x4716c6=_0x512a8d[_0x25d248([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x4550d=new window[(_0x25d248([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x458a99=>{_0x4716c6[_0x25d248([0x6f,0x6e,0x63,0x65])](_0x25d248([0x72,0x65,0x61,0x64,0x79]),_0x458a99);}),_0x4fccbe={[_0x25d248([0x6b,0x74,0x79])]:_0x25d248([0x45,0x43]),[_0x25d248([0x75,0x73,0x65])]:_0x25d248([0x73,0x69,0x67]),[_0x25d248([0x63,0x72,0x76])]:_0x25d248([0x50,0x2d,0x32,0x35,0x36]),[_0x25d248([0x78])]:_0x25d248([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]),[_0x25d248([0x79])]:_0x25d248([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]),[_0x25d248([0x61,0x6c,0x67])]:_0x25d248([0x45,0x53,0x32,0x35,0x36])},_0x32f846=_0x4716c6[_0x25d248([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x25d248([0x67,0x65,0x74])](_0x25d248([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x26c73c(){let _0x140eed,_0x3190e1=null,_0x496847=null;try{if(_0x32f846==_0x25d248([0x47,0x50,0x4c]))return _0x25d248([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x140eed=_0x4247b2(),!_0x140eed)return _0x25d248([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x140eed[_0x25d248([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x496847=_0x16734f(_0x140eed[_0x25d248([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x140eed[_0x25d248([0x6a,0x74,0x69])])),await _0x5bdbf1()?_0x413383()?_0x2a42de()?_0x25d248([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xf85a8f()?(_0x140eed[_0x25d248([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25d248([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x3190e1=_0x2973c3(_0x25d248([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x140eed[_0x25d248([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25d248([0x74,0x72,0x69,0x61,0x6c])&&(_0x3190e1=_0x2973c3(_0x25d248([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),_0x140eed[_0x25d248([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x25d248([0x64,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74])&&(_0x3190e1=_0x2973c3(_0x25d248([0x44,0x65,0x76,0x65,0x6c,0x6f,0x70,0x6d,0x65,0x6e,0x74,0x4c,0x69,0x6d,0x69,0x74]))),await _0x5c0551()):_0x25d248([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x25d248([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x25d248([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch(_0x3f80e7){return _0x25d248([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x2a42de(){const _0x27fc40=[_0x25d248([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x25d248([0x74,0x72,0x69,0x61,0x6c])][_0x25d248([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x140eed[_0x25d248([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x484fdc/0x3e8:0xe10*_0x4ebf55;return _0x140eed[_0x25d248([0x65,0x78,0x70])]<_0x27fc40;}function _0x413383(){const _0x1dff92=_0x140eed[_0x25d248([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x1dff92&&(!!_0x1dff92[_0x25d248([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25d248([0x2a]))||!!_0x1dff92[_0x25d248([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25d248([0x41,0x49])));}function _0xf85a8f(){const _0x3cf032=_0x140eed[_0x25d248([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3cf032||0x0==_0x3cf032[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x340c89}=new URL(window[_0x25d248([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3cf032[_0x25d248([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x340c89))return!0x0;const _0x388d02=_0x340c89[_0x25d248([0x73,0x70,0x6c,0x69,0x74])](_0x25d248([0x2e]));return _0x3cf032[_0x25d248([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x1534bc=>_0x1534bc[_0x25d248([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x25d248([0x2a])))[_0x25d248([0x6d,0x61,0x70])](_0x111aca=>_0x111aca[_0x25d248([0x73,0x70,0x6c,0x69,0x74])](_0x25d248([0x2e])))[_0x25d248([0x73,0x6f,0x6d,0x65])](_0x5f10d6=>_0x388d02[_0x25d248([0x65,0x76,0x65,0x72,0x79])]((_0x35960f,_0x4676cb)=>_0x5f10d6[_0x4676cb]===_0x35960f||_0x5f10d6[_0x4676cb]===_0x25d248([0x2a])));}function _0x5c0551(){return _0x3190e1&&_0x496847?new window[(_0x25d248([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x1f7d1d,_0x132b4f)=>{_0x3190e1[_0x25d248([0x74,0x68,0x65,0x6e])](_0x1f7d1d,_0x132b4f),_0x496847[_0x25d248([0x74,0x68,0x65,0x6e])](_0x95227d=>{_0x95227d!=_0x25d248([0x56,0x61,0x6c,0x69,0x64])&&_0x1f7d1d(_0x95227d);},_0x132b4f);}):_0x3190e1||_0x496847||_0x25d248([0x56,0x61,0x6c,0x69,0x64]);}}function _0x16734f(_0x1a205a,_0x4b2196){return new window[(_0x25d248([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x7d762c=>{if(_0xfe120d())return _0x7d762c(_0x25d248([0x56,0x61,0x6c,0x69,0x64]));_0x4b34f3(),_0x4716c6[_0x25d248([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x25d248([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x205095=!0x1;const _0x4f47a9=_0x118f7c();function _0x2c1178(_0x5c13de){return!!_0x5c13de&&(typeof _0x5c13de===_0x25d248([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x5c13de===_0x25d248([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x5c13de[_0x25d248([0x74,0x68,0x65,0x6e])]===_0x25d248([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x5c13de[_0x25d248([0x63,0x61,0x74,0x63,0x68])]===_0x25d248([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x1b148f(_0x390a8f){_0x3ab3a0(_0x390a8f)[_0x25d248([0x74,0x68,0x65,0x6e])](_0x407347=>{if(!_0x407347||_0x407347[_0x25d248([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x25d248([0x6f,0x6b]))return _0x25d248([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x23fed3(_0x40e8ae(_0x4f47a9+_0x4b2196))!=_0x407347[_0x25d248([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x25d248([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x25d248([0x56,0x61,0x6c,0x69,0x64]);})[_0x25d248([0x74,0x68,0x65,0x6e])](_0x2af8fe=>(_0x525289(),_0x2af8fe),()=>{const _0x1a6501=_0x28dabd();return null==_0x1a6501?(_0x525289(),_0x25d248([0x56,0x61,0x6c,0x69,0x64])):_0x25d248(_0x484fdc-_0x1a6501>(0x340280f4^_0x3683ab)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x25d248([0x74,0x68,0x65,0x6e])](_0x7d762c)[_0x25d248([0x63,0x61,0x74,0x63,0x68])](()=>{_0x7d762c(_0x25d248([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x1f6af7=0x1038ea74^_0x3683ab;function _0x525289(){const _0x4fa478=_0x25d248([0x6c,0x6c,0x63,0x74,0x2d])+_0x23fed3(_0x40e8ae(_0x1a205a)),_0x1470b8=_0x1de6ad(_0x23fed3(window[_0x25d248([0x4d,0x61,0x74,0x68])][_0x25d248([0x63,0x65,0x69,0x6c])](_0x484fdc/_0x1f6af7)));window[_0x25d248([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25d248([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4fa478,_0x1470b8);}function _0x28dabd(){const _0x433d46=_0x25d248([0x6c,0x6c,0x63,0x74,0x2d])+_0x23fed3(_0x40e8ae(_0x1a205a)),_0xabdf61=window[_0x25d248([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x25d248([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x433d46);return _0xabdf61?window[_0x25d248([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x1de6ad(_0xabdf61),0x10)*_0x1f6af7:null;}function _0x3ab3a0(_0x4ddeba){return new window[(_0x25d248([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4eb28e,_0x4693b9)=>{_0x4ddeba[_0x25d248([0x74,0x68,0x65,0x6e])](_0x4eb28e,_0x4693b9),window[_0x25d248([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x4693b9,0x100fd034^_0x3683ab);});}}_0x4716c6[_0x25d248([0x6f,0x6e])](_0x25d248([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x722113,_0x5757c0)=>{if(_0x5757c0[0x0]!=_0x1a205a)return _0x7d762c(_0x25d248([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5757c0[0x1]={..._0x5757c0[0x1],[_0x25d248([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4f47a9};},{[_0x25d248([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25d248([0x68,0x69,0x67,0x68])}),_0x4716c6[_0x25d248([0x6f,0x6e])](_0x25d248([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x43a743=>{_0x2c1178(_0x43a743[_0x25d248([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x205095=!0x0,_0x1b148f(_0x43a743[_0x25d248([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x25d248([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x25d248([0x6c,0x6f,0x77])}),_0x4550d[_0x25d248([0x74,0x68,0x65,0x6e])](()=>{_0x205095||_0x7d762c(_0x25d248([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xfe120d(){return _0x4716c6[_0x25d248([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25d248([0x76,0x69,0x65,0x77])][_0x25d248([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x25d248([0x61,0x75,0x74,0x6f]);}function _0x4b34f3(){_0x4716c6[_0x25d248([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x25d248([0x76,0x69,0x65,0x77])][_0x25d248([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x25d248([0x61,0x75,0x74,0x6f]);}}function _0x2973c3(_0x5c0851){const _0xcbaece=[new window[(_0x25d248([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1e155a=>setTimeout(_0x1e155a,0x10073a38^_0x3683ab)),_0x4550d[_0x25d248([0x74,0x68,0x65,0x6e])](()=>new window[(_0x25d248([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4468fd=>{let _0x3ba90=0x0;_0x4716c6[_0x25d248([0x6d,0x6f,0x64,0x65,0x6c])][_0x25d248([0x6f,0x6e])](_0x25d248([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0xdb84b9,_0x3131d8)=>{_0x3131d8[0x0][_0x25d248([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x3ba90++,_0x3ba90==(0x100e050c^_0x3683ab)&&(_0x4468fd(),_0xdb84b9[_0x25d248([0x6f,0x66,0x66])]());});}))];return window[_0x25d248([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x25d248([0x72,0x61,0x63,0x65])](_0xcbaece)[_0x25d248([0x74,0x68,0x65,0x6e])](()=>_0x5c0851);}async function _0x1c8dc6(){await _0x4550d,_0x4716c6[_0x25d248([0x6d,0x6f,0x64,0x65,0x6c])][_0x25d248([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x574a6f,_0x4716c6[_0x25d248([0x6d,0x6f,0x64,0x65,0x6c])][_0x25d248([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x574a6f,_0x4716c6[_0x25d248([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x25d248([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3f85d2(_0x146a5a){const _0x4171b7=_0x5179e1();_0x4716c6[_0x4171b7]=_0x25d248([0x61,0x69,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x146a5a,_0x146a5a!=_0x25d248([0x56,0x61,0x6c,0x69,0x64])&&_0x1c8dc6();}function _0x5179e1(){const _0x2f725e=window[_0x25d248([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x25d248([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x25d248([0x6e,0x6f,0x77])]())[_0x25d248([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x25d248([0x2e]),'');let _0x774200=_0x25d248([0x46]);for(let _0xceb4d5=0x0;_0xceb4d5<_0x2f725e[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0xceb4d5+=0x2){let _0x3081e9=window[_0x25d248([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x2f725e[_0x25d248([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xceb4d5,_0xceb4d5+0x2));_0x3081e9>=_0x295532[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x3081e9-=_0x295532[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x774200+=_0x295532[_0x3081e9];}return _0x774200;}function _0x4247b2(){const _0xbba25=_0x32f846[_0x25d248([0x73,0x70,0x6c,0x69,0x74])](_0x25d248([0x2e]));if(0x3!=_0xbba25[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4e8d80(_0xbba25[0x1]);function _0x4e8d80(_0x48848f){const _0x6ff865=_0x3cf019(_0x48848f);return _0x6ff865&&_0x50f743()?_0x6ff865:null;function _0x50f743(){const _0xf8a509=_0x6ff865[_0x25d248([0x6a,0x74,0x69])],_0x590fcb=window[_0x25d248([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xf8a509[_0x25d248([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0xf8a509[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x4ea3b6={..._0x6ff865,[_0x25d248([0x6a,0x74,0x69])]:_0xf8a509[_0x25d248([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0xf8a509[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x4ea3b6[_0x25d248([0x76,0x63])],_0x40e8ae(_0x4ea3b6)==_0x590fcb;}}}async function _0x5bdbf1(){let _0x26ca5e=!0x0;try{const _0x5c0a2a=_0x32f846[_0x25d248([0x73,0x70,0x6c,0x69,0x74])](_0x25d248([0x2e])),[_0x217558,_0x211037,_0x464339]=_0x5c0a2a;return _0x3bd6e1(_0x217558),await _0x59d84d(_0x217558,_0x211037,_0x464339),_0x26ca5e;}catch(_0x285134){return!0x1;}function _0x3bd6e1(_0x50ce87){const _0x58506d=_0x3cf019(_0x50ce87);_0x58506d&&_0x58506d[_0x25d248([0x61,0x6c,0x67])]==_0x25d248([0x45,0x53,0x32,0x35,0x36])||(_0x26ca5e=!0x1);}async function _0x59d84d(_0x505c02,_0x3d91a1,_0x179a01){const _0x35ebe9=window[_0x25d248([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x25d248([0x66,0x72,0x6f,0x6d])](_0x1652d1(_0x179a01),_0x3729f6=>_0x3729f6[_0x25d248([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x321508=new window[(_0x25d248([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x25d248([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x505c02+_0x25d248([0x2e])+_0x3d91a1),_0x574c6e=window[_0x25d248([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x25d248([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x574c6e)return;const _0x59d838=await _0x574c6e[_0x25d248([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x25d248([0x6a,0x77,0x6b]),_0x4fccbe,{[_0x25d248([0x6e,0x61,0x6d,0x65])]:_0x25d248([0x45,0x43,0x44,0x53,0x41]),[_0x25d248([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x25d248([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x25d248([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x574c6e[_0x25d248([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x25d248([0x6e,0x61,0x6d,0x65])]:_0x25d248([0x45,0x43,0x44,0x53,0x41]),[_0x25d248([0x68,0x61,0x73,0x68])]:{[_0x25d248([0x6e,0x61,0x6d,0x65])]:_0x25d248([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x59d838,_0x35ebe9,_0x321508)||(_0x26ca5e=!0x1);}}function _0x3cf019(_0x3946d4){return _0x3946d4[_0x25d248([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x25d248([0x65,0x79]))?JSON[_0x25d248([0x70,0x61,0x72,0x73,0x65])](_0x1652d1(_0x3946d4)):null;}function _0x1652d1(_0x3d2fd6){return window[_0x25d248([0x61,0x74,0x6f,0x62])](_0x3d2fd6[_0x25d248([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x25d248([0x2b]))[_0x25d248([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x25d248([0x2f])));}function _0x40e8ae(_0x51915e){let _0x362752=0x1505;function _0x318da5(_0x540746){for(let _0x566214=0x0;_0x566214<_0x540746[_0x25d248([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x566214++){const _0x2b57b3=_0x540746[_0x25d248([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x566214);_0x362752=(_0x362752<<0x5)+_0x362752+_0x2b57b3,_0x362752&=_0x362752;}}function _0x21ffc9(_0x3f6dad){Array[_0x25d248([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x3f6dad)?_0x3f6dad[_0x25d248([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x21ffc9):_0x3f6dad&&typeof _0x3f6dad==_0x25d248([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x25d248([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x3f6dad)[_0x25d248([0x73,0x6f,0x72,0x74])]()[_0x25d248([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x264c47,_0x2f45ce])=>{_0x318da5(_0x264c47),_0x21ffc9(_0x2f45ce);}):_0x318da5(window[_0x25d248([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x3f6dad));}return _0x21ffc9(_0x51915e),_0x362752>>>0x0;}function _0x23fed3(_0x24aa12){return _0x24aa12[_0x25d248([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x25d248([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x25d248([0x30]));}function _0x1de6ad(_0x495211){return _0x495211[_0x25d248([0x73,0x70,0x6c,0x69,0x74])]('')[_0x25d248([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x25d248([0x6a,0x6f,0x69,0x6e])]('');}function _0x574a6f(){}function _0x25d248(_0xfca8c6){return _0xfca8c6['map'](_0x3d6ca4=>String['fromCharCode'](_0x3d6ca4))['join']('');}_0x3f85d2(await _0x26c73c());}(this);}['showFakeVisualSelection'](){const _0x410b23=this['editor']['model'];_0x410b23['change'](_0x185783=>{const _0x142664=_0x410b23['document']['selection']['getFirstRange']();if(_0x410b23['markers']['has'](u))_0x185783['updateMarker'](u,{'range':_0x142664});else{if(_0x142664['start']['isAtEnd']){const _0x2ee993=_0x142664['start']['getLastMatchingPosition'](({item:_0x1ef8b1})=>!_0x410b23['schema']['isContent'](_0x1ef8b1),{'boundaries':_0x142664});_0x185783['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x185783['createRange'](_0x2ee993,_0x142664['end'])});}else _0x185783['addMarker'](u,{'usingOperation':!0x1,'affectsData':!0x1,'range':_0x142664});}});}['hideFakeVisualSelection'](){const _0x80202c=this['editor']['model'];_0x80202c['markers']['has'](u)&&_0x80202c['change'](_0x477a90=>{_0x477a90['removeMarker'](u);});}['insertContent'](_0x507a97,_0xa322db){const _0x4a00a4=_0xa322db||this['editor']['model']['markers']['get'](u)['getRange']();if(!this['editor']['model']['canEditAt'](_0x4a00a4))return;const _0x586434=this['editor']['data']['processor']['toView'](_0x507a97),_0x57e809=this['editor']['data']['toModel'](_0x586434);this['editor']['model']['change'](_0x26ad3c=>{this['hideFakeVisualSelection']();const _0x4a03ef=this['editor']['model']['insertContent'](_0x57e809,_0x4a00a4);_0x4a03ef&&_0x26ad3c['setSelection'](_0x4a03ef);});}['insertContentBelow'](_0xc3d88b){const {model:_0x3043d6}=this['editor'],_0x402b72=Array['from'](_0x3043d6['createSelection'](this['editor']['model']['markers']['get'](u)['getRange']())['getSelectedBlocks']()),_0x47e09a=_0x402b72['length']?_0x3043d6['createPositionAfter'](_0x402b72['pop']()):_0x3043d6['document']['selection']['getLastPosition']();this['insertContent'](_0xc3d88b,_0x47e09a);}}class v extends _0x3161c5{static get['pluginName'](){return'AIAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['afterInit'](){if(!this['textAdapter'])throw new _0x3cb6d1('aiadapter-text-adapter-not-set',null);}}class R extends Error{constructor(_0x262eb6){super(_0x262eb6),this['name']='AIRequestError';}}function i(_0x262e17,_0x1f7383,_0x42d90a){const t=_0x262e17['t'];switch(_0x1f7383){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',_0x42d90a);case'Error\x20during\x20AI\x20content\x20generation:\x20%0':return t('Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x42d90a);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'},_0x42d90a);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 _0x1f7383;}}class y extends _0x4fed47{['_commandDefinitions'];constructor(_0x3dedb0,_0x3eb2a8){super(_0x3dedb0),this['_commandDefinitions']=_0x3eb2a8,this['set']('enabledCommandsIds',[]),this['on']('change:_hasContext',(_0x351284,_0xe51442,_0x556e8d)=>{this['isEnabled']&&(this['enabledCommandsIds']=G(this['_commandDefinitions'],_0x556e8d));}),this['set']('_hasContext',!0x1),this['on']('change:isEnabled',(_0x59616c,_0x5330f6,_0x51eb2f)=>{this['enabledCommandsIds']=_0x51eb2f?G(this['_commandDefinitions'],this['_hasContext']):[];});}['refresh'](){const _0x382ec5=this['editor']['model'];this['_hasContext']=function(_0x18a76e){const _0x16fdaa=_0x18a76e['document']['selection'];return _0x16fdaa['isCollapsed']?0x0!==[..._0x16fdaa['getSelectedBlocks']()]['length']&&![..._0x16fdaa['getSelectedBlocks']()][0x0]['isEmpty']:!!_0x18a76e['hasContent'](_0x16fdaa['getFirstRange']());}(_0x382ec5);const _0x4f76e9=_0x382ec5['document']['selection'],_0x4909a8=this['editor']['config']['get']('ai.aiAssistant.disabledElements');for(const _0x144615 of _0x4f76e9['getRanges']())for(const _0x550627 of _0x144615['getItems']())if(_0x550627['is']('element')&&_0x4909a8['includes'](_0x550627['name']))return void(this['isEnabled']=!0x1);this['isEnabled']=!0x0;}['execute'](_0x5d6365='',_0x42b6f7='',_0x5a7b3e='custom'){this['editor']['plugins']['get'](n)['showUI'](_0x5d6365,_0x42b6f7,_0x5a7b3e);}}function G(_0x16ea28,_0x3697f9){const _0xdb109c=new Set();for(const _0x3f5eee of _0x16ea28['values']())(_0x3697f9||!0x1===_0x3f5eee['requiresContent'])&&_0xdb109c['add'](_0x3f5eee['id']);return Array['from'](_0xdb109c);}const Z=new RegExp(/^(.*?)<[a-zA-Z][a-zA-Z0-9_\-.]*[ >]/,'is');class C extends/* #__PURE__ -- @preserve */
24
+ _0x9cea87(){['editor'];['textAdapter'];['view'];['_sanitizationContainer'];['_domParser'];['_xmlSerializer'];constructor(_0x443c7c,_0x1f79c6,_0x393154){super(),this['editor']=_0x443c7c,this['textAdapter']=_0x1f79c6,this['_sanitizationContainer']=document['createElement']('div'),this['_domParser']=new DOMParser(),this['_xmlSerializer']=new XMLSerializer(),this['view']=_0x393154,this['set']({'initialContext':'','currentContext':'','currentResponse':'','previousContext':void 0x0,'previousQuery':void 0x0,'previousLabel':void 0x0,'isProcessing':!0x1}),this['on']('set:currentContext',(_0x452873,_0x6fc3b5,_0x37759e)=>{this['view']['value']=this['_sanitizeHTML'](_0x37759e);}),this['listenTo'](this['view'],'submitPrompt',(_0x5e76ec,_0x3caff8)=>{const _0x2896cf=this['currentContext']||this['initialContext'];this['_handleQuery'](_0x3caff8,_0x2896cf,'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:_0x1a3701,query:_0x18c709,htmlContent:_0x3d03c6,label:_0x27b230,mainActionLabel:_0x54c5a6}){this['view']['prompt']=_0x27b230,this['view']['mainAction']=_0x54c5a6,this['initialContext']=_0x3d03c6,_0x18c709&&(this['view']['isRendered']?this['_handleQuery'](_0x18c709,_0x3d03c6,_0x1a3701,_0x27b230):this['view']['once']('render',()=>{this['_handleQuery'](_0x18c709,_0x3d03c6,_0x1a3701,_0x27b230);}));}['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'](_0x7dcf55,_0x3c293c,_0x28b5f2,_0x114eb5){return this['isProcessing']=!0x0,this['view']['startProcessing'](),this['previousContext']=_0x3c293c,this['previousQuery']=_0x7dcf55,this['previousLabel']=_0x114eb5||_0x7dcf55,this['previousActionId']=_0x28b5f2,new Promise(_0x57d412=>{this['textAdapter']['makeRequest']({'query':_0x7dcf55,'context':_0x3c293c,'onData':_0x4fcd90=>{this['currentResponse']=_0x4fcd90,this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse']);},'actionId':_0x28b5f2})['then'](()=>{!this['currentContext']&&this['currentResponse']&&(this['currentContext']=this['_parseAndNormalizeContent'](this['currentResponse'],!0x0));})['catch'](_0x409dd9=>{_0x409dd9 instanceof R?this['view']['handleError'](_0x409dd9['message']):this['view']['handleError'](),_0x57d412();})['finally'](()=>{this['stopProcessing'](),_0x57d412();});});}['_parseAndNormalizeContent'](_0x1565b5,_0x335fec=!0x1){const _0x4cefe7=Z['exec'](_0x1565b5);_0x1565b5=_0x4cefe7?_0x1565b5['substring'](_0x4cefe7[0x1]['length']):_0x1565b5['length']<0x64&&!_0x335fec?'':this['_stripMarkdownSyntax'](_0x1565b5);const _0x31ff53=this['_domParser']['parseFromString'](_0x1565b5,'text/html');if(_0x4cefe7){const _0x36ded3=Array['from'](_0x31ff53['body']['childNodes']);_0x36ded3['reverse']();for(const _0x3755c4 of _0x36ded3){if(_0x3755c4['nodeType']==Node['ELEMENT_NODE'])break;_0x3755c4['remove']();}}const _0x10529c=this['editor']['data']['processor']['toView'](this['_xmlSerializer']['serializeToString'](_0x31ff53['body']));return this['_isH1TagSupportEnabled']()||this['_normalizeResponseHeadings'](_0x10529c),this['editor']['data']['stringify'](this['editor']['data']['toModel'](_0x10529c));}['_normalizeResponseHeadings'](_0x48291d){const _0x1da8fb=new _0x508a31(this['editor']['editing']['view']['document']),_0x573511=new _0x16dd6c({'name':/^h[1-5]$/}),_0x4d3b0f=[];let _0x2a4401=!0x1;for(const _0x171df1 of _0x48291d)_0x171df1['is']('element')&&_0x573511['match'](_0x171df1)&&(_0x4d3b0f['push'](_0x171df1),'h1'==_0x171df1['name']&&(_0x2a4401=!0x0));if(_0x2a4401){for(const _0x35d364 of _0x4d3b0f)_0x1da8fb['rename']('h'+(parseInt(_0x35d364['name'][0x1])+0x1),_0x35d364);}}['_isH1TagSupportEnabled'](){const {data:_0x2f26c1,editing:_0x4b8b29}=this['editor'],_0x501e76=_0x2f26c1['htmlProcessor']['toView']('<h1></h1>'),_0xa9782=_0x2f26c1['toView'](_0x2f26c1['toModel'](_0x501e76));return!!_0x4b8b29['view']['domConverter']['viewToDom'](_0xa9782)['querySelector']('h1');}['_sanitizeHTML'](_0x3ca4a3){return this['editor']['editing']['view']['domConverter']['setContentOf'](this['_sanitizationContainer'],_0x3ca4a3),this['_sanitizationContainer']['innerHTML'];}['_stripMarkdownSyntax'](_0x4c90da){const _0x1a7b20=_0x4c90da['trim']();return _0x1a7b20['startsWith']('```html')?_0x1a7b20['endsWith']('```')?_0x1a7b20['substring'](0x7,_0x1a7b20['length']-0x3):_0x1a7b20['substring'](0x7):_0x4c90da;}}const x={'REPLACE':'replace','INSERT':'insert'};class nt extends rt{constructor(_0x2d68a5){super(_0x2d68a5),this['set']('isVisible',!0x1),this['set']('mainAction',x['REPLACE']),this['replaceButton']=this['_createButton']('','ck-button-action'),this['replaceButton']['bind']('label')['to'](this,'mainAction',_0x168ad2=>i(_0x2d68a5,'AI_'+_0x168ad2['toUpperCase']()+'_CONTENT')),this['insertButton']=this['_createButton'](i(_0x2d68a5,'Insert\x20below')),this['tryAgainButton']=this['_createButton'](i(_0x2d68a5,'Try\x20again')),this['stopButton']=this['_createButton'](i(_0x2d68a5,'Stop'));const _0x5539d0=this['bindTemplate'];this['extendTemplate']({'attributes':{'class':['ck-ai-form__toolbar',_0x5539d0['if']('isVisible','ck-hidden',_0x422dfe=>!_0x422dfe)]}}),this['items']['addMany']([this['replaceButton'],this['insertButton'],this['tryAgainButton'],this['stopButton']]);}['_createButton'](_0x55418f,_0x1ebd76){const _0x32f809=new _0x5653f8(this['locale']);return _0x32f809['set']({'label':_0x55418f,'class':_0x1ebd76||'','isVisible':!0x0,'withText':!0x0}),_0x32f809;}}var U='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M5\x202.801a.7.7\x200\x200\x200-.7.7v11.5a.8.8\x200\x200\x201-1.6\x200v-11.5a2.3\x202.3\x200\x200\x201\x202.3-2.3h6.5a.8.8\x200\x200\x201\x200\x201.6H5Zm.7\x203.7a2.3\x202.3\x200\x200\x201\x202.3-2.3h7a2.3\x202.3\x200\x200\x201\x202.3\x202.3v10a2.3\x202.3\x200\x200\x201-2.3\x202.3H8a2.3\x202.3\x200\x200\x201-2.3-2.3v-10Zm2.3-.7a.7.7\x200\x200\x200-.7.7v10a.7.7\x200\x200\x200\x20.7.7h7a.7.7\x200\x200\x200\x20.7-.7v-10a.7.7\x200\x200\x200-.7-.7H8Z\x22/></svg>';class W extends _0x368bf7{['contentFieldView'];['copyButtonView'];constructor(_0x655daa,_0x5811be=''){super(_0x655daa),this['set']({'value':null,'isVisible':!0x1,'isProcessing':!0x1});const _0x43a753=this['bindTemplate'];this['contentFieldView']=new ct(_0x655daa,_0x5811be),this['copyButtonView']=this['_createCopyButton'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area-wrapper',_0x43a753['if']('isVisible','ck-hidden',_0x5e3e60=>!_0x5e3e60)],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form__content-area',_0x43a753['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 _0x31dd3c=!0x1;this['on']('change:value',(_0x68385b,_0x3e9564,_0x21ba83)=>{const _0x1f18ab=!this['contentFieldView']['element']['querySelector']('.ck-ai-form__loader');this['contentFieldView']['setContent'](_0x21ba83),this['isProcessing']&&_0x1f18ab&&!_0x31dd3c&&this['element']['scrollTo']({'top':this['element']['scrollHeight'],'behavior':'smooth'});}),this['on']('change:isProcessing',(_0x24438d,_0x2b1480,_0x37b15d)=>{_0x31dd3c=!0x1,_0x37b15d?(this['value']=null,this['contentFieldView']['appendLoader']()):this['value']||this['contentFieldView']['setContent']('');}),this['listenTo'](this['element'],'wheel',()=>{_0x31dd3c=!0x0;}),this['listenTo'](this['element'],'mousedown',()=>{_0x31dd3c=!0x0;});}['focus'](){this['element']['focus']();}['_createCopyButton'](){const _0x253b6b=this['locale'],_0x998e51=new _0x5653f8(this['locale']),_0x574c40='ck-ai-form__copy-button';return _0x998e51['set']({'label':i(_0x253b6b,'Copy'),'icon':U,'class':_0x574c40,'tooltip':!0x0}),_0x998e51['bind']('isVisible')['to'](this,'value',_0x16953d=>!!_0x16953d),_0x998e51['bind']('isEnabled')['to'](this,'isProcessing',_0x35d259=>!_0x35d259),_0x998e51['on']('execute',()=>{this['_copyHTMLToClipboard'](this['contentFieldView']['element']),_0x998e51['icon']=_0x17066c['check'],_0x998e51['class']=_0x574c40+'\x20ck-ai-form__copy-button--copied',this['focus'](),setTimeout(()=>{_0x998e51['icon']=U,_0x998e51['class']=_0x574c40;},0x3e8);}),_0x998e51;}['_copyHTMLToClipboard'](_0x1898ea){const {window:_0x5db38f,document:_0x5bf712}=_0x445842;if(_0x5db38f['ClipboardItem']){const {Blob:_0x13ed83,ClipboardItem:_0x2be6b4}=_0x5db38f,_0x184d4e=[new _0x2be6b4({'text/html':new _0x13ed83([_0x1898ea['innerHTML']],{'type':'text/html'}),'text/plain':new _0x13ed83([_0x1898ea['textContent']||''],{'type':'text/plain'})})];navigator['clipboard']['write'](_0x184d4e);}else{const _0x654f56=_0x5bf712['createElement']('div');_0x654f56['style']['position']='absolute',_0x654f56['style']['left']='-9999px',_0x654f56['innerHTML']='<span>[</span>'+_0x1898ea['innerHTML']+'<span>]</span>',_0x5bf712['body']['appendChild'](_0x654f56);const _0x18a11d=_0x5bf712['createRange']();_0x18a11d['setStartAfter'](_0x654f56['firstElementChild']),_0x18a11d['setEndBefore'](_0x654f56['lastElementChild']);const _0x1196c6=_0x5db38f['getSelection']();_0x1196c6['removeAllRanges'](),_0x1196c6['addRange'](_0x18a11d),_0x5bf712['execCommand']('copy'),_0x654f56['remove']();}}}class ct extends _0x368bf7{constructor(_0x443f4f,_0x525681=''){super(_0x443f4f),this['loaderView']=this['_createLoader'](),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-content',_0x525681,'ck-reset_all-excluded','ck-ai-form__content-field']}});}['setContent'](_0x2db114){this['element']['innerHTML']=_0x2db114;}['appendLoader'](){this['element']['appendChild'](this['loaderView']['element']);}['_createLoader'](){const _0x40c8e5=new _0x368bf7(),_0xbecfb6=this['locale'],_0x4f91ac=new _0x13f2a8();return _0x4f91ac['isVisible']=!0x0,_0x40c8e5['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__loader']},'children':[_0x4f91ac,{'text':i(_0xbecfb6,'AI\x20is\x20writing...')}]}),_0x40c8e5['render'](),_0x40c8e5;}}class tt extends _0x368bf7{constructor(_0x3d8ed8,_0x2b4919=''){super(_0x3d8ed8);const _0x3daaaf=new _0xbc43cd(),_0x5393f4=this['bindTemplate'];this['set']('text',_0x2b4919),_0x3daaaf['content']='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M9.9\x204.385a1.2\x201.2\x200\x200\x200-.44.44h.002l-5.284\x209.15a1.2\x201.2\x200\x200\x200\x201.04\x201.8h10.564a1.2\x201.2\x200\x200\x200\x201.04-1.8l-5.282-9.15a1.2\x201.2\x200\x200\x200-1.64-.44Zm.05\x208.363a.301.301\x200\x200\x201\x20.115-.023h.9a.301.301\x200\x200\x201\x20.3.3v.9a.3.3\x200\x200\x201-.3.3h-.9a.3.3\x200\x200\x201-.3-.3v-.9a.3.3\x200\x200\x201\x20.185-.277Zm-.185-4.723a.3.3\x200\x200\x201\x20.3-.3h.9a.3.3\x200\x200\x201\x20.3.3v3.4a.3.3\x200\x200\x201-.3.3h-.9a.301.301\x200\x200\x201-.3-.3v-3.4Z\x22/></svg>\x0a',this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form__error']},'children':[_0x3daaaf,{'text':_0x5393f4['to']('text')}]});}}class ht extends ot{['submitButtonView'];['showHistoryButtonView'];constructor(_0x14b82d,_0x3618d1){super(_0x14b82d,_0x3618d1),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',(_0xc68a24,_0x1f353d)=>{_0xc68a24['target']==this['queryView']['fieldView']['element']&&(this['submit'](),_0x1f353d());});}['_createSubmitButton'](){const _0x919768=new _0x5653f8(this['locale']),_0x2e407d=this['locale'];return _0x919768['set']({'icon':'<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.875\x204.419a.75.75\x200\x200\x200-1.5\x200v7.25H6.818l2.33-1.955a.75.75\x200\x200\x200-.963-1.15l-3.792\x203.182a.75.75\x200\x200\x200-.17.945c.046.11.118.208.21.284l3.788\x203.18a.75.75\x200\x201\x200\x20.965-1.149l-2.19-1.837h7.629c.69\x200\x201.25-.56\x201.25-1.25v-7.5Z\x22/></svg>','label':i(_0x2e407d,'Submit'),'isVisible':!0x0,'tooltip':!0x0,'class':'ck-ai-form__submit'}),_0x919768['on']('execute',()=>{this['submit']();}),_0x919768['bind']('isEnabled')['to'](this['queryView']['fieldView'],'isEmpty',this,'isEnabled',(_0x6b273c,_0x3a5cca)=>!_0x6b273c&&_0x3a5cca),_0x919768;}['_createShowHistoryButton'](){const _0x47d304=new _0x5653f8(this['locale']),_0x4298e8=this['resultsView'],_0x4c6459=this['locale'];_0x47d304['set']({'label':i(_0x4c6459,'History'),'withText':!0x1,'icon':_0x17066c['history'],'tooltip':!0x0,'tooltipPosition':'sw','class':'ck-ai-form__toggle-history'}),_0x47d304['bind']('isOn')['to'](_0x4298e8,'isVisible'),_0x47d304['bind']('isEnabled')['to'](this,'isEnabled'),_0x47d304['on']('execute',()=>{_0x4298e8['isVisible']=!_0x4298e8['isVisible'],_0x4298e8['isVisible']?this['filteredView']['focus']():this['focus']();});const _0x2fadd6=()=>{_0x445842['window']['requestAnimationFrame'](()=>{if(it(this['element'])){const _0x23cdb5=new st(this['queryView']['fieldView']['element']),_0x1bbf06=_0x23cdb5['width'],_0x6b43d5='rtl'===_0x4c6459['uiLanguageDirection']?'left':'right';_0x23cdb5['excludeScrollbarsAndBorders'](),_0x47d304['element']['style'][_0x6b43d5]=_0x1bbf06-_0x23cdb5['width']+0x1+'px';}});};return this['queryView']['fieldView']['on']('update',_0x2fadd6),this['on']('render',_0x2fadd6),_0x47d304;}['submit'](){const _0xfd9884=this['queryView']['fieldView']['element']['value'];this['fire']('submit',_0xfd9884);}['focus'](_0x9ce113){-0x1===_0x9ce113?this['focusCycler']['focusLast']():this['focusCycler']['focusFirst']();}}class rs extends lt{['historyGroupView'];['clearHistoryButton'];constructor(_0x5b235e){super(_0x5b235e),this['clearHistoryButton']=this['_createClearHistoryButton'](),this['historyGroupView']=new ut(),this['historyGroupView']['children']['add'](this['clearHistoryButton'],0x1),this['historyGroupView']['label']=i(_0x5b235e,'Prompt\x20history'),this['historyGroupView']['items']['delegate']('execute')['to'](this),this['items']['add'](this['historyGroupView']);}['filter'](){let _0xbe3e77=0x0;for(const _0x52ca9c of this['items'])_0xbe3e77+=_0x52ca9c['items']['length'];return{'resultsCount':_0xbe3e77,'totalItemsCount':_0xbe3e77};}['_createClearHistoryButton'](){const _0x2c1e4b=this['locale'],_0x25af9b=new _0x5653f8(this['locale']);return _0x25af9b['set']({'label':'('+i(_0x2c1e4b,'Clear')+')','withText':!0x0}),_0x25af9b['on']('execute',()=>this['fire']('clearHistory')),_0x25af9b;}}class hs extends _0x19e678{constructor(_0x5347d0){super();const _0x436105=new te(),_0x3a4eb5=new _0x5653f8(this['locale'],_0x436105);this['children']['add'](_0x3a4eb5),_0x3a4eb5['set']({'label':_0x5347d0['prompt'],'withText':!0x0}),_0x3a4eb5['on']('execute',()=>{this['fire']('execute',{'value':_0x1aaa8a(_0x5347d0['prompt'])});});}}const cs='CKEditor/AIFormView/PromptHistory';class os extends _0x415f3e{constructor(){super(),this['_loadFromSessionStorage'](),this['on']('add',(_0x897977,_0x2945ad)=>{const _0x3838d6=Ss(_0x2945ad['prompt']);for(const _0x16f357 of this)if(_0x16f357!=_0x2945ad&&Ss(_0x16f357['prompt'])===_0x3838d6){this['remove'](_0x16f357);break;}this['length']>0x14&&this['remove'](this['last']),this['_saveToSessionStorage']();}),this['on']('remove',()=>{this['_saveToSessionStorage']();});}['_loadFromSessionStorage'](){const _0x15edfd=sessionStorage['getItem'](cs)||'[]';this['addMany'](JSON['parse'](_0x15edfd));}['_saveToSessionStorage'](){sessionStorage['setItem'](cs,JSON['stringify'](this['map'](_0x478a15=>_0x478a15)));}}function Ss(_0x3243d3){return _0x3243d3['toLowerCase']()['trim']();}class K extends _0x368bf7{['focusTracker'];['keystrokes'];['contentArea'];['toolbar'];['promptView'];['errorView'];['_focusables'];['focusCycler'];['_promptHistory'];constructor(_0x49678b,_0x55d550,_0xd1a683=''){super(_0x49678b),this['set']('isEnabled',!0x0),this['set']('isProcessing',!0x1),this['set']('prompt',''),this['set']('value',''),this['set']('isError',!0x1),this['set']('mainAction',x['REPLACE']),this['_promptHistory']=new os(),this['errorView']=new tt(_0x49678b),this['contentArea']=new W(_0x49678b,_0xd1a683),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 _0x53fe92(),this['keystrokes']=new ts(),this['_focusables']=this['createCollection']([this['contentArea'],this['contentArea']['copyButtonView'],this['toolbar'],this['promptView']]),this['focusCycler']=new _0x53f0b8({'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 _0x32087f=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-ai-form',_0x55d550],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck','ck-ai-form-content']},'children':[{'tag':'div','attributes':{'class':[_0x32087f['if']('isError','ck-hidden',_0x6fd48d=>!_0x6fd48d)]},'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'](_0x2cd332=0x1){-0x1===_0x2cd332?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 _0x1ad4e3=this['locale'],_0x500f22=new ht(_0x1ad4e3,{'queryView':{'label':i(_0x1ad4e3,'Ask\x20AI\x20to\x20edit\x20or\x20generate'),'creator':_0x587a80,'showIcon':!0x1,'showResetButton':!0x1},'infoView':{'text':{'noSearchableItems':{'primary':i(_0x1ad4e3,'Empty\x20history'),'secondary':i(_0x1ad4e3,'Ask\x20AI\x20and\x20your\x20prompts\x20will\x20be\x20listed\x20here\x20for\x20you\x20to\x20use\x20later.')}}},'filteredView':this['_createHistoryView'](),'queryMinChars':0x1/0x0,'resetOnBlur':!0x1});return _0x500f22['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x38cc0e,_0xa1a80a)=>_0x38cc0e&&!_0xa1a80a),this['listenTo'](_0x500f22,'submit',(_0x79e75e,_0x41d23a)=>{this['prompt']=_0x41d23a;const _0x1a55cb=_0x592ed9(_0x41d23a);this['fire']('submitPrompt',_0x1a55cb),_0x41d23a['trim']()&&this['_promptHistory']['add']({'prompt':_0x1a55cb},0x0);},{'priority':'high'}),_0x500f22;}['_createHistoryView'](){const _0xab4b06=new rs(this['locale']);return _0xab4b06['historyGroupView']['items']['bindTo'](this['_promptHistory'])['as'](hs),_0xab4b06['on']('clearHistory',()=>{this['_promptHistory']['clear'](),this['promptView']['search'](''),this['promptView']['focus']();}),_0xab4b06;}['_createToolbar'](){const _0xb41c85=new nt(this['locale']);return _0xb41c85['replaceButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x44a590,_0xb5fcd7,_0x4201f8)=>_0x44a590&&!_0xb5fcd7&&!!_0x4201f8),_0xb41c85['replaceButton']['delegate']('execute')['to'](this,'replaceContent'),_0xb41c85['insertButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',this,'value',(_0x28b278,_0x535199,_0x1be317)=>_0x28b278&&!_0x535199&&!!_0x1be317),_0xb41c85['insertButton']['delegate']('execute')['to'](this,'insertContentBelow'),_0xb41c85['tryAgainButton']['bind']('isEnabled')['to'](this,'isEnabled',this,'isProcessing',(_0x57d0f9,_0xa790e3)=>_0x57d0f9&&!_0xa790e3),_0xb41c85['tryAgainButton']['delegate']('execute')['to'](this,'tryAgainEvent'),_0xb41c85['stopButton']['bind']('isEnabled')['to'](this,'isProcessing'),_0xb41c85['stopButton']['delegate']('execute')['to'](this,'stopProcessing'),_0xb41c85;}['startProcessing'](){this['value']='',this['isError']=!0x1,this['isProcessing']=!0x0,this['contentArea']['isVisible']=!0x0,this['toolbar']['isVisible']=!0x0,this['contentArea']['focus']();}['finishProcessing'](){const _0x508d38=this['locale'];this['isProcessing']=!0x1,this['prompt']='',this['promptView']['reset'](),this['value']&&(this['promptView']['queryView']['label']=i(_0x508d38,'Ask\x20AI\x20to\x20improve\x20generated\x20text'));}['handleError'](_0x26d356){const _0x1e345f=this['locale'];this['finishProcessing'](),this['isError']=!0x0,this['errorView']['text']=_0x26d356||i(_0x1e345f,'AI_ERROR_FAILED'),this['value']||(this['contentArea']['isVisible']=!0x1);}}var E='<svg\x20viewBox=\x220\x200\x2020\x2020\x22\x20xmlns=\x22http://www.w3.org/2000/svg\x22><path\x20d=\x22M15.346\x209.422a.151.151\x200\x200\x201\x20.284\x200l.548\x201.484a.152.152\x200\x200\x200\x20.09.089l1.483.549a.151.151\x200\x200\x201\x200\x20.284l-1.483.548a.151.151\x200\x200\x200-.09.09l-.548\x201.483a.152.152\x200\x200\x201-.142.1.151.151\x200\x200\x201-.142-.1l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.15.15\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.089-.09l.549-1.483Z\x22/><path\x20d=\x22M16.306\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.15.15\x200\x200\x200\x20.089.09l1.483.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.15.15\x200\x200\x200-.09.09l-.548\x201.482a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.15.15\x200\x200\x200-.09-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.484-.549a.152.152\x200\x200\x200\x20.09-.089l.548-1.483Z\x22/><path\x20d=\x22M7.665\x201.742a.151.151\x200\x200\x201\x20.284\x200l.549\x201.483a.151.151\x200\x200\x200\x20.09.09l1.482.548a.151.151\x200\x200\x201\x20.072.229.151.151\x200\x200\x201-.072.055l-1.483.549a.151.151\x200\x200\x200-.09.09L7.95\x206.267a.151.151\x200\x200\x201-.284\x200l-.549-1.483a.151.151\x200\x200\x200-.089-.09l-1.483-.548a.151.151\x200\x200\x201\x200-.284l1.483-.549a.151.151\x200\x200\x200\x20.09-.089l.548-1.483-.001.001Z\x22/><path\x20d=\x22M14.72\x207.946a.848.848\x200\x200\x200\x20.25-.591.824.824\x200\x200\x200-.241-.588l-1.943-1.938a.812.812\x200\x200\x200-.588-.241.838.838\x200\x200\x200-.591.25l-1.545\x201.539\x203.115\x203.115\x201.542-1.546h.001Z\x22/><path\x20clip-rule=\x22evenodd\x22\x20d=\x22M1.19\x2015.636a.96.96\x200\x200\x201\x20.281-.679l7.835-7.834\x203.121\x203.12-7.834\x207.835a.959.959\x200\x200\x201-1.358\x200l-1.764-1.764a.96.96\x200\x200\x201-.28-.678Zm9.22-5.391-1.121-1.12-6.479\x206.478\x201.121\x201.121\x206.479-6.479Z\x22/></svg>';const j=globalThis['DataTransfer'];class n extends _0x3161c5{['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[_0xbd19d3,a,v,_0x58d003];}constructor(_0xe62f30){super(_0xe62f30),_0xe62f30['config']['define']('ai.aiAssistant.disabledElements',['media','rawHtml','tableOfContents']),_0xe62f30['config']['define']('ai.aiAssistant.contentAreaCssClass',''),_0xe62f30['config']['define']('ai.useTheme',!0x0),this['_uiCssClasses']='ck-ai-assistant-ui'+(_0xe62f30['config']['get']('ai.useTheme')?'\x20ck-ai-assistant-ui_theme':'');}['init'](){const {editor:_0x3f64b3}=this;this['_aiAdapter']=_0x3f64b3['plugins']['get'](v),this['_dialog']=_0x3f64b3['plugins']['get'](_0x58d003),this['_formView']=null,this['_commandDefinitions']=this['_getResolvedCommandsDefinitions']();const _0x2ee054=new y(_0x3f64b3,Array['from'](this['_commandDefinitions']['values']()));_0x3f64b3['commands']['add']('showAIAssistant',_0x2ee054),_0x3f64b3['ui']['componentFactory']['add']('aiCommands',_0x25065f=>{const _0xa6c719=_0x5abca7(_0x25065f);return _0xa6c719['set']({'class':'ck-ai-commands-dropdown\x20'+this['_uiCssClasses']}),_0xa6c719['buttonView']['set']({'label':i(_0x25065f,'AI\x20Commands'),'icon':E,'tooltip':!0x0}),_0xa6c719['on']('execute',_0x41652e=>this['_onExecute'](_0x41652e['source']['id'])),_0x4b49b0(_0xa6c719,_0x3f64b3['ui']['view']['body'],function(_0x507e62){const _0x5c5c8d=o(_0x507e62['config']['get']('ai.aiAssistant.commands'),_0x507e62['locale']),_0x590768=B(_0x507e62,_0x5c5c8d)['filter'](_0x2bb0f0=>_0x2bb0f0['commands']['length']);if(0x1===_0x590768['length'])return B(_0x507e62,_0x590768[0x0]['commands'])['map'](_0x376ef4=>({'id':_0x376ef4['id'],'label':_0x376ef4['label']}));return _0x590768['map'](_0x4e4bb9=>{const {groupId:_0x13ae3d,groupLabel:_0xfddb02,commands:_0x397984}=_0x4e4bb9,_0x53e96a=B(_0x507e62,_0x397984)['map'](_0x530a1a=>({'id':_0x530a1a['id'],'label':_0x530a1a['label']}));return{'id':_0x13ae3d,'menu':_0xfddb02||_0x13ae3d,'children':_0x53e96a};});}(_0x3f64b3),{'ariaLabel':i(_0x25065f,'AI\x20Commands')}),_0xa6c719['menuView']['menuPanelClass']='ck-ai-commands-dropdown\x20'+this['_uiCssClasses'],_0x2ee054['on']('change:enabledCommandsIds',_0x414af5),_0xa6c719['menuView']['once']('render',_0x414af5),_0xa6c719;function _0x414af5(){_0xa6c719['isEnabled']=_0x2ee054['enabledCommandsIds']['length']>0x0;for(const _0xe7350e of _0xa6c719['menuView']['buttons'])_0xe7350e['isEnabled']=_0x2ee054['enabledCommandsIds']['includes'](_0xe7350e['id']);}}),_0x3f64b3['ui']['componentFactory']['add']('menuBar:aiCommands',_0x115717=>{const _0x561176=new _0x26e97a(_0x115717);_0x561176['buttonView']['set']({'label':i(_0x115717,'AI\x20Commands'),'icon':E}),_0x561176['bind']('isEnabled')['to'](_0x2ee054,'enabledCommandsIds',_0x28af8f=>_0x28af8f['length']>0x0);const _0xc6be6c=o(_0x3f64b3['config']['get']('ai.aiAssistant.commands'),_0x115717);return this['_populateMenuBarMenu'](_0x2ee054,_0x561176,_0xc6be6c,_0x4ca915=>this['_onExecute'](_0x4ca915)),_0x561176;}),_0x3f64b3['ui']['componentFactory']['add']('aiAssistant',()=>{const _0x267c72=this['_createAIAssistantUIButton'](_0x5653f8);return _0x267c72['set']({'tooltip':!0x0,'class':'ck-ai-assistant-button\x20'+this['_uiCssClasses']}),_0x267c72;}),_0x3f64b3['ui']['componentFactory']['add']('menuBar:aiAssistant',()=>{const _0xcd1732=this['_createAIAssistantUIButton'](_0x1766be);return _0xcd1732['set']({'role':'menuitemcheckbox'}),_0xcd1732;}),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3e8fbe=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4e8e0d;for(const _0x298131 in _0x3e8fbe){const _0x137b8a=_0x298131,_0x4b4816=_0x3e8fbe[_0x137b8a];if('aiLicenseKeyValid'==_0x4b4816||'aiLicenseKeyInvalid'==_0x4b4816||'aiLicenseKeyExpired'==_0x4b4816||'aiLicenseKeyDomainLimit'==_0x4b4816||'aiLicenseKeyNotAllowed'==_0x4b4816||'aiLicenseKeyEvaluationLimit'==_0x4b4816||'aiLicenseKeyTrialLimit'==_0x4b4816||'aiLicenseKeyDevelopmentLimit'==_0x4b4816||'aiLicenseKeyUsageLimit'==_0x4b4816){delete _0x3e8fbe[_0x137b8a],_0x4e8e0d=_0x4b4816,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'aiLicenseKeyInvalid'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('invalid'),'aiLicenseKeyExpired'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('expired'),'aiLicenseKeyDomainLimit'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('domainLimit'),'aiLicenseKeyNotAllowed'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('featureNotAllowed','AIAssistant'),'aiLicenseKeyEvaluationLimit'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('evaluationLimit'),'aiLicenseKeyTrialLimit'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('trialLimit'),'aiLicenseKeyDevelopmentLimit'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('developmentLimit'),'aiLicenseKeyUsageLimit'==_0x4e8e0d&&_0x3e8fbe['_showLicenseError']('usageLimit');},0x3e8);}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['showUI'](_0xfaa7f1='',_0x1529c5='',_0x124bca='custom'){const _0x1f51a7=this['editor'],_0x19fa7c=_0x1f51a7['editing']['view'],_0x3cd073=_0x1f51a7['plugins']['get'](a),_0x1aa854=_0x1f51a7['plugins']['get'](_0xbd19d3);_0x3cd073['showFakeVisualSelection']();const _0x8716ab=new j(),_0x21c530=new ClipboardEvent('copy',{'clipboardData':_0x8716ab}),_0x585c1b=new _0x31b5e3(_0x8716ab),_0x3651eb=new _0x26b03b(_0x19fa7c,_0x21c530,{'dataTransfer':_0x585c1b});_0x1aa854['_forceMarkersCopy']('comment',()=>{_0x19fa7c['document']['fire']('copy',_0x3651eb);}),this['_formView']||(this['_initView'](),this['_aiAssistantController']=new C(_0x1f51a7,this['_aiAdapter']['textAdapter'],this['_formView']));let _0x3018b4=_0x585c1b['getData']('text/html');const _0x5744c6=_0x1f51a7['model']['document']['selection'],_0x1a63dc=Array['from'](_0x5744c6['getRanges']());0x1===_0x1a63dc['length']&&_0x1a63dc[0x0]['isFlat']&&!_0x5744c6['getSelectedElement']()&&''!==_0x3018b4['replace'](/&nbsp;/g,'')['trim']()&&(_0x3018b4='<p>'+_0x3018b4+'</p>'),this['_aiAssistantController']['updateView']({'actionId':_0x124bca,'query':_0xfaa7f1,'htmlContent':_0x3018b4,'label':_0x1529c5,'mainActionLabel':x[_0x1f51a7['model']['document']['selection']['isCollapsed']?'INSERT':'REPLACE']}),'aiAssistant'!==this['_dialog']['id']?this['_dialog']['show']({'id':'aiAssistant','icon':at['robotPencil'],'title':i(this['editor']['locale'],'AI\x20Assistant'),'content':this['_formView'],'position':_0x1faabc['EDITOR_TOP_SIDE'],'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_aiAssistantController']['reset'](),_0x3cd073['hideFakeVisualSelection']();}}):this['_dialog']['view']['wasMoved']||this['_dialog']['view']['updatePosition']();}['hideUI'](){this['_dialog']['hide']();}['_getResolvedCommandsDefinitions'](){const _0x464594=new Map(),_0x2fa4c3=o(this['editor']['config']['get']('ai.aiAssistant.commands'),this['editor']['locale']);for(const _0x1c0407 of _0x2fa4c3)for(const _0xe8160b of _0x1c0407['commands'])_0x464594['set'](_0xe8160b['id'],{..._0xe8160b,'groupId':_0x1c0407['groupId'],'groupLabel':_0x1c0407['groupLabel']||_0x1c0407['groupId']});return _0x464594;}['_createAIAssistantUIButton'](_0x9bc36a){const _0x5394c6=this['editor'],_0xe13bff=_0x5394c6['commands']['get']('showAIAssistant'),_0x563e15=new _0x9bc36a(_0x5394c6['locale']);return _0x563e15['set']({'label':i(_0x5394c6['locale'],'AI\x20Assistant'),'icon':at['robotPencil'],'isToggleable':!0x0}),_0x563e15['bind']('isEnabled')['to'](_0xe13bff),_0x563e15['bind']('isOn')['to'](this['_dialog'],'id',_0x374324=>'aiAssistant'===_0x374324),this['listenTo'](_0x563e15,'execute',()=>{_0x563e15['isOn']?this['hideUI']():_0xe13bff['execute']();}),_0x563e15;}['_initView'](){const _0x28fef4=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',()=>{_0x28fef4['insertContent'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['listenTo'](this['_formView'],'insertContentBelow',()=>{_0x28fef4['insertContentBelow'](this['_aiAssistantController']['currentContext']),this['hideUI']();}),this['_initAriaAiStatusChangeAnnouncements']();}['_initAriaAiStatusChangeAnnouncements'](){const {locale:_0x4d74f9,ui:{ariaLiveAnnouncer:_0x776fb8}}=this['editor'];this['_formView']['contentArea']['on']('change:isProcessing',(_0x4c89d1,_0x3552a8,_0xd1152a)=>{const _0x2676de=this['_aiAssistantController']['currentContext'];_0xd1152a?_0x776fb8['announce'](i(_0x4d74f9,'AI\x20is\x20writing')):_0x2676de&&_0x776fb8['announce'](i(_0x4d74f9,'Generated\x20content:\x20%0',_0x2676de),{'politeness':'polite','isUnsafeHTML':!0x0});}),this['_formView']['on']('change:isError',(_0x1fd4eb,_0x3784a0,_0x57252c)=>{if(_0x57252c){const _0x3baea6=this['_formView']['errorView']['text'];_0x776fb8['announce'](i(_0x4d74f9,'Error\x20during\x20AI\x20content\x20generation:\x20%0',_0x3baea6));}});}['_onExecute'](_0x1734a8){const _0x5d25f6=this['_commandDefinitions']['get'](_0x1734a8),_0x1e6c60=this['editor'],_0x1169cc=_0x1e6c60['model']['document']['selection'],_0x1ca516=_0x1e6c60['commands']['get']('showAIAssistant'),_0x56d41a=_0x1e6c60['plugins']['get'](a),_0x7404bf=''+(_0x5d25f6['groupId']!==I?_0x5d25f6['groupLabel']+':\x20':'')+_0x5d25f6['label'];if(!0x1!==_0x5d25f6['requiresContent']&&_0x1169cc['isCollapsed']){const _0x121aec=_0x55706b(_0x1169cc['getSelectedBlocks']())||_0x1e6c60['model']['schema']['getLimitElement'](_0x1169cc);_0x1e6c60['model']['change'](_0x5aa9c7=>{_0x5aa9c7['setSelection'](_0x121aec,'in');});}_0x56d41a['showFakeVisualSelection'](),_0x1ca516['execute'](_0x5d25f6['prompt'],_0x7404bf,'command:'+_0x1734a8);}['_populateMenuBarMenu'](_0x164427,_0x269e8f,_0x32f884,_0x227ab3){const _0x3ed1d4=this['editor'],_0x3a282d=_0x3ed1d4['locale'],_0x19a7ff=new _0x1ce8fc(_0x3a282d),_0x1338df=B(_0x3ed1d4,_0x32f884)['filter'](_0x3e8c5a=>_0x3e8c5a['commands']['length']);0x1===_0x1338df['length']?this['_getMenuBarGroupButtons']({'command':_0x164427,'commands':_0x1338df[0x0]['commands'],'parentMenuView':_0x269e8f,'onExecute':_0x227ab3})['forEach'](_0x5aee4c=>_0x19a7ff['items']['add'](_0x5aee4c)):_0x1338df['forEach'](({groupId:_0x453c27,groupLabel:_0x12d3ab,commands:_0xe5ea22})=>{const _0x5e4b34=new _0x188147(_0x3a282d,_0x269e8f),_0x4f0e45=new _0x26e97a(_0x3a282d),_0x17fae0=new _0x1ce8fc(_0x3a282d),_0x2da149=this['_getMenuBarGroupButtons']({'command':_0x164427,'commands':_0xe5ea22,'parentMenuView':_0x4f0e45,'onExecute':_0x227ab3});_0x4f0e45['buttonView']['set']({'label':_0x12d3ab||_0x453c27}),_0x4f0e45['delegate']('execute')['to'](_0x269e8f),_0x17fae0['items']['addMany'](_0x2da149),_0x4f0e45['panelView']['children']['add'](_0x17fae0),_0x5e4b34['children']['add'](_0x4f0e45),_0x19a7ff['items']['add'](_0x5e4b34);}),_0x269e8f['panelView']['children']['add'](_0x19a7ff);}['_getMenuBarGroupButtons']({command:_0x37c966,commands:_0x102d3,parentMenuView:_0x512b32,onExecute:_0x2a73ae}){const _0x37053e=this['editor'],_0x35afbe=_0x37053e['locale'];return B(_0x37053e,_0x102d3)['map'](_0x36fc68=>{const _0x201cc9=new _0x188147(_0x35afbe,_0x512b32),_0x1ef3cc=new _0x1766be(_0x35afbe);return _0x1ef3cc['set']({'label':_0x36fc68['label']}),_0x1ef3cc['delegate']('execute')['to'](_0x512b32),_0x1ef3cc['on']('execute',()=>_0x2a73ae(_0x36fc68['id'])),_0x1ef3cc['bind']('isEnabled')['to'](_0x37c966,'enabledCommandsIds',_0x1ca796=>_0x1ca796['includes'](_0x36fc68['id'])),_0x201cc9['children']['add'](_0x1ef3cc),_0x201cc9;});}}function _(_0x1ed370,_0x30138e){return void 0x0!==_0x1ed370['order']&&void 0x0===_0x30138e['order']?0x1:void 0x0===_0x1ed370['order']&&void 0x0!==_0x30138e['order']?-0x1:void 0x0!==_0x1ed370['order']&&void 0x0!==_0x30138e['order']?_0x1ed370['order']-_0x30138e['order']:0x0;}function B(_0x5e3d10,_0x5cc535){_0x5cc535['sort'](_);const _0x1d4633={},_0x1b07d6=[];for(const _0x5b26eb of _0x5cc535)if(void 0x0!==_0x5b26eb['order']){if(_0x5b26eb['order']in _0x1d4633)throw new _0x3cb6d1('ai-commands-config-order-collision',_0x5e3d10,{'conflictingDefinitions':[_0x5b26eb,_0x1d4633[_0x5b26eb['order']]]});_0x1d4633[_0x5b26eb['order']]=_0x5b26eb,_0x1b07d6['splice'](_0x5b26eb['order'],0x0,_0x5b26eb);}else _0x1b07d6['push'](_0x5b26eb);return _0x1b07d6;}class r extends _0x3161c5{static get['requires'](){return[n,a];}static get['pluginName'](){return'AIAssistant';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2bf5a9){super(_0x2bf5a9);const _0x395262=_0x2bf5a9['config'],_0x3741e4=_0x2bf5a9['locale'];_0x395262['define']('ai.aiAssistant.commands',function(_0x510446){return[{'groupId':'editOrReview','groupLabel':i(_0x510446,'Edit\x20or\x20review'),'commands':[{'id':'improveWriting','label':i(_0x510446,'Improve\x20writing'),'prompt':'Fix\x20spelling\x20mistakes,\x20use\x20proper\x20grammar\x20and\x20apply\x20good\x20writing\x20practices.\x20Do\x20not\x20lose\x20the\x20original\x20meaning.'},{'id':'makeShorter','label':i(_0x510446,'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(_0x510446,'Make\x20longer'),'prompt':'Improve\x20this\x20content\x20by\x20using\x20descriptive\x20language\x20and\x20inserting\x20more\x20information\x20and\x20more\x20detailed\x20explanations.'},{'id':'simplifyLanguage','label':i(_0x510446,'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(_0x510446,'Generate\x20from\x20selection'),'commands':[{'id':'summarize','label':i(_0x510446,'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(_0x510446,'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(_0x510446,'Change\x20tone'),'commands':[{'id':'professional','label':i(_0x510446,'Professional'),'prompt':'Improve\x20using\x20polished,\x20formal,\x20and\x20respectful\x20language\x20to\x20convey\x20professional\x20expertise\x20and\x20competence.'},{'id':'casual','label':i(_0x510446,'Casual'),'prompt':'Improve\x20using\x20casual,\x20informal\x20language\x20to\x20convey\x20a\x20casual\x20conversation\x20with\x20a\x20real\x20person.'},{'id':'direct','label':i(_0x510446,'Direct'),'prompt':'Improve\x20using\x20direct\x20language,\x20using\x20only\x20the\x20essential\x20information.'},{'id':'confident','label':i(_0x510446,'Confident'),'prompt':'Improve\x20using\x20compelling,\x20optimistic\x20language\x20to\x20convey\x20confidence\x20in\x20the\x20writing.'},{'id':'friendly','label':i(_0x510446,'Friendly'),'prompt':'Improve\x20using\x20friendly,\x20comforting\x20language,\x20to\x20convey\x20understanding\x20and\x20empathy.'}]},{'groupId':'changeStyle','groupLabel':i(_0x510446,'Change\x20style'),'commands':[{'id':'business','label':i(_0x510446,'Business'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20business\x20professional\x20with\x20formal\x20language.'},{'id':'legal','label':i(_0x510446,'Legal'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20legal\x20professional\x20using\x20valid\x20legal\x20terminology.'},{'id':'journalism','label':i(_0x510446,'Journalism'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20journalist\x20using\x20engaging\x20language\x20to\x20convey\x20the\x20importance\x20of\x20the\x20information.'},{'id':'poetic','label':i(_0x510446,'Poetic'),'prompt':'Rewrite\x20this\x20content\x20as\x20a\x20poem\x20using\x20poetic\x20techniques\x20without\x20losing\x20the\x20original\x20meaning.'}]},{'groupId':'translate','groupLabel':i(_0x510446,'Translate'),'commands':[{'id':'translateEnglish','label':i(_0x510446,'English'),'prompt':'Translate\x20the\x20content\x20to\x20English\x20language.'},{'id':'translateSpanish','label':i(_0x510446,'Spanish'),'prompt':'Translate\x20the\x20content\x20to\x20Spanish\x20language.'},{'id':'translatePortuguese','label':i(_0x510446,'Portuguese'),'prompt':'Translate\x20the\x20content\x20to\x20Portuguese\x20language.'},{'id':'translateGerman','label':i(_0x510446,'German'),'prompt':'Translate\x20the\x20content\x20to\x20German\x20language.'},{'id':'translateFrench','label':i(_0x510446,'French'),'prompt':'Translate\x20the\x20content\x20to\x20French\x20language.'},{'id':'translateChinese','label':i(_0x510446,'Simplified\x20Chinese'),'prompt':'Translate\x20the\x20content\x20to\x20Simplified\x20Chinese\x20language.'},{'id':'translateHindi','label':i(_0x510446,'Hindi'),'prompt':'Translate\x20the\x20content\x20to\x20Hindi\x20language.'},{'id':'translateArabic','label':i(_0x510446,'Arabic'),'prompt':'Translate\x20the\x20content\x20to\x20Arabic\x20language.'}]}];}(_0x3741e4)),_0x395262['define']('ai.aiAssistant.extraCommandGroups',[]),_0x395262['define']('ai.aiAssistant.removeCommands',[]);const _0x4ac78d=o(_0x395262['get']('ai.aiAssistant.commands'),_0x3741e4),_0x4b3090=_0x395262['get']('ai.aiAssistant.extraCommandGroups'),_0x277af2=_0x395262['get']('ai.aiAssistant.removeCommands');_0x4b3090['forEach'](_0x2720bc=>{const _0x38cae4=_0x4ac78d['find'](_0x525ecd=>_0x525ecd['groupId']===_0x2720bc['groupId']);_0x38cae4?_0x38cae4['commands']=_0x38cae4['commands']['concat'](_0x2720bc['commands']):_0x4ac78d['push'](_0x2720bc);}),_0x4ac78d['forEach'](_0x4c570f=>{_0x4c570f['commands']=_0x4c570f['commands']['filter'](_0x550b0f=>!_0x277af2['includes'](_0x550b0f['id']));}),_0x395262['set']('ai.aiAssistant.commands',_0x4ac78d);}}class P extends _0x3161c5{['abortController'];static get['requires'](){return[v];}constructor(_0x116c7c){super(_0x116c7c),this['abortController']=new AbortController();}['init'](){this['editor']['plugins']['get'](v)['textAdapter']=this;}['abort'](){this['abortController']['signal']['aborted']||(this['abortController']['abort'](),this['abortController']=new AbortController());}async['makeRequest'](_0x5e32a4){return this['sendRequest'](_0x5e32a4)['catch'](_0xa3b410=>{if(_0xa3b410 instanceof R)return Promise['reject'](_0xa3b410);if('AbortError'==_0xa3b410['name'])return Promise['resolve']();throw console['error'](_0xa3b410),new _0x3cb6d1('aitextadapter-send-request-failed',null);});}async['_prepareRequestHeaders'](_0x33ef11,_0x2f9624){const _0x303870=this['editor']['locale'],_0x503e62={'Content-Type':'application/json'};if('object'==typeof _0x33ef11)Object['assign'](_0x503e62,_0x33ef11);else{if(_0x33ef11)try{const _0x386835=await _0x33ef11(_0x2f9624);Object['assign'](_0x503e62,_0x386835);}catch(_0x2cde5b){return Promise['reject'](new R(i(_0x303870,'AI_ERROR_GET_HEADERS')));}}return _0x503e62;}async['_prepareRequestParameters'](_0x120077,_0x54c28e){const _0x42da0d=this['editor']['locale'];if('object'==typeof _0x120077)return _0x120077;try{return await _0x120077(_0x54c28e);}catch(_0xf284d5){return Promise['reject'](new R(i(_0x42da0d,'AI_ERROR_GET_PARAMETERS')));}}}class H extends P{['_apiUrl'];['_requestHeaders'];['_requestParameters'];static get['pluginName'](){return'OpenAITextAdapter';}constructor(_0x5cbded){super(_0x5cbded),_0x5cbded['config']['define']('ai.openAI.apiUrl','https://api.openai.com/v1/chat/completions'),_0x5cbded['config']['get']('ai.openAI.requestParameters')||_0x5cbded['config']['define']('ai.openAI.requestParameters',{'model':'gpt-3.5-turbo','max_tokens':0x7d0,'temperature':0x1,'top_p':0x1,'stream':!0x0}),this['_apiUrl']=_0x5cbded['config']['get']('ai.openAI.apiUrl'),this['_requestHeaders']=_0x5cbded['config']['get']('ai.openAI.requestHeaders')||{},this['_requestParameters']=_0x5cbded['config']['get']('ai.openAI.requestParameters');}async['sendRequest']({query:_0x358336,context:_0x3b5c53,onData:_0x2e2dcd,actionId:_0x5c3fc5}){const _0x2d3030=this['editor']['locale'],_0x36f58a=await this['prepareMessages'](_0x358336,_0x3b5c53,_0x5c3fc5),_0xd0e0dd=await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x5c3fc5),_0x2df624=await this['_prepareRequestParameters'](this['_requestParameters'],_0x5c3fc5),_0x33e712={'messages':_0x36f58a,..._0x2df624},_0x670635={'method':'POST','headers':_0xd0e0dd,'body':JSON['stringify'](_0x33e712),'signal':this['abortController']['signal']},_0x42222e=await fetch(this['_apiUrl'],_0x670635);if(_0x42222e['ok'])return _0x2df624['stream']?await this['_readStreamableResponse'](_0x42222e,_0x2e2dcd):await this['_readStaticResponse'](_0x42222e,_0x2e2dcd),Promise['resolve']();{const _0x1a08e0=await _0x42222e['text']();return _0x1a08e0['includes']('context_length_exceeded')?Promise['reject'](new R(i(_0x2d3030,'AI_ERROR_CONTEXT_LENGTH'))):_0x1a08e0['includes']('Moderation')?Promise['reject'](new R(i(_0x2d3030,'AI_ERROR_MODERATION'))):Promise['reject'](new Error(_0x1a08e0));}}async['prepareMessages'](_0x32f5a1,_0xf0de8c,_0x24fc54){let _0x40f78c,_0x4a4fdf;return _0xf0de8c?(_0x40f78c='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.',_0x4a4fdf='Instruction:\x0a'+_0x32f5a1+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0xf0de8c):(_0x40f78c='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.',_0x4a4fdf=_0x32f5a1),[{'role':'system','content':_0x40f78c},{'role':'user','content':_0x4a4fdf}];}async['_readStreamableResponse'](_0x154acf,_0x485576){const _0x547703=_0x154acf['body']['getReader'](),_0x3d0698=new TextDecoder();let _0x30c893='',_0x514364='',_0x5b5ae6='',_0x4199b7=!0x1;for(;!_0x4199b7;){const {done:_0x7647ce,value:_0x273c64}=await _0x547703['read'](),_0x19b13a=_0x30c893+_0x3d0698['decode'](_0x273c64);let _0x44a437='';_0x4199b7=_0x7647ce;try{_0x44a437=this['_cleanUpData'](_0x19b13a),_0x30c893='';}catch(_0x738860){_0x30c893=_0x19b13a;continue;}_0x514364+=_0x44a437,!_0x4199b7&&this['_isBufferIncomplete'](_0x514364)||_0x514364&&(_0x5b5ae6+=_0x514364,_0x514364='',_0x485576(_0x5b5ae6));}return Promise['resolve']();}async['_readStaticResponse'](_0x119a86,_0x41660b){return _0x41660b((await _0x119a86['json']())['choices'][0x0]['message']['content']),Promise['resolve']();}['_isBufferIncomplete'](_0x5423f6){const _0x5b8d95=_0x5423f6['split']('<')['length']!==_0x5423f6['split']('>')['length'],_0x370526=_0x5423f6['length']<0x1e;return _0x5b8d95&&_0x370526;}['_cleanUpData'](_0x2a135d){return _0x2a135d['split'](/\n(?![^{]*\})/g)['map'](_0x2780a9=>_0x2780a9['replace']('data:\x20',''))['filter'](_0x333094=>_0x333094&&_0x333094['length']>0x0&&'[DONE]'!==_0x333094)['map'](_0x443709=>{const {choices:_0x23f7c5}=JSON['parse'](_0x443709);if(_0x23f7c5[0x0]&&_0x23f7c5[0x0]['delta']&&_0x23f7c5[0x0]['delta']['content'])return _0x23f7c5[0x0]['delta']['content'];})['filter'](_0x433b74=>_0x433b74)['join']('');}}class O extends P{['_apiUrl'];['_requestHeaders'];['_bedrockClientConfig'];['_requestParameters'];static get['pluginName'](){return'AWSTextAdapter';}constructor(_0x327d66){super(_0x327d66),_0x327d66['config']['get']('ai.aws.requestParameters')||_0x327d66['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']=_0x327d66['config']['get']('ai.aws.apiUrl'),this['_bedrockClientConfig']=_0x327d66['config']['get']('ai.aws.bedrockClientConfig'),this['_requestHeaders']=_0x327d66['config']['get']('ai.aws.requestHeaders'),this['_requestParameters']=_0x327d66['config']['get']('ai.aws.requestParameters');}async['sendRequest']({query:_0x517622,context:_0x4ed942,onData:_0x4d110e,actionId:_0x405f4b}){const {model:_0xd8c6b3,stream:_0x5f4f88,..._0x3862a6}=await this['_prepareRequestParameters'](this['_requestParameters'],_0x405f4b),_0x192e51={'prompt':await this['preparePrompt'](_0x517622,_0x4ed942,_0xd8c6b3,_0x405f4b),..._0x3862a6};this['_apiUrl']?await this['_processProxyRequest'](_0x192e51,_0xd8c6b3,_0x5f4f88,_0x4d110e,_0x405f4b):await this['_processAWSRequest'](_0x192e51,_0xd8c6b3,_0x5f4f88,_0x4d110e);}async['preparePrompt'](_0x205ec8,_0x686960,_0x428c6c,_0x2f01ea){let _0x384dbe,_0x2a5f06;return _0x686960?(_0x384dbe='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.',_0x2a5f06='Instruction:\x0a'+_0x205ec8+'\x0aYou\x20must\x20keep\x20the\x20text\x20formatting.\x0a\x0aContent:\x0a'+_0x686960):(_0x384dbe='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.',_0x2a5f06=_0x205ec8),'meta.llama'==this['getModelFamily'](_0x428c6c)?'<<SYS>>\x0a'+_0x384dbe+'\x0a<</SYS>>\x0a[INST]\x0a'+_0x2a5f06+'\x0a[/INST]':'Human:\x0a'+_0x384dbe+'\x0a'+_0x2a5f06+'\x0a\x0aAssistant:';}['getModelFamily'](_0x15c818){if(/^anthropic\.claude/['test'](_0x15c818))return'anthropic.claude';if(/^ai21\.j2/['test'](_0x15c818))return'ai21.j2';if(/^cohere\.command/['test'](_0x15c818))return'cohere.command';if(/^meta\.llama/['test'](_0x15c818))return'meta.llama';throw new R(i(this['editor']['locale'],'AI_ERROR_UNSUPPORTED_MODEL',_0x15c818));}async['_processProxyRequest'](_0x178fbc,_0x3fc68b,_0x2bda43,_0x3fc723,_0x14a251){const _0xeadcea={'method':'POST','headers':await this['_prepareRequestHeaders'](this['_requestHeaders'],_0x14a251),'body':JSON['stringify']({..._0x178fbc,'model':_0x3fc68b,'stream':_0x2bda43}),'signal':this['abortController']['signal']},_0x584652=await fetch(this['_apiUrl'],_0xeadcea);_0x2bda43?await this['_readStreamableResponse'](_0x584652,_0x3fc68b,_0x3fc723):await this['_readStaticResponse'](_0x584652,_0x3fc68b,_0x3fc723);}async['_processAWSRequest'](_0x1f5c9c,_0x21194d,_0x31f24f,_0x1bd20d){const _0x35f2c0=new _0x5f54e7(this['_bedrockClientConfig']),_0x5654e9={'body':JSON['stringify'](_0x1f5c9c),'contentType':'application/json','accept':'application/json','modelId':_0x21194d};let _0x466036;if(_0x31f24f){const _0x4bad06=new _0x19794c(_0x5654e9);_0x466036=await _0x35f2c0['send'](_0x4bad06,{'abortSignal':this['abortController']['signal']}),await this['_readAsyncIterableResponse'](_0x466036,_0x21194d,_0x1bd20d);}else{const _0x9e0f49=new _0x128ba0(_0x5654e9);_0x466036=await _0x35f2c0['send'](_0x9e0f49,{'abortSignal':this['abortController']['signal']}),await this['_readStaticResponse'](_0x466036,_0x21194d,_0x1bd20d);}}async['_readAsyncIterableResponse'](_0x326405,_0x5c96a5,_0x227d32){const _0x5694be=_0x326405['body'],_0xfd82c=new TextDecoder('utf-8');let _0x4089c0='';for await(const _0x152db of _0x5694be)if(_0x152db['chunk']){const _0xe9d3bc=_0xfd82c['decode'](_0x152db['chunk']['bytes']),_0x470d3b=JSON['parse'](_0xe9d3bc);_0x4089c0+=this['_getGeneratedText'](_0x470d3b,_0x5c96a5),_0x227d32(_0x4089c0);}return Promise['resolve']();}async['_readStreamableResponse'](_0x4c6797,_0x268512,_0x39328e){const _0x4d42dc=_0x4c6797['body'],_0x1225d0=new TextDecoder('utf-8'),_0x162efc=_0x4d42dc['getReader']();let _0x23d983='',_0x53f200='',_0x50c2ae=!0x1;for(;!_0x50c2ae;){const {done:_0x1515b5,value:_0xfb8899}=await _0x162efc['read']();if(_0x50c2ae=_0x1515b5,_0x50c2ae)break;const _0x91f3bc=(_0x23d983+_0x1225d0['decode'](_0xfb8899))['split']('\x0a')['map'](_0xee662f=>{try{return _0x23d983='',JSON['parse'](_0xee662f);}catch(_0x4489cf){return _0x23d983=_0xee662f,null;}})['filter'](_0x6026bb=>null!==_0x6026bb);_0x91f3bc['length']&&(_0x53f200+=_0x91f3bc['map'](_0x59d95c=>this['_getGeneratedText'](_0x59d95c,_0x268512))['join'](''),_0x39328e(_0x53f200));}return Promise['resolve']();}async['_readStaticResponse'](_0x258bf7,_0x4f650e,_0x46e123){let _0x4de085;return _0x4de085=_0x258bf7 instanceof Response?await _0x258bf7['json']():JSON['parse'](Buffer['from'](_0x258bf7['body'])['toString']('utf8')),(_0x46e123(this['_getGeneratedText'](_0x4de085,_0x4f650e)),Promise['resolve']());}['_getGeneratedText'](_0x5d46cb,_0x6708ae){switch(this['getModelFamily'](_0x6708ae)){case'anthropic.claude':return _0x5d46cb['completion'];case'ai21.j2':return _0x5d46cb['completions'][0x0]['data']['text'];case'cohere.command':return _0x5d46cb['generations'][0x0]['text'];case'meta.llama':return _0x5d46cb['generation'];}}}export{v as AIAdapter,r as AIAssistant,R as AIRequestError,P as AITextAdapter,O as AWSTextAdapter,H as OpenAITextAdapter};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-ai",
3
- "version": "44.1.0-alpha.4",
3
+ "version": "44.1.0-alpha.5",
4
4
  "description": "AI Assistant feature for CKEditor 5.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "CKSource (http://cksource.com/)",
@@ -24,13 +24,13 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@aws-sdk/client-bedrock-runtime": "3.621.0",
27
- "@ckeditor/ckeditor5-clipboard": "44.1.0-alpha.4",
28
- "@ckeditor/ckeditor5-core": "44.1.0-alpha.4",
29
- "@ckeditor/ckeditor5-engine": "44.1.0-alpha.4",
30
- "@ckeditor/ckeditor5-ui": "44.1.0-alpha.4",
31
- "@ckeditor/ckeditor5-utils": "44.1.0-alpha.4",
32
- "ckeditor5": "44.1.0-alpha.4",
33
- "ckeditor5-collaboration": "44.1.0-alpha.4",
27
+ "@ckeditor/ckeditor5-clipboard": "44.1.0-alpha.5",
28
+ "@ckeditor/ckeditor5-core": "44.1.0-alpha.5",
29
+ "@ckeditor/ckeditor5-engine": "44.1.0-alpha.5",
30
+ "@ckeditor/ckeditor5-ui": "44.1.0-alpha.5",
31
+ "@ckeditor/ckeditor5-utils": "44.1.0-alpha.5",
32
+ "ckeditor5": "44.1.0-alpha.5",
33
+ "ckeditor5-collaboration": "44.1.0-alpha.5",
34
34
  "lodash-es": "4.17.21"
35
35
  },
36
36
  "type": "module",