"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.restoreAppDataUseCaseDI = void 0;
const rxjs_1 = require("rxjs");
const restoreAppDataUseCase_1 = require("./restoreAppDataUseCase");
const restoreAppData_1 = require("./restoreAppData");
const deleteAppDataUseCaseDI_1 = require("./deleteAppDataUseCaseDI");
/**
 * Dependency injection function for the restoreAppDataUseCase.
 *
 * @param transport - The transport object used to communicate with the Ledger device.
 * @param appName - The name of the application to restore.
 * @param deviceModelId - The device model ID.
 * @param storageProvider - The storage provider object used for retrieving the backup data.
 * @returns An observable that emits RestoreAppDataEvent during the restore process.
 */
function restoreAppDataUseCaseDI(transport, appName, deviceModelId, storageProvider) {
    return (0, restoreAppDataUseCase_1.restoreAppDataUseCase)(appName, deviceModelId, storageProvider, data => (0, restoreAppData_1.restoreAppData)(transport, appName, data)).pipe((0, rxjs_1.switchMap)(() => (0, deleteAppDataUseCaseDI_1.deleteAppDataUseCaseDI)(appName, deviceModelId, storageProvider)));
}
exports.restoreAppDataUseCaseDI = restoreAppDataUseCaseDI;
//# sourceMappingURL=restoreAppDataUseCaseDI.js.map