'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-75aef097.js');
const locale = require('./locale-ff30a5f3.js');

const mapCommentsToActionListModel = (comments) => {
    return comments.map(comment => {
        return {
            id: comment,
            type: "actionable",
            caption: comment
        };
    });
};

const selectRecentCommentCss = ":host{display:grid;block-size:100%}.opacity-0{opacity:0}.gxi-hidden{display:none !important}.align-center{display:flex;align-items:center}.align-end{display:flex;align-items:end}.overflow-auto{overflow:auto}:host(.gx-ide-component){height:100% !important;display:flex !important;flex-direction:column !important}.gx-ide-main-wrapper{color:var(--gx-ide-component-text-color);font-weight:var(--font-style-regular);font-size:var(--font-size-body-m);font-family:var(--font-family-body);height:100%;display:flex;flex-direction:column;flex-grow:1;box-sizing:border-box}.buttons-container{display:flex;gap:var(--spacing-gap-m)}.giu-static-pill-icon-and-text,.giu-static-pill{background-color:var(--elevation-background-color, var(--color-accent-surface-elevation-1));padding-inline:var(--spacing-padding-m);color:var(--color-text-neutral-default);font-size:var(--font-size-body-s);line-height:var(--line-height-relaxed);font-weight:var(--font-style-regular);border-radius:4px;min-block-size:25px;display:inline-grid;align-items:center;pointer-events:none;inline-size:max-content}.giu-static-pill-icon-and-text{display:inline-grid;grid-auto-flow:column;grid-auto-columns:max-content;gap:var(--spacing-gap-m)}.tab-full-width-buttons::part(tab-list block-start),.tab-full-width-buttons::part(tab-list block-end){grid-auto-columns:1fr}.tab-full-width-buttons::part(tab block-start){justify-content:center}.tree-view::part(item__header){--icon__system_warning_warning--disabled:var(\n    --icon__system_warning_warning--enabled\n  )}.tabular-grid{--focus-outline-width:1px}button.button-secondary{border-color:var(--color-border-neutral-default)}:host{display:grid;block-size:100%;grid-template-rows:1fr max-content}.section{display:contents}.main{contain:size;overflow:auto}.list-box{block-size:100%}";

const CSS_BUNDLES = [
    // Use only the bundles that are needed for this component.
    "resets/box-sizing",
    "components/button",
    "components/list-box",
    "utils/layout",
    "utils/spacing"
];
const GxIdeTeamDevSelectRecentComment = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.componentDidRenderFirstTime = index.createEvent(this, "componentDidRenderFirstTime", 7);
        this.selectedComment = null;
        this.commentSelectionChangedHandler = (event) => {
            if (event.detail.length > 0) {
                this.selectedComment = event.detail[0].item.id;
            }
        };
        this.confirmCallbackHandle = async () => {
            await this.confirmCallback(this.selectedComment);
        };
        this.cancelCallbackHandle = async () => {
            await this.cancelCallback();
        };
        this.comments = undefined;
        this.commentsActionList = [];
        this.confirmCallback = undefined;
        this.cancelCallback = undefined;
    }
    async componentWillLoad() {
        this._componentLocale = await locale.Locale.getComponentStrings(this.el);
        this.commentsActionList = mapCommentsToActionListModel(this.comments);
    }
    render() {
        return (index.h(index.Host, { class: "widget" }, index.h("ch-theme", { model: CSS_BUNDLES }), index.h("section", { class: "section" }, index.h("div", { class: "main" }, index.h("ch-action-list-render", { class: "list-box recent-comments-list", selection: "single", model: this.commentsActionList, onSelectedItemsChange: this.commentSelectionChangedHandler })), index.h("footer", { class: "footer dialog-footer-with-border spacing-body-block-end spacing-body-inline" }, index.h("div", { class: "buttons-spacer" }, index.h("button", { class: "button-secondary", id: "button-cancel", onClick: this.cancelCallbackHandle, part: "button-cancel" }, this._componentLocale.cancelButton), index.h("button", { class: "button-primary", id: "button-confirm", onClick: this.confirmCallbackHandle, part: "button-confirm" }, this._componentLocale.confirmButton))))));
    }
    static get assetsDirs() { return ["gx-ide-assets/team-dev-select-recent-comment"]; }
    get el() { return index.getElement(this); }
};
GxIdeTeamDevSelectRecentComment.style = selectRecentCommentCss;

exports.gx_ide_team_dev_select_recent_comment = GxIdeTeamDevSelectRecentComment;

//# sourceMappingURL=gx-ide-team-dev-select-recent-comment.cjs.entry.js.map