'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index$1 = require('./index-0b1e2673.js');
require('./_commonjsHelpers-937cd5b3.js');
const index = require('./index-36cf3884.js');

const sv = {
  "Create account": "Skapa konto",
  Close: "Stäng",
};

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

const styleCss = ".sc-payfunc-account-create-popup-h{position:sticky;float:right;width:34em;max-width:85%}.sc-payfunc-account-create-popup-h>smoothly-icon.sc-payfunc-account-create-popup{position:relative;cursor:pointer;float:right;z-index:2}.sc-payfunc-account-create-popup-h>payfunc-account-create.sc-payfunc-account-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-payfunc-account-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;transform:rotate(45deg);z-index:2}.sc-payfunc-account-create-popup-h .background.sc-payfunc-account-create-popup{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1}";

const PayfuncAccountCreatePopup = class {
  constructor(hostRef) {
    index$1.registerInstance(this, hostRef);
    this.create = index$1.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
        ? [
          index$1.h("payfunc-account-create", { onClose: (e) => this.onClose(e), onCreateAccount: (e) => this.onCreate(e) }),
          index$1.h("div", { class: "arrow" }),
          index$1.h("div", { class: "background", onClick: () => (this.opened = false) }),
        ]
        : [],
      index$1.h("smoothly-icon", { name: this.opened ? "chevron-down-circle" : "add-circle", size: "large", toolTip: this.opened ? this.t("Close") : this.t("Create account"), onClick: () => (this.opened = !this.opened) }),
    ];
  }
  get element() { return index$1.getElement(this); }
};
PayfuncAccountCreatePopup.style = styleCss;

exports.payfunc_account_create_popup = PayfuncAccountCreatePopup;
