UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

24 lines • 12.8 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 _0x336957=_0x3556;(function(_0x22423f,_0x1c2d4e){const _0x27e7cb=_0x3556,_0x2c2d24=_0x22423f();while(!![]){try{const _0x4c33bd=parseInt(_0x27e7cb(0x1de))/0x1*(-parseInt(_0x27e7cb(0x201))/0x2)+parseInt(_0x27e7cb(0x1fa))/0x3*(-parseInt(_0x27e7cb(0x1eb))/0x4)+-parseInt(_0x27e7cb(0x1f8))/0x5*(-parseInt(_0x27e7cb(0x1f0))/0x6)+parseInt(_0x27e7cb(0x1fe))/0x7*(parseInt(_0x27e7cb(0x1ef))/0x8)+-parseInt(_0x27e7cb(0x1c7))/0x9+-parseInt(_0x27e7cb(0x1b7))/0xa+parseInt(_0x27e7cb(0x1d1))/0xb*(parseInt(_0x27e7cb(0x206))/0xc);if(_0x4c33bd===_0x1c2d4e)break;else _0x2c2d24['push'](_0x2c2d24['shift']());}catch(_0x351e42){_0x2c2d24['push'](_0x2c2d24['shift']());}}}(_0x178d,0xdc820));import{ListItemView as _0x4185b0,HighlightedTextView as _0x250a26,ButtonView as _0x48ce43,ListView as _0x22c36f,IconView as _0x550ced,createDropdown as _0x12bb3e,InputTextView as _0x560db7}from'ckeditor5/src/ui.js';import{IconThreeHorizontalDots as _0x5b1dac,IconPin as _0x5430c9,IconCheck as _0x4d49f3,IconCancel as _0x71bbc7}from'ckeditor5/src/icons.js';import{LateFocusDropdownButtonView as _0x597acc,ConfirmMixin as _0x14d9d2}from'ckeditor5-collaboration/src/collaboration-core.js';import{escape as _0x1fa06a}from'es-toolkit/compat';import{AISpinnerView as _0xaa70d1}from'../../aicore/ui/aispinner.js';import{getTranslation as _0x351914}from'../../aicore/utils/common-translations.js';export class AIChatHistoryListItemView extends/* #__PURE__ -- @preserve */ _0x14d9d2(_0x4185b0){['id'];static [_0x336957(0x1fc)]={'remove':_0x336957(0x204),'rename':_0x336957(0x1f4),'pin':_0x336957(0x1b5),'unpin':_0x336957(0x212)};[_0x336957(0x208)];[_0x336957(0x1e2)];[_0x336957(0x20f)];constructor(_0x3c4e0a,_0x16d0bd){const _0x8ff64d=_0x336957;super(_0x3c4e0a);const _0x276c52=this[_0x8ff64d(0x1f6)];this[_0x8ff64d(0x20a)](_0x8ff64d(0x1fb),!0x1),this[_0x8ff64d(0x20a)](_0x8ff64d(0x1ca),!0x0),this[_0x8ff64d(0x20a)](_0x8ff64d(0x1da),!!_0x16d0bd[_0x8ff64d(0x1da)]),this[_0x8ff64d(0x20a)](_0x8ff64d(0x1f7),null),this['id']=_0x16d0bd['id'];const {title:_0x5dbc6d,createdAt:_0x53c4f7,active:_0x52ec3d=!0x1}=_0x16d0bd;this[_0x8ff64d(0x20f)]=new _0x250a26(),this[_0x8ff64d(0x20f)][_0x8ff64d(0x205)]=_0x5dbc6d,this[_0x8ff64d(0x20f)][_0x8ff64d(0x1ce)]({'attributes':{'class':[_0x8ff64d(0x1d6)]}});const _0x53c5e9=this[_0x8ff64d(0x1cb)](),_0x2b56cc=this[_0x8ff64d(0x1bc)](_0x3c4e0a),_0x2630d3=this[_0x8ff64d(0x1e0)](),_0x4a931c=this[_0x8ff64d(0x1e1)](_0x3c4e0a,_0x5dbc6d),_0x3ec5dd=this[_0x8ff64d(0x1d0)](_0x3c4e0a,_0x4a931c),_0x3dcd98=this[_0x8ff64d(0x20d)](_0x3c4e0a,_0x4a931c);this[_0x8ff64d(0x208)]=this[_0x8ff64d(0x1c3)](),this[_0x8ff64d(0x1e2)]=this[_0x8ff64d(0x1c3)](),this[_0x8ff64d(0x1e2)][_0x8ff64d(0x1cf)](this[_0x8ff64d(0x20f)]),this[_0x8ff64d(0x208)][_0x8ff64d(0x1cf)](_0x2b56cc),this[_0x8ff64d(0x208)][_0x8ff64d(0x1cf)](_0x2630d3),this['on'](_0x8ff64d(0x1c9),(_0x5c4160,_0xb684c9,_0x466895)=>{const _0x230661=_0x8ff64d;this[_0x230661(0x208)][_0x230661(0x214)](),this[_0x230661(0x1e2)][_0x230661(0x214)](),_0x466895?(this[_0x230661(0x208)][_0x230661(0x1cf)](_0x3ec5dd),this[_0x230661(0x208)][_0x230661(0x1cf)](_0x3dcd98),this[_0x230661(0x1e2)][_0x230661(0x1cf)](_0x4a931c),_0x4a931c[_0x230661(0x1cd)][_0x230661(0x1e9)]()):(this[_0x230661(0x208)][_0x230661(0x1cf)](_0x2b56cc),this[_0x230661(0x208)][_0x230661(0x1cf)](_0x2630d3),this[_0x230661(0x1e2)][_0x230661(0x1cf)](this[_0x230661(0x20f)]));}),this[_0x8ff64d(0x1c2)]({'tag':'li','attributes':{'class':[_0x8ff64d(0x1c0),_0x52ec3d?_0x8ff64d(0x1e4):'',_0x276c52['if'](_0x8ff64d(0x1ca),_0x8ff64d(0x207),_0x5e9458=>!_0x5e9458),_0x276c52['if'](_0x8ff64d(0x1fb),_0x8ff64d(0x1c5))],'role':_0x8ff64d(0x20c)},'children':[{'tag':_0x8ff64d(0x213),'attributes':{'class':[_0x8ff64d(0x1ba)]},'children':[{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x1e7),_0x276c52['if'](_0x8ff64d(0x1f7),_0x8ff64d(0x207),_0x3f2224=>!!_0x3f2224)]},'children':_0x52ec3d?[_0x53c5e9]:[]},{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x1fd),_0x276c52['if'](_0x8ff64d(0x1f7),_0x8ff64d(0x207),_0xcc26f0=>!_0xcc26f0)]},'children':[this[_0x8ff64d(0x1c4)]()]}]},{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x1d5)]},'children':[{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x20e)]},'on':{'click':this[_0x8ff64d(0x1f6)]['to'](_0x8ff64d(0x1ed))},'children':[{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x1c1)]},'children':[{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x1d6),_0x276c52['if'](_0x8ff64d(0x1f7),_0x8ff64d(0x207),_0x50aa2c=>!!_0x50aa2c)]},'children':this[_0x8ff64d(0x1e2)]},{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x209),_0x276c52['if'](_0x8ff64d(0x1f7),_0x8ff64d(0x207),_0x158f1e=>!_0x158f1e)]},'children':[{'text':_0x276c52['to'](_0x8ff64d(0x1f7),_0x129234=>_0x129234?_0x351914(this[_0x8ff64d(0x1bb)],AIChatHistoryListItemView[_0x8ff64d(0x1fc)][_0x129234]):'')}]}]},{'tag':_0x8ff64d(0x213),'attributes':{'class':[_0x8ff64d(0x200)]},'children':[_0x53c4f7]}]},{'tag':_0x8ff64d(0x1d3),'attributes':{'class':[_0x8ff64d(0x211)]},'children':this[_0x8ff64d(0x208)]}]}]}),this['on'](_0x8ff64d(0x1ed),()=>{const _0x210df5=_0x8ff64d;this[_0x210df5(0x1fb)]||this[_0x210df5(0x216)](_0x210df5(0x215),{'id':this['id']});});}[_0x336957(0x1b4)](_0x2be7d7){const _0x309178=_0x336957;this[_0x309178(0x20f)][_0x309178(0x205)]=_0x1fa06a(_0x2be7d7);}[_0x336957(0x203)](_0x7e8f15,_0x3ad67e){const _0x43a2be=_0x336957;this[_0x43a2be(0x20a)](_0x43a2be(0x1f7),_0x3ad67e?_0x7e8f15:null);}[_0x336957(0x1cb)](){const _0x38af5c=_0x336957,_0xe8f632=new _0x550ced();return _0xe8f632[_0x38af5c(0x20a)]({'content':_0x4d49f3}),_0xe8f632;}[_0x336957(0x1bc)](_0x54b7bf){const _0x3c50d0=_0x336957,_0x530f44=new _0x48ce43(_0x54b7bf);return _0x530f44[_0x3c50d0(0x20a)]({'label':_0x351914(_0x54b7bf,_0x3c50d0(0x1c8)),'icon':_0x5430c9,'withText':!0x1,'tooltip':!0x0}),_0x530f44[_0x3c50d0(0x1db)](_0x3c50d0(0x1f2))['to'](this,_0x3c50d0(0x1da)),_0x530f44['on'](_0x3c50d0(0x1be),()=>{const _0x258ed4=_0x3c50d0,_0x117b94=!this[_0x258ed4(0x1da)];this[_0x258ed4(0x216)](_0x258ed4(0x210),{'id':this['id'],'pinned':_0x117b94});}),_0x530f44;}[_0x336957(0x1e0)](){const _0x27f13b=_0x336957,_0x56e145=_0x12bb3e(this[_0x27f13b(0x1bb)],_0x597acc),_0x5f3293=_0x56e145[_0x27f13b(0x1ff)][_0x27f13b(0x1b8)];_0x56e145[_0x27f13b(0x1f9)][_0x27f13b(0x20a)]({'label':_0x351914(this[_0x27f13b(0x1bb)],_0x27f13b(0x1dc)),'icon':_0x5b1dac}),_0x56e145[_0x27f13b(0x1ea)]='sw';const _0x1e97af=new _0x48ce43(this[_0x27f13b(0x1bb)]);_0x1e97af[_0x27f13b(0x1bf)]=_0x351914(this[_0x27f13b(0x1bb)],_0x27f13b(0x20b)),_0x1e97af[_0x27f13b(0x1e3)]=!0x0,_0x1e97af['on'](_0x27f13b(0x1be),()=>{const _0x5a0ce2=_0x27f13b;this[_0x5a0ce2(0x1fb)]=!0x0;});const _0x591add=new _0x48ce43(this[_0x27f13b(0x1bb)]);_0x591add[_0x27f13b(0x1bf)]=_0x351914(this[_0x27f13b(0x1bb)],_0x27f13b(0x1f3)),_0x591add[_0x27f13b(0x1e3)]=!0x0,_0x591add['on'](_0x27f13b(0x1be),()=>{const _0x3791b5=_0x27f13b;this[_0x3791b5(0x1c6)](_0x351914(this[_0x3791b5(0x1bb)],_0x3791b5(0x1d4)),this[_0x3791b5(0x1cd)])[_0x3791b5(0x1f1)](()=>{const _0x329d19=_0x3791b5;this[_0x329d19(0x216)](_0x329d19(0x1d9),{'id':this['id']});});});const _0x2c464d=new _0x22c36f(this[_0x27f13b(0x1bb)]),_0x5c4245=new _0x4185b0(this[_0x27f13b(0x1bb)]);_0x5c4245[_0x27f13b(0x1b8)][_0x27f13b(0x1cf)](_0x1e97af);const _0x3968e4=new _0x4185b0(this[_0x27f13b(0x1bb)]);return _0x3968e4[_0x27f13b(0x1b8)][_0x27f13b(0x1cf)](_0x591add),_0x2c464d[_0x27f13b(0x1dd)][_0x27f13b(0x1d8)]([_0x5c4245,_0x3968e4]),_0x5f3293[_0x27f13b(0x1cf)](_0x2c464d),_0x56e145;}[_0x336957(0x1e1)](_0x232969,_0x10c2cf){const _0x1986b8=_0x336957,_0x3865b2=new _0x560db7(_0x232969),_0x145b38=_0x3865b2[_0x1986b8(0x1f6)];return _0x3865b2[_0x1986b8(0x1ee)]=_0x10c2cf,_0x3865b2[_0x1986b8(0x1ce)]({'on':{'keydown':_0x145b38['to'](_0x21b4c4=>{const _0x29a247=_0x1986b8;_0x29a247(0x1e6)==_0x21b4c4[_0x29a247(0x1b9)]&&this[_0x29a247(0x1bd)](_0x3865b2);})}}),_0x3865b2;}[_0x336957(0x1d0)](_0x156077,_0x2d9739){const _0xe3b2a7=_0x336957,_0xbe3cb=new _0x48ce43(_0x156077);return _0xbe3cb[_0xe3b2a7(0x20a)]({'icon':_0x4d49f3,'withText':!0x1,'tooltip':_0x351914(_0x156077,_0xe3b2a7(0x1f5))}),_0xbe3cb[_0xe3b2a7(0x1ce)]({'attributes':{'class':[_0xe3b2a7(0x1df)]}}),_0xbe3cb['on'](_0xe3b2a7(0x1be),()=>{const _0x43af47=_0xe3b2a7;this[_0x43af47(0x1bd)](_0x2d9739);}),_0xbe3cb;}[_0x336957(0x1bd)](_0x4586ec){const _0x2b3f1b=_0x336957,_0x22a4ba=_0x4586ec[_0x2b3f1b(0x1cd)][_0x2b3f1b(0x1ee)]||'';this[_0x2b3f1b(0x20f)][_0x2b3f1b(0x205)]=_0x22a4ba,this[_0x2b3f1b(0x1fb)]=!0x1,this[_0x2b3f1b(0x216)](_0x2b3f1b(0x1b6),{'id':this['id'],'title':_0x22a4ba});}[_0x336957(0x20d)](_0x2941f6,_0x236be8){const _0x3fc3f9=_0x336957,_0xdb1942=new _0x48ce43(_0x2941f6);return _0xdb1942[_0x3fc3f9(0x20a)]({'icon':_0x71bbc7,'withText':!0x1,'tooltip':_0x351914(_0x2941f6,_0x3fc3f9(0x1cc))}),_0xdb1942[_0x3fc3f9(0x1ce)]({'attributes':{'class':[_0x3fc3f9(0x1e8)]}}),_0xdb1942['on'](_0x3fc3f9(0x1be),()=>{const _0x5db4c4=_0x3fc3f9;this[_0x5db4c4(0x1fb)]=!0x1,_0x236be8[_0x5db4c4(0x1ee)]=this[_0x5db4c4(0x20f)][_0x5db4c4(0x205)]||'',this[_0x5db4c4(0x216)](_0x5db4c4(0x1d2));}),_0xdb1942;}[_0x336957(0x1c4)](){const _0x26afd4=_0x336957,_0x321533=new _0xaa70d1(_0x26afd4(0x202));return _0x321533[_0x26afd4(0x1ca)]=!0x0,_0x321533;}[_0x336957(0x1d7)](_0x1f2a1f){const _0x998d64=_0x336957;return this[_0x998d64(0x20f)]&&_0x998d64(0x217)==typeof this[_0x998d64(0x20f)][_0x998d64(0x205)]&&this[_0x998d64(0x20f)][_0x998d64(0x205)][_0x998d64(0x1ec)](_0x1f2a1f)?{'title':!0x0}:null;}[_0x336957(0x1e5)](_0x1bf875){const _0x8c89a2=_0x336957;this[_0x8c89a2(0x20f)][_0x8c89a2(0x1e5)](_0x1bf875);}}function _0x3556(_0x16e65d,_0x47ec06){const _0x178deb=_0x178d();return _0x3556=function(_0x3556de,_0x1bee75){_0x3556de=_0x3556de-0x1b4;let _0x2c2628=_0x178deb[_0x3556de];return _0x2c2628;},_0x3556(_0x16e65d,_0x47ec06);}function _0x178d(){const _0xde75e3=['1764452lqeedi','match','click','value','136nUxHOG','6373404ThzblP','then','isOn','AI_CHAT_HISTORY_REMOVE','AI_CHAT_HISTORY_LOADING_RENAMING','AI_CHAT_HISTORY_ACCEPT','bindTemplate','loadingState','5ZJrMem','buttonView','9qwDeLp','isEdit','LOADING_LABELS','ck-ai-loader','567217ekDjGd','panelView','ck-ai-chat-history__item-date','3218ybrJem','tiny','updateLoadingState','AI_CHAT_HISTORY_LOADING_REMOVING','text','3144564GPwOor','ck-hidden','actions','ck-ai-loader__text','set','AI_CHAT_HISTORY_EDIT_NAME','listitem','_createCancelEditButtonView','ck-ai-chat-history__item-content','_titleView','setConversationPinned','ck-ai-chat-history__item-actions','AI_CHAT_HISTORY_LOADING_UNPINNING','span','clear','selectConversation','fire','string','updateTitle','AI_CHAT_HISTORY_LOADING_PINNING','editConversationTitle','16027710VmabYD','children','key','ck-ai-chat-history__item-check-container','locale','_createPinButtonView','_commitEditInputValue','execute','label','ck-ai-chat-history__item','ck-ai-chat-history__item-main-content','setTemplate','createCollection','_createSpinnerView','ck-ai-chat-history__item--edit','showConfirm','10083681YidnwV','AI_CHAT_HISTORY_PIN_BUTTON','change:isEdit','isVisible','_createCheckView','AI_CHAT_HISTORY_CANCEL','element','extendTemplate','add','_createAcceptEditButtonView','165xLbFdf','edit:cancel','div','AI_CHAT_HISTORY_REMOVE_CONFIRM','ck-ai-chat-history__item-row','ck-ai-chat-history__item-title','isMatching','addMany','removeConversation','pinned','bind','AI_CHAT_HISTORY_SHOW_MORE_ITEMS','items','883hDgHMm','ck-confirm-view-submit','_createMenuDropdownView','_createEditInputView','mainContent','withText','ck-ai-chat-history__item--active','highlightText','Enter','ck-ai-chat-history__item-check','ck-confirm-view-cancel','focus','panelPosition'];_0x178d=function(){return _0xde75e3;};return _0x178d();}