import { r as registerInstance, j as createEvent, h, g as getElement } from './index-07845439.js';
import { d as dist } from './index-63517df5.js';
import './_commonjsHelpers-8fe71198.js';

const sv = {
  "Create customer": "Skapa kund",
  Close: "Stäng",
};

function create(language) {
  return dist.create({
    sv,
  }, language);
}

const styleCss = ".sc-ig-customer-create-popup-h{position:-webkit-sticky;position:sticky;float:right;width:34em;max-width:85%}.sc-ig-customer-create-popup-h>smoothly-icon.sc-ig-customer-create-popup{position:relative;cursor:pointer;float:right;z-index:2}.sc-ig-customer-create-popup-h>ig-customer-create.sc-ig-customer-create-popup{background-color:rgb(var(--smoothly-medium-contrast));border:solid 1px rgb(var(--smoothly-medium-shade));border-radius:.6em;padding-left:1em;padding-right:1em;padding-top:1em;padding-bottom:.5em;position:absolute;right:-1.4em;bottom:4.2em;z-index:2}.arrow.sc-ig-customer-create-popup{background-color:rgb(var(--smoothly-medium-contrast));border-color:rgb(var(--smoothly-medium-shade));width:30px;height:30px;border-bottom-style:solid;border-bottom-width:1px;border-right-style:solid;border-right-width:1px;position:absolute;right:.5em;bottom:3.2em;-webkit-transform:rotate(45deg);transform:rotate(45deg);z-index:2}.sc-ig-customer-create-popup-h .background.sc-ig-customer-create-popup{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1}";

const IntergiroCustomerCreatePopup = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.create = createEvent(this, "create", 7);
    this.opened = false;
    this.visible = false;
  }
  componentWillLoad() {
    this.t = create(this.element);
  }
  onCreate(e) {
    this.create.emit(e.detail);
  }
  onClose(e) {
    this.opened = false;
  }
  render() {
    return [
      this.opened
        ? [
          h("ig-customer-create", { onClose: (e) => this.onClose(e), onCreateCustomer: (e) => this.onCreate(e) }),
          h("div", { class: "arrow" }),
          h("div", { class: "background", onClick: () => (this.opened = false) }),
        ]
        : [],
      h("smoothly-icon", { name: this.opened ? "chevron-down-circle" : "add-circle", size: "large", toolTip: this.opened ? this.t("Close") : this.t("Create customer"), onClick: () => (this.opened = !this.opened) }),
    ];
  }
  get element() { return getElement(this); }
};
IntergiroCustomerCreatePopup.style = styleCss;

export { IntergiroCustomerCreatePopup as ig_customer_create_popup };
