"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocationExtent = getLocationExtent;
const extent_1 = require("../../../extent");
/**
 * Get the extent from the entity's location, if it has one.
 * Otherwise, fall back to using the org extent.
 */
async function getLocationExtent(location, hubRequestOptions) {
    var _a;
    return ((_a = location === null || location === void 0 ? void 0 : location.extent) === null || _a === void 0 ? void 0 : _a.length)
        ? (0, extent_1.bBoxToExtent)(location.extent)
        : await (0, extent_1.orgExtent)(hubRequestOptions);
}
//# sourceMappingURL=getLocationExtent.js.map