import useEngineContext from "../../../hooks/useEngineContext";
export var useRuntime = function useRuntime() {
  var _context$appHelper, _context$appHelper$ge, _app$getPlugin, _app$getPlugin$useRun;
  var context = useEngineContext();
  var app = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getApp) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper);
  var _ref = (app === null || app === void 0 || (_app$getPlugin = app.getPlugin) === null || _app$getPlugin === void 0 || (_app$getPlugin = _app$getPlugin.call(app, 'unifiedCommunication')) === null || _app$getPlugin === void 0 || (_app$getPlugin$useRun = _app$getPlugin.useRuntime) === null || _app$getPlugin$useRun === void 0 ? void 0 : _app$getPlugin$useRun.call(_app$getPlugin)) || {},
    runtime = _ref.runtime;
  return {
    runtime: runtime,
    isSecondaryScreen: (runtime === null || runtime === void 0 ? void 0 : runtime.role) === 'secondary-screen'
  };
};