import { r as registerInstance, h, g as getElement } from './chunk-82a2445c.js';
var DrupalNode = /** @class */ (function () {
    function DrupalNode(hostRef) {
        registerInstance(this, hostRef);
    }
    DrupalNode.prototype.componentDidLoad = function () {
        this.postRender();
    };
    DrupalNode.prototype.componentDidUpdate = function () {
        this.postRender();
    };
    DrupalNode.prototype.postRender = function () {
        var bodyField = this.el.querySelector('.field--name-body');
        if (this.data.attributes.body) {
            bodyField.innerHTML = this.data.attributes.body.value;
        }
        else {
            bodyField.innerHTML = '';
        }
    };
    DrupalNode.prototype.parseNode = function (node) {
        // console.log(node);
        var type = node.type.split('--')[1];
        return node;
    };
    DrupalNode.prototype.render = function () {
        var data;
        if (this.dataJson) {
            data = this.data = this.parseNode(JSON.parse(this.dataJson).data);
        }
        return (h("article", { id: 'node-' + data.attributes.nid, class: 'node node--type-' + data.type.split('--')[1] + ' node--view-mode-full clearfix' }, h("header", null, h("h2", { class: "title node__title" }, data.attributes.title)), h("div", { class: "node__content clearfix" }, h("div", { class: "field field--name-body" }), data.attributes.field_iframe &&
            h("div", { class: "field field--name-iframe" }, h("ema-iframe", { src: data.attributes.field_iframe.uri, width: data.attributes.field_width, height: data.attributes.field_height })))));
    };
    Object.defineProperty(DrupalNode.prototype, "el", {
        get: function () { return getElement(this); },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(DrupalNode, "style", {
        get: function () { return ":root{--ema-color:#343a40;--ema-primary:#007bff;--ema-secondary:#6c757d;--ema-success:#28a745;--ema-info:#17a2b8;--ema-warning:#ffc107;--ema-danger:#dc3545;--ema-light:#f8f9fa;--ema-dark:#343a40;--ema-background:#fff;--ema-background-diap:rgba(29,29,29,0.97);--ema-border-color:#c5c9cd;--ema-border:1px solid #c5c9cd;--ema-border-radius:3px 3px 3px 3px;--ema-box-shadow:1px 1px 10px 1px #ccc;--ema-margin:0.25rem;--ema-margin-sm:0.5rem;--ema-margin-md:1rem;--ema-margin-lg:1.5rem;--ema-margin-xl:2rem;--ema-padding:0.25rem;--ema-padding-sm:0.5rem;--ema-padding-md:1rem;--ema-padding-lg:1.5rem;--ema-padding-xl:2rem;--ema-gray-100:#f8f9fa;--ema-gray-200:#e9ecef;--ema-gray-300:#dee2e6;--ema-gray-400:#ced4da;--ema-gray-500:#adb5bd;--ema-gray-600:#868e96;--ema-gray-700:#495057;--ema-gray-800:#343a40;--ema-gray-900:#212529}ema-drupal-node .node .field{margin-bottom:var(--ema-padding-md,1rem)}"; },
        enumerable: true,
        configurable: true
    });
    return DrupalNode;
}());
export { DrupalNode as ema_drupal_node };
