{% if atom.doc.features.app.enabled===true %}

import { default as Engine } from "../default/{{ atom.doc.features.app_default_entry_file or atom.doc.features.main_default_entry_file }}";

  {% if atom.doc.features.app.export===true %}
    {% if atom.doc.features.app.extend===true %}
      import { default as init } from '../../../app/index.js';
    {% endif %}
    const createApp = ({ container }) => {
        {% if atom.doc.features.app.extend===true %}
          return init({container,Engine});
        {% else %} 
          return (props) => {
              const engine = new Engine();
              engine.run({ ...props, container }).catch((error) => {
                console.log(error.message)
              });
          }
        {% endif %}
    };
    export { createApp };
  {% else %}
      {% if atom.doc.features.app.extend===true %}
        import { default as run } from '../../../app/index.js';
        run({ Engine }).catch((error) => {
            console.log(error.message)
        });
      {% else %} 
        const engine = new Engine();
        engine.run().catch((error) => {
          console.log(error.message)
        });
      {% endif %}    
  {% endif %}

{% endif %}