'use strict';

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

const index = require('./index-ee190ee0.js');
const store = require('./store-5a3b44dc.js');
const ionicGlobal = require('./ionic-global-542e0609.js');
const theme = require('./theme-b0b295c1.js');
require('./index-4901314f.js');
require('./getHandlebarsHelpers-8ef28401.js');
require('./_commonjsHelpers-a5111d61.js');
require('./index-ba857994.js');
require('./localforage-af1b8c0e.js');

const selectTemplateCss = "";

const SelectTemplate = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.name = "template";
    this.value = undefined;
    this.jobId = undefined;
    this.disabled = false;
    this.templates = undefined;
    this.placeholder = "Select a Template";
    this.label = "Template";
    this.labelPosition = "stacked";
    this.interface = "popover";
    this.interfaceOptions = undefined;
    this.disablePosition = true;
    this.disableFrame = false;
    this.allowFullscreen = false;
    this.resize = false;
    this.zoom = 1;
    this.preview = false;
  }
  render() {
    const templateOptions = (this.templates || store.state.templates || []).map(({ subject: label, id: value }) => ({ label, value }));
    return (index.h(index.Host, null, templateOptions.length ? (index.h("fireenjin-select", { ref: (el) => (this.templateSelectEl = el), onIonChange: (event) => (this.value = event.target.value), interface: this.interface, interfaceOptions: this.interfaceOptions, name: this.name, label: this.label, labelPosition: this.labelPosition, placeholder: this.placeholder, value: this.value, options: templateOptions }, index.h("ion-button", { slot: "start", fill: "clear", onClick: () => (this.preview = !this.preview) }, index.h("ion-icon", { slot: "icon-only", name: this.preview ? "eye-off" : "eye" })), index.h("ion-button", { slot: "end", fill: "clear", onClick: () => (this.templateSelectEl.value = null) }, index.h("ion-icon", { slot: "icon-only", name: "close-circle" })))) : null, this.preview && this.value && (index.h("floodteam-template", { templateId: this.value, disablePosition: this.disablePosition, disableFrame: this.disableFrame, allowFullscreen: this.allowFullscreen, zoom: this.zoom || 1, resize: this.resize, style: {
        overflowY: "auto",
        height: "30vh",
        display: "block",
        width: "100%",
      } }))));
  }
};
SelectTemplate.style = selectTemplateCss;

const cardTitleIosCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-text-color, #000);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:28px;font-weight:700;line-height:1.2}";

const cardTitleMdCss = ":host{display:block;position:relative;color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}:host{--color:var(--ion-color-step-850, #262626);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;line-height:1.2}";

const CardTitle = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
  }
  render() {
    const mode = ionicGlobal.getIonMode(this);
    return (index.h(index.Host, { role: "heading", "aria-level": "2", class: theme.createColorClasses(this.color, {
        'ion-inherit-color': true,
        [mode]: true,
      }) }, index.h("slot", null)));
  }
};
CardTitle.style = {
  ios: cardTitleIosCss,
  md: cardTitleMdCss
};

exports.floodteam_select_template = SelectTemplate;
exports.ion_card_title = CardTitle;
