/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { c as _ } from "../../chunks/runtime.js";
import { u as x } from "../../chunks/useT9n.js";
import { LitElement as v, createEvent as r, safeClassMap as y, nothing as c, safeStyleMap as w } from "@arcgis/lumina";
import { useContextConsumer as g } from "@arcgis/lumina/context";
import { css as $, html as i } from "lit";
import { c as C, i as S } from "../../chunks/deployAppContexts.js";
import { y as D, T as n, x as k, A as T } from "../../chunks/interfaces.js";
import { f as h, a as I, b as u } from "../../chunks/cardsHelpers.js";
import { g as O } from "../../chunks/getRelatedInfos.js";
import { k as N, i as m, j as p, h as M } from "../../chunks/helpers.js";
import * as f from "@esri/solution-common";
const U = $`.negative-tabbing-offset[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:-2px}.tabbing-offset[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.font-weight-med{font-weight:var(--calcite-font-weight-medium)}.font-weight-bold{font-weight:var(--calcite-font-weight-bold)}.heading-font{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.title-font{font-size:1.8rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.font-1{font-size:var(--calcite-spacing-lg)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.flex-direction-row{flex-direction:row}@container (min-width: 801px){.font-size-override .display-flex.flex-direction-row>.image-width+.display-flex{flex:1;min-width:0}}.icon-color{color:var(--calcite-color-text-3)}.padding-bottom-lg{padding-bottom:var(--calcite-spacing-lg)}.item-padding{--calcite-internal-accordion-item-padding: var(--calcite-spacing-xl)}.align-items-center{align-items:center}.align-items-start{align-items:start}.font-size-override{--calcite-font-size--2: var(--calcite-font-size--1)}.background-color-1{background-color:var(--calcite-color-surface-2)}.background-color-2{background-color:var(--calcite-color-surface-3)}.label-override{--calcite-label-margin-bottom: var(--calcite-spacing-none)}.position-relative{position:relative}.overflow-hidden{overflow:hidden}.overflow-auto{overflow:auto}.margin-block-start-end-0{margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}.panel-background-2{--calcite-panel-background-color: var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-3)}.panel-background-1{--calcite-panel-background-color: var(--calcite-color-surface-2);--calcite-shell-panel-background-color: var(--calcite-color-surface-2)}.border-none{border:none}.font-color-1{color:var(--calcite-color-text-1)}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-surface-2);--calcite-panel-background-color: var(--calcite-color-surface-2)}.dialog-y-size{--calcite-dialog-size-y: 90% }.dialog-x-size{--calcite-dialog-size-x: 90% }.bottom-border{border-bottom:solid var(--calcite-spacing-px);color:var(--calcite-color-border-1)}.margin-start-end-xxl{margin-inline-start:var(--calcite-spacing-xxl);margin-inline-end:var(--calcite-spacing-xxl)}.margin-start-end-lg{margin-inline-start:var(--calcite-spacing-lg);margin-inline-end:var(--calcite-spacing-lg)}.margin-top-xxl{margin-top:var(--calcite-spacing-xxl)}.justify-between{justify-content:space-between}.items-baseline{align-items:baseline}.padding-xxl{padding:var(--calcite-spacing-xxl)}.padding-lg{padding:var(--calcite-spacing-lg)}.padding-top-xxl{padding-top:var(--calcite-spacing-xxl)}.padding-top-lg{padding-top:var(--calcite-spacing-lg)}.padding-bottom-xxl{padding-bottom:var(--calcite-spacing-xxl)}.padding-end-1{padding-inline-end:var(--calcite-spacing-lg)}.padding-end-xxl{padding-inline-end:var(--calcite-spacing-xxl)}.padding-start-sm{padding-inline-start:var(--calcite-spacing-sm)}.padding-start-xxl{padding-inline-start:var(--calcite-spacing-xxl)}.image-width{width:300px;flex-grow:0;flex-shrink:0}@container (max-width: 1280px){.image-width{flex-grow:0;flex-shrink:1}}img{max-width:100%;height:auto;overflow-clip-margin:content-box;overflow:clip;display:block}.margin-xl{margin:var(--calcite-spacing-xl)}.line-height-1{line-height:1.1}.line-height-xxl{line-height:var(--calcite-line-height-xxl)}@container (max-width: 800px){.font-size-override .display-flex.flex-direction-row{flex-direction:column!important}.image-width{width:100%!important;max-width:100%!important;margin:0!important;padding:var(--calcite-spacing-lg)!important;padding-bottom:0!important;box-sizing:border-box}.image-width img{width:100%;max-width:100%}.margin-xl{margin:0!important}.image-width+.display-flex{padding-inline-start:var(--calcite-spacing-lg)!important;padding-inline-end:var(--calcite-spacing-lg)!important}.padding-start-sm{padding-inline-start:0!important}.title-font{padding-inline-start:0!important;padding-top:var(--calcite-spacing-lg)!important;padding-bottom:var(--calcite-spacing-lg)!important}.align-items-start.padding-bottom-xxl,.padding-bottom-xxl.padding-start-sm{padding-bottom:var(--calcite-spacing-lg)!important}}calcite-shell-panel{--calcite-shell-panel-max-width: 20rem;--calcite-shell-panel-width: 24vw}calcite-shell{block-size:unset}.solution-deployed-action{--calcite-color-focus: initial}.solution-deployed-action.padding-bottom-lg,.solution-deployed-action.padding-bottom-1{padding-bottom:0;margin-bottom:var(--calcite-spacing-lg)}.solution-deployed-action.padding-top-1{padding-top:0;margin-top:var(--calcite-spacing-lg)}.chipClass{padding-left:var(--calcite-spacing-sm)!important;padding-right:var(--calcite-spacing-sm)!important}.skeleton-loader{background:linear-gradient(90deg,var(--calcite-color-foreground-1) 0%,var(--calcite-color-foreground-2) 50%,var(--calcite-color-foreground-1) 100%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:var(--calcite-border-radius)}.skeleton-folder{height:1.5rem;width:12rem;border-radius:var(--calcite-border-radius)}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}`;
class V extends v {
  constructor() {
    super(), this.diagramKey = "", this.open = !1, this.readOnlyNotice = "", this.templateInfos = [], this._accordionLoading = !1, this._configureTitlesOpen = !1, this._deleteDialogOpen = !1, this._hasNewVersion = !1, this._hasSourceSolution = !1, this._isDiagramOpen = !1, this._isNameConflict = !1, this._invalidNameMessage = "", this._showFailedAlert = !1, this._showItemUpdateLoading = !1, this.isMobile = !1, this._templateInfoGraph = [], this._thumbnailUrl = "", this._folderName = "", this._folderId = null, this._folderLoading = !1, this._translations = x({ name: "solution-deployed-card-panel", blocking: !0 }), this._configContextConsumer = g({
      context: C,
      subscribe: !0,
      callback: async (e) => {
        e && (this._isOrgAdmin = D(e.authentication), this._user = e.authentication?.Portal?.user);
      }
    }), this._isOrgAdmin = !1, this._isMobileContextConsumer = g({
      context: S,
      subscribe: !0,
      callback: (e) => this.isMobile = e
    }), this.navTabSelected = r(), this.forceSelectTab = r(), this.sortTypeChanged = r(), this.solutionConfigureDialogClose = r(), this._nonSolutionDependencyItems = [], this._openFolder = (e) => {
      e.stopPropagation(), this._telemetry?.logEvent({
        category: n.DEPLOYMENTS,
        action: "Open Folder",
        dimensions: [
          this.card?.title || "",
          this.card?.deployCommonId || "",
          this.card?.deployVersion || "",
          "Details Page"
        ]
      });
      const t = this._configContextConsumer.value?.orgUrl;
      if (!t)
        return;
      const a = this._configContextConsumer.value?.userSession?.username, l = this.card?.owner === a;
      let o;
      if (l) {
        const s = this._folderId || this.card?.owner;
        o = `${t}/home/content.html?folder=${s}`;
      } else
        this._folderId ? o = `${t}/home/content.html?user=${this.card?.owner}&folder=${this._folderId}` : o = `${t}/home/content.html?user=${this.card?.owner}&folder=${this.card?.owner}`;
      window.open(o, "_blank");
    }, this._openSourceSolutionDetails = async (e) => {
      e.stopPropagation(), this._telemetry?.logEvent({
        category: n.DEPLOYMENTS,
        action: "Open Details",
        dimensions: [
          this.card?.title || "",
          this.card?.deployCommonId || "",
          this.card?.deployVersion || ""
        ]
      }), await new Promise((a) => setTimeout(a, 100));
      const t = h(this._configContextConsumer.value.allCards, this.card.deployCommonId);
      t && this.forceSelectTab.emit({ tabType: "details", tabTitleOrId: t });
    }, this.listenOn(window, "deployedCardSelected", this._deployedCardSelected), this.listenOn(window, "deployAppTabSelected", this._handleDeployAppTabSelected), this.listenOn(window, "displayDeployedCard", () => {
      N({
        kind: "success",
        icon: "check-circle",
        title: this._translations.deploySuccessAlert.replace("{{solutionTitle}}", this.card?.title ?? ""),
        message: "",
        autoClose: !0,
        autoCloseDuration: "medium"
      });
    }), this.listenOn(window, "sessionRefreshed", (e) => {
      this._updateThumbnailToken(e.detail);
    });
  }
  static {
    this.properties = { card: 0, cardRef: 1, diagramKey: 1, open: 5, readOnlyNotice: 1, templateInfos: 0, _accordionLoading: 16, _configureTitlesOpen: 16, _deleteDialogOpen: 16, _hasNewVersion: 16, _hasSourceSolution: 16, _isDiagramOpen: 16, _isNameConflict: 16, _invalidNameMessage: 16, _showFailedAlert: 16, _showItemUpdateLoading: 16, isMobile: 16, _templateInfoGraph: 16, _thumbnailUrl: 16, _folderName: 16, _folderId: 16, _folderLoading: 16, _translations: 16, _nonSolutionDependencyItems: 16 };
  }
  static {
    this.styles = U;
  }
  get _telemetry() {
    return this._configContextConsumer.value?.telemetrySession;
  }
  async load() {
    if (this._isMobileContextConsumer.value && (this.isMobile = this._isMobileContextConsumer.value), this.card?.thumbnailUrl) {
      const e = this._configContextConsumer.value?.userSession, t = this.card?.thumbnailUrl.replace(/w=\d+/, "w=400");
      this._thumbnailUrl = `${t}&token=${e?.token}`;
    }
  }
  willUpdate(e) {
    if (e.has("card")) {
      const t = this._configContextConsumer.value?.userSession, a = this.card?.thumbnailUrl.replace(/w=\d+/, "w=400");
      this._thumbnailUrl = `${a}&token=${t?.token}`, this._folderLoading = !0, this._folderName = "", this._folderId = null;
    }
  }
  render() {
    const e = this.card && this.card.typeKeywords?.includes("AIAssistant");
    return this.isMobile ? i`<calcite-shell class="position-relative background-color-2"><calcite-panel class="panel-background-2 border-none" slot=panel-bottom><div class="background-color-2 padding-top-lg">${this._getSolutionPanel()}</div><div class="background-color-1 margin-top-xxl">${this._getButtons()}${this._getOwnerSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getFolderSection()}${!e && i`<div class="bottom-border margin-start-end-xxl"></div>` || ""}${!e && this._getSolutionVersionCard() || ""}</div>${this._getSolutionContents()}</calcite-panel></calcite-shell>` : i`<calcite-shell class="position-relative background-color-2"><calcite-panel class="padding-end-xxl panel-background-2 border-none" slot=panel-bottom><div class="display-flex flex-direction-column overflow-hidden"><div class="background-color-2 padding-top-xxl">${this._getSolutionPanel()}</div>${this._getSolutionContents()}</div></calcite-panel><calcite-shell-panel class="panel-background-1" slot=panel-end>${this._getButtons()}${this._getOwnerSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getFolderSection()}${!e && i`<div class="bottom-border margin-start-end-xxl"></div>` || ""}${!e && this._getSolutionVersionCard() || ""}</calcite-shell-panel>${this._renderDiagramDialog()}${this._getConfigureTitlesDialog()}${this._getDeleteDialog()}</calcite-shell>`;
  }
  async _deployedCardSelected(e) {
    const t = e.detail;
    this.card = t.card, this.cardRef = t.cardRef, this.templateInfos = [], this._accordionLoading = !0, this.templateInfos = await this._getTemplates(), this._accordionLoading = !1;
    const a = await O(this._configContextConsumer.value.userSession, this.card);
    this._nonSolutionDependencyItems = a._nonSolutionDependencyItems;
    const l = I(this._configContextConsumer.value?.allCards || [], this.card.deployCommonId);
    this._hasSourceSolution = !!l;
    let o = !1;
    if (l) {
      const s = u(l), d = u(this.card);
      o = s > d;
    }
    this._hasNewVersion = o, this._folderLoading = !0, this._folderName = "", this._folderId = null, await this._fetchFolderInfo(), this._folderLoading = !1;
  }
  _handleDeployAppTabSelected(e) {
    e.detail === "deployed-card" && this.sortTypeChanged.emit("");
  }
  _getButtons() {
    const e = this._configContextConsumer.value?.userSession?.username, t = this._configContextConsumer.value?.authentication?.CanUpdateSolution, a = this._configContextConsumer.value?.authentication?.CanDeleteSolution && this._configContextConsumer.value?.authentication?.CanUpdateSolution, l = m(this._configContextConsumer.value), o = this.card?.owner === e || this._isOrgAdmin || t, s = this.card?.owner === e || this._isOrgAdmin || a, d = o ? "display-none" : "", b = this.isMobile ? "padding-lg" : "padding-xxl";
    return i`<div class=${`display-flex flex-direction-column ${b}`}>${!this.isMobile && i`<calcite-button appearance=outline-fill class="padding-bottom-1 solution-deployed-action" kind=neutral @click=${this._openDiagram} scale=m width=full>${this._translations.viewTheDiagram}</calcite-button>` || ""}<calcite-button appearance=outline-fill class="padding-bottom-1 solution-deployed-action" kind=neutral @click=${this._viewDocumentation} scale=m width=full>${this._translations.solutionDocumentation}</calcite-button><calcite-button appearance=outline-fill class="padding-bottom-1 solution-deployed-action" kind=neutral @click=${this._openItemDetails} scale=m width=full>${this._translations.itemDetails}</calcite-button>${o && !this.isMobile && i`<calcite-button appearance=outline-fill class="padding-bottom-1 solution-deployed-action" .disabled=${l} id=solution-configure-titles-button kind=neutral @click=${this._openConfigureTitlesDialog} scale=m width=full>${this._translations.updateTitles}</calcite-button><calcite-tooltip class=${y(d)} overlay-positioning=fixed reference-element=solution-configure-titles-button><span>${this._translations.mustOwnSolution}</span></calcite-tooltip>` || ""}${s && !this.isMobile && i`<calcite-button appearance=outline-fill class="padding-bottom-1 solution-deployed-action" .disabled=${l} kind=neutral @click=${this._deleteSolution} scale=m width=full>${this._translations.deleteSolution}</calcite-button>` || ""}</div>`;
  }
  _getReadOnlyNotice() {
    return i`<calcite-notice class="padding-bottom-lg" icon=exclamation-mark-triangle kind=warning open scale=s><div slot=message .innerHTML=${this.readOnlyNotice ?? ""}></div></calcite-notice>`;
  }
  _openConfigureTitlesDialog() {
    this._configureTitlesOpen = !0;
  }
  _getConfigureTitlesDialog() {
    return this._configureTitlesOpen ? i`<solution-configure-titles .card=${this.card} @solutionConfigureTitlesBeforeClose=${async () => {
      this.templateInfos = await this._getTemplates(), this._configureTitlesOpen = !1;
    }} @solutionItemsTitlesChanged=${async () => {
      this.templateInfos = await this._getTemplates();
    }} .open=${this._configureTitlesOpen} source="Details Page" .templateInfos=${this.templateInfos}></solution-configure-titles>` : "";
  }
  _viewDocumentation(e) {
    e.stopPropagation(), this._telemetry?.logEvent({
      category: n.DEPLOYMENTS,
      action: "Open Help",
      dimensions: [
        this.card?.title || "",
        this.card?.deployCommonId || "",
        this.card?.deployVersion || "",
        "Details Page",
        p(this.card?.typeKeywords)
      ]
    }), window.open(this.card.learnMoreUrl, "_blank");
  }
  _openItemDetails(e) {
    e.stopPropagation(), this._telemetry?.logEvent({
      category: n.DEPLOYMENTS,
      action: "Open Item Details",
      dimensions: [
        this.card?.title || "",
        this.card?.deployCommonId || "",
        this.card?.deployVersion || "",
        "Details Page",
        p(this.card?.typeKeywords)
      ]
    }), window.open(this.card.itemUrl, "_blank");
  }
  _getOwnerSection() {
    if (!this._configContextConsumer?.value)
      return;
    const e = this.isMobile ? "margin-start-end-lg" : "margin-start-end-xxl";
    return i`<div class=${`display-flex padding-bottom-xxl ${e} flex-direction-column`}><div class="display-flex justify-between items-baseline"><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l tabindex=0>${this._translations.aboutYourSolutionOwner}</calcite-label></div><solution-user-avatar .fullname=${this._user?.username === this.card?.owner ? this._user?.fullName : void 0} .lookupProfile=${this._user?.username !== this.card?.owner} .thumbnailUrl=${this._user?.username === this.card?.owner ? this._user?.thumbnailUrl : void 0} .username=${this.card?.owner}></solution-user-avatar></div>`;
  }
  async _openDiagram(e) {
    e.stopPropagation();
    const t = await this._getTemplates();
    t && (this._telemetry?.logEvent({
      category: n.DEPLOYMENTS,
      action: "View Diagram",
      dimensions: [
        this.card?.title || "",
        this.card?.deployCommonId || "",
        this.card?.deployVersion || "",
        "Details Page",
        p(this.card?.typeKeywords)
      ]
    }), this._templateInfoGraph = t, this._isDiagramOpen = !0);
  }
  async _getTemplates() {
    return this.cardRef ? await this.cardRef.getTemplates() : this.card ? await k(this.card.id, this._configContextConsumer.value.userSession) : void 0;
  }
  async _fetchFolderInfo() {
    if (this.card?.id)
      try {
        const e = this._configContextConsumer.value?.userSession;
        if (!e)
          return;
        const t = await f.getItemBase(this.card.id, e);
        if (this._folderId = t.ownerFolder ?? null, this._folderId) {
          const a = await f.getUserFolder(this.card.owner, this._folderId, e);
          this._folderName = a?.currentFolder?.title || this._folderId;
        } else
          this._folderName = this.card.owner || "Root";
      } catch (e) {
        console.error("Error fetching folder info:", e), this._folderId = null, this._folderName = "";
      }
  }
  _getFolderSection() {
    const e = this.isMobile ? "padding-lg" : "padding-xxl", a = !this._folderId ? "home" : "folder";
    return i`<div class=${`${e} display-flex flex-direction-column`}><div class="display-flex justify-between items-baseline"><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l slot=heading tabindex=0>${this._translations.folder}</calcite-label><calcite-button appearance=transparent aria-label=${this._translations.openFolder ?? c} .disabled=${this._folderLoading} kind=neutral icon-start=launch2 @click=${this._openFolder}>${this._translations.openFolder}</calcite-button></div><div class="display-flex"><div class="display-flex flex-direction-row padding-top-lg align-items-center">${this._folderLoading ? i`<div class="skeleton-loader skeleton-folder"></div>` : i`<calcite-icon aria-hidden=true class="icon-color" .icon=${a} scale=m></calcite-icon><div class="display-flex flex-direction-column padding-start-xxl"><span class="tabbing-offset" tabindex=0>${this._folderName || "Root"}</span></div>`}</div></div></div>`;
  }
  _getSolutionVersionCard() {
    const e = this._hasNewVersion ? this._translations.newVersionAvailable : this._translations.youHaveTheLatestVersion, t = this.isMobile ? "padding-lg" : "padding-xxl";
    return i`<div class=${`${t} display-flex flex-direction-column`}><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l slot=heading tabindex=0>${this._translations.solutionVersion.replace("{{version}}", this.card?.deployVersion || "")}</calcite-label><div class="display-flex"><div class="display-flex flex-direction-row padding-top-lg align-items-center"><calcite-icon aria-hidden=true class="icon-color" icon=clock-forward scale=m></calcite-icon><div class="display-flex flex-direction-column padding-start-xxl"><span class="tabbing-offset" tabindex=0>${e}</span></div></div></div>${this._hasNewVersion ? i`<calcite-button appearance=outline-fill class="padding-top-1 solution-deployed-action" kind=neutral @click=${this._openNewVersionSolution} scale=m width=full>${this._translations.learnMoreNewVersion}</calcite-button>` : this._hasSourceSolution ? i`<calcite-button appearance=outline-fill class="padding-top-1 solution-deployed-action" kind=neutral @click=${this._openSourceSolutionDetails} scale=m width=full>${this._translations.openDetails}</calcite-button>` : null}</div>`;
  }
  async _openNewVersionSolution(e) {
    e.stopPropagation(), this._telemetry?.logEvent({
      category: n.DEPLOYMENTS,
      action: "View Latest Version",
      dimensions: [
        this.card?.title || "",
        this.card?.deployCommonId || "",
        this.card?.deployVersion || ""
      ]
    }), await new Promise((a) => setTimeout(a, 100));
    const t = h(this._configContextConsumer.value.allCards, this.card.deployCommonId);
    t && this.forceSelectTab.emit({ tabType: "details", tabTitleOrId: t });
  }
  _getSolutionPanel() {
    const e = this.card && this.card.typeKeywords?.includes("AIAssistant");
    return i`<calcite-panel class="font-size-override panel-background-1"><div class="display-flex flex-direction-row"><div class="image-width margin-xl"><img alt=${this.card?.title ?? c} src=${this._thumbnailUrl ?? c}></div><div class="display-flex flex-direction-column"><h1 class="title-font margin-block-start-end-0 padding-end-xxl padding-start-sm padding-top-xxl padding-bottom-xxl line-height-1 negative-tabbing-offset" tabindex=0>${this.card?.title}${e && this._getChips() || ""}</h1><div class="display-flex flex-direction-column padding-bottom-xxl padding-start-sm"><div class="display-flex align-items-start padding-bottom-xxl"><div class="font-1 padding-end-1 line-height-xxl negative-tabbing-offset" tabindex=0>${this.card?.snippet}</div></div><div class="display-flex"><div class="display-flex"><calcite-label class="label-override icon-color tabbing-offset" layout=inline tabindex=0><calcite-icon aria-hidden=true class="icon-color" icon=projects scale=s></calcite-icon>${this._translations.aboutYourSolutionDeployedDate.replace("{{deployedDate}}", this.card?.created || "")}</calcite-label></div></div>${m(this._configContextConsumer.value) && i`<div class="display-flex flex-direction-row padding-end-xxl" style=${w({ paddingTop: "1rem" })}>${this._getReadOnlyNotice()}</div>` || ""}</div></div></div></calcite-panel>`;
  }
  _getSolutionContents() {
    const e = this.card ? M(this._nonSolutionDependencyItems, this.card.id) : [];
    return i`<calcite-panel class="panel-background-1 padding-top-xxl"><calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded><div class="margin-block-start-end-0 heading-font " slot=content-start>${this._translations.solutionsContentsAndCount.replace("{{numberOfSolutions}}", this.templateInfos.length.toString())}</div><div class="overflow-auto">${this._accordionLoading ? i`<calcite-loader .label=${this._translations.loadingText} scale=m></calcite-loader>` : i`<solution-item-accordion .itemRelationshipDependencies=${e} .listSelectionMode=${e.length > 0 ? "multiple" : "single"} .reuseWarning=${this._translations.itemUsedInOtherSolutions} .templateInfos=${this.templateInfos} .typeKeywords=${this.card?.typeKeywords}></solution-item-accordion>`}</div></calcite-accordion-item></calcite-accordion></calcite-panel>`;
  }
  _getDeleteDialog() {
    return this._deleteDialogOpen ? i`<solution-delete-dialog .card=${this.card} @solutionDeleted=${() => setTimeout(() => this.navTabSelected.emit({ tabType: "deployments" }), 100)} @solutionDeleteDialogBeforeClose=${() => {
      this._deleteDialogOpen = !1;
    }} .open=${this._deleteDialogOpen} source="Details Page"></solution-delete-dialog>` : "";
  }
  _renderDiagramDialog() {
    return this._isDiagramOpen ? i`<calcite-dialog class="dialog-y-size dialog-x-size panel-bg-color" .heading=${this._translations.diagramOfTheSolution.replace("{{solution}}", this.card?.title ?? "")} id=${this._translations.diagramOfTheSolution.replace("{{solution}}", this.card?.title ?? "") ?? c} modal .open=${this._isDiagramOpen} @calciteDialogClose=${() => {
      this._isDiagramOpen = !1;
    }} outside-close-disabled scale=m width=l><solution-item-diagram .diagramKey=${this.diagramKey !== "" ? this.diagramKey : this._configContextConsumer.value?.diagramKey ?? ""} .templateInfoGraph=${this._templateInfoGraph} .typeKeywords=${this.card?.typeKeywords}></solution-item-diagram></calcite-dialog>` : "";
  }
  _getChips() {
    return i`<calcite-chip class="chipClass" icon=effects .label=${this._translations.builtWithAI} scale=s>${this._translations.builtWithAI}</calcite-chip>`;
  }
  async _deleteSolution() {
    this._deleteDialogOpen = !0;
  }
  _updateThumbnailToken(e) {
    this._thumbnailUrl !== "" && (this._thumbnailUrl = T(this._thumbnailUrl, e));
  }
}
_("solution-deployed-card-panel", V);
export {
  V as SolutionDeployedCardPanel
};
