/**
 * amis v3.1.0
 * Copyright 2018-2023 baidu
 */

import { __extends, __rest, __assign, __decorate } from 'tslib';
import { isPureVariable, resolveVariableAndFilter, Renderer } from 'amis-core';
import React from 'react';
import { Alert2 } from 'amis-ui';

/** @class */ ((function (_super) {
    __extends(TplRenderer, _super);
    function TplRenderer() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    TplRenderer.prototype.render = function () {
        var _a = this.props, render = _a.render, body = _a.body, level = _a.level, icon = _a.icon, showIcon = _a.showIcon, rest = __rest(_a, ["render", "body", "level", "icon", "showIcon"]);
        if (isPureVariable(level)) {
            level = resolveVariableAndFilter(level, this.props.data);
        }
        if (isPureVariable(icon)) {
            icon = resolveVariableAndFilter(icon, this.props.data);
        }
        if (isPureVariable(showIcon)) {
            showIcon = resolveVariableAndFilter(showIcon, this.props.data);
        }
        return (React.createElement(Alert2, __assign({}, rest, { level: level, icon: icon, showIcon: showIcon }), render('body', body)));
    };
    TplRenderer = __decorate([
        Renderer({
            type: 'alert'
        })
    ], TplRenderer);
    return TplRenderer;
})(React.Component));
