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

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

const n = ":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;grid-template-rows:max-content 1fr max-content;height:100%}.dialog-header{margin-block-end:16px}.main-content{grid-auto-rows:max-content}.footer-info{margin-bottom:12px}.description{display:grid;grid-auto-rows:max-content;gap:var(--spacing-gap-m)}";

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

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

var l, c, d, p, f, h, u, b, g, m;

const v = [ "resets/box-sizing", "components/button", "components/checkbox", "components/combo-box", "components/edit", "utils/form", "utils/layout", "utils/typography" ];

const w = class {
  constructor(i) {
    t(this, i);
    /**
         * The component hard-coded strings translations.
         */    l.set(this, void 0);
    c.set(this, void 0);
    d.set(this, void 0);
    p.set(this, void 0);
    f.set(this, (() => {
      this.cancelCallback();
    }));
    h.set(this, (() => {
      if (!s(this, p, "f").value && !s(this, d, "f").value) {
        s(this, c, "f").value = "never";
      } else if (s(this, c, "f").value === "never") {
        s(this, c, "f").value = "prompt";
      }
    }));
    u.set(this, (async () => {
      if (this.saveCallback) {
        const t = {
          importWebPanels: !!s(this, p, "f").value,
          importPanels: !!s(this, d, "f").value,
          futureUpgrades: s(this, c, "f").value ? s(this, c, "f").value : null
        };
        await this.repairCallback(t);
      }
    }));
    b.set(this, (() => {
      var t;
      return e("div", {
        class: "field-group",
        role: "region",
        "aria-label": s(this, l, "f").filters.filtersHeading
      }, e("h5", {
        class: "subtitle-regular-s margin-block-end-s"
      }, s(this, l, "f").filters.filtersHeading), e("div", {
        class: "filters__wrapper"
      }, e("div", {
        class: "field-group",
        role: "group",
        "aria-labelledby": "frontend-objects-label"
      }, e("div", {
        class: "field field-block"
      }, e("label", {
        id: "frontend-objects-label",
        class: "label"
      }, s(this, l, "f").filters.frontEndObjects), e("div", {
        class: "field-group-inline"
      }, e("ch-checkbox", {
        class: "checkbox",
        checkedValue: "webPanels",
        value: ((t = this.defaultConfiguration) === null || t === void 0 ? void 0 : t.importWebPanels) ? "webPanels" : undefined,
        caption: s(this, l, "f").filters.webPanelsCheckbox,
        onInput: s(this, h, "f"),
        ref: t => r(this, p, t, "f"),
        part: "web-panels-checkbox"
      }), e("ch-checkbox", {
        class: "checkbox",
        checkedValue: "panels",
        value: this.defaultConfiguration.importPanels && this.canSelectPanels ? "panels" : undefined,
        caption: s(this, l, "f").filters.panelsCheckbox,
        disabled: !this.canSelectPanels,
        onInput: s(this, h, "f"),
        ref: t => r(this, d, t, "f"),
        part: "panels-checkbox"
      }))), e("div", {
        class: "field field-block"
      }, e("label", {
        class: "label",
        htmlFor: "future-upgrades-combo"
      }, s(this, l, "f").filters.futureUpgradesComboLabel), e("ch-combo-box-render", {
        id: "future-upgrades-combo",
        class: "combo-box",
        value: this.defaultConfiguration.futureUpgrades,
        ref: t => r(this, c, t, "f"),
        model: [ {
          value: "automatic",
          caption: s(this, l, "f").manageFutureUpgrades.installAutomatically
        }, {
          value: "prompt",
          caption: s(this, l, "f").manageFutureUpgrades.promptMe
        }, {
          value: "never",
          caption: s(this, l, "f").manageFutureUpgrades.neverUpdate
        } ],
        part: "future-upgrades-combo"
      })))));
    }));
    g.set(this, (() => e("div", {
      class: "description"
    }, this.configurationType === "installation" ? [ e("p", {
      class: "text-body"
    }, s(this, l, "f").header.headerTextInstallation.firstSentence), e("p", {
      class: "text-body"
    }, s(this, l, "f").header.headerTextInstallation.secondSentence), e("p", {
      class: "text-body"
    }, s(this, l, "f").header.headerTextInstallation.thirdSentence) ] : [ e("p", {
      class: "text-body"
    }, s(this, l, "f").header.headerTextUpdate.firstSentence), e("p", {
      class: "text-body"
    }, s(this, l, "f").header.headerTextUpdate.secondSentence) ])));
    m.set(this, (async () => {
      if (this.saveCallback) {
        const t = {
          importWebPanels: !!s(this, p, "f").value,
          importPanels: !!s(this, d, "f").value,
          futureUpgrades: s(this, c, "f").value ? s(this, c, "f").value : null
        };
        await this.saveCallback(t);
      }
    }));
    this.cancelCallback = undefined;
    this.canSelectPanels = false;
    this.configurationType = "installation";
    this.defaultConfiguration = {
      importWebPanels: true,
      importPanels: false,
      futureUpgrades: "prompt"
    };
    this.repairCallback = undefined;
    this.saveCallback = undefined;
  }
  async componentWillLoad() {
    r(this, l, await o.getComponentStrings(this.el), "f");
  }
  render() {
    return e(i, {
      class: "widget spacing-body"
    }, e("ch-theme", {
      model: v
    }), e("div", {
      class: "dialog-header dialog-header-with-border"
    }, s(this, g, "f").call(this)), e("div", {
      class: "main-content field-group"
    }, s(this, b, "f").call(this)), e("div", {
      class: "footer"
    }, this.configurationType === "update" && e("div", {
      class: "footer-info"
    }, e("p", null, "Use Repair to import GAM components again")), e("div", {
      class: "dialog-footer-with-border dialog-footer-space-between"
    }, this.configurationType === "update" && e("button", {
      id: "repair-button",
      class: "button-secondary",
      onClick: s(this, u, "f"),
      part: "button button--repair"
    }, "Repair"), e("div", {
      class: "buttons-spacer"
    }, e("button", {
      id: "cancel-button",
      class: "button-secondary",
      onClick: s(this, f, "f"),
      part: "button button--cancel"
    }, "Cancel"), e("button", {
      id: "confirm-button",
      class: "button-primary",
      onClick: s(this, m, "f"),
      part: "button button--confirm"
    }, "Save")))));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/gam-installation-settings" ];
  }
  get el() {
    return a(this);
  }
};

l = new WeakMap, c = new WeakMap, d = new WeakMap, p = new WeakMap, f = new WeakMap, 
h = new WeakMap, u = new WeakMap, b = new WeakMap, g = new WeakMap, m = new WeakMap;

w.style = n;

export { w as gx_ide_gam_installation_settings };
//# sourceMappingURL=p-95ee765c.entry.js.map