/**
 * DevExtreme (esm/renovation/utils/plugin/getter_extender.js)
 * Version: 22.1.3 (build 22180-0310)
 * Build date: Wed Jun 29 2022
 *
 * Copyright (c) 2012 - 2022 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["order", "type", "value"];
import {
    createVNode
} from "inferno";
import {
    InfernoEffect,
    InfernoComponent
} from "@devextreme/runtime/inferno";
import {
    PluginsContext,
    PluginSelector
} from "./context";
export var viewFunction = () => createVNode(1, "div");
export var GetterExtenderProps = {};
export class GetterExtender extends InfernoComponent {
    constructor(props) {
        super(props);
        this.state = {};
        this.updateExtender = this.updateExtender.bind(this)
    }
    get plugins() {
        if ("PluginsContext" in this.context) {
            return this.context.PluginsContext
        }
        return PluginsContext
    }
    createEffects() {
        return [new InfernoEffect(this.updateExtender, [this.props.value, this.plugins, this.props.type, this.props.order])]
    }
    updateEffects() {
        var _this$_effects$;
        null === (_this$_effects$ = this._effects[0]) || void 0 === _this$_effects$ ? void 0 : _this$_effects$.update([this.props.value, this.plugins, this.props.type, this.props.order])
    }
    updateExtender() {
        var {
            value: value
        } = this.props;
        if (value instanceof PluginSelector) {
            return this.plugins.extend(this.props.type, this.props.order, value.func, value.deps)
        }
        return this.plugins.extend(this.props.type, this.props.order, () => this.plugins.getValue(value), [value])
    }
    get restAttributes() {
        var _this$props = this.props,
            restProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
        return restProps
    }
    render() {
        this.props;
        return viewFunction()
    }
}
GetterExtender.defaultProps = GetterExtenderProps;
