'use strict';

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

const index = require('./index-0b1e2673.js');

const styleCss = ".sc-payfunc-accounts-h{display:block;width:100%;max-width:90em;margin:auto}payfunc-account-create-popup.sc-payfunc-accounts{bottom:3.5em;margin-right:2.5em}";

const PayfuncAccounts = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.updateAccounts = index.createEvent(this, "updateAccounts", 7);
    this.selected = {};
  }
  componentWillLoad() {
    this.accountsChanged();
  }
  accountsChanged() {
    if (!this.accountsFiltered)
      this.accountsFiltered = this.accounts;
  }
  handleFilterChanged(event) {
    this.accountsFiltered = event.detail;
    event.stopPropagation();
  }
  handleSelectedChanged(event) {
    this.selected = event.detail;
  }
  onCreate(e) {
    this.updateAccounts.emit(e.detail);
  }
  render() {
    return [
      index.h("payfunc-filter", { filter: this.filter, value: this.accounts }),
      index.h("payfunc-accounts-actions", { whitelist: this.whitelist, selected: this.selected }),
      index.h("payfunc-accounts-table", { accounts: this.accountsFiltered, orders: this.orders, selected: this.selected, whitelist: this.whitelist }),
      index.h("payfunc-account-create-popup", { hidden: true, onCreate: (e) => this.onCreate(e) }),
      index.h("payfunc-accounts-footer", { accounts: this.accountsFiltered }),
    ];
  }
  static get watchers() { return {
    "accounts": ["accountsChanged"]
  }; }
};
PayfuncAccounts.style = styleCss;

exports.payfunc_accounts = PayfuncAccounts;
