"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const uninstallApp_1 = __importDefault(require("./uninstallApp"));
const rxjs_1 = require("rxjs");
const backupAppDataUseCaseDI_1 = require("../device/use-cases/appDataBackup/backupAppDataUseCaseDI");
function uninstallAppWithBackup(transport, targetId, app, deviceId, storage, skipAppDataBackup = false) {
    const backup = (0, backupAppDataUseCaseDI_1.backupAppDataUseCaseDI)(transport, app.name, deviceId, storage);
    const uninstall = (0, uninstallApp_1.default)(transport, targetId, app);
    return skipAppDataBackup ? uninstall : (0, rxjs_1.concat)(backup, uninstall);
}
exports.default = uninstallAppWithBackup;
//# sourceMappingURL=uninstallAppWithBackup.js.map