UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

23 lines • 12.2 kB
/* * 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 _0xd54c3d=_0x5ccc;(function(_0x3f5684,_0x6fdd06){const _0x3c38c4=_0x5ccc,_0x5bea67=_0x3f5684();while(!![]){try{const _0x3cfd57=parseInt(_0x3c38c4(0xb0))/0x1+parseInt(_0x3c38c4(0xd8))/0x2+parseInt(_0x3c38c4(0xe5))/0x3+parseInt(_0x3c38c4(0xad))/0x4+-parseInt(_0x3c38c4(0xb5))/0x5+parseInt(_0x3c38c4(0xc9))/0x6+-parseInt(_0x3c38c4(0xc6))/0x7;if(_0x3cfd57===_0x6fdd06)break;else _0x5bea67['push'](_0x5bea67['shift']());}catch(_0x45ca44){_0x5bea67['push'](_0x5bea67['shift']());}}}(_0x2354,0x40329));import{ContextPlugin as _0x50c1e7}from'ckeditor5/src/core.js';function _0x5ccc(_0x10c65a,_0x3f9dfd){const _0x23544b=_0x2354();return _0x5ccc=function(_0x5ccc12,_0x5b5da6){_0x5ccc12=_0x5ccc12-0xad;let _0x3b3191=_0x23544b[_0x5ccc12];return _0x3b3191;},_0x5ccc(_0x10c65a,_0x3f9dfd);}import{AIConnector as _0x113d92}from'../aicore/aiconnector.js';import{AIChatController as _0x209753}from'../aichat/aichatcontroller.js';import{AITabs as _0x2583dc}from'../aitabs/aitabs.js';import{AIChatHistoryUI as _0x3239a7}from'./aichathistoryui.js';import{AIChatHistoryConversations as _0x4014f1}from'./model/aichathistoryconversations.js';import{getTranslation as _0x32edd9}from'../aicore/utils/common-translations.js';export class AIChatHistoryController extends _0x50c1e7{[_0xd54c3d(0xef)];[_0xd54c3d(0xff)];[_0xd54c3d(0xe9)];static get[_0xd54c3d(0xd6)](){return[_0x113d92,_0x209753,_0x3239a7,_0x2583dc];}static get[_0xd54c3d(0xb6)](){const _0x2b9de0=_0xd54c3d;return _0x2b9de0(0xfb);}static get[_0xd54c3d(0x100)](){return!0x0;}static get[_0xd54c3d(0xfe)](){return!0x0;}[_0xd54c3d(0xbd)](){const _0x4c99d3=_0xd54c3d;this[_0x4c99d3(0xef)]=this[_0x4c99d3(0xc1)][_0x4c99d3(0xcd)][_0x4c99d3(0xd7)](_0x113d92),this[_0x4c99d3(0xff)]=this[_0x4c99d3(0xc1)][_0x4c99d3(0xcd)][_0x4c99d3(0xd7)](_0x3239a7),this[_0x4c99d3(0xe9)]=this[_0x4c99d3(0xc1)][_0x4c99d3(0xcd)][_0x4c99d3(0xd7)](_0x209753);const _0x5cdb96=this[_0x4c99d3(0xc1)][_0x4c99d3(0xcd)][_0x4c99d3(0xd7)](_0x2583dc);try{const _0x5eb5d4=this[_0x4c99d3(0xe9)][_0x4c99d3(0x104)]();this[_0x4c99d3(0xf4)]=new _0x4014f1({'connector':this[_0x4c99d3(0xef)],'group':_0x5eb5d4}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xff)],_0x4c99d3(0xba),(_0x4662f7,_0x3a23e9)=>{const _0x16e4c9=_0x4c99d3;this[_0x16e4c9(0xc5)](_0x3a23e9['id'],_0x16e4c9(0xb2)),this[_0x16e4c9(0xc4)](_0x3a23e9['id']);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xff)],_0x4c99d3(0xc0),(_0x272965,_0x364058)=>{const _0x3cc04a=_0x4c99d3;this[_0x3cc04a(0xc5)](_0x364058['id'],_0x3cc04a(0xbf)),this[_0x3cc04a(0xf7)](_0x364058['id'],_0x364058[_0x3cc04a(0xe2)]);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xf4)],_0x4c99d3(0xf2),(_0x22a87e,_0x3b2dfb)=>{const _0x23b383=_0x4c99d3;void 0x0!==_0x3b2dfb[_0x23b383(0xb8)][_0x23b383(0xe2)]&&this[_0x23b383(0xff)][_0x23b383(0xf0)](_0x3b2dfb[_0x23b383(0xc2)],_0x3b2dfb[_0x23b383(0xb8)][_0x23b383(0xe2)]),void 0x0!==_0x3b2dfb[_0x23b383(0xb8)][_0x23b383(0x10f)]&&this[_0x23b383(0xca)](),this[_0x23b383(0x10e)](_0x3b2dfb[_0x23b383(0xc2)]);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xf4)],_0x4c99d3(0xeb),(_0x195bd7,_0x4272cc)=>{const _0xd85bc3=_0x4c99d3;this[_0xd85bc3(0xe9)][_0xd85bc3(0xc7)](_0x4272cc[_0xd85bc3(0xc2)]),this[_0xd85bc3(0xff)][_0xd85bc3(0xe3)](_0x4272cc[_0xd85bc3(0xc2)]),this[_0xd85bc3(0x10e)](_0x4272cc[_0xd85bc3(0xc2)]);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xf4)],_0x4c99d3(0xed),()=>{const _0x2ea5b6=_0x4c99d3;this[_0x2ea5b6(0xca)]();}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xf4)],_0x4c99d3(0xe4),(_0x358896,_0x1303bb)=>{const _0x5bb0f2=_0x4c99d3;this[_0x5bb0f2(0x107)](_0x1303bb[_0x5bb0f2(0xe4)],_0x1303bb[_0x5bb0f2(0xb1)],_0x1303bb[_0x5bb0f2(0xc2)]);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xff)],_0x4c99d3(0x101),(_0x2b808e,_0x51fccf)=>{const _0x4a1d18=_0x4c99d3;this[_0x4a1d18(0xe6)](_0x51fccf['id']);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xff)],_0x4c99d3(0xbe),(_0xc29da8,_0x246351)=>{const _0x2079a8=_0x4c99d3,_0x40c08f=_0x246351[_0x2079a8(0x10f)]?_0x2079a8(0xf5):_0x2079a8(0xd0);this[_0x2079a8(0xc5)](_0x246351['id'],_0x40c08f),this[_0x2079a8(0xda)](_0x246351['id'],_0x246351[_0x2079a8(0x10f)]);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xff)],_0x4c99d3(0xb7),()=>{const _0x40a7d9=_0x4c99d3;_0x5cdb96[_0x40a7d9(0xaf)][_0x40a7d9(0xd9)](_0x40a7d9(0x10b));}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xe9)],_0x4c99d3(0xde),()=>{const _0x44a830=_0x4c99d3;this[_0x44a830(0xca)]();}),_0x5cdb96[_0x4c99d3(0xaf)]['on'](_0x4c99d3(0xcb),()=>{const _0x2c8b7b=_0x4c99d3;this[_0x2c8b7b(0xee)]();}),this[_0x4c99d3(0xbb)](_0x5cdb96,_0x4c99d3(0xd2),(_0x4f24cf,_0x1b7724)=>{const _0x572a4c=_0x4c99d3;this[_0x572a4c(0xe0)](_0x1b7724);}),this[_0x4c99d3(0xbb)](this[_0x4c99d3(0xff)],_0x4c99d3(0xb9),()=>{const _0x4146da=_0x4c99d3;_0x5cdb96[_0x4146da(0x108)]();});}catch(_0x2ce03d){this[_0x4c99d3(0x107)](_0x2ce03d,_0x4c99d3(0xbd));}}async[_0xd54c3d(0xf7)](_0x54f6c8,_0x2d8a06){const _0x28f87a=_0xd54c3d;await this[_0x28f87a(0xf4)][_0x28f87a(0xf0)](_0x54f6c8,_0x2d8a06);}async[_0xd54c3d(0xda)](_0x6c90c,_0x11d398){const _0x4b022a=_0xd54c3d;await this[_0x4b022a(0xf4)][_0x4b022a(0xd4)](_0x6c90c,_0x11d398);}async[_0xd54c3d(0xc4)](_0x30e790){const _0x17dbd3=_0xd54c3d;await this[_0x17dbd3(0xf4)][_0x17dbd3(0xe8)](_0x30e790);}async[_0xd54c3d(0xe6)](_0x569e02){const _0x58b864=_0xd54c3d;await this[_0x58b864(0xe9)][_0x58b864(0xe1)](_0x569e02);}async[_0xd54c3d(0xee)](){const _0x1f9e5e=_0xd54c3d;this[_0x1f9e5e(0xff)][_0x1f9e5e(0x103)](''),this[_0x1f9e5e(0xff)][_0x1f9e5e(0xf1)](!0x0),await this[_0x1f9e5e(0xf4)][_0x1f9e5e(0xbd)](),this[_0x1f9e5e(0xff)][_0x1f9e5e(0xf1)](!0x1);}[_0xd54c3d(0xca)](){const _0xf18e0a=_0xd54c3d,_0x474bb7=this[_0xf18e0a(0xe9)][_0xf18e0a(0xfc)]?.['id'],_0x45a0d3=this[_0xf18e0a(0xdc)]()[_0xf18e0a(0xdb)](_0x25a5ce=>({'title':_0x25a5ce[_0xf18e0a(0xe2)],'items':_0x25a5ce[_0xf18e0a(0xcf)][_0xf18e0a(0xdb)](_0x36b1ec=>({'id':_0x36b1ec['id'],'title':_0x36b1ec[_0xf18e0a(0xe2)]||_0x32edd9(this[_0xf18e0a(0xc1)][_0xf18e0a(0xcc)],_0xf18e0a(0xf3)),'createdAt':new Date(_0x36b1ec[_0xf18e0a(0xf8)])[_0xf18e0a(0xea)](),'active':_0x36b1ec['id']===_0x474bb7,'pinned':_0x36b1ec[_0xf18e0a(0x10f)]}))}));this[_0xf18e0a(0xff)][_0xf18e0a(0xe7)](_0x45a0d3);}[_0xd54c3d(0xc5)](_0x26d98c,_0xf046ef){const _0x6f4903=_0xd54c3d;this[_0x6f4903(0xff)][_0x6f4903(0xd3)](_0x26d98c,_0xf046ef,!0x0);}[_0xd54c3d(0x10e)](_0xafc03){const _0x6f15c0=_0xd54c3d;this[_0x6f15c0(0xff)][_0x6f15c0(0xd3)](_0xafc03,null,!0x1);}[_0xd54c3d(0x107)](_0x22ec6b,_0x4524ae,_0x43ba86){const _0x14e2d4=_0xd54c3d,_0x2b2568=this[_0x14e2d4(0xb4)](_0x4524ae,_0x43ba86);this[_0x14e2d4(0xff)][_0x14e2d4(0x103)](_0x2b2568),_0x43ba86&&this[_0x14e2d4(0x10e)](_0x43ba86),this[_0x14e2d4(0xff)][_0x14e2d4(0xf1)](!0x1);}[_0xd54c3d(0xb4)](_0x1e4fc1,_0x301a94){const _0x283b9c=_0xd54c3d,_0x1e3eb5=_0x301a94?this[_0x283b9c(0xf4)][_0x283b9c(0xae)](_0x301a94):null,_0x4e1a96=_0x1e3eb5?.[_0x283b9c(0xe2)]||_0x32edd9(this[_0x283b9c(0xc1)][_0x283b9c(0xcc)],_0x283b9c(0xf3));switch(_0x1e4fc1){case _0x283b9c(0xf0):return _0x32edd9(this[_0x283b9c(0xc1)][_0x283b9c(0xcc)],_0x283b9c(0xf6),_0x4e1a96);case _0x283b9c(0xd4):{const _0x31adeb=_0x32edd9(this[_0x283b9c(0xc1)][_0x283b9c(0xcc)],_0x1e3eb5?.[_0x283b9c(0x10f)]?_0x283b9c(0x10c):_0x283b9c(0x10a));return _0x32edd9(this[_0x283b9c(0xc1)][_0x283b9c(0xcc)],_0x283b9c(0xd1),[_0x31adeb,_0x4e1a96]);}case _0x283b9c(0xe8):return _0x32edd9(this[_0x283b9c(0xc1)][_0x283b9c(0xcc)],_0x283b9c(0xb3),_0x4e1a96);case _0x283b9c(0xbd):case _0x283b9c(0x109):return _0x32edd9(this[_0x283b9c(0xc1)][_0x283b9c(0xcc)],_0x283b9c(0x102));default:return _0x32edd9(this[_0x283b9c(0xc1)][_0x283b9c(0xcc)],_0x283b9c(0xec));}}[_0xd54c3d(0xdc)](){const _0x3fd500=_0xd54c3d,_0x2ac828=new Date(),_0x9050b3=new Date(_0x2ac828[_0x3fd500(0x105)](),_0x2ac828[_0x3fd500(0xbc)](),_0x2ac828[_0x3fd500(0xdd)]()),_0x5f3e36=new Date(_0x9050b3);_0x5f3e36[_0x3fd500(0x106)](_0x5f3e36[_0x3fd500(0xdd)]()-0x1);const _0x6f92d=new Date(_0x9050b3);_0x6f92d[_0x3fd500(0x106)](_0x6f92d[_0x3fd500(0xdd)]()-0xe);const _0x1f013d=this[_0x3fd500(0xf4)][_0x3fd500(0xc3)]({'pinned':!0x0}),_0x12b105=this[_0x3fd500(0xf4)][_0x3fd500(0xc3)]({'from':_0x9050b3,'to':_0x9050b3}),_0x1c8b86=this[_0x3fd500(0xf4)][_0x3fd500(0xc3)]({'from':_0x5f3e36,'to':_0x5f3e36}),_0x44ac59=this[_0x3fd500(0xf4)][_0x3fd500(0xc3)]({'from':_0x6f92d,'to':_0x5f3e36}),_0x358855=this[_0x3fd500(0xf4)][_0x3fd500(0xc3)]({'to':_0x6f92d}),_0x5f2893=[];return _0x1f013d[_0x3fd500(0xc8)]>0x0&&_0x5f2893[_0x3fd500(0xf9)]({'title':_0x32edd9(this[_0x3fd500(0xc1)][_0x3fd500(0xcc)],_0x3fd500(0xfa)),'items':_0x1f013d}),_0x12b105[_0x3fd500(0xc8)]>0x0&&_0x5f2893[_0x3fd500(0xf9)]({'title':_0x32edd9(this[_0x3fd500(0xc1)][_0x3fd500(0xcc)],_0x3fd500(0xce)),'items':_0x12b105}),_0x1c8b86[_0x3fd500(0xc8)]>0x0&&_0x5f2893[_0x3fd500(0xf9)]({'title':_0x32edd9(this[_0x3fd500(0xc1)][_0x3fd500(0xcc)],_0x3fd500(0xfd)),'items':_0x1c8b86}),_0x44ac59[_0x3fd500(0xc8)]>0x0&&_0x5f2893[_0x3fd500(0xf9)]({'title':_0x32edd9(this[_0x3fd500(0xc1)][_0x3fd500(0xcc)],_0x3fd500(0xd5)),'items':_0x44ac59}),_0x358855[_0x3fd500(0xc8)]>0x0&&_0x5f2893[_0x3fd500(0xf9)]({'title':_0x32edd9(this[_0x3fd500(0xc1)][_0x3fd500(0xcc)],_0x3fd500(0x10d)),'items':_0x358855}),_0x5f2893;}[_0xd54c3d(0xe0)](_0x29a743){const _0x4ab860=_0xd54c3d;this[_0x4ab860(0xff)][_0x4ab860(0xdf)](_0x29a743);}}function _0x2354(){const _0x33798b=['view','1493pIQQwI','operation','remove','AI_CHAT_HISTORY_ERROR_REMOVE_ITEM','_generateErrorMessage','2098595sqrZEx','pluginName','openChat','updates','resizeTabs','removeConversation','listenTo','getMonth','init','setConversationPinned','rename','editConversationTitle','context','itemId','getItems','_handleRemove','_setItemLoading','2564912UgzFLN','handleRemovedConversation','length','626652gjPdGS','_updateHistoryItemsUI','activateTab:history','locale','plugins','AI_CHAT_HISTORY_CATEGORY_TODAY','items','unpin','AI_CHAT_HISTORY_ERROR_UPDATE_PINNED','resizedTabs','updateItemLoadingState','updateItemPinned','AI_CHAT_HISTORY_CATEGORY_LAST_14_DAYS','requires','get','883236qHAUTX','activateTab','_handleTogglePin','map','_getCategorizedItems','getDate','change:activeConversation','setIsMaximized','_setIsMaximized','loadConversation','title','removeHistoryItem','error','1091760UgPkBK','_handleSelectConversation','updateItems','removeItem','_aiChatController','toLocaleDateString','itemRemoved','AI_CHAT_HISTORY_ERROR_GENERIC','itemsLoaded','_showConversationHistory','_aiConnector','updateItemTitle','setLoadingSkeleton','itemUpdated','AI_CHAT_UNTITLED_CONVERSATION','history','pin','AI_CHAT_HISTORY_ERROR_UPDATE_TITLE','_handleEditTitle','createdAt','push','AI_CHAT_HISTORY_CATEGORY_PINNED','AIChatHistoryController','activeConversation','AI_CHAT_HISTORY_CATEGORY_YESTERDAY','isPremiumPlugin','_aiChatHistoryUi','isOfficialPlugin','selectConversation','AI_CHAT_HISTORY_ERROR_LOAD_ITEMS','showError','getGroupId','getFullYear','setDate','_handleHistoryErrorUI','resize','loadItems','AI_CHAT_HISTORY_PIN_ACTION','chat','AI_CHAT_HISTORY_UNPIN_ACTION','AI_CHAT_HISTORY_CATEGORY_LATER','_clearItemLoading','pinned','550460oZykHD','getItem'];_0x2354=function(){return _0x33798b;};return _0x2354();}