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

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

const mapTypesToComboBoxItemModel = t => {
  const e = [];
  t.forEach((t => {
    const s = {
      value: t.value,
      caption: t.caption
    };
    e.push(s);
  }));
  return e;
};

const n = "button.button-secondary{border-color:var(--color-border-neutral-default)}:host{display:grid;block-size:100%;overflow:hidden;grid-template-rows:1fr max-content}.checkbox{inline-size:max-content}";

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

var c = undefined && undefined.__classPrivateFieldSet || function(t, e, s, i, o) {
  if (i === "m") throw new TypeError("Private method is not writable");
  if (i === "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 i === "a" ? o.call(t, s) : o ? o.value = s : e.set(t, s), s;
};

var h, l, d, f, u, p, b, m, w;

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

const g = class {
  constructor(i) {
    t(this, i);
    h.set(this, void 0);
    l.set(this, e(`./gx-ide-assets/bpm-sync-gam-roles/shortcuts.json`));
    d.set(this, []);
    f.set(this, void 0);
    u.set(this, void 0);
    p.set(this, void 0);
    b.set(this, (() => {
      if (this.cancelCallback) {
        this.cancelCallback();
      }
    }));
    m.set(this, (async () => {
      var t;
      if (this.saveCallback) {
        const e = {
          automaticBackup: !!((t = r(this, f, "f")) === null || t === void 0 ? void 0 : t.value),
          syncType: r(this, p, "f").value
        };
        await this.saveCallback(e);
      }
    }));
    w.set(this, (() => s("footer", {
      class: "dialog-footer dialog-footer-with-border spacing-body-block-end spacing-body-inline"
    }, s("div", {
      class: "buttons-spacer"
    }, s("button", {
      class: "button-secondary",
      id: "button-cancel",
      onClick: r(this, b, "f"),
      part: "button-cancel"
    }, r(this, h, "f").footer.cancelButtonText), s("button", {
      class: "button-primary",
      id: "button-create",
      onClick: r(this, m, "f"),
      part: "button-ok"
    }, r(this, h, "f").footer.okButtonText)))));
    this.cancelCallback = undefined;
    this.saveCallback = undefined;
  }
  async componentWillLoad() {
    c(this, h, await a.getComponentStrings(this.el), "f");
    c(this, d, mapTypesToComboBoxItemModel(r(this, h, "f").main.synchronizationTypeOptions), "f");
  }
  /**
     * Suspends or reactivates the shortcuts
     */  async suspendShortcuts(t) {
    if (t) {
      r(this, u, "f").suspend = true;
    } else {
      r(this, u, "f").suspend = false;
    }
  }
  render() {
    return s(i, {
      class: "widget"
    }, s("ch-theme", {
      model: y
    }), s("ch-shortcuts", {
      src: r(this, l, "f"),
      ref: t => c(this, u, t, "f")
    }), s("section", {
      class: "section spacing-body"
    }, s("div", {
      class: "main field-group"
    }, s("div", {
      class: "field field-block"
    }, s("label", {
      class: "label",
      htmlFor: "synch-type"
    }, r(this, h, "f").main.synchronizationTypeLabel), s("ch-combo-box-render", {
      accessibleName: "Synchronization types",
      class: "combo-box",
      id: "synch-type",
      value: r(this, d, "f")[0].caption,
      model: r(this, d, "f"),
      ref: t => c(this, p, t, "f")
    })), s("ch-checkbox", {
      class: "checkbox",
      caption: r(this, h, "f").main.checkBoxLabel,
      checkedValue: "true",
      ref: t => c(this, f, t, "f")
    }))), r(this, w, "f").call(this));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/bpm-sync-gam-roles" ];
  }
  get el() {
    return o(this);
  }
};

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

g.style = n;

export { g as gx_ide_bpm_sync_gam_roles };
//# sourceMappingURL=p-b5f2603f.entry.js.map