@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 6.57 kB
JavaScript
/*
* Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
*
*
*
*
* +---------------------------------------------------------------------------------+
* | |
* | Hello stranger! |
* | |
* | |
* | What you're currently looking at is the source code of a legally protected, |
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
* | are forbidden and will result in legal consequences. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
const _0x2e2fc0=_0x3884;(function(_0x195356,_0xe2334c){const _0x4a2a1e=_0x3884,_0x413518=_0x195356();while(!![]){try{const _0x24b58c=-parseInt(_0x4a2a1e(0xf2))/0x1+parseInt(_0x4a2a1e(0xdd))/0x2*(-parseInt(_0x4a2a1e(0xee))/0x3)+-parseInt(_0x4a2a1e(0xf7))/0x4+-parseInt(_0x4a2a1e(0x119))/0x5*(parseInt(_0x4a2a1e(0xde))/0x6)+-parseInt(_0x4a2a1e(0xe6))/0x7*(-parseInt(_0x4a2a1e(0xe0))/0x8)+-parseInt(_0x4a2a1e(0xfa))/0x9+parseInt(_0x4a2a1e(0xfb))/0xa;if(_0x24b58c===_0xe2334c)break;else _0x413518['push'](_0x413518['shift']());}catch(_0x342f8b){_0x413518['push'](_0x413518['shift']());}}}(_0x46c7,0x51474));import{Command as _0x2de5a8}from'ckeditor5/src/core.js';import{CKEditorError as _0x4a1fec,first as _0xb10fcf}from'ckeditor5/src/utils.js';function _0x46c7(){const _0x367d4e=['has','getSelectedBlocks','displayedPrompt','focusPromptInput','other','_handleAIActionsAction','CHAT','AI_QUICK_ACTIONS_PLUGIN_NOT_FOUND','args','type','ask-ai','locale','AIChatController','plugins','get','AITabs','removeSelectionFromChatContext','change','ai-quick-actions-plugin-not-found','view','_handleAIChatAction','log','executeAction','handleAIReviewAction','addSelectionToChatContext','ACTION','prompt','actionName','isCollapsed','9210SZOoXM','260290AGiBZx','1722yyWoyp','getLimitElement','8QnZYSE','sendMessage','document','execute','REVIEW','startConversation','3308522xrHJdj','_expandSelectionIfCollapsed','icon','editor','_handleAIReviewAction','schema','label','AIActions','3pHljPA','chat','model','setSelection','486329PVwOCg','parent','AIChat','selection','activateTab','722676NhqVKV','AIReviewMode','_handleAIActionsActionLabel','1886445FVbYhe','13956720tFRbln'];_0x46c7=function(){return _0x367d4e;};return _0x46c7();}function _0x3884(_0x55a612,_0x312118){const _0x46c7c0=_0x46c7();return _0x3884=function(_0x3884aa,_0x196612){_0x3884aa=_0x3884aa-0xdd;let _0x79782d=_0x46c7c0[_0x3884aa];return _0x79782d;},_0x3884(_0x55a612,_0x312118);}import{AIQuickActionType as _0x414723}from'./aiquickactionsui.js';import{getTranslation as _0x4f6468}from'../aicore/utils/common-translations.js';export class AIQuickActionsCommand extends _0x2de5a8{[_0x2e2fc0(0xe3)](_0x34f515){const _0x21633c=_0x2e2fc0;switch(this[_0x21633c(0xe7)](),_0x34f515[_0x21633c(0x105)]){case _0x414723[_0x21633c(0x102)]:if(!this[_0x21633c(0xe9)][_0x21633c(0x109)][_0x21633c(0xfc)](_0x21633c(0xf4))){const _0x485edb=_0x4f6468(this[_0x21633c(0xe9)][_0x21633c(0x107)],_0x21633c(0x103),_0x21633c(0xf4));throw new _0x4a1fec(_0x21633c(0x10e),this[_0x21633c(0xe9)],{'errorMessage':_0x485edb});}this[_0x21633c(0x110)](_0x34f515);break;case _0x414723[_0x21633c(0x115)]:if(!this[_0x21633c(0xe9)][_0x21633c(0x109)][_0x21633c(0xfc)](_0x21633c(0xed))){const _0x50a25c=_0x4f6468(this[_0x21633c(0xe9)][_0x21633c(0x107)],_0x21633c(0x103),_0x21633c(0xed));throw new _0x4a1fec(_0x21633c(0x10e),this[_0x21633c(0xe9)],{'errorMessage':_0x50a25c});}this[_0x21633c(0x101)](_0x34f515);break;case _0x414723[_0x21633c(0xe4)]:if(!this[_0x21633c(0xe9)][_0x21633c(0x109)][_0x21633c(0xfc)](_0x21633c(0xf8))){const _0x249077=_0x4f6468(this[_0x21633c(0xe9)][_0x21633c(0x107)],_0x21633c(0x103),_0x21633c(0xf8));throw new _0x4a1fec(_0x21633c(0x10e),this[_0x21633c(0xe9)],{'errorMessage':_0x249077});}this[_0x21633c(0xea)](_0x34f515);}}async[_0x2e2fc0(0x110)](_0x2c9cc2){const _0x12409f=_0x2e2fc0,_0x3fa42b=this[_0x12409f(0xe9)][_0x12409f(0x109)][_0x12409f(0x10a)](_0x12409f(0xf4)),_0x18a7b0=this[_0x12409f(0xe9)][_0x12409f(0x109)][_0x12409f(0x10a)](_0x12409f(0x108));if(this[_0x12409f(0xe9)][_0x12409f(0x109)][_0x12409f(0x10a)](_0x12409f(0x10b))[_0x12409f(0x10f)][_0x12409f(0xf6)](_0x12409f(0xef)),_0x12409f(0x106)===_0x2c9cc2['id'])_0x18a7b0[_0x12409f(0x10c)](),await _0x3fa42b[_0x12409f(0x114)](),_0x3fa42b[_0x12409f(0xff)]();else await _0x3fa42b[_0x12409f(0xe5)](),_0x18a7b0[_0x12409f(0x10c)](),await _0x3fa42b[_0x12409f(0x114)](),_0x3fa42b[_0x12409f(0xff)](),await _0x3fa42b[_0x12409f(0xe1)]({'message':_0x2c9cc2[_0x12409f(0x116)]||_0x2c9cc2[_0x12409f(0xfe)],'quickActionData':{'id':_0x2c9cc2['id'],'displayedPrompt':_0x2c9cc2[_0x12409f(0xfe)]}});}[_0x2e2fc0(0xe7)](){const _0x1e7240=_0x2e2fc0,_0xc72a32=this[_0x1e7240(0xe9)],_0x491fb9=_0xc72a32[_0x1e7240(0xf0)][_0x1e7240(0xe2)][_0x1e7240(0xf5)];if(!_0x491fb9[_0x1e7240(0x118)])return;const _0x5eaeb0=_0xb10fcf(_0x491fb9[_0x1e7240(0xfd)]())||_0xc72a32[_0x1e7240(0xf0)][_0x1e7240(0xeb)][_0x1e7240(0xdf)](_0x491fb9);_0xc72a32[_0x1e7240(0xf0)][_0x1e7240(0x10d)](_0x3ed108=>{const _0x4eff11=_0x1e7240;_0x3ed108[_0x4eff11(0xf1)](_0x5eaeb0,'in');});}[_0x2e2fc0(0xf9)](_0x529972){const _0x4d1520=_0x2e2fc0;return _0x529972[_0x4d1520(0xf3)]?.[_0x4d1520(0xec)]&&_0x4d1520(0x100)!==_0x529972[_0x4d1520(0xf3)]?.['id']?_0x529972[_0x4d1520(0xf3)][_0x4d1520(0xec)]+':\x20'+_0x529972[_0x4d1520(0xfe)]:_0x529972[_0x4d1520(0xfe)];}async[_0x2e2fc0(0x101)](_0x37ec6a){const _0x35a296=_0x2e2fc0,_0x19f952=this[_0x35a296(0xe9)][_0x35a296(0x109)][_0x35a296(0x10a)](_0x35a296(0xed)),_0x12f6d7=_0x37ec6a[_0x35a296(0x116)]?{'userMessage':_0x37ec6a[_0x35a296(0x116)],'model':_0x37ec6a[_0x35a296(0xf0)]}:{'actionName':_0x37ec6a[_0x35a296(0x117)]||_0x37ec6a['id'],'args':_0x37ec6a[_0x35a296(0x104)]},_0x2481cd=this[_0x35a296(0xf9)](_0x37ec6a);await _0x19f952[_0x35a296(0x112)](_0x12f6d7,_0x2481cd,_0x37ec6a[_0x35a296(0xe8)]);}async[_0x2e2fc0(0xea)](_0x3391db){const _0x1fda76=_0x2e2fc0;console[_0x1fda76(0x111)](_0x1fda76(0x113),_0x3391db);}}