import { c as u } from "../../chunks/runtime.js";
import { html as c } from "lit-html";
import { LitElement as v, createEvent as b, noShadowRoot as f, nothing as x } from "@arcgis/lumina";
/*! All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
v4.33.18 */
class I extends v {
  constructor() {
    super(...arguments), this.geosceneManageVersion = b();
  }
  static {
    this.properties = { versionItemElementProps: 0 };
  }
  static {
    this.shadowRootOptions = f;
  }
  render() {
    const { versionItemElementProps: { currentUser: d, currentVersionIdentifier: m, isVersionAdministrator: g, isVersioningApiAvailable: p, serviceUrl: t, strings: { actions: n }, versionInfo: e } } = this, s = e.versionIdentifier.name, V = s.substring(s.lastIndexOf(".") + 1), a = s.substring(0, s.lastIndexOf(".")), r = e.versionIdentifier.guid, l = `actionSwitchToVersion_${r}`, o = a.toUpperCase() === d.toUpperCase() && p || g, i = m.guid === e.versionIdentifier.guid, h = c`<calcite-action appearance=transparent .disabled=${i} id=${l ?? x} icon=code-branch text @click=${() => {
      this.geosceneManageVersion.emit({ actionType: "changeVersion", serviceUrl: t, versionInfo: e });
    }} slot=actions-start></calcite-action>`, $ = i ? void 0 : c`<calcite-tooltip overlay-positioning=fixed .referenceElement=${l}><span>${n.switchToVersion}</span></calcite-tooltip>`;
    return c`<calcite-list-item .description=${a} .label=${V} .value=${r}>${h}${$}<calcite-action-menu overlay-positioning=fixed slot=actions-end label><calcite-action .disabled=${i} icon=code-branch @click=${() => {
      this.geosceneManageVersion.emit({ actionType: "changeVersion", serviceUrl: t, versionInfo: e });
    }} scale=s .text=${n.switchToVersion} text-enabled></calcite-action><calcite-action .disabled=${!o || i} icon=code-branch-edit @click=${() => {
      this.geosceneManageVersion.emit({ actionType: "editVersion", serviceUrl: t, versionInfo: e });
    }} scale=s .text=${n.editVersion} text-enabled></calcite-action><calcite-action .disabled=${!o || o && i} icon=trash @click=${() => {
      this.geosceneManageVersion.emit({ actionType: "deleteVersion", serviceUrl: t, versionInfo: e });
    }} scale=s .text=${n.deleteVersion} text-enabled></calcite-action></calcite-action-menu></calcite-list-item>`;
  }
}
u("geoscene-version-management-version-item", I);
export {
  I as GeosceneVersionManagementVersionItem
};