import { r as registerInstance, h } from './index-33e43734.js';
import { s as state } from './store-be7d1de5.js';
import './index-91eb4513.js';
import './getHandlebarsHelpers-91de4454.js';
import './_commonjsHelpers-4ed75ef8.js';
import './logic-88140d62.js';
import './index-d4e79b88.js';
import './localforage-9daa31d6.js';

let TemplateBlock = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.zoom = 1;
    this.resize = false;
    this.allowFullscreen = false;
    this.disablePositioning = false;
  }
  componentDidLoad() {
    try {
      this.templateEl.shadowRoot.querySelector(".contract-header").remove();
      this.templateEl.shadowRoot.querySelector(".contract-footer").remove();
    }
    catch (e) {
      console.log(e);
    }
    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 = 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 || (state === null || state === void 0 ? void 0 : state.helpers) || {};
    const partials = (this.partials || 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 (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 }));
  }
};

export { TemplateBlock as floodteam_template };

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