import * as i0 from '@angular/core';
import { EventEmitter, Output, Input, Component, input, inject, computed, ContentChildren } from '@angular/core';
import { IconDirective, C8yTranslatePipe, MarkdownToHtmlPipe, DatePipe, TextareaAutoresizeDirective } from '@c8y/ngx-components';
import * as i1 from 'ngx-bootstrap/tooltip';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { gettext } from '@c8y/ngx-components/gettext';
import { NgClass, AsyncPipe } from '@angular/common';
import { TranslateService } from '@ngx-translate/core';
import * as i1$1 from '@angular/forms';
import { FormsModule } from '@angular/forms';

/**
 * An action button that can be added to chat messages.
 * Typically used for actions like copying, regenerating, or providing feedback on messages.
 */
class AiChatMessageActionComponent {
    constructor() {
        /**
         * Disables the action button when true.
         */
        this.disabled = false;
        /**
         * Tooltip text displayed when hovering over the action button.
         */
        this.tooltip = '';
        /**
         * Icon to display in the action button.
         */
        this.icon = 'cog';
        /**
         * Emitted when the action button is clicked.
         */
        this.click = new EventEmitter();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatMessageActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.19", type: AiChatMessageActionComponent, isStandalone: true, selector: "c8y-ai-chat-message-action", inputs: { disabled: "disabled", tooltip: "tooltip", icon: "icon" }, outputs: { click: "click" }, ngImport: i0, template: "<button\n  class=\"btn btn-dot text-muted\"\n  [attr.aria-label]=\"tooltip | translate\"\n  [tooltip]=\"tooltip | translate\"\n  [adaptivePosition]=\"true\"\n  [delay]=\"500\"\n  (click)=\"click.emit()\"\n  [disabled]=\"disabled\"\n>\n  <i\n    class=\"text-12\"\n    [c8yIcon]=\"icon\"\n  ></i>\n</button>\n", dependencies: [{ kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatMessageActionComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-ai-chat-message-action', standalone: true, imports: [TooltipModule, C8yTranslatePipe, IconDirective], template: "<button\n  class=\"btn btn-dot text-muted\"\n  [attr.aria-label]=\"tooltip | translate\"\n  [tooltip]=\"tooltip | translate\"\n  [adaptivePosition]=\"true\"\n  [delay]=\"500\"\n  (click)=\"click.emit()\"\n  [disabled]=\"disabled\"\n>\n  <i\n    class=\"text-12\"\n    [c8yIcon]=\"icon\"\n  ></i>\n</button>\n" }]
        }], propDecorators: { disabled: [{
                type: Input
            }], tooltip: [{
                type: Input
            }], icon: [{
                type: Input
            }], click: [{
                type: Output
            }] } });

