var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var isCombiSiteOpen = isCombiSiteOpen;
var CombiSiteInfoController = /** @class */ (function (_super) {
    __extends(CombiSiteInfoController, _super);
    function CombiSiteInfoController($scope, $http, $log, $routeParams, $q, $location, $window, $timeout, $anchorScroll, $cookies, utilityService, deeplinkValidationService) {
        var _this = _super.call(this, $scope, $http, $log, $window, $timeout, $location, $anchorScroll, utilityService) || this;
        _this.isEnteringLoadMainPage = false;
        _this.isExistingLoadMainPage = false;
        _this.scope = $scope;
        _this.http = $http;
        _this.log = $log;
        _this.routeParams = $routeParams;
        _this.q = $q;
        _this.location = $location;
        _this.timeout = $timeout;
        _this.cookies = $cookies;
        //this.anchorScroll = $anchorScroll;
        $scope.vm = _this;
        $scope.PageLocations = PageLocations;
        $scope.Constants = Constants;
        _this.utilityService = utilityService;
        _super.prototype.SetAndPushPageLocation.call(_this, PageLocations.CombiSiteInfoPageLocation);
        //this.pageLocation = PageLocations.CombiSiteInfoPageLocation;
        //this.PushLocation(PageLocations.CombiSiteInfoPageLocation);
        _this.deeplinkValidationService = deeplinkValidationService;
        _this.utilityService.listenOnWindowResize();
        return _this;
    }
    CombiSiteInfoController.prototype.Init = function (initObject) {
        _super.prototype.Init.call(this, initObject);
        if (!isCombiSiteOpen) {
            this.utilityService.redirectToErrorPage("Combi_NoRangedTicketsForSale");
        }
        //if (!this.deeplinkValidationService.validateCurrentPageLocation(PageLocations.CombiSiteInfoPageLocation,
        //    this.initObject)) {
        //    return;
        //}
        this.scrollToID('combi-site-info');
        //chooses and sets the text on the tab in a combi site
        if (this.initObject.LanguageCode == "da-dk") {
            document.title = "Kombi billet info - LEGOLAND & LEGO House";
        }
        else if (this.initObject.LanguageCode == "de-de") {
            document.title = "Kombi-Eintrittskarte-Info – LEGOLAND & LEGO House";
        }
        else {
            document.title = "Combi ticket info - LEGOLAND & LEGO House";
        }
    };
    CombiSiteInfoController.prototype.goToNextStep = function (form) {
        if (form.$valid) {
            this.isExistingLoadMainPage = true;
            //setTimeout(() => {
            //Insert cookie on first page
            this.cookies.put("YesToTerms", "Yes");
            this.location.path(this.utilityService.getLinkWithLanguage(PageLocations.CombiSitePickTimeSlotPageLocation, this.initObject.LanguageCode));
            this.isExistingLoadMainPage = false;
            //}, 100000);
        }
    };
    return CombiSiteInfoController;
}(IFramePageController));
//# sourceMappingURL=combi-site-info.controller.js.map