var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var App;
(function (App) {
    var Service = /** @class */ (function () {
        function Service() {
        }
        return Service;
    }()); // Service class
    App.Service = Service;
    var HttpHandlerService = /** @class */ (function (_super) {
        __extends(HttpHandlerService, _super);
        function HttpHandlerService($http) {
            var _this = _super.call(this) || this;
            _this.httpService = $http;
            return _this;
        }
        HttpHandlerService.prototype.useGetHandler = function (params) {
            var _this = this;
            var result = this.httpService({ method: 'GET', url: this.handlerUrl, params: params })
                .then(function (response) { return _this.handlerResponded(response, params); });
            return result;
        };
        HttpHandlerService.prototype.usePostHandler = function (params) {
            var _this = this;
            var result = this.httpService.post(this.handlerUrl, params)
                .then(function (response) { return _this.handlerResponded(response, params); });
            return result;
        };
        HttpHandlerService.prototype.handlerResponded = function (response, params) {
            //response.data.requestParams = params;
            return response.data;
        };
        return HttpHandlerService;
    }(Service)); // HttpHandlerService class
    App.HttpHandlerService = HttpHandlerService;
})(App || (App = {}));
//# sourceMappingURL=service.js.map;
/// <reference path="service.ts"/>
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var App;
(function (App) {
    var ClientService = /** @class */ (function (_super) {
        __extends(ClientService, _super);
        function ClientService($http) {
            return _super.call(this, $http) || this;
        }
        ClientService.prototype.GetClientInfo = function (clientCallLetters) {
            this.handlerUrl = WebAPIUrl + 'api/Client/GetClientInfo';
            var params = { callLetters: clientCallLetters };
            return this.useGetHandler(params);
        };
        ClientService.prototype.GetSignupSettings = function (cID) {
            this.handlerUrl = WebAPIUrl + 'api/Client/GetSignupSettings';
            var params = { clientID: cID };
            return this.useGetHandler(params);
        };
        ClientService.prototype.GetClientDisclaimer = function (cID) {
            this.handlerUrl = WebAPIUrl + 'api/Client/ClientDisclaimer';
            var params = { clientID: cID };
            return this.useGetHandler(params);
        };
        ClientService.prototype.GetClientGenderText = function (cID) {
            this.handlerUrl = WebAPIUrl + 'api/Client/ClientGenderText';
            var params = { clientID: cID };
            return this.useGetHandler(params);
        };
        ClientService.prototype.GetNationalClientCallLetters = function (clientCallLetters) {
            this.handlerUrl = WebAPIUrl + 'api/Client/GetNationalClientCallLetters';
            var params = { callLetters: clientCallLetters };
            return this.useGetHandler(params);
        };
        ClientService.prototype.GetCountryEmailsOptInMessage = function (countryID, clientID, lang) {
            this.handlerUrl = WebAPIUrl + 'api/Client/CountryEmailsOptInMessage';
            var params = { countryID: countryID, clientID: clientID, lang: lang };
            return this.useGetHandler(params);
        };
        ClientService.$inject = ['$http'];
        return ClientService;
    }(App.HttpHandlerService)); // ClientService class
    App.ClientService = ClientService;
})(App || (App = {}));
//# sourceMappingURL=clientService.js.map;
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var App;
(function (App) {
    var ParticipantService = /** @class */ (function (_super) {
        __extends(ParticipantService, _super);
        function ParticipantService($http) {
            return _super.call(this, $http) || this;
        }
        ParticipantService.prototype.GetParticipantSignupAward = function (pID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetSignupAward';
            var params = { participantID: pID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetParticipantSurveyAward = function (pID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetSurveyAward';
            var params = { participantID: pID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetBasicParticipantInfo = function (pID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetBasicInfo';
            var params = { participantID: pID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetParticipantInfo = function (pID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetParticipantInfo';
            var params = { participantid: pID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetRadioHabitsQuestions = function (pID, cID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetRadioHabitQuestions';
            var params = { participantID: pID, clientID: cID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetPreferencesQuestions = function (pID, cID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetPreferencesQuestions';
            var params = { participantID: pID, clientID: cID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.SavePreferences = function (pID, cID, qs) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/SavePreferences';
            //public class RadioHabits {
            //    public int ParticipantID;
            //    public int ClientID;
            //    public List<Question> Questions;
            //}
            var rh = {
                ParticipantID: pID,
                ClientID: cID,
                Questions: qs
            };
            return this.usePostHandler(rh);
        };
        ParticipantService.prototype.GetMontages = function (cID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetMontageSettings';
            var params = { clientID: cID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetMontagesForParticipant = function (cID, pID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetMontagesForParticipant';
            var params = { clientID: cID, participantID: pID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.SaveMontages = function (pID, m, cq) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/SaveMontages';
            var ms = { Montages: m, ConclusionQuestion: cq, ParticipantID: pID };
            return this.usePostHandler(ms);
        };
        ParticipantService.prototype.GetThanksForSubscribingMessage = function (pID, cID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetThanksForSubscribingMessage';
            var params = { participantID: pID, clientID: cID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.SaveRadioHabits = function (pID, cID, qs) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/SaveRadioHabits';
            //public class RadioHabits {
            //    public int ParticipantID;
            //    public int ClientID;
            //    public List<Question> Questions;
            //}
            var rh = {
                ParticipantID: pID,
                ClientID: cID,
                Questions: qs
            };
            return this.usePostHandler(rh);
        };
        ParticipantService.prototype.UpdateProfile = function (p) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/UpdateProfile';
            return this.usePostHandler(p);
        };
        ParticipantService.prototype.GetParticipantEntities = function (eml) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetParticipantEntities';
            var params = { email: eml };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetPersonalInfoRequest = function (rID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetPersonalInfoRequest';
            var params = { requestID: rID };
            return this.useGetHandler(params);
        };
        ParticipantService.prototype.GetPersonalInfoData = function (rID, pID) {
            this.handlerUrl = WebAPIUrl + 'api/Participant/GetPersonalInfoData';
            var params = { requestID: rID, participantID: pID };
            return this.useGetHandler(params);
        };
        ParticipantService.$inject = ['$http'];
        return ParticipantService;
    }(App.HttpHandlerService)); // ParticipantService class
    App.ParticipantService = ParticipantService;
})(App || (App = {}));
//# sourceMappingURL=participantService.js.map;
/// <reference path="service.ts"/>
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var App;
(function (App) {
    var SystemService = /** @class */ (function (_super) {
        __extends(SystemService, _super);
        function SystemService($http) {
            //this.handlerUrl = WebAPIUrl + 'api/System/';
            return _super.call(this, $http) || this;
        }
        SystemService.prototype.GetEthnicities = function () {
            this.handlerUrl = WebAPIUrl + 'api/System/Ethnicities';
            var params = {};
            return this.useGetHandler(params);
        };
        SystemService.prototype.GetCountries = function () {
            this.handlerUrl = WebAPIUrl + 'api/System/Countries';
            var params = {};
            return this.useGetHandler(params);
        };
        SystemService.prototype.GetStates = function () {
            this.handlerUrl = WebAPIUrl + 'api/System/States';
            var params = {};
            return this.useGetHandler(params);
        };
        SystemService.prototype.GetDisclaimer = function () {
            this.handlerUrl = WebAPIUrl + 'api/System/Disclaimer';
            var params = {};
            return this.useGetHandler(params);
        };
        SystemService.prototype.GetExternalLogin = function (provider, clientCallLetters, redirectUri) {
            this.handlerUrl = WebAPIUrl + "api/Account/ExternalLogin?provider=" + provider
                + "&response_type=token&client_id=" + clientCallLetters
                + "&redirect_uri=" + redirectUri;
            var params = {};
            return this.useGetHandler(params);
        };
        SystemService.prototype.GetContactOptions = function (clientID) {
            this.handlerUrl = WebAPIUrl + 'api/System/ContactOptions';
            var params = { clientID: clientID };
            ;
            return this.useGetHandler(params);
        };
        SystemService.prototype.PostSupportRequest = function (request) {
            this.handlerUrl = WebAPIUrl + 'api/System/SupportRequest';
            return this.usePostHandler(request);
        };
        SystemService.$inject = ['$http'];
        return SystemService;
    }(App.HttpHandlerService)); // SystemService class
    App.SystemService = SystemService;
})(App || (App = {}));
//# sourceMappingURL=systemService.js.map;
/// <reference path="service.ts"/>
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var App;
(function (App) {
    var SurveyService = /** @class */ (function (_super) {
        __extends(SurveyService, _super);
        function SurveyService($http) {
            //this.handlerUrl = WebAPIUrl + 'api/Survey/GetSurveys';
            return _super.call(this, $http) || this;
        }
        SurveyService.prototype.GetSurveys = function (pID) {
            this.handlerUrl = WebAPIUrl + 'api/Survey/GetSurveys';
            var params = { participantID: pID };
            return this.useGetHandler(params);
        };
        SurveyService.prototype.GetSurveyDetails = function (sID, pID) {
            if (pID > 0) {
                this.handlerUrl = WebAPIUrl + 'api/Survey/GetSurveyDetails';
                var params = { surveyID: sID, participantID: pID };
            }
            else {
                this.handlerUrl = WebAPIUrl + 'api/Survey/GetSurveyPreviewDetails';
                var params = { surveyID: sID };
            }
            return this.useGetHandler(params);
        };
        SurveyService.prototype.GetSurveyMessage = function (cID, sID, pID, p) {
            this.handlerUrl = WebAPIUrl + 'api/Survey/GetSurveyMessage';
            var params = { clientID: cID, surveyID: sID, participantID: pID, page: p };
            return this.useGetHandler(params);
        };
        SurveyService.prototype.GetSurveySongs = function (sID, pID) {
            this.handlerUrl = WebAPIUrl + 'api/Survey/GetSurveySongs';
            var params = { surveyID: sID, participantID: pID };
            return this.useGetHandler(params);
        };
        SurveyService.prototype.GetSurveyQuestionSet = function (qsetID, clID) {
            this.handlerUrl = WebAPIUrl + 'api/Survey/GetSurveyQuestionSet';
            var params = { qsID: qsetID, clientID: clID };
            return this.useGetHandler(params);
        };
        SurveyService.prototype.SaveQuestionSetAnswers = function (pID, sID, qs) {
            //SaveQuestionSetAnswers(int participantID, int surveyID, int quesionSetID, int surveyMediaID, List<Question> questions)
            this.handlerUrl = WebAPIUrl + 'api/Survey/SaveQuestionSetAnswers';
            qs.ParticipantID = parseInt(pID);
            qs.SurveyID = parseInt(sID);
            return this.usePostHandler(qs);
        };
        SurveyService.$inject = ['$http'];
        return SurveyService;
    }(App.HttpHandlerService)); // SurveyService class
    App.SurveyService = SurveyService;
})(App || (App = {}));
//# sourceMappingURL=surveyService.js.map;
/// <reference path="service.ts"/>
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var App;
(function (App) {
    var ResultService = /** @class */ (function (_super) {
        __extends(ResultService, _super);
        function ResultService($http) {
            return _super.call(this, $http) || this;
        }
        ResultService.prototype.GetTopSongs = function (cID) {
            this.handlerUrl = WebAPIUrl + 'api/Results/TopSongs';
            var params = { clientID: cID };
            return this.useGetHandler(params);
        };
        ResultService.prototype.GetTopSongsForFormat = function (cID, fID) {
            this.handlerUrl = WebAPIUrl + 'api/Results/TopSongsPerFormat';
            var params = { clientID: cID, formatID: fID };
            return this.useGetHandler(params);
        };
        ResultService.$inject = ['$http'];
        return ResultService;
    }(App.HttpHandlerService)); //ResultService class
    App.ResultService = ResultService;
})(App || (App = {}));
//# sourceMappingURL=resultService.js.map;
