'use strict';

const tslib_es6 = require('../../../../../tslib@2.8.1/node_modules/tslib/tslib.es6.cjs');
const React = require('react');

function _interopNamespaceCompat(e) {
    if (e && typeof e === 'object' && 'default' in e) return e;
    const n = Object.create(null);
    if (e) {
        for (const k in e) {
            n[k] = e[k];
        }
    }
    n.default = e;
    return n;
}

const React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);

var SideCar = function (_a) {
    var sideCar = _a.sideCar, rest = tslib_es6.__rest(_a, ["sideCar"]);
    if (!sideCar) {
        throw new Error('Sidecar: please provide `sideCar` property to import the right car');
    }
    var Target = sideCar.read();
    if (!Target) {
        throw new Error('Sidecar medium not found');
    }
    return React__namespace.createElement(Target, tslib_es6.__assign({}, rest));
};
SideCar.isSideCarExport = true;
function exportSidecar(medium, exported) {
    medium.useMedium(exported);
    return SideCar;
}

exports.exportSidecar = exportSidecar;
