'use strict';

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

const index = require('./index-fd2bbf0b.js');
const store = require('./store-03756ad8.js');
require('./index-81aa1bcb.js');
require('./getCache-c039a6ae.js');
require('./_commonjsHelpers-a5111d61.js');
require('./logic-d8c34975.js');
require('./index-6307644b.js');

let TemplateBlock = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.zoom = 1;
    this.resize = false;
    this.allowFullscreen = false;
    this.disablePositioning = false;
  }
  componentDidLoad() {
    if (!this.disablePositioning)
      return;
    const renderWrapperEl = this.templateEl.shadowRoot.querySelector(".render-wrapper");
    if (renderWrapperEl)
      renderWrapperEl.style.position = "relative";
  }
  render() {
    var _a, _b;
    const template = this.template ||
      ((_b = (_a = store.state === null || store.state === void 0 ? void 0 : store.state.templates) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (template) => (template === null || template === void 0 ? void 0 : template.id) === this.templateId));
    const helpers = this.helpers || (store.state === null || store.state === void 0 ? void 0 : store.state.helpers) || {};
    const partials = (this.partials || (store.state === null || store.state === void 0 ? void 0 : store.state.templates) || [])
      .filter((template) => !!(template === null || template === void 0 ? void 0 : template.partial))
      .map((partial) => ({
      html: (partial === null || partial === void 0 ? void 0 : partial.html) || "",
      id: (partial === null || partial === void 0 ? void 0 : partial.id) || null,
    }));
    return (index.h("fireenjin-render-template", { ref: (el) => (this.templateEl = el), disableFrame: true, template: template, templateId: this.templateId, data: this.data, helpers: helpers, partials: partials, zoom: this.zoom, allowFullscreen: this.allowFullscreen, resize: this.resize, rawHtml: this.rawHtml }));
  }
};

exports.floodteam_template = TemplateBlock;

//# sourceMappingURL=floodteam-template.cjs.entry.js.map