import { r as e, h as t, H as o, a as r } from "./p-9b9ccd0c.js";

import { f as s } from "./p-4d330836.js";

import { L as i } from "./p-311eedf3.js";

const a = ":host{display:flex;flex-direction:column;height:100%}.comment-item{display:flex;flex-direction:column;gap:var(--control-mer-control-label-vertical-spacing, 4px)}.comments-list{display:flex;flex-direction:column;gap:var(--spacing-gap-xl);list-style:none;margin:0;padding:0}.divider{border:none;border-top:1px solid var(--color-border-surface-on-elevation-1, #333d47);margin:0}.row{display:flex;flex-direction:column;gap:var(--spacing-gap-xl)}.comments-container{overflow-y:auto;flex:1}.comment-title{color:var(--color-text-neutral-neutral)}";

var n = undefined && undefined.__classPrivateFieldGet || function(e, t, o, r) {
  if (o === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
  if (typeof t === "function" ? e !== t || !r : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return o === "m" ? r : o === "a" ? r.call(e) : r ? r.value : t.get(e);
};

var l = undefined && undefined.__classPrivateFieldSet || function(e, t, o, r, s) {
  if (r === "m") throw new TypeError("Private method is not writable");
  if (r === "a" && !s) throw new TypeError("Private accessor was defined without a setter");
  if (typeof t === "function" ? e !== t || !s : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return r === "a" ? s.call(e, o) : s ? s.value = o : t.set(e, o), o;
};

var c, d, m, p;

const f = [ "resets/box-sizing", "utils/form--full", "utils/layout", "utils/typography", "utils/spacing", "chameleon/scrollbar" ];

const h = class {
  constructor(o) {
    e(this, o);
    c.set(this, void 0);
    d.set(this, (e => t("div", {
      class: "comment-item"
    }, t("header", null, t("span", {
      class: "body-semi-bold-s comment-title"
    }, s(new Date(e.date)), " - ", e.user)), t("p", {
      class: "body-regular-m"
    }, e.comment))));
    m.set(this, (() => t("footer", {
      class: "control-footer-with-border spacing-body"
    }, t("div", {
      class: "buttons-spacer"
    }, t("button", {
      class: "button-primary",
      onClick: n(this, p, "f")
    }, n(this, c, "f").buttons.close)))));
    p.set(this, (async () => {
      await this.closeCallback();
    }));
    this.commentsData = [];
    this.closeCallback = undefined;
  }
  async componentWillLoad() {
    l(this, c, await i.getComponentStrings(this.el), "f");
  }
  render() {
    return t(o, {
      class: "widget"
    }, t("ch-theme", {
      model: f
    }), t("div", {
      class: "spacing-body comments-container scrollable"
    }, t("ul", {
      class: "comments-list"
    }, this.commentsData.map(((e, o) => t("li", {
      class: "row"
    }, n(this, d, "f").call(this, e), o < this.commentsData.length - 1 && t("hr", {
      class: "divider"
    })))))), n(this, m, "f").call(this));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/comments-viewer" ];
  }
  get el() {
    return r(this);
  }
};

c = new WeakMap, d = new WeakMap, m = new WeakMap, p = new WeakMap;

h.style = a;

export { h as gx_ide_comments_viewer };
//# sourceMappingURL=p-056955be.entry.js.map