(function(){"use strict";function n(n,t,i,r,u,f,e,o){function p(){var n=ct.customer.clientStore.getItem(ct.utls.storageKeys.ProductLogos);n||e.GetLogo(function(n){ct.customer.clientStore.setItem(ct.utls.storageKeys.ProductLogos,JSON.stringify(n))})}function w(){n.$apply(function(){n.showContactCdWindow=!0});ct.customer.utls.initializeKendoWindow(c,"","","",!0,b);c.data("kendoWindow").center().open();var t=c.data("kendoWindow");t.wrapper.addClass("cdimention-popup")}function b(){o(function(){n.showContactCdWindow=!1},1)}var h,l,a,v,s,y,c;if(f.log("run customer"),n.clientName="ContactPortal",r.defaults.headers.common[ct.utls.headerKeys.ApplicationType]="ContactPortal",h=null,ct.utls.isNullOrEmpty(ct.customer.clientStore.getItem(ct.utls.storageKeys.SignInResponse))||(h=JSON.parse(ct.customer.clientStore.getItem(ct.utls.storageKeys.SignInResponse))),l=window.location.hash.length>0,window.location.search.indexOf("login")>=0&&signinCustomer(),h)n.accessToken==undefined&&(n.accessToken=h.access_token);else if(!l&&!ct.utls.isHomePage()&&!ct.utls.isRedirectPage()&&!ct.utls.isContentPage()){a=window.location.search.indexOf("refreshUser")>=0;window.location.pathname==="/login"||a||ct.customer.clientStore.setItem(ct.customer.storageKeys.PostLoginRedirectUrl,window.location.pathname+window.location.search);signinCustomer();throw new Error("You are not login.");}ct.utls.isHomePage()||(v=ct.customer.clientStore.getItem(ct.customer.storageKeys.CustomerFirstTimeUser),v&&(s=JSON.parse(ct.customer.clientStore.getItem(ct.utls.storageKeys.SignInResponse)),s&&(y={userReference:s.profile.sub,UserId:s.profile.contactuserid,MarketId:s.profile.contactmarketid},r.defaults.headers.common[ct.utls.headerKeys.FirstTimeUser]=JSON.stringify(y))));$("#contact-us-form").click(function(){w()});n.showContactCdWindow=!1;c=$("#contactUsCdFormWindow");ct.utls.isContentPage()||p();n.cpToggleSlide=function(n,t){$("#"+n).slideToggle("slow");var i=$("#"+t)[0];i&&(i.className=i.className.indexOf("accordion-minus")>=0?"accordion-plus":"accordion-minus")};n.RedirectToYourBooking=function(n){var t={BookingNumber:n.BookingNumber,Season:n.Season,ComponentNumber:n.ComponentNumber};ct.customer.clientStore.setItem(ct.customer.storageKeys.BookingsNavigationInfo,JSON.stringify(t));window.location.href="/account/yourbooking"}}angular.module("ct.customerPortal",["ngRoute","ngCookies","kendo.directives","ui.router","ct.common","cp.ngConfirm"]).run(n);n.$inject=["$rootScope","$location","$cookies","$http","globalConstants","$log","generalService","$timeout"]})()