System.register([], function (_export, _context) {
  "use strict";

  return {
    setters: [],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_client_vivide_vivide_js = _recorder_._src_client_vivide_vivide_js || {};
      Object.defineProperty(_recorder_._src_client_vivide_vivide_js, 'letsScript', {
        get() {
          return letsScript;
        },

        set(thisIsVererySecretVariableName) {
          _export('letsScript', letsScript = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });

      /**
       * The high level entry point to vivide
       * call at least with some data as Array as argument
       */
      async function letsScript(object, evt, sourceView) {
        // lively.success('LETS_SCRIPT')
        let pos;
        if (evt) {
          pos = lively.getPosition(evt);
        }

        let view = await lively.openComponentInWindow('vivide-view', pos);

        await view.initDefaultScript();
        view.newDataFromUpstream(object);

        if (evt && evt.shiftKey) {
          await view.createScriptEditor();
        }

        if (sourceView) {
          sourceView.connectTo(view);
        }
      }

      _export('letsScript', letsScript);
    }
  };
});