'use strict';

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

const index = require('./index-22fd9091.js');
require('./index-a20d8492.js');
const runStore = require('./runStore-bfd81991.js');

const BaseLink = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.routeChange = index.createEvent(this, "routeChange", 7);
    this.style = [];
    this.color = "--cj-color-primary";
    this.hoverColor = "--cj-color-secondary";
    this.decoration = "--cj-link-decoration";
    this.hoverDecoration = "--cj-link-hover-decoration";
  }
  async componentWillLoad() {
    await this.computeStyles();
  }
  async computeStyles() {
    const hash = await (await Promise.resolve().then(function () { return require('./style-2b3a6185.js'); }).then(function (n) { return n.style; })).calculateStyles(this);
    this.hash = hash;
  }
  renderLink() {
    if (runStore.runState.router) {
      const defaultProps = runStore.href(this.href, runStore.runState.router);
      const overwrittenProps = Object.assign(Object.assign({}, defaultProps), { onClick: (ev) => {
          this.routeChange.emit({ type: "routechange", newUrl: this.href });
          if (typeof defaultProps.onClick === "function")
            defaultProps.onClick(ev);
          window.scrollTo({ top: 0 });
        } });
      return (index.h("a", Object.assign({}, overwrittenProps, { class: this.hash }), index.h("slot", null)));
    }
    return (index.h("a", { href: this.href, class: this.hash }, index.h("slot", null)));
  }
  render() {
    return index.h(index.Host, { class: this.hash }, this.renderLink());
  }
};

const CorejamBox = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    //@todo check if props are valid
    this.display = "block";
    this.droppableElements = ["corejam-box"];
  }
  async componentWillRender() {
    const hash = await (await Promise.resolve().then(function () { return require('./style-2b3a6185.js'); }).then(function (n) { return n.style; })).calculateStyles(this);
    this.hash = hash;
  }
  render() {
    return (index.h(index.Host, { class: this.hash }, index.h("slot", null)));
  }
};

exports.corejam_base_link = BaseLink;
exports.corejam_box = CorejamBox;
