@ckeditor/ckeditor5-ai
Version:
AI features for CKEditor 5.
23 lines • 11 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. |
* | |
* | |
* +---------------------------------------------------------------------------------+
*
*
*
*
*/
function _0x3242(_0x13aad0,_0x4f6e05){const _0x19b780=_0x19b7();return _0x3242=function(_0x3242a5,_0x52e486){_0x3242a5=_0x3242a5-0x6b;let _0xff5a22=_0x19b780[_0x3242a5];return _0xff5a22;},_0x3242(_0x13aad0,_0x4f6e05);}const _0x482c40=_0x3242;(function(_0x34e323,_0x12bcaa){const _0x1e462c=_0x3242,_0x18d665=_0x34e323();while(!![]){try{const _0x50f6db=parseInt(_0x1e462c(0xbe))/0x1+-parseInt(_0x1e462c(0x9a))/0x2*(-parseInt(_0x1e462c(0x8b))/0x3)+-parseInt(_0x1e462c(0xad))/0x4*(parseInt(_0x1e462c(0x93))/0x5)+parseInt(_0x1e462c(0x83))/0x6*(parseInt(_0x1e462c(0xb7))/0x7)+parseInt(_0x1e462c(0xc6))/0x8*(parseInt(_0x1e462c(0xab))/0x9)+parseInt(_0x1e462c(0x6b))/0xa+-parseInt(_0x1e462c(0x87))/0xb*(parseInt(_0x1e462c(0x7e))/0xc);if(_0x50f6db===_0x12bcaa)break;else _0x18d665['push'](_0x18d665['shift']());}catch(_0x439411){_0x18d665['push'](_0x18d665['shift']());}}}(_0x19b7,0xf2d8c));function _0x19b7(){const _0x12d095=['10332BlFMey','insertSuggestion','stopAutoScroll','AI_BALLOON_NEXT_TOOLTIP','isErrorVisible','222hXEkIB','_getScrollableElement','start','bodyView','37598RBaIKI','createCollection','view','destroy','12399ThbrZi','_addContentView','clear','set','startAutoScroll','AI_BALLOON_PREVIOUS_TOOLTIP','_errorView','showRecoverableError','60DCiKUf','setLoading','isTrackChangesOn','focusCycler','ck-hidden','change:isTrackChangesOn','clearLoading','418gQDXKP','stop','applyButton','keystrokes','showBlockingError','focus','setupRotator','_dialogContent','ck-ai-suggestion__error-text','remove','add','_addToolbar','suggestButton','div','_createNextButtonView','_createErrorView','showPrevious','16173DSroNl','children','213232gETjyT','addMany','isLoading','locale','getIndex','_initializeScrollManager','element','errorMessage','hideError','mainView','344365uTzajX','headerView','applySuggestion','scrollManager','ai-balloon-content','_availableActions','isEnabled','599116ouUsve','bindTemplate','setTemplate','execute','focusTracker','listenTo','_mainView','_addDisclaimerView','2872QpleTw','render','showApplyButton','6490430jzVSxk','ai-balloon-error','bind','showSuggestButton','includes','tab','toolbar','focusFirst','updateContent','disclaimerView','showNext','focusLast','showError','_focusables','fire','_createPreviousButtonView','span','shift\x20+\x20tab','ck-ai-suggestion__error'];_0x19b7=function(){return _0x12d095;};return _0x19b7();}import{ButtonView as _0x7d3814,View as _0x5ed552,ViewCollection as _0x24b545,FocusCycler as _0x1113e0}from'ckeditor5/src/ui.js';import{FocusTracker as _0x1b84ff,KeystrokeHandler as _0x3985f1}from'ckeditor5/src/utils.js';import{IconNextArrow as _0x1c0761,IconPreviousArrow as _0x3bad8c}from'@ckeditor/ckeditor5-icons';import{AIBalloonToolbarView as _0x29622d}from'./aiballoontoolbarview.js';import{AIBalloonDisclaimerView as _0x39ebb7}from'./aiballoondisclaimerview.js';import{getTranslation as _0x4aebde}from'../../aicore/utils/common-translations.js';import{ScrollManager as _0x39c572}from'../../aicore/utils/scrollmanager.js';import{AISuggestionContainerView as _0x3c9056}from'../../aicore/ui/suggestioncontainer/aisuggestioncontainerview.js';export const AI_BALLOON_VIEW_EVENT_NAMES=[_0x482c40(0xb9),_0x482c40(0x7f),_0x482c40(0x75),_0x482c40(0xaa)];export class AIBalloonView extends _0x5ed552{[_0x482c40(0xc2)];[_0x482c40(0x9d)];[_0x482c40(0x96)];[_0x482c40(0xbc)];[_0x482c40(0x78)];[_0x482c40(0x91)];[_0x482c40(0xba)];constructor(_0x35c24d,_0x1b7625,_0x3f831c,_0x1492e2){const _0x1534b0=_0x482c40;super(_0x35c24d),this[_0x1534b0(0xbc)]=_0x3f831c,this[_0x1534b0(0x8e)](_0x1534b0(0xaf),!0x1),this[_0x1534b0(0x8e)](_0x1534b0(0x95),_0x1492e2),this[_0x1534b0(0x8e)](_0x1534b0(0x82),!0x1),this[_0x1534b0(0x8e)](_0x1534b0(0xb4),''),this[_0x1534b0(0xc2)]=new _0x1b84ff(),this[_0x1534b0(0x9d)]=new _0x3985f1(),this[_0x1534b0(0x78)]=this[_0x1534b0(0x88)](),this[_0x1534b0(0x96)]=new _0x1113e0({'focusables':this[_0x1534b0(0x78)],'focusTracker':this[_0x1534b0(0xc2)],'keystrokeHandler':this[_0x1534b0(0x9d)],'actions':{'focusPrevious':_0x1534b0(0x7c),'focusNext':_0x1534b0(0x70)}}),this[_0x1534b0(0xa1)]=new _0x24b545(),this[_0x1534b0(0x8c)](_0x1b7625[_0x1534b0(0xb6)]),this[_0x1534b0(0xc5)](),this[_0x1534b0(0xa5)](_0x1b7625[_0x1534b0(0xc8)],_0x1b7625[_0x1534b0(0x6e)]),this[_0x1534b0(0x71)][_0x1534b0(0x6d)](_0x1534b0(0xaf))['to'](this),this[_0x1534b0(0x78)][_0x1534b0(0x8d)](),this[_0x1534b0(0x78)][_0x1534b0(0xae)]([this[_0x1534b0(0x71)]]),this[_0x1534b0(0xc0)]({'tag':_0x1534b0(0xa7),'attributes':{'class':_0x1534b0(0xbb)},'children':this[_0x1534b0(0xa1)]}),this['on'](_0x1534b0(0x98),()=>{const _0x201c35=_0x1534b0;this[_0x201c35(0xa1)][_0x201c35(0xa3)](this[_0x201c35(0x71)]),this[_0x201c35(0xa5)](_0x1b7625[_0x201c35(0xc8)],_0x1b7625[_0x201c35(0x6e)]);});}[_0x482c40(0xc7)](){const _0x56e548=_0x482c40;super[_0x56e548(0xc7)]();for(const _0x40974b of this[_0x56e548(0x78)])this[_0x56e548(0xc2)][_0x56e548(0xa4)](_0x40974b[_0x56e548(0xb3)]);this[_0x56e548(0x9d)][_0x56e548(0xc3)](this[_0x56e548(0xb3)]),this[_0x56e548(0xb2)]();}[_0x482c40(0x8a)](){const _0x7076db=_0x482c40;super[_0x7076db(0x8a)](),this[_0x7076db(0xba)]&&this[_0x7076db(0xba)][_0x7076db(0x8a)]();}[_0x482c40(0x9f)](_0x8177a2){const _0x1f75be=_0x482c40;-0x1===_0x8177a2?this[_0x1f75be(0x96)][_0x1f75be(0x76)]():this[_0x1f75be(0x96)][_0x1f75be(0x72)]();}[_0x482c40(0x94)](){const _0x2194d4=_0x482c40;this[_0x2194d4(0xaf)]=!0x0;}[_0x482c40(0x99)](){const _0xc03a55=_0x482c40;this[_0xc03a55(0xaf)]=!0x1;}[_0x482c40(0x77)](_0x26e84e){const _0x585c1d=_0x482c40;this[_0x585c1d(0x91)]||(this[_0x585c1d(0x91)]=this[_0x585c1d(0xa9)](),this[_0x585c1d(0xa1)][_0x585c1d(0xae)]([this[_0x585c1d(0x91)]],0x0)),this[_0x585c1d(0xb4)]=_0x26e84e,this[_0x585c1d(0x82)]=!0x0;}[_0x482c40(0xb5)](){const _0x38718a=_0x482c40;this[_0x38718a(0x82)]=!0x1;}[_0x482c40(0x92)](_0x4a547d){const _0x29432d=_0x482c40;this[_0x29432d(0x77)](_0x4a547d);}[_0x482c40(0x9e)](_0x18d3b9){const _0x1efc02=_0x482c40;this[_0x1efc02(0x77)](_0x18d3b9),this[_0x1efc02(0x71)]&&(this[_0x1efc02(0x71)][_0x1efc02(0x9c)]&&(this[_0x1efc02(0x71)][_0x1efc02(0x9c)][_0x1efc02(0xbd)]=!0x1),this[_0x1efc02(0x71)][_0x1efc02(0xa6)]&&(this[_0x1efc02(0x71)][_0x1efc02(0xa6)][_0x1efc02(0xbd)]=!0x1));}[_0x482c40(0xa0)](_0x52534c){const _0x54e3e2=_0x482c40,_0x4b77ce=this[_0x54e3e2(0xa8)](),_0x556b20=this[_0x54e3e2(0x7a)]();_0x52534c[_0x54e3e2(0x89)][_0x54e3e2(0xb8)][_0x54e3e2(0xac)][_0x54e3e2(0xa4)](_0x4b77ce,0x2),_0x52534c[_0x54e3e2(0x89)][_0x54e3e2(0xb8)][_0x54e3e2(0xac)][_0x54e3e2(0xa4)](_0x556b20,0x0),this[_0x54e3e2(0x78)][_0x54e3e2(0xae)]([_0x4b77ce,_0x556b20]),this[_0x54e3e2(0xc2)][_0x54e3e2(0xa4)](_0x4b77ce[_0x54e3e2(0xb3)]),this[_0x54e3e2(0xc2)][_0x54e3e2(0xa4)](_0x556b20[_0x54e3e2(0xb3)]);}[_0x482c40(0x8c)](_0x481fcb){const _0x3bbb9c=_0x482c40;this[_0x3bbb9c(0xc4)]=_0x481fcb,this[_0x3bbb9c(0xa1)][_0x3bbb9c(0xa4)](this[_0x3bbb9c(0xc4)]);}[_0x482c40(0x73)](_0x44c253){const _0x427cef=_0x482c40,_0x4d874=this[_0x427cef(0xa1)][_0x427cef(0xb1)](this[_0x427cef(0xc4)]);this[_0x427cef(0xa1)][_0x427cef(0xa3)](this[_0x427cef(0xc4)]),this[_0x427cef(0xc4)]=_0x44c253,this[_0x427cef(0xa1)][_0x427cef(0xa4)](this[_0x427cef(0xc4)],_0x4d874),this[_0x427cef(0xb5)](),this[_0x427cef(0xba)]&&this[_0x427cef(0xba)][_0x427cef(0x8a)](),this[_0x427cef(0xb2)]();}[_0x482c40(0xc5)](){const _0x3d01ac=_0x482c40;this[_0x3d01ac(0x74)]=new _0x39ebb7(this[_0x3d01ac(0xb0)]),this[_0x3d01ac(0xa1)][_0x3d01ac(0xa4)](this[_0x3d01ac(0x74)]);}[_0x482c40(0xa5)](_0x1f16df=!0x0,_0x426be1=!0x0){const _0x5eb897=_0x482c40;_0x1f16df=_0x1f16df&&!this[_0x5eb897(0x95)]&&this[_0x5eb897(0xbc)][_0x5eb897(0x6f)](_0x5eb897(0xb9)),_0x426be1=_0x426be1&&this[_0x5eb897(0xbc)][_0x5eb897(0x6f)](_0x5eb897(0x7f)),this[_0x5eb897(0x71)]=new _0x29622d(this[_0x5eb897(0xb0)],_0x1f16df,_0x426be1),this[_0x5eb897(0x71)][_0x5eb897(0x9c)]?.['on'](_0x5eb897(0xc1),()=>{const _0x503bd3=_0x5eb897;this[_0x503bd3(0x79)](_0x503bd3(0xb9));}),this[_0x5eb897(0x71)][_0x5eb897(0xa6)]?.['on'](_0x5eb897(0xc1),()=>{const _0x37217d=_0x5eb897;this[_0x37217d(0x79)](_0x37217d(0x7f));}),this[_0x5eb897(0xa1)][_0x5eb897(0xa4)](this[_0x5eb897(0x71)]);}[_0x482c40(0xa8)](){const _0x36c14f=_0x482c40,_0x5b4e34=new _0x7d3814(this[_0x36c14f(0xb0)]);return _0x5b4e34[_0x36c14f(0x8e)]({'icon':_0x1c0761,'tooltip':_0x4aebde(this[_0x36c14f(0xb0)],_0x36c14f(0x81))}),_0x5b4e34['on'](_0x36c14f(0xc1),()=>{const _0x10957c=_0x36c14f;this[_0x10957c(0x79)](_0x10957c(0x75));}),_0x5b4e34;}[_0x482c40(0x7a)](){const _0x174721=_0x482c40,_0x2944b2=new _0x7d3814(this[_0x174721(0xb0)]);return _0x2944b2[_0x174721(0x8e)]({'icon':_0x3bad8c,'tooltip':_0x4aebde(this[_0x174721(0xb0)],_0x174721(0x90))}),_0x2944b2['on'](_0x174721(0xc1),()=>{const _0x169f9e=_0x174721;this[_0x169f9e(0x79)](_0x169f9e(0xaa));}),_0x2944b2;}[_0x482c40(0xa9)](){const _0x3deb7d=_0x482c40,_0x1cbfd4=new _0x5ed552(this[_0x3deb7d(0xb0)]),_0x34a7a7=new _0x5ed552(this[_0x3deb7d(0xb0)]);return _0x34a7a7[_0x3deb7d(0xc0)]({'tag':_0x3deb7d(0x7b),'attributes':{'class':['ck',_0x3deb7d(0xa2)]},'children':[{'text':this[_0x3deb7d(0xbf)]['to'](_0x3deb7d(0xb4))}]}),_0x1cbfd4[_0x3deb7d(0xc0)]({'tag':_0x3deb7d(0xa7),'attributes':{'class':['ck',_0x3deb7d(0x7d),_0x3deb7d(0x6c),this[_0x3deb7d(0xbf)]['if'](_0x3deb7d(0x82),_0x3deb7d(0x97),_0x62180c=>!_0x62180c)]},'children':[_0x34a7a7]}),_0x1cbfd4;}[_0x482c40(0x8f)](){const _0x414a2a=_0x482c40;this[_0x414a2a(0xb2)](),this[_0x414a2a(0xba)]&&this[_0x414a2a(0xba)][_0x414a2a(0x85)]();}[_0x482c40(0x80)](){const _0x59ed08=_0x482c40;this[_0x59ed08(0xba)]&&this[_0x59ed08(0xba)][_0x59ed08(0x9b)]();}[_0x482c40(0xb2)](){const _0x4f0747=_0x482c40,_0x53894c=this[_0x4f0747(0x84)]();_0x53894c&&!this[_0x4f0747(0xba)]&&(this[_0x4f0747(0xba)]=new _0x39c572(_0x53894c));}[_0x482c40(0x84)](){const _0x2d65a9=_0x482c40;return this[_0x2d65a9(0xc4)]instanceof _0x3c9056&&this[_0x2d65a9(0xc4)][_0x2d65a9(0x86)][_0x2d65a9(0xb3)]?this[_0x2d65a9(0xc4)][_0x2d65a9(0x86)][_0x2d65a9(0xb3)]:null;}}