"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class LiveSyncServiceResolver {
    constructor($errors, $injector, $mobileHelper) {
        this.$errors = $errors;
        this.$injector = $injector;
        this.$mobileHelper = $mobileHelper;
    }
    resolveLiveSyncService(platform) {
        if (this.$mobileHelper.isiOSPlatform(platform)) {
            return this.$injector.resolve("iOSLiveSyncService");
        }
        else if (this.$mobileHelper.isAndroidPlatform(platform)) {
            return this.$injector.resolve("androidLiveSyncService");
        }
        this.$errors.failWithoutHelp(`Invalid platform ${platform}. Supported platforms are: ${this.$mobileHelper.platformNames.join(", ")}`);
    }
}
exports.LiveSyncServiceResolver = LiveSyncServiceResolver;
$injector.register("liveSyncServiceResolver", LiveSyncServiceResolver);
