"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.canUseHubDownloadApi = canUseHubDownloadApi;
const canUseCreateReplica_1 = require("./canUseCreateReplica");
const canUseHubDownloadSystem_1 = require("./canUseHubDownloadSystem");
/**
 * Determines if the Hub Download API can be used for the given entity.
 * @param entity entity to check if Hub Download API can be used
 * @param context ArcGIS context
 * @returns whether the Hub Download API can be used
 */
function canUseHubDownloadApi(entity, context) {
    var _a;
    const isDownloadApiAvailable = ((_a = context.serviceStatus) === null || _a === void 0 ? void 0 : _a["hub-downloads"]) === "online";
    return (isDownloadApiAvailable &&
        ((0, canUseHubDownloadSystem_1.canUseHubDownloadSystem)(entity) || (0, canUseCreateReplica_1.canUseCreateReplica)(entity)));
}
//# sourceMappingURL=canUseHubDownloadApi.js.map