UNPKG

@ckeditor/ckeditor5-ai

Version:

AI features for CKEditor 5.

23 lines 8.87 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 _0x2f4291=_0x44c9;function _0x44c9(_0x3089d2,_0x4cfe0c){const _0xca3c56=_0xca3c();return _0x44c9=function(_0x44c9dc,_0x2befd2){_0x44c9dc=_0x44c9dc-0x14e;let _0x19e59c=_0xca3c56[_0x44c9dc];return _0x19e59c;},_0x44c9(_0x3089d2,_0x4cfe0c);}(function(_0x44a94a,_0x3de9e0){const _0xfbfd99=_0x44c9,_0x3f400a=_0x44a94a();while(!![]){try{const _0x46af3a=-parseInt(_0xfbfd99(0x175))/0x1*(-parseInt(_0xfbfd99(0x185))/0x2)+parseInt(_0xfbfd99(0x18e))/0x3*(parseInt(_0xfbfd99(0x16f))/0x4)+parseInt(_0xfbfd99(0x181))/0x5+-parseInt(_0xfbfd99(0x167))/0x6+-parseInt(_0xfbfd99(0x196))/0x7+parseInt(_0xfbfd99(0x164))/0x8*(-parseInt(_0xfbfd99(0x18d))/0x9)+parseInt(_0xfbfd99(0x172))/0xa;if(_0x46af3a===_0x3de9e0)break;else _0x3f400a['push'](_0x3f400a['shift']());}catch(_0x1f6549){_0x3f400a['push'](_0x3f400a['shift']());}}}(_0xca3c,0x886fd));import{FocusTracker as _0x19992d,KeystrokeHandler as _0x5463e7}from'ckeditor5/src/utils.js';import{ButtonView as _0x266e96,FocusCycler as _0x34d381,LabeledFieldView as _0x8ffdfc,View as _0x251757,FormHeaderView as _0x4a5c42,createLabeledInputText as _0x2c39f2,submitHandler as _0x419fb0}from'ckeditor5/src/ui.js';import{IconCheck as _0x3b198d,IconPreviousArrow as _0x404aab}from'@ckeditor/ckeditor5-icons';import{getTranslation as _0x44b068}from'../../../aicore/utils/common-translations.js';function _0xca3c(){const _0x38e386=['shift+tab','_createUrlInputField','backButton','ck-button-icon\x20ck-button-back','getValue','4584VAdEhV','destroy','fire','4190730DfmCvW','_setupTemplate','urlInputField','div','locale','setError','AI_CHAT_CONTEXT_URL_BACK_TO_CONTEXT','ck-ai-chat-context-controls__url-input-section','18672VRnzVJ','length','forEach','855360jFfTiD','_createConfirmButton','add','9539LSIcWN','input','render','ck-ai-header\x20ck-ai-header_small\x20ck-ai-header_context-url','set','stop','AI_CHAT_CONTEXT_URL_EMPTY_ERROR','AI_CHAT_CONTEXT_URL_ADD_URL','form','focus','AI_CHAT_CONTEXT_URL_INVALID_ERROR','execute','3041165TtSttK','refreshBalloon','_setupKeystrokes','_updateConfirmButtonState','122dIMySf','AI_CHAT_CONTEXT_URL_LABEL','children','esc','_handleSubmit','focusCycler','tab','clearError','81aSZjYO','186HCRREB','errorText','ck-labeled-field-view_empty','submit','ck-ai-chat-context-controls__url-form','isEnabled','_setupEventHandlers','element','2118249HVZIiD','setTemplate','_createBackButton','AI_CHAT_CONTEXT_URL_PLACEHOLDER','_focusables','trim','_isValidUrl','submitUrl','clear','confirmButton','fieldView','keystrokes','focusTracker','value','createCollection','ck-button-icon','listenTo','cancel'];_0xca3c=function(){return _0x38e386;};return _0xca3c();}const ch=_0x2f4291(0x192),nh=_0x2f4291(0x16e);export class AIChatContextPanelUrlInputView extends _0x251757{[_0x2f4291(0x159)];[_0x2f4291(0x158)];[_0x2f4291(0x151)];[_0x2f4291(0x18a)];[_0x2f4291(0x169)];[_0x2f4291(0x161)];[_0x2f4291(0x156)];constructor(_0x130361){const _0x36c367=_0x2f4291;super(_0x130361),this[_0x36c367(0x159)]=new _0x19992d(),this[_0x36c367(0x158)]=new _0x5463e7(),this[_0x36c367(0x161)]=this[_0x36c367(0x14f)](),this[_0x36c367(0x169)]=this[_0x36c367(0x160)](),this[_0x36c367(0x156)]=this[_0x36c367(0x173)](),this[_0x36c367(0x151)]=this[_0x36c367(0x15b)]([this[_0x36c367(0x161)],this[_0x36c367(0x169)],this[_0x36c367(0x156)]]),this[_0x36c367(0x18a)]=new _0x34d381({'focusables':this[_0x36c367(0x151)],'focusTracker':this[_0x36c367(0x159)],'keystrokeHandler':this[_0x36c367(0x158)],'actions':{'focusPrevious':_0x36c367(0x15f),'focusNext':_0x36c367(0x18b)}}),this[_0x36c367(0x168)](),this[_0x36c367(0x194)](),this[_0x36c367(0x183)]();}[_0x2f4291(0x177)](){const _0x2500e9=_0x2f4291;super[_0x2500e9(0x177)](),this[_0x2500e9(0x151)][_0x2500e9(0x171)](_0x4a90d7=>{const _0x1b587c=_0x2500e9;this[_0x1b587c(0x159)][_0x1b587c(0x174)](_0x4a90d7[_0x1b587c(0x195)]),this[_0x1b587c(0x158)][_0x1b587c(0x15d)](_0x4a90d7[_0x1b587c(0x195)]);}),_0x419fb0({'view':this}),this[_0x2500e9(0x17e)]();}[_0x2f4291(0x165)](){const _0x5b2139=_0x2f4291;super[_0x5b2139(0x165)](),this[_0x5b2139(0x159)][_0x5b2139(0x165)](),this[_0x5b2139(0x158)][_0x5b2139(0x165)]();}[_0x2f4291(0x17e)](){const _0x2818bf=_0x2f4291;this[_0x2818bf(0x169)][_0x2818bf(0x17e)]();}[_0x2f4291(0x163)](){const _0x5d31d6=_0x2f4291;return this[_0x5d31d6(0x169)][_0x5d31d6(0x157)][_0x5d31d6(0x195)]?.[_0x5d31d6(0x15a)]?.[_0x5d31d6(0x152)]()||'';}[_0x2f4291(0x155)](){const _0x172337=_0x2f4291;this[_0x172337(0x169)][_0x172337(0x157)][_0x172337(0x195)][_0x172337(0x15a)]='',this[_0x172337(0x169)][_0x172337(0x18f)]=null,this[_0x172337(0x156)][_0x172337(0x193)]=!0x1;}[_0x2f4291(0x16c)](_0x2978f7){const _0x2053e3=_0x2f4291;this[_0x2053e3(0x169)][_0x2053e3(0x18f)]=_0x2978f7,this[_0x2053e3(0x184)](),this[_0x2053e3(0x166)](_0x2053e3(0x182));}[_0x2f4291(0x18c)](){const _0x491d16=_0x2f4291;this[_0x491d16(0x169)][_0x491d16(0x18f)]=null,this[_0x491d16(0x184)]();}[_0x2f4291(0x14f)](){const _0xf0cd19=_0x2f4291,_0xddd2b9=new _0x266e96(this[_0xf0cd19(0x16b)]);return _0xddd2b9[_0xf0cd19(0x179)]({'icon':_0x404aab,'tooltip':_0x44b068(this[_0xf0cd19(0x16b)],_0xf0cd19(0x16d)),'tooltipPosition':'n','class':_0xf0cd19(0x162)}),_0xddd2b9;}[_0x2f4291(0x160)](){const _0x1d19ca=_0x2f4291,_0x1ef6d7=new _0x8ffdfc(this[_0x1d19ca(0x16b)],_0x2c39f2);return _0x1ef6d7[_0x1d19ca(0x179)]({'label':_0x44b068(this[_0x1d19ca(0x16b)],_0x1d19ca(0x186)),'class':_0x1d19ca(0x190)}),_0x1ef6d7[_0x1d19ca(0x157)][_0x1d19ca(0x179)]({'placeholder':_0x44b068(this[_0x1d19ca(0x16b)],_0x1d19ca(0x150))}),_0x1ef6d7;}[_0x2f4291(0x173)](){const _0x29ec43=_0x2f4291,_0x34e4fc=new _0x266e96(this[_0x29ec43(0x16b)]);return _0x34e4fc[_0x29ec43(0x179)]({'icon':_0x3b198d,'tooltip':_0x44b068(this[_0x29ec43(0x16b)],_0x29ec43(0x17c)),'tooltipPosition':'n','class':_0x29ec43(0x15c),'type':_0x29ec43(0x191),'isEnabled':!0x1}),_0x34e4fc;}[_0x2f4291(0x168)](){const _0x485b9d=_0x2f4291,_0x363114=new _0x4a5c42(this[_0x485b9d(0x16b)],{'label':_0x44b068(this[_0x485b9d(0x16b)],_0x485b9d(0x17c)),'class':_0x485b9d(0x178)});_0x363114[_0x485b9d(0x187)][_0x485b9d(0x174)](this[_0x485b9d(0x161)],0x0),this[_0x485b9d(0x14e)]({'tag':_0x485b9d(0x17d),'attributes':{'class':ch,'tabindex':'-1'},'children':[_0x363114,{'tag':_0x485b9d(0x16a),'attributes':{'class':nh},'children':[this[_0x485b9d(0x169)],this[_0x485b9d(0x156)]]}]});}[_0x2f4291(0x194)](){const _0x3e22af=_0x2f4291;this[_0x3e22af(0x161)]['on'](_0x3e22af(0x180),()=>{const _0x54ebcb=_0x3e22af;this[_0x54ebcb(0x155)](),this[_0x54ebcb(0x166)](_0x54ebcb(0x15e));}),this[_0x3e22af(0x169)][_0x3e22af(0x157)]['on'](_0x3e22af(0x176),()=>{const _0x42153a=_0x3e22af;this[_0x42153a(0x18c)](),this[_0x42153a(0x184)](),this[_0x42153a(0x166)](_0x42153a(0x182));}),this['on'](_0x3e22af(0x191),_0x435575=>{const _0x249c95=_0x3e22af;_0x435575[_0x249c95(0x17a)](),this[_0x249c95(0x189)]();});}[_0x2f4291(0x183)](){const _0x3a461d=_0x2f4291;this[_0x3a461d(0x158)][_0x3a461d(0x179)](_0x3a461d(0x188),(_0x564689,_0x2914be)=>{const _0x2f2ef8=_0x3a461d;this[_0x2f2ef8(0x155)](),this[_0x2f2ef8(0x166)](_0x2f2ef8(0x15e)),_0x2914be();});}[_0x2f4291(0x189)](){const _0x346341=_0x2f4291,_0x441f5d=this[_0x346341(0x163)]()[_0x346341(0x152)]();_0x441f5d?this[_0x346341(0x153)](_0x441f5d)?(this[_0x346341(0x18c)](),this[_0x346341(0x166)](_0x346341(0x154),_0x441f5d)):this[_0x346341(0x16c)](_0x44b068(this[_0x346341(0x16b)],_0x346341(0x17f))):this[_0x346341(0x16c)](_0x44b068(this[_0x346341(0x16b)],_0x346341(0x17b)));}[_0x2f4291(0x184)](){const _0x4890fa=_0x2f4291,_0x9ece08=this[_0x4890fa(0x163)]()[_0x4890fa(0x152)](),_0x554c5d=!!this[_0x4890fa(0x169)][_0x4890fa(0x18f)];this[_0x4890fa(0x156)][_0x4890fa(0x193)]=_0x9ece08[_0x4890fa(0x170)]>0x0&&!_0x554c5d;}[_0x2f4291(0x153)](_0x2d1f37){try{return!!new URL(_0x2d1f37);}catch{return!0x1;}}}