"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var StringUtils_1 = require("../../helpers/StringUtils");
function HaikuVueDOMAdapter(haikuComponentFactory) {
    return {
        props: {
            haikuOptions: Object,
            haikuStates: Object,
            eventHandlers: Object,
            timelines: Object,
            vanities: Object,
            placeholder: Object,
        },
        mounted: function () {
            var _this = this;
            this.haiku = haikuComponentFactory(this.$el, {
                ref: this.$el,
                options: this.$props.haikuOptions,
                states: this.$props.haikuStates,
                eventHandlers: this.$props.eventHandlers,
                timelines: this.$props.timelines,
                vanities: this.$props.vanities,
                placeholder: this.$props.placeholder,
                onHaikuComponentWillInitialize: function (component) {
                    _this.$emit('haikuComponentWillInitialize', component);
                },
                onHaikuComponentDidMount: function (component) {
                    _this.$emit('haikuComponentDidMount', component);
                },
                onHaikuComponentWillMount: function (component) {
                    _this.$emit('haikuComponentWillMount', component);
                },
                onHaikuComponentDidInitialize: function (component) {
                    _this.$emit('haikuComponentDidInitialize', component);
                },
                onHaikuComponentWillUnmount: function (component) {
                    _this.$emit('haikuComponentWillUnmount', component);
                },
            });
        },
        updated: function () {
            this.haiku.assignConfig({
                options: this.$props.haikuOptions,
                states: this.$props.haikuStates,
                eventHandlers: this.$props.eventHandlers,
                timelines: this.$props.timelines,
                vanities: this.$props.vanities,
                placeholder: this.$props.placeholder,
            });
        },
        destroyed: function () {
            this.haiku.callUnmount();
        },
        render: function (createElement) {
            return createElement('div', {
                attrs: {
                    id: 'haiku-vueroot-' + StringUtils_1.randomString(24),
                },
                style: {
                    position: 'relative',
                    margin: 0,
                    padding: 0,
                    border: 0,
                    width: '100%',
                    height: '100%',
                    transform: 'matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)',
                },
            });
        },
    };
}
exports.default = HaikuVueDOMAdapter;
//# sourceMappingURL=HaikuVueDOMAdapter.js.map