import { NotificationService, SearchComponent } from '@alauda/ui';
import { HttpParams } from '@angular/common/http';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, Output, TemplateRef, ViewChild, } from '@angular/core';
import { encode } from 'ab64';
import { debounce } from 'lodash-es';
import { combineLatest, Subject, take } from 'rxjs';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
import { SearchAddon } from 'xterm-addon-search';
import { ApiGatewayService } from '../../api/public-api';
import { AuthorizationStateService } from '../../authorization/public-api';
import { TranslateService } from '../../translate/public-api';
import { ConnectionStatus, TERMINAL_THEME_LOCAL_STORAGE_KEY, XTERM_DARK_THEME, XTERM_DEFAULT_OPTIONS, XTERM_LIGHT_THEME, } from '../constants';
import * as i0 from "@angular/core";
import * as i1 from "../../api/public-api";
import * as i2 from "../../authorization/public-api";
import * as i3 from "@alauda/ui";
import * as i4 from "../../translate/public-api";
const _c0 = ["anchor"];
const _c1 = ["searchInput"];
function TerminalComponent_aui_inline_alert_0_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "aui-inline-alert", 17)(1, "span");
    i0.ɵɵtext(2);
    i0.ɵɵpipe(3, "translate");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "button", 18);
    i0.ɵɵlistener("click", function TerminalComponent_aui_inline_alert_0_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r6); const ctx_r5 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r5.reconnect()); });
    i0.ɵɵtext(5);
    i0.ɵɵpipe(6, "translate");
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(3, 2, "exec_disconnected_tip"));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(6, 4, "reconnect"), " ");
} }
function TerminalComponent_div_22_Template(rf, ctx) { if (rf & 1) {
    const _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 19)(1, "aui-search", 20, 21);
    i0.ɵɵlistener("keywordChange", function TerminalComponent_div_22_Template_aui_search_keywordChange_1_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r8 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r8.searchKeyword = $event); })("keydown", function TerminalComponent_div_22_Template_aui_search_keydown_1_listener($event) { i0.ɵɵrestoreView(_r9); const ctx_r10 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r10.onSearchInputKeyDown($event)); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "button", 22);
    i0.ɵɵlistener("click", function TerminalComponent_div_22_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r9); const ctx_r11 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r11.findPrevious()); });
    i0.ɵɵpipe(4, "translate");
    i0.ɵɵelement(5, "aui-icon", 23);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(6, "button", 22);
    i0.ɵɵlistener("click", function TerminalComponent_div_22_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r9); const ctx_r12 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r12.findNext()); });
    i0.ɵɵpipe(7, "translate");
    i0.ɵɵelement(8, "aui-icon", 24);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(9, "button", 22);
    i0.ɵɵlistener("click", function TerminalComponent_div_22_Template_button_click_9_listener() { i0.ɵɵrestoreView(_r9); const ctx_r13 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r13.closeSearching()); });
    i0.ɵɵpipe(10, "translate");
    i0.ɵɵelement(11, "aui-icon", 25);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("keyword", ctx_r2.searchKeyword);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("square", true)("plain", true)("title", i0.ɵɵpipeBind1(4, 10, "find_previous") + " (Shift + Enter)");
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("square", true)("plain", true)("title", i0.ɵɵpipeBind1(7, 12, "find_next") + " (Enter)");
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("square", true)("plain", true)("title", i0.ɵɵpipeBind1(10, 14, "close") + " (Escape)");
} }
function TerminalComponent_ng_container_23_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
const _c2 = function (a0, a1, a2) { return { $implicit: a0, socket: a1, index: a2 }; };
export const BIN_SH = '/bin/sh';
export const AUTO_SCRIPT_COMMENT = '# !!auto-script!!';
/**
 * For dispatching keyboard events automatically to xterm,
 * please view https://www.physics.udel.edu/~watson/scen103/ascii.html for reference.
 *
 * For instance, if you want to dispatch `Ctrl+C` to xterm, you should dispatch `\x03`(aka `\u0003`) to the socket.
 *
 * ```ts
 * socket.send('0' + encode('\u0003'))
 * ```
 */
