@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 10.5 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 _0x13dd39=_0x1a37;(function(_0x8a5a67,_0x1f8bdf){const _0x20c950=_0x1a37,_0x4185ea=_0x8a5a67();while(!![]){try{const _0x4ea11e=-parseInt(_0x20c950(0x1fa))/0x1+parseInt(_0x20c950(0x1f1))/0x2*(parseInt(_0x20c950(0x212))/0x3)+parseInt(_0x20c950(0x22d))/0x4+parseInt(_0x20c950(0x215))/0x5*(-parseInt(_0x20c950(0x1e8))/0x6)+parseInt(_0x20c950(0x1f0))/0x7+-parseInt(_0x20c950(0x220))/0x8+-parseInt(_0x20c950(0x21f))/0x9;if(_0x4ea11e===_0x1f8bdf)break;else _0x4185ea['push'](_0x4185ea['shift']());}catch(_0x4d74ef){_0x4185ea['push'](_0x4185ea['shift']());}}}(_0x1db7,0x933de));import{CKEditorError as _0x44d121,logWarning as _0x2a59dd,scrollViewportToShowTarget as _0x463203}from'ckeditor5/src/utils.js';import{View as _0x719094}from'ckeditor5/src/ui.js';import{AI_CHAT_UI_EVENT_NAMES as _0x45de7d}from'../utils/eventnames.js';import{AIChatFeedSuggestionItemView as _0x5132a3}from'./feed/aichatfeedsuggestionitemview.js';import{AIChatFeedReplyItemView as _0x42857d}from'./feed/aichatfeedreplyitemview.js';import{AIChatFeedUserMessageItemView as _0x18a55d}from'./feed/aichatfeedusermessageitem.js';import{AIChatFeedErrorItemView as _0x1fba7a}from'./feed/aichatfeederroritemview.js';import{AIChatFeedInteractionHeaderView as _0x3b07ca}from'./feed/aichatfeedinteractionheaderview.js';function _0x1db7(){const _0x5ea89d=['aiFeed','toggleLoadingSkeleton','isLoadingSkeletonVisible','_createFeedLoader','bind','_createFeedItems','stopAutoScroll','ai-reply','1710eXycwj','loadingMessage','_setupTemplate','25oqCZJe','ck-ai-chat__feed__items','ai-suggestion-reply','span','bindTemplate','ck-hidden','isPending','setLoadingMessage','delegate','ai-chat-feed-view-item-not-found','2655648ukYLbQ','3821864eLNtjr','getItemIds','destroy','start','clear','createCollection','scrollToSuggestion','remove','setTemplate','removeItem','user-message','element','ck-ai-chat-feed-view-scroll-to-suggestion-invalid-item','2945700PvXOmZ','ck-ai-chat-feed-view-scroll-to-suggestion-part-view-not-found','getItemById','extendTemplate','find','ai-chat-feed-view-item-not-a-suggestion-or-reply-item','locale','ck-ai-chat__loader','map','scrollManager','markAsDone','575202QEqSuh','addItem','isTrackChangesOn','markItemAsDone','updateReplyItem','add','updateSuggestionPartState','children','1519490YcuZhg','4120TpEkYA','stop','_createSkeletonLoader','updateSources','set','ck-ai-chat__loader-text','_createTemplateChildren','updateWebSources','ai-chat-feed-view-item-not-a-suggestion-item','272453zdfQSk','updateSuggestionItem','isVisible','_bodyCollection','getPartView','ck-ai-chat__feed','startAutoScroll','ai-chat-feed-view-item-not-a-reply-item','updatePartState','updateContent','interaction-header','_createLoaderChildren','render','includes','options','div'];_0x1db7=function(){return _0x5ea89d;};return _0x1db7();}import{ScrollManager as _0x4c5172}from'../../aicore/utils/scrollmanager.js';import{AISkeletonView as _0x2df60f,SKELETON_DEFINITIONS as _0x53d832}from'../../aicore/ui/aiskeleton.js';function _0x1a37(_0x3d9b13,_0x3524de){const _0x1db75b=_0x1db7();return _0x1a37=function(_0x1a376f,_0x4cbdf9){_0x1a376f=_0x1a376f-0x1e8;let _0x55412e=_0x1db75b[_0x1a376f];return _0x55412e;},_0x1a37(_0x3d9b13,_0x3524de);}import{AISpinnerView as _0x537639}from'../../aicore/ui/aispinner.js';export class AIChatFeedView extends _0x719094{[_0x13dd39(0x1ef)];[_0x13dd39(0x236)];[_0x13dd39(0x1fd)];constructor(_0x5428f5,_0xf7450f){const _0x2f2aca=_0x13dd39;super(_0x5428f5),this[_0x2f2aca(0x1fd)]=_0xf7450f,this[_0x2f2aca(0x1f5)](_0x2f2aca(0x21b),!0x1),this[_0x2f2aca(0x1f5)](_0x2f2aca(0x213),''),this[_0x2f2aca(0x1f5)](_0x2f2aca(0x20c),!0x1),this[_0x2f2aca(0x1f5)](_0x2f2aca(0x1ea),!0x1),this[_0x2f2aca(0x1ef)]=this[_0x2f2aca(0x225)](),this[_0x2f2aca(0x1ef)][_0x2f2aca(0x21d)](..._0x45de7d)['to'](this),this[_0x2f2aca(0x214)]();}[_0x13dd39(0x206)](){const _0x25ddb4=_0x13dd39;super[_0x25ddb4(0x206)](),this[_0x25ddb4(0x236)]=new _0x4c5172(this[_0x25ddb4(0x22b)]);}[_0x13dd39(0x222)](){const _0x2b463e=_0x13dd39;super[_0x2b463e(0x222)](),this[_0x2b463e(0x236)][_0x2b463e(0x222)]();}[_0x13dd39(0x224)](){const _0x569620=_0x13dd39;this[_0x569620(0x1ef)][_0x569620(0x224)]();}[_0x13dd39(0x1e9)](_0x2a5e21,_0xed5f9e){const _0x58565f=_0x13dd39;let _0x7bfcf6;_0x58565f(0x211)===_0x2a5e21?_0x7bfcf6=new _0x42857d(this[_0x58565f(0x233)],_0xed5f9e):_0x58565f(0x217)===_0x2a5e21?(_0x7bfcf6=new _0x5132a3(this[_0x58565f(0x233)],_0xed5f9e),_0x7bfcf6[_0x58565f(0x20e)](_0x58565f(0x1ea))['to'](this,_0x58565f(0x1ea))):_0x7bfcf6=_0x58565f(0x22a)===_0x2a5e21?new _0x18a55d(this[_0x58565f(0x233)],_0xed5f9e,this[_0x58565f(0x1fd)]):_0x58565f(0x204)===_0x2a5e21?new _0x3b07ca(this[_0x58565f(0x233)],_0xed5f9e):new _0x1fba7a(_0xed5f9e),this[_0x58565f(0x1ef)][_0x58565f(0x1ed)](_0x7bfcf6);}async[_0x13dd39(0x1ec)]({id:_0x90644f,parsedContent:_0x3dd99e,renderingStrategy:_0x2b1737,abortSignal:_0x12e2ca}){const _0xfc258f=_0x13dd39,_0x38a89c=this[_0xfc258f(0x22f)](_0x90644f);if(!(_0x38a89c instanceof _0x42857d))throw new _0x44d121(_0xfc258f(0x201),null,{'itemView':_0x38a89c,'id':_0x90644f,'parsedContent':_0x3dd99e});await _0x38a89c[_0xfc258f(0x203)]({'parsedContent':_0x3dd99e,'renderingStrategy':_0x2b1737,'abortSignal':_0x12e2ca});}async[_0x13dd39(0x1f8)](_0x33a64f,_0x21355b){const _0x88925a=_0x13dd39,_0x4d9379=this[_0x88925a(0x22f)](_0x33a64f);if(_0x4d9379 instanceof _0x5132a3)_0x4d9379[_0x88925a(0x1f4)](_0x21355b);else{if(!(_0x4d9379 instanceof _0x42857d))throw new _0x44d121(_0x88925a(0x232),null,{'itemView':_0x4d9379,'id':_0x33a64f,'sources':_0x21355b});_0x4d9379[_0x88925a(0x1f4)](_0x21355b);}}async[_0x13dd39(0x1fb)]({id:_0xc54955,parts:_0x5d6c27,renderingStrategy:_0x3fed4f,abortSignal:_0x58cbb4}){const _0x3da6bc=_0x13dd39,_0x1f064d=this[_0x3da6bc(0x22f)](_0xc54955);if(!(_0x1f064d instanceof _0x5132a3))throw new _0x44d121(_0x3da6bc(0x1f9),null,{'itemView':_0x1f064d,'id':_0xc54955,'parts':_0x5d6c27});await _0x1f064d[_0x3da6bc(0x203)]({'parts':_0x5d6c27,'renderingStrategy':_0x3fed4f,'abortSignal':_0x58cbb4});}[_0x13dd39(0x1ee)]({id:_0x188a33,index:_0x23aa2a,state:_0x31c170}){const _0x5a758a=_0x13dd39,_0xf4a4c5=this[_0x5a758a(0x22f)](_0x188a33);if(!(_0xf4a4c5 instanceof _0x5132a3))throw new _0x44d121(_0x5a758a(0x1f9),this,{'id':_0x188a33});_0xf4a4c5[_0x5a758a(0x202)](_0x23aa2a,_0x31c170);}[_0x13dd39(0x1eb)](_0x3af7d2){const _0x283c6d=_0x13dd39;this[_0x283c6d(0x22f)](_0x3af7d2)[_0x283c6d(0x237)]();}[_0x13dd39(0x221)](){const _0x668b19=_0x13dd39;return this[_0x668b19(0x1ef)][_0x668b19(0x235)](_0x321864=>_0x321864[_0x668b19(0x208)]['id']);}[_0x13dd39(0x229)](_0x375db2){const _0x1bb829=_0x13dd39;this[_0x1bb829(0x1ef)][_0x1bb829(0x227)](this[_0x1bb829(0x22f)](_0x375db2));}[_0x13dd39(0x226)](_0x5e0940,_0x1ec099){const _0x16d4c6=_0x13dd39,_0xd63fd0=this[_0x16d4c6(0x22f)](_0x5e0940);if(!(_0xd63fd0 instanceof _0x5132a3))return void _0x2a59dd(_0x16d4c6(0x22c),{'replyId':_0x5e0940,'partIndex':_0x1ec099});const _0x4d39db=_0xd63fd0[_0x16d4c6(0x1fe)](_0x1ec099);_0x4d39db?_0x463203({'target':_0x4d39db[_0x16d4c6(0x22b)],'ancestorOffset':0x14,'alignToTop':!0x0,'forceScroll':!0x0}):_0x2a59dd(_0x16d4c6(0x22e),{'replyId':_0x5e0940,'partIndex':_0x1ec099});}[_0x13dd39(0x214)](){const _0x2b01f6=_0x13dd39;this[_0x2b01f6(0x228)]({'tag':_0x2b01f6(0x209),'attributes':{'class':['ck',_0x2b01f6(0x1ff)]},'children':this[_0x2b01f6(0x1f7)]()});}[_0x13dd39(0x1f7)](){const _0x59f4ae=_0x13dd39,_0x17d121=this[_0x59f4ae(0x1f3)]();return[this[_0x59f4ae(0x20f)](),_0x17d121,this[_0x59f4ae(0x20d)]()];}[_0x13dd39(0x1f3)](){const _0x3dc42d=_0x13dd39,_0x337481=new _0x2df60f(this[_0x3dc42d(0x233)],_0x53d832[_0x3dc42d(0x20a)]);return _0x337481[_0x3dc42d(0x230)]({'attributes':{'class':[this[_0x3dc42d(0x219)]['if'](_0x3dc42d(0x20c),_0x3dc42d(0x21a),_0x46aca1=>!_0x46aca1)]}}),_0x337481;}[_0x13dd39(0x20f)](){const _0x1ffa58=_0x13dd39,_0x5195a5=new _0x719094(this[_0x1ffa58(0x233)]);return _0x5195a5[_0x1ffa58(0x228)]({'tag':_0x1ffa58(0x209),'attributes':{'class':['ck',_0x1ffa58(0x216),this[_0x1ffa58(0x219)]['if'](_0x1ffa58(0x20c),_0x1ffa58(0x21a))]},'children':this[_0x1ffa58(0x1ef)]}),_0x5195a5;}[_0x13dd39(0x20d)](){const _0x1477a4=_0x13dd39,_0x36584e=new _0x719094(this[_0x1477a4(0x233)]);return _0x36584e[_0x1477a4(0x228)]({'tag':_0x1477a4(0x209),'attributes':{'class':['ck',_0x1477a4(0x234),this[_0x1477a4(0x219)]['if'](_0x1477a4(0x21b),_0x1477a4(0x21a),_0x5aae90=>!_0x5aae90)]},'children':this[_0x1477a4(0x205)]()}),_0x36584e;}[_0x13dd39(0x205)](){const _0x3df1dd=_0x13dd39,_0x2cd225=new _0x537639();return _0x2cd225[_0x3df1dd(0x1fc)]=!0x0,[_0x2cd225,{'tag':_0x3df1dd(0x218),'attributes':{'class':['ck',_0x3df1dd(0x1f6)]},'children':[{'text':this[_0x3df1dd(0x219)]['to'](_0x3df1dd(0x213))}]}];}[_0x13dd39(0x22f)](_0x5d8118){const _0x51ef58=_0x13dd39,_0x107e6a=this[_0x51ef58(0x1ef)][_0x51ef58(0x231)](_0xab56c9=>_0xab56c9[_0x51ef58(0x208)]['id'][_0x51ef58(0x207)](_0x5d8118));if(!_0x107e6a)throw new _0x44d121(_0x51ef58(0x21e),this,{'id':_0x5d8118});return _0x107e6a;}[_0x13dd39(0x21c)](_0x1fb118){const _0x3fc4be=_0x13dd39;this[_0x3fc4be(0x1f5)](_0x3fc4be(0x213),_0x1fb118);}[_0x13dd39(0x20b)](_0x2fc09a){const _0x17c6c5=_0x13dd39;this[_0x17c6c5(0x1f5)](_0x17c6c5(0x20c),_0x2fc09a);}[_0x13dd39(0x200)](){const _0x3f94d1=_0x13dd39;this[_0x3f94d1(0x236)][_0x3f94d1(0x223)]();}[_0x13dd39(0x210)](){const _0x183bec=_0x13dd39;this[_0x183bec(0x236)][_0x183bec(0x1f2)]();}}