Object.defineProperty(exports, "__esModule", { value: true });
let currentBabelFilePath = null;
// this is super unclean!! but there's no other type of context I can use in babel helpers right now
// it should be fine since babel transform is synchronous, only one file can be compiled
// by babel at any given time
function getCurrentBabelFilePath() {
    return currentBabelFilePath;
}
exports.getCurrentBabelFilePath = getCurrentBabelFilePath;
// more global state for babel
let locs = {};
function createLoc(value) {
    // would be nice to just use an integer, but then need to avoid collisions better
    const id = Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(36) +
        Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(36);
    locs[id] = value;
    return id;
}
exports.createLoc = createLoc;
function getAndResetLocs() {
    var ret = locs;
    locs = {};
    return ret;
}
exports.getAndResetLocs = getAndResetLocs;
function getBabelOptions(plugin, extraBabelOptions = {}, url) {
    currentBabelFilePath = url;
    const options = Object.assign({ plugins: [plugin] }, extraBabelOptions, { sourceMaps: false, sourceFileName: url + "?dontprocess", parserOpts: {
            strictMode: false
        }, 
        // prevent code from not being pretty after instrumentation:
        // `[BABEL] Note: The code generator has deoptimised the styling of "unknown" as it exceeds the max of "500KB"`
        compact: false });
    return options;
}
exports.default = getBabelOptions;
//# sourceMappingURL=getBabelOptions.js.map