export class TerminalComponent {
    constructor(apiGateway, authState, notification, translate, cdr) {
        this.apiGateway = apiGateway;
        this.authState = authState;
        this.notification = notification;
        this.translate = translate;
        this.cdr = cdr;
        this.ConnectionStatus = ConnectionStatus;
        this.connectionStatusChange = new EventEmitter();
        this.sendData = new EventEmitter();
        this.socketReady = new EventEmitter();
        this.fallbackShell = new EventEmitter();
        this.theme = localStorage.getItem(TERMINAL_THEME_LOCAL_STORAGE_KEY) === 'light'
            ? 'light'
            : 'dark';
        this.searching = false;
        this.searchKeyword = '';
        this.coding = 'utf8';
        this.commandHasRun = false;
        this.socket$$ = new Subject();
    }
    ngOnChanges() {
        if (this.xterm) {
            this.reconnect();
        }
    }
    ngAfterViewInit() {
        this.initXterm();
    }
    ngOnDestroy() {
        this.closeSocket();
        this.xterm?.dispose();
    }
    focus() {
        this.xterm?.focus();
    }
    reconnect() {
        this.closeSocket();
        this.initSocketConnection();
    }
    switchTheme() {
        this.theme = this.theme === 'light' ? 'dark' : 'light';
        localStorage.setItem(TERMINAL_THEME_LOCAL_STORAGE_KEY, this.theme);
        this.xterm.options.theme =
            this.theme === 'light' ? XTERM_LIGHT_THEME : XTERM_DARK_THEME;
        this.cdr.markForCheck();
    }
    openSearching() {
        this.searching = true;
        requestAnimationFrame(() => {
            this.searchInputRef.focus();
        });
    }
    closeSearching() {
        this.searching = false;
        this.searchKeyword = '';
        this.xterm?.focus();
    }
    onShellKeyDown(event) {
        if ((event.metaKey || event.ctrlKey) && event.code === 'KeyF') {
            this.openSearching();
            event.preventDefault();
            event.stopPropagation();
        }
    }
    onSearchInputKeyDown(event) {
        if (event.code === 'Escape') {
            this.closeSearching();
            event.preventDefault();
            event.stopPropagation();
        }
        else if (event.code === 'Enter') {
            if (event.shiftKey) {
                this.findPrevious();
            }
            else {
                this.findNext();
            }
            event.preventDefault();
            event.stopPropagation();
        }
    }
    findNext() {
        this.searchAddon.findNext(this.searchKeyword);
    }
    findPrevious() {
        this.searchAddon.findPrevious(this.searchKeyword);
    }
    initXterm() {
        this.xterm = new Terminal({
            ...XTERM_DEFAULT_OPTIONS,
            theme: this.theme === 'light' ? XTERM_LIGHT_THEME : XTERM_DARK_THEME,
        });
        this.xterm.loadAddon(this.initSearchAddon());
        this.xterm.loadAddon(this.initFitAddon());
        this.xterm.open(this.anchorRef.nativeElement);
        this.xterm.onData((data) => {
            if (this.connectionStatus === ConnectionStatus.Connected) {
                this.commandHasRun = true;
                this.socket.send('0' + encode(data));
                this.sendData.emit(data);
            }
        });
        this.xterm.onSelectionChange(() => {
            const selection = this.xterm.getSelection();
            navigator.clipboard?.writeText(selection);
        });
        this.initSocketConnection();
    }
    initFitAddon() {
        const fitAddon = new FitAddon();
        const resizeObserver = new ResizeObserver(debounce(([entry]) => {
            if (entry.contentRect.width !== 0) {
                fitAddon.fit();
                this.resizeRemoteTerminal();
            }
        }, 200));
        resizeObserver.observe(this.anchorRef.nativeElement);
        return fitAddon;
    }
    initSearchAddon() {
        this.searchAddon = new SearchAddon();
        return this.searchAddon;
    }
    initSocketConnection(fallbackCommand) {
        this.updateConnectionStatus(ConnectionStatus.Connecting);
        this.xterm.clear();
        this.xterm.write('Connecting...\r\n');
        combineLatest([this.apiGateway.getApiAddress(), this.authState.getToken()])
            .pipe(take(1))
            .subscribe(([apiAddress, accessToken]) => {
            if (this.socket) {
                this.socket.close();
            }
            const { cluster, namespace, pod, container, user = 'root', } = this.option;
            const initialCommand = fallbackCommand || this.option.command || BIN_SH;
            const command = user === 'root'
                ? initialCommand.split(' ')
                : ['sh', '-c', `su -p ${user} -c "${initialCommand}"`];
            this.socket = new WebSocket(apiAddress.replace(/^http/, 'ws') +
                `/kubernetes/${cluster}/api/v1/namespaces/${namespace}/pods/${pod}/exec?${new HttpParams({
                    fromObject: {
                        'access-token': accessToken,
                        stdin: true,
                        stdout: true,
                        stderr: true,
                        tty: true,
                        container,
                        command,
                    },
                }).toString()}`, ['base64.channel.k8s.io']);
            this.socket.addEventListener('open', () => {
                this.updateConnectionStatus(ConnectionStatus.Connected);
                this.resizeRemoteTerminal();
                this.xterm.clear();
                this.xterm.focus();
                this.socketReady.emit(this.socket);
                this.socket$$.next(this.socket);
                this.ping = window.setInterval(() => {
                    this.socket.send('0');
                }, 5000);
            });
            let lastText;
            this.socket.addEventListener('message', (event) => {
                const text = decode(this.coding, event.data.slice(1));
                if (lastText?.includes(AUTO_SCRIPT_COMMENT) ||
                    text.includes(AUTO_SCRIPT_COMMENT)) {
                    lastText = text;
                    return;
                }
                this.xterm.write(text);
            });
            this.socket.addEventListener('close', () => {
                this.closeSocket();
                if (!this.commandHasRun && initialCommand !== BIN_SH) {
                    this.fallbackShell.emit(BIN_SH);
                    this.initSocketConnection(BIN_SH);
                    this.notification.warning(this.translate.get('unsupported_exec_command_warning'));
                }
            });
        });
    }
    closeSocket() {
        if (this.connectionStatus === ConnectionStatus.Connecting) {
            this.xterm.clear();
        }
        clearInterval(this.ping);
        this.socket?.close();
        this.socket = null;
        this.socket$$.next(this.socket);
        this.updateConnectionStatus(ConnectionStatus.Disconnected);
    }
    // https://github.com/kubernetes-ui/container-terminal/blob/ba560d4f715f405beb0a64bab8fb29a21aac2671/container-terminal.js#L152
    resizeRemoteTerminal() {
        if (this.connectionStatus === ConnectionStatus.Connected) {
            this.socket.send(`4${encode(JSON.stringify({ Width: this.xterm.cols, Height: this.xterm.rows }))}`);
        }
    }
    updateConnectionStatus(status) {
        this.connectionStatus = status;
        this.connectionStatusChange.emit(status);
        this.cdr.markForCheck();
    }
}
TerminalComponent.ɵfac = function TerminalComponent_Factory(t) { return new (t || TerminalComponent)(i0.ɵɵdirectiveInject(i1.ApiGatewayService), i0.ɵɵdirectiveInject(i2.AuthorizationStateService), i0.ɵɵdirectiveInject(i3.NotificationService), i0.ɵɵdirectiveInject(i4.TranslateService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
TerminalComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TerminalComponent, selectors: [["acl-terminal"]], viewQuery: function TerminalComponent_Query(rf, ctx) { if (rf & 1) {
        i0.ɵɵviewQuery(_c0, 5);
        i0.ɵɵviewQuery(_c1, 5);
    } if (rf & 2) {
        let _t;
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.anchorRef = _t.first);
        i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.searchInputRef = _t.first);
    } }, inputs: { option: "option", index: "index", extraContent: "extraContent" }, outputs: { connectionStatusChange: "connectionStatusChange", sendData: "sendData", socketReady: "socketReady", fallbackShell: "fallbackShell" }, features: [i0.ɵɵNgOnChangesFeature], decls: 31, vars: 29, consts: [["type", "error", 4, "ngIf"], [1, "acl-terminal__wrapper"], [1, "acl-terminal"], [1, "acl-terminal__header"], [1, "acl-terminal__button", 3, "auiDropdown", "auiDropdownClass"], ["icon", "angle_down"], [1, "acl-terminal__button", 3, "click"], ["icon", "search_s"], [3, "icon"], [1, "acl-terminal__shell", 3, "keydown"], [1, "acl-terminal__anchor"], ["anchor", ""], ["class", "acl-terminal__finding", 4, "ngIf"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], ["size", "small"], ["codingMenu", ""], [3, "actived", "click"], ["type", "error"], ["aui-button", "text", 3, "click"], [1, "acl-terminal__finding"], ["size", "small", 3, "keyword", "keywordChange", "keydown"], ["searchInput", ""], ["aui-button", "text", "size", "mini", 3, "square", "plain", "title", "click"], ["icon", "arrow", 2, "transform", "rotate(-90deg)"], ["icon", "arrow", 2, "transform", "rotate(90deg)"], ["icon", "close"]], template: function TerminalComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, TerminalComponent_aui_inline_alert_0_Template, 7, 6, "aui-inline-alert", 0);
        i0.ɵɵelementStart(1, "div", 1)(2, "div", 2)(3, "div", 3)(4, "div", 4)(5, "span");
        i0.ɵɵtext(6);
        i0.ɵɵpipe(7, "translate");
        i0.ɵɵelementEnd();
        i0.ɵɵelement(8, "aui-icon", 5);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(9, "div", 6);
        i0.ɵɵlistener("click", function TerminalComponent_Template_div_click_9_listener() { return ctx.openSearching(); });
        i0.ɵɵelement(10, "aui-icon", 7);
        i0.ɵɵelementStart(11, "span");
        i0.ɵɵtext(12);
        i0.ɵɵpipe(13, "translate");
        i0.ɵɵelementEnd()();
        i0.ɵɵelementStart(14, "div", 6);
        i0.ɵɵlistener("click", function TerminalComponent_Template_div_click_14_listener() { return ctx.switchTheme(); });
        i0.ɵɵelement(15, "aui-icon", 8);
        i0.ɵɵelementStart(16, "span");
        i0.ɵɵtext(17);
        i0.ɵɵpipe(18, "translate");
        i0.ɵɵelementEnd()()();
        i0.ɵɵelementStart(19, "div", 9);
        i0.ɵɵlistener("keydown", function TerminalComponent_Template_div_keydown_19_listener($event) { return ctx.onShellKeyDown($event); });
        i0.ɵɵelement(20, "div", 10, 11);
        i0.ɵɵtemplate(22, TerminalComponent_div_22_Template, 12, 16, "div", 12);
        i0.ɵɵelementEnd()();
        i0.ɵɵtemplate(23, TerminalComponent_ng_container_23_Template, 1, 0, "ng-container", 13);
        i0.ɵɵpipe(24, "async");
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(25, "aui-menu", 14, 15)(27, "aui-menu-item", 16);
        i0.ɵɵlistener("click", function TerminalComponent_Template_aui_menu_item_click_27_listener() { return ctx.coding = "utf8"; });
        i0.ɵɵtext(28, "UTF-8 ");
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(29, "aui-menu-item", 16);
        i0.ɵɵlistener("click", function TerminalComponent_Template_aui_menu_item_click_29_listener() { return ctx.coding = "gb18030"; });
        i0.ɵɵtext(30, "GB 18030 ");
        i0.ɵɵelementEnd()();
    } if (rf & 2) {
        const _r4 = i0.ɵɵreference(26);
        i0.ɵɵproperty("ngIf", ctx.connectionStatus === ctx.ConnectionStatus.Disconnected);
        i0.ɵɵadvance(2);
        i0.ɵɵclassProp("acl-terminal--dark", ctx.theme === "dark")("acl-terminal--light", ctx.theme === "light");
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("auiDropdown", _r4)("auiDropdownClass", "acl-terminal__dropdown " + (ctx.theme === "light" ? "acl-terminal__dropdown--light" : "acl-terminal__dropdown--dark"));
        i0.ɵɵadvance(2);
        i0.ɵɵtextInterpolate2("", ctx.coding === "utf8" ? "UTF-8" : ctx.coding === "gb18030" ? "GB 18030" : ctx.coding.toUpperCase(), " ", i0.ɵɵpipeBind1(7, 17, "decoding"), "");
        i0.ɵɵadvance(6);
        i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(13, 19, "find"));
        i0.ɵɵadvance(3);
        i0.ɵɵproperty("icon", ctx.theme === "light" ? "sun" : "moon");
        i0.ɵɵadvance(2);
        i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(18, 21, ctx.theme === "light" ? "light_theme" : "dark_theme"));
        i0.ɵɵadvance(5);
        i0.ɵɵproperty("ngIf", ctx.searching);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngTemplateOutlet", ctx.extraContent)("ngTemplateOutletContext", i0.ɵɵpureFunction3(25, _c2, ctx.option, i0.ɵɵpipeBind1(24, 23, ctx.socket$$), ctx.index));
        i0.ɵɵadvance(4);
        i0.ɵɵproperty("actived", ctx.coding === "utf8");
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("actived", ctx.coding === "gb18030");
    } }, styles: ["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%}.acl-terminal__dropdown[_ngcontent-%COMP%]   .acl-terminal__dropdown--dark[_ngcontent-%COMP%]{color-scheme:dark;--aui-color-blue: 61, 142, 255;--aui-color-b-0: 54, 116, 204;--aui-color-b-1: 109, 170, 255;--aui-color-b-2: 53, 111, 193;--aui-color-b-3: 50, 101, 173;--aui-color-b-4: 47, 85, 143;--aui-color-b-5: 40, 54, 81;--aui-color-b-6: 42, 64, 102;--aui-color-b-7: 44, 74, 122;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 17, 182, 113;--aui-color-g-0: 21, 146, 97;--aui-color-g-1: 76, 200, 148;--aui-color-g-2: 22, 139, 93;--aui-color-g-4: 27, 103, 78;--aui-color-g-6: 31, 74, 66;--aui-color-g-7: 28, 88, 72;--aui-color-yellow: 237, 172, 44;--aui-color-y-0: 186, 138, 45;--aui-color-y-1: 241, 192, 96;--aui-color-y-2: 176, 132, 45;--aui-color-y-4: 126, 98, 47;--aui-color-y-6: 86, 72, 49;--aui-color-y-7: 105, 85, 48;--aui-color-red: 226, 50, 79;--aui-color-r-0: 178, 47, 72;--aui-color-r-1: 233, 101, 123;--aui-color-r-2: 168, 46, 70;--aui-color-r-4: 121, 43, 63;--aui-color-r-6: 83, 41, 57;--aui-color-r-7: 101, 42, 60;--aui-color-n-1: 238, 239, 243;--aui-color-n-2: 200, 201, 205;--aui-color-n-3: 184, 186, 194;--aui-color-n-4: 152, 154, 162;--aui-color-n-5: 144, 147, 159;--aui-color-n-6: 120, 123, 135;--aui-color-n-7: 92, 95, 107;--aui-color-n-8: 67, 70, 82;--aui-color-n-9: 24, 27, 39;--aui-color-n-10: 36, 39, 51;--aui-color-origin-shadow: var(--aui-color-n-9);--aui-color-popper-bg: 56, 59, 71;--aui-color-button-bg: 56, 59, 71;--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal__dropdown[_ngcontent-%COMP%]   .acl-terminal__dropdown--dark[_ngcontent-%COMP%] > .aui-menu[_ngcontent-%COMP%]{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.75)}.acl-terminal__dropdown[_ngcontent-%COMP%]   .acl-terminal__dropdown--light[_ngcontent-%COMP%]{color-scheme:light;--aui-color-blue: 0, 122, 245;--aui-color-b-0: 0, 103, 208;--aui-color-b-1: 38, 141, 246;--aui-color-b-2: 77, 162, 248;--aui-color-b-3: 102, 175, 249;--aui-color-b-4: 179, 215, 252;--aui-color-b-5: 204, 228, 253;--aui-color-b-6: 229, 241, 254;--aui-color-b-7: 242, 248, 254;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 0, 194, 97;--aui-color-g-0: 0, 165, 82;--aui-color-g-1: 38, 203, 120;--aui-color-g-2: 76, 212, 144;--aui-color-g-4: 179, 236, 207;--aui-color-g-6: 230, 249, 239;--aui-color-g-7: 242, 251, 246;--aui-color-yellow: 245, 163, 0;--aui-color-y-0: 220, 146, 0;--aui-color-y-1: 246, 176, 38;--aui-color-y-2: 248, 190, 77;--aui-color-y-4: 252, 227, 179;--aui-color-y-6: 254, 245, 230;--aui-color-y-7: 254, 250, 243;--aui-color-red: 235, 0, 39;--aui-color-r-0: 199, 0, 33;--aui-color-r-1: 237, 38, 71;--aui-color-r-2: 241, 76, 103;--aui-color-r-4: 249, 179, 190;--aui-color-r-6: 253, 230, 233;--aui-color-r-7: 254, 243, 244;--aui-color-n-1: 50, 52, 55;--aui-color-n-2: 100, 102, 105;--aui-color-n-3: 124, 126, 129;--aui-color-n-4: 150, 152, 155;--aui-color-n-5: 174, 176, 179;--aui-color-n-6: 200, 202, 205;--aui-color-n-7: 212, 214, 217;--aui-color-n-8: 237, 239, 242;--aui-color-n-9: 247, 249, 252;--aui-color-n-10: 255, 255, 255;--aui-color-origin-shadow: var(--aui-color-n-1);--aui-color-popper-bg: var(--aui-color-n-10);--aui-color-button-bg: var(--aui-color-n-9);--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal__dropdown[_ngcontent-%COMP%]   .acl-terminal__dropdown--light[_ngcontent-%COMP%] > .aui-menu[_ngcontent-%COMP%]{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.2)}.acl-terminal[_ngcontent-%COMP%]{display:flex;flex:1;flex-direction:column;width:100%;padding:12px;background-color:rgb(var(--aui-color-n-9));border-radius:var(--aui-border-radius-l);overflow:hidden}.acl-terminal__wrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1}.acl-terminal__header[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;align-items:center;height:var(--aui-line-height-m);margin-bottom:12px;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-main-text))}.acl-terminal__button[_ngcontent-%COMP%]{cursor:pointer;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-help-text))}.acl-terminal__button[_ngcontent-%COMP%]   aui-icon[_ngcontent-%COMP%]{font-size:var(--aui-icon-size-m)}.acl-terminal__button[_ngcontent-%COMP%]   aui-icon[_ngcontent-%COMP%]:first-child{margin-right:4px}.acl-terminal__button[_ngcontent-%COMP%]   aui-icon[_ngcontent-%COMP%]:last-child{margin-left:4px}.acl-terminal__button[_ngcontent-%COMP%] + .acl-terminal__button[_ngcontent-%COMP%]{margin-left:12px}.acl-terminal__shell[_ngcontent-%COMP%]{width:100%;height:100%;padding:8px;background-color:rgb(var(--aui-color-n-10));border:1px solid rgb(var(--aui-color-n-8));border-radius:var(--aui-border-radius-l);overflow:hidden;position:relative}.acl-terminal__anchor[_ngcontent-%COMP%]{width:100%;height:100%;overflow:hidden}.acl-terminal__finding[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;padding:8px;z-index:100;display:flex;align-items:center;background-color:rgb(var(--aui-color-popper-bg));border-radius:var(--aui-border-radius-m)}.acl-terminal__finding[_ngcontent-%COMP%]   .aui-input[_ngcontent-%COMP%]{margin-right:8px}.acl-terminal--dark[_ngcontent-%COMP%]{color-scheme:dark;--aui-color-blue: 61, 142, 255;--aui-color-b-0: 54, 116, 204;--aui-color-b-1: 109, 170, 255;--aui-color-b-2: 53, 111, 193;--aui-color-b-3: 50, 101, 173;--aui-color-b-4: 47, 85, 143;--aui-color-b-5: 40, 54, 81;--aui-color-b-6: 42, 64, 102;--aui-color-b-7: 44, 74, 122;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 17, 182, 113;--aui-color-g-0: 21, 146, 97;--aui-color-g-1: 76, 200, 148;--aui-color-g-2: 22, 139, 93;--aui-color-g-4: 27, 103, 78;--aui-color-g-6: 31, 74, 66;--aui-color-g-7: 28, 88, 72;--aui-color-yellow: 237, 172, 44;--aui-color-y-0: 186, 138, 45;--aui-color-y-1: 241, 192, 96;--aui-color-y-2: 176, 132, 45;--aui-color-y-4: 126, 98, 47;--aui-color-y-6: 86, 72, 49;--aui-color-y-7: 105, 85, 48;--aui-color-red: 226, 50, 79;--aui-color-r-0: 178, 47, 72;--aui-color-r-1: 233, 101, 123;--aui-color-r-2: 168, 46, 70;--aui-color-r-4: 121, 43, 63;--aui-color-r-6: 83, 41, 57;--aui-color-r-7: 101, 42, 60;--aui-color-n-1: 238, 239, 243;--aui-color-n-2: 200, 201, 205;--aui-color-n-3: 184, 186, 194;--aui-color-n-4: 152, 154, 162;--aui-color-n-5: 144, 147, 159;--aui-color-n-6: 120, 123, 135;--aui-color-n-7: 92, 95, 107;--aui-color-n-8: 67, 70, 82;--aui-color-n-9: 24, 27, 39;--aui-color-n-10: 36, 39, 51;--aui-color-origin-shadow: var(--aui-color-n-9);--aui-color-popper-bg: 56, 59, 71;--aui-color-button-bg: 56, 59, 71;--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal--light[_ngcontent-%COMP%]{color-scheme:light;--aui-color-blue: 0, 122, 245;--aui-color-b-0: 0, 103, 208;--aui-color-b-1: 38, 141, 246;--aui-color-b-2: 77, 162, 248;--aui-color-b-3: 102, 175, 249;--aui-color-b-4: 179, 215, 252;--aui-color-b-5: 204, 228, 253;--aui-color-b-6: 229, 241, 254;--aui-color-b-7: 242, 248, 254;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 0, 194, 97;--aui-color-g-0: 0, 165, 82;--aui-color-g-1: 38, 203, 120;--aui-color-g-2: 76, 212, 144;--aui-color-g-4: 179, 236, 207;--aui-color-g-6: 230, 249, 239;--aui-color-g-7: 242, 251, 246;--aui-color-yellow: 245, 163, 0;--aui-color-y-0: 220, 146, 0;--aui-color-y-1: 246, 176, 38;--aui-color-y-2: 248, 190, 77;--aui-color-y-4: 252, 227, 179;--aui-color-y-6: 254, 245, 230;--aui-color-y-7: 254, 250, 243;--aui-color-red: 235, 0, 39;--aui-color-r-0: 199, 0, 33;--aui-color-r-1: 237, 38, 71;--aui-color-r-2: 241, 76, 103;--aui-color-r-4: 249, 179, 190;--aui-color-r-6: 253, 230, 233;--aui-color-r-7: 254, 243, 244;--aui-color-n-1: 50, 52, 55;--aui-color-n-2: 100, 102, 105;--aui-color-n-3: 124, 126, 129;--aui-color-n-4: 150, 152, 155;--aui-color-n-5: 174, 176, 179;--aui-color-n-6: 200, 202, 205;--aui-color-n-7: 212, 214, 217;--aui-color-n-8: 237, 239, 242;--aui-color-n-9: 247, 249, 252;--aui-color-n-10: 255, 255, 255;--aui-color-origin-shadow: var(--aui-color-n-1);--aui-color-popper-bg: var(--aui-color-n-10);--aui-color-button-bg: var(--aui-color-n-9);--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal--dark[_ngcontent-%COMP%]   .acl-terminal__finding[_ngcontent-%COMP%]{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.75)}.acl-terminal--light[_ngcontent-%COMP%]   .acl-terminal__finding[_ngcontent-%COMP%]{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.2)}"], changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TerminalComponent, [{
        type: Component,
        args: [{ selector: 'acl-terminal', changeDetection: ChangeDetectionStrategy.OnPush, template: "<aui-inline-alert\n  *ngIf=\"connectionStatus === ConnectionStatus.Disconnected\"\n  type=\"error\"\n>\n  <span>{{ 'exec_disconnected_tip' | translate }}</span>\n  <button\n    aui-button=\"text\"\n    (click)=\"reconnect()\"\n  >\n    {{ 'reconnect' | translate }}\n  </button>\n</aui-inline-alert>\n\n<div class=\"acl-terminal__wrapper\">\n  <div\n    class=\"acl-terminal\"\n    [class.acl-terminal--dark]=\"theme === 'dark'\"\n    [class.acl-terminal--light]=\"theme === 'light'\"\n  >\n    <div class=\"acl-terminal__header\">\n      <div\n        class=\"acl-terminal__button\"\n        [auiDropdown]=\"codingMenu\"\n        [auiDropdownClass]=\"\n          'acl-terminal__dropdown ' +\n          (theme === 'light'\n            ? 'acl-terminal__dropdown--light'\n            : 'acl-terminal__dropdown--dark')\n        \"\n      >\n        <span\n          >{{\n            coding === 'utf8'\n              ? 'UTF-8'\n              : coding === 'gb18030'\n              ? 'GB 18030'\n              : coding.toUpperCase()\n          }}\n          {{ 'decoding' | translate }}</span\n        >\n        <aui-icon icon=\"angle_down\"></aui-icon>\n      </div>\n      <div\n        class=\"acl-terminal__button\"\n        (click)=\"openSearching()\"\n      >\n        <aui-icon icon=\"search_s\"></aui-icon>\n        <span>{{ 'find' | translate }}</span>\n      </div>\n      <div\n        class=\"acl-terminal__button\"\n        (click)=\"switchTheme()\"\n      >\n        <aui-icon [icon]=\"theme === 'light' ? 'sun' : 'moon'\"></aui-icon>\n        <span>{{\n          (theme === 'light' ? 'light_theme' : 'dark_theme') | translate\n        }}</span>\n      </div>\n    </div>\n    <div\n      class=\"acl-terminal__shell\"\n      (keydown)=\"onShellKeyDown($event)\"\n    >\n      <div\n        #anchor\n        class=\"acl-terminal__anchor\"\n      ></div>\n      <div\n        *ngIf=\"searching\"\n        class=\"acl-terminal__finding\"\n      >\n        <aui-search\n          #searchInput\n          size=\"small\"\n          [(keyword)]=\"searchKeyword\"\n          (keydown)=\"onSearchInputKeyDown($event)\"\n        ></aui-search>\n        <button\n          aui-button=\"text\"\n          size=\"mini\"\n          [square]=\"true\"\n          [plain]=\"true\"\n          [title]=\"('find_previous' | translate) + ' (Shift + Enter)'\"\n          (click)=\"findPrevious()\"\n        >\n          <aui-icon\n            icon=\"arrow\"\n            style=\"transform: rotate(-90deg)\"\n          ></aui-icon>\n        </button>\n        <button\n          aui-button=\"text\"\n          size=\"mini\"\n          [square]=\"true\"\n          [plain]=\"true\"\n          [title]=\"('find_next' | translate) + ' (Enter)'\"\n          (click)=\"findNext()\"\n        >\n          <aui-icon\n            icon=\"arrow\"\n            style=\"transform: rotate(90deg)\"\n          ></aui-icon>\n        </button>\n        <button\n          aui-button=\"text\"\n          size=\"mini\"\n          [square]=\"true\"\n          [plain]=\"true\"\n          [title]=\"('close' | translate) + ' (Escape)'\"\n          (click)=\"closeSearching()\"\n        >\n          <aui-icon icon=\"close\"></aui-icon>\n        </button>\n      </div>\n    </div>\n  </div>\n\n  <ng-container\n    *ngTemplateOutlet=\"\n      extraContent;\n      context: {\n        $implicit: option,\n        socket: socket$$ | async,\n        index: index\n      }\n    \"\n  ></ng-container>\n</div>\n\n<aui-menu\n  #codingMenu\n  size=\"small\"\n>\n  <aui-menu-item\n    [actived]=\"coding === 'utf8'\"\n    (click)=\"coding = 'utf8'\"\n    >UTF-8\n  </aui-menu-item>\n  <aui-menu-item\n    [actived]=\"coding === 'gb18030'\"\n    (click)=\"coding = 'gb18030'\"\n    >GB 18030\n  </aui-menu-item>\n</aui-menu>\n", styles: [":host{display:flex;flex-direction:column;width:100%}.acl-terminal__dropdown .acl-terminal__dropdown--dark{color-scheme:dark;--aui-color-blue: 61, 142, 255;--aui-color-b-0: 54, 116, 204;--aui-color-b-1: 109, 170, 255;--aui-color-b-2: 53, 111, 193;--aui-color-b-3: 50, 101, 173;--aui-color-b-4: 47, 85, 143;--aui-color-b-5: 40, 54, 81;--aui-color-b-6: 42, 64, 102;--aui-color-b-7: 44, 74, 122;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 17, 182, 113;--aui-color-g-0: 21, 146, 97;--aui-color-g-1: 76, 200, 148;--aui-color-g-2: 22, 139, 93;--aui-color-g-4: 27, 103, 78;--aui-color-g-6: 31, 74, 66;--aui-color-g-7: 28, 88, 72;--aui-color-yellow: 237, 172, 44;--aui-color-y-0: 186, 138, 45;--aui-color-y-1: 241, 192, 96;--aui-color-y-2: 176, 132, 45;--aui-color-y-4: 126, 98, 47;--aui-color-y-6: 86, 72, 49;--aui-color-y-7: 105, 85, 48;--aui-color-red: 226, 50, 79;--aui-color-r-0: 178, 47, 72;--aui-color-r-1: 233, 101, 123;--aui-color-r-2: 168, 46, 70;--aui-color-r-4: 121, 43, 63;--aui-color-r-6: 83, 41, 57;--aui-color-r-7: 101, 42, 60;--aui-color-n-1: 238, 239, 243;--aui-color-n-2: 200, 201, 205;--aui-color-n-3: 184, 186, 194;--aui-color-n-4: 152, 154, 162;--aui-color-n-5: 144, 147, 159;--aui-color-n-6: 120, 123, 135;--aui-color-n-7: 92, 95, 107;--aui-color-n-8: 67, 70, 82;--aui-color-n-9: 24, 27, 39;--aui-color-n-10: 36, 39, 51;--aui-color-origin-shadow: var(--aui-color-n-9);--aui-color-popper-bg: 56, 59, 71;--aui-color-button-bg: 56, 59, 71;--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal__dropdown .acl-terminal__dropdown--dark>.aui-menu{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.75)}.acl-terminal__dropdown .acl-terminal__dropdown--light{color-scheme:light;--aui-color-blue: 0, 122, 245;--aui-color-b-0: 0, 103, 208;--aui-color-b-1: 38, 141, 246;--aui-color-b-2: 77, 162, 248;--aui-color-b-3: 102, 175, 249;--aui-color-b-4: 179, 215, 252;--aui-color-b-5: 204, 228, 253;--aui-color-b-6: 229, 241, 254;--aui-color-b-7: 242, 248, 254;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 0, 194, 97;--aui-color-g-0: 0, 165, 82;--aui-color-g-1: 38, 203, 120;--aui-color-g-2: 76, 212, 144;--aui-color-g-4: 179, 236, 207;--aui-color-g-6: 230, 249, 239;--aui-color-g-7: 242, 251, 246;--aui-color-yellow: 245, 163, 0;--aui-color-y-0: 220, 146, 0;--aui-color-y-1: 246, 176, 38;--aui-color-y-2: 248, 190, 77;--aui-color-y-4: 252, 227, 179;--aui-color-y-6: 254, 245, 230;--aui-color-y-7: 254, 250, 243;--aui-color-red: 235, 0, 39;--aui-color-r-0: 199, 0, 33;--aui-color-r-1: 237, 38, 71;--aui-color-r-2: 241, 76, 103;--aui-color-r-4: 249, 179, 190;--aui-color-r-6: 253, 230, 233;--aui-color-r-7: 254, 243, 244;--aui-color-n-1: 50, 52, 55;--aui-color-n-2: 100, 102, 105;--aui-color-n-3: 124, 126, 129;--aui-color-n-4: 150, 152, 155;--aui-color-n-5: 174, 176, 179;--aui-color-n-6: 200, 202, 205;--aui-color-n-7: 212, 214, 217;--aui-color-n-8: 237, 239, 242;--aui-color-n-9: 247, 249, 252;--aui-color-n-10: 255, 255, 255;--aui-color-origin-shadow: var(--aui-color-n-1);--aui-color-popper-bg: var(--aui-color-n-10);--aui-color-button-bg: var(--aui-color-n-9);--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal__dropdown .acl-terminal__dropdown--light>.aui-menu{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.2)}.acl-terminal{display:flex;flex:1;flex-direction:column;width:100%;padding:12px;background-color:rgb(var(--aui-color-n-9));border-radius:var(--aui-border-radius-l);overflow:hidden}.acl-terminal__wrapper{display:flex;flex-direction:column;flex:1}.acl-terminal__header{display:flex;justify-content:flex-end;align-items:center;height:var(--aui-line-height-m);margin-bottom:12px;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-main-text))}.acl-terminal__button{cursor:pointer;font-size:var(--aui-font-size-m);line-height:var(--aui-line-height-m);color:rgb(var(--aui-color-help-text))}.acl-terminal__button aui-icon{font-size:var(--aui-icon-size-m)}.acl-terminal__button aui-icon:first-child{margin-right:4px}.acl-terminal__button aui-icon:last-child{margin-left:4px}.acl-terminal__button+.acl-terminal__button{margin-left:12px}.acl-terminal__shell{width:100%;height:100%;padding:8px;background-color:rgb(var(--aui-color-n-10));border:1px solid rgb(var(--aui-color-n-8));border-radius:var(--aui-border-radius-l);overflow:hidden;position:relative}.acl-terminal__anchor{width:100%;height:100%;overflow:hidden}.acl-terminal__finding{position:absolute;top:8px;right:8px;padding:8px;z-index:100;display:flex;align-items:center;background-color:rgb(var(--aui-color-popper-bg));border-radius:var(--aui-border-radius-m)}.acl-terminal__finding .aui-input{margin-right:8px}.acl-terminal--dark{color-scheme:dark;--aui-color-blue: 61, 142, 255;--aui-color-b-0: 54, 116, 204;--aui-color-b-1: 109, 170, 255;--aui-color-b-2: 53, 111, 193;--aui-color-b-3: 50, 101, 173;--aui-color-b-4: 47, 85, 143;--aui-color-b-5: 40, 54, 81;--aui-color-b-6: 42, 64, 102;--aui-color-b-7: 44, 74, 122;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 17, 182, 113;--aui-color-g-0: 21, 146, 97;--aui-color-g-1: 76, 200, 148;--aui-color-g-2: 22, 139, 93;--aui-color-g-4: 27, 103, 78;--aui-color-g-6: 31, 74, 66;--aui-color-g-7: 28, 88, 72;--aui-color-yellow: 237, 172, 44;--aui-color-y-0: 186, 138, 45;--aui-color-y-1: 241, 192, 96;--aui-color-y-2: 176, 132, 45;--aui-color-y-4: 126, 98, 47;--aui-color-y-6: 86, 72, 49;--aui-color-y-7: 105, 85, 48;--aui-color-red: 226, 50, 79;--aui-color-r-0: 178, 47, 72;--aui-color-r-1: 233, 101, 123;--aui-color-r-2: 168, 46, 70;--aui-color-r-4: 121, 43, 63;--aui-color-r-6: 83, 41, 57;--aui-color-r-7: 101, 42, 60;--aui-color-n-1: 238, 239, 243;--aui-color-n-2: 200, 201, 205;--aui-color-n-3: 184, 186, 194;--aui-color-n-4: 152, 154, 162;--aui-color-n-5: 144, 147, 159;--aui-color-n-6: 120, 123, 135;--aui-color-n-7: 92, 95, 107;--aui-color-n-8: 67, 70, 82;--aui-color-n-9: 24, 27, 39;--aui-color-n-10: 36, 39, 51;--aui-color-origin-shadow: var(--aui-color-n-9);--aui-color-popper-bg: 56, 59, 71;--aui-color-button-bg: 56, 59, 71;--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal--light{color-scheme:light;--aui-color-blue: 0, 122, 245;--aui-color-b-0: 0, 103, 208;--aui-color-b-1: 38, 141, 246;--aui-color-b-2: 77, 162, 248;--aui-color-b-3: 102, 175, 249;--aui-color-b-4: 179, 215, 252;--aui-color-b-5: 204, 228, 253;--aui-color-b-6: 229, 241, 254;--aui-color-b-7: 242, 248, 254;--aui-color-primary: var(--aui-color-blue);--aui-color-p-0: var(--aui-color-b-0);--aui-color-p-1: var(--aui-color-b-1);--aui-color-p-2: var(--aui-color-b-2);--aui-color-p-3: var(--aui-color-b-3);--aui-color-p-4: var(--aui-color-b-4);--aui-color-p-5: var(--aui-color-b-5);--aui-color-p-6: var(--aui-color-b-6);--aui-color-p-7: var(--aui-color-b-7);--aui-color-green: 0, 194, 97;--aui-color-g-0: 0, 165, 82;--aui-color-g-1: 38, 203, 120;--aui-color-g-2: 76, 212, 144;--aui-color-g-4: 179, 236, 207;--aui-color-g-6: 230, 249, 239;--aui-color-g-7: 242, 251, 246;--aui-color-yellow: 245, 163, 0;--aui-color-y-0: 220, 146, 0;--aui-color-y-1: 246, 176, 38;--aui-color-y-2: 248, 190, 77;--aui-color-y-4: 252, 227, 179;--aui-color-y-6: 254, 245, 230;--aui-color-y-7: 254, 250, 243;--aui-color-red: 235, 0, 39;--aui-color-r-0: 199, 0, 33;--aui-color-r-1: 237, 38, 71;--aui-color-r-2: 241, 76, 103;--aui-color-r-4: 249, 179, 190;--aui-color-r-6: 253, 230, 233;--aui-color-r-7: 254, 243, 244;--aui-color-n-1: 50, 52, 55;--aui-color-n-2: 100, 102, 105;--aui-color-n-3: 124, 126, 129;--aui-color-n-4: 150, 152, 155;--aui-color-n-5: 174, 176, 179;--aui-color-n-6: 200, 202, 205;--aui-color-n-7: 212, 214, 217;--aui-color-n-8: 237, 239, 242;--aui-color-n-9: 247, 249, 252;--aui-color-n-10: 255, 255, 255;--aui-color-origin-shadow: var(--aui-color-n-1);--aui-color-popper-bg: var(--aui-color-n-10);--aui-color-button-bg: var(--aui-color-n-9);--aui-color-main-bg: var(--aui-color-n-9);--aui-color-divider: var(--aui-color-n-8);--aui-color-border: var(--aui-color-n-7);--aui-color-main-text: var(--aui-color-n-1);--aui-color-secondary-text: var(--aui-color-n-2);--aui-color-help-text: var(--aui-color-n-4);--aui-color-disabled-text: var(--aui-color-n-6);--aui-color-placeholder-text: var(--aui-color-n-6)}.acl-terminal--dark .acl-terminal__finding{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.75)}.acl-terminal--light .acl-terminal__finding{box-shadow:0 2px 8px 0 rgba(var(--aui-color-origin-shadow),.2)}\n"] }]
    }], function () { return [{ type: i1.ApiGatewayService }, { type: i2.AuthorizationStateService }, { type: i3.NotificationService }, { type: i4.TranslateService }, { type: i0.ChangeDetectorRef }]; }, { option: [{
            type: Input
        }], index: [{
            type: Input
        }], extraContent: [{
            type: Input
        }], connectionStatusChange: [{
            type: Output
        }], sendData: [{
            type: Output
        }], socketReady: [{
            type: Output
        }], fallbackShell: [{
            type: Output
        }], anchorRef: [{
            type: ViewChild,
            args: ['anchor']
        }], searchInputRef: [{
            type: ViewChild,
            args: ['searchInput']
        }] }); })();
function decode(coding, data) {
    const dataView = new DataView(Uint8Array.from(atob(data), c => c.codePointAt(0)).buffer);
    const decoder = new TextDecoder(coding);
    return decoder.decode(dataView);
}
//# sourceMappingURL=data:application/json;base64, 