@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 11.3 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 _0x50edfe=_0x9784;(function(_0x311b7d,_0x67f1b5){const _0x3405c9=_0x9784,_0x2274d5=_0x311b7d();while(!![]){try{const _0x438304=parseInt(_0x3405c9(0x12b))/0x1+-parseInt(_0x3405c9(0xf6))/0x2*(parseInt(_0x3405c9(0xd6))/0x3)+-parseInt(_0x3405c9(0xfe))/0x4+parseInt(_0x3405c9(0x10a))/0x5+parseInt(_0x3405c9(0xf0))/0x6+parseInt(_0x3405c9(0xe6))/0x7+-parseInt(_0x3405c9(0x129))/0x8;if(_0x438304===_0x67f1b5)break;else _0x2274d5['push'](_0x2274d5['shift']());}catch(_0x4a6cfa){_0x2274d5['push'](_0x2274d5['shift']());}}}(_0x3f5c,0x3df50));import{View as _0xafab8c,SearchTextView as _0x249824,FormHeaderView as _0x437b44,ButtonView as _0x5c39da}from'ckeditor5/src/ui.js';import{IconAIHistory as _0x5845e8,IconCancel as _0x19b256,IconPlus as _0x47c923}from'ckeditor5/src/icons.js';import{AIChatHistorySectionListView as _0x54ad6a}from'./aichathistorysectionlistview.js';function _0x9784(_0xe5d084,_0x2f10a8){const _0x3f5c50=_0x3f5c();return _0x9784=function(_0x9784f3,_0xa93393){_0x9784f3=_0x9784f3-0xd6;let _0x5175e8=_0x3f5c50[_0x9784f3];return _0x5175e8;},_0x9784(_0xe5d084,_0x2f10a8);}import{AIChatHistoryListView as _0x5ec739}from'./aichathistorylistview.js';function _0x3f5c(){const _0x126ea0=['ck-ai-chat__start-conversation','ck-ai-notification_error','_createListItemViews','2428242botrBl','div','search','ck-ai-chat-history__empty','items','AI_CHAT_LABEL_NEW_CHAT','342014ezWTGZ','some','updateItemLoadingState','change:hasItems','isEmptyViewVisible','isMainErrorViewVisible','execute','_createEmptyStateView','335868mOUajj','emptyView','removeItem','change:isLoading','push','resizeButton','aiHistory','hasItems','ck-ai-chat-history','clear','delegate','updateItemTitle','12760NXaZhq','itemsViews','bind','set','searchView','queryView','change:errorMessage','updateHistoryItemsWithCategories','addMany','setTemplate','ck-ai-chat-history__content','sections','getItem','extendTemplate','openChat','AI_CHAT_HISTORY_SEARCH_NOT_FOUND_SECONDARY','remove','mainErrorView','errorMessage','add','ltr','ck-ai-notification','_updateViewVisibility','bindTemplate','AI_CHAT_HISTORY_EMPTY_MESSAGE','AI_CHAT_HISTORY_HEADING','_createSearchView','splice','_refreshSearch','indexOf','isSearchViewVisible','3536184lECdin','title','374150EwJLqb','sectionsView','AI_CHAT_HISTORY_SEARCH_NOT_FOUND_PRIMARY','_createErrorView','render','updateLoadingState','3ZxzEoQ','ck-rounded-corners','value','length','element','fieldView','isVisible','ck-ai-header\x20ck-ai-header_history','AI_CHAT_HISTORY_SEARCH_LABEL','children','skeletonView','isLoading','isMaximized','ck-reset_all','_createSkeletonView','ck-ai-notification_error__dismiss-button','1185548HmSfIh','removeHistoryItem','locale','ck-ai-chat-history__empty-message','ck-hidden','fire','updateTitle'];_0x3f5c=function(){return _0x126ea0;};return _0x3f5c();}import{AIChatHistoryListItemView as _0x7d5635}from'./aichathistorylistitemview.js';import{AI_CHAT_HISTORY_UI_EVENT_NAMES as _0x540dfd}from'../aichathistoryui.js';import{AISkeletonView as _0x1a1686,SKELETON_DEFINITIONS as _0x2a0644}from'../../aicore/ui/aiskeleton.js';import{createResizeButton as _0xb70860}from'../../aicore/utils/createresizebutton.js';import{getTranslation as _0x387ca3}from'../../aicore/utils/common-translations.js';export class AIChatHistoryView extends _0xafab8c{[_0x50edfe(0x10e)];[_0x50edfe(0x11b)];[_0x50edfe(0xe0)];[_0x50edfe(0xff)];[_0x50edfe(0x12c)];[_0x50edfe(0x103)];constructor(_0xb59193,_0x5bd662){const _0x2664f7=_0x50edfe;super(_0xb59193),this[_0x2664f7(0x10d)](_0x2664f7(0x105),!0x1),this[_0x2664f7(0x10d)](_0x2664f7(0xe1),!0x0),this[_0x2664f7(0x10d)](_0x2664f7(0x11c),''),this[_0x2664f7(0x10d)](_0x2664f7(0xe2),!0x1),this[_0x2664f7(0x10d)](_0x2664f7(0x128),!0x1),this[_0x2664f7(0x10d)](_0x2664f7(0xfa),!0x1),this[_0x2664f7(0x10d)](_0x2664f7(0xfb),!0x1);const _0xef6a34=new _0x437b44(_0xb59193,{'label':_0x387ca3(_0xb59193,_0x2664f7(0x123)),'icon':_0x5845e8,'class':_0x2664f7(0xdd)});_0x5bd662&&(this[_0x2664f7(0x103)]=_0xb70860(_0xb59193,this),_0xef6a34[_0x2664f7(0xdf)][_0x2664f7(0x11d)](this[_0x2664f7(0x103)])),this[_0x2664f7(0x12c)]=new _0x54ad6a(_0xb59193,[]),this[_0x2664f7(0x12c)][_0x2664f7(0x108)](..._0x540dfd)['to'](this),this[_0x2664f7(0x11b)]=this[_0x2664f7(0x12e)](),this[_0x2664f7(0xe0)]=this[_0x2664f7(0xe4)](),this[_0x2664f7(0xff)]=this[_0x2664f7(0xfd)](),this[_0x2664f7(0x10e)]=this[_0x2664f7(0x124)](),this[_0x2664f7(0x11b)][_0x2664f7(0x117)]({'attributes':{'class':[this[_0x2664f7(0x121)]['if'](_0x2664f7(0xfb),_0x2664f7(0xea),_0x1f1c31=>!_0x1f1c31)]}}),this['on'](_0x2664f7(0x101),()=>this[_0x2664f7(0x120)]()),this['on'](_0x2664f7(0xf9),()=>this[_0x2664f7(0x120)]()),this['on'](_0x2664f7(0x110),()=>this[_0x2664f7(0x120)]()),this[_0x2664f7(0x113)]({'tag':_0x2664f7(0xf1),'attributes':{'class':['ck',_0x2664f7(0xe3),_0x2664f7(0x106),_0x2664f7(0xd7)],'dir':_0x2664f7(0x11e)},'children':[_0xef6a34,{'tag':_0x2664f7(0xf1),'attributes':{'class':[_0x2664f7(0x114)]},'children':[this[_0x2664f7(0xe0)],this[_0x2664f7(0x11b)],this[_0x2664f7(0xff)],this[_0x2664f7(0x10e)]]}]});}[_0x50edfe(0x120)](){const _0x551781=_0x50edfe;this[_0x551781(0x128)]=!this[_0x551781(0xe1)]&&this[_0x551781(0x105)],this[_0x551781(0xfa)]=!this[_0x551781(0xe1)]&&!this[_0x551781(0x105)]&&!this[_0x551781(0x11c)],this[_0x551781(0xfb)]=!this[_0x551781(0x128)]&&!!this[_0x551781(0x11c)];}[_0x50edfe(0x124)](){const _0x3e12ce=_0x50edfe,_0x25bd33=new _0x249824(this[_0x3e12ce(0xe8)],{'filteredView':this[_0x3e12ce(0x12c)],'queryView':{'label':_0x387ca3(this[_0x3e12ce(0xe8)],_0x3e12ce(0xde))},'infoView':{'text':{'notFound':{'primary':_0x13484e=>_0x387ca3(this[_0x3e12ce(0xe8)],_0x3e12ce(0x12d),_0x13484e),'secondary':_0x387ca3(this[_0x3e12ce(0xe8)],_0x3e12ce(0x119))}}}}),_0x2c0221=this[_0x3e12ce(0x12e)]();return _0x2c0221[_0x3e12ce(0x117)]({'attributes':{'class':[this[_0x3e12ce(0x121)]['if'](_0x3e12ce(0x11c),_0x3e12ce(0xea),_0x1b9600=>!_0x1b9600)]}}),_0x25bd33['on'](_0x3e12ce(0x12f),()=>{const _0x2dabb6=_0x3e12ce;_0x25bd33[_0x2dabb6(0xdf)][_0x2dabb6(0x11d)](_0x2c0221,0x1);}),_0x25bd33[_0x3e12ce(0x117)]({'attributes':{'class':[this[_0x3e12ce(0x121)]['if'](_0x3e12ce(0x128),_0x3e12ce(0xea),_0x285577=>!_0x285577)]}}),_0x25bd33;}[_0x50edfe(0xe4)](){const _0x36af74=_0x50edfe,_0x11a4c3=new _0x1a1686(this[_0x36af74(0xe8)],_0x2a0644[_0x36af74(0x104)]);return _0x11a4c3[_0x36af74(0x117)]({'attributes':{'class':[this[_0x36af74(0x121)]['if'](_0x36af74(0xe1),_0x36af74(0xea),_0xb00286=>!_0xb00286)]}}),_0x11a4c3;}[_0x50edfe(0x12e)](){const _0x38a014=_0x50edfe,_0x3ca0c5=new _0xafab8c(this[_0x38a014(0xe8)]),_0x2bd653=new _0x5c39da(this[_0x38a014(0xe8)]);_0x2bd653[_0x38a014(0x10d)]({'withText':!0x1,'icon':_0x19b256,'class':_0x38a014(0xe5)}),_0x2bd653[_0x38a014(0x10c)](_0x38a014(0xdc))['to'](this,_0x38a014(0x105),_0x2d3fba=>!!_0x2d3fba),_0x2bd653['on'](_0x38a014(0xfc),()=>{const _0x4b6c69=_0x38a014;this[_0x4b6c69(0x11c)]='';});const _0x37698c=this[_0x38a014(0x121)];return _0x3ca0c5[_0x38a014(0x113)]({'tag':_0x38a014(0xf1),'attributes':{'class':['ck',_0x38a014(0x11f),_0x38a014(0xee)]},'children':[{'tag':'p','children':[{'text':_0x37698c['to'](_0x38a014(0x11c))}]},_0x2bd653]}),_0x3ca0c5;}[_0x50edfe(0xfd)](){const _0x72d42f=_0x50edfe,_0x1e064a=new _0x5c39da(this[_0x72d42f(0xe8)]);_0x1e064a[_0x72d42f(0x10d)]({'label':_0x387ca3(this[_0x72d42f(0xe8)],_0x72d42f(0xf5)),'withText':!0x0,'icon':_0x47c923,'class':_0x72d42f(0xed)}),_0x1e064a['on'](_0x72d42f(0xfc),()=>{const _0x2f5f2d=_0x72d42f;this[_0x2f5f2d(0xeb)](_0x2f5f2d(0x118));});const _0x39f8c6=new _0xafab8c(this[_0x72d42f(0xe8)]);return _0x39f8c6[_0x72d42f(0x113)]({'tag':_0x72d42f(0xf1),'attributes':{'class':[_0x72d42f(0xf3),this[_0x72d42f(0x121)]['if'](_0x72d42f(0xfa),_0x72d42f(0xea),_0x38b684=>!_0x38b684)]},'children':[{'tag':'p','attributes':{'class':[_0x72d42f(0xe9)]},'children':[_0x387ca3(this[_0x72d42f(0xe8)],_0x72d42f(0x122))]},_0x1e064a]}),_0x39f8c6;}[_0x50edfe(0xef)](_0x3589ae,_0x4a1d38){const _0x542b9f=_0x50edfe,_0x32c987=[];for(const _0x318d5b of _0x3589ae){const _0x57a58c=new _0x7d5635(_0x4a1d38,_0x318d5b);_0x57a58c[_0x542b9f(0x108)](..._0x540dfd)['to'](this),_0x32c987[_0x542b9f(0x102)](_0x57a58c);}return _0x32c987;}[_0x50edfe(0x111)](_0x3581fb){const _0x37b250=_0x50edfe,_0x4abcd2=this[_0x37b250(0xe8)]||'en',_0xfbc6b8=[];for(const _0x50bb04 of _0x3581fb){const _0x22cf58=this[_0x37b250(0xef)](_0x50bb04[_0x37b250(0xf4)],_0x4abcd2);_0xfbc6b8[_0x37b250(0x102)](new _0x5ec739(_0x4abcd2,{'title':_0x50bb04[_0x37b250(0x12a)],'items':_0x22cf58}));}this[_0x37b250(0x12c)][_0x37b250(0x115)]=_0xfbc6b8,this[_0x37b250(0x12c)][_0x37b250(0xf4)][_0x37b250(0x107)](),this[_0x37b250(0x12c)][_0x37b250(0xf4)][_0x37b250(0x112)](_0xfbc6b8),this[_0x37b250(0x105)]=_0x3581fb[_0x37b250(0xf7)](_0x435e76=>_0x435e76[_0x37b250(0xf4)][_0x37b250(0xd9)]>0x0),this[_0x37b250(0x126)]();}[_0x50edfe(0xe7)](_0xb4178b){const _0x54e910=_0x50edfe;for(const _0x145f39 of this[_0x54e910(0x12c)][_0x54e910(0x115)]){const _0x3613d7=_0x145f39[_0x54e910(0x116)](_0xb4178b);if(_0x3613d7){if(_0x145f39[_0x54e910(0x100)](_0x3613d7),0x0===_0x145f39[_0x54e910(0x10b)][_0x54e910(0xd9)]){const _0x2e3827=this[_0x54e910(0x12c)][_0x54e910(0x115)][_0x54e910(0x127)](_0x145f39);-0x1!==_0x2e3827&&(this[_0x54e910(0x12c)][_0x54e910(0x115)][_0x54e910(0x125)](_0x2e3827,0x1),this[_0x54e910(0x12c)][_0x54e910(0xf4)][_0x54e910(0x11a)](_0x145f39));}this[_0x54e910(0x105)]=this[_0x54e910(0x12c)][_0x54e910(0x115)][_0x54e910(0xd9)]>0x0,this[_0x54e910(0x126)]();break;}}}[_0x50edfe(0x109)](_0x1e5ddb,_0x26522a){const _0x29a7a3=_0x50edfe;for(const _0x27842a of this[_0x29a7a3(0x12c)][_0x29a7a3(0x115)]){const _0x5747e0=_0x27842a[_0x29a7a3(0x116)](_0x1e5ddb);if(_0x5747e0){_0x5747e0[_0x29a7a3(0xec)](_0x26522a);break;}}}[_0x50edfe(0xf8)](_0x4b69fd,_0x2830ce,_0x2ffd15){const _0x4eae86=_0x50edfe;for(const _0x1f27ae of this[_0x4eae86(0x12c)][_0x4eae86(0x115)]){const _0x5343eb=_0x1f27ae[_0x4eae86(0x116)](_0x4b69fd);if(_0x5343eb){_0x5343eb[_0x4eae86(0x130)](_0x2830ce,_0x2ffd15);break;}}}[_0x50edfe(0x126)](){const _0xeacbd6=_0x50edfe;if(this[_0xeacbd6(0x105)]){const _0x22af17=this[_0xeacbd6(0x10e)][_0xeacbd6(0x10f)][_0xeacbd6(0xdb)]?.[_0xeacbd6(0xda)]?.[_0xeacbd6(0xd8)]||'';this[_0xeacbd6(0x10e)][_0xeacbd6(0xf2)](_0x22af17);}}}