import { canUseCreateReplica } from "./canUseCreateReplica";
import { canUseHubDownloadSystem } from "./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
 */
export function canUseHubDownloadApi(entity, context) {
    var _a;
    const isDownloadApiAvailable = ((_a = context.serviceStatus) === null || _a === void 0 ? void 0 : _a["hub-downloads"]) === "online";
    return (isDownloadApiAvailable &&
        (canUseHubDownloadSystem(entity) || canUseCreateReplica(entity)));
}
//# sourceMappingURL=canUseHubDownloadApi.js.map