class AiChatMessageComponent {
    constructor() {
        this.role = input(...(ngDevMode ? [undefined, { debugName: "role" }] : []));
        this.message = input(...(ngDevMode ? [undefined, { debugName: "message" }] : []));
        this.translateService = inject(TranslateService);
        this.roleResolved = computed(() => {
            return this.message()?.role || this.role();
        }, ...(ngDevMode ? [{ debugName: "roleResolved" }] : []));
        /**
         * Generates an accessible label for the message container.
         * Includes the role (user or assistant) and timestamp if available.
         * @returns The aria-label string for screen readers
         */
        this.ariaLabel = computed(() => {
            const tpl = this.roleResolved() === 'user'
                ? gettext('You said: "{{ message }}"')
                : gettext('Assistant said: "{{ message }}"');
            const msg = this.message();
            return this.translateService.instant(tpl, { message: msg?.content || gettext('No response.') });
        }, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : []));
        /**
         * Generates an accessible label for the message content.
         * Prefixes the content with contextual information about who sent it.
         * @returns The aria-label string with prefixed role information
         */
        this.messageContentAriaLabel = computed(() => {
            const msg = this.message();
            const time = msg?.timestamp ? new Date(msg.timestamp).toLocaleTimeString() : '';
            let tpl;
            if (time) {
                tpl =
                    this.roleResolved() === 'user'
                        ? gettext('User message at {{ time }}')
                        : gettext('Assistant message at {{ time }}');
            }
            else {
                tpl = this.roleResolved() === 'user' ? gettext('User message') : gettext('Assistant message');
            }
            return this.translateService.instant(tpl, { time });
        }, ...(ngDevMode ? [{ debugName: "messageContentAriaLabel" }] : []));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AiChatMessageComponent, isStandalone: true, selector: "c8y-ai-chat-message", inputs: { role: { classPropertyName: "role", publicName: "role", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div\n  class=\"d-col p-b-16\"\n  [attr.aria-label]=\"ariaLabel()\"\n  role=\"article\"\n>\n  <div\n    class=\"chat-message text-break-word\"\n    [ngClass]=\"{\n      'user-message': message()?.role === 'user' || role() === 'user',\n      'agent-message': message()?.role === 'assistant' || role() === 'assistant'\n    }\"\n  >\n    <div\n      class=\"message-content\"\n      [attr.aria-label]=\"messageContentAriaLabel()\"\n      [innerHTML]=\"message()?.content | markdownToHtml | async\"\n    ></div>\n    <ng-content select=\":not(c8y-ai-chat-message-action)\"></ng-content>\n    @if (message()?.timestamp) {\n      <div class=\"message-timestamp\">\n        <span [tooltip]=\"message()?.timestamp | c8yDate\">\n          {{ message()?.timestamp | c8yDate: 'adaptiveDate' }}\n        </span>\n      </div>\n    }\n  </div>\n  <div\n    class=\"message-action\"\n    [attr.aria-label]=\"'Message actions' | translate\"\n    role=\"toolbar\"\n    [ngClass]=\"{\n      'user-action showOnHover': message()?.role === 'user' || role() === 'user',\n      'agent-action p-l-16': message()?.role === 'assistant' || role() === 'assistant'\n    }\"\n  >\n    <ng-content select=\"c8y-ai-chat-message-action\"></ng-content>\n  </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: MarkdownToHtmlPipe, name: "markdownToHtml" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: DatePipe, name: "c8yDate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatMessageComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-ai-chat-message', standalone: true, imports: [MarkdownToHtmlPipe, AsyncPipe, NgClass, TooltipModule, C8yTranslatePipe, DatePipe], template: "<div\n  class=\"d-col p-b-16\"\n  [attr.aria-label]=\"ariaLabel()\"\n  role=\"article\"\n>\n  <div\n    class=\"chat-message text-break-word\"\n    [ngClass]=\"{\n      'user-message': message()?.role === 'user' || role() === 'user',\n      'agent-message': message()?.role === 'assistant' || role() === 'assistant'\n    }\"\n  >\n    <div\n      class=\"message-content\"\n      [attr.aria-label]=\"messageContentAriaLabel()\"\n      [innerHTML]=\"message()?.content | markdownToHtml | async\"\n    ></div>\n    <ng-content select=\":not(c8y-ai-chat-message-action)\"></ng-content>\n    @if (message()?.timestamp) {\n      <div class=\"message-timestamp\">\n        <span [tooltip]=\"message()?.timestamp | c8yDate\">\n          {{ message()?.timestamp | c8yDate: 'adaptiveDate' }}\n        </span>\n      </div>\n    }\n  </div>\n  <div\n    class=\"message-action\"\n    [attr.aria-label]=\"'Message actions' | translate\"\n    role=\"toolbar\"\n    [ngClass]=\"{\n      'user-action showOnHover': message()?.role === 'user' || role() === 'user',\n      'agent-action p-l-16': message()?.role === 'assistant' || role() === 'assistant'\n    }\"\n  >\n    <ng-content select=\"c8y-ai-chat-message-action\"></ng-content>\n  </div>\n</div>\n" }]
        }], propDecorators: { role: [{ type: i0.Input, args: [{ isSignal: true, alias: "role", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }] } });

/**
 * A suggestion chip that can be displayed in the chat interface.
 * When clicked, it automatically populates and sends a predefined prompt.
 */
class AiChatSuggestionComponent {
    constructor() {
        /**
         * Icon to display alongside the suggestion label.
         */
        this.icon = 'c8y-bulb';
        /**
         * When true, uses AI-styled buttons instead of default styling.
         */
        this.useAiButtons = false;
        /**
         * Disables the suggestion chip when true.
         */
        this.disabled = false;
        /**
         * Emitted when the suggestion is clicked, providing the prompt as an AIMessage.
         */
        this.suggestionClicked = new EventEmitter();
    }
    /**
     * Handles suggestion click and emits the prompt as a user message.
     */
    suggest() {
        this.suggestionClicked.emit({
            content: this.prompt,
            role: 'user',
            timestamp: new Date().toISOString()
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatSuggestionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AiChatSuggestionComponent, isStandalone: true, selector: "c8y-ai-chat-suggestion", inputs: { label: "label", prompt: "prompt", icon: "icon", useAiButtons: "useAiButtons", disabled: "disabled" }, outputs: { suggestionClicked: "suggestionClicked" }, ngImport: i0, template: "@if (!useAiButtons) {\n  <button\n    class=\"btn btn-default btn-sm\"\n    [title]=\"prompt | translate\"\n    (click)=\"suggest()\"\n    [disabled]=\"disabled\"\n  >\n    <i [c8yIcon]=\"icon\"></i>\n    {{ label | translate }}\n  </button>\n} @else {\n  <button\n    class=\"btn btn-sm btn-ai\"\n    [title]=\"prompt | translate\"\n    (click)=\"suggest()\"\n    [disabled]=\"disabled\"\n  >\n    <span>{{ label | translate }}</span>\n  </button>\n}\n", dependencies: [{ kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatSuggestionComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-ai-chat-suggestion', standalone: true, imports: [IconDirective, C8yTranslatePipe], template: "@if (!useAiButtons) {\n  <button\n    class=\"btn btn-default btn-sm\"\n    [title]=\"prompt | translate\"\n    (click)=\"suggest()\"\n    [disabled]=\"disabled\"\n  >\n    <i [c8yIcon]=\"icon\"></i>\n    {{ label | translate }}\n  </button>\n} @else {\n  <button\n    class=\"btn btn-sm btn-ai\"\n    [title]=\"prompt | translate\"\n    (click)=\"suggest()\"\n    [disabled]=\"disabled\"\n  >\n    <span>{{ label | translate }}</span>\n  </button>\n}\n" }]
        }], propDecorators: { label: [{
                type: Input
            }], prompt: [{
                type: Input
            }], icon: [{
                type: Input
            }], useAiButtons: [{
                type: Input
            }], disabled: [{
                type: Input
            }], suggestionClicked: [{
                type: Output
            }] } });

/**
 * An interactive chat interface component for AI-powered conversations.
 * Displays messages in a conversation format with support for loading states,
 * custom configuration, and markdown formatting.
 */
class AiChatComponent {
    constructor() {
        /**
         * Indicates whether the chat is currently processing a request.
         * When true, displays a cancel button instead of send button and disables the input.
         */
        this.isLoading = false;
        /**
         * Disables the chat input and send button when true.
         */
        this.disabled = false;
        /**
         * The current text in the chat input field. Supports two-way binding.
         */
        this.prompt = '';
        /**
         * Emitted when the user sends a message.
         * Provides an AIMessage object with role, content, and timestamp.
         */
        this.onMessage = new EventEmitter();
        /**
         * Emitted when the user cancels an ongoing operation during loading state.
         */
        this.onCancel = new EventEmitter();
        this.componentId = `chat-${crypto.randomUUID()}`;
        this._config = {
            headline: gettext('Welcome!'),
            welcomeText: '',
            title: gettext('What can I help you with?'),
            placeholder: gettext('Type your message here...'),
            sendButtonText: gettext('Send'),
            cancelButtonText: gettext('Cancel'),
            disclaimerText: gettext('AI-generated responses can contain errors. Verify the details before use.'),
            userInterfaceIcons: {
                send: 'arrow-circle-up',
                cancel: 'stop-circle'
            }
        };
    }
    /**
     * Configuration object for customizing labels, placeholders, and icons.
     * Accepts partial configuration to override defaults.
     */
    set config(value) {
        this._config = { ...this._config, ...value };
    }
    get config() {
        return this._config;
    }
    /**
     * Handles message submission when the user sends a message.
     * Emits the onMessage event and clears the input.
     * @param $event - The event object from the form submission
     */
    sendMessage($event) {
        $event.preventDefault();
        if (!this.prompt)
            return;
        this.onMessage.emit({
            role: 'user',
            content: this.prompt,
            timestamp: new Date().toISOString()
        });
        this.prompt = '';
    }
    /**
     * Handles cancellation of ongoing operations during loading state.
     * Emits the onCancel event.
     */
    cancel() {
        this.onCancel.emit();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.19", type: AiChatComponent, isStandalone: true, selector: "c8y-ai-chat", inputs: { isLoading: "isLoading", disabled: "disabled", prompt: "prompt", config: "config" }, outputs: { onMessage: "onMessage", onCancel: "onCancel" }, host: { classAttribute: "d-contents" }, queries: [{ propertyName: "messages", predicate: AiChatMessageComponent }], ngImport: i0, template: "<div\n  class=\"d-col fit-h fit-w flex-grow\"\n  [attr.aria-label]=\"config.headline | translate\"\n  role=\"region\"\n>\n  @if (messages.length > 0) {\n    <div\n      class=\"inner-scroll flex-grow d-col-reverse min-height-0 bg-level-0\"\n      [attr.aria-label]=\"'Chat conversation' | translate\"\n      aria-live=\"polite\"\n      aria-atomic=\"false\"\n      role=\"log\"\n    >\n      <div class=\"d-col p-l-16 p-r-16\">\n        <ng-content select=\"c8y-ai-chat-message\"></ng-content>\n        <ng-content></ng-content>\n      </div>\n    </div>\n  }\n  <div [ngClass]=\"{ 'd-col fit-h': messages.length === 0 }\">\n    @if (messages.length === 0) {\n      <div\n        class=\"p-24\"\n        aria-live=\"polite\"\n        role=\"status\"\n      >\n        <h4 class=\"m-b-16 text-medium\">{{ config.headline | translate }}</h4>\n        <p class=\"p-b-8 text-balance\">{{ config.title | translate }}</p>\n        <p class=\"text-muted text-balance\">{{ config.welcomeText | translate }}</p>\n      </div>\n    }\n    <div class=\"chat-input bg-level-1\">\n      <div class=\"d-flex inner-scroll a-i-center gap-8 p-l-16 p-r-16 p-b-8\">\n        <ng-content select=\"c8y-ai-chat-suggestion\"></ng-content>\n      </div>\n      <div class=\"chat-input-group\">\n        <label\n          class=\"sr-only\"\n          for=\"chat-input-{{ componentId }}\"\n        >\n          {{ config.placeholder | translate }}\n        </label>\n        <textarea\n          class=\"form-control no-resize\"\n          style=\"max-height: 200px !important\"\n          [attr.aria-label]=\"config.placeholder | translate\"\n          id=\"chat-input-{{ componentId }}\"\n          placeholder=\"{{ config.placeholder | translate }}\"\n          [attr.aria-describedby]=\"config.disclaimerText ? 'chat-disclaimer-' + componentId : null\"\n          [attr.aria-busy]=\"isLoading\"\n          [(ngModel)]=\"prompt\"\n          (keydown.enter)=\"sendMessage($event)\"\n          [disabled]=\"isLoading || disabled\"\n          c8y-textarea-autoresize\n        ></textarea>\n        <div class=\"chat-input-group-btn\">\n          @if (!isLoading) {\n            <button\n              class=\"btn btn-dot\"\n              [attr.title]=\"config.sendButtonText | translate\"\n              [attr.aria-label]=\"config.sendButtonText | translate\"\n              type=\"button\"\n              (click)=\"sendMessage($event)\"\n              [disabled]=\"disabled || prompt.trim().length === 0\"\n            >\n              <i [c8yIcon]=\"config.userInterfaceIcons?.send || 'arrow-circle-right'\"></i>\n            </button>\n          } @else {\n            <button\n              class=\"btn btn-dot btn-dot--danger\"\n              [attr.title]=\"config.cancelButtonText | translate\"\n              [attr.aria-label]=\"config.cancelButtonText | translate\"\n              type=\"button\"\n              (click)=\"cancel()\"\n            >\n              <i [c8yIcon]=\"config.userInterfaceIcons?.cancel || 'stop'\"></i>\n            </button>\n          }\n        </div>\n      </div>\n      @if (config.disclaimerText) {\n        <div\n          class=\"text-muted m-b-8 text-10 p-l-16\"\n          id=\"chat-disclaimer-{{ componentId }}\"\n          role=\"note\"\n        >\n          {{ config.disclaimerText | translate }}\n        </div>\n      }\n    </div>\n  </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: TextareaAutoresizeDirective, selector: "[c8y-textarea-autoresize]" }, { kind: "directive", type: IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: C8yTranslatePipe, name: "translate" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AiChatComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-ai-chat', imports: [C8yTranslatePipe, FormsModule, TextareaAutoresizeDirective, IconDirective, NgClass], standalone: true, host: { class: 'd-contents' }, template: "<div\n  class=\"d-col fit-h fit-w flex-grow\"\n  [attr.aria-label]=\"config.headline | translate\"\n  role=\"region\"\n>\n  @if (messages.length > 0) {\n    <div\n      class=\"inner-scroll flex-grow d-col-reverse min-height-0 bg-level-0\"\n      [attr.aria-label]=\"'Chat conversation' | translate\"\n      aria-live=\"polite\"\n      aria-atomic=\"false\"\n      role=\"log\"\n    >\n      <div class=\"d-col p-l-16 p-r-16\">\n        <ng-content select=\"c8y-ai-chat-message\"></ng-content>\n        <ng-content></ng-content>\n      </div>\n    </div>\n  }\n  <div [ngClass]=\"{ 'd-col fit-h': messages.length === 0 }\">\n    @if (messages.length === 0) {\n      <div\n        class=\"p-24\"\n        aria-live=\"polite\"\n        role=\"status\"\n      >\n        <h4 class=\"m-b-16 text-medium\">{{ config.headline | translate }}</h4>\n        <p class=\"p-b-8 text-balance\">{{ config.title | translate }}</p>\n        <p class=\"text-muted text-balance\">{{ config.welcomeText | translate }}</p>\n      </div>\n    }\n    <div class=\"chat-input bg-level-1\">\n      <div class=\"d-flex inner-scroll a-i-center gap-8 p-l-16 p-r-16 p-b-8\">\n        <ng-content select=\"c8y-ai-chat-suggestion\"></ng-content>\n      </div>\n      <div class=\"chat-input-group\">\n        <label\n          class=\"sr-only\"\n          for=\"chat-input-{{ componentId }}\"\n        >\n          {{ config.placeholder | translate }}\n        </label>\n        <textarea\n          class=\"form-control no-resize\"\n          style=\"max-height: 200px !important\"\n          [attr.aria-label]=\"config.placeholder | translate\"\n          id=\"chat-input-{{ componentId }}\"\n          placeholder=\"{{ config.placeholder | translate }}\"\n          [attr.aria-describedby]=\"config.disclaimerText ? 'chat-disclaimer-' + componentId : null\"\n          [attr.aria-busy]=\"isLoading\"\n          [(ngModel)]=\"prompt\"\n          (keydown.enter)=\"sendMessage($event)\"\n          [disabled]=\"isLoading || disabled\"\n          c8y-textarea-autoresize\n        ></textarea>\n        <div class=\"chat-input-group-btn\">\n          @if (!isLoading) {\n            <button\n              class=\"btn btn-dot\"\n              [attr.title]=\"config.sendButtonText | translate\"\n              [attr.aria-label]=\"config.sendButtonText | translate\"\n              type=\"button\"\n              (click)=\"sendMessage($event)\"\n              [disabled]=\"disabled || prompt.trim().length === 0\"\n            >\n              <i [c8yIcon]=\"config.userInterfaceIcons?.send || 'arrow-circle-right'\"></i>\n            </button>\n          } @else {\n            <button\n              class=\"btn btn-dot btn-dot--danger\"\n              [attr.title]=\"config.cancelButtonText | translate\"\n              [attr.aria-label]=\"config.cancelButtonText | translate\"\n              type=\"button\"\n              (click)=\"cancel()\"\n            >\n              <i [c8yIcon]=\"config.userInterfaceIcons?.cancel || 'stop'\"></i>\n            </button>\n          }\n        </div>\n      </div>\n      @if (config.disclaimerText) {\n        <div\n          class=\"text-muted m-b-8 text-10 p-l-16\"\n          id=\"chat-disclaimer-{{ componentId }}\"\n          role=\"note\"\n        >\n          {{ config.disclaimerText | translate }}\n        </div>\n      }\n    </div>\n  </div>\n</div>\n" }]
        }], propDecorators: { isLoading: [{
                type: Input
            }], disabled: [{
                type: Input
            }], prompt: [{
                type: Input
            }], onMessage: [{
                type: Output
            }], onCancel: [{
                type: Output
            }], messages: [{
                type: ContentChildren,
                args: [AiChatMessageComponent]
            }], config: [{
                type: Input
            }] } });

/**
 * Generated bundle index. Do not edit.
 */

export { AiChatComponent, AiChatMessageActionComponent, AiChatMessageComponent, AiChatSuggestionComponent };
//# sourceMappingURL=c8y-ngx-components-ai-ai-chat.mjs.map
