'use strict';

var React = require('react');
var isSvgComponent = require('./utils/is-svg-component.js');
var SVGVisualElement = require('../../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js');
var HTMLVisualElement = require('../../../../../../../motion-dom@12.38.0/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js');

const createDomVisualElement = (Component, options) => {
    /**
     * Use explicit isSVG override if provided, otherwise auto-detect
     */
    const isSVG = options.isSVG ?? isSvgComponent.isSVGComponent(Component);
    return isSVG
        ? new SVGVisualElement.SVGVisualElement(options)
        : new HTMLVisualElement.HTMLVisualElement(options, {
            allowProjection: Component !== React.Fragment,
        });
};

exports.createDomVisualElement = createDomVisualElement;
