(function(n){"use strict";var t=n.module("hawaiianApp",["ng.shims.placeholder","ngSanitize","haConfigModule","haUtilsModule","haGlobalsModule","haSitecoreModule","haName","haJson","ngPromiseExtras","haTailModule","haDataModule","haDraggableModule","haRevealOnLoadModule","haWhenReadyModule","selectOnClickModule","currencyNoDecimalsFilter","haFootNoteModule","haErrorsModule","haKeyboardModule","haToggleModule","noClickFocusModule","haWindowEventsModule","haCurrencyModule","haLocalizeNameModule","haLocalizeDateModule","haPasswordStrengthModule","haFormValidationModule","haCarouselModule","haCalendarModule","haCalendar2Module","haCalendarEventsModule","shareWidgetModule","haDateInputModule","haLocationInputModule","haRecentSearchesModule","haHelpAndTipsModule","haAlertModule","haDynamicModalModule","haCustomDropdownModule","haAvatarModule","haTooltipModule","haGlobalAlertModule","haGlobalMessageModule","haMapNavigatorModule","haErrorPageModule","haProgressBarModule","haStickyBookingWidgetModule","haPassengerCountModule","haCalendarEventsService","haCustomerSelectionsService","haFavoritesService","haHelpAndTipsService","haModalService","haSearchCacheService","haSegmentService","haUserService","haGlobalHeaderModule","haHeaderSearchModule","exploreHeroModule","exploreMapModule","haGlobalFooterModule","haFormNativeappLinkSmsModule","haNativeAppModalModule","haBookingHeroModule","haCustomDirectivesModule","haFlightStatusModule","haReshopSelectionModalModule","haGlobalAlertsModule","haSearchResultsModule","haFeaturedDealsModule","haMainImageContentBlockModule","haCmsChildNavFrontPageModule","haCmsChildNavSubPageModule","haPhotoGalleryModule","haCmsDetailPageBannerHeadlineModule","haCmsBodyCopyAdModule","haCmsFullWidthPromotionModule","haAdvancedSearchModule","haHomepageModule","haCmsRichTextEditorModule","haCmsBodyCopyWithSidebarModule","haLowFareSearchModule","haFlexiblePriceViewModule","haPriceApiModule","haEcertAPI","ui.mask","ui.keypress","hmTouchEvents","ngTouch","ngAnimate","haPerformanceStatsModule","haDateUtilsModule","haDatepickerModule","haBookingFormModule","haAirportsModule","haInputName","haBookingFormModule","formValidation","haNeatFormsModule","haCartrawlerFormsModule","ui.bootstrap.tabs","ui.bootstrap.accordion","haWatchTrailerModule","haLoadingSpinnerModule","haRegexModule","haHomepageStoriesAndEventsModule","haAriaLiveModule","focusOnDisplayModule","haRoundingFiltersModule","haElementDirectivesModule","haPrimaryNavAccountMenuModule","haPrimaryNavAlertsModule","haKisaTermsModule","haBodyExtensionModule","haSessionTimeoutAPI","haMobileService","haAirportOrAddressInputModule","haHotelsInputModule","haButtonSpinnerModule","haRVFormModule","haIslandGuideMapModule","haDisableOnClickModule","TitleCaseModule","haEncryptionModule","haLaunchDarklyModule","haTimedHideModule","haDealTilesModule","haResponsiveAttributeModule","haPairLinksModule","haDomModalModule","bookingWidgetSlimModule","haDelayAutoplayModule","haAccordionModule"]);t.config(["$logProvider","$sceProvider","$anchorScrollProvider","$provide",function(n,t,i,r){var u=window.location.search.indexOf("debug")>=0,f=window.location.hostname.indexOf("local")===0;n.debugEnabled(u||f);t.enabled(!1);i.disableAutoScrolling();r.decorator("ngModelDirective",["$delegate",function(n){var t=n[0],i=t.controller;return t.controller=["$scope","$element","$attrs","$injector",function(n,t,r,u){var f=r.name,e;f!=null&&f.indexOf("{{")>-1&&(e=u.get("$interpolate"),r.$set("name",e(f)(n)));u.invoke(i,this,{$scope:n,$element:t,$attrs:r})}],n}]);r.decorator("formDirective",["$delegate",function(n){var t=n[0],i=t.controller;return t.controller=["$scope","$element","$attrs","$injector",function(n,t,r,u){var f=r.name||r.ngForm,e;f!=null&&f.indexOf("{{")>-1&&(e=u.get("$interpolate"),r.$set("name",e(f)(n)));u.invoke(i,this,{$scope:n,$element:t,$attrs:r})}],n}])}]);t.run(["$q","$rootScope","haModal","haGlobals","haCitiesSvc","haUtils","haMobileSvc","haConfig",function(t,i,r,u,f,e,o,s){typeof Promise=="undefined"&&(window.Promise=function(n){var i=t.defer();return n(function(n){i.resolve(n)},function(n){i.reject(n)}),i.promise},Promise.resolve=function(n){return new Promise(function(t){t(n)})},Promise.reject=t.reject,Promise.all=t.all);i.haModal=r;i.haCitiesSvc=f;u(["$language","$currency"],function(n,t){i.$language=n;i.$currency=t});i.getMediaImage=function(n){return e.getImageFromSiteCoreString(n)};i.getTemplateUrl=s.getTemplateUrl;i.getRazorTemplateUrl=s.getRazorTemplateUrl;i.getImgUrl=s.getImgUrl;i.csrf=window.tokens;i.moment=moment;i.isMobile=o.determineIsMobile();n.element(window).bind("resize",function(){i.isMobile=o.determineIsMobile();i.$apply()})}])})(angular),function(n){"use strict";var t=n.module("haCmsRichTextEditorModule",[]);t.directive("haCmsRichTextEditor",["$compile",function(n){var t=function(n){n.$emit("$haCmsRichTextEditorReady")},i;return t.$inject=["$scope"],i=function(t,i){var u,f,r;i.find("a").each(function(i,r){var u=$(r).attr("href");typeof u=="string"&&u.indexOf("#")===0&&($(r).attr("ha-scroll-to",u.slice(1)),n(r)(t))});u=$(i);f=u.closest(".column");f.length>0&&(r=u.closest(".two-column-sublayout"),r.length>0&&r.find(".rich-text-col").length===0&&(r.find(".column").removeClass("default-split"),f.addClass("rich-text-col")))},{restrict:"A",scope:!0,link:i,controller:t}}])}(angular),function(n){"use strict";var t=n.module("haAdvancedSearchModule",[]);t.directive("haAdvancedSearch",["haSitecoreStrings","haGlobals","$interpolate",function(n,t,i){var r=function(r){t("ETCOResponseModel",function(t){r.ETCOResponseModel=t;n.get("ReservationsTravelCreditRedemption.GetOffAllRoutesText").then(function(n){r.ecertTitle=i(n)(r)})});r.enableHotelsWidget=r.$switch("BookingWidget:enablehotelwidget");r.enableCarsWidget=r.$switch("BookingWidget:enablecarwidget");r.enablePackagesWidget=r.$switch("BookingWidget:enablepackageswidget");r.$on("$bookingWidgetReady",function(){$(".advWidgetFooter").show();$(".initLoader").hide()});r.$emit("$haAdvancedSearchReady");r.doSubmit=function(){setTimeout(function(){$('form[name="flightSearch"]').trigger("submit")},0)}},u;return r.$inject=["$scope"],u=function(n){n.exampleMethod=function(){return n}},{restrict:"A",scope:!0,link:u,controller:r}}])}(angular),function(n){"use strict";var t=n.module("haCmsFullWidthPromotionModule",[]);t.directive("haCmsFullWidthPromotion",function(){var n=function(n){n.$emit("$haCmsFullWidthPromotionReady")},t;return n.$inject=["$scope"],t=function(n){n.exampleMethod=function(){return n}},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";var t=n.module("haCmsBodyCopyAdModule",[]);t.directive("haCmsBodyCopyAd",function(){var n=function(n){n.$emit("$haCmsBodyCopyAdReady")},t;return n.$inject=["$scope"],t=function(n){n.exampleMethod=function(){return n}},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";var t=n.module("haCmsDetailPageBannerHeadlineModule",[]);t.directive("haCmsDetailPageBannerHeadline",function(){var n=function(n){n.$emit("$haCmsDetailPageBannerHeadlineReady")},t;return n.$inject=["$scope"],t=function(n){n.exampleMethod=function(){return n};n.$on("hacontactusEmailSuccess",function(t,i){(i.showMessageFlag==="SUCCESS"||i.showMessageFlag==="FAIL")&&(n.showmessageContentFlag=i.showMessageFlag,n.showmessageContent=i.showMessage)})},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";var t=n.module("haPhotoGalleryModule",["haCarouselModule"]);t.directive("haPhotoGallery",["haGlobals",function(n){var t=function(n){n.$emit("$haPhotoGalleryReady")},i;return t.$inject=["$scope"],i=function(t,i){t.showPhotoGallery=function(){t.isVisible=!0;setTimeout(r(),200)};t.exampleMethod=function(){return t};t.PhotoGallery=[];n("PhotoGalleryVM",function(n){t.PhotoGallery=n});t.slides=i.find(".ha-carousel-slide");t.closeBtnClick=function(){t.isVisible=!1};var r=function(){if($(".ha-photo-gallery .is-mobile").css("display")==="none"){var n=$(window).height();$(".ha-photo-gallery img").css("max-height",n-100);$(".ha-photo-gallery .ha-carousel-slide").css("height",n);$(".ha-photo-gallery .ha-carousel-slide .main-content .paddle").css("height",n)}};$(window).resize(function(){r()});t.showPhotoGallery();r()},{restrict:"A",scope:!0,link:i,controller:t}}])}(angular),function(n){"use strict";var t=n.module("haCmsChildNavSubPageModule",[]);t.directive("haCmsChildNavSubPage",function(){var n=function(n){var t,r,i,u;for(n.$emit("$haCmsChildNavSubPageReady"),t=$(".child-nav-tile"),r=[],i=0;i<t.length;i++)u=$(t[i]),r.push(u.height());t.css("height",Math.max.apply(null,r))},t;return n.$inject=["$scope"],t=function(n){n.exampleMethod=function(){return n}},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";var t=n.module("haCmsChildNavFrontPageModule",[]);t.directive("haCmsChildNavFrontPage",function(){var n=function(n){var i,r,t,u;for(n.$emit("$haCmsChildNavFrontPageReady"),i=$(".child-nav-tile"),r=[],t=0;t<i.length;t++)u=$(i[t]),r.push(u.height());$(".child-nav-tile").css("height",Math.max.apply(null,r))},t;return n.$inject=["$scope"],t=function(n){n.exampleMethod=function(){return n}},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";var t=n.module("haMainImageContentBlockModule",[]);t.directive("haMainImageContentBlock",function(){var n=function(n){n.$emit("$haMainImageContentBlockReady")},t;return n.$inject=["$scope"],t=function(n,t){n.slides=t.find(".ha-carousel-slide");n.exampleMethod=function(){return n}},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";var t=n.module("haFeaturedDealsModule",["haCarouselModule"]);t.directive("haFeaturedDeals",[function(){var t=function(t,i,r){var u=n.fromJson(r.dealsData),h=u.DealTiles?u.DealTiles.length:99,f,o,e,s;for(t.toLabelText=r.toLabelText,t.fromLabelText=r.fromLabelText,t.perPersonLabelText=r.perPersonLabelText,t.referenceMark=r.referenceMark,t.defaultColumns=12/u.PerPage,h<3&&(t.defaultColumns=6),t.dealType=u.TileSize||"Small",t.deals=u.DealTiles,f=[],o=-1,e=0;e<t.deals.length;e++)s=t.deals[e],e%u.PerPage==0&&(f.push({group:[]}),o++),f[o].group.push(s);t.dealGroups=f;t.slides=f};return{restrict:"A",scope:!0,link:t}}]);t.directive("haPromoTile",["$rootScope","$filter","$timeout","haConfig",function(n,t,i,r){var u=function(r,u,f){var e=r.$eval(f.model),o,s;r.model=e;e.bgImage={"background-image":"url('"+e.BackgroundImageURL+"')"};e.iconUrl={"background-image":"url('"+e.IconURL+"')"};e.promoType=e.TripType===1?r.oneWayLabelText:r.roundTripLabelText;r.dealType=e.TripType===3?"RichText":r.dealType;e.LowestFare=Math.min(e.MainCabinBasicFare||Number.POSITIVE_INFINITY,e.Fare);r.referenceMark=r.referenceMark||"*";n.footnotes&&n.footnotes.numeric&&n.references||(n.footnotes={numeric:[]},n.references={});n.references[e.DisclaimerGuid]?e.DisclaimerReferenceMark=n.references[e.DisclaimerGuid]:e.Disclaimer&&(n.references[e.DisclaimerGuid]=r.referenceMark+(Object.keys(n.references).length+1),e.DisclaimerReferenceMark=n.references[e.DisclaimerGuid],o=e.LowestFare&&e.LowestFare===e.MainCabinBasicFare,s=o?e.MainCabinBasicDisclaimer:e.Disclaimer,n.footnotes.numeric.push({id:"*"+(n.footnotes.numeric.length+1),text:s}));r.navigateTo=function(n){i(function(){var i;if(!r.isAnimating){if(n.CallToActionType>0){var u=";dd="+t("date")(n.DepartureDate,"MM/dd/yyyy"),f=+e.TripType==1?";rd="+t("date")(n.ReturnDate,"MM/dd/yyyy"):"",o=["searchDetails=o=",n.OriginAirportCode,";d=",n.DestinationAirportCode,u,f,";a=1;c=0;tt=",+n.TripType==0?"1":"2"].join("");i="/book/home?"+o}else i=n.CTALinkURL;location.href=i}},10)}};return{restrict:"A",scope:!0,link:u,templateUrl:r.getTemplateUrl("ha-promo-tile-base-template.html")}}])}(angular),function(n){"use strict";var t=n.module("haSearchResultsModule",[]);t.directive("haSearchResults",["haGlobals","haGlobalHeaderAPI",function(n,t){var i=function(i){i.googleResult=null;n("GoogleSearchResult",function(n){i.googleResult=n});i.$emit("$haSearchResultsReady");i.pagecount=0;i.totalrecords=0;i.pages=[];i.selectedpage=1;i.startPageIndex=1;var r=0;i.IsServiceErrors=!1;i.ServiceErrorMessage="";i.UpdateAll=function(){if(i.googleResult!=null)if(i.googleResult.ErrorMessage)i.IsServiceErrors=!0,i.ServiceErrorMessage=i.googleResult.ErrorMessage;else if(i.googleResult.ErrorMessage==null&&i.googleResult.items!=null){if(i.pagesize=+i.googleResult.queries.request[0].count,i.initialSearchText=i.googleResult.queries.request[0].searchTerms,i.lastSearchText=i.initialSearchText,i.totalrecords=i.googleResult.queries.request[0].totalResults,r=Math.ceil(i.totalrecords/i.pagesize),i.totalPageCount=r,document.body.dispatchEvent(new CustomEvent("SearchResultFired",{detail:i.totalrecords})),r<i.pagesize&&(i.pagesize=r),i.pagecount=r,i.pagesize<=i.pagecount){i.pages.splice(0,15);for(var n=i.startPageIndex;n<=i.pagesize;n++)i.pages.push(n);i.selectedpage=i.pages[0];i.selectedpage===1&&(i.setPrvDisabled=!0);i.pages.length<=1&&(i.setNxtDisabled=!0)}i.googleResult.items!=null&&(i.SearchIndex=i.googleResult.queries.request[0],i.SearchTerms=parseInt(i.googleResult.queries.request[0].startIndex,10)+parseInt(i.SearchIndex.count,10)-1,i.itemsPerPage=i.googleResult.items.length)}};i.NextOrPreviousOrNewSearchText=function(n){t.searchGoogle(n).success(function(n){n.ErrorMessage?(i.IsServiceErrors=!0,i.ServiceErrorMessage=n.ErrorMessage):n&&(i.googleResult=n,i.SearchIndex=i.googleResult.queries.request[0],i.SearchTerms=parseInt(i.googleResult.queries.request[0].startIndex)+parseInt(i.SearchIndex.count)-1);i.$root.isMobile||$("body, html").animate({scrollTop:350},"slow")})};i.NavigateToPage=function(n){var t,r,u;n>1?(i.selectedpage=n,t=i.SearchIndex.searchTerms,r=(i.selectedpage-1)*i.itemsPerPage+1,t=t+"&start="+r+"&sa=N",i.googleResult.SearchPhrase=i.SearchIndex.searchTerms,i.NextOrPreviousOrNewSearchText(t),i.disableNextPagination(),i.disablePreviousPagination()):(i.selectedpage=n,u=i.SearchIndex.searchTerms,i.NextOrPreviousOrNewSearchText(u))};i.nextResult=function(){var n=i.SearchIndex.searchTerms,t=i.selectedpage*i.itemsPerPage+1;n=n+"&start="+t+"&sa=N";i.googleResult.SearchPhrase=i.SearchIndex.searchTerms;i.NextOrPreviousOrNewSearchText(n);i.disableNextPagination()};i.newPreviousResult=function(){var n=i.SearchIndex.searchTerms,t=(i.selectedpage-2)*i.itemsPerPage+1;n=n+"&start="+t+"&sa=N";i.googleResult.SearchPhrase=i.SearchIndex.searchTerms;i.NextOrPreviousOrNewSearchText(n);i.selectedpage--;i.disablePreviousPagination();i.disableNextPagination()};i.NavigateByStep=function(n){var t=i.selectedpage,r,u,f;if(n==="next"){if(!i.setNxtDisabled&&i.selectedpage<10)if(t>=i.pagesize&&t<=i.totalPageCount){for(i.pa=i.pages.splice(1,1),i.pages.splice(0,15),r=i.pa[0];r<=i.pagesize+1;r++)i.pages.push(r);i.nextResult();i.pagesize++;t++;i.selectedpage=t;i.selectedpage>1&&(i.setPrvDisabled=!1)}else i.nextResult(),t++,i.selectedpage=t,i.selectedpage>1&&(i.setPrvDisabled=!1)}else if(n==="prev"&&!i.setPrvDisabled)if(t>=i.pagesize)if(u=i.pages[0],u--,u>0){for(i.pa=i.pages.splice(9,1),i.pages.splice(0,15),f=u;f<=i.pagesize-1;f++)i.pages.push(f);i.newPreviousResult();i.pagesize--;t--;i.selectedpage=t}else i.newPreviousResult(),t--,i.selectedpage=t;else i.newPreviousResult(),t--,i.selectedpage=t};i.searchSubmitBtnClick=function(){if(i.googleResult.SearchPhrase===i.lastSearchText)return!1;var n=i.googleResult.SearchPhrase;n!==""&&n!==i.lastSearchText&&(i.lastSearchText=n,t.searchGoogle(n).success(function(n){if(n.ErrorMessage||n.TranslateServiceError!=="")i.IsServiceErrors=!0,i.ServiceErrorMessage=n.ErrorMessage,document.body.dispatchEvent(new CustomEvent("SearchResultFired",{detail:"0"}));else if(n){i.googleResult=n;i.IsServiceErrors=!1;i.setNxtDisabled=!1;i.pagesize=+i.googleResult.queries.request[0].count;i.pagecount=i.pagesize;i.UpdateAll();var t=i.googleResult.queries.request[0].totalResults;document.body.dispatchEvent(new CustomEvent("SearchResultFired",{detail:t}))}i.$root.isMobile||$("body, html").animate({scrollTop:350},"slow")}))};i.UpdateAll()},r;return i.$inject=["$scope"],r=function(n,t){n.exampleMethod=function(){return n};n.$searchInput=t.find(".search-field");n.$searchSubmitBtn=t.find(".search-submit-btn");n.lastindex=t.find(".last-index");n.firstindex=t.find(".first-index");n.pages.length<=1?(n.setNxtDisabled=!0,n.lastindex.addClass("disabled")):n.setNxtDisabled=!1;n.setPrvDisabled=!0;n.firstindex.addClass("disabled");n.onSearchFieldKeyup=function(){n.googleResult.SearchPhrase===""?n.$searchSubmitBtn.addClass("disabled"):n.$searchSubmitBtn.removeClass("disabled")};n.disableNextPagination=function(){n.pagecount>n.selectedpage?(n.lastindex.removeClass("disabled"),n.setNxtDisabled=!1):n.pagecount<=n.selectedpage+1?(n.lastindex.addClass("disabled"),n.setNxtDisabled=!0):n.setNxtDisabled=!1};n.disablePreviousPagination=function(){n.selectedpage>=2?n.selectedpage<=n.startPageIndex?(n.firstindex.addClass("disabled"),n.setPrvDisabled=!0):n.selectedpage>=2&&(n.firstindex.removeClass("disabled"),n.setPrvDisabled=!1):n.selectedpage<=1&&(n.firstindex.addClass("disabled"),n.setPrvDisabled=!0)};n.activePage=function(){}},{restrict:"A",scope:!0,link:r,controller:i}}])}(angular),function(n){"use strict";var t=n.module("haGlobalAlertsModule",[]);t.directive("haGlobalAlerts",[function(){var n=["$scope","$rootScope",function(n,t){t.haGlobalAlerts={};this.updateHeight=function(n){t.haGlobalAlerts.clientHeight=n}}];return{restrict:"A",require:"haGlobalAlerts",controller:n,link:function(n,t,i,r){var f=t[0],u;r.updateHeight(t.innerHeight());u=!0;n.$watch(function(){return t.innerHeight()},function(n,t){(u||n!==t)&&(u=!1,r.updateHeight(n))})}}}])}(angular),function(n){"use strict";var t=n.module("haReshopSelectionModalModule",[]);t.directive("haReshopSelectionModal",function(){var n=function(n){n.$emit("$haReshopSelectionModalReady")},t;return n.$inject=["$scope"],t=function(n,t){n.exampleMethod=function(){return n};n.$paxSelect=t.find(".pax-select");n.$flightSelect=t.find(".flight-select");n.$seeFlightsBtn=t.find(".see-flights-btn");n.$continueBtn=t.find(".continue-btn");n.selectedPax=[0,1];n.selectedLegs=[];n.closeChangeFlightsBtnClick=function(){t.hide()};n.continueBtnClick=function(){n.transitionFromPaxToFlights()};n.transitionFromPaxToFlights=function(){n.$paxSelect.addClass("hide");n.$flightSelect.addClass("expand")};n.enableContinueBtn=function(t){t?n.$continueBtn.removeClass("disabled"):n.$continueBtn.addClass("disabled")};n.togglePaxSelect=function(t){n.isPaxSelected(t)?n.removePax(t):n.addPax(t);n.enableContinueBtn(n.selectedPax.length>0)};n.addPax=function(t){n.selectedPax.indexOf(t)===-1&&n.selectedPax.push(t)};n.removePax=function(t){n.selectedPax.indexOf(t)!==-1&&n.selectedPax.splice(n.selectedPax.indexOf(t),1)};n.isPaxSelected=function(t){return n.selectedPax.indexOf(t)>=0};n.showFlightControlsForLeg=function(i){n.$currentLegControls=t.find(".leg-"+i+"-controls");n.isLegSelected(i)?(n.removeLeg(i),n.$currentLegControls.removeClass("expand")):(n.addLeg(i),n.$currentLegControls.addClass("expand"));n.enableSeeFlightsBtn(n.selectedLegs.length>0)};n.enableSeeFlightsBtn=function(t){t?n.$seeFlightsBtn.removeClass("disabled"):n.$seeFlightsBtn.addClass("disabled")};n.addLeg=function(t){n.selectedLegs.indexOf(t)===-1&&n.selectedLegs.push(t)};n.removeLeg=function(t){n.selectedLegs.indexOf(t)!==-1&&n.selectedLegs.splice(n.selectedLegs.indexOf(t),1)};n.isLegSelected=function(t){return n.selectedLegs.indexOf(t)>=0}},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";var t=n.module("haFlightStatusModule",[]);t.directive("haFlightStatus",["haGlobals","$window",function(t,i){var r=i.serverShortDate,u=function(i,u){if(t("jsonFSModel",function(n){i.FSByFlightNoModel=n}),typeof Storage!="undefined")try{sessionStorage.flightStatus=!0}catch(e){}i.createLegs=function(n){u.createLegs(n,!1)};setTimeout(function(){n.element("#DepartureDate").click()},1e3);i.FlightDelayStatus={latedeparture:"Late Departure",latearrival:"Late Arrival",delayed:"Delayed",cancelled:"Cancelled"};i.FlightOnTimeStatus={ontime:"on Time",earlyarrival:"Early Arrival"};i.departureDateToday=typeof r!="undefined"?new Date(r):new Date;i.departureDateTomorrow=typeof r!="undefined"?new Date(r):new Date;i.departureDateYesterday=typeof r!="undefined"?new Date(r):new Date;i.departureDateTomorrow.setDate(i.departureDateToday.getDate()+1);i.departureDateYesterday.setDate(i.departureDateToday.getDate()-1);var f=new Date;i.DepartureDate=[f.getMonth()+1,f.getDate(),f.getFullYear()].join("/");t("jsonFlightResultModel",function(n){i.OperatedBy=n.OperatedBy;i.FlightNo=n.FlightNumber;i.Origin=n.Origin;i.Destination=n.Destination;i.FlightStatus=n.FlightStatus;i.AircraftType=n.AircraftType;i.EquipmentType=n.EquipmentType;n.FlightStatus==="Delayed"?i.FlightStatusStyle="delayed":n.FlightStatus==="Arrived"||n.FlightStatus==="Landed"?i.FlightStatusStyle="arrived":n.FlightStatus==="Scheduled"||n.FlightStatus==="Delayed"||n.FlightStatus==="Cancelled"?i.FlightStatusStyle="scheduled":(n.FlightStatus==="Recovery"||n.FlightStatus==="Diverted"||n.FlightStatus==="In Air"||n.FlightStatus==="Expected"||n.FlightStatus==="Departed")&&(i.FlightStatusStyle="active");n.FlightOnTimeStatus!=null&&n.FlightOnTimeStatus!==""&&(i.FlightStatusIndicator=n.FlightOnTimeStatus,i.FlightStatusIndicator in i.FlightDelayStatus?i.OnTimeStatusStyle="delayed":i.FlightStatusIndicator in i.FlightOnTimeStatus&&(i.OnTimeStatusStyle="ontime"));i.ScheduledDepartureTime=n.ScheduledDepartureTime;i.ScheduledArrivalTime=n.ScheduledArrivalTime;i.ActualDepartureTime=n.ActualDepartureTime;i.EstimatedArrivalTime=n.EstimatedArrivalTime;i.ScheduledDepartureDate=n.ScheduledDepartureDate;i.ScheduledArrivalDate=n.ScheduledArrivalDate;i.ActualDepartureDate=n.ActualDepartureDate;i.EstimatedArrivalDate=n.EstimatedArrivalDate;i.ScheduledDepartureTerminal=n.ScheduledDepartureTerminal;i.ScheduledDepartureGate=n.ScheduledDepartureGate;i.ScheduledArrivalGate=n.ScheduledArrivalGate;i.ActualArrivalTerminal=n.ActualArrivalTerminal;i.MapURL=n.MapURL;i.MapHideStyle=n.FlightStatus==="In Air"?"map-hidden":"";i.FlightDelayDuration=n.FlightDelayDuration==null||n.FlightDelayDuration==="00:00"?"":n.FlightDelayDuration})},f;return u.$inject=["$scope","haCustomerSelections"],f=function(n,i){t("jsonFSByRouteModel",function(t){n.flightsByRouteVM=t});n.$index=0;n.$arrived=i.find(".arrived");n.$active=i.find(".active");n.$scheduled=i.find(".scheduled");n.$arrivedExpandControl=i.find(".arrived-expand-control");n.$activeExpandControl=i.find(".active-expand-control");n.$scheduledExpandControl=i.find(".scheduled-expand-control");n.arrivedIsExpanded=!1;n.activeIsExpanded=!1;n.scheduledIsExpanded=!1;n.mapIsHidden=!0;n.convertToDate=function(n){return new Date(n)};n.expandBtnClick=function(t){t==="arrived"?n.expandArrived(n.arriveIsExpanded):t==="active"?n.expandActive(n.activeIsExpanded):t==="scheduled"&&n.expandScheduled(n.scheduledIsExpanded)};n.expandArrived=function(t){t?n.closeArrived():n.openArrived()};n.openArrived=function(){n.arriveIsExpanded=!0;n.$arrived.addClass("expand");n.$arrivedExpandControl.removeClass("fontIcon20-circlePlus");n.$arrivedExpandControl.addClass("fontIcon20-circleMinus")};n.closeArrived=function(){n.arriveIsExpanded=!1;n.$arrived.removeClass("expand");n.$arrivedExpandControl.removeClass("fontIcon20-circleMinus");n.$arrivedExpandControl.addClass("fontIcon20-circlePlus")};n.expandActive=function(t){t?n.closeActive():n.openActive()};n.openActive=function(){n.activeIsExpanded=!0;n.$active.addClass("expand");n.$activeExpandControl.removeClass("fontIcon20-circlePlus");n.$activeExpandControl.addClass("fontIcon20-circleMinus")};n.closeActive=function(){n.activeIsExpanded=!1;n.$active.removeClass("expand");n.$activeExpandControl.removeClass("fontIcon20-circleMinus");n.$activeExpandControl.addClass("fontIcon20-circlePlus")};n.expandScheduled=function(t){t?n.closeScheduled():n.openScheduled()};n.openScheduled=function(){n.scheduledIsExpanded=!0;n.$scheduled.addClass("expand");n.$scheduledExpandControl.removeClass("fontIcon20-circlePlus");n.$scheduledExpandControl.addClass("fontIcon20-circleMinus")};n.closeScheduled=function(){n.scheduledIsExpanded=!1;n.$scheduled.removeClass("expand");n.$scheduledExpandControl.removeClass("fontIcon20-circleMinus");n.$scheduledExpandControl.addClass("fontIcon20-circlePlus")};n.mapToggleBtnClick=function(t){n.$currentMapToggle=i.find(".map-toggle-"+t);n.$currentMap=i.find(".flight-status-map-"+t);n.$currentMapToggle.hasClass("map-hidden")?(n.$currentMapToggle.removeClass("map-hidden"),n.$currentMapToggle.addClass("map-shown"),n.$currentMap.addClass("expand")):(n.$currentMapToggle.removeClass("map-shown"),n.$currentMapToggle.addClass("map-hidden"),n.$currentMap.removeClass("expand"))};n.createLegs(2);n.openOnLoad=function(){n.$active!==null&&n.$active!==undefined&&n.flightsByRouteVM!==undefined&&n.flightsByRouteVM.ArrivedFlights.length>0?n.openArrived():n.$active!==null&&n.$active!==undefined&&n.flightsByRouteVM!==undefined&&n.flightsByRouteVM.ActiveFlights.length>0?n.openActive():n.$scheduled!==null&&n.$scheduled!==undefined&&n.flightsByRouteVM!==undefined&&n.flightsByRouteVM.ScheduledFlights.length>0&&n.openScheduled()};n.$emit("$haFlightStatusReady");n.openOnLoad()},{restrict:"A",scope:!0,link:f,controller:u}}])}(angular),function(n){"use strict";var t=n.module("haCustomDirectivesModule",["haUserProfileAPI"]);t.directive("numberOnly",function(){return{require:"ngModel",link:function(n,t,i,r){r.$parsers.push(function(n){var i;if(n==null)return"";if(i=n.replace(/[^0-9]/g,""),i!==n){var u=t[0],f=0,e=0,o=!1;try{f=u.selectionStart;e=u.selectionEnd+i.length-n.length}catch(s){o=!0}if(r.$setViewValue(i),r.$render(),!o)try{u.setSelectionRange(f,e)}catch(s){}}return i})}}});t.directive("minLength",function(){return{require:"ngModel",link:function(n,t,i,r){var u=parseInt(i.minLength);n.minLengthValidator=function(n){var t=r.$isEmpty(n)||n.length>=u;return r.$setValidity("minlength",t),t?n:undefined};i.$observe("minLength",function(t){u=parseInt(t);n.minLengthValidator(r.$viewValue)});n.$watch(i.ngModel,function(t){u=parseInt(i.minLength);n.minLengthValidator(t)})}}});t.directive("maxLength",function(){return{require:"ngModel",link:function(n,t,i,r){var u=parseInt(i.maxLength);n.maxLengthValidator=function(n){var t=r.$isEmpty(n)||n.length<=u;return r.$setValidity("maxlength",t),t?n:undefined};i.$observe("maxLength",function(i){u=parseInt(i);t.attr("maxlength",u);n.maxLengthValidator(r.$viewValue)});n.$watch(i.ngModel,function(t){u=parseInt(i.maxLength);n.maxLengthValidator(t)})}}});t.directive("regexPattern",function(){return{require:"ngModel",link:function(n,t,i,r){var u=new RegExp(i.regexPattern);r.$parsers.push(function(n){var i;if(n==null)return"";if(i=n.replace(u,""),i!==n){var f=t[0],e=0,o=0,s=!1;try{e=f.selectionStart;o=f.selectionEnd+i.length-n.length}catch(h){s=!0}if(r.$setViewValue(i),r.$render(),!s)try{f.setSelectionRange(e,o)}catch(h){}}return i})}}});t.directive("userNameUnique",["$q","haUserProfileAPI",function(n,t){return{require:"ngModel",link:function(i,r,u,f){var e;i.safeApply=function(n){var t=this.$root.$$phase;t==="$apply"||t==="$digest"?n&&typeof n=="function"&&n():this.$apply(n)};i.$watch(u.ngModel,function(){i.safeApply(function(){f.$setValidity("userNameNotUnique",!0)})});r.on("blur",function(){i.isValid()||i.$apply(function(){f.$setValidity("userNameAjax",!1);var i={username:r.val()};e&&e.resolve();e=n.defer();t.checkUsernameAvailability(i,e).success(function(n){f.$setValidity("userNameNotUnique",n.IsSuccess);f.$setValidity("userNameAjax",!0)})})});i.isValid=function(){var i,t,n;if(r.controller("ngModel").$error){i=!1;t=r.controller("ngModel").$error;for(n in t)if(t.hasOwnProperty(n)&&n!=="userNameAjax"&&n!=="userNameNotUnique"&&t[n]===!0){i=!0;break}return i}return!1}}}}])}(angular),function(n){"use strict";var t=n.module("haBookingHeroModule",[]);t.directive("haBookingHero",function(){var n=function(n){n.$emit("$haBookingHeroReady")},t;return n.$inject=["$scope"],t=function(n){n.exampleMethod=function(){return n}},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";n.module("haGlobalFooterModule",[]).directive("haGlobalFooter",["$rootScope",function(n){return{restrict:"A",scope:!0,link:function(){$(".back-to-top").click(function(){n.isMobile||(window.scrollTo({top:0,behavior:"smooth"}),$("#skipToContent").focus());n.isMobile&&window.scrollTo(0,0)})},controller:["$scope",function(n){function i(){for(var t=[],n,r=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),i=0;i<r.length;i+=1)n=r[i].split("="),t.push(n[0]),t[n[0]]=n[1];return t}var t=i();t.subscriptionflag&&t.subscriptionflag==="1"&&(n.ShowFooterHeaderAlert=!0,n.FooterErrorType="error",n.FooterHeaderMessage="Error Occured");n.Date=new Date}]}}])}(angular),function(n){"use strict";var t;try{t=n.module("haFormNativeappLinkSmsModule")}catch(i){t=n.module("haFormNativeappLinkSmsModule",["haHttpService","haGeoDataModule"])}t.directive("haFormNativeappLinkSms",["$q","haGlobals","haHttpService","haGeoDataSvc",function(t,i,r,u){var f=function(t,f,e){t.IsCountryDataReady=!1;u.getCountries().then(function(i){t.countries=i;n.extend(t,{countryCodeData:u.getPhoneCountryCodes()});t.phoneRegexByCC=function(n){var t=u.lookupCountryByCode(n);return t!=null?u.getPhoneNumberRegex(t.Key):/.*/};t.phoneCountryCodeByCC=function(n){var i=t.countries.filter(function(t){if(t.IsoCode===n)return t});return i.length===1?i[0].PhoneCountryCode:""};t.IsCountryDataReady=!0},function(){!t.form||$(t.form).hide()});$(document).ready(function(){t.isModal||(t.form=$("#"+e.formName),t.msgSent=f.find(".msgSent"),t.msgFailed=f.find(".msgFailed"))});t.recipient={};t.recipient.CountryCode="USA";i("defaultCountryCode",function(n){t.recipient.CountryCode=n});t.recipient.Number="";t.formNativeappLinkSmsSubmit=function(){t.isModal&&!t.form&&(t.form=$("#"+e.formName),t.msgSent=f.find(".msgSentModal"),t.msgFailed=f.find(".msgFailedModal"));t.sendSmsRequest().success(function(){$(t.msgSent).fadeIn("slow");setTimeout(function(){$(t.msgSent).fadeOut("slow")},5e3);t.isSubmitted=!1}).error(function(){$(t.msgFailed).fadeIn("slow");setTimeout(function(){$(t.msgFailed).fadeOut("slow")},5e3);t.isSubmitted=!1})};t.isSubmitted=!1;t.sendSmsRequest=function(){t.isSubmitted=!0;var n=t.form[0].elements,i="+"+$(n.PhoneCountryCode).val()+$(n.PhoneNumber).val().replace(/\D/g,""),u=$(n.area).val();return r.POST("/api/v2/shared/TextAppLink",{phone:i,area:u})}};return{restrict:"A",scope:!0,link:f}}])}(angular),function(n){"use strict";var t=n.module("exploreMapModule",[]);t.directive("exploreMap",["haConfig",function(n){var i=function(){},t;return i.$inject=["$scope"],t=function(n){n.$emit("$exploreMapReady")},t.$inject=["$scope"],{restrict:"A",templateUrl:n.getTemplateUrl("explore-map-base-template"),scope:!0,link:t,controller:i}}])}(angular),function(n){"use strict";var t=n.module("exploreHeroModule",[]);t.directive("exploreHero",["haConfig",function(n){var t=function(n){n.$emit("$methodsBound")},i;return t.$inject=["$scope"],i=function(n,t,i){n.PhotoGallery=[];n.widgetTitle=i.widgettitle;n.widgetDescription=i.widgetdescription;n.widgetLinkLabel=i.widgetlinklabel},{restrict:"A",scope:!0,link:i,templateUrl:n.getTemplateUrl("explore-hero-base-template.html"),controller:t}}])}(angular),function(n){"use strict";n.module("haGlobalHeaderModule",["haGlobalHeaderAPI"]).directive("haGlobalHeader",["$timeout","haConfig","haModal","$http","$rootScope",function(t,i,r,u,f){return{restrict:"A",scope:!0,link:function(i,r){function u(n,r){if(n){o.css({bottom:0,visibility:"visible"});$(".navtray-content-inner.active").removeClass("active");var u=$(".navtray-content-inner--"+r);$(".nav-overflow").css("max-height",s);i.primaryNavtrayIsOpen=!0;i.currentSection=r;t(function(){u.addClass("active");$(".nav-pane").css("opacity","1")},120)}else o.css({bottom:0,transition:"bottom .2s ease-in"}),i.primaryNavtrayIsOpen=!1,i.currentSection=null,$(".nav-overflow").css("max-height","0"),$(".nav-pane").css("opacity","0"),t(function(){o.css({visibility:"hidden"})},200)}function e(n){i.regionSelectMenuIsOpen=n;n||$(".region.link").focus()}function h(n){var r=$(".nav-pane."+i.currentSection),u=$(".nav-pane."+n);r.css("opacity","1");i.currentSection=n;t(function(){u.css("opacity","1")},90)}var o=r.find("[ha-primary-nav-tray]"),s="185px";if(i.skipToContent=function(){$('[role="main"] :tabbable:first').focus()},i.toggleNavigation=function(r){i.primaryNavtrayIsOpen?i.currentSection===r?u(!1):h(r):u(!0,r);r==="book"&&(f.user.isExpertBookingOptIn||t(function(){n.element("[ha-global-header]").find('a[href^="/Book/ExpertBooking"]').addClass("ng-hide")},0))},i.toggleRegion=function(){i.regionSelectMenuIsOpen?e(!1):e(!0)},i.$root.isMobile)i.$watch("mobileMenus",function(n){n.menuOpen||n.myAcctOpen?$('.ha-global-footer, section[role="main"]').hide():$('.ha-global-footer, section[role="main"]').show()},!0);else{$("html").on("click",function(n){var r=$.grep($(n.target).parents(),function(n){return $(n).hasClass("nav-overflow")}).length>0;!i.primaryNavtrayIsOpen||r||$(n.target).hasClass("ha-nav")||t(function(){u(!1)});i.regionSelectMenuIsOpen&&!$(n.target).closest(".parent").hasClass("region")&&t(function(){e(!1)})});$("body").delegate("a:not(.ha-nav.nav-li-inner, .nav-pane a)","focus",function(){i.primaryNavtrayIsOpen&&t(function(){u(!1)})}).delegate("a:not(.region)","focus",function(){i.regionSelectMenuIsOpen&&t(function(){e(!1)})});$("body").on("keyup",function(n){if(n.keyCode===27&&(n.preventDefault(),i.regionSelectMenuIsOpen&&t(function(){e(!1)}),i.primaryNavtrayIsOpen)){var r=$(document.activeElement).parent().attr("class").split(" ")[1];["book","manage","airline","island"].indexOf(r)>-1&&$(".ha-nav."+r).focus();t(function(){u(!1)})}});$("#skipToContent").focus(function(){$(this).removeClass("sr-only")}).blur(function(){$(this).addClass("sr-only")});$(".nav-pane").removeClass("init")}},controller:["$scope","$rootScope","haUser","haFavorites","haGlobals","haGlobalHeaderAPI",function(n,t,u,f,e,o){function c(n){n+="=";for(var i=document.cookie.split(/;\s*/),t=i.length-1;t>=0;t--)if(!i[t].indexOf(n))return i[t].replace(n,"")}function l(){var n=c("IPS");return n!==undefined?n:null}var s,a,v,y,h;t.user&&$.extend(t.user,{accountType:sessionStorage.getItem("accType"),haMiles:sessionStorage.getItem("haMiles")});n.mobileMenus={myAcctOpen:!1,menuOpen:!1};s=function(){t.isMobile?window.location.href=n.link:window.open(n.link,"_blank")};t.barclaysPopup=function(u,f){n.link=u;t.isMobile?Promise.all([$scs.get(f+".Content"),$scs.get(f+".Title")]).then(function(t){r(i.getTemplateUrl("ha-modal.html"),{backdrop:"true",title:t[1],success:{label:"Okay",fn:s},cancel:{},size:"modal-md",defaultContent:t[0],scope:n,mobileVerticalCenter:!0})}):s()};t.corpAccTypes=["C","R","W","A"];t.individualAccTypes=["B","D","E","H","I","O","P","S","T","V","Z"];n.logout=function(){u.logout();sessionStorage.clear()};u.updateUser();f.updateFavorites();e("enableUSSite",function(n){a=n==="True"});e("enableAUSite",function(n){v=n==="True"});e("enableNZSite",function(n){y=n==="True"});e("sitecoreContextId",function(n){h=n});e(["isLoggedIn","acctType","acctNo","isExpertBookingOptIn","haMilesEliteStatus"],function(n,i,r,u,f){t.isLoggedIn=n;t.bccIpsOffer=l()==="True";t.user&&$.extend(t.user,{accountType:i,haMiles:r,isExpertBookingOptIn:u,haMilesEliteStatus:f})});n.navSelectCountry=function(n){o.selectCountry(n,h).success(function(n){n!==null&&n!==""&&(window.location.href=n.RedirectUrl)},function(n){window.alert(n)})}}]}}])}(angular),function(n){"use strict";n.module("haHeaderSearchModule",[]).directive("haHeaderSearch",["haModal","$http",function(n,t){return{restrict:"A",scope:!0,link:function(i){function r(t){t?($("#searchModalTemplate .search-textarea").removeAttr("id"),n({id:"SearchModel",backdrop:!1,scope:i,size:"modal-size",template:$("#searchModalTemplate"),cancel:{fn:function(){i.searchModalIsOpen=!1}}}),$("#searchModalTemplate .search-textarea").attr("id","help-search"),$("#searchModalTemplate").attr("role","dialog")):(i.$modalCancel(),$(".nav-utility-li--search > a").focus());i.searchModalIsOpen=t}i.search=function(){i.searchText?($(".search-submit-btn").removeClass("disabled"),$(".search-submit-btn > .sr-only").css("display","none")):($(".search-submit-btn").addClass("disabled"),$(".search-submit-btn > .sr-only").css("display","block"))};i.submitSearch=function(){if(!i.searchText)return!1;t({url:"/search-results",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:$.param({searchText:i.searchText})}).then(function(){window.location.href="/search-results"})};i.toggleSearch=function(){i.searchModalIsOpen?r(!1):r(!0)}}}}])}(angular),function(n){"use strict";var t=n.module("haCmsBodyCopyWithSidebarModule",[]);t.directive("haCmsBodyCopyWithSidebar",function(){var n=function(n){n.$emit("$haCmsBodyCopyWithSidebarReady")},t;return n.$inject=["$scope"],t=function(n,t){$("html").hasClass("lte-ie8")&&t.find(":last-child").addClass("last-child")},{restrict:"A",scope:!0,link:t,controller:n}})}(angular),function(n){"use strict";function t(n,t){i[n]&&(i[n].textContent=t)}var i,r=n.module("haPerformanceStatsModule",[]);r.directive("haPerformanceStats",["$log","$window","$document","$rootScope","haConfig",function(n,r,u,f,e){var s=r.performance,c=s!=null?s.now():0,o=r.perfStats,h;return o.timeToAngular=c-o.headStart,h=function(){var t,n,i=f,r=0,u=0;n=i;do if(r+=1,n.$$watchers&&(u+=n.$$watchers.length),!(t=n.$$childHead||n!==i&&n.$$nextSibling))while(n!==i&&!(t=n.$$nextSibling))n=n.$parent;while(n=t);return[r,u]},{restrict:"A",replace:!0,templateUrl:e.getTemplateUrl("ha-performance-stats.html"),link:function(){if(i={"#scopes":u[0].querySelector("#scopes"),"#watchers":u[0].querySelector("#watchers"),"#dirty-checks":u[0].querySelector("#dirty-checks"),"#digest-cycles":u[0].querySelector("#digest-cycles"),"#digest-ms":u[0].querySelector("#digest-ms"),"#digest-fps":u[0].querySelector("#digest-fps"),"#avg-digest-ms":u[0].querySelector("#avg-digest-ms"),"#avg-digest-fps":u[0].querySelector("#avg-digest-fps"),"#max-digest-ms":u[0].querySelector("#max-digest-ms"),"#max-digest-fps":u[0].querySelector("#max-digest-fps"),"#head-load":u[0].querySelector("#head-load"),"#body-load":u[0].querySelector("#body-load"),"#footer-load":u[0].querySelector("#footer-load"),"#vendor-load":u[0].querySelector("#vendor-load"),"#app-load":u[0].querySelector("#app-load"),"#metrics-load":u[0].querySelector("#metrics-load"),"#time-to-eop":u[0].querySelector("#time-to-eop"),"#time-to-ng":u[0].querySelector("#time-to-ng")},t("#head-load",o.headLoad.toFixed(1)),t("#body-load",o.bodyLoad.toFixed(1)),t("#footer-load",o.footerLoad.toFixed(1)),t("#vendor-load",o.vendorScriptLoad.toFixed(1)),t("#app-load",o.appLoad.toFixed(1)),t("#metrics-load",o.metricsLoad.toFixed(1)),t("#time-to-eop",o.TTLB.toFixed(1)),t("#time-to-ng",o.timeToAngular.toFixed(1)),s!=null){var e=0,c=0,a=0,l=0,v=0;f.$$watchers.push({eq:!1,last:null,fn:function(){},exp:function(){},get:function(){return v++,c===0&&(c=s.now(),e++),f.$$postDigest(function(){var u,i,f,o;if(c!==0){u=s.now();i=u-c;t("#digest-ms",i.toFixed(1));t("#digest-fps",(1e3/i).toFixed(0));l=Math.max(i,l);t("#max-digest-ms",l.toFixed(1));t("#max-digest-fps",(1e3/l).toFixed(0));a+=i;e>0&&(f=a/e,t("#avg-digest-ms",f.toFixed(1)),t("#avg-digest-fps",(1e3/f).toFixed(0)));t("#dirty-checks",v);t("#digest-cycles",e);var y=h(),p=y[0],w=y[1];t("#scopes",p);t("#watchers",w);o="NG-PERF: Digest Cycle #"+e+": "+i.toFixed(1)+" ms, Scopes: "+p+", Watchers: "+w+" [Overhead: "+(s.now()-u).toPrecision(3)+" ms]";n.debug(o);r.console.timeStamp&&r.console.timeStamp(o);c=0}}),null}})}}}}])}(angular),function(n){"use strict";function i(n,t){if(n&&n.origin&&n.origin.Code&&n.destination&&n.destination.Code)return t?n.destination.Code+"-"+n.origin.Code:n.origin.Code+"-"+n.destination.Code}var t=n.module("haBookingFormModule",["haFeatureFlagsModule","duScroll"]);t.directive("haBookingForm",["$document","haHttpService","haConfig","haGlobals","haFeatureFlags","$window","haUtils","haCitiesSvc","haDateUtils","haUnavailableDays","$timeout","haModal","haEcertAPI","$filter","$q","$compile","$log","haSitecoreStrings",function(t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k){return{restrict:"A",link:function(f,p,d){function g(n){var t=f.departDate[n];return t&&moment(t).startOf("day")}function st(){f.multicity_datepicker_configs.forEach(function(n,t){var i=function(){for(var n=t;n;)if(f.departDate[--n])return moment(f.departDate[n])}();!g(t)&&i&&ht(n.viewing,i);ht(n.range_start,g(t-1)||i||moment());ht(n.range_end,g(t+1)||moment().add(331,"days"))})}function ht(n,t){n.year(t.year()).month(t.month()).date(t.date())}function ei(){t.off("click.closeCalendar");t.on("click.closeCalendar",function(i){var r=$(i.target);r.closest(".originDestinationWrap"+f.idx).length||(t.off("click.closeCalendar"),f.currentDateChoice="",n.forEach(f.calendarOpen,function(n,t){ft(t)}),f.$digest())})}function ft(n){l(function(){f.calendarOpen[n]=!1},500)}function nt(){f.isChildCountInvalid=parseInt(f.pax.adultCount,10)===0&&parseInt(f.pax.childCount,10)>0;f.isSearchDisabled=f.pax.adultCount<1&&f.pax.childCount<1;var n=parseInt(f.pax.adultCount,10)+parseInt(f.pax.childCount,10);f.isCountValid=n>0&&n<8;f.flightSearch&&f.flightSearch.$setValidity("haPassengerCount",f.isCountValid)}function ct(){f.$root.selectedPromoId&&f.tripType>0&&(f.paymentType.type="0",n.forEach(f.legs,function(n){n.isMiles=!1}));switch(f.tripType){case 0:f.paymentType.type="0";break;case 1:f.paymentType.type=f.legs.length===1&&f.legs[0].isMiles?"1":"0";break;case 2:f.paymentType.type=f.legs.length===2&&f.legs[0].isMiles&&f.legs[1].isMiles?"1":f.legs.length===2&&!f.legs[0].isMiles&&f.legs[1].isMiles?"2":f.legs.length===2&&f.legs[0].isMiles&&!f.legs[1].isMiles?"3":"0"}f.milesRadioOverride!==""&&(f.paymentType.type=f.milesRadioOverride)}function kt(){var n=!1,t=!1;return f.legs[0]&&f.legs[0].origin&&f.legs[0].origin.IsCodeShare&&f.legs[0].origin.Code!=="MKK"&&f.legs[0].origin.Code!=="JHM"&&f.legs[0].origin.Code!=="LNY"&&(n=!0),f.legs[0]&&f.legs[0].destination&&f.legs[0].destination.IsCodeShare&&f.legs[0].destination.Code!=="MKK"&&f.legs[0].destination.Code!=="JHM"&&f.legs[0].destination.Code!=="LNY"&&(t=!0),!n&&!t}function lt(){if(f.$switch("BookingWidget:enablerefundablefares")&&f.refundableFareOption&&!f.enableTCR&&!f.$root.selectedPromoId&&f.tripType!==0&&(f.paymentType.type===undefined||f.paymentType.type==="0")&&kt()){f.showRefundableFare=!0;return}f.showRefundableFare=!1}function at(){f.disableMilesOption=!!f.$root.selectedPromoId||!kt()||f.tripType===0;(f.disableMilesOption||f.tripType===1&&parseInt(f.paymentType.type,10)>1)&&(f.paymentType.type="0")}function dt(){f.promoCodeOptionEnabled=f.promoCodeOption&&!f.$root.selectedPromoId&&!f.enableTCR}function et(){f.flexiblePriceViewLink&&(f.isValidLowFareDuration=f.departDate[0]&&f.returnDate[0]&&f.tripType===2?h.numDaysDifference(f.departDate[0],f.returnDate[0])<=60:!0)}function vt(){var n=!0;f.flightSearch.$setValidity("haDuplicateLegs",n);l(function(){var r,u,t,i;if(f.tripType===0&&!(f.legs.length<2)&&f.flightSearch.$valid)for(t=0;t<f.legs.length;t++)for(r=f.legs[t].origin.Code,u=f.legs[t].destination.Code,i=0;i<f.legs.length;i++)if(t!==i&&(n=f.tripType!==0||r!==f.legs[i].origin.Code||u!==f.legs[i].destination.Code,f.flightSearch.$setValidity("haDuplicateLegs",n),!n))return})}function yt(n){typeof n!="undefined"&&(f.messages[n]=[gt(n,"origin"),gt(n,"destination")].filter(function(n){return!!n}).map(function(n){return'<div class="cal-message"><i class="ha-icon fontIcon24-'+(f.widgetDatepickerAlertIcon||"info-circle")+'"><\/i><p>'+n+"<\/p><\/div>"}).join(""))}function gt(n,t){return(t=f.legs[n][t])&&t.ShowCalendarMessage?t.CalendarMessage:""}function ni(t,i){t=t||{};var r=t.legs&&(i||t.legs[0].departDate>=tt)&&!(t.tripType===0&&f.multiCity===!1);r&&(f.legs=[],f.departDate=[],f.returnDate=[],f.unavailableDays=[],f.messages=[],t.legs.forEach(function(i,r){s.getCityMap().then(function(t){var u=f.legs[r]={origin:t[i.origin.code],destination:t[i.destination.code],isMiles:!!i.miles};f.intl=u.origin.Market===3||u.destination.Market===3;c.getUnavailableDays(u,f).then(function(t){f.unavailableDays[r]=n.isArray(t)?t:[];nt();yt(r)})});f.departDate[r]=i.departDate;var u=t.legs[r+1];u&&(f.returnDate[r]=u.departDate)}));f.pax.adultCount=f.enableTCR||f.disableAdultFieldForNITP?1:it(t.adults,1);f.pax.childCount=f.enableTCR||f.disableAdultFieldForNITP?0:it(t.children,0);f.tripType=it(t.tripType,2);f.flightSearch&&(f.flightSearch.IsRefundableCheck=!!t.refundable);nt();ct()}function oi(t){t=t||{};f.legs=[];f.departDate=[];f.returnDate=[];f.unavailableDays=[];f.messages=[];t.legs.forEach(function(i,r){s.getCityMap().then(function(t){var u=f.legs[r]={origin:t[i.origin.code],destination:t[i.destination.code],isMiles:!!i.miles};f.intl=u.origin&&u.origin.Market&&u.destination&&u.destination.Market?u.origin.Market===3||u.destination.Market===3:u.origin&&!u.destination?u.origin.Market===3:u.destination?u.destination.Market===3:"";u.origin&&u.destination&&c.getUnavailableDays(u,f).then(function(t){f.unavailableDays[r]=n.isArray(t)?t:[];nt();yt(r)})});f.departDate[r]=i.departDate;var u=t.legs[r+1];u&&(f.returnDate[r]=u.departDate)});f.pax.adultCount=f.enableTCR||f.disableAdultFieldForNITP?1:it(t.adults,1);f.pax.childCount=f.enableTCR||f.disableAdultFieldForNITP?0:it(t.children,0);f.tripType=it(t.tripType,2);f.flightSearch&&(f.flightSearch.IsRefundableCheck=!!t.refundable);nt();ct()}function it(n,t){return n=Number(n),isNaN(n)?t:n}function si(){var n=o.getFlightQueryModelRecentCookie();f.flightQueryCookieArr=n&&n.filter(function(n){var t=n.FlightSearchSegmentList[0].DepartureDate.substr(0,10);return t=moment(t,"YYYY-MM-DD").toDate(),t>=tt})}function hi(){l(function(){"promos,travelCredit,btnSearchFlights,btnSearchFlightsPlusHotels,recentSearchesSwitch,advancedSearchLink,flexiblePriceViewLink,flightScheduleLink,oneWay,roundTrip,multiCity,adults,children,expanded,childCountWarning,refundableFareOption,Enable1AOnLegacy".split(",").forEach(function(n){f[n]=!(d[n]&&d[n]==="false")});["milesRadioButton","promoCodeOption"].forEach(function(n){f[n]=!!(d[n]&&d[n]==="true")});(f.isAffiliate||f.isCorporate)&&(f.btnSearchFlightsPlusHotels=!1);f.theme=d.theme||"a";f.milesRadioOverride=d.milesRadioOverride||"";f.searchPosition=d.searchPosition||"right";f.defaultDestinationImage=d.defaultDestinationImage||"";et();dt()})}function pt(n,t){var i=f.legs[n]&&f.legs[n].origin||f.legs[0].destination,r=f.legs[n]&&f.legs[n].destination||f.legs[0].origin;return{origin:{code:i.Code,display:i.DisplayName},destination:{code:r.Code,display:r.DisplayName},departDate:t}}function ti(n){var i=[pt(0,f.departDate[0])],t;if(f.tripType===2)i.push(pt(1,f.returnDate[0]));else if(f.tripType===0&&n)for(t=1;t<f.legs.length;t++)i.push(pt(t,f.departDate[t]));return i}function ci(){var t="",n="";v.HandleAffiliates(f.promoCode.Code).then(function(i){i.data.IsSuccess&&i.data.RedirectURL!=null?(i.data.RedirectURL=i.data.RedirectURL,e.location=i.data.RedirectURL):(i.data.ServiceErrors!=null?(f.promoCodeNotFound=!0,f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!1)):t="Error While Processing Request",n(i))},n)}function li(n){var t="/Ecertificate?ecertId="+n;t!=null?e.location=t:(f.promoCodeNotFound=!0,f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!1))}function ai(){return["departureDate","arrivalDate","departureLocation","arrivalLocation"].forEach(function(n){f[n]=d[n]||""}),f.childrenCount=d.childrenCount||0,f.adultsCount=d.adultsCount||1,f.roundTripFlight=d.roundTripFlight!=null&&d.roundTripFlight==="1",d.promoCodeValue&&(f.promoCode={},f.promoCode.Code=d.promoCodeValue),f.departureDate||f.arrivalDate||f.departureLocation||f.arrivalLocation||d.promoCodeValue?(f.searchAttributesSet=!0,!0):(f.searchAttributesSet=!1,!1)}function ii(){var n=[],i={origin:{code:f.departureLocation.toUpperCase()},destination:{code:f.arrivalLocation.toUpperCase()},departDate:f.departureDate?moment(f.departureDate.substr(0,10),"YYYY-MM-DD").toDate():undefined},t;return n.push(i),f.roundTripFlight===!0&&(t={origin:{code:f.arrivalLocation.toUpperCase()},destination:{code:f.departureLocation.toUpperCase()},departDate:f.arrivalDate?moment(f.arrivalDate.substr(0,10),"YYYY-MM-DD").toDate():undefined},n.push(t)),wt(n,f.adultsCount,f.childrenCount)}function ri(){var n=o.parseLegs(o.querystring("l"));return n&&wt(n,o.querystring("a"),o.querystring("c"))}function ui(n){if(n){var i=n.FlightSearchSegmentList.map(function(n){return{origin:{code:n.OriginCityCode.toUpperCase()},destination:{code:n.DestinationCityCode.toUpperCase()},departDate:moment(n.DepartureDate.substr(0,10),"YYYY-MM-DD").toDate(),miles:n.IsMiles}}),t=wt(i,n.AdultCount,n.ChildCount);return t.refundable=n.IsRefundable,t}}function wt(n,t,i){var r=n.length===2&&n[0].origin.code===n[1].destination.code,u=!parseInt(t,10)&&!parseInt(i,10);return{legs:vi(n),adults:u?1:parseInt(t,10)||0,children:parseInt(i,10)||0,tripType:r?2:n.length===1?1:0}}function vi(n){return n.map(function(n){var t=moment(n.departDate);return t.diff(moment().startOf("day"))<0&&(n.departDate=null),n})}function yi(){n.element('a[href^="/book/flights"]').parent().addClass("ng-hide");n.element('a[href^="/book/hotels"]').parent().addClass("ng-hide");n.element('a[href^="/book/car-rentals"]').parent().addClass("ng-hide");n.element('a[href^="/book/vacation-packages"]').parent().addClass("ng-hide");n.element('a[href^="/book/activities-and-cruises"]').parent().addClass("ng-hide")}function pi(){n.element('a[href^="/book/flights"]').parent().removeClass("ng-hide");n.element('a[href^="/book/hotels"]').parent().removeClass("ng-hide");n.element('a[href^="/book/car-rentals"]').parent().removeClass("ng-hide");n.element('a[href^="/book/vacation-packages"]').parent().removeClass("ng-hide");n.element('a[href^="/book/activities-and-cruises"]').parent().removeClass("ng-hide")}function fi(t){f.promoCode.isValidPromoCode=!0;f.promoCode.hasApplied=!0;f.promoCode.PromoCodePromotion=t;f.PromoModel.Promo=t;yi();k.get("Header.promoappliedmessage").then(function(t){var i='<div ha-global-message header="'+t+'" type="success" message-close-time="4700"><\/div>';n.element("[ha-global-header]").append(w(i)(f))});f.promoCodeNotFound=!1;f.$root.discountRemoved=!1;f.$root.discountPermanentlyRemoved=!1;f.$root.selectedPromoId=f.PromoModel.Promo.OfferId}function wi(){f.promoCode.isValidPromoCode=!1;f.promoCode.Code=null;pi();f.$root.discountRemoved=!0;f.$root.discountPermanentlyRemoved=!0;f.$root.selectedPromoId=null;v.removePromoCodeFromSession()}function bt(){f.promoCode.Code=null;f.promoCodeNotFound=!1;f.flightSearch.PromoCode!==null&&f.flightSearch.PromoCode!==undefined&&(f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!0),f.flightSearch.PromoCode.$validate())}function rt(){var n=bi();i.POST("/Book/Home/GetFlightSearchRedirectPath",n).success(function(n){if(!n||n.Success!==!1){var t=n.RedirectUrl;typeof t=="string"&&t!==""?window.location.href=t:document.flightSearch.submit()}else l(function(){document.flightSearch.submit()})}).error(function(){document.flightSearch.submit()})}function bi(){var n={},r=ti(!0),t,i;for(n.tripType=f.tripType,n.pricingType=f.paymentType.type,n.isRefundable=f.flightSearch.IsRefundableCheck,n.segments=[],t=0;t<r.length;t++)i={},i.originCityCode=r[t].origin.code,i.destinationCityCode=r[t].destination.code,i.departureDate=moment(r[t].departDate).format("YYYY-MM-DD"),n.segments.push(i);return n.promoCode=f.promoCode!==undefined?f.promoCode.Code:f.flightSearch.PromoCode!=undefined?f.flightSearch.PromoCode.$modelValue:"",n.currency=f.$currency,n.adultCount=f.pax.adultCount,n.childCount=f.pax.childCount,n}function ki(){var s,r,e,n,t,i;if(u("promoJson",function(n){f.PromoModel=n||undefined;f.promoCode={};f.promoCodeNotFound=!1;f.promoCode.PromoCodePromotion=f.PromoModel.Promo;f.PromoModel!==null&&f.PromoModel.Promo!==null&&(f.$root.selectedPromoId=f.PromoModel.Promo.OfferId,f.PromoModel.Promo.OfferType===10&&fi(f.PromoModel.Promo))}),u("enableTCR",function(n){f.enableTCR=n}),u("wholesaleDisableDollarMile",function(n){f.wholesaleDisableDollarMile=n}),u("ETCOResponseModel",function(n){f.ETCOResponseModel=n}),u("flightSearchModel",function(n){f.disableAdultFieldForNITP=n.DisableAdultField}),u("widgetDatepickerAlertIcon",function(n){f.widgetDatepickerAlertIcon=n}),f.ActivateValidationSpinner=!1,f.formSubmitted=!1,hi(),f.intl=!1,f.isEN=o.isEN(),f.legs=[],s={},f.legs.push(s),f.departDate=[],f.returnDate=[],f.currentDateChoice="",f.calendarOpen=[],f.messages=[],f.unavailableDays=[],f.pax={},f.passengerCount=[0,1,2,3,4,5,6,7],f.childrenOnly=!1,f.isAffiliate=!1,f.$root.user&&f.$root.user.accountType=="A"&&(f.isAffiliate=!0),f.isCorporate=f.$root.isLoggedIn&&f.$root.corpAccTypes.indexOf(f.$root.user.accountType)>-1,f.paymentType={},f.enablepricechart=f.$switch("LowFare:enablepricechart"),f.enablepricecalendar=f.$switch("LowFare:enablepricecalendar"),f.ETCOResponseModel&&k.get("ReservationsTravelCreditRedemption.offallroutesfootertext").then(function(n){var t=y("localCurrency")(f.ETCOResponseModel.Amount,f.$currency);f.offAllRoutesFooterText=n.replace("{{ETCO.Dollar.Discounts}}",t)}),r=window.location.href.toLowerCase().indexOf("flexibleautoopen")!==-1,e=r?ii()||ri():ai()?ii():ri()||ui(o.getFlightQueryModelCookie()),f.promoCodeMaxLength=15,n=o.querystring("pcodeapply"),n&&n.length>0?(f.promoCode.Code=n.substring(0,f.promoCodeMaxLength),f.$root.$regex.promoCode.test(f.promoCode.Code)&&f.applyPromoCode()):(t=o.querystring("pcode"),t&&t.length>0&&(f.promoCode.Code=t.substring(0,f.promoCodeMaxLength))),i=o.querystring("promoCode"),i&&i.length>0&&(f.promoCode={},f.promoCode.Code=i.substring(0,f.promoCodeMaxLength)),l(function(){f.searchAttributesSet?oi(e):ni(e,!0);si();f.$broadcast("trip type changed",f.tripType)},0),r&&(f.autoOpened=!1,f.$on("citiesavailable",function(){f.autoOpened||(f.autoOpened=!0,l(function(){f.openPriceChart()}))})),f.ready=!0,HA.cdnDynamic)$(window).on("load",function(){["BookingWidget","StickProgressBar","LowFare","InflightOptions","InFlightOptionsInfo","PassengerTripSummary","FareSearch","PROMO_DISCOUNTS","ETCO_CHECK"].map(k.request)})}var ot=$('form[name="flightSearch"]'),ut,tt;for(s.preloadCities(),f.range_datepicker_config={start:"[name='_FlightSearchSegmentList[0].DepartureDate']",end:"[name='_FlightSearchSegmentList[1].DepartureDate']"},f.multicity_datepicker_configs=[],f.multicity_datepicker_config=function(n){if(f.multicity_datepicker_configs[n])return f.multicity_datepicker_configs[n];var t=f.multicity_datepicker_configs[n]={viewing:g(n-1)||moment().startOf("day"),range_start:g(n-1)||moment().startOf("day"),range_end:g(n+1)||moment().add(331,"days").startOf("day"),idx:n};return st(),t},ut=0;ut<6;ut++)f.$watch("departDate["+ut+"]",function(){st()});f.$on("dateInputFocused",function(t,i,r){f.currentDateChoice=i;f.idx=r;n.forEach(f.calendarOpen,function(n,t){f.calendarOpen[t]=!1});f.calendarOpen[r]=!0;ei()});f.$on("setDate",function(n,t){if(f[f.currentDateChoice]){if(f[f.currentDateChoice][f.idx]=t||"",f.currentDateChoice==="departDate"&&f.returnDate[f.idx]&&t>f.returnDate[f.idx]?f.returnDate[f.idx]=undefined:f.currentDateChoice==="returnDate"&&f.departDate[f.idx]&&t<f.departDate[f.idx]&&(f.departDate[f.idx]=undefined),f.tripType===0){for(var i=f.idx;i>0;i--)f.departDate[i-1]&&t<f.departDate[i-1]&&(f.departDate[i-1]=t);for(i=f.idx;i<f.legs.length-1;i++)f.departDate[i+1]&&t>f.departDate[i+1]&&(f.departDate[i+1]=t)}f.$digest()}});f.$on("airportInputFocused",function(n,t){var i=t.closest("li"),r=i.index();f.idx=r;f.expanded||f.setExpanded()});f.$on("haWhereWeFlyPinClicked",function(){f.expanded||l(function(){f.setExpanded()},500)});f.$on("airportChanged",function(){var i,u,t,r,e;n.forEach(f.legs,function(n){n.invalidPair=!1});i=f.legs;u=f.tripType===2;i[0]&&u&&(i.length<2&&(i[1]={}),i[1].origin=i[0].destination,i[1].destination=i[0].origin);t=i&&i[f.idx];t&&t.origin&&t.origin.Code&&t.destination&&t.destination.Code&&(c.getUnavailableDays(t,f).then(function(i){f.departDate[f.idx]&&i[0].CalendarYears.contains(f.departDate[f.idx])&&delete f.departDate[f.idx];f.returnDate[f.idx]&&i[1].CalendarYears.contains(f.returnDate[f.idx])&&delete f.returnDate[f.idx];f.unavailableDays[f.idx]=n.isArray(i)?i:[];f.intl=t.origin&&t.origin.Market===3||t.destination&&t.destination.Market===3?!0:!1;nt()}),yt(f.idx),vt(),f.idx===0&&f.defaultDestinationImage!==""&&(r=t.destination.ImageURL,r===""&&(r=f.defaultDestinationImage),e=new Image,e.src=r));lt();at();f.$broadcast("airport changed")});f.$on("recallSearch",function(n,t){f.recallSearch(t)});f.$watchCollection("[pax.adultCount, pax.childCount]",function(){nt()});f.$watchCollection("departDate",function(){f.departDate[f.idx]&&!f.returnDate[f.idx]&&f.tripType===2?f.currentDateChoice="returnDate":f.departDate[f.idx]&&f.returnDate[f.idx]?ft(f.idx):f.tripType!==2&&ft(f.idx);et()});f.$watchCollection("returnDate",function(){f.returnDate[f.idx]&&!f.departDate[f.idx]?f.currentDateChoice="departDate":f.returnDate[f.idx]&&f.departDate[f.idx]&&ft(f.idx);et()});f.$watchCollection("legs",function(){f.milesRadioButton&&ct();et()});f.recentSearches={open:!1};f.$watch("recentSearches.open",function(n){typeof n!="undefined"&&(n?l(function(){$("body").on("click.recent",function(){f.$apply(function(){f.recentSearches.open=!1})})},10):$("body").off("click.recent"))});f.$watch("paymentType.type",function(){lt()});f.$root.$watch("selectedPromoId",function(){lt();at();dt()});f.$watch("promoCode.Code",function(){f.flightSearch&&f.flightSearch.PromoCode&&f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!0)});tt=new Date((new Date).setHours(0,0,0,0));f.setTripType=function(n){f.flightSearch.$submitted=!1;ot.removeClass("submitted");f.tripType!=0&&n===0&&f.deleteLeg(1);f.tripType=n;n===1&&(f.legs=f.legs.slice(0,1));f.showChartError=!1;f.$root.selectedPromoId&&f.tripType===0?(f.$root.discountRemoved=!0,f.$root.selectedPromoId=null):f.PromoModel&&f.PromoModel.Promo&&f.tripType!==0&&!f.$root.discountPermanentlyRemoved&&(f.$root.selectedPromoId=f.PromoModel.Promo.OfferId,f.$root.discountRemoved=!1);at();f.$broadcast("trip type changed",n)};f.focusTripTypeSelection=function(){f.expanded=!0};f.focusBackOnTripType=function(){f.recentSearches.open=!1};f.$on("airportInputFocused",function(){f.recentSearches.open=!1});f.$on("haAlertClosed",function(n,t){t==="promoCodeError"&&(f.promoCodeNotFound=!1)});f.openPriceChart=function(n){n=n||"calendar";f.flightSearch.$valid?a(r.getTemplateUrl("/Book/FlightSearch/ha-flexible-price-modal.html"),{id:"FlexiblePriceView",backdrop:"true",extendScope:{legs:ti(!1),adults:f.pax.adultCount,children:f.pax.childCount,display:n}}):f.showChartError=!0};f.addLeg=function(n){ot.removeClass("submitted");f.flightSearch.$submitted=!1;for(var t=0;t<n;t++)f.leg={},f.legs.push(f.leg)};f.deleteLeg=function(n){f.legs.splice(n,1);f.departDate.splice(n,1);f.unavailableDays.splice(n,1);f.messages.splice(n,1);f.multicity_datepicker_configs.splice(n,1);st();vt()};f.getCalendarHeading=function(n){if($el.context.textContent&&$el.context.textContent.length>0){var t=$el.context.textContent.split("\n")[4].replace(",",""),i=$el.context.textContent.split("\n")[13].replace(",","");return n!=="returnDate"?t:i}return n!=="returnDate"?k("BookingWidget.departdate"):k("BookingWidget.returndate")};f.scrollForm=function(i){var r=n.element(".homepage-widget");r.length>0?t.scrollToElement(r,20,450,function(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n}).then(function(){f.expanded=i}):f.expanded=i};f.scrollTo=function(i){l(function(){var r=n.element("#"+i);r.length>0&&t.scrollToElement(r,20,450,function(n){return n<.5?8*n*n*n*n:1-8*--n*n*n*n})},0)};f.getIsUnavailable=function(n){if(h.isBefore(n,tt)&&!h.isSameDay(n,tt)||h.isAfter331(n,tt))return!0;var t=f.currentDateChoice,u=c.isUnavailable(n,f.unavailableDays[f.idx],t),i=f.departDate[f.idx],r=f.returnDate[f.idx];return i&&r&&f.tripType>0?u:u||f.tripType===2&&(t==="returnDate"&&i&&h.isBefore(n,i)||t==="departDate"&&r&&h.isAfter(n,r))};f.infantInfoModal=function(){(!f.isCorporate||f.isAffiliate)&&a(r.getTemplateUrl("ha-child-infant-info-modal.html"),{id:"infantModal",backdrop:"true"});console.log(f.isAffiliate)};f.infantInfoContentCheck=function(){return k("BookingWidget.childinformationmodal")==null||k("BookingWidget.childinformationmodal")===""||k("BookingWidget.childinformationmodal")==="[BookingWidget.childinformationmodal]"?!0:!1};f.searchFlightsPlusHotels=function(n){var i,h,r,l,a,u,v;for(n.preventDefault(),i=0,h=f.legs.length;i<h;i++)if(f.legs[i].invalidPair=s.pairIsInvalid(f.legs[i].origin.Code,f.legs[i].destination.Code),f.legs[i].invalidPair)return;if(f.flightSearch.PromoCode===undefined||f.flightSearch.PromoCode.$valid||bt(),f.flightSearch.$valid||_.size(f.flightSearch.$error)===1&&f.flightSearch.$error.haPassengerCount){var c=1,t={},p=f.departDate[0].YYYY_MM_DD(),w=f.returnDate[0].YYYY_MM_DD(),d=f.legs[0].origin.Code,g=f.legs[0].destination.Code,nt=f.pax.adultCount,e=f.pax.childCount;for(t.FromAirport=d,t.Destination=g,t.ToTime=362,t.FromTime=362,t.NumRoom=c,t.cabinClass="e",r=0;r<c;r++)if(l="NumAdult-Room"+(r+1),a="NumChild-room"+(r+1),t[l]=nt,e>0)for(t[a]=e,u=0;u<e;u++)v="Room"+(r+1)+"-Child"+(u+1)+"Age",t[v]=6;t.mdpcid=o.webtrends.tokenV2("FLTWIDGET.PACKAGE");var tt=o.createQueryString(t),it=k("BookingWidget.searchpackagesurl"),y=it+"FlightHotel/"+p+"/"+w+tt;b.debug(y);location.href=y}else{f.flightSearch.$submitted=!0;ot.addClass("submitted");f.$broadcast("validateForm");return}};f.applyPromoCodeOnEnter=function(n){n.which===13&&(n.preventDefault(),f.applyPromoCode())};f.applyPromoCode=function(){v.validateRedeemPromoCode(f.promoCode.Code).success(function(n){n&&n.IsSuccess&&n.PromoCodePromotion?(n&&n.IsSuccess&&n.PromoCodePromotion.OfferType===10?fi(n.PromoCodePromotion):n&&n.IsSuccess&&n.PromoCodePromotion.OfferType===3&&li(f.promoCode.Code),f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!0)):n.PromoCodePromotion==null?(ci(f.promoCode.Code),f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!0)):(b.error("applyPromoCode failed"),f.promoCodeNotFound=!0,f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!1))}).error(function(n){b.error("Validate Promo Code encountered error: "+n);f.promoCodeNotFound=!0;f.flightSearch.PromoCode.$setValidity("promoCodeNotFound",!1)})};f.removePromoCode=function(){f.promoCode.hasApplied=!1;wi()};f.submit=function(t){var u,i,e;if(t.preventDefault(),f.formSubmitted=!0,f.Enable1AOnLegacy||f.flightSearch.PromoCode===undefined||f.flightSearch.PromoCode.$valid||bt(),!f.flightSearch.$valid){f.$broadcast("validateForm");return}for(u=[],f.legs&&n.forEach(f.legs,function(n){u.push(n.origin.Code);u.push(n.destination.Code)}),i=0,e=f.legs.length;i<e;i++)if(f.legs[i].invalidPair=s.pairIsInvalid(f.legs[i].origin.Code,f.legs[i].destination.Code),f.legs[i].invalidPair)return;if(f.tripType===0&&(f.legs.length===1?document.flightSearch.FlightQueryTypeId.value=1:f.legs.length===2&&(document.flightSearch.FlightQueryTypeId.value=f.legs[0].origin.Code===f.legs[1].destination.Code&&f.legs[0].destination.Code===f.legs[1].origin.Code?2:f.tripType),vt()),f.milesRadioButton&&f.paymentType&&f.paymentType.type!==undefined)switch(f.paymentType.type){case"1":f.legs[0].isMiles=!0;f.tripType===2&&(f.legs[1]===undefined&&(f.legs[1]={origin:f.legs[0].destination,destination:f.legs[0].origin}),f.legs[1].isMiles=!0);break;case"2":f.legs[0].isMiles=!1;f.legs[1]===undefined&&(f.legs[1]={origin:f.legs[0].destination,destination:f.legs[0].origin});f.legs[1].isMiles=!0;break;case"3":f.legs[0].isMiles=!0;f.legs[1]===undefined&&(f.legs[1]={origin:f.legs[0].destination,destination:f.legs[0].origin});f.legs[1].isMiles=!1;break;default:f.legs[0].isMiles=!1;f.tripType===2&&(f.legs[1]===undefined&&(f.legs[1]={origin:f.legs[0].destination,destination:f.legs[0].origin}),f.legs[1].isMiles=!1)}l(function(){var t,i;if(!f.flightSearch.$valid){f.$broadcast("validateForm");return}if(f.enableTCR&&(t=new Date,t.setHours(0,0,0,0),f.ETCOResponseModel.Errors=[],(f.legs[0].origin.IsCodeShare&&f.legs[0].origin.Code!=="MKK"&&f.legs[0].origin.Code!=="JHM"&&f.legs[0].origin.Code!=="LNY"||f.legs[0].destination.IsCodeShare&&f.legs[0].destination.Code!=="MKK"&&f.legs[0].destination.Code!=="JHM"&&f.legs[0].destination.Code!=="LNY")&&f.ETCOResponseModel.Errors.push("ETCOErrorCodeShare"),(h.isBefore(t,new Date(f.ETCOResponseModel.BookBetweenFrom))||h.isAfter(t,new Date(f.ETCOResponseModel.BookBetweenTo)))&&f.ETCOResponseModel.Errors.push("ETCOErrorNoLongerValid"),(h.isBefore(f.departDate[0],new Date(f.ETCOResponseModel.TravelPeriodFrom))||f.tripType===1&&h.isAfter(f.departDate[0],new Date(f.ETCOResponseModel.TravelPeriodTo))||f.tripType===2&&h.isAfter(f.returnDate[0],new Date(f.ETCOResponseModel.TravelPeriodTo)))&&f.ETCOResponseModel.Errors.push("ETCOErrorDateRange"),f.ETCOResponseModel.Errors.length>0)){k.get("ReservationsTravelCreditRedemption").then(function(t){n.forEach(f.ETCOResponseModel.Errors,function(n,i){t.hasOwnProperty(n.toLowerCase())&&(f.ETCOResponseModel.Errors[i]=t[n.toLowerCase()])});a(r.getTemplateUrl("ha-booking-etco-modal.html"),{id:"promoValidationModal",backdrop:"true",scope:f})});return}f.Enable1AOnLegacy?(f.ActivateValidationSpinner=!1,l(function(){rt()})):f.tripType!==0&&f.PromoModel&&f.PromoModel.Promo&&!f.$root.discountRemoved?(i={PromoCode:f.PromoModel.Promo.OfferId,Origin:f.legs[0].origin.Code,Destination:f.legs[0].destination.Code,DepartureDate:y("date")(f.departDate[0],"yyyy-MM-dd"),ReturnDate:f.returnDate[0]?y("date")(f.returnDate[0],"yyyy-MM-dd"):null,TripType:f.tripType,AdultCount:!!f.flightSearch.AdultCount&&!!f.flightSearch.AdultCount.$modelValue?f.flightSearch.AdultCount.$modelValue:0,ChildCount:!!f.flightSearch.ChildCount&&!!f.flightSearch.ChildCount.$modelValue?f.flightSearch.ChildCount.$modelValue:0,InfantCount:!!f.flightSearch.InfantCount&&!!f.flightSearch.InfantCount.$modelValue?f.flightSearch.InfantCount.$modelValue:0},f.ActivateValidationSpinner=!0,f.PromoModel.Errors=null,v.isValidPromo(i).success(function(n){!n||n.IsSuccess!==!1?(f.ActivateValidationSpinner=!1,l(function(){rt()})):(f.ActivateValidationSpinner=!1,f.PromoModel.Errors=n.Errors,a(r.getTemplateUrl("ha-booking-promo-modal.html"),{id:"promoValidationModal",backdrop:"true",scope:f}))}).error(function(n){f.ActivateValidationSpinner=!1;n&&n.RedirectURL&&(window.location.href=n.RedirectURL);return})):f.promoCode==undefined||f.promoCode.Code==undefined||f.promoCode.Code==""||f.promoCode.hasApplied?(f.$root.discountRemoved=!0,f.$root.selectedPromoId=null,l(function(){rt()})):l(function(){a(r.getTemplateUrl("ha-booking-promo-modal.html"),{id:"promoValidationModal",backdrop:"true",scope:f})})})};f.submitWithoutDiscount=function(){f.$root.discountRemoved=!0;f.$root.selectedPromoId=null;bt();f.$modalCancel();l(function(){rt()})};f.submitWithoutETCO=function(){f.etcoRemoved=!0;f.$modalCancel();l(function(){rt()})};f.recallSearch=function(n){var t=f.flightQueryCookieArr[n];ni(ui(t));f.recent=!1};f.setExpanded=function(){f.expanded=!0;$(".booking-widget.row").addClass("open")};f.setClosed=function(){f.setTripType(2);f.expanded=!1;$(".booking-widget.row").removeClass("open")};f.mobileSelect=function(n){f.tab=f.tab===n?"":n};f.openMobileRecentSearches=function(){a(r.getTemplateUrl("/Book/FlightSearch/ha-recent-searches-modal.html"),{id:"RecentSearchesModal",backdrop:"true",extendScope:{flightQueryCookieArr:f.flightQueryCookieArr,recallSearch:f.recallSearch}})};ki()}}}]);t.directive("haBookingDateFormatter",["$filter","$locale",function(n,t){return{require:"ngModel",link:function(i,r,u,f){f.$formatters.push(function(i){return!i||!(i instanceof Date)?"":n("date")(i,"EEEE, ")+n("date")(i,t.DATETIME_FORMATS.shortDate)})}}}]);t.directive("haDatesAvailable",["haUnavailableDays",function(n){return{restrict:"A",require:"ngModel",link:function(t,i,r,u){var f=function(i,r){var f=!0;return!r||!r.length?(u.$setValidity("haDates",f),f):(u.$modelValue&&(f=t.tripType!==1?!n.isUnavailable(u.$modelValue,r,"departDate")||!n.isUnavailable(u.$modelValue,r,"returnDate"):!n.isUnavailable(u.$modelValue,r,"departDate")),u.$setValidity("haDates",f),i)};u.$formatters.push(f);t.$on("unavailableDaysChanged",function(n,t){return f(u.$viewValue,t)})}}}]);t.factory("haUnavailableDays",["haHttpService","$q",function(n,t){function u(n){var t=this;return(t=t&&t[n.getFullYear()])&&(t=t[n.getMonth()+1])&&t[n.getDate()]}function f(t,i){return t=t.split("-"),n.GET("/book/flightschedule/UnAvailableDaysOfOperation",{method:"get",params:{origin:t[0],destination:t[1],triptype:i||1},config:{cache:!0}})}var r={};return{get:function(n){var t=r[n];return t?t:r[n]=f(n).then(function(t){var i=t.data[n]||{CalendarYears:{}};return i.CalendarYears.pair=n,i.CalendarYears.contains=u,i.CalendarYears}).catch(function(n){return console.log(n),Promise.reject(n)})},getUnavailableDays:function(n,r){return t.all([this.get(i(n),!0),this.get(i(n,!0),!0)]).then(function(n){return n=n.map(function(n){return{CalendarYears:n}}),r.$broadcast("unavailableDaysChanged",n),n})},isUnavailable:function(n,t,i){if(t&&t.length){var r=i==="departDate"?t[0]:t[1];return r.CalendarYears.contains(n)}}}}]);t.directive("haDelegateClick",function(){return function(t,i,r){var u=r.haDelegateClick;i.on("click",r.haDelegateSelector,function(i){var r=$(i.target),f=r.data("ng-json")?r:r.closest("[data-ng-json]"),e=n.fromJson(f.data("ngJson")||undefined);typeof t[u]=="function"&&t[u](i,e)})}})}(angular),function(n){"use strict";var r=n.module("haFlexiblePriceViewModule",["haPriceApiModule","ngAnimate","haFeatureFlagsModule"]),i=!1,e=.33,u=331,t=25,o=1e3,f,s=["januarytext","februarytext","marchtext","apriltext","maytext","junetext","julytext","augusttext","septembertext","octobertext","novembertext","decembertext"];r.directive("haFlexiblePriceView",["haFeatureFlags","haSitecoreStrings","haHttpService","haPriceApiService","haConfig","haDateUtils","$filter","$animate","haUtils","$timeout","$rootScope",function(r,h,c,l,a,v,y,p,w,b,k){return{templateUrl:a.getTemplateUrl("/Book/FlightSearch/ha-flexible-price-view.html"),restrict:"A",link:function(r,c){function rt(){function t(t,i){return{OriginCityCode:n[t].origin.code,DestinationCityCode:n[t].destination.code,DepartureDate:moment(i).format("YYYY-MM-DD"),SegmentID:t+1}}var n=r.legs,u=new Date(n[0].departDate),f=new Date(n[0].departDate).dateAdd("day",r.model.tripLength),i={searchRequest:{FlightQueryTypeId:r.legs.length,AdultCount:r.adults,ChildCount:r.children,FlightSearchSegmentList:[t(0,u)]},isCalendar:r.display==="calendar"};return r.legs.length===2&&i.searchRequest.FlightSearchSegmentList.push(t(1,f)),i}function ut(){r.selectedPrice={date:new Date(r.legs[0].departDate),price:0};k.isMobile&&(r.initialPrice={date:new Date(r.legs[0].departDate),price:0});r.display==="chart"?(r.currentDate=new Date(r.selectedPrice.date),r.currentDate.setDate(r.currentDate.getDate()-parseInt(t/2))):r.currentDate=new Date(r.legs[0].departDate.getFullYear(),r.legs[0].departDate.getMonth(),1)}function y(n){var e,s,f,t,o,u,i;if(k.isMobile&&n.length>90){for(e=[],t=0,o=n.length;t<o;t++)f=n[t].DepartDate,s=moment(f).month(),moment(f).date()>=20&&e.indexOf(s)<0&&e.push(s);for(t=0;t<n.length;t++)f=n[t].DepartDate,e.indexOf(moment(f).month())<0&&(n.splice(t,1),t--)}for(r.firstBufferDate=r.firstBufferDate?r.firstBufferDate:new Date("1/1/2100"),r.lastBufferDate=r.lastBufferDate?r.lastBufferDate:new Date("1/1/1900"),t=0,o=n.length;t<o;t++)u=n[t],i=u.DepartDate,i===r.selectedPrice.date.YYYY_MM_DD()&&(r.selectedPrice.price=u.Price),k.isMobile&&i===r.initialPrice.date.YYYY_MM_DD()&&(r.initialPrice.price=u.Price),r.buffer[i]={price:u.Price,departDate:i,returnDate:u.ReturnDate},i=moment(u.DepartDate).toDate(),r.lastBufferDate=v.isAfter(i,r.lastBufferDate)?i:r.lastBufferDate,r.firstBufferDate=v.isBefore(i,r.firstBufferDate)?i:r.firstBufferDate}function a(){var n,u,s,i,f,o,h;for(r.chartData=[],r.calendarData={},r.minPrice=Number.POSITIVE_INFINITY,r.maxPrice=Number.NEGATIVE_INFINITY,k.isMobile?f=v.numDaysDifference(new Date(r.firstBufferDate),new Date(r.lastBufferDate)):(f=v.numDaysDifference(r.currentDate,new Date(r.lastBufferDate)),f=f>t?f:t),o=0;o<f+1;o++)h=k.isMobile?r.firstBufferDate:r.currentDate,n=new Date(h),n.setDate(h.getDate()+o),s=new Date(n),s.setDate(n.getDate()+parseInt(r.model.tripLength)),u=n,i=undefined,u.YYYY_MM_DD()===r.selectedPrice.date.YYYY_MM_DD()&&(r.buffer[n.YYYY_MM_DD()]&&r.buffer[n.YYYY_MM_DD()].price?r.selectedPrice.price=r.buffer[n.YYYY_MM_DD()].price:r.selectionError=!0),r.buffer[u.YYYY_MM_DD()]&&(i=r.buffer[u.YYYY_MM_DD()].price,i&&((o<=t||k.isMobile)&&(r.minPrice=Math.min(r.minPrice,i),r.maxPrice=Math.max(r.maxPrice,i)),r.minCalendarPrice=Math.min(r.minCalendarPrice,i))),r.calendarData[u.YYYY_MM_DD()]={departDate:u,returnDate:s,price:i},(o<=t||k.isMobile)&&r.chartData.push({departDate:u,returnDate:s,price:i});k.isMobile?(r.minPrice=Math.min(r.minPrice,r.initialPrice.price),r.maxPrice=Math.max(r.maxPrice,r.initialPrice.price)):(r.minPrice=Math.min(r.minPrice,r.selectedPrice.price),r.maxPrice=Math.max(r.maxPrice,r.selectedPrice.price));r.maxPrice+=Math.round(r.maxPrice*e);ft();window.setTimeout(function(){p.enabled(!0)},0)}function ft(){for(var n=0;n<r.chartData.length;n++)r.chartData[n].price&&(r.chartData[n].ratio=r.chartData[n].price===r.minPrice&&r.chartData[n].price===r.maxPrice?1:r.chartData[n].price/r.maxPrice);r.selectedPrice.ratio=Math.min(r.selectedPrice.price/r.maxPrice,1);k.isMobile&&(r.initialPrice.ratio=Math.min(r.initialPrice.price/r.maxPrice,1))}function et(n){var u,i,f,e;if(n>0){if(u=new Date(r.lastBufferDate),i=new Date(r.currentDate),i.dateAdd("day",t-1),v.isAfter(i,u))return!0}else if(f=new Date(r.firstBufferDate),e=new Date(r.currentDate),v.isBefore(e,f))return!0;return!1}function d(n){if(r.error){r.model.loading=!1;return}var i,u,t=!0;n>0?(i=new Date(r.lastBufferDate),r.currentDate=new Date(r.currentDate.getFullYear(),r.currentDate.getMonth()+1,1),u=new Date(r.currentDate.getFullYear(),r.currentDate.getMonth()+2,1),t=v.isAfter(u,r.lastBufferDate)?!0:!1,t=r.maxForward&&r.maxForward.date?!1:t):(i=new Date(r.firstBufferDate.getTime()),r.currentDate=new Date(r.currentDate.getFullYear(),r.currentDate.getMonth()-1,1),t=v.isBefore(r.currentDate,r.firstBufferDate)&&!moment(new Date).isSame(i,"day"));r.maxForward&&r.maxForward.date&&(r.maxForward.disableForward=v.isAfter(u,r.lastBufferDate)?!0:!1);t?(r.model.loading=!0,l.fetchPrices(moment(i).add(n,"day").format("YYYY-MM-DD"),n,{cache:!0}).success(function(n){n.IsSuccess&&(y(n.LowFareTripResponseList),n.isMaxDateReached&&(r.maxForward={date:r.results[r.results.length-1].DepartDate,disableForward:!0}),a());r.model.loading=!1})):(a(),r.model.loading=!1)}function ot(n){var i=et(n),t;r.moving=!1;r.model.loading=!0;i?(t=n>0?new Date(r.lastBufferDate):new Date(r.firstBufferDate),l.fetchPrices(moment(t).format("YYYY-MM-DD"),n,{cache:!0}).success(function(n){n.IsSuccess&&(y(n.LowFareTripResponseList),a());r.model.loading=!1})):(a(),r.model.loading=!1);r.$apply()}function g(){var f;r.preventLeft=!1;r.preventRight=!1;r.endOfMonthIndex=null;var e=[],n=r.chartData[0].departDate,i={month:n.getMonth(),year:n.getFullYear(),days:1};for(f=1;f<t;f++)n=r.chartData[f].departDate,n.getMonth()!==i.month?(e.push(i),r.endOfMonthIndex=f-1,i={month:n.getMonth(),year:n.getFullYear(),days:1}):i.days++,n<=Date.now()&&(r.preventLeft=!0),v.numDaysDifference(new Date,n)>=u&&(r.preventRight=!0);e.push(i);r.visibleMonths=e}function st(){var n=c.closest(".ha-modal")[0];return n.scrollHeight-n.scrollTop}function nt(){v.numDaysDifference(new Date(r.firstBufferDate),new Date(moment(Date.now()).utc().format("MM/DD/YYYY")))<=1&&(r.preventLeft=!0);v.numDaysDifference(new Date,new Date(r.lastBufferDate))>=u&&(r.preventRight=!0)}function it(){typeof r.legs=="string"&&(r.legs=w.parseLegs(r.legs),r.legs[0].origin.display=r.legs[0].origin.code,r.legs[0].destination.display=r.legs[0].destination.code);r.minPrice=Number.POSITIVE_INFINITY;r.maxPrice=Number.NEGATIVE_INFINITY;r.buffer={};r.visibleMonths=[];r.display=r.display||"calendar";r.maxForward={};r.chartData=[];r.calendarData={};r.currentDate=undefined;r.firstBufferDate=undefined;r.lastBufferDate=undefined;r.visibleMonths=[];r.model={tripLength:r.legs.length===2?moment(r.legs[1].departDate).diff(r.legs[0].departDate,"days"):0,loading:!1};r.tripType=r.legs.length;h.fetch("LowFare.nighttext,LowFare.nightstext").then(function(t){r.nightValues=n.copy(Array(61)).map(function(n,i){return i+" "+t[1]});r.nightValues[0]="0 "+t[0];r.nightValues[1]="1 "+t[0];r.$apply()});ut();r.updatePrices()}r.$on("calendarForward",function(){r.model.loading=!0;d(1)});r.$on("calendarBackward",function(){r.model.loading=!0;d(-1)});r.$watch("model.tripLength",function(n,t){n!==t&&(r.legs[1].departDate=moment(r.legs[0].departDate).add(n,"days").toDate(),r.maxForward={},r.updatePrices())});r.initialLoad=!0;r.$watch("results",function(n){n&&n.length&&(r.initialLoad=!1,p.enabled(!1),y(n),a(),g(),k.isMobile&&nt())});r.updatePrices=function(){r.error=!1;r.model.loading=!0;var n=rt();b(function(){l.fetchInitialPrices({data:n,config:{cache:!0}}).then(function(n){n.IsSuccess?(r.results=n.LowFareTripResponseList,n.isMaxDateReached&&(r.maxForward={date:r.results[r.results.length-1].DepartDate,disableForward:!0})):(r.error=!0,r.results=[]);b(function(){r.model.loading=!1})},50)})};r.move=function(n){if(i||r.error){r.model.loading=!1;return}r.moving=!0;i=!0;r.currentDate.setDate(r.currentDate.getDate()+n);var t=n/Math.abs(n);window.clearTimeout(f);f=window.setTimeout(function(){ot(t)},o);a();g()};r.monthFilter=function(n){return h("LowFare."+s[n])};r.getFlightResultsLink=function(n){var t="/Book/FlightResults?l="+r.legs[0].origin.code+"-"+r.legs[0].destination.code+"+"+moment(n).format("YYYY-MM-DD");return r.legs[1]&&(t+=","+r.legs[1].origin.code+"-"+r.legs[1].destination.code+"+"+moment(n).add(r.model.tripLength,"days").format("YYYY-MM-DD")),r.adults&&(t+="&a="+r.adults),r.children&&(t+="&c="+r.children),t};r.getLowLineStyle=function(){return"calc("+((1-r.selectedPrice.ratio)*100).toString()+"% + 45px)"};r.getBarStyle=function(n){return n.price?((1-n.ratio)*100).toString()+"%":r.model.loading||r.moving?"100%":"-23px"};r.getMonthStyle=function(n,t,i){return t==="width"?(n.days*4).toString()+"%":(i?((1-n.days/25)*100).toString():"0")+"%"};r.getTipStyle=function(n){return n.price?Math.min((1-n.ratio)*100,84).toString()+"%":r.model.loading||r.moving?"100%":"-23px"};r.setDisplay=function(n){r.display=n;it()};r.dayPlus=function(t,i){return n.isDate(t)?new Date(+t).dateAdd("day",i):new Date};r.selectDate=function(n,t){k.isMobile&&(t.preventDefault(),r.calendarData[n.YYYY_MM_DD()]&&b(function(){r.legs[0].departDate=n;r.selectedPrice.date=n;r.selectedPrice.price=r.calendarData[n.YYYY_MM_DD()].price}))};r.moveMobile=function(n){if(r.error||!k.isMobile)return!1;r.model.loading=!0;var t=n>0?new Date(r.lastBufferDate):new Date(r.firstBufferDate);l.fetchPrices(moment(t).format("YYYY-MM-DD"),n,{cache:!0}).success(function(t){var i,u;t.IsSuccess&&(n<0&&(i=st(),b(function(){var n=c.closest(".ha-modal")[0];n.scrollTop=n.scrollHeight-i},0)),y(t.LowFareTripResponseList),a(),u=n>0?"calendarGoForward":"calendarGoBackward",r.$broadcast(u,3));t.isMaxDateReached&&(r.preventRight=!0);nt();b(function(){r.model.loading=!1})})};r.setScrollPos=function(){$("#load-previous-row").length&&($("#FlexiblePriceView")[0].scrollTop=82)};var tt=!0;r.setChartPos=function(){tt&&k.isMobile&&(tt=!1,b(function(){var n=c.find(".selected-price");n.length&&c.closest(".ha-modal").scrollTop(n.offset().top-$(window).height()/2)},0))};it()}}}]);r.animation(".month-animation",function(){return{enter:function(n,t){n.css({opacity:0});n.delay(500).animate({opacity:1},{complete:t})}}});r.animation(".price-item-animation",function(){return{enter:function(n,t){if(n.hasClass("first-item")){var r=n.css("margin-left");return n.css({"margin-left":0}),n.animate({"margin-left":r},{easing:"linear",duration:500,complete:t}),function(){n.css({"margin-left":""});i=!1}}n.animate({"background-color":"transparent"},{duration:500,complete:t})},leave:function(n,t){if(n.animate({"margin-left":0},{easing:"linear",duration:500,complete:t}),n.hasClass("first-item")){var r=n.nextAll(":not(.ng-leave-prepare)").first();return r.css({"margin-left":0}),function(){r.css({"margin-left":""});i=!1}}}}})}(angular),function(n){"use strict";var t=n.module("haKisaTermsModule",[]);t.directive("haKisaTermsCheckboxLaunch",["$window","$rootScope","haConfig","haModal",function(n,t,i,r){return{restrict:"A",scope:!1,link:function(u,f,e){var o=e.contentVar||"termsAndConditions";e.ngModel&&(t.$on("termsModalFailure",function(n,t){t===o&&u.$eval(e.ngModel+" = false")}),t.$on("termsModalSuccess",function(n,t){t===o&&u.$eval(e.ngModel+" = true")}));n[o]&&n[o].ParentCheckBoxText&&f.after('<label for="'+e.id+'" class="required">'+n[o].ParentCheckBoxText+"<\/label>");u.termsStart=function(){n[o]&&(t.$broadcast("termsModalStart",o),r(i.getTemplateUrl("ha-kisa-terms-modal.html"),{id:"kisaTermsModal",backdrop:!0,modalLock:!0,scope:u,extendScope:{scContent:n[o],termsName:o}}))}}}}]);t.directive("haKisaTermsModal",["$rootScope","haConfig","haModal",function(n){return{restrict:"A",scope:!1,link:function(t){n[t.termsName]=n[t.termsName]||{allAccepted:!1,themes:t.scContent.PrivacyPolicies};t.terms=n[t.termsName];t.termsToggleAll=function(){var n;n=t.terms.allAccepted?!0:!1;t.terms.themes.forEach(function(t){t.accepted=n})};t.termsToggleTheme=function(n){t.terms.themes[n].accepted||(t.terms.allAccepted=!1)};t.cancelTerms=function(){n.$broadcast("termsModalFailure",t.termsName);t.$modalCancel()};t.submitTerms=function(){n.$broadcast("termsModalSuccess",t.termsName);t.$modalSuccess()}}}}])}(angular),function(n){"use strict";var t=n.module("haIslandGuideMapModule",[]);t.directive("haIslandGuideMap",["$rootScope",function(n){return{restrict:"A",scope:!0,link:function(){var r=$("#islandGuideMap .islandLabel"),t=$("#islandGuideMap .islandArt"),u=r.add(t),i=1.05;n.isMobile||t.hover(function(n){var t=$("<div><\/div>"),r=$(n.target).closest(".islandArt").find("*");t.css("left",1);t.animate({left:1.05},{duration:500,step:function(n){i=n;r.each(function(t,i){var r=i.getBBox(),u=r.width/2,f=r.height/2,e=r.x,o=r.y,s=-(u+e)*(n-1),h=-(f+o)*(n-1);$(i).attr("transform","translate("+s+","+h+") scale("+n+")")})}})},function(n){var t=$("<div><\/div>"),r=$(n.target).closest(".islandArt").find("*");t.css("left",i||1.05);t.animate({left:1},{duration:500,step:function(n){r.each(function(t,i){var r=i.getBBox(),u=r.width/2,f=r.height/2,e=r.x,o=r.y,s=-(u+e)*(n-1),h=-(f+o)*(n-1);$(i).attr("transform","translate("+s+","+h+") scale("+n+")")})}})});u.click(function(){window.location=$(this).attr("data-href")})}}}])}(angular),function(n){"use strict";var t=n.module("haNativeAppModalModule",[]);t.directive("haNativeAppModal",["$location","$rootScope","haGlobals","haUtils",function(t,i,r,u){var f=function(t){r("daysToHide",function(n){if(!n){t.daysToHide=0;return}if(n<0){t.daysToHide=0;return}t.daysToHide=n});t.createModalHideExpirationCookie=function(n){var i=new Date,r,u;!n||(i=new Date(n));r=new Date;r.setTime(i.getTime()+t.daysToHide.toString()*864e5);u="expires="+r.toUTCString();document.cookie=HA.CookiesRequireSsl?["ModalHideExpirationCookie="+i.toUTCString()+"; ",u,"; secure; ","; path=/"].join(""):["ModalHideExpirationCookie="+i.toUTCString()+"; ",u,"; path=/"].join("")};t.getModalHideExpirationCookie=function(){var n="",t=u.readCookie("ModalHideExpirationCookie");return!t||(n=decodeURIComponent(t)),n};t.removeModalHideExpirationCookie=function(){document.cookie=encodeURIComponent("ModalHideExpirationCookie")+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=; path="};$(window).load(function(){var i,u,f,e,o;if(r("defaultCountryCode",function(n){n!=="USA"}),i="",i=t.getModalHideExpirationCookie(),i!==""&&i!=="Invalid Date"){if(u=i,f=(new Date).toUTCString(),t.createModalHideExpirationCookie(u),e=moment(u).isValid()?moment(u):moment(),o=moment(f).isValid()?moment(f):moment(),t.daysToHide>o.diff(e,"days"))return;haModal({id:"modal-nativeapp-link-sms",backdrop:"true",template:n.element("#modal-nativeapp-link-sms"),scope:t})}else haModal({id:"modal-nativeapp-link-sms",backdrop:"true",template:n.element("#modal-nativeapp-link-sms"),scope:t,cancel:{label:"Close",fn:t.createModalHideExpirationCookie}})})};return{restrict:"A",scope:!0,link:f}}])}(angular),function(n){"use strict";var i=3,t=n.module("haDealTilesModule",[]);t.directive("haDealTiles",[function(){var t=function(t,r,u){var s=n.fromJson(u.dealsData),e,o,f,h;for(t.deals=s.DealTiles,console.log(s),e=[],o=-1,f=0;f<t.deals.length;f++)h=t.deals[f],f%i==0&&(e.push({group:[]}),o++),e[o].group.push(h);t.dealGroups=e};return{restrict:"A",scope:!0,link:t}}]);t.directive("haDealTile",["haConfig","$rootScope",function(n,t){var i="ha-deal-tile-base-template.html",r=function(n){if(console.log("deal tile 2020 directive link"),console.log(n.model),n.model.LowestFare=Math.min(n.model.MainCabinBasicFare||Number.POSITIVE_INFINITY,n.model.Fare),n.referenceMark=n.referenceMark||"*",t.footnotes&&t.footnotes.numeric&&t.references||(t.footnotes={numeric:[]},t.references={}),t.references[n.model.DisclaimerGuid])n.model.DisclaimerReferenceMark=t.references[n.model.DisclaimerGuid];else if(n.model.Disclaimer&&n.model.TripType!=3){t.references[n.model.DisclaimerGuid]=n.referenceMark+(Object.keys(t.references).length+1);n.model.DisclaimerReferenceMark=t.references[n.model.DisclaimerGuid];var i=n.model.LowestFare&&n.model.LowestFare===n.model.MainCabinBasicFare,r=i?n.model.MainCabinBasicDisclaimer:n.model.Disclaimer;t.footnotes.numeric.push({id:"*"+(t.footnotes.numeric.length+1),text:r})}};return window.location.pathname=="/"&&(i="ha-deal-tile-base-template-lazyload.html"),{restrict:"A",scope:{model:"="},link:r,templateUrl:n.getTemplateUrl(i)}}])}(angular),function(n){"use strict";var t=n.module("bookingWidgetSlimModule",[]);t.directive("bookingWidgetSlim",["$rootScope",function(t){var i=t.isMobile?0:40,r=2,u=function(u,f){var o=n.element('<div id="booking-widget-overlay"><\/div>'),e;u.$watch("tab",function(n,t){t!=n&&n!="bookflights"&&(u.expanded=!0)});e=null;u.$watch("expanded",function(n){if(!t.isMobile)if(n)f.before(o),o.click(function(){u.expanded=!1;u.$apply()}),e=window.pageYOffset,$("html, body").animate({scrollTop:f.offset().top-i});else{o.remove();var s=f.outerHeight();e!=null&&Math.abs(window.pageYOffset-(f.offset().top-i))<=r&&window.scrollTo({left:0,top:e});e=null;u.tab="bookflights"}});f.bind("keydown keypress",function(n){n.which===27&&(u.expanded=!1,u.$apply(),n.preventDefault())})};return{restrict:"A",scope:!0,link:u}}])}(angular),function(n){"use strict";function o(n){return u.indexOf(n)!==-1?(u.splice(u.indexOf(n),1),!0):!1}function e(n,i,r,u){var f=t(r);/text|html|value/.test(u)?n[u==="value"?"val":u](f):(i[i.$normalize(u)]=f,n.attr(u,f));i.scsHideEmpty!==undefined&&o(r)&&n.addClass("hidden")}function s(n){return n.replace(/[A-Z]/g,function(n,t){return(t?"-":"")+n.toLowerCase()}).replace(/^[^-]+-/,"")}function r(n,t,i){return n=n.replace(/{(\d+)}/g,function(n,i){return t&&t[i]}),i&&(n=n.replace(/{([^}]+)}/g,function(n,t){return i.$eval(t)||n})),n}function h(n){if(!n[0].attributes[0])throw new Error("`scs` element must have a keys attribute");return n[0].attributes[0].name}function f(n){return console.error("SCString not found: ",n),u.push(n),"["+n+"]"}var i=n.module("haSitecoreModule",["haGlobalsModule"]),u=[],t=f;i.factory("haSitecoreStrings",["$parse","haGlobals","$q","haConfig","haHttpService",function(i,u,e,o,s){function a(n){var r=i(n.toLowerCase())(t);return typeof r=="undefined"&&f(n),!!r&&!/0|false/.test(r)&&r}function h(n){return s.GET(l(n)).then(function(i){return i.data?t[n]=i.data:Promise.reject(new Error("Invalid response data"))})}function c(n){var r=/^(\w+)(?:(?:\.|\[['"])([\w ]+))?/.exec(n);if(!r)return Promise.reject(new Error("Invalid ns_key argument: "+n));var i=r[1].toLowerCase(),u=r[2],f=t[i]?Promise.resolve(t[i]):t[i]=h(i);return f.then(function(i){return u?t(n):i})}var l=o.getSitecoreResourceUrl;return t=function(u,e){var o=i(u.toLowerCase())(t);return o&&n.isArray(e)&&(o=r(o,e)),o||f(u)},t.truthy=a,t.request=h,t.get=c,t.fetch=function(n){return typeof n!="string"?Promise.resolve(t):Promise.all(n.split(",").map(c))},u("HA",function(i){n.extend(t,i.SCStrings)}),t}]);i.factory("haSitecore",["haGlobals","haConfig","haHttpService",function(t,i,r){function u(t,i){i||(i={});t=t.toLowerCase();i.src=o("/static/images/"+t);var r=n.element("<img alt>").attr(i);return u.alt(t).then(function(n){r.attr("alt",n||"")}),["catch"](function(n){console.error(n)}),r}function e(n){return!!e[n.toLowerCase()]}var f=0,o=i.getImgUrl,s=i.getDynamicJsonUrl("sitecoreimages");return u.alt=function(t){if(t=t.toLowerCase(),f){var i=u[t];return typeof i=="undefined"?Promise.reject(new Error("Sitecore image not found: "+t)):Promise.resolve(i)}return r.GET(s).then(function(i){if(i.data){f++;n.extend(u,i.data);return}return f<3?u.alt(t):Promise.reject(new Error("Data unavailable"))})},t("HA",function(t){n.extend(e,t.SCSwitches)}),{$switch:e,$img:u}}]);["scsText","scsHtml","scsLabel","scsEyebrow","scsPlaceholder","scsErrorMessage","scsHref","scsSrc","scsDescription","scsHeader","scsValue"].forEach(function(n){var t=s(n);i.directive(n,function(){return{priority:500,link:{pre:function(i,r,u){e(r,u,u[n],t)}}}})});i.directive("i18nContent",function(){return{restrict:"A",link:function(n,i,u){var e=r(u.i18nContent,[],n),f=i.attr("format")||i.text();t.fetch(e).then(function(t){var u=i.contents(),e;if(u.length>1||u.length===1&&u[0].nodeType!==3&&u[0].nodeType!==8)return console.error("i18n-content directive can only only be applied to an element with a text node child.");e=i[0].nodeName==="INPUT"?"val":"html";i[e](f?r(f,t,n):t.join(" "))})}}});i.directive("i18nBackgroundImage",function(){return{restrict:"A",link:function(n,i,u){var f=r(u.i18nBackgroundImage,[],n);t.get(f).then(function(t){i.css("background-image",r("url('{0}')",[n.getMediaImage(t)]))})}}});i.directive("i18nSrc",function(){return{restrict:"A",link:function(n,i,u){var f=r(u.i18nSrc,[],n);t.get(f).then(function(t){i.attr("src",n.getMediaImage(t))})}}});i.directive("i18nimage",["haUtils",function(n){return{restrict:"E",replace:!0,scope:{},template:'<img ng-src="{{object.src}}" alt=""/>',link:function(i,r){var u=r.attr("key");t.get(u).then(function(t){t!=="["+u+"]"?(i.object=n.getImageObjectFromSiteCoreString(t),i.object.alt&&r.attr("alt",i.object.alt),i.object.width&&r.attr("width",i.object.width),i.object.height&&r.attr("height",i.object.height)):r.replaceWith(t)})}}}]);i.directive("i18nLink",["$window",function(n){return{restrict:"E",replace:!0,scope:{},template:"<a><\/a>",link:function(i,r){var u=r.attr("key");t.get(u).then(function(t){var i=$(t);i[0]&&(r.attr("href","http://"+(i.attr("linktype")==="internal"?n.location.host:"")+i.attr("url")),r.attr("title",i.attr("title")),r.text(i.attr("text")))})}}}]);i.directive("i18n",function(){return{restrict:"E",link:function(n,i){var u=i.attr("key")||i.attr("keys")||h(i);t.fetch(u).then(function(t){var u=i.text();i.replaceWith(u?r(u,t,n):t.join(" "))})}}});i.directive("scsAttrs",["$parse",function(t){return{link:{pre:function(i,r,u){var f=t(u.scsAttrs)(i);typeof f=="object"&&n.forEach(f,e.bind(this,r,u))}}}}]);i.run(["$rootScope","haSitecoreStrings","haSitecore",function(n,t,i){n.constructor.prototype.$scs=t;n.constructor.prototype.$switch=i.$switch;n.constructor.prototype.$img=i.$img;window.$scs=t;window.$switch=i.$switch;window.$img=i.$img}])}(angular),function(n){"use strict";var t=n.module("haAdvanceToNextInputService",[]);t.service("haAdvanceToNextInput",[function(){return{next:function(n){var t=$("input[ha-advance-to-next-input]"),i=t.index(n.find("input[ha-advance-to-next-input]")),r=t.eq(i+1);r.length>0&&i>=0&&setTimeout(function(){r.focus()},0)}}}]);t.run(["$rootScope","haAdvanceToNextInput",function(n,t){n.$on("haAdvanceToNextInput:next",function(n,i){t.next(i)})}])}(angular),function(n){"use strict";var t=n.module("haCalendarEventsService",[]);t.service("haCalendarEventsService",function(){var n={"123":{promoDays:[{start:{year:2013,month:10,day:20},end:{year:2013,month:11,day:1}},{start:{year:2013,month:11,day:16},end:{year:2013,month:11,day:18}},{start:{year:2013,month:11,day:30},end:{year:2013,month:12,day:1}}]},"456":{unavailableDays:[{start:{year:2013,month:11,day:8},end:{year:2013,month:11,day:10}}]},"789":{unavailableDays:[{start:{year:2013,month:11,day:8},end:{year:2013,month:11,day:10}}],promoDays:[{start:{year:2013,month:10,day:20},end:{year:2013,month:11,day:1}},{start:{year:2013,month:11,day:16},end:{year:2013,month:11,day:18}},{start:{year:2013,month:11,day:30},end:{year:2013,month:12,day:1}}]}};return{getEvents:function(t,i){setTimeout(function(){i(n[t])},1)}}})}(angular),function(n){"use strict";function t(n,i){return typeof i=="undefined"&&(i=3),n().then(undefined,function(r){if(i>0&&[0,408,500,502,503,504].indexOf(r.status)>=0)return t(n,i-1);throw r;})}var i=n.module("haCitiesModule",["haCitiesAPI"]);i.factory("haCitiesSvc",["$q","$log","$filter","haCitiesAPI",function(i,r,u,f){var e={},o=!1,c=function(n,t){var r,i;if(t!=null){if(typeof t=="string"&&(t=u(t)),typeof t!="function")return n;for(r=[],i=0;i<n.length;i++)n[i]!=null&&t(n[i])&&r.push(n[i]);return r}return n},k=function(n){return o=!0,s(n)},s=function(n){var r,u;return o&&!e.CITY_LIST_EXPERT_BOOKING&&(e.CITY_LIST=null),e.CITY_LIST?(r=i.defer(),r.resolve(c(e.CITY_LIST,n)),r.promise):(u=o?f.getCityListExpertBooking:f.getCityList,t(u).then(function(t){return e.CITY_LIST=t,o&&(e.CITY_LIST_EXPERT_BOOKING=t),c(e.CITY_LIST,n)}))},d=function(n,i){var r=function(){return f.getFilteredCityList(n,i)};return t(r).then(function(n){return n})},h=function(){if(e.CITY_MAP!=null){var n=i.defer();return n.resolve(e.CITY_MAP),n.promise}return s().then(function(n){e.CITY_MAP={};for(var t=0;t<n.length;t++)e.CITY_MAP[n[t].Code]=n[t];return e.CITY_MAP})},a=function(){var n,r;return o&&!e.CITY_PAIRS_EXPERT_BOOKING&&(e.CITY_PAIRS=null),e.CITY_PAIRS?(n=i.defer(),n.resolve(e.CITY_PAIRS),n.promise):(r=o?f.getCityPairsExpertBooking:f.getCityPairs,t(r).then(function(n){return e.CITY_PAIRS=n,o&&(e.CITY_PAIRS_EXPERT_BOOKING=n),e.CITY_PAIRS}))},v=function(){if(e.NITP_MAP!=null){var n=i.defer();return n.resolve(e.NITP_MAP),n.promise}return t(f.getNitpMap).then(function(n){return e.NITP_MAP=n,e.NITP_MAP})},g=function(n){return h().then(function(t){return t[n]})},nt=function(n){return e.CITY_MAP[n]},l=function(n,t){var u=[],r,i;if(t=t||1,!e.CITY_PAIRS||!e.CITY_MAP)return[];for(r=e.CITY_PAIRS[n],i=0;i<r.length;i++)u.push(e.CITY_MAP[r[i]]);return u},tt=function(n,t){return t=t||1,i.all([a(),h()]).then(function(){return l(n,t)})},y=function(n,t,i){return n==null?s(i):(t=t||1,tt(n,t).then(function(n){return c(n,i)}))},p=function(n){for(var i=[],t=0;t<n.length-1;t++)i.push(n[t]+" "+n[t+1]),i.push(n[t]+n[t+1]);return n.concat(i)},it=function(t,i){var r=0,u,f,e,o;return i==null?r:(t.DisplayName===i&&(r=100),u=i.split(" ").join(""),t.Code!=null&&t.Code.toUpperCase()===i.toUpperCase()&&(r+=1),t.DisplayName!=null&&(f=p(t.DisplayName.split(" ")),n.forEach(f,function(n){n.toLowerCase().indexOf(i.toLowerCase())===0?r+=.3:n.toLowerCase().indexOf(u.toLowerCase())===0&&(r+=.15)})),t.LinkedAirportCodes!=null&&(e=t.LinkedAirportCodes.split(","),n.forEach(e,function(n){n.toUpperCase()===i.toUpperCase()&&(r+=.2)})),t.SearchTags!=null&&(o=p(t.SearchTags.split(" ")),n.forEach(o,function(n){(n.toLowerCase().indexOf(i.toLowerCase())===0||n.toLowerCase().indexOf(u.toLowerCase())===0)&&(r+=.1)})),r>0&&t.IsHACity&&(r+=.5),t._weight=r,t._weight)},w=function(n,t){for(var i,u=[],r=0;r<n.length;r++)i=n[r],i!=null&&it(i,t)>0&&u.push(i);return u},rt=function(n,t,i){return o=!0,b(n,t,i)},b=function(n,t,i){return y(t,1,i).then(function(t){return u("orderBy")(w(t,n),"-_weight")})},ut=function(n,i,r){var e=function(){return f.getFilteredCityList(i,r)};return t(e).then(function(t){return u("orderBy")(w(t,n),"-_weight")})},ft=function(){return i.all([s(),v()]).then(function(n){for(var i,r=n[0],f=n[1],u=[],t=0;t<r.length;t++)i=r[t],f.hasOwnProperty(i.Code)&&u.push(i);return u})},et=function(n){return i.all([s(),v()]).then(function(t){for(var s,i,u,f=t[0],h=t[1],e=[],o=h[n],r=0;r<o.length;r++)for(s=o[r],i=0;i<f.length;i++)u=f[i],u.Code===s&&e.push(u);return e})};return e.preloadCitiesExpertBooking=function(){o=!0;e.preloadCities()},e.preloadCities=function(){h();a()},e.isInternational=function(n){return n!=null&&n.Market===3},e.pairIsInvalid=function(n,t){var r,u,i,f;if(!n||!t)return!0;for(r=l(n),u=[],i=0,f=r.length;i<f;i++)r[i]&&r[i].Code&&u.push(r[i].Code);return u.indexOf(t)<0?!0:!1},e.getAllCities=s,e.getAllCitiesExpertBooking=k,e.getFilteredCities=d,e.getReachableCities=y,e.getCityByCode=g,e.getCityByCodeSync=nt,e.getMatchingCities=b,e.getNitpOrigins=ft,e.getNitpDestinations=et,e.getMatchingFilteredCities=ut,e.getCityMap=h,e.getValidPairs=l,e.getMatchingCitiesExpertBooking=rt,e.getHotelCities=f.getExpediaCityList,e.searchCarLocations=f.searchCarLocations,e.getAllCarLocations=f.getAllCarLocations,e.getCarLocationById=f.getCarLocationById,e}])}(angular),function(n){"use strict";var t=n.module("haCustomerSelectionsService",[]);t.service("haCustomerSelections",["$rootScope","haUtils",function(t,i){var r;return $.extend(t,{selections:{tripName:"Default Trip Name",legs:[],passengers:[]}}),t.$watch("selections",function(){r.updateTotal()},!0),r={clearLegs:function(){t.selections.legs=[]},createLegs:function(n,i){for(var r=0;r<n;r++)!i&&(i||t.selections.legs[r])||t.selections.legs[r]===undefined&&(t.selections.legs[r]={})},getLeg:function(n){return!i.isNumber(n)||!t.selections.legs[n]?!1:t.selections.legs[n]},setLegDate:function(i,u){var f=null,e=u?new Date(u.year,u.month-1,u.day):new Date(new Date*1+6048e5*i),h=new Date,o=new Date(h.getFullYear(),h.getMonth(),h.getDate()),s;u===undefined?(i>0&&(f=t.selections.legs[i-1].date),f===undefined&&(f={year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()})):(f=u,s=0,n.forEach(t.selections.legs,function(n){if(n.date!=null){var t=new Date(n.date.year,n.date.month-1,n.date.day);s<i?t>e&&(n.date=f):s>i&&t<e&&(n.date=f)}s++}));t.selections.legs[i].date=f;e<o&&setTimeout(function(){r.setLegDate(i,{year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()})},0)},updateTotal:function(){t.selections.currentTotal=1234.56},updateLegDates:function(){var u,r,n,i,f,e;if(t.selections.legs&&t.selections.legs.length>1)for(u=t.selections.legs.length,r=0;r<=u-2;r++)n=t.selections.legs[r],i=t.selections.legs[r+1],n.date!=null&&i.date!=null&&(f=new Date(n.date.year,n.date.month-1,n.date.day),e=new Date(i.date.year,i.date.month-1,i.date.day),e<f&&(i.date=n.date))}}}])}(angular),function(n){"use strict";n.module("haDataCacheService",["haHttpService"]).service("haDataCacheService",["haHttpService","$cacheFactory",function(n,t){var i=t.get("haDataCache");return{get:function(t){return n.GET(t,{cache:i})}}}])}(angular),function(n){"use strict";var t=n.module("haFavoritesService",[]);t.service("haFavorites",["$rootScope",function(n){var i=[{title:"Waimoku Falls Trail",photo:"/Content/assets/common/images/demo-nav-wishlist1.jpg",location:"Haleakala National Park"}],t={updateFavorites:function(){return n.favorites=i,t}};return t}])}(angular),function(n){"use strict";var t=n.module("haGlobalsModule",[]);t.factory("haGlobals",["$window",function(t){return function(i,r,u){if(i=[].concat(i),u=!!u,i.length!==0&&r!=null){var o=[],f=!1,e=!0;n.forEach(i,function(n){var i=typeof t[n]!="undefined"&&t[n]!==null;f=f||i;e=e&&i;o.push(t[n])});(u&&e||!u&&f)&&r.apply(null,o)}}}])}(angular),function(n){"use strict";var t=n.module("haHelpAndTipsService",[]);t.service("haHelpAndTips",function(){var n={cityName:"Kahului, Maui",months:[{sunnyPct:"80",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"},{sunnyPct:"90",tempLow:"70F",tempHigh:"84F"}]};return{getData:function(t,i){n.cityName=t==="OGG"?"Kahului, Maui":t==="HNL"?"Honolulu":"Default Data";i(n)}}})}(angular),function(n){"use strict";n.module("haHttpService",[]).factory("requestedWithInterceptor",["$location","$rootScope",function(n,t){return{request:function(n){return/\/\//.test(n.url)||(n.headers["X-Requested-With"]="XMLHttpRequest",n.headers.csrf=t.csrf),n},response:function(n){if(n&&n.data&&n.data.ErrorType){if(n.data.ErrorType==="TabError"){window.location.href="/book/error?ErrorType=TabError";return}if(n.data.ErrorType==="SessionTimeOut"){window.location.href="/book/error?ErrorType=SessionTimeOut";return}}return n}}}]).factory("sessionLostInterceptor",["$q","$rootScope",function(n,t){return{responseError:function(i){return i&&i.status===401&&t.$broadcast("$sessionLostEvent"),n.reject(i)}}}]).config(["$httpProvider",function(n){n.interceptors.push("requestedWithInterceptor");n.interceptors.push("sessionLostInterceptor")}]).factory("haHttpService",["$log","$http","$q",function(t,i,r){return{GET:function(n,r){return r=r||{},typeof t.debug=="function"&&t.debug("GET "+n),i.get(n,r).error(function(i,r){t.warn("["+r+"] GET "+n,i)})},GETPARALLEL:function(t){var u=r.defer(),f=[];return n.forEach(t,function(n){f.push(i.get(n))}),r.all(f).then(function(n){u.resolve(n)},function(){u.reject()}),u.promise},POST:function(n,r,u){return u=u||{},typeof t.debug=="function"&&t.debug("POST "+n),i.post(n,r,u).error(function(i,r){t.warn("["+r+"] POST "+n,i)})},PUT:function(n,r,u){return u=u||{},typeof t.debug=="function"&&t.debug("PUT "+n),i.put(n,r,u).error(function(i,r){t.warn("["+r+"] PUT "+n,i)})},DELETE:function(n,r){return r=r||{},typeof t.debug=="function"&&t.debug("DELETE "+n),i["delete"](n,r).error(function(i,r){t.warn("["+r+"] DELETE "+n)})}}}]).directive("form",["$rootScope",function(n){return{restrict:"E",link:function(t,i){i.length&&n.csrf&&i.append($('<input type="hidden" name="__RequestVerificationToken" value="'+$('body > [name="__RequestVerificationToken"]').val()+'" />'))}}}])}(angular),function(n){"use strict";var t=n.module("haModalService",[]);t.factory("haModal",["$document","$compile","$rootScope","haConfig","$controller","$timeout",function(t,i,r,u,f,e){function s(t,u,s){var d=n.element('<div class="ha-loading-spinner fixed"><div><div><\/div><\/div><\/div>'),w,ft,et,c,ot,st;o.append(d);var y=$(document.activeElement),p=window.pageYOffset,g=!1,nt=!1;n.isObject(t)?(s=u,u=t):u.templateUrl=t;u=n.extend({},h,u);w=u.id?' id="'+u.id+'" ':"";document.body.dispatchEvent(new CustomEvent("ModalOpened",{detail:u.id}));r.$broadcast("cancelTooltip");var tt=function(){return u.template?n.isString(u.template)?u.template:u.template.html():"<div ng-include=\"'"+u.templateUrl+"'\"><\/div>"}(),l="",v="",it=u.modalLock;it?(l=n.element('<div class="ha-modal '+u.modalClass+' fade"'+w+' tabindex="0"><div class="modalContainer modalLock '+u.size+'">'+tt+"<\/div><\/div>"),v=n.element('<div class="modal-backdrop">')):(l=n.element('<div class="ha-modal '+u.modalClass+' fade"'+w+' tabindex="0"><div class="modalContainer '+u.size+'"><a class="close-modal-icon" ng-click="$modalCancel()" href="" role="button"><i class="close ha-icon icon-close"><\/i><span class="sr-only" scs-text="forms.close"><\/span><\/a>'+tt+"<\/div><\/div>"),v=n.element('<div class="modal-backdrop" ng-click="$modalCancel($event)">'));var a,b,ht=function(){a=$(l[0]).find(":focusable");b=$(l[0]).find("input[type=text], input[type=email], textarea, select");b.length>0?$("html").hasClass("lte-ie9")||$(b[0]).focus():r.isMobile||$(a[0]).focus()},ct=function(){var n=c.$watch(function(){return l.find(".modalContainer").height()},function(t){if(t!==0){var i=l.find(".modalContainer"),r=i.outerHeight()/-2;i.css({top:"50%","margin-top":r});n()}})},rt=function(n){if(n.keyCode===9){a=$(l[0]).find(":focusable").get();var t=document.activeElement===a[0],i=document.activeElement===a[a.length-1];n.shiftKey&&t?(n.preventDefault(),a[a.length-1].focus()):!n.shiftKey&&i&&(n.preventDefault(),a[0].focus())}},ut=function(n){n.keyCode!==27||it||($(document.activeElement).blur(),c.$modalCancel(n))},k=function(){nt||(nt=!0,o.unbind("keydown",ut),o.unbind("keydown",rt),v.removeClass("fade in"),l.removeClass("in"),e(function(){if(l.remove(),o.removeClass("modal-active"),r.modalsopen--,r.modalsopen==0&&(r.modalactive=!1),r.isMobile&&!g){var n=parseFloat($("body").css("margin-top"));p=n*-1;$("body").css({"margin-top":0});window.scrollTo(0,p)}u.backdrop&&v.remove()},300))};o.bind("keydown",ut);o.bind("keydown",rt);c=u.scope||r.$new();u.extendScope&&n.extend(c,u.extendScope);r.modalsopen?r.modalsopen++:r.modalsopen=1;r.modalactive=!0;c.$defaultContent=u.defaultContent;c.$title=u.title;c.$heading=u.heading;c.$modalClose=k;c.$on("$modalCancel",function(n,t){t&&t.length?t===u.id&&c.$modalClose():c.$modalClose()});c.$on("$modalOpened",function(n,t){t&&t.length&&t!==u.id&&(g=!0)});c.$modalCancel=function(n){var t=l.find(".modalContainer"),i;(!n||n.type!=="click"||$.contains(t[0],n.target)&&!t.is(n.target)&&$.contains(document,n.target))&&(i=u.cancel.fn||k,c.$modalClose(),e(function(){c.$emit("haModalClosed",u.id);!r.isMobile&&y&&y[0]&&y[0].tagName!=="g"&&y.focus()},300),i.call(this))};c.$modalSuccess=function(){var n=u.success.fn||k;n.call(this);c.$modalClose()};c.$modalSuccessLabel=u.success.label;c.$modalCancelLabel=u.cancel.label;u.controller&&(et=n.extend({$scope:c},s),ft=f(u.controller,et),l.contents().data("$ngControllerController",ft));r.$on("closeModal",function(){c.$modalCancel()});i(l)(c);i(v)(c);o.append(l);o.addClass("modal-active");r.isMobile&&(ot=parseFloat($("body").css("margin-top")),ot>=0&&$("body").css({"margin-top":p*-1}),l.find(".modal-header").length&&(st=l.find(".modal-header").outerHeight(),l.find(".modal-main").css({paddingTop:st})));r.$broadcast("$modalOpened",u.id);u.backdrop&&(o.append(v),e(function(){v.addClass("fade in")},0));$(".ha-modal").on("click",function(n){n.stopPropagation();$(n.target).hasClass("ha-modal")&&!u.modalLock&&c.$modalCancel()});return e(function(){l.addClass("in");d.addClass("ng-hide");ht();u.callback&&u.callback(l);!r.isMobile&&u.verticalCenter&&ct();r.isMobile&&u.mobileVerticalCenter&&l.addClass("mobile-vertical-center")},100),c}var h={id:null,template:null,templateUrl:null,title:"Default Title",heading:"Default Heading",backdrop:!0,success:{label:"OK",fn:null},cancel:{label:"Close",fn:null},controller:null,backdropClass:"modal-backdrop",defaultContent:null,modalClass:"modal",modalLock:!1,size:"",verticalCenter:!1,mobileVerticalCenter:!1},o=t.find("body");return s.openPriceCalendar=function(n,t,i){var r={id:"FlexiblePriceView",backdrop:"true",extendScope:{legs:n,adults:t||1,children:i||0}};s(u.getTemplateUrl("/Book/FlightSearch/ha-flexible-price-modal.html"),r)},window.haModal=s,s}])}(angular),function(n){"use strict";var t=n.module("haSearchCacheService",[]);t.service("haSearchCache",["$rootScope",function(n){return $.extend(n,{searchCache:[{tripName:"Trip To Honolulu",legs:[{origin:"SFO",destination:"HNL",date:{year:2013,month:9,day:10},time:{start:900,end:2100}}]},{tripName:"Trip To Honolulu",legs:[{origin:"SFO",destination:"HNL",date:{year:2013,month:9,day:10},time:{start:900,end:2100}},{origin:"HNL",destination:"SFO",date:{year:2013,month:9,day:20},time:{start:900,end:2100}}]},{tripName:"Trip To Hawaii",legs:[{origin:"SFO",destination:"HNL",date:{year:2013,month:9,day:10},time:{start:900,end:2100}},{origin:"HNL",destination:"OGG",date:{year:2013,month:9,day:15},time:{start:900,end:2100}},{origin:"OGG",destination:"SFO",date:{year:2013,month:9,day:20},time:{start:900,end:2100}}]}]}),{cacheCurrentSelections:function(){n.searchCache.unshift(n.selections)},restoreSearch:function(t){n.searchCache[t]&&(n.selections=$.extend(!0,{},n.searchCache[t]))}}}])}(angular),function(n){"use strict";var t=n.module("haSegmentService",[]);t.service("haSegmentService",["haPassengersService","$log",function(t,i){return{selectedSegments:[],legs:[],numFares:function(i,r){var u={Adult:0,Child:0,Infant:0},f=this.getRelevantPaxTypes();return t.passengers!=null&&n.forEach(t.passengers,function(n){n.Type==="Child"&&f.indexOf(n.Type)<0?u.Adult++:u[n.Type]++}),u[r]},getRelevantPaxTypes:function(i){var r=[],u=this,f=i?[i]:this.selectedSegments;return n.forEach(t.getNonInfants(),function(t){n.forEach(f,function(n){u.getFare(n,t.Type,!0)&&r.indexOf(t.Type)===-1&&r.push(t.Type)})}),r},getFare:function(t,r,u){var f,o=this,e;return t!=null?(e=this.getFareClass(t),t.BookingFares!=null&&n.forEach(t.BookingFares,function(n){if(n.Name.toLowerCase()===e){var t=n.FareTypes[r];f=u?t:o.getClosestFare(r,n.FareTypes)}})):i.warn('getFare() called with null "segment"'),f},getClosestFare:function(n,i){for(var u,f=t.types.indexOf(n),r=f;r>=0;r--)if(u=i[t.types[r]],u)return u},getFareClass:function(n){var t;return n!=null?n.BookingFares!=null&&n.BookingFares[0]!=null&&typeof n.BookingFares[0].Name=="string"&&(t=n.BookingFares[0].Name.toLowerCase()):i.warn('getFareClass() called with null "segment"'),n.selectedSeatClass||t},getExtraComfortPrice:function(t){var i=0;return this.Legs!=null&&n.forEach(t.Legs,function(n){i+=this.getLegExtraComfortPrice(n)}),i},getLegExtraComfortPrice:function(t){var i=0;return t.SeatSelections!=null&&n.forEach(t.SeatSelections,function(n){i+=n.price}),i}}}])}(angular),function(n){"use strict";n.module("haTemplateCache",["haHttpService"]).service("haTemplateCache",["haHttpService","$templateCache",function(n,t){return{get:function(i){return n.GET(i,{cache:t})}}}])}(angular),function(n){"use strict";var t=n.module("haUserService",[]);t.service("haUser",["$rootScope",function(n){var i={firstName:"John",lastName:"Doe",photo:"/Content/assets/common/images/demo-nav-account-pic-icon.jpg",haMiles:"14552",upcomingTrips:[{departTime:1386375432426,arriveTime:1386375432426,flights:[123,456,789],onTime:!0},{departTime:1386375432426,arriveTime:1386375432426,flights:[123,456,789],onTime:!0}],savedTrips:[{tripName:"Trip to Maui",tripType:"Package",tripLink:"#",newPrice:!1,savedDate:1386375432426,departDate:1386375432426,returnDate:1386375432426,otherPassengers:["Charlie Becket","Mako Becket","Brad Becket"]},{tripName:"Trip to Honolulu",tripType:"Package",tripLink:"#",newPrice:!0,savedDate:1386375432426,departDate:1386375432426,returnDate:1386375432426,otherPassengers:["Charlie Becket"]},{tripName:"Trip to Big Island",tripType:"Package",tripLink:"#",newPrice:!0,savedDate:1386375432426,departDate:1386375432426,returnDate:1386375432426,otherPassengers:["Charlie Becket","Brad Becket"]}],eCerts:[{title:"30% Off",subtitle:"Mainland to Hawaii Islands",travelStart:1386375432426,travelEnd:1386375432426,bookBy:1386375432426}]},t={updateUser:function(){return n.user=i,t},logout:function(){return delete n.user,t}};return t.updateUser(),t}])}(angular),function(n){"use strict";String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,i){return typeof n[i]!="undefined"?n[i]:t})});var t=n.module("haUtilsModule",["haViewModelModule"]);t.factory("haUtils",["$rootScope","$log","$window","$locale","haViewModelSvc","haConfig",function(t,i,r,u,f,e){function l(){var n,t=/([^&=]+)=?([^&]*)/g,i=window.location.search.substring(1);for(s={};n=t.exec(i);)s[h(n[1])]=h(n[2])}function h(n){return decodeURIComponent(n.replace(/\+/g," "))}function c(t){var r=null,i=t.split("|"),u;return i.length===6&&(r={FlightSearchSegmentList:[],FlightQueryTypeId:parseInt(i[1]),AdultCount:parseInt(i[2]),ChildCount:parseInt(i[3]),InfantCount:parseInt(i[4]),IsRefundable:i[5]==="true"?!0:!1},u=i[0].split("+"),n.forEach(u,function(n){var t=n.split("=");t.length===4&&r.FlightSearchSegmentList.push({DepartureDate:t[0],OriginCityCode:t[1],DestinationCityCode:t[2],IsMiles:t[3]==="true"?!0:!1})})),r}var o={debounce:function(n,t,i){var r;return function(){function e(){i||n.apply(u,f);r=null}var u=this,f=arguments;r?clearTimeout(r):i&&n.apply(u,f);r=setTimeout(e,t||100)}},safeApply:function(n,i){if(typeof n.$id!="number"&&typeof i=="function")throw new Error("safeApply expects a scope and a function.");var r=t.$$phase;r==="$apply"||r==="$digest"?i():n.$apply(i)},closestInArray:function(n,t){var r,u=Infinity,i,f;for(i in n)f=Math.abs(n[i]-t),Math.abs(n[i]-t)<u&&(u=f,r=n[i]);return r},getChildrenPositions:function(n,t){var r=n.get(0).getBoundingClientRect().left,i=[];return t.each(function(){i.push(this.getBoundingClientRect().left-r)}),i},indexOf:function(n,t){if(!n||!t)return-1;for(var i=0;i<n.length;i++)if(n[i]===t)return i;return-1},inIframe:function(){try{return r.self!==r.top}catch(n){return!0}},isNumber:function(n){return!isNaN(parseFloat(n))&&isFinite(n)},leftPad:function(n,t){for(var i=n+"";i.length<t;)i="0"+i;return i},objRef:function(n,t){t=t.split(".");for(var i=0;i<t.length;i++){if(!n||n[t[i]]===undefined)return undefined;n=n[t[i]]}return n},objSet:function(n,t,i){for(t=t.split(".");t.length>1;)n=n[t.shift()];return n[t.shift()]=i,i},readCookie:function(n){n+="=";for(var i=document.cookie.split(/;\s*/),t=i.length-1;t>=0;t--)if(!i[t].indexOf(n))return i[t].replace(n,"")},getFlightQueryModelCookie:function(){var n=this.readCookie("FlightQueryModelCookie2"),t;return n!==undefined&&(i.debug("FlightQueryModelCookie2: Found"),n=decodeURIComponent(n),t=c(n),t)?t:(i.debug("FlightQueryModelCookie2: null"),null)},getFlightQueryModelRecentCookie:function(){var t=this.readCookie("FlightQueryModelRecentCookie2"),r,u;return t!==undefined&&(i.debug("getFlightQueryModelCookie2: Found"),t=decodeURIComponent(t),r=[],u=t.split(","),n.forEach(u,function(n){var t=c(n);t&&r.push(t)}),r.length>0)?r:(i.debug("getFlightQueryModelCookie2: null"),null)},getReshopFlightQueryModelCookie:function(){var n=this.readCookie("ReshopFlightQueryModelCookie");return n!==undefined?(n=decodeURIComponent(n),JSON.parse(n)):null},isEN:function(){var t=n.element("body");return t.hasClass("en")||t.hasClass("en-au")||t.hasClass("en-nz")||t.hasClass("en-us")},isJP:function(){return n.element("body").hasClass("ja-jp")},isKR:function(){return n.element("body").hasClass("ko-kr")},isCN:function(){return n.element("body").hasClass("zh-cn")},isTW:function(){return n.element("body").hasClass("zh-tw")},ensureRootScope:function(){return t.HA||(t.HA={})},ensureScope:function(n,t){return t[n]||(t[n]={})},isLocalDev:function(){return r.location.hostname.indexOf("local")===0},attachNgModelAttrToScopeAsVM:function(n,t,i){t.ngModel!=null&&t.$observe("ngModel",function(t){t!=null&&n.$watch(t,function(t){t!=null&&(n.VM=t,i!=null&&i(n.VM))})})},attachViewModelToScopeAsVM:function(n,t,i){return f.get(t).then(function(t){n.VM==null&&(n.VM=t);n.VM!=null&&i!=null&&i(n.VM)})},attachPartialVM:function(n,t,i,r,u){t.ngModel!=null?o.attachNgModelAttrToScopeAsVM(n,t,u):i!=null?o.attachViewModelToScopeAsVM(n,i,u):(n.VM=r||{},u!=null&&u(n.VM))},getImageFromSiteCoreString:function(n){var i=$(n),r=i.attr("mediapath"),t;return r?[HA.cdn,"/~/media",r,".ashx"].join(""):(t=i.attr("src"),t?[HA.cdn,"/",t].join(""):void 0)},getImageObjectFromSiteCoreString:function(n){var t=$(n),i=t.attr("mediapath"),r=t.attr("alt"),u=t.attr("width"),f=t.attr("height");return{src:[HA.cdn,"/~/media",i,".ashx"].join(""),alt:r,width:u,height:f}},webtrends:{token:function(n){var t=r.$pageName.replace(" ",""),i=r.$langCode.substr(-2);return["HAWAIIANAIR",i,n,t].join("_")},tokenV2:function(n){var t=r.$langCode.substr(-2);return["HAWAIIAN-",t,".TPS.BRAND.",n].join("")}},parseLegs:function(n){return n&&n.split(",").map(function(n){var t=/([A-Za-z]{3})-?([A-Za-z]{3})?[ +-]?(\d\d\d\d-\d\d-\d\d)?/.exec(n);if(t)return{origin:{code:t[1].toUpperCase()},destination:{code:t[2].toUpperCase()},departDate:t[3]&&moment(t[3],"YYYY-MM-DD").toDate()}})},splitUrl:function(n){var i={url:n,params:[]},t;return n&&(t=n.split("?"),t.length>1&&(i={url:t[0],params:t[1].split("&")})),i},querystring:function(n){return s||l(),s[n]},createQueryString:function(t,i,r){var u=[],e,f;if(n.forEach(t,function(n,t){u.push(t+"="+encodeURI(n))}),i&&(e=encodeURI(this.createCarRentalQuery(i)),e&&u.push("supplierBenefits="+e)),r)for(f=0;f<r.length;f++)u.push(r[f]);return"?"+u.join("&")},createCarRentalQuery:function(t){var i=[];return n.forEach(t,function(t,r){n.forEach(t,function(n,t){n&&i.push(r+"|"+t+"|"+n)})}),i.join(",")},getLocale:function(n){var t="";switch(n){case"ja-jp":t="jp";break;case"zh-cn":t="zh";break;case"zh-tw":t="zh_hk";break;case"ko-kr":t="ko";break;default:t="en"}return t},localStorageSet:function(n,t){r.localStorage&&r.localStorage.setItem(n,t)},localStorageGet:function(n){var t;return r.localStorage&&(t=r.localStorage[n]),t?t:null},injectScriptDependency:function(t,i){var r=n.element(document.createElement("script"));r.attr("charset","utf-8");r.attr("src",i);t.prepend(r)},formatDynamicString:function(n,t){if(n)return n.replace(/({\d})/g,function(n){if(n)return t[n.replace(/{/,"").replace(/}/,"")]})},checkForInfant:function(n){for(var i=!1,t=0;t<n.Travellers.length;t++)n.Travellers[t].Type=="INF"&&(i=!0);return i},checkIfTicketedInfant:function(n){for(var t,r=!1,i=0;i<n.Travellers.length;i++)for(t=0;t<n.Tickets.length;t++)n.Travellers[i].Type=="INF"&&n.Travellers[i].DisplayName===n.Tickets[t].TravellerName&&n.Tickets[t].ETicket.length>0&&(r=!0);return r},removeDuplicatesFromArray:function(n,t){return n.filter(function(n){return this[n[t]]?!1:this[n[t]]=!0},{})},getStandardLocale:function(){var n=u.id.split("-");return n[1]=!n[1]?"":n[1].toUpperCase(),n.join("_")},bccCapture:function(n,i,r){var v,y;try{t.isTargetBcusEligible();var u=window.location.href,f="",s="",h="",c="",l="",a="",o=1;console.log("returl",u);u.toLowerCase().indexOf("/book/pax/index#/passenger/1")!==-1?($("input[name=firstname]").length&&(s=$("input[name=firstname]").val()),$("input[name=lastname]").length&&(h=$("input[name=lastname]").val()),$("input[name='Member1']:checked").val()?$("input[name=partnerairline]").length&&(v=$("input[name=partnerairline]").val(),v.indexOf("HA")!==-1&&$("input[name=hmnumber]").length&&(a=$("input[name=hmnumber]").val())):$("input[name=email]").length&&(f=$("input[name=email]").val())):u.toLowerCase().indexOf("/book/pax/index#/contact")!==-1&&($("input[name=email]").length&&(f=$("input[name=email]").val()),$("input[name=PhoneNum0]").length&&(c=$("input[name=PhoneNum0]").val()),$("input[name=PhoneNum1]").length&&(l=$("input[name=PhoneNum1]").val()));y={cellNumber:i,campaignId:n,referrerId:r,returl:u,first:s,last:h,email:f,dayPhone:c,evePhone:l,HaMilesNumber:a};window.location.hostname.indexOf("webview")!==-1?Promise.all([$scs.get("BarclaysPopupContent.Heading"),$scs.get("BarclaysPopupContent.Content"),$scs.get("BarclaysPopupContent.Title"),$scs.get("BarclaysPopupContent.OkayButtonText"),$scs.get("BarclaysPopupContent.CancelButtonText")]).then(function(n){haModal(e.getTemplateUrl("ha-nma-modal.html"),{id:"barclays-modal",backdrop:"true",heading:n[0],title:n[2],success:{label:n[3],fn:function(){$.when(p()).done(function(){if(u.toLowerCase().indexOf("/book/payment")!==-1&&o==1){sessionStorage.setItem("referrerId",r);var n=document.getElementById("formIFrame");n.contentWindow.postMessage("barclaysRequest",iframeOrigin);t.isTargetBcusEligible()}})}},cancel:{label:n[4]},size:"modal-md",defaultContent:n[1]})}):$.when(p()).done(function(){if(u.toLowerCase().indexOf("/book/payment")!==-1&&o==1){sessionStorage.setItem("referrerId",r);var n=document.getElementById("formIFrame");n.contentWindow.postMessage("barclaysRequest",iframeOrigin);t.isTargetBcusEligible()}});function p(){return $.ajax({cache:!1,async:!1,type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",url:window.location.origin+"/api/v2/target/BccApply/",data:JSON.stringify(y),success:function(n){n.length&&(window.location.href=n,o=0)},error:function(n){t.isTargetBcusEligible();console.log(JSON.stringify(n));return}})}}catch(w){console.log(w.message)}},isTargetBcusEligible:function(){return $.ajax({cache:!1,async:!1,type:"GET",timeout:500,url:window.location.origin+"/api/v2/target/BccTargetEligibility/",success:function(n){t.IsBCusEligible=n===!0?!0:!1;return},error:function(n,i){console.log(JSON.stringify(n));console.log(i);t.IsBCusEligible=!1}})},isUpliftConfirmed:function(){return $.ajax({cache:!1,async:!1,type:"POST",timeout:500,url:window.location.origin+"/Book/Payment/UpliftConfirm/",success:function(n){n.OrderId!=="empty"?(t.UpliftOrderId=n.OrderId,t.UpliftReservationCode=n.PNR,t.isUpliftConfirmed=!0):t.isUpliftConfirmed=!1;return},error:function(n,i){console.log(JSON.stringify(n));console.log(i);t.isUpliftConfirmed=!1}})}},s;return t.constructor.prototype.isEN=o.isEN,t.constructor.prototype.isJP=o.isJP,t.constructor.prototype.isKR=o.isKR,t.constructor.prototype.isCN=o.isCN,t.constructor.prototype.isTW=o.isTW,o}])}(angular),function(n){"use strict";var t=n.module("haConfigModule",[]);t.factory("haConfig",[function(){var r="/templates/",o="/sitecoreresources/",i="en-US",u=[{com:"en"},{"co.jp":"ja-jp"},{"co.kr":"ko-kr"},{"com.cn":"zh-cn"},{"com.tw":"zh-tw"},{"com.au":"en-au"},{"co.nz":"en-nz"}],t=location.host.split("."),f=t.length<4||!isNaN(parseInt(t[0],10))?"com":t[2]+"."+t[3],s=u.map(function(n){return typeof n[f]!="undefined"}).indexOf(!0),n=HA.cdn.html&&HA.cdn.js&&HA.cdn.css&&HA.cdn.img?"?sc_lang="+u[s][f]:"",e=window.ver;return HA.cdn.isOldIE&&(HA.cdn.html=HA.cdnDynamic=""),{getTemplateUrl:function(n){return n?[HA.cdn.html,r,n.replace(/^\/|\/$/g,""),"?ver=",e].join(""):""},getTemplateUrlWithInclude:function(n){return"<div ng-include=\"'"+this.getTemplateUrl(n)+"'\"><\/div>"},getRazorTemplateUrl:function(t){t+=n;var i=(~t.indexOf("?")?"&":"?")+"ver="+e;return t?[HA.cdn.html,r,t.replace(/^\/|\/$/g,""),i].join(""):""},getImgUrl:function(t){if(/^http/i.test(t)||/^\/\//i.test(t))return t;var i=n;return/\?/gi.test(t)&&n&&(i="&"+n.substring(1)),t?[HA.cdn.img,"/",t.replace(/^\/|\/$/g,""),i].join(""):""},getSitecoreResourceUrl:function(t){return t?[HA.cdnDynamic,o,t.replace(/^\/|\/$/g,""),n].join(""):""},getDynamicJsonUrl:function(t){if(/^http/i.test(t)||/^\/\//i.test(t))return t;var i=n;return/\?/gi.test(t)&&n&&(i="&"+n.substring(1)),t?[HA.cdnDynamic,"/",t.replace(/^\/|\/$/g,""),i].join(""):""},setLanguageCode:function(n){i=n;n==="en"&&(i="en-US")},getLanguageCode:function(){return i}}}])}(angular),function(n){"use strict";var t=n.module("haFeatureFlagsModule",[]);t.provider("haFeatureFlags",["$windowProvider",function(n){var i=n.$get(),r=i.HA!=null&&i.HA.FLAGS||{},t={},u=this.hasDefault=function(n){return typeof t[n]!="undefined"},f=this.has=function(n){return typeof r[n]!="undefined"},e=this.get=function(n,i){return f(n)?r[n]:typeof i!="undefined"?i:u(n)?t[n]:undefined};this.setDefault=function(n,i){t[n]=i};this.getDefault=function(n){return t[n]};this.$get=function(){return{hasDefault:u,has:f,get:e,setDefault:this.setDefault,getDefault:this.getDefault}}}])}(angular),function(n){"use strict";var t=n.module("haDateUtilsModule",[]);t.factory("haDateUtils",["$locale",function(t){function i(n){return n>9?"-"+n:"-0"+n}return Date.prototype.dateAdd=function(n,t){t=parseInt(t);var i=0;switch(n){case"day":i=t*24;this.dateAdd("hour",i);break;case"hour":i=t*60;this.dateAdd("minute",i);break;case"week":i=t*7;this.dateAdd("day",i);break;case"minute":i=t*60;this.dateAdd("second",i);break;case"second":i=t*1e3;this.dateAdd("millisecond",i);break;case"month":t=t+this.getUTCMonth();t/12>0&&(this.dateAdd("year",t/12),t=t%12);this.setUTCMonth(t);break;case"millisecond":this.setTime(this.getTime()+t);break;case"year":this.setFullYear(this.getUTCFullYear()+t);break;default:throw new Error("Invalid date increment passed");}return this},Date.prototype.YYYY_MM_DD=function(){return this.getFullYear()+i(this.getMonth()+1)+i(this.getDate())},{getVisibleMonths:function(n,i){for(var f=n>0?(new Date).dateAdd("month",n*-1):new Date,r=f.getMonth(),u=f.getFullYear(),e=[],s=t.DATETIME_FORMATS.MONTH,o=0;o<n+i+1;o++)r===12&&(r=0,u++),e.push({weeks:this.getVisibleWeeks(new Date(u,r,1)),name:s[r]+" "+u}),u=r>11?u+1:u,r=r>11?r-12:++r;return e},getVisibleWeeks:function(n){var t,i,r;for(n=new Date(n||new Date),n.setDate(1),n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0),n.getDay()===0&&n.getDate()===1||(n.getDay()===0?n.setDate(-5):n.setDate(n.getDate()-n.getDay()),n.getDate()===1&&n.setDate(-6)),t=[];t.length<6;){for(i=[],r=0;r<7;r++)i.push(new Date(n)),n.setDate(n.getDate()+1);t.push(i)}return t},getDaysOfWeek:function(n){var t,i;for(n=new Date(n||new Date),n=new Date(n.getFullYear(),n.getMonth(),n.getDate()),n.setDate(n.getDate()-n.getDay()),t=[],i=0;i<7;i++)t.push(new Date(n)),n.setDate(n.getDate()+1);return t},isValid:function(n,t,i){var u=parseInt(n,10),f=parseInt(t,10),e=parseInt(i,10),r;return!u||isNaN(f)||!e?!1:(r=new Date(u,f-1,e),r.getFullYear()===u&&r.getMonth()===f-1&&r.getDate()===e)},isBetween:function(n,t,i){return this.isAfter(n,t)&&this.isBefore(n,i)},isAfter:function(t,i){return!n.isDate(t)||!n.isDate(i)?!1:t.getTime()>i.getTime()},isBefore:function(t,i){return!n.isDate(t)||!n.isDate(i)?!1:t.getTime()<i.getTime()},isSameYear:function(t,i){return!n.isDate(t)||!n.isDate(i)?!1:t.getFullYear()===i.getFullYear()},isSameMonth:function(t,i){return!n.isDate(t)||!n.isDate(i)?!1:this.isSameYear(t,i)&&t.getMonth()===i.getMonth()},isSameDay:function(t,i){return!n.isDate(t)||!n.isDate(i)?!1:this.isSameMonth(t,i)&&t.getDate()===i.getDate()},isAfter331:function(t,i){if(!n.isDate(t)||!n.isDate(i))return!1;var r=Math.round(Math.abs((t.getTime()-i.getTime())/864e5));return r>=330},msToDate:function(n){return new Date(n)},isNextDay:function(t,i){return!n.isDate(t)||!n.isDate(i)?!1:t.getTime()<i.getTime()},numDaysDifference:function(t,i){if(!n.isDate(t)||!n.isDate(i))return!1;return Math.round(Math.abs((t.getTime()-i.getTime())/864e5))}}}])}(angular),function(n){"use strict";var t;try{t=n.module("haViewModelModule")}catch(i){t=n.module("haViewModelModule",[])}t.factory("haViewModelSvc",["$log","$q",function(n,t){var i={},r={},u=function(t,i){n.debug("_defer",t);var u=r[t]=r[t]||[];u.push(i)},f=function(t){var u,f;if(i[t]!=null)for(u=r[t]||[];u.length>0;)n.debug("_resolve",t),f=u.pop(),f.resolve(i[t])},e=function(n,t){i[n]=t;f(n)},o=function(n){var r=t.defer();return i[n]!=null?r.resolve(i[n]):u(n,r),r.promise},s=function(n){return i[n]};return{put:e,get:o,getSync:s}}])}(angular),function(n){"use strict";var t=n.module("haRegexModule",[]);t.factory("haRegexService",function(){var n=/^[a-zA-Z0-9]{6}$/,t=/^[0-9]{13}$/,u=/^(((PB|pb|Pb|pB)[a-zA-Z0-9]{13,13})|\d{12,14})$/,i=/^(\d){9}$/,f=/^[\w\d\.\-]+@[a-zA-Z\d\.\-]+\.[a-zA-Z]{2,15}$/,r=/^(?=.*[a-zA-Z])([a-zA-Z0-9\.]{6,30})$/;return{alphaNumeric:/[a-zA-Z0-9- ]/gi,hmNumber:i,email:f,phone:/[0-9]{10,15}/,name:/^[a-zA-Z-\s]{0,30}$/,addressLine:/^[a-zA-Z0-9-\.\,\/\\ ]{0,29}$/,city:/^[a-zA-Z-\s]{0,30}$/,state:/^[a-zA-Z0-9- ]{0,30}$/,username:r,login:new RegExp(i.source+"|"+f.source+"|"+r.source),password:/^(?=.*[a-z])(?=.*\d)(?=.*[A-Z]).{10,16}$/,usernameOrHmNumber:new RegExp(i.source+"|"+r.source),creditCard:/^[0-9]{15,16}$/,redress:/^[a-zA-Z0-9]{0,13}$/,knownTraveler:/^[a-zA-Z0-9]{0,25}$/,jalFlightNumber:/(^(JL|NU)?[0-9]{1,4}$)|^[0-9]{1,4}$/i,flightStatusByNumber:/^(ha|HA)?[0-9]{1,4}$/,pnr:n,confirmationCode:t,owwConfCode:u,pnrOrConfCode:new RegExp(n.source+"|"+t.source),pnrOrConfOrOwwConfCode:new RegExp(n.source+"|"+t.source+"|"+u.source),maikaiNumber:/^[0-9]{12}/,agentCode:/^[a-zA-Z0-9]{1,10}$/,giftcardnumber:/\d{19}/,giftcardpin:/\d{4}/,chinaRewardMemberShipNumber:/^(cr|CR)\d{16}$/,ticketOrMSR:/^\d{13}$/,cashbagNum:/^\d{16}$/,promoCode:/^[a-zA-Z0-9_-]{1,15}$/,carMembershipNumber:/^[a-zA-Z0-9]{6}$/,carDiscountNumber:/^[a-zA-Z]{1}[0-9]{6}$/,carCouponNumber:/^[a-zA-Z]{4}[0-9]{3}$/,flightNumber:/^[0-9]{1,5}$/}});t.run(["$rootScope","haRegexService",function(n,t){n.$regex=t}])}(angular),function(n){"use strict";var t=n.module("haAriaLiveModule",[]);t.service("haAriaLiveService",["$rootScope","$timeout","$log",function(n,t){return{updateMessage:function(i){n.ariaLiveMessage=i;t(function(){n.ariaLiveMessage=""},5e3)}}}])}(angular),function(n){"use strict";var t;try{t=n.module("haMobileService")}catch(i){t=n.module("haMobileService",[])}t.service("haMobileSvc",[function(){var n=767;this.determineIsMobile=function(){return window.innerWidth>n?(window.isMobile=!1,!1):(window.isMobile=!0,!0)}}]);t.directive("haFlushFittingCol",["$rootScope",function(n){return{restrict:"A",link:function(t,i,r){if(n.isMobile){var u=0-i.offset().left;i.css({marginLeft:u,marginRight:u,width:"auto",overflow:"hidden"});r.preservepadding!=="true"&&i.css({padding:0})}}}}]);t.directive("haEqualHeightColumns",["$rootScope","$interval",function(n,t){return{restrict:"A",link:function(i,r){if(n.isMobile)var u=0,f=50,e=t(function(){r.children(":last").outerHeight()>f&&(t.cancel(e),r.children().each(function(){$(this).outerHeight()>u&&(u=$(this).outerHeight())}),r.children().each(function(){$(this).outerHeight()<u&&$(this).css("height",u)}))},50)}}}])}(angular),function(n){"use strict";var t;try{t=n.module("haGeoDataModule")}catch(i){t=n.module("haGeoDataModule",["haHttpService"])}t.factory("haGeoDataSvc",["$q","$log","$filter","$cacheFactory","haGeoDataAPI",function(n,t,i,r,u){var f=r("haGeoDataCache"),s=r("regexCache"),e=null,o="COUNTRY",h="STATES_",c="CITIES_",l="COUNTRY_PHONE_CODES";return{setCountryData:function(n){return n=i("orderBy")(n,["Sorting","DisplayName"]),f.put(o,n)},setActiveCountry:function(n){e=n},getCountries:function(){var r=o,e=f.get(r),t;return e!=null?(t=n.defer(),t.resolve(e),t.promise):u.getCountries().then(function(n){return n=i("orderBy")(n,"Sorting"),f.put(r,n)})},getStates:function(t){var r=h+t,e=f.get(r),i;return e!=null?(i=n.defer(),i.resolve(e),i.promise):u.getStates(t).then(function(n){return f.put(r,n)})},getStateAndCities:function(t,i){var e=c+t+i,o=f.get(e),r;return o!=null?(r=n.defer(),r.resolve(o),r.promise):u.getStateAndCities(t,i).then(function(n){return f.put(e,n)})},getAddressStyle:function(n){var i,r,t;if(n=n||e&&e.Key,i=f.get(o),i!=null)for(r=0;r<i.length;r++)if(t=i[r],t!=null&&t.Key===n)return t.AddressStyle||t.Iso2Code;return null},noStates:function(n){var t,i,r;if(n=n||e&&e.Key,t=f.get(o),t!=null)for(i=0;i<t.length;i++)if(r=t[i],r!=null&&r.Key===n){if(r.StateValidation==="X")return!0;break}return!1},hasPostalCode:function(n){var t,i,r;if(n=n||e&&e.Key,t=f.get(o),t!=null)for(i=0;i<t.length;i++)if(r=t[i],r!=null&&r.Key===n){if(r.PostalCodeValidation==="X")return!1;break}return!0},getPostalCodeRegex:function(n){var t,r,u,i;if(n=n||e&&e.Key,t=s.get(n)||s.put(n,{}),t.PostalCodeValidation)return t.PostalCodeValidation;if(r=f.get(o),r!=null)for(u=0;u<r.length;u++)if(i=r[u],i!=null&&i.Key===n){if(i.PostalCodeValidation!=null&&i.PostalCodeValidation!=="X")return t.PostalCodeValidation=new RegExp(i.PostalCodeValidation),t.PostalCodeValidation;break}return t.PostalCodeValidation=/.*/,t.PostalCodeValidation},getPhoneNumberRegex:function(n){var t,r,u,i;if(n=n||e&&e.Key,t=s.get(n)||s.put(n,{}),t.PhoneNumberValidation)return t.PhoneNumberValidation;if(r=f.get(o),r!=null)for(u=0;u<r.length;u++)if(i=r[u],i!=null&&i.Key===n){if(i.PhoneNumberValidation!=null)return t.PhoneNumberValidation=new RegExp(i.PhoneNumberValidation),t.PhoneNumberValidation;break}return t.PhoneNumberValidation=/.*/,t.PhoneNumberValidation},getCityRegex:function(n){var t,r,u,i;if(n=n||e&&e.Key,t=s.get(n)||s.put(n,{}),t.CityValidation)return t.CityValidation;if(r=f.get(o),r!=null)for(u=0;u<r.length;u++)if(i=r[u],i!=null&&i.Key===n){if(i.CityValidation!=null)return t.CityValidation=new RegExp(i.CityValidation),t.CityValidation;break}return t.CityValidation=/^[a-zA-Z- ]{0,30}$/,t.CityValidation},getPhoneCountryCodes:function(){var e=l,s=f.get(e),n,h,r,t;if(s!=null)return s;if(n=f.get(o),h=function(n){return n.IsoCode==="USA"?1:parseInt(n.CountryTier)===1?2:3},n=i("orderBy")(n,[h,"IsoCode"]),n!=null){for(r=[],t=0;t<n.length;t++){var u=n[t].PhoneCountryCode,c=n[t].IsoCode,a=n[t].Key;u>0&&r.push({Code:u,Key:a,Name:"+"+u,Value:c})}return f.put(e,r)}return[]},lookupCountryByCode:function(n){var r=f.get(o),t,i;if(r!=null)for(t=0;t<r.length;t++)if(i=r[t],i!=null&&i.IsoCode===n)return i;return null}}}])}(angular),function(n){"use strict";n.module("haEncryptionModule",[]).factory("haEncryptionService",["haEncryptionAPI",function(n){function i(){return"Format of data is invalid in EncryptionService."}function t(n){return n&&typeof n=="string"&&n!==""?!0:!1}return{Encrypt:function(r,u){return t(r)&&t(u)?n.encryptString(r,u):Promise.reject(i())},EncryptString:function(n,t){return this.Encrypt(n,t).then(function(n){return n.data},function(n){return console.error("Encryption Error: "+n),""})}}}])}(angular),function(n){"use strict";n.module("haLaunchDarklyModule",[]).factory("haLaunchDarklyService",["haLaunchDarklyAPI","$q",function(n){function t(n,t){return"Format of variant "+t+" is invalid for type "+n+" in LaunchDarklyService."}function i(n){return n===!0||n===!1?!0:!1}function r(n){return typeof n=="number"?!0:!1}function u(n){return typeof n=="number"&&n.toString().includes(".")?!0:!1}function f(n){return typeof n=="string"?!0:!1}function e(n){return typeof n=="string"&&n.indexOf("-")!==n.length-1?!0:!1}return{GetFlagVariant:function(o,s,h,c){var l=!1;switch(s){case"boolean":l=i(h);break;case"integer":l=r(h);break;case"float":l=u(h);break;case"dictionary":l=e(h);break;case"string":l=f(h);break;default:return Promise.reject("Invalid type: "+s+" sent to LaunchDarklyService.")}return l?n.getFeatureFlag(o,s,h.toString(),c):Promise.reject(t(s,h))},trackResult:function(t){n.trackResult(t)},GetFlagVariantAsBoolean:function(n,t,i){return this.GetFlagVariant(n,t,i).then(function(n){return n.data==="ENABLED"?!0:!1},function(n){return console.error("Launch Darkly Error: "+n+"\tKEY: "+attributes.key),!1})}}}])}(angular),function(n){"use strict";var t=n.module("haUplift",[]);t.service("haUplift",["haHttpService","haLaunchDarklyAPI","haPaymentAPI","$rootScope","$q","haUtils",function(t,i,r,u,f){function y(){o?(l=o.UpliftCode,h=o.UpliftAPI,u.UpTimeout=o.UpliftTimeout,u.isUpEnabled=o.IsUpliftEnabled,u.UpliftComponents=o.ComponentCollection,setTimeout(function(){(function(n,t,i,r,u,f,e,o){n.UpLiftPlatformObject=u;n[u]=n[u]||function(){(n[u].q=n[u].q||[]).push(arguments)};n[u].l=1*new Date;e=t.createElement(i);o=t.getElementsByTagName(i)[0];e.async=1;e.src=r+"?id="+f;o.parentNode.insertBefore(e,o);var s=window.location.host.match(/[w-]+.w{2,3}(:d+)?$/);s&&(s=s[0]);n[u]("create",f,s)})(window,document,"script","//cdn.uplift-platform.com/a/up.js","up",l)},u.UpTimeout)):u.isUpEnabled=!1}function b(){try{s&&document.getElementById("up-pay-monthly-container")!=null?window.Uplift.Payments.init({apiKey:h,locale:"en-US",currency:"USD",checkout:!0,container:"#up-pay-monthly-container",onChange:d}):window.Uplift.Payments.init({apiKey:h,locale:"en-US",currency:"USD"})}catch(n){}}function d(n){var t={OFFER_AVAILABLE:function(){$("#uplifterror_mobile").hide();$("#uplifterror_web").hide();$("#upliftSegment").show()},TOKEN_AVAILABLE:function(){Uplift.Payments.getToken()},TOKEN_RETRIEVED:function(){var e=n.token,t,i,o,f;u.UpToken=e;t=$("#confirmBooking");i=$("#confirmBookingAmount");t&&i&&(t.show(),i.show());o=e.card_token;f=window.sessionStorage.up_br;u.UpliftOrderId=f;r.setUpliftToken(o,f).success(function(){console.log("Token stored")}).error(function(){document.write();console.log("Token not stored")})},OFFER_UNAVAILABLE:function(){window.UpliftGlobals.ChangeCallback&&window.UpliftGlobals.ChangeCallback("OFFER_UNAVAILABLE");u.isMobile?$("#uplifterror_mobile").show():$("#uplifterror_web").show();$("#up-pay-monthly-container").hide();$("#check-monthly").attr("disabled",!0);$("#upliftSegment").hide()},SERVICE_UNAVAILABLE:function(){window.UpliftGlobals.ChangeCallback&&window.UpliftGlobals.ChangeCallback("SERVICE_UNAVAILABLE");u.isMobile?$("#uplifterror_mobile").show():$("#uplifterror_web").show();$("#up-pay-monthly-container").hide();$("#check-monthly").attr("disabled",!0);$("#upliftSegment").hide()}};t[n.status]()}function k(){var r=[],t,u,n,o,h,c,i,f;if(s)for(t=e.itenerary.Travellers,u=e.itenerary.PassengerTripSummary.Passengers,n=0;n<t.length;n++)o=t[n].DOBMonth<10?"0"+t[n].DOBMonth:t[n].DOBMonth,h=t[n].DOBDay<10?"0"+t[n].DOBDay:t[n].DOBDay,r.push({id:n+1,first_name:u[n].FirstName,last_name:u[n].LastName,date_of_birth:o+"/"+h+"/"+t[n].DOBYear});else c=[{id:e.id,first_name:"Xxxxx",last_name:"Xxxxx",date_of_birth:"01/01/2001"}],r=c;return i=[{departure_apc:e.Origin,arrival_apc:e.Destination,departure_time:e.DepartureDate,arrival_time:e.ArrivalDate}],s&&(i=e.iteneraryTrips),f=[{origin:e.Origin,destination:e.Destination,trip_type:e.tripType,itinerary:i}],e.IsTripInsuranceSelected&&(f=[{origin:e.Origin,destination:e.Destination,trip_type:e.tripType,itinerary:i,insurance:[{types:["cancellation"],price:e.insuranceCost*100,price_per_person:e.insuranceCost/t.length*100}]}]),{order_amount:Math.trunc(e.order_amount*100),travelers:r,air_reservations:f}}function g(){var n=/MSIE|Trident/.test(window.navigator.userAgent);o.IsUpliftEnabled&&!n?a.resolve():a.reject()}var s=!1,h="",l="",o=window.upliftConfiguration,e,c,a,p,w,v,nt;return window.UpliftGlobals=window.UpliftGlobals||{},window.UpliftGlobals.isUpliftEnabled=!1,u.isUpEnabled=!1,e=[],c=[],a=f.defer(),c.push(a.promise),p=f.defer(),c.push(p.promise),w=!1,u.$on("UpliftElementReady",function(){w||(w=!0,g(),p.resolve())}),v=f.defer(),c.push(v.promise),nt=u.$watch("EnableUplift",function(n){n===!0?v.resolve():n===!1&&v.reject()}),f.all(c).then(function(){u.isUpEnabled=!0;window.UpliftGlobals.isUpliftEnabled=!0;y()}),u.showUpliftTeaser=function(n){return o&&o.ComponentCollection?o.ComponentCollection[n]?o.ComponentCollection[n]:!1:!1},window.upReady=function(){b();var n=k();try{window.Uplift.Payments.load(n);$("#upliftTabSelector").show()}catch(t){}},{upReady:function(){h!==""&&l!==""&&window.upReady()},refreshUplift:function(){if(h!==""&&l!=="")try{var n=k();window.Uplift.Payments.load(n);CheckUpliftComponentEnabled()}catch(t){}},loadUplift:function(t,i){e.tripType=i==1?"oneway":"roundtrip";t.ActiveTab!=null&&n.forEach(t.ActiveTab.TripAndFareDetails,function(t){e.Origin=t.TripSlice.Origin;e.DepartureDate=moment(t.TripSlice.DepartureDate).format("YYYY/MM/DD").toString().replaceAll("/","");e.Destination=t.TripSlice.Destination;e.ArrivalDate=moment(t.TripSlice.ArrivalDate).format("YYYY/MM/DD").toString().replaceAll("/","");var i=1;n.forEach(t.FareDetails,function(t){t.IsAvailable==!0&&n.forEach(t.FareTypes,function(t){n.forEach(t.FareInfos,function(n){e.order_amount=n.FiledInFareInfo.BaseFare;e.id=i++})})})})},selectUplift:function(t,i,r,u){s=r;var f=[];n.forEach(i.AvailGridTrips,function(n){var t=n.Origin,i=n.Destination,r=moment(n.DepartureDate).format("YYYY/MM/DD").toString().replaceAll("/",""),u=moment(n.ArrivalDate).format("YYYY/MM/DD").toString().replaceAll("/",""),o=n.CabinName,s=n.OriginCityName,h=n.DestinationCityName;f.push({departure_apc:t,departure_city:s,arrival_apc:i,arrival_city:h,departure_time:r,arrival_time:u,fare_class:o,carrier_code:"HA",ticket_type:"digital",reservation_type:"standard",airline:"Hawaiian Airlines"});e.Origin=t;e.DepartureDate=r;e.Destination=i;e.ArrivalDate=u;e.id=n.TripID});e.tripType=i.TripType==1?"oneway":"roundtrip";e.order_amount=t;e.trips=i;r&&u&&(e.itenerary=u,e.iteneraryTrips=f,u.TripSummary.TripInsurance&&(e.insuranceCost=u.TripSummary.TripInsurance.InsuranceCost))},selectPayMonthly:function(n){e.IsTripInsuranceSelected=n?n:!1;u.isUpEnabled&&(this.refreshUplift(),window.Uplift.Payments.select())},deselectPayMonthly:function(n,t){u.isUpEnabled&&(e.IsTripInsuranceSelected=t,this.refreshUplift(),window.Uplift.Payments.deselect(n))},confirmPayMonthly:function(n){y();window.upReady=function(){s=!0;b();window.Uplift.Payments.confirm(n)}},getUpliftConfig:function(){$.ajax({cache:!1,async:!0,type:"GET",url:window.location.origin+"/book/Uplift/UpliftConfiguration",success:function(n){o=n;o.IsUpliftEnabled&&y()},error:function(n,t){console.log(JSON.stringify(n));console.log(t)}})}}}]);t.directive("haUpliftEmitter",["$rootScope",function(n){return{restrict:"A",link:function(t){n.$broadcast("UpliftElementReady",t)}}}])}(angular),function(n){"use strict";n.module("haCitiesAPI",["haHttpService"]).service("haCitiesAPI",["haHttpService","$cacheFactory","haConfig","haUtils","$rootScope","$q",function(t,i,r,u,f,e){function a(n,t){if(n=n.toLocaleLowerCase(),!n)return t;var i=t.filter(function(t){return t.text.indexOf(n)>-1});return i.sort(function(t,i){return v(i.text,n)-v(t.text,n)})}function v(n,t){return Number(n.indexOf(" "+t)>-1)}var h=i.get("$http"),c=$scs("Cities_Version").versionnumber||"5.0.7",s,l,o={CITY_LIST_URL:r.getDynamicJsonUrl(["/Book/City/",c,"/GetCities"].join("")),getCityList:function(){return t.GET(o.CITY_LIST_URL,{cache:h,timeout:1e4}).then(function(n){return f.$broadcast("citiesavailable"),n.data.CityList.Cities})},CITY_PAIRS_URL:r.getDynamicJsonUrl(["/Book/City/",c,"/GetValidCities"].join("")),getCityPairs:function(){return t.GET(o.CITY_PAIRS_URL,{cache:h,timeout:1e4}).then(function(n){return n.data.CityList.Cities})},EXPERT_BOOKING_LIST_URL:r.getDynamicJsonUrl(["/Book/City/",c,"/GetCitiesExpertBooking"].join("")),getCityListExpertBooking:function(){return t.GET(o.EXPERT_BOOKING_LIST_URL,{cache:h,timeout:1e4}).then(function(n){return n.data.CityList.Cities})},EXPERT_BOOKING_PAIRS_URL:r.getDynamicJsonUrl(["/Book/City/",c,"/GetValidCitiesExpertBooking"].join("")),getCityPairsExpertBooking:function(){return t.GET(o.EXPERT_BOOKING_PAIRS_URL,{cache:h,timeout:1e4}).then(function(n){return n.data.CityList.Cities})},NITP_MAP_URL:"/Content/assets/models/NitpMap.json",getNitpMap:function(){return t.GET(o.NITP_MAP_URL,{cache:h,timeout:1e4}).then(function(n){return n.data})},FILTERED_CITY_LIST_URL:function(n,t){return"/Book/City/"+c+"/FilterCityList?index="+n+"&isDepartCity="+t},getFilteredCityList:function(n,i){return t.GET(o.FILTERED_CITY_LIST_URL(n,i),{cache:h,timeout:1e4}).then(function(n){return n.data.CityList!=null&&n.data.CityList.Cities||[]})},EXPEDIA_SUGGEST_URL:function(n){var t=u.getStandardLocale(),i;return t=t==="en_US"||t==="ja_JP"||t==="en_AU"||t==="en_NZ"||t==="ko_KR"?t:"en_US",i="?regiontype=1631&locale="+t+"&lob=HOTELS&format=json&ab=7140.1%7C7949.1&features=ta_hierarchy&maxresults=5&client=HawaiianHotelWidget&siteid=70209","https://suggest.expedia.com/api/v4/typeahead/"+n+i},getExpediaCityList:function(n){return t.GET(o.EXPEDIA_SUGGEST_URL(n),{cache:h,timeout:1e4}).then(function(n){return n.data.sr}).catch(function(n){return n})},RENTAL_CAR_LOCATION_URL:r.getDynamicJsonUrl("/api/v2/cars/locations"),searchCarLocations:function(n,t){return o.getAllCarLocations().then(function(i){var r=a(n,i[t[0]]);return r.length<15&&t[1]&&t[0]!==t[1]&&(r=r.concat(a(n,i[t[1]]))),r.length=Math.min(r.length,15),r})},getAllCarLocations:function(){return s?s.then?s:e.resolve(s):s=t.GET(o.RENTAL_CAR_LOCATION_URL,{cache:h,timeout:6e5}).then(function(t){return s=_.groupBy(t.data,"country"),l=_.indexBy(t.data,"id"),n.forEach(Object.keys(s),function(t){n.forEach(s[t],function(n){n.text=["",n.name,n.postal,n.city,n.airport].join(" ").toLocaleLowerCase()})}),s}).catch(function(n){return n})},getCarLocationById:function(n){return o.getAllCarLocations().then(function(){return l[n]})}};return o}])}(angular),function(n){"use strict";var t=n.module("haEcertAPI",["haHttpService"]);t.service("haEcertAPI",["haHttpService",function(n){return{getPassengerCredit:function(t){return n.POST("/TravelCreditRedemption/GetPassengerCredit",t)},selectDuplicatePassenger:function(t){return n.POST("/TravelCreditRedemption/SelectDuplicatePassenger",{index:t})},fetchPopup:function(t){return n.GET("/TravelCreditRedemption/"+t)},isValidPromo:function(t){return n.POST("/Book/Home/PromotionValid",t)},validateRedeemPromoCode:function(t){return n.POST("/Book/ECert/ValidateRedeemPromoCode",{OfferCode:t})},removePromoCodeFromSession:function(){return n.POST("/Book/ECert/RemovePromoCodeFromSession")},HandleAffiliates:function(t){return n.POST("/Program/Affiliate/ValidateAffiliate",{promoCode:t})}}}])}(angular),function(n){"use strict";n.module("haEmailAPI",["haHttpService"]).service("haEmailAPI",["haHttpService",function(n){return{emailAvailabilityCheck:function(t,i){return n.POST("/MyAccount/EmailAvailability/EmailAvailabilityCheck",{emailAddress:t},{timeout:i.promise}).then(function(n){return n.data.IsSuccess||n.data.Message==="Internal Processing Error"})}}}])}(angular),function(n){"use strict";var t=n.module("haFlightResultsAPI",["haHttpService"]);t.service("haFlightResultsAPI",["haHttpService",function(n){return{SEARCH_FLIGHTS_URL:"/Book/FlightResults/SearchFlights",fetch:function(){return n.POST(this.SEARCH_FLIGHTS_URL,{})},SEARCH_FLIGHTS_ALTERNATE_DATE_URL:"/Book/FlightResults/SearchFlightsAlternateDate",fetchTab:function(t,i){return n.POST(this.SEARCH_FLIGHTS_ALTERNATE_DATE_URL,{tripId:t,selectedDate:i})},SEARCH_FLIGHTS_STEP_THROUGH_URL:"/Book/FlightResults/SearchFlightsStepThrough",SearchFlightsStepThrough:function(t,i,r){return n.POST(this.SEARCH_FLIGHTS_STEP_THROUGH_URL,{JDDataList:t.JDDataList,tripId:i,isEdit:r})},fetchCurrency:function(){return n.GET("/scripts/modules/BOS_BKK_miles.json")},bookFlights:function(t,i){return n.POST("/Book/FlightResults/ContinueBooking",{selectedFares:t,tripSummary:i})},fetchModalContent:function(t){return n.GET("/Book/FlightResults/ModalContent",{params:{modalName:t}})},checkFlightAvailability:function(t){return n.POST("/Book/FlightResults/CheckFlightAvailability",{selectedFares:t})},fetchPopup:function(t){return n.GET("/Book/FlightResults/"+t)},toggleCurrencyMilesService:function(t,i){return n.POST("/Book/FlightResults/toggleCurrencyMiles",null,{params:{segmentID:t,isMiles:i}})},updateChangeFlightModel:function(){return n.POST("/Book/FlightResults/EditSearch")},updateSelectedHoldFare:function(t){return n.POST("/Book/FlightResults/UpdatedSelectedHoldFare",{selectedfare:t})},fetchOnTimePerformanceDetails:function(t){return n.GET("/Book/FlightResults/FetchOnTimePerformanceDetails",{params:{flightNumbers:t}})}}}])}(angular),function(n){"use strict";var t=n.module("haFlightResultsEndOnEndAPI",["haHttpService"]);t.service("haFlightResultsEndOnEndAPI",["haHttpService",function(n){return{selectPromo:function(t){return n.POST("/Book/FlightResults/SelectPromo",{OfferId:t})},removePromo:function(){return n.POST("/Book/FlightResults/RemoveSelectedPromo",{})},SEARCH_FLIGHTS_URL:"/Book/FlightResults/SearchFlightsEndOnEnd",fetch:function(){return n.POST(this.SEARCH_FLIGHTS_URL,{priority:6})},changeMilesOption:function(t){return n.POST("/Book/FlightResults/ChangeMilesOption",{pricingType:t})},SEARCH_FLIGHTS_ALTERNATE_DATE_URL:"/Book/FlightResults/SearchFlightsAlternateDateEndOnEnd",fetchTab:function(t,i,r){return n.POST(this.SEARCH_FLIGHTS_ALTERNATE_DATE_URL,{JDDataList:t,tripId:i,selectedDate:r})},SEARCH_FLIGHTS_STEP_THROUGH_URL:"/Book/FlightResults/SearchFlightsStepThroughEndOnEnd",SearchFlightsStepThrough:function(t,i,r){return n.POST(this.SEARCH_FLIGHTS_STEP_THROUGH_URL,{JDDataList:t,tripId:i,isEdit:r})},GET_TRIP_SUMMARY_URL:"/Book/FlightResults/FlightResultsTripSummary",GetTripSummary:function(t){return n.POST(this.GET_TRIP_SUMMARY_URL,{JDDataList:t})},fetchCurrency:function(){return n.GET("/scripts/modules/BOS_BKK_miles.json")},bookFlights:function(t,i){return n.POST("/Book/FlightResults/ContinueBookingEndOnEnd",{selectedFares:t,tripSummary:i})},fetchModalContent:function(t){return n.GET("/Book/FlightResults/ModalContent",{params:{modalName:t}})},checkFlightAvailability:function(t){return n.POST("/Book/FlightResults/CheckFlightAvailabilityEndOnEnd",{selectedFares:t})},fetchPopup:function(t){return n.GET("/Book/FlightResults/"+t)},toggleCurrencyMilesService:function(t,i){return n.POST("/Book/FlightResults/toggleCurrencyMiles",null,{params:{segmentID:t,isMiles:i}})},updateChangeFlightModel:function(){return n.POST("/Book/FlightResults/EditSearch")},updateSelectedHoldFare:function(t){return n.POST("/Book/FlightResults/UpdatedSelectedHoldFare",{selectedfare:t})},fetchOnTimePerformanceDetails:function(t){return n.GET("/Book/FlightResults/FetchOnTimePerformanceDetails",{params:{flightNumbers:t}})},fetchPlaneConfiguration:function(){return n.GET("/planes/configuration",{priority:1})},fetchPlaneMarketingData:function(){return n.GET("/planes/marketingdata",{priority:1})},getSocialProofData:function(t,i,r,u){return n.GET("/Book/FlightResults/GetSocialProofData",{params:{origin:t,destination:i,departureDate:r,flightResultCount:u}})},getRedirectionUrl:function(){return n.GET("/Book/FlightResults/GetFlightResultsRedirectionPath")}}}])}(angular),function(n){"use strict";var t=n.module("haGlobalHeaderAPI",["haHttpService"]);t.service("haGlobalHeaderAPI",["haHttpService",function(n){return{selectCountry:function(t,i){return n.POST("/Header/SelectCountry",{selectedCountry:t,contextItemId:i})},searchGoogle:function(t){return n.POST("/Header/NewSearch",{GoogleText:t})}}}])}(angular),function(n){"use strict";var t=n.module("haInterstitialAPI",["haHttpService"]);t.service("haInterstitialAPI",["haHttpService","haConfig",function(n,t){return{getAirAvailability:function(){return n.GET(t.getRazorTemplateUrl("InterstitialAirAvailability"))},changeSeatInterstitial:function(){return n.GET("/my-account/my-trips/Shared/InterstitialUpdateSeats")}}}])}(angular),function(n){"use strict";n.module("haItineraryAPI",["haHttpService"]).service("haItineraryAPI",["haHttpService",function(n){return{updatePassengerInfo:function(t,i){return n.POST("/MyAccount/ItineraryDetails/UpdatePassengerInfo",{pnr:t,travellerInformation:i})},GetReceiptInfo:function(t){return n.POST("/MyAccount/ItineraryDetails/GetReceiptInfo",{ticketNo:t})},UpdatePaxAndFlightDetails:function(t){return n.POST("/MyAccount/ItineraryDetails/UpdatePaxAndFlightDetails",{ChangeFlightModel:t})},isValidHMAccount:function(t,i,r){return n.POST("/MyAccount/ItineraryDetails/IsValidHMAccount",{hmNumber:t,firstName:i,lastName:r,timeout:6e4})},HMEnrollAndUpdatePNR:function(t,i){return n.POST("/MyAccount/ItineraryDetails/HMEnrollAndUpdatePassengerInfo",{pnr:t,travellerInformation:i,timeout:6e4})},IsEligibleForChangeFlight:function(){return n.POST("/MyAccount/ItineraryDetails/IsEligibleForChangeFlight")},CancelHoldTrip:function(t){return n.POST("/MyAccount/ItineraryDetails/CancelHoldTrip",{cancelHoldTripRequest:t})},GroupPNRSelectTravellers:function(t){return n.POST("/MyAccount/ItineraryDetails/GroupPNRSelectTravellers",{travellers:t})},CancelWaiverPnr:function(t,i,r){return n.POST("/MyAccount/ItineraryDetails/CancelWaiverPnr",{pnr:t,lastName:i,optionalCancellationEmailAddress:r})}}}])}(angular),function(n){"use strict";n.module("haLoginAPI",["haHttpService"]).service("haLoginAPI",["haHttpService",function(n){return{login:function(t){return n.POST("/MyAccount/Login/Login",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},pageLoad:function(){return n.GET("/MyAccount/Login/AuthenticateLoad?dummy="+Math.random())},ResetEmail:function(t){return n.POST("/MyAccount/Login/ResetEmailAddressUpdate",{newEmailAddress:t})},ResetEmailAddress:function(t){return n.POST("/MyAccount/Login/ResetEmailAddressLoad",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},ValidateSecurityAnswers:function(t,i,r,u,f,e,o){return n.POST("/MyAccount/Login/ForgotEmailValidateSecurityAnswersSubmit",{accountNo:t,question1:i,question2:r,question3:u,answer1:f,answer2:e,answer3:o})},UpdatePassword:function(t){return n.POST("/MyAccount/Login/UpdatePassword",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},ForgotEmailAddressSubmit:function(t,i,r,u,f){return n.POST("/MyAccount/Login/ForgotEmailAddressLoad",{firstName:t,lastName:i,phoneNumber:r,country:u,zipCode:f})},CreateUsername:function(t){return n.POST("/MyAccount/Login/CreateUsernameSubmit",{username:t})},AuthenticateEmailOnly:function(t,i){return n.POST("/MyAccount/EmailOnly/AuthenticateEmailOnly",{email:t,zip:i})},EmailOnlyPreferencesSubmit:function(t){return n.POST("/MyAccount/EmailOnly/GetEmailOnlyPreferences",{EmailOnlyPreferences:t})},UnsubscribeEmailAddressSubmit:function(t,i,r){return n.POST("/MyAccount/EmailOnly/EmailUnsubscribe",{EmailAddress:t,UnSubscriptionID:i,UnSubscribeAll:r})},UpdateEmailPreferencesSubmit:function(t,i){return n.POST("/MyAccount/EmailOnly/Unsubscribe",{EmailAddress:t,ZipCode:i})}}}])}(angular),function(n){"use strict";var t=n.module("haPassengersAPI",["haHttpService"]);t.service("haPassengersAPI",["haHttpService",function(n){return{addeditpax:function(t){return n.POST("/Book/Pax/AddEditPax",{travellerInformation:t})},editPaxLink:function(){return n.POST("/Book/Pax/PaxLoadLoggedIn")},editLoggedInPax:function(t){return n.POST("/Book/Pax/EditLoggedInPax",{editLoggedInTraveler:t})},addPaxToPNR:function(t){return n.POST("/Book/Pax/AddPaxToPNR",{travellerInformationList:t})},addExtraLoggedTravellerInfo:function(t){return n.POST("/Book/Pax/AdditionalLoggedInTravelerInfo",{additionalLoggedInTravelerInfo:t})},associateinfants:function(t){return n.POST("/Book/Pax/AssociateInfants",{travellerInformationList:t})},updatecontactinfo:function(t){return n.POST("/Book/Pax/UpdateContactInfo",{ContactInfo:t})}}}])}(angular),function(n){"use strict";n.module("haPaymentAPI",["haHttpService"]).service("haPaymentAPI",["haHttpService",function(n){return{FlightAvailability:function(t){return n.POST("/Book/Payment/FlightAvailability",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},validateCreditCard:function(t){return n.POST("/Book/Payment/ValidateCreditCard",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},ValidatePaymentAuthorization:function(t){return n.POST("/Book/Payment/ValidatePaymentAuthorization",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},fetchScheduleMismatchPopup:function(){return n.GET("/Book/Payment/FlightScheduleMismatch")},postPaymentProcess:function(t,i,r){var u="/Book/Payment/ProcessPayment?UpdateSchedule="+i+"&Token="+r;return n.POST(u,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},postProcessPaymentForAsyncPNR:function(t,i,r){var u="/Book/Payment/ProcessPaymentForAsyncPNR?UpdateSchedule="+i+"&Token="+r;return n.POST(u,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},postProcessPaymentForHoldPNR:function(t,i,r){var u="/Book/Payment/ProcessPaymentForHoldPNR?UpdateSchedule="+i+"&Token="+r;return n.POST(u,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},postProcessNITPRedemption:function(){return n.POST("/Book/Payment/ProcessNITPRedemption",{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},removePriceLockSession:function(){return n.POST("/Book/Payment/RemovePriceLockSession")},getPaymentOptionsState:function(){return n.GET("/Book/Payment/GetPaymentMethods")},fetchModalContent:function(t){return n.GET("/Shared/TermsAndConditions/ModalContent",{params:{modalName:t}})},getPaymentMethodsState:function(){return n.POST("/Book/Payment/GetPaymentMethods")},fetchMasterPassToken:function(t){return n.POST("/Book/MasterPass/GetMasterPassRequestToken",{purchaseType:t})},fetchMasterPassPaymentInfo:function(t){return n.POST("/Book/MasterPass/GetMasterPassPaymentInfo",{oauthToken:t.oauth_token,oauthVerifier:t.oauth_verifier,checkOutUrl:t.checkout_resource_url})},getAliPaySignedUrl:function(){return n.POST("/Api/AliPay/GetAliPaySignedUrl")},upgradeToMainCabin:function(){return n.POST("/Book/Payment/UpgradeToMainCabin")},getItineraryDetails:function(){return n.GET("/Book/Itinerary/GetItineraryDetails")},setUpliftToken:function(t,i){return n.POST("/Book/Payment/SetUpliftToken",{Token:t,OrderId:i})}}}])}(angular),function(n){"use strict";n.module("haPaymentMethodsAPI",["haHttpService"]).service("haPaymentMethodsAPI",["haHttpService",function(n){return{PaymentMethodsAddEdit:function(t){return n.POST("/MyAccount/PaymentMethods/PaymentMethodAddEdit",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},PaymentMethodsDelete:function(t){return n.POST("/MyAccount/PaymentMethods/PaymentMethodDelete",null,{params:{ccID:t}})},PaymentMethodsAddInitialize:function(){return n.POST("/MyAccount/PaymentMethods/PaymentMethodAdd")},PaymentMethodsAdd:function(t){return n.POST("/MyAccount/PaymentMethods/PaymentMethodAddEdit",{ccPaymentInfo:t})},getCDESavedCard:function(t){return n.GET("/MyAccount/PaymentMethods/GetCDEDataForSavedCard",{cache:!1,params:{ccID:t}})}}}])}(angular),function(n){"use strict";var t=n.module("haProfileSettingsAPI",["haHttpService"]);t.service("haProfileSettingsAPI",["haHttpService",function(n){return{updateAccountSettings:function(t){return n.POST("/MyAccount/ProfileSettings/AccountSettingsSubmit",{accountSettingsVM:t})},updateTravelPreferences:function(t){return n.POST("/MyAccount/ProfileSettings/TravelPreferencesLoad",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},updateEmailSubscrption:function(t){return n.POST("/MyAccount/ProfileSettings/EmailSubscriptionsSubmit",{emailSubscriptionviewmodel:t})}}}])}(angular),function(n){"use strict";n.module("haPurchaseMilesAPI",["haHttpService"]).service("haPurchaseMilesAPI",["haHttpService",function(n){return{checkEligibility:function(t,i,r,u,f){return n.POST("/MyAccount/PurchaseMiles/PurchaseMilesEligibility",{selectedMiles:t,iSGiftPurchaseSelected:i,recipientAccountNumber:r,recipientlastName:u,recipientEmail:f})}}}])}(angular),function(n){"use strict";var t=n.module("haSeatMapAPI",["haHttpService"]);t.service("haSeatMapAPI",["haHttpService",function(n){return{getSeatMapForLeg:function(t,i){return n.POST(i?"/Book/InFlightOptions/GetSeatMapPreview":"/Book/InFlightOptions/GetSeatMap",{seatMapRequest:t})},UpdateInflightOptionsService:function(t,i){return n.POST("/Book/InFlightOptions/UpdateInflightOptions",{seatmapSelection:t,model:i})},UpdateChangeFlightInflightoptions:function(t,i){return n.POST("/Book/InFlightOptions/UpdateChangeFlightInflightoptions",{seatmapSelection:t,model:i})},ShowDownGradePopUp:function(t){return n.POST("/Book/InFlightOptions/ShowDownGradePopUp",{seatmapSelection:t})},getSeatMapForPostLeg:function(t){return n.POST("/MyAccount/PostPurchaseEditSeats/GetSeatMap",{seatMapRequest:t})},ValidateEditSeatFareDifference:function(t){return n.POST("/MyAccount/PostPurchaseEditSeats/ValidateEditSeatFareDifference",{seatMapSelection:t})},ConfirmEditSeatsService:function(t){return n.POST("/MyAccount/PostPurchaseEditSeats/ConfirmEditSeats",{model:t})}}}])}(angular),function(n){"use strict";n.module("haTravelersAPI",["haHttpService"]).service("haTravelersAPI",["haHttpService",function(n){return{TravelerAddEdit:function(t){return n.POST("/MyAccount/TravelersList/TravelerAddEdit",t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})},TravelerDelete:function(t){return n.POST("/MyAccount/TravelersList/TravelerDelete",null,{params:{travelerID:t}})},GetTravelers:function(t){return n.GET("/my-account/travelers",{params:{include:t}})},AddEditTraveler:function(t,i){var r=i?{temp:!0}:undefined;return n.POST("/my-account/travelers/TravelerAddEdit",t,{params:r})},getUserType:function(){return n.POST("/my-account/Travelers/getUserType")}}}])}(angular),function(n){"use strict";n.module("haUserProfileAPI",["haHttpService"]).service("haUserProfileAPI",["haHttpService",function(n){return{checkUsernameAvailability:function(t,i){return n.POST("/MyAccount/UserProfile/CheckUsernameAvailability",t,{timeout:i.promise})}}}])}(angular),function(n){"use strict";n.module("haPriceApiModule",["haHttpService"]).service("haPriceApiService",["$http","$q","$rootScope","haConfig",function(n,t,i){var r=i.$switch("BookingWidget:EnableDealsandOffersGetReq"),u=r?"GET":"POST";return{fetchInitialPrices:function(i){var e=r?"?searchRequest="+JSON.stringify(i.data.searchRequest)+"&isCalendar="+JSON.stringify(i.data.isCalendar):"",o="/Book/LowFareSearchChart/GetPriceChart{0}".format(e),f=t.defer(),s=r?{}:i.data;return n({method:u,url:o,data:s}).then(function(n){f.resolve(n.data)},function(n){f.reject(n)}),f.promise},fetchPrices:function(t,i,r){r=r||{};var u=r.config,f=r.url||"/Book/LowFareSearchChart/GetPriceChartAdditionalDays";return n.post(f,{dateStr:t,direction:i},u)}}}])}(angular),function(){"use strict";function n(n){function t(){function t(n){return n.data}function i(n){console.log("XHR Failed for getSessionTime."+n.data)}return n.GET("/Book/Shared/GetSessionTimeout").then(t).catch(i)}function i(){function t(n){return n}function i(n){return console.log("XHR Failed for Extend Session: "+n.status),n}return n.POST("/json/v1/session/extend").then(t).catch(i)}return{getUserSessionTime:t,restartUserSessionTime:i}}angular.module("haSessionTimeoutAPI",[]).factory("haSessionTimeoutAPI",n);n.$inject=["haHttpService"]}(),function(n){"use strict";var t;try{t=n.module("haGeoDataModule")}catch(i){t=n.module("haGeoDataModule",["haHttpService"])}t.service("haGeoDataAPI",["haHttpService","haConfig",function(n,t){return{GET_COUNTRIES_URL:function(){return"/MyAccount/AccountShared/GetCountries?languagecode="+t.getLanguageCode()},getCountries:function(){return n.GET(this.GET_COUNTRIES_URL()).then(function(n){return n.data})},GET_STATES_URL:function(n){return"/MyAccount/AccountShared/GetStatesByCountry?countrykey="+n+"&languagecode="+t.getLanguageCode()},getStates:function(t){return n.GET(this.GET_STATES_URL(t)).then(function(n){return n.data})},GET_STATE_AND_CITIES_URL:function(n,i){return"/MyAccount/AccountShared/GetCityAndStateByCountryAndPostalCode?countrykey="+n+"&postalcode="+i+"&languagecode="+t.getLanguageCode()},getStateAndCities:function(t,i){return n.GET(this.GET_STATE_AND_CITIES_URL(t,i)).then(function(n){return n.data})}}}])}(angular),function(n){"use strict";n.module("haEncryptionModule").service("haEncryptionAPI",["haHttpService",function(n){var t=window.location.protocol+"//"+window.location.host+"/api/v2/Encryption";return{encryptString:function(i,r){return n.GET(t+"/String/"+i+"/"+r).success(function(n){return Promise.resolve(n)}).error(function(n){return Promise.reject(new Error(n))})}}}])}(angular),function(n){"use strict";n.module("haLaunchDarklyModule").service("haLaunchDarklyAPI",["haHttpService",function(n){var t=window.location.protocol+"//"+window.location.host+"/api/v2/LaunchDarkly";return{getFeatureFlag:function(i,r,u,f){return n.GET(t+"/"+i+"/"+r+"/"+u+"/"+f).success(function(n){return Promise.resolve(n)}).error(function(n){return Promise.reject(new Error(n))})},trackResult:function(i){return n.GET(t+"/TrackResult/"+i).success(function(n){return Promise.resolve(n)}).error(function(n){return Promise.reject(new Error(n))})}}}])}(angular),function(n){"use strict";var t;try{t=n.module("haAirportsModule")}catch(i){t=n.module("haAirportsModule",["haCitiesModule","haAdvanceToNextInputService","ui.bootstrap.typeahead.ha"])}t.directive("haAirportPair",[function(){var n=["$scope",function(){var n={originCtrl:null,destinationCtrl:null,register:function(t){if(t.pairCtrl=n,t.isOrigin)n.originCtrl=t;else if(t.isDestination)n.destinationCtrl=t;else throw new Error("Attempted to register a non-origin/destination inputCtrl.");},getOriginCode:function(){return n.originCtrl!=null?n.originCtrl.getCode():null},getDestinationCode:function(){return n.destinationCtrl!=null?n.destinationCtrl.getCode():null}};return n}];return{restrict:"A",scope:!0,controller:n}}])}(angular),function(n){"use strict";var t;try{t=n.module("haAirportsModule")}catch(i){t=n.module("haAirportsModule",["haCitiesModule","haAdvanceToNextInputService","ui.bootstrap.typeahead.ha"])}t.controller("haAirportInputCtrl",["$log","$scope","$timeout","haTemplateCache","haCitiesSvc","haConfig",function(n,t,i,r,u,f){i(function(){r.get(f.getRazorTemplateUrl("destination-modal-base"));r.get(f.getRazorTemplateUrl("destination-modal-hawaii"));r.get(f.getRazorTemplateUrl("destination-modal-na"));r.get(f.getRazorTemplateUrl("destination-modal-asia"))},500+1e3*Math.random());var e={isOrigin:!1,isDestination:!1,isReshop:!1,isExpertBooking:!1,legIndex:0,pairCtrl:null},o=function(){if(e.pairCtrl!=null){if(e.isDestination)return e.pairCtrl.getOriginCode();if(e.isOrigin)return e.pairCtrl.getDestinationCode()}return null};return e.getCode=function(){return t.ngModel?t.ngModel.Code:null},t.getMatchingAirports=function(n){return e.isReshop?u.getMatchingFilteredCities(n,e.legIndex,e.isOrigin):e.isExpertBooking?u.getMatchingCitiesExpertBooking(n,o(),t.filterFn):u.getMatchingCities(n,null,t.filterFn)},e}]);t.filter("isHACity",function(){return function(n){return n!=null&&n.IsHACity===!0}});t.directive("haAirportInput",["$log","$timeout","$window","haConfig",function(n,t,i){return{restrict:"A",require:["haAirportInput","?^haAirportPair"],scope:{ngModel:"=",preselectCode:"=",onChange:"@",filterFn:"@",label:"@",placeholder:"@",required:"@",disabled:"@",id:"@",name:"@",hidePin:"@",labelStyle:"@",size:"@"},template:'<div> <div has-autofill ng-class="{invalid: (invalid && !isFocused)}"> <label class="ha-label" ng-class="{\'required-asterisk\':required, \'ha-form-lg\': !size || size==\'large\', \'ha-form-sm\':size==\'small\', \'inline\': labelStyle==\'inline\' || !labelStyle || labelStyle !==\'eyebrow\', \'wrap-on-mobile\': labelStyle==\'inlineWrapOnMobile\'}"> <span ng-if="label">{{label}}<span class="mandatory-flag" ng-if="required">*<\/span><\/span> <input type="hidden" name="{{name}}Code" ng-value="ngModel.Code"/> <div class="mobile-tap-mask" ng-if="$root.isMobile" ha-location-modal="hawaii" ng-click="pinClicked()" filter-fn="{{filterFn}}"><\/div><input role="combobox" aria-owns="airportMatch-{{elNumber}}" aria-expanded="{{isOpen() || false}}" placeholder="{{placeholder}}"  id="{{id}}" type="text" name="{{name}}" autocomplete="off" ng-model="ngModel" allow-non-english="true" ha-typeahead="airport as airport.DisplayName for airport in getMatchingAirports($viewValue)" typeahead-editable="false" typeahead-min-length="3" typeahead-wait-ms="150" typeahead-on-select="onSelect($item, $model, $label)" ng-required="required" ng-disabled="disabled" ng-focus="onFocus($event)" ng-blur="onBlur($event)" ng-class="{\'has-pin\':!hideWhereweflyPin}" ha-errors > <div class="location-dropdown"> <div class="ha-typeahead-results" role="textbox" id="airportMatch-{{elNumber}}"><\/div><\/div><a href="" ha-location-modal="hawaii" ng-if="!hideWhereweflyPin" ng-click="pinClicked()" title="{{pinTitle || label}}" filter-fn="{{filterFn}}" city-list-type="{{cityListType}}" class="ha-airport-input-pin"> <i class="ha-icon fontIcon32-mapPin"><\/i> <\/a> <em for="airportInput-{{elNumber}}"><\/em> <\/label> <\/div><\/div>',controller:"haAirportInputCtrl",link:function(n,r,u,f){var e,o,s;n.$root.isMobile&&r.find('input[role="combobox"]').attr("readonly","readonly");n.elNumber=Math.floor(Math.random()*1e4+1);e=f[0];e.isOrigin=typeof u.origin!="undefined";e.isDestination=typeof u.destination!="undefined";e.isReshop=typeof u.reshop!="undefined";e.isExpertBooking=typeof u.expertBooking!="undefined";e.legIndex=u.legIndex!=null&&u.legIndex;n.cityListType="normal";e.isReshop?n.cityListType=e.isOrigin?"reshop-"+e.legIndex+"-origin":"reshop-"+e.legIndex+"-destination":e.isExpertBooking&&(n.cityListType="expertbooking");o=f[1];o!=null&&o.register(e);n.preselectCode!=null&&(s=n.preselectCode,n.getMatchingAirports(s).then(function(t){for(var i=0;i<t.length;i++)if(t[i].Code===s){n.ngModel=t[i];break}}));n.$parent.setLocationPathname=function(n){i.location.pathname!==n&&(console.log("$window.location.pathname = "+n),i.location.pathname=n)};n.$parent.setLocationPathname=function(n){i.location.pathname!==n&&(console.log("$window.location.pathname = "+n),i.location.pathname=n)};n.$watch("ngModel",function(t){n.onChange!=null&&t&&n.$parent.$eval(n.onChange);n.$emit("airportChanged")});n.onSelected=function(i){n.ngModel=i;t(function(){n.focus()},0)};n.onSelect=function(){t(function(){n.focus()},0)};n.pinClicked=function(){n.$emit("haWhereWeFlyPinClicked")};n.onClick=function(n){n.target.select()};n.hideWhereweflyPin=n.$eval(n.hidePin);n.labelStyle=n.$eval(n.labelStyle);n.size=n.$eval(n.size);n.focus=function(){setTimeout(function(){r.find('input[type="text"]').focus()},0)};n.pinTitle="pinTitle"in u?u.pinTitle:$scs("BookingWidget.AirportInputPinTitle");n.onFocus=function(i){n.isFocused=!0;t(function(){i.target.select()},0);n.$emit("airportInputFocused",r)};n.onBlur=function(){n.isFocused=!1}}}}])}(angular),function(n){"use strict";var t=n.module("haStickyBookingWidgetModule",["haModalService"]);t.directive("haStickyBookingWidget",["$rootScope","$window","haUtils","haCitiesSvc","haConfig","haDateUtils","$timeout","haModal","haSitecoreStrings",function(t,i,r,u,f,e,o,s,h){var c=function(t,e,c){function a(){var f;c.$observe("defaultDestinationImage",function(n){t.defaultDestinationImage=n||""});c.$observe("multiCity",function(n){t.multiCity=n&&n==="false"?!1:!0});t.stickyBookingOffsetY=!1;t.leg={};var n=r.getFlightQueryModelCookie(),e=moment().format("YYYY-MM-DD"),i=r.getFlightQueryModelRecentCookie();if(i)for(f=0;f<i.length;f++)i[f].FlightSearchSegmentList[0].DepartureDate.substr(0,10)<e&&i.splice(f,1),t.flightQueryCookieArr=i;n&&n.FlightSearchSegmentList[0]&&n.FlightSearchSegmentList[0].OriginCityCode?u.getCityByCode(n.FlightSearchSegmentList[0].OriginCityCode).then(function(n){t.leg.origin=n}):h.get("BookingWidget['originplaceholderstickywidget']").then(function(n){t.leg.origin=n});n&&n.FlightSearchSegmentList[0]&&n.FlightSearchSegmentList[0].DestinationCityCode?u.getCityByCode(n.FlightSearchSegmentList[0].DestinationCityCode).then(function(n){t.leg.destination=n}):h.get("BookingWidget['destinationplaceholderstickywidget']").then(function(n){t.leg.destination=n})}t.openFlightSearchEdit=function(){s(f.getTemplateUrl("ha-book-flight-search-edit-modal.html"),{id:"fare-help-modal",backdrop:"false",scope:t,modalLock:!0})};var l=function(){if(t.stickyBookingOffsetY===!1){var i=n.element("[ha-sticky-booking-widget]");if(i!=null)t.stickyBookingOffsetY=i.offset().top;else return}return t.stickyBookingOffsetY};t.recallSearch=function(n){t.$broadcast("recallSearch",n);t.recent=!1};n.element(i).bind("scroll",function(){var n=this.pageYOffset;$("html").hasClass("lte-ie8")&&(n=this.document.documentElement.scrollTop);t.fixed=n>=l()?!0:!1;t.$digest()});t.recentSearches={open:!1};t.$watch("recentSearches.open",function(n){typeof n!="undefined"&&(n?o(function(){$("body").on("click.recent",function(){t.$apply(function(){t.recentSearches.open=!1})})},10):$("body").off("click.recent"))});a()};return{restrict:"A",scope:!0,link:c,templateUrl:f.getTemplateUrl("ha-sticky-booking-widget-base-template.html")}}])}(angular),function(n){"use strict";var t=n.module("haProgressBarModule",[]);t.directive("haProgressBar",["haConfig",function(n){var t=function(){},i;return t.$inject=["$scope"],i=function(n,t,i){n.steps=i.steps;n.current=i.current;n.completed=n.current-1;n.empty=n.steps-n.current;n.getIterations=function(n){return new Array(n)};n.$emit("$haProgressBarReady")},{restrict:"A",scope:!0,link:i,controller:t,templateUrl:n.getTemplateUrl("ha-progress-bar-base-template.html")}}])}(angular),function(n){"use strict";var t=n.module("haErrorPageModule",[]);t.directive("haErrorPage",["haConfig",function(t){var i=function(){},r;i.$inject=["$scope"];r=function(u,f,e){return u.header=e.header,u.subtext=e.subtext,u.hasTransclude=n.element("[ng-transclude]").contents().length>0?!0:!1,{restrict:"A",scope:!0,link:r,controller:i,transclude:!0,templateUrl:t.getTemplateUrl("ha-error-page-base-template.html")}}}])}(angular),function(n){"use strict";var t=n.module("haMapNavigatorModule",[]);t.directive("haMapNavigator",["haConfig",function(t){var i=function(n,t){t.onresize=function(){n.reinitializeMap();n.$apply()}},r;return i.$inject=["$scope","$window"],r=function(t,i,r){var b=100,f=172,e=0,ft,w;t.zoomLevel=.75;var o=t.zoomLevel,k=0,s=0,et=t.$eval(r.model),u=i.find(".focus-magnifier"),c=i.find(".main-image-container"),l=0,a=0,h=i.width()/2,ot=.5,v=.2;t.model=et;var d=function(){s=parseInt(i.css("width"),10)/f/t.zoomLevel},g=function(){var s=parseInt(u.width(),10),r=t.zoomLevel*f,h=parseInt(u.height(),10),o=r*ot,n,i;t.magnifierStyle={width:r+"px",height:o+"px",borderWidth:Math.round(b/t.zoomLevel)+"px"};n=parseInt(u.css("top"),10)+(h-o)/2;i=parseInt(u.css("left"),10)+(s-r)/2;i+r>f&&(i=f-r);n+o>e&&(n=e-o);i<0&&(i=0);n<0&&(n=0);u.css("top",n+"px");u.css("left",i+"px")},nt=function(){var r=i.find(".main-image").width(),n;t.mapImageStyle={width:parseInt(i.css("width"),10)/t.zoomLevel};n=parseInt(i.find(".main-image").height(),10)*(t.mapImageStyle.width/r);l=n-h;a=t.mapImageStyle.width-parseInt(i.css("width"),10);t.mainImageConstraintStyle={width:t.mapImageStyle.width*2-parseInt(i.css("width"),10),height:n*2-h,left:-a,top:-l}},tt=function(){var n=Math.round(b/t.zoomLevel),i=n*2+f,r=n*2+e-1;t.focusContainerStyle={top:-n+"px",left:-n+"px",width:i+"px",height:r+"px"}},y=function(){var n=parseInt(u.css("left"),10)*s,t=parseInt(u.css("top"),10)*s;c.css("left",-(n-a)+"px");c.css("top",-(t-l)+"px")},st=function(){var n=(parseInt(c.css("left"),10)-a)/s,t=(parseInt(c.css("top"),10)-l)/s;u.css("left",-n+"px");u.css("top",-t+"px")},p=function(){d();g();tt();nt();y()};t.zoomOut=function(){t.zoomLevel<1&&(t.zoomLevel=t.zoomLevel+v<=1?t.zoomLevel+v:1,p())};t.zoomIn=function(){t.zoomLevel>o&&(t.zoomLevel=t.zoomLevel-v>=o?t.zoomLevel-v:o,p())};var it=0,rt=function(){it++;it===2&&(u.css("left","28px"),u.css("top","13px"),y(),t.$apply())},ht=i.find(".main-image").attr("image-id"),ut=function(){i.css("height",h);i.find(".ha-map-navigator").css("height",h);o=i.width()/k;o>t.zoomLevel&&(t.zoomLevel=o);d();nt();rt()};t.$on(ht,function(){k=i.find(".main-image").width();ut()});ft=i.find(".preview-background").attr("image-id");w=function(){f=i.find(".preview-background").width();e=i.find(".preview-background").height();i.find(".preview-container").css("height",e+1);i.find(".tap-zoom-panel").css("height",e+1);g();tt();rt()};t.$on(ft,function(){i.find(".preview-background")[0].ondragstart=function(){return!1};w()});i.find("[ha-draggable]").each(function(){var t=n.element(this).scope();t.updateDraggableSettings({containment:"parent"})});t.$on("$dragging",function(n,t){$(t.toElement).hasClass("main-image")?st():y()});t.reinitializeMap=function(){h=i.width()/2;w();ut();p()};t.setGrab=function(n){t.grabbing=n};new window.Hamster(i.find(".focus-magnifier")[0]).wheel(function(n,i){i>0?t.zoomIn():t.zoomOut();t.$apply()});new Hammer(i.find(".main-image-container")).on("pinchin",function(){t.zoomOut();t.$apply()});new Hammer(i.find(".main-image-container")).on("pinchout",function(){t.zoomIn();t.$apply()});t.$emit("$haMapNavigatorReady")},{restrict:"A",scope:!0,link:r,templateUrl:t.getTemplateUrl("ha-map-navigator-base-template.html"),controller:i}}]);t.directive("loadWatch",function(){return{restrict:"A",link:function(n,t,i){t.bind("load",function(t){n.$emit(i.imageId,t)})}}})}(angular),function(n){"use strict";var t=n.module("haGlobalMessageModule",["ngAnimate","haAlertModule"]);t.directive("haGlobalMessage",["haConfig","$timeout",function(n,t){var i=function(n,t){n.alert={type:"success",header:"",description:null};n.closeMessage=function(){n.isShown=!1};n.setAutoFade=function(){t(n.closeMessage,n.messageCloseTime)}},r;return i.$inject=["$scope","$timeout"],r=function(n,i,r){n.alert.header=r.header;n.alert.description=r.description;n.alert.type=r.type;n.isShown=!n.alert.header||n.alert.header===""?!1:!0;n.messageCloseTime=r.messageCloseTime||3e3;n.setAutoFade();n.exampleMethod=function(){return n};n.$emit("$haGlobalMessageReady");t(function(){i.children().find('[role="alert"]').focus()},300)},{restrict:"A",scope:!0,link:r,templateUrl:n.getTemplateUrl("ha-global-message-base-template.html"),controller:i}}])}(angular),function(n){"use strict";var t=n.module("haGlobalAlertModule",[]);t.directive("haGlobalAlert",["haConfig",function(n){var t=function(n){n.showAlert=!0;n.$on("$showAlert",function(){n.showAlert=!0});n.$on("$hideAlert",function(){n.showAlert=!1});n.hideAlert=function(){n.showAlert=!1}},i;return t.$inject=["$scope"],i=function(n,t,i){n.type=i.type;n.noIcon=!1;i.noicon&&(n.noIcon=!0);n.header=i.header;n.description=i.description;n.btntext=i.btntext;n.btnlink=i.btnlink;i.$observe("header",function(){n.header=i.header;n.showAlert=!0});i.$observe("type",function(){n.type=i.type;n.showAlert=!0});i.$observe("description",function(){n.description=i.description});i.$observe("noicon",function(){n.noIcon=!1;i.noicon&&(n.noIcon=!0);n.showAlert=!0});i.$observe("btntext",function(){n.btntext=i.btntext});i.$observe("btnlink",function(){n.btnlink=i.btnlink});n.$emit("$haGlobalAlertReady")},{restrict:"A",scope:!0,link:i,templateUrl:n.getTemplateUrl("ha-global-alert-base-template.html"),controller:t}}])}(angular),function(n){"use strict";var t=n.module("haTooltipModule",[]);t.directive("haTooltip",["haConfig","$timeout",function(t,i){var r=function(){},u;return r.$inject=["$scope"],u=function(t,r,u){function o(){var l=29,v=8,h=12,p={position:"absolute",margin:0},i=$("#"+t.targetElId),c=i.position(),o=c.top,u=c.left,a=i.offset(),y=s(r);f=Number(t.width)||r.width();switch(e[0]){case"top":o+=i.height()+v;break;case"bottom":o-=y+v;break;case"left":u+=i.width()+v;break;case"right":u-=f+h}switch(e[1]){case"left":u-=l+h/2-i.width()/2;break;case"right":u-=f-l-h/2-i.width()/2;break;case"top":o-=l+h/2-i.height()/2;break;case"bottom":o-=y-l-h/2-i.height()/2;break;case"center":e[0]==="top"||e[0]==="bottom"?u-=f/2-i.width()/2:o-=y/2-i.height()/2}a.left-r.width()/2<0?u-=a.left-r.width()/2:a.left+r.width()/2>window.innerWidth-10&&(u+=window.innerWidth-10-(a.left+r.width()/2));c.top=o;c.left=u;n.extend(p,c);r.css(p)}function s(n){var t=n.attr("style"),i,r;return n.css({position:"absolute",visibility:"hidden",display:"block"}),n.hasClass("ng-hide")&&(n.removeClass("ng-hide"),i=!0),r=n.find(".ha-tooltip").outerHeight(),n.attr("style",t?t:""),i&&n.addClass("ng-hide"),r}var e,f;t.subtext=u.subtext;t.position=u.position;t.arrowPosition=u.arrowPosition;f=u.width;f>window.innerWidth&&(f=window.innerWidth-20);t.width=f;t.targetElId=u.targetElId;t.setWidth=function(){if(t.width)return{width:t.width}};t.width&&r.css({width:t.width});t.targetElId&&t.position==="absolute"&&t.arrowPosition&&(e=t.arrowPosition.split("-"),f=parseInt(t.width)||r.width(),i(o),u.ngShow&&t.$watch(u.ngShow,function(n){n&&o()}));t.$emit("$haTooltipReady")},{restrict:"A",scope:!0,link:u,controller:r,transclude:!0,templateUrl:t.getTemplateUrl("ha-tooltip-base-template.html")}}])}(angular),function(n){"use strict";var t=n.module("haAvatarModule",[]);t.directive("haAvatar",["haConfig",function(n){var t=function(){},i;return t.$inject=["$scope"],i=function(n,t,i){i.$observe("size",function(){n.setAvatarSize()});n.name=i.name;i.$observe("name",function(){n.name=i.name});n.alt=i.alt;n.src=i.src;i.$observe("src",function(){n.src=i.src});n.initials=i.initials;i.$observe("initials",function(){n.initials=i.initials});n.seatSelection=i.seatSelection;i.$observe("seatSelection",function(){n.seatSelection=i.seatSelection});n.setAvatarSize=function(){n.size=i.size;n.size||(n.size="large");n.size==="small"&&(n.avatarWidth=70,n.avatarHeight=70);n.size==="large"&&(n.avatarWidth=125,n.avatarHeight=125)};n.setAvatarSize();n.$emit("$haAvatarReady")},{restrict:"A",scope:!0,link:i,controller:t,templateUrl:n.getTemplateUrl("ha-avatar-base-template.html")}}])}(angular),function(n){"use strict";var t=n.module("haDynamicModalModule",[]);t.directive("haDynamicModal",function(){var t=function(t,i,r){t.body=n.element(document).find("body");t.backdropEl=n.element('<div class="modal-backdrop" ng-click="$modalCancel()">');t.handleEscPressed=function(n){n.keyCode===27&&t.$modalCancel()};t.closeFn=function(){t.body.unbind("keydown",t.handleEscPressed);t.backdropEl.removeClass("fade in");t.modalEl.removeClass("in");r(function(){t.body.removeClass("modal-active")},300)};t.body.bind("keydown",t.handleEscPressed)},i;return t.$inject=["$scope"],i=function(n){n.exampleMethod=function(){return n};n.$emit("$haDynamicModalReady")},{restrict:"A",scope:!0,transclude:!0,link:i,controller:t}})}(angular),function(n){"use strict";var t=n.module("haAlertModule",[]);t.directive("haAlert",["$window","haConfig",function(n,t){var i=function(t){t.showAlert=!0;t.$on("$showAlert",function(n,i){i===t.alertId&&(t.showAlert=!0)});t.$on("$hideAlert",function(){t.showAlert=!1});t.hideAlert=function(){t.showAlert=!1;t.$emit("haAlertClosed",t.alertId)};t.postTealeaf=function(){n.TLT!=null&&n.TLT.logCustomEvent("HAErrorMessage",{ErrorHeader:t.header,ErrorMessage:t.description})}},r;return i.$inject=["$scope"],r=function(n,t,i){if(n.type=i.type,n.alertId=i.alertId,n.noClose=i.noClose!==undefined,n.noIcon=!!i.noicon,n.header=i.header,n.description=i.description,n.customIconClass=i.customIconClass,i.$observe("header",function(){n.header=i.header;n.showAlert=!0}),i.$observe("type",function(){n.type=i.type;n.showAlert=!0;n.type==="error"&&(n.noClose=!0)}),i.$observe("description",function(){n.description=i.description}),i.$observe("noicon",function(){n.noIcon=!!i.noicon;n.showAlert=!0}),i.$observe("customIconClass",function(){n.customIconClass=i.customIconClass}),typeof t.context!="undefined"&&n.header!==""&&typeof(t.context.offsetHeight!==undefined)&&t.context.offsetHeight!==0){if(t.find(".alert-content [ng-transclude]").children().length>0){var r=t.find(".alert-content [ng-transclude]").text().trim();t.find(".alert-hidden-content.sr-only").append('<p class="sr-only">'+r+"<\/p>")}["promo","info"].indexOf(i.type.toLowerCase())===-1&&i.disableAutofocus!=="true"&&t.find('[role="alert"]').focus();n.description!==undefined&&n.postTealeaf()}},{restrict:"A",scope:!0,link:r,transclude:!0,templateUrl:t.getTemplateUrl("ha-alert-base-template.html"),controller:i}}])}(angular),function(n){"use strict";var t=n.module("haHelpAndTipsModule",[]);t.directive("haHelpAndTips",["haConfig",function(n){var t=function(n,t){n.getData=function(i,r){t.getData(i,function(t){n.cityName=t.cityName;n.month=t.months[(r-1)%12];n.monthDate=new Date(2e3,r-1);n.$emit("$haHelpAndTips:dataLoaded")})}},i;return t.$inject=["$scope","haHelpAndTips"],i=function(n,t,i){i.$observe("city",function(){n.getData(i.city,i.month)});n.$on("$haHelpAndTips:dataLoaded",function(){n.$emit("$haHelpAndTips:Ready")})},{restrict:"A",scope:!0,link:i,templateUrl:n.getTemplateUrl("ha-help-and-tips-base-template.html"),controller:t}}])}(angular),function(n){"use strict";var t=n.module("haRecentSearchesModule",[]);t.directive("haRecentSearches",["haConfig",function(n){var t=function(n,t){n.restoreSearch=function(i){t.restoreSearch(i);n.deactivate()};n.activate=function(){return n.active=!0,n};n.deactivate=function(){return n.active=!1,n};n.active=!1},i;return t.$inject=["$scope","haSearchCache","haCustomerSelections"],i=function(n,t){n.toggleActive=function(){return n.active?n.deactivate():(t.find(".toggle").focus(),n.activate()),n};n.preventDefault=function(n){n.preventDefault()};n.$emit("$haRecentSearchesReady")},{restrict:"A",scope:!0,templateUrl:n.getTemplateUrl("ha-recent-searches-base-template.html"),link:i,controller:t}}])}(angular),function(n){var t=n.module("haLocationInputModule",["haUtilsModule","haTemplateCache","haCitiesAPI","ui.bootstrap.typeahead","haAdvanceToNextInputService"]);t.directive("haLocationInput",["$compile","$timeout","haTemplateCache","haConfig",function(n,t,i,r){t(function(){i.get(r.getRazorTemplateUrl("destination-modal-hawaii"));i.get(r.getRazorTemplateUrl("destination-modal-na"));i.get(r.getRazorTemplateUrl("destination-modal-asia"));i.get(r.getRazorTemplateUrl("destination-modal-base"))},1e3);var u=function(n,t,i){var r=n.haLocationInput=n.haLocationInput||{};i.$observe("required",function(t){n.required=t});n.errorMessage=i.errorMessage;r.placeholder=i.placeholder;r.label=i.label;r.required=i.required;r.tagname=i.tagname;r.tagPrefix=i.tagPrefix!==undefined?i.tagPrefix:"";r.tagname2=i.tagname2;r.tagPrefix2=i.tagPrefix2!==undefined?i.tagPrefix2:"";r.disabledInput=i.disabledInput==="true";r.selectedCity=r.selectedCity||i.haLocationSelectedCity};return{restrict:"A",scope:{preset:"=",disabledInput:"=",originLeg:"=",destinationLeg:"=",cityFilterIndex:"=",cityFilterIsDeparture:"="},link:u,templateUrl:r.getRazorTemplateUrl("ha-location-input-base-template"),controller:"haLocationInputController"}}]);t.controller("haLocationInputController",["$scope","$log","haCitiesAPI",function(n,t,i){function u(){n.$root.DefaultCity==null||r.selectedCity||(r.selectedCity=n.$root.DefaultCity);var u=function(i){t.debug("SEND: haLocationInput:ready:CityList");r.CityList=i;n.$broadcast("haLocationInput:ready:CityList")};r.cityFilterIndex!=null?i.getFilteredCityList(r.cityFilterIndex,r.cityFilterIsDeparture).then(u):i.getCityList().then(u)}var r=n.haLocationInput=n.haLocationInput||{};r.CityList=[];r.preset=n.preset;r.disabled=n.disabledInput;r.originLeg=n.originLeg;r.destinationLeg=n.destinationLeg;r.cityFilterIndex=n.cityFilterIndex;r.cityFilterIsDeparture=!!n.cityFilterIsDeparture;u()}])}(angular),function(n){"use strict";var t=n.module("haLocationInputModule");t.directive("haLocationTypeahead",["$compile","$log","$filter","$timeout","haAdvanceToNextInput","haConfig",function(n,t,i,r,u,f){var e=function(n,f){var e=n.haLocationData,s=function(){n.$apply(function(){e.focused=!0;n.$emit("HaLocationInput:focused",f);n.$root.DefaultCity==null||e.selectedCity||(e.selectedCity=n.$root.DefaultCity)})},h=function(t){r(function(){if(e.focused=!1,t!=null){var i=t.target;(i!=null&&i.value==null||i.value==="")&&n.clearSelection()}n.$emit("HaLocationInput:blurred")},350)},o;f.find("input[typeahead]").on("focus",s).on("blur",h);o=function(){var r,f,u;e.CityList!=null&&e.CityList.length!==0&&(t.debug("haLocationTypeahead._onCityListReady"),f=i("filter"),e.preset?(r=f(e.CityList,{Code:e.preset}),r.length>0?(t.debug('haLocationTypeahead: Matched "preset" ('+e.preset+")."),n.processSelection(r[0])):t.debug('haLocationTypeahead: Could not set "preset" ('+e.preset+"). No match in CityList.")):(e.originLeg!=null&&e.originLeg.origin!=null?u=e.originLeg.origin:e.destinationLeg!=null&&e.destinationLeg.destination!=null&&(u=e.destinationLeg.destination),u!=null?(r=f(e.CityList,{Code:u}),r.length>0?(t.debug('haLocationTypeahead: Matched "code" ('+u+")."),n.processSelection(r[0])):t.debug('haLocationTypeahead: Could not set "code" ('+u+"). No match in CityList.")):t.debug("haLocationTypeahead: No legs specified.")))};t.debug("ON: haLocationInput:ready:CityList");n.$on("haLocationInput:ready:CityList",function(){t.debug("RCVD: haLocationInput:ready:CityList");o()});t.debug("ON: $root.selections.legs:ready");n.$on("$root.selections.legs:ready",function(){t.debug("RCVD: $root.selections.legs:ready");o()});o();n.$watch("currentCityDisplayName",function(n){if(n!==undefined){var t=f.parents("[ha-input]").scope();t!=null&&t.$model!=null&&(t.$model.$setViewValue(n),t.$model.$render())}});n.advanceToNextInput=function(){u.next(f)}};return{restrict:"AE",link:e,scope:{haLocationData:"=haLocationData"},replace:!0,controller:"haLocationTypeaheadController",templateUrl:f.getRazorTemplateUrl("ha-location-typeahead")}}]);t.controller("haLocationTypeaheadController",["$scope","$timeout","haUtils",function(t,i,r){var u=t.haLocationData,f,e,o;u.focused=!1;f=function(n){for(var i=[],t=0;t<n.length-1;t++)i.push(n[t]+" "+n[t+1]),i.push(n[t]+n[t+1]);return n.concat(i)};t.haAirportSort=function(t){return function(i){var r=0,u,e,o,s;return t==null?r:(i.DisplayName===t&&(r=100),u=t.split(" ").join(""),i.Code!=null&&i.Code.toUpperCase()===t.toUpperCase()&&(r+=1),i.DisplayName!=null&&(e=f(i.DisplayName.split(" ")),n.forEach(e,function(n){n.toLowerCase().indexOf(t.toLowerCase())===0?r+=.3:n.toLowerCase().indexOf(u.toLowerCase())===0&&(r+=.15)})),i.LinkedAirportCodes!=null&&(o=i.LinkedAirportCodes.split(","),n.forEach(o,function(n){n.toUpperCase()===t.toUpperCase()&&(r+=.2)})),i.SearchTags!=null&&(s=f(i.SearchTags.split(" ")),n.forEach(s,function(n){(n.toLowerCase().indexOf(t.toLowerCase())===0||n.toLowerCase().indexOf(u.toLowerCase())===0)&&(r+=.1)})),r>0&&i.IsHACity&&(r+=.5),i._weight=r,-r)}};t.haAirportFilter=function(n){return n._weight>0};e=r.isJP()||r.isKR()||r.isCN()||r.isTW();t.typeaheadMinLength=function(){return e?2:3};o=function(n){u.originLeg!=null&&(u.originLeg.origin=n.Code,u.originLeg.originCityData=n);u.destinationLeg!=null&&(u.destinationLeg.destination=n.Code,u.destinationLeg.destinationCityData=n)};t.processSelection=function(n){t.$root.DefaultCity=null;t.currentCityDisplayName=n.DisplayName;u.selectedCity=n;u.currentCityCode=n.Code;u.linkedCityCode=n.LinkedAirportCodes;o(n)};t.clearSelection=function(){u.currentCityCode=null;u.linkedCityCode=null};t.onSelected=function(n){i(function(){u.focused=!1;t.processSelection(n);t.advanceToNextInput()},200)}}])}(angular),function(n){"use strict";var t=n.module("haLocationInputModule");t.directive("haLocationModal",["haModal","haCitiesSvc","haConfig","$timeout",function(n,t,i,r){function u(u,f,e){var l=e.eventName||"click",s,o,h,c;u.filterName=e.filterFn!==""?e.filterFn:null;u.cityListType=e.cityListType||"normal";s=function(t){u.updateAvailableCities(u.region);var f=t.currentTarget;n(i.getRazorTemplateUrl("destination-modal-base"),{id:"locationModal",backdrop:"true",scope:u,cancel:{fn:function(){r(function(){$(f).prevAll("[ha-typeahead]").focus()},300)}}})};f.on(l,s);u.cityListType.match("^reshop")?(o=u.cityListType.split("-"),o.length===3&&(h=o[1],c=o[2]==="origin",t.getFilteredCities(h,c).then(function(n){u.cities=n}))):u.cityListType.match("^expertbooking")?t.getAllCitiesExpertBooking().then(function(n){u.cities=n}):t.getAllCities().then(function(n){u.cities=n})}return{restrict:"A",link:u,controller:"haLocationModalController",scope:{region:"@haLocationModal",selectedCity:"=haLocationSelectedCity"}}}]);t.controller("haLocationModalController",["$scope","$filter",function(t,i){function u(n){var t=0;switch(n){case"hawaii":t=1;break;case"na":t=2;break;case"asia":t=3}return t}function f(n){switch(n){case"hawaii":t.$root.isMobile&&r(t.regionalCities,"IslandName",1);break;case"na":r(t.regionalCities,"State",4);break;case"asia":r(t.regionalCities,"CountryName",4)}}function r(r,u,f){var o=0,e=[],h,s;t.regionalCities=[];r=i("citiesOrderBy")(r,u,!1);h=r.length;r=_.groupBy(r,u);s=Math.round((h+Object.keys(r).length)/f);n.forEach(r,function(n,r){if(n=i("citiesOrderBy")(n,"NonLocalisedCityName",!1),o+n.length>s*1.5)if(s-o<s/3&&(t.regionalCities.push(e),o=0,e=[]),n.length>s*1.5){var u=s-o+3;e.push({Name:r,Cities:n.slice(0,u)});t.regionalCities.push(e);e=[];e.push({Name:r,Cities:n.slice(u)});o=n.length-u}else e.push({Name:r,Cities:n}),o=n.length+1;else o+=n.length+1,e.push({Name:r,Cities:n});o>=s&&t.regionalCities.length<f-1&&(o=0,t.regionalCities.push(e),e=[])});u==="IslandName"&&n.forEach(e,function(n){n.islandSortOrder=!n.Cities?9:n.Cities[0].IslandSortOrder});t.regionalCities.push(e)}t.regionalCities=[];t.$watch("region",function(n,i){n!==i&&t.updateAvailableCities(n)});t.selectCity=function(n){var i;do if(i=t.$parent,i.onSelected!=null){i.onSelected(n);break}while(i!=null);t.$modalClose()};t.selectRegion=function(n){t.region=n};t.isRegion=function(n){return this.region===n};t.getCitiesByMarket=function(n){return t.cities?t.filterName==="isHACity"?t.cities.filter(function(t){return t.Market===n&&t.IsHACity===!0}):t.cities.filter(function(t){return t.Market===n}):[]};t.regionHasCities=function(n){var i=u(n),r=t.getCitiesByMarket(i);return!!r.length};t.updateAvailableCities=function(n){var i=u(n);t.regionalCities=t.getCitiesByMarket(i);f(n)}}]);t.filter("citiesOrderBy",[function(){return function(t,i,r){var u=[];return n.forEach(t,function(n){u.push(n)}),u.sort(function(n,t){return n[i]>t[i]?1:-1}),r&&u.reverse(),u}}])}(angular),function(n){"use strict";var t=n.module("haDateInputModule",["haAdvanceToNextInputService"]);t.directive("haDateInput",["haUtils","haConfig","haAdvanceToNextInput",function(n,t,i){var r=function(t,i){t.updateTimestamp=function(i){i?(t.date=n.leftPad(i.month,2)+n.leftPad(i.day,2)+i.year.toString(),t.timestamp=new Date(i.year,i.month-1,i.day),t.updated=i.updated):t.date=t.timestamp=undefined};t.setDate=i.setLegDate;t.getLegData=function(n){return i.getLeg(n)}},u;return r.$inject=["$scope","haCustomerSelections"],u=function(n,t,r){n.onFocus=function(){t.addClass("focused");n.$emit("HaDateInput:focused",t)};n.onBlur=function(){t.removeClass("focused");n.$emit("HaDateInput:selected",t)};n.advanceToNextInput=function(){i.next(t)};n.legData=n.getLegData(r.targetLeg);n.$watch("$root.selections.legs",function(){var t=n.updated;n.legData=n.getLegData(r.targetLeg);n.updateTimestamp(n.legData.date);n.updated!==t&&n.advanceToNextInput()},!0);n.$watch("date",function(t,i){t!==i&&n.date&&n.legData&&n.setDate(r.targetLeg,{month:n.date.substr(0,2),day:n.date.substr(2,2),year:n.date.substr(4,4)})});n.label=r.label;n.tagname=r.tagname;n.tagPrefix=r.tagPrefix!==undefined?r.tagPrefix:"";n.placeholder=r.placeholder;n.required=r.required;n.errorMessage=r.errorMessage;n.$emit("$haDateInputReady")},{restrict:"A",scope:!0,templateUrl:t.getTemplateUrl("ha-date-input-base-template.html"),link:u,controller:r}}]);t.directive("haDateFormatter",["$filter","$locale",function(n,t){function i(){return t.DATETIME_FORMATS.shortDate}return{require:"ngModel",link:function(t,r,u,f){f.$formatters.push(function(t){if(t==null||typeof t!="string")return"";var r={month:parseInt(t.substr(0,2),10)-1,day:parseInt(t.substr(2,2),10),year:parseInt(t.substr(4,4),10)},u=new Date(r.year,r.month,r.day,0,0,0,0);return n("date")(u,i())})}}}]);t.run(["$locale","haUtils",function(n,t){t.isEN()&&(n.DATETIME_FORMATS.shortDate="M/d/yyyy")}])}(angular),function(n){"use strict";var t=n.module("shareWidgetModule",[]);t.directive("shareWidget",["haConfig",function(n){var t=function(n){n.shareServices=["Twitter","LinkedIn","Facebook","Google+"]},i=function(n){n.$emit("$methodsBound")};return t.$inject=["$scope"],{restrict:"A",scope:!0,link:i,controller:t,templateUrl:n.getTemplateUrl("share-widget-base-template")}}])}(angular),function(n){"use strict";var t=n.module("haCalendarEventsModule",[]);t.directive("haCalendarEvents",[function(){var n=function(n,t){n.getCalendarEvents=function(n,i){t.getEvents(n,function(n){i(n)})}},t;return n.$inject=["$scope","haCalendarEventsService"],t=function(n,t,i){n.getCalendarEvents(i.haCalendarEvents,function(t){$.extend(n,t);n.$broadcast("$haCalendarEventsLoaded")})},{restrict:"A",scope:!0,link:t,controller:n}}])}(angular),function(n){"use strict";function t(n){return n.format("YYYY-MM-DD")}function i(n){return n.format("YYYY-MM")}var r=n.module("haCalendarModule",[]);r.directive("haCalendar",["$compile","$locale","haConfig","haUnavailableDays","haAriaLiveService",function(n,r,u,f,e){return{templateUrl:u.getTemplateUrl("ha-calendar.html"),restrict:"A",controller:["$timeout","$rootScope","$scope","$element","$attrs","$parse",function(u,o,s,h,c,l){function g(n){if(o.isMobile)a.calendars=1;else{if(typeof n=="undefined")return;a.calendars=n===2?2:1}}function nt(n,t){if(n&&n.origin&&n.origin.Code&&n.destination&&n.destination.Code)return t?n.destination.Code+"-"+n.origin.Code:n.origin.Code+"-"+n.destination.Code}function ut(){return a.viewing&&moment(a.viewing).startOf("month")}function b(n){a.viewing.year(n.year()).month(n.month())}function v(){var u=ut(),r=moment(u),n,i;for(y.empty(),n=0;n<a.calendars;n++)ft(r),r.add(1,"months");i=moment(w()||NaN);i.isValid()&&y.find("td[date="+t(i)+"]").addClass("selected");a.render.calendar(h,a.isReturn)}function k(n){return t(n).valueOf()>=t(a.range_start)&&t(n).valueOf()<t(a.range_end)}function d(n){return moment(y.find(n).attr("date"),"YYYY-MM-DD")}function ft(n){var f=s.$new(!0),r=moment(n).startOf("month"),e=moment(r).endOf("month").date(),u=r.day();rt(f,function(f){a.render.caption(f.find("caption"),r);f.attr("date",i(n)).find("tbody>tr>td").each(function(n){var f=n-u+1;if(!(n<u)&&!(f>e)){var i=moment(r).date(f),o=i.diff(tt,"days"),s=$(this).attr("date",t(i)).addClass(o?o<0?" past":" future":" today").toggleClass("disabled",!k(i));a.render.day(s,i)}});y.append(f)})}var a=$.extend(!0,{calendars:1,range_start:moment([1900]),range_end:moment([3e3]),double_wide:!1,render:{calendar:function(n,t){var i,r,u;if(a.rangeRender&&a.rangeRender(n),a.double_wide&&n.addClass("double-wide"),i=a.idx||0,s.legs&&s.legs[i]&&(r=nt(s.legs[i],t),r&&r.length&&f.get(r).then(function(t){n.find("td[date]:not(.disabled)").each(function(){var n=$(this);t.contains(moment(n.attr("date"),"YYYY-MM-DD").toDate())&&n.addClass("disabled")})}),s.tripType===2?n.addClass("double-wide"):n.removeClass("double-wide")),s.messages&&(u=n.closest(".datepicker"),u.find("header > .calendar-messages").html(s.messages[i]),e.updateMessage(s.messages[i])),a.onRender)a.onRender(n)},caption:function(n,t){var i=t.month(),u=r.DATETIME_FORMATS.MONTH,f=t.year();n.html(u[i]+" "+f)},day:function(n,t){n.html(t.date())}}},s.$eval(c.haCalendar)),p,w;g(s.tripType);s.$on("trip type changed",function(n,t){g(t);v()});s.$on("airport changed",function(){v()});h.children("header").children("h2").text(a.calendarHeading);var tt=moment().startOf("day"),it=h.find("li").remove()[0].outerHTML,rt=n(it),y=h.find("ol.months");a.hasOwnProperty("watch")&&s.$watch(a.watch,v);s.$watch(function(){return a.range_start.valueOf()},v);s.$watch(function(){return a.range_end.valueOf()},v);s.$watch(function(){return a.viewing.valueOf()},v);p=l(c.haCalendarModel||"date");w=p.bind(p,s);this.select=function(n){u(function(){p.assign(s,n)},0);s.$emit("select",n)};s.$watch(w,function(n){if(y.find(".selected").removeClass("selected"),n||(n=Math.max(new Date,a.range_start.valueOf())),n=moment(n),n.isValid()&&k(n)){a.sticky_viewer&&b(n);var t=y.find("li[date="+i(n)+"]");if(t.length)return v()}});this.render=v;s.prev=function(){var n=d("li:first").add(-1,"month");b(n);s.$emit("prev",n)};s.next=function(){var n=d("li:first");b(n.add(1,"month"));s.$emit("next",n)};this.inRange=k;this.dateOf=d;a.viewing||(a.viewing=moment(w()||moment()).startOf("month"));s.$emit("ready",this)}],compile:function(n){return n.find("th").each(function(n,t){t.innerText=r.DATETIME_FORMATS.SHORTDAY[n]}),function(n,t,i,r){t.find("ol.months").on("click","td[date]:not(.disabled)",function(t){n.$apply(function(){r.select(r.dateOf(t.target).toDate())})});t.find(".prev").click(function(){n.$apply(n.prev)});t.find(".next").click(function(t){t.preventDefault();n.$apply(n.next)})}}}}])}(angular),function(n){"use strict";var t=n.module("haCalendar2Module",[]);t.directive("haCalendar2",["haDateUtils","$timeout","$rootScope","$parse","haConfig",function(t,i,r,u,f){return{templateUrl:f.getTemplateUrl("ha-calendar2.html"),restrict:"A",link:function(f,e,o){function d(n){var i=new Date;return f.pastDisabled||f.futureDisabled?f.pastDisabled&&t.isBefore(n,i)&&!t.isSameDay(n,i)||f.futureDisabled&&t.isAfter(n,i):!1}function p(){a=!1;h.removeClass("animating");f.$apply(function(){f.limitTrailer=-1*f.monthsToShow;h.css("left")==="0px"?f.limitIndex--:h.css("left",w)})}function g(){var i=document.createElement("div"),n={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"};for(var t in n)if(i.style[t]!==undefined)return n[t];return!1}function k(n,t,i,r){return t&&n.getDate()>7||r>=4&&n.getDate()>=1&&n.getDate()<15}var s,c;o.mode&&(f.mode=o.mode);o.monthsBackward&&(f.monthsBackward=parseInt(o.monthsBackward,10));o.monthsForward&&(f.monthsForward=parseInt(o.monthsForward,10));o.monthsToShow&&(f.monthsToShow=parseInt(o.monthsToShow,10));o.dayTemplate&&(f.dayTemplate=o.dayTemplate);o.departDate&&(s=u(o.departDate)(f));o.returnDate&&(c=u(o.returnDate)(f));o.getIsUnavailable&&(f.getIsUnavailable=u(o.getIsUnavailable)(f));o.departDate&&f.$watch(o.departDate,function(n){s=n});o.returnDate&&f.$watch(o.returnDate,function(n){c=n});f.mode=f.mode||"single";f.monthsBackward=f.monthsBackward||0;f.monthsForward=typeof f.monthsForward!="undefined"?f.monthsForward:11;f.monthsToShow=f.monthsToShow||1;f.dayTemplate=f.dayTemplate||"ha-datepicker-day-template";f.getIsUnavailable=f.getIsUnavailable||function(){return!1};f.pastDisabled=typeof f.pastDisabled!="undefined";f.futureDisabled=typeof f.futureDisabled!="undefined";f.monthsBackward=f.pastDisabled?0:f.monthsBackward;f.monthsForward=f.futureDisabled?0:f.monthsForward;var w="0",b=f.monthsToShow===2?"-50%":"-100%",h=$("#months",e),v=g(),a=!1,l,y=f.mode==="single";f.months=t.getVisibleMonths(f.monthsBackward,f.monthsForward);f.weekdays=f.weekdays||t.getDaysOfWeek();f.limitIndex=f.monthsBackward>0?f.monthsBackward+1:f.monthsToShow;f.limitTrailer=-1*f.monthsToShow;y?l=f.inputModel:s?l=s:!s&&c&&(l=c);l&&n.isDate(l)&&(f.limitIndex+=moment(l).diff(moment().startOf("month"),"months"));h.on(v,p);f.next=function(n){(n=n||1,a||f.limitIndex===f.monthsBackward+f.monthsForward+1)||(f.$emit("calendarForward"),f.limitIndex+=n,f.limitTrailer=f.mode==="stack"?f.limitTrailer-=n:-1*(f.monthsToShow+1),f.mode!=="stack"&&(h.addClass("animating"),i(function(){a=!0;h.css("left",b);v||p()})))};f.prev=function(){a||f.limitIndex===f.monthsToShow||(f.$emit("calendarBackward"),f.limitTrailer=f.mode==="stack"?f.limitIndex*-1:-1*(f.monthsToShow+1),f.mode!=="stack"&&(h.css("left",b),i(function(){a=!0;h.addClass("animating");h.css("left",w);v||p()})))};f.$on("calendarGoForward",function(n,t){f.next(t)});f.$on("calendarGoBackward",f.prev);f.setDate=function(n,t){r.$broadcast("setDate",new Date(t.day),n.target)};f.displayDay=function(n,t,i){return k(n,t,i)?"-":n.getDate()};f.isEdgeDay=function(n,t,i,r){return k(n,t,i,r)};f.isDepart=function(n){return y?t.isSameDay(f.inputModel,n):s?t.isSameDay(s,n):!1};f.isReturn=function(n){return y?t.isSameDay(f.inputModel,n):c?t.isSameDay(c,n):!1};f.isSelected=function(n){return!!s&&!!c&&t.isBetween(n,s,c)};f.isUnavailable=function(n){return f.getIsUnavailable(n)||d(n)};f.dayPlus=function(t,i){return n.isDate(t)?new Date(+t).dateAdd("day",i):new Date}}}}])}(angular),function(n){"use strict";var t=n.module("haCarouselModule",[]);t.directive("haCarousel",["$timeout","$compile","haUtils","haConfig","$rootScope",function(n,t,i,r,u){return{restrict:"A",scope:!0,priority:20,transclude:!0,templateUrl:r.getTemplateUrl("ha-carousel-template.html"),link:function(t,r,f,e,o){var c=t.$eval(f.onlyPage),l=t.$eval(f.noTransition),s=f.allowWrap?t.$eval(f.allowWrap):!0,h=t.$eval(f.mobileSlide),a=u.isMobile,v=f.paginationType,y=t.$eval(f.largePaddles),p=f.paginationAriaHidden?f.paginationAriaHidden:!1;r.find(".transclude").append(o(t,function(){}));r.find("[ha-draggable]").each(function(){$(this).scope().updateDraggableSettings({distance:40,axis:"x"});$(this).scope().$on("$dragEnd",function(n,i,r){c&&t.gotoNextSlideInDirection(r.position.left-r.originalPosition.left);t.gotoNearestSlide()})});t.slideWrapper=r.find(".ha-carousel-slide-wrapper").first();n(function(){t.slides=t.slideWrapper.children(".ha-carousel-slide");t.currentSlide=0;t.paginationType=v;t.largePaddles=y;t.paginationAriaHidden=p;t.allowWrap=s;t.slideCount=t.slides.length;t.slideWrapperWidth=t.slideCount*100+"%";t.slideWidth=100/t.slideCount+"%"});t.gotoSlide=function(i,u,f){return n(function(){var o=t.slides[i],n,e,s,c;t.isAnimating&&o||!o||(t.isAnimating=!0,typeof u=="undefined"&&(u=350),n=o.getBoundingClientRect(),e=r.get(0).getBoundingClientRect(),s=function(){t.isAnimating=!1;u>0&&r.trigger("haCarouselAtSlide",i);f&&f()},c=function(){t.slideWrapper.animate({left:(n.right-n.left)/(e.right-e.left)*-100*i+"%"},u,s)},l?h&&(!h||a)?c():(t.slideWrapper.css("left",(n.right-n.left)/(e.right-e.left)*-100*i+"%"),s()):c(),t.currentSlide=i)},0),t};t.gotoNextSlide=function(){var n=this.slideWrapper.children(".ha-carousel-slide"),t=!s||this.currentSlide+1<n.length?this.currentSlide+1:0;return this.gotoSlide(t),this};t.gotoPreviousSlide=function(){var n=this.slideWrapper.children(".ha-carousel-slide"),t=!s||this.currentSlide-1>=0?this.currentSlide-1:n.length-1;return this.gotoSlide(t),this};t.gotoNextSlideInDirection=function(n,t){var i=this.slideWrapper.children(".ha-carousel-slide");if(i.length!==0)return t=t||$(i[0]).width()/4,n>0&&n>t&&this.currentSlide>0?this.gotoPreviousSlide():n<0&&n<-t&&this.currentSlide<i.length-1?this.gotoNextSlide():this.gotoSlide(this.currentSlide),this.$apply(),this};t.gotoNearestSlide=function(){var t=this.slideWrapper.children(".ha-carousel-slide"),n=i.getChildrenPositions(r,t),u=i.closestInArray(n,0);return this.gotoSlide(n.indexOf(u)),this.$apply(),this};t.getAltText=function(){var n="",t=$(this.slide).children(".main-image");return t.length>0&&(n=t[0].dataset.alt),n};t.currentSlide=0;t.$emit("$haCarouselReady")}}}]);t.directive("haCarouselPaddles",["haConfig",function(n){return{restrict:"A",templateUrl:n.getTemplateUrl("ha-carousel-paddles-template.html")}}]);t.directive("haCarouselPagination",["haConfig",function(n){return{restrict:"A",templateUrl:n.getTemplateUrl("ha-carousel-pagination-template.html")}}]);t.directive("haCarouselPaginationWithPaddles",["haConfig",function(n){return{restrict:"A",templateUrl:n.getTemplateUrl("ha-carousel-pagination-with-paddles-template.html")}}])}(angular),function(n){"use strict";var t=n.module("haPassengerCountModule",[]);t.directive("haPassengerCount",[function(){return{restrict:"A",require:"ngModel",scope:{otherDropdownCount:"="},link:function(n,t,i,r){var u=function(t){var u=typeof n.otherDropdownCount=="undefined"?0:parseInt(n.otherDropdownCount,10),i=parseInt(t,10)+u,f=i>0&&i<8;return r.$setValidity("haPassengerCount",f),t};r.$parsers.unshift(u);r.$formatters.push(u);n.$watch("otherDropdownCount",function(){return u(r.$viewValue)})}}}])}(angular),function(n){"use strict";var t,i;try{t=n.module("haLowFareSearchModule")}catch(r){t=n.module("haLowFareSearchModule",["haPriceApiModule","ngAnimate","ngTouch"])}i=!1;t.directive("haPriceChart",["haPriceApiService","$animate","haConfig",function(n,t,r){var s=.33,h=331,u=25,f=15,c=1e3,e,l="/Book/home?searchDetails=",o=function(r){function v(){r.selectedPrice={date:new Date(r.tripData.departureDate),price:0};r.currentDate=new Date(r.selectedPrice.date);r.currentDate.setDate(r.currentDate.getDate()-parseInt(u/2))}function y(n){for(var t,u,i=0;i<n.length;i++)t=n[i],u=new Date(t.DepartDate),u.getTime()===r.selectedPrice.date.getTime()&&(r.selectedPrice.price=t.Price),r.buffer[u.getTime()]={price:t.Price,originalDate:t.date}}function o(){var h=[],f,n,e,o,i;for(r.minPrice=Number.POSITIVE_INFINITY,r.maxPrice=Number.NEGATIVE_INFINITY,f=0;f<u;f++)n=new Date(r.currentDate),n.setDate(r.currentDate.getDate()+f),e=new Date(n),e.setDate(n.getDate()+parseInt(r.tripData.tripLength)),o={date:n,returnDate:e},r.buffer[n.valueOf()]&&(i=r.buffer[n.valueOf()].price,i&&(r.minPrice=Math.min(r.minPrice,i),r.maxPrice=Math.max(r.maxPrice,i)),o.price=i),h.push(o);r.minPrice=Math.min(r.minPrice,r.selectedPrice.price);r.maxPrice=Math.max(r.maxPrice,r.selectedPrice.price);r.maxPrice+=Math.round(r.maxPrice*s);r.visible=h;w();window.setTimeout(function(){t.enabled(!0)},0)}function w(){for(var n=0;n<r.visible.length;n++)r.visible[n].price&&(r.visible[n].ratio=r.visible[n].price===r.minPrice&&r.visible[n].price===r.maxPrice?1:r.visible[n].price/r.maxPrice);r.selectedPrice.ratio=Math.min(r.selectedPrice.price/r.maxPrice,1)}function b(n){for(var i,t={startDate:undefined,days:undefined},e=!1,o=-f;o<u+f;o++)if(i=new Date(r.currentDate),n<0&&i.setDate(i.getDate()+u),i.setDate(i.getDate()+o*n),r.buffer[i.valueOf()])e&&(e=!1);else if(e)t.days++;else if(t.startDate){t.startDate=new Date(r.currentDate);t.startDate.setDate(r.currentDate.getDate()-f);t.days=u+2*f;break}else t.startDate=i,t.days=1,e=!0;return t}function k(t){var i=b(t);r.moving=!1;i.startDate&&(r.loading=!0,n.fetchPrices(a(i.startDate),t).success(function(n){n.IsSuccess&&(y(n.LowFareTripResponseList),o());r.loading=!1}));r.$apply()}function p(){var i;r.preventLeft=!1;r.preventRight=!1;r.endOfMonthIndex=null;var u=[],n=r.visible[0].date,t={month:n.getMonth(),year:n.getFullYear(),days:1};for(i=1;i<r.visible.length;i++)n=r.visible[i].date,n.getMonth()!==t.month?(u.push(t),r.endOfMonthIndex=i-1,t={month:n.getMonth(),year:n.getFullYear(),days:1}):t.days++,n<=Date.now()&&(r.preventLeft=!0),g(new Date,n)>=h&&(r.preventRight=!0);u.push(t);r.visibleMonths=u}function a(n){var t="";return t+=("0"+(n.getMonth()+1)).slice(-2)+"/",t+=("0"+n.getDate()).slice(-2)+"/",t+n.getFullYear()}function g(n,t){var i=n.getTime(),r=t.getTime(),u=r-i;return Math.round(u/864e5)}r.minPrice=Number.POSITIVE_INFINITY;r.maxPrice=Number.NEGATIVE_INFINITY;v();r.buffer={};r.visibleMonths=[];r.endOfMonthIndex=undefined;r.moving=!1;r.move=function(n){if(!i){r.moving=!0;i=!0;r.currentDate.setDate(r.currentDate.getDate()+n);var t=n/Math.abs(n);window.clearTimeout(e);e=window.setTimeout(function(){k(t)},c);o();p()}};var d=["januarytext","februarytext","marchtext","apriltext","maytext","junetext","julytext","augusttext","septembertext","octobertext","novembertext","decembertext"];r.monthFilter=function(n){return r.sitecoreStrings[d[n]]};r.barClicked=function(n){var t=["o="+r.tripData.origin,"d="+r.tripData.destination,"dd="+a(n.date),"a="+r.tripData.adultCount,"c="+r.tripData.childCount,"rd="+a(n.returnDate),"tt="+r.tripData.tripType];window.location.href=l+t.join(";")};r.$watch("results",function(n){n&&(t.enabled(!1),r.buffer={},v(),y(n),o(),p())})};return o.$inject=["$scope"],{restrict:"A",scope:{tripData:"=",sitecoreStrings:"=",sitecoreStringsLoaded:"=",results:"=",loading:"=",error:"="},controller:o,templateUrl:r.getTemplateUrl("ha-price-chart-base-template.html")}}]);t.animation(".month-animation",function(){return{enter:function(n,t){n.css({opacity:0});n.delay(500).animate({opacity:1},{complete:t})}}});t.animation(".price-item-animation",function(){return{enter:function(n,t){if(n.hasClass("first-item")){var r=n.css("margin-left");return n.css({"margin-left":0}),n.animate({"margin-left":r},{easing:"linear",duration:500,complete:t}),function(){n.css({"margin-left":""});i=!1}}n.animate({"background-color":"transparent"},{duration:500,complete:t})},leave:function(n,t){if(n.animate({"margin-left":0},{easing:"linear",duration:500,complete:t}),n.hasClass("first-item")){var r=n.nextAll(".first-item").first();return r.css({"margin-left":0}),function(){r.css({"margin-left":""});i=!1}}}}})}(angular),function(n){"use strict";var t=n.module("haDatepickerModule",[]);t.directive("haDatepicker2",["$rootScope","haTemplateCache","haConfig","$filter","$locale","$compile",function(n,t,i,r,u,f){return{require:"ngModel",restrict:"A",scope:!0,link:function(t,i,e,o){function y(){c=!1;$(document.body).off("mouseup blur",y)}function l(){if(n.isMobile){i.select();return}document.activeElement!==i[0]&&i.focus().select()}function p(n){return n.valueOf()>=s.range_start&&n.valueOf()<=s.range_end}function w(n){return b(n)?"":r("date")(n,s.display)}function b(n){return!n||!moment.isMoment(n)&&!(n instanceof Date)||isNaN(n)}var a=i.attr("autocomplete","off").attr("ha-datepicker2"),s=t.$eval(a)||{},v,c;s.format=s.format||"MM/DD/YYYY";s.display=s.display||"EEEE, "+u.DATETIME_FORMATS.shortDate;var k=$(i[0].form),d=t.$new(),g='<div ha-calendar="'+a+'" ha-calendar-model="'+e.ngModel+'"><\/div>',nt=f(g)(d),h=$('<div class="datepicker">').click(l).insertAfter(i).append(nt);i[0].name==="_"&&i.attr("name",null);n.isMobile&&i.attr("readonly","readonly");i.on("focus",function(){h.css("top",i.position().top+i.outerHeight()+"px");h.toggle(!0);i.addClass("open");clearTimeout(v);i.val(o.$viewValue||"").select()});i.on("blur",function(){c||(v=setTimeout(function(){h.toggle(!1);i.removeClass("open");o.$valid&&i.val(o.$modelValue?w(o.$modelValue):"")},200))});h.on("mousedown",function(){c=!0;$(document.body).on("mouseup blur",y)});t.$on("prev",l);t.$on("next",l);t.$on("select",function(){s.next!==!1&&setTimeout(function(){if(s.next)return $(s.next).focus();var t=k.find(":input:visible:enabled:not(button.prev,button.next)"),r=t.eq(t.index(i)+1);n.isMobile&&i.blur();r.focus()},10)});o.$parsers.push(function(n){var i,t,r,u;if(n&&typeof n=="string"&&!n.match(/^\d{2}\/\d{2}\/\d{4}$/)){for(i=n.match(/\d+/g),t=0;t<2&&t<i.length;t++)i[t].length===1&&(i[t]="0"+i[t]);n=i.join("/")}return r=n instanceof Date?moment(n):moment(n,s.format,!0),u=!n||r.isValid()&&p(r),o.$setValidity("date",u),u&&n?r.toDate():undefined});o.$formatters.push(function(n){var t=!n||!b(n)&&p(n);return o.$setValidity("date",t),t&&n&&!i.is(":focus")&&setTimeout(function(){i.val(w(n))},50),t&&n?moment(n).format(s.format):""})}}}]);t.directive("haRangeDatepicker",["$parse","haSitecoreStrings",function(n,t){return{restrict:"A",link:{pre:function(i,r,u){function h(n){return $.extend({},f,{range_start:moment(f.range_start),range_end:moment(f.range_end),calendarHeading:n?f.return_cal_title:f.depart_cal_title,isReturn:n})}function c(t){var r=n(t);return{get:r.bind(r,i),set:r.assign.bind(r,i)}}function v(n){var t=e.end.get(),r=e.start.get(),u,f;return t&&r&&i.tripType===2&&n.isBefore(t)&&n.isAfter(r)?"between":(u=r&&n.isSame(r),f=t&&n.isSame(t),u&&f)?void 0:u?"start":f&&i.tripType===2?"end":void 0}var o=t("BookingWidget.departdate"),s=t("BookingWidget.returndate"),f;r.context.textContent&&r.context.textContent.length>0&&(o=r.context.textContent.split("\n")[4].replace(",",""),s=r.context.textContent.split("\n")[13].replace(",",""));f=$.extend(!0,{calendars:2,viewing:moment().startOf("month"),namespace:"",format:"MM/DD/YYYY",range_start:moment().startOf("day"),range_end:moment().add(331,"days"),depart_cal_title:o,return_cal_title:s,rangeRender:function(n){n.find("td[date]").removeClass("start end between").each(function(){var n=$(this),i=moment(n.attr("date"),"YYYY-MM-DD"),t=v(i);t&&n.addClass(t)})}},i.$eval(u.haRangeDatepicker));i[f.namespace+"_configs"]={start:h(!1),end:h(!0)};var l=r.find(f.start).attr("ha-datepicker2",f.namespace+"_configs.start").attr("ng-model"),a=r.find(f.end).attr("ha-datepicker2",f.namespace+"_configs.end").attr("ng-model"),e={start:c(l),end:c(a)};i.$watch(l,function(n){var t,i;n&&(n=moment(n),t=e.end.get(),t&&n.isAfter(t)&&e.end.set(undefined),i=n.month(),n.year()>f.viewing.year()&&(i+=12),i>f.viewing.month()?f.viewing.year(n.year()).month(n.month()-1):f.viewing.year(n.year()).month(n.month()));f.viewing.add(1,"ms")});i.$watch(a,function(n){if(n){n=moment(n);var t=e.start.get();t&&n.isBefore(t)&&e.start.set(undefined)}f.viewing.add(1,"ms")})}}}}]);t.directive("haDatepicker",["haTemplateCache","haConfig",function(n,t){return n.get(t.getTemplateUrl("ha-calendar2.html")),n.get(t.getTemplateUrl("ha-booking-day-template.html")),n.get(t.getTemplateUrl("ha-datepicker-day-template.html")),{templateUrl:t.getTemplateUrl("ha-datepicker.html"),restrict:"A",scope:{label:"@",eyebrow:"@",placeholder:"@",name:"@",inputModel:"=",monthsBackward:"=",monthsForward:"=",monthsToShow:"=",dayTemplate:"@",errorMessage:"@",pastDisabled:"@",futureDisabled:"@"},link:function(n,t,i){function r(){$("body").off("click.closeCalendar");$("body").on("click.closeCalendar",function(t){var i=$(t.target);!n.calendarOpen||n.calendarOpen&&i.closest("[ha-datepicker]").length||i.closest(".calendarPopupWrap").length>0||i.is(".calendarPopupWrap")||($("body").off("click.closeCalendar"),n.currentDateChoice="",n.calendarOpen=!1,n.$digest())})}n.calendarOpen=!1;n.monthsToShow=n.monthsToShow||1;n.pastDisabled=i.hasOwnProperty("pastDisabled");n.futureDisabled=i.hasOwnProperty("futureDisabled");n.dayTemplate=n.dayTemplate||"ha-datepicker-day-template.html";n.required=!1;i.$observe("required",function(){i.hasOwnProperty("required")&&(n.required=!0)});n.$on("dateInputFocused",function(){n.calendarOpen=!0;r()});n.$on("setDate",function(t,i){n.calendarOpen&&(n.inputModel=i||"",n.$apply())});n.$watch("inputModel",function(){n.calendarOpen=!1});i.$observe("eyebrow",function(t,i){t!==i&&(n.eyebrow=t)});i.$observe("label",function(t,i){t!==i&&(n.label=t)});i.$observe("placeholder",function(t,i){t!==i&&(n.placeholder=t)})}}}]);t.directive("haDatepickerInput",["haTemplateCache","haConfig",function(n,t){return n.get(t.getTemplateUrl("ha-calendar2.html")),n.get(t.getTemplateUrl("ha-booking-day-template.html")),{templateUrl:t.getTemplateUrl("ha-datepicker-input.html"),scope:{inputModel:"=",calendarOpen:"=",currentDateChoice:"=",inputName:"@name",label:"@",eyebrow:"@",placeholder:"@",disabled:"=",ngRequired:"=",errorMessage:"="},link:function(n,t,i){n.onFocus=function(){n.$emit("dateInputFocused",t)};n.isActive=function(){return n.calendarOpen};i.$observe("eyebrow",function(t,i){t!==i&&(n.eyebrow=t)});i.$observe("label",function(t,i){t!==i&&(n.label=t)});i.$observe("placeholder",function(t,i){t!==i&&(n.placeholder=t)})}}}])}(angular),function(n){"use strict";var t=n.module("haNeatFormsModule",[]);t.directive("haNeatForms",["haUtils","haDateUtils","$window","haCitiesSvc","$filter","localShortDateFilter","$timeout","haConfig","haSitecoreStrings","$log",function(n,t,i,r,u,f,e,o,s,h){return{templateUrl:o.getTemplateUrl("ha-neat-forms-template.html"),restrict:"A",scope:{formType:"@",onMauve:"@"},link:function(t,i,f){function o(n){if(!t.strings.departdate)return"";var i=t.strings.departdate,r=t.strings.returndate;return t.model.packageType.indexOf("A")<0&&f.formType==="hotels"&&(i=t.strings.checkintext,r=t.strings.checkouttext),n!=="returnDate"?i:r}function v(){var i=0,r=!1,n;if(f.formType==="hotels")r=!0;else{for(n=0;n<t.model.rooms.length;n++)i+=t.model.rooms[n].adultCount,i+=t.model.rooms[n].child.length;i>=1&&i<=6&&(r=!0)}return r}function y(){for(var i,u=0,r=0,f=!1,n=0;n<t.model.rooms.length;n++)for(r+=t.model.rooms[n].adultCount,i=0;i<t.model.rooms[n].child.length;i++)t.model.rooms[n].child[i].age>=12?r+=1:t.model.rooms[n].child[i].seat==="Lap"&&(u+=1);return u<=r&&(f=!0),f}function a(n){var i=n.substr(0,10),t=i.split("-");return new Date(t[0],t[1]-1,t[2])}var e,c,l;t.language=$language;t.Error="";t.passengerOptions=[1,2,3,4,5,6];t.childPassengerOptions=[0,1,2,3,4,5,6];t.childPassengerAge=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17];t.roomOptions=[];t.packageTimes=[{name:s("BookingWidget.anytime"),val:"Anytime"},{name:s("BookingWidget.morning"),val:"Morning"},{name:s("BookingWidget.noon"),val:"Noon"},{name:s("BookingWidget.evening"),val:"Evening"},{name:"12:00 am",val:"TwelveAm"},{name:"1:00 am",val:"OneAm"},{name:"2:00 am",val:"TwoAm"},{name:"3:00 am",val:"ThreeAm"},{name:"4:00 am",val:"FourAm"},{name:"5:00 am",val:"FiveAm"},{name:"6:00 am",val:"SixAm"},{name:"7:00 am",val:"SevenAm"},{name:"8:00 am",val:"EightAm"},{name:"9:00 am",val:"NineAm"},{name:"10:00 am",val:"TenAm"},{name:"11:00 am",val:"ElevenAm"},{name:"12 Noon",val:"Noon"},{name:"1:00 pm",val:"OnePm"},{name:"2:00 pm",val:"TwoPm"},{name:"3:00 pm",val:"ThreePm"},{name:"4:00 pm",val:"FourPm"},{name:"5:00 pm",val:"FivePm"},{name:"6:00 pm",val:"SixPm"},{name:"7:00 pm",val:"SevenPm"},{name:"8:00 pm",val:"EightPm"},{name:"9:00 pm",val:"NinePm"},{name:"10:00 pm",val:"TenPm"},{name:"11:00 pm",val:"ElevenPm"}];t.getMediaImage=n.getImageFromSiteCoreString;t.language==="en"&&(t.packageTimes=t.packageTimes.map(function(n){if(n.val==="Anytime")n.val=362;else if(n.val==="Morning")n.val=361;else if(n.val==="Noon")n.val=721;else if(n.val==="Evening")n.val=1081;else{var t=2;n.name.indexOf(":")===1&&(t=1);n.val=n.name.substr(0,t)+n.name.substr(-2).toUpperCase()}return n}));t.tripType=2;t.legs=[];t.strings={};s.get("BookingWidget").then(function(n){var i,r;if(t.strings=n,f.formType==="hotels"){for(t.maxRooms=8,t.model.neatformbuttontext=t.strings.bookhotelbuttontext,t.model.dynamicDestinationText=t.strings.destinationtext,t.model.dynamicDepartText=t.strings.checkintext,t.model.dynamicReturnText=t.strings.checkouttext,t.model.thirdPartyPartnerImage=t.onMauve==="true"?t.strings.bghotelsthirdpartypartnerimage:t.strings.nobghotelsthirdpartypartnerimage,i=0;i<t.maxRooms;i++)t.roomOptions[i]=i+1;t.model.enableHelpLink=!0;t.strings.vacationrentalshelpurl||(t.model.enableHelpLink=!1)}else if(f.formType==="packages")for(t.maxRooms=3,t.model.neatformbuttontext=t.strings.continuebuttontext,t.model.dynamicDestinationText=t.strings.to,t.model.dynamicDepartText=t.strings.departtext,t.model.dynamicReturnText=t.strings.returntext,t.model.thirdPartyPartnerImage=t.onMauve==="true"?t.strings.bgpackagesthirdpartypartnerimage:t.strings.nobgpackagesthirdpartypartnerimage,r=0;r<t.maxRooms;r++)t.roomOptions[r]=r+1});t.model={adultCount:1,childCount:0,roomCount:1,rooms:[{adultCount:1,childrenCount:0,child:[]}],departDate:"",returnDate:"",originCity:"",destinationCity:"",packageType:"",airClass:"EconomyClass",fromTime:t.packageTimes[0],toTime:t.packageTimes[0],formType:t.formType,onMauve:t.onMauve,neatforms_datepicker_config:{start:"[name=_FromDate]",end:"[name=_ToDate]",depart_cal_title:o("departDate"),return_cal_title:o("returnDate"),namespace:"neatforms",onRender:function(n){n.addClass("double-wide")}}};t.$on("airportChanged",function(){t.model.packageType.indexOf("A")>=0&&t.model.originCity&&t.model.originCity.Code&&t.model.destinationCity&&t.model.destinationCity.Code&&(t.legs[0]={origin:{Code:t.model.originCity.Code},destination:{Code:t.model.destinationCity.Code}},t.$broadcast("airport changed"))});t.$watch("model.rooms",function(){t.Error!==""&&(t.Error="")},!0);f.formType==="hotels"?t.model.packageType="H":f.formType==="packages"&&(t.model.packageType="AH",t.$watch(function(n){if(n.model)return n.model.packageType},function(n){n&&n.indexOf("A")<0?(t.model.dynamicDestinationText=t.strings.destinationtext,t.model.dynamicDepartText=t.strings.checkintext,t.model.dynamicReturnText=t.strings.checkouttext):(t.model.dynamicDestinationText=t.strings.to,t.model.dynamicDepartText=t.strings.departtext,t.model.dynamicReturnText=t.strings.returntext)}));e=n.getFlightQueryModelCookie();e&&(t.model.adultCount=e.AdultCount||1,t.model.childCount=e.ChildCount||0,e.FlightSearchSegmentList[0]&&(c=e.FlightSearchSegmentList[0].OriginCityCode,l=e.FlightSearchSegmentList[0].DestinationCityCode,r.getCityByCode(c).then(function(n){t.model.originCity=n}),r.getCityByCode(l).then(function(n){t.model.destinationCity=n}),t.model.departDate=a(e.FlightSearchSegmentList[0].DepartureDate)),e.FlightSearchSegmentList[1]&&(t.model.returnDate=a(e.FlightSearchSegmentList[1].DepartureDate)));t.updateChildren=function(n,i){var r,u,f;if(i>t.model.rooms[n].child.length)for(r=i-t.model.rooms[n].child.length,u=0;u<r;u++)t.model.rooms[n].child.push({});else if(r=t.model.rooms[n].child.length-i,r!==0)for(f=0;f<r;f++)t.model.rooms[n].child.pop()};t.updateRooms=function(n){var i,r,u;if(n>t.model.rooms.length)for(i=n-t.model.rooms.length,r=0;r<i;r++)t.model.rooms.push({adultCount:1,childrenCount:0,child:[]});else if(i=t.model.rooms.length-n,i!==0)for(u=0;u<i;u++)t.model.rooms.pop()};t.clearRooms=function(){t.model.roomCount=1;t.model.rooms=[{adultCount:t.model.rooms[0].adultCount,childrenCount:t.model.rooms[0].childrenCount,child:t.model.rooms[0].child}]};t.formatString=function(t,i){return n.formatDynamicString(t,i)};t.setForm=function(n){t.form=n};t.bizClassAvailable=function(){return typeof t.model.destinationCity=="object"&&+t.model.destinationCity.Market==3?!0:typeof t.model.originCity=="object"&&+t.model.originCity.Market==3?!0:!1};t.submitForm=function(n){t.Error="";t.language==="cn"||t.language==="kr"?t.submitNeatForm(n):t.submitExpediaForm(n)};t.enableHotelAndCarTab=function(){return s("BookingWidget.hotelandcartext")==null||s("BookingWidget.hotelandcartext")===""||s("BookingWidget.hotelandcartext")==="[BookingWidget.hotelandcartext]"?!1:!0};t.enableHotelTab=function(){return s("BookingWidget.hotelstext")==null||s("BookingWidget.hotelstext")===""||s("BookingWidget.hotelstext")==="[BookingWidget.hotelstext]"?!1:!0};t.enableVacationTab=!1;s("BookingWidget.enablevacationrentals")==="1"&&(t.enableVacationTab=!0);t.submitNeatForm=function(i){var a,c,l,e,w,o;i.preventDefault();t.neatFormSubmitAttempt=!0;c=t.model.destinationCity;typeof t.model.destinationCity=="object"&&(c=t.model.destinationCity.LongDescription,a=t.model.destinationCity.Code);typeof t.model.originCity=="object"&&(l=t.model.originCity.Code);var v=u("localShortDate")(t.model.departDate,"en"),y=u("localShortDate")(t.model.returnDate,"en"),r={DD:t.model.packageType!=="H"?s("BookingWidget.neatgroupddparam")||"HAWAIIANAIR":s("BookingWidget.hotelneatgroupddparam")||"HAWAIIANAIR",combinationType:t.model.packageType,adultsNum:t.model.adultCount,doSearch:"T"},p=Number(t.model.childCount);if(p>0)for(e=0;e<p;e++)w="minorAge"+(e+1),r[w]=6;f.formType==="hotels"?(r.toLocation=t.isJP()?t.model.destinationCity.SearchTags.split(",").slice(0,2).join(","):c,r.hotelFromDate=v,r.hotelToDate=y,r["WT.mc_id"]=n.webtrends.token("HotelWidget")):(r.toLocation=a,r.fromLocation=l,r.fromDate=v,r.toDate=y,r.fromTime=t.model.fromTime.val,r.toTime=t.model.toTime.val,r["WT.mc_id"]=n.webtrends.token("PackageWidget"));t.model.packageType.indexOf("H")>=0&&(r.roomsNum=t.model.roomCount);t.model.packageType.indexOf("A")>=0&&(r.airClass=t.model.airClass,r.fromLocation=l);f.formType==="packages"&&($language==="en-au"||$language==="en-nz")&&(r.referrerId="Intl");t.form.$valid?(f.formType==="packages"?(r.DD=s("BookingWidget.neatgroupddparam")||"HAWAIIANAIR",o=s("BookingWidget.searchpackagesurl")+n.createQueryString(r)):o=s("BookingWidget.bookhotelurl")+n.createQueryString(r),h.debug(o),location.href=o):t.Error=s("BookingWidget.pleasecorrecttheerrorsbelow")};t.submitExpediaForm=function(i){var r,c,p,e,ut,o,l,a,w;f.formType==="hotels"&&t.model.packageType==="HC"&&(f.formType="packages");i.preventDefault();t.neatFormSubmitAttempt=!0;var b=v(),k=y(),u={},d=!t.model.departDate?undefined:t.model.departDate.YYYY_MM_DD(),g=!t.model.returnDate?undefined:t.model.returnDate.YYYY_MM_DD(),nt=!t.model.destinationCity?undefined:t.model.destinationCity.Code,ft=!t.model.originCity?undefined:t.model.originCity.Code;f.formType==="hotels"?u.cityName=nt||!!t.model.destinationCity&&!!t.model.destinationCity.DisplayName?t.model.destinationCity.DisplayName:"":(u.FromAirport=ft,u.Destination=nt,u.ToTime=t.model.toTime.val,u.FromTime=t.model.fromTime.val);t.model.packageType.indexOf("H")>=0&&(u.NumRoom=t.model.roomCount);t.model.packageType.indexOf("A")>=0&&(u.cabinClass=t.model.airClass.substr(0,1).toLowerCase());var tt=0,it=0,rt=!1;for(r=0;r<t.model.rooms.length;r++)for(tt+=t.model.rooms[r].child.length,it+=t.model.rooms[r].adultCount,f.formType==="hotels"?c="NumAdult"+(r+1):t.model.packageType==="AC"?(c="NumAdult",p="NumChild"):(c="NumAdult-Room"+(r+1),p="NumChild-room"+(r+1)),u[c]=t.model.rooms[r].adultCount,f.formType==="packages"&&(u[p]=t.model.rooms[r].child.length),e=0;e<t.model.rooms[r].child.length;e++)ut=f.formType==="hotels"?"Rm"+(r+1)+"Child"+(e+1)+"Age":t.model.packageType==="AC"?"Child"+(e+1)+"Age":"Room"+(r+1)+"-Child"+(e+1)+"Age",t.model.rooms[r].child[e].seat==="Seat"&&(rt=!0),u[ut]=rt&&t.model.rooms[r].child[e].age<2&&t.model.rooms[r].child[e].seat==="Seat"?2:t.model.rooms[r].child[e].age;f.formType==="packages"&&(u.NumAdult=it,u.NumChild=tt);switch(t.model.packageType){case"AH":o="FlightHotel";break;case"AHC":o="FlightHotelCar";break;case"AC":o="FlightCar";break;case"HC":o="HotelCar";break;case"VR":o="VacationRental";break;default:o="FlightHotel"}u.mdpcid=f.formType==="hotels"?n.webtrends.tokenV2("HTLWIDGET.HOTEL"):f.formType==="packages"?typeof campaignid_0030!="undefined"?campaignid_0030:n.webtrends.tokenV2("PKGWIDGET.PACKAGE"):n.webtrends.tokenV2("FLTWIDGET.PACKAGE");t.form.$valid&&b&&k?(w=n.createQueryString(u),f.formType==="packages"?(a=s("BookingWidget.searchpackagesurl"),l=a+o+"/"+d+"/"+g+w):(a=s("BookingWidget.bookhotelurl"),l=a+d+"/"+g+w),h.debug(l),location.href=l):(t.Error=s("BookingWidget.pleasecorrecttheerrorsbelow"),b||(t.Error=s("BookingWidget.InvalidPackagePassengerCount")),k||(t.Error=s("BookingWidget.LapChildErrorText")))}}}}])}(angular),function(n){"use strict";var t=n.module("haCartrawlerFormsModule",[]);t.directive("haCartrawlerForms",["haUtils","haDateUtils","$window","haCitiesSvc","$timeout","haConfig","haSitecoreStrings","$log","haFeatureFlags","haEncryptionService","$q",function(n,t,i,r,u,f,e,o,s,h,c){return{templateUrl:f.getTemplateUrl("ha-cartrawler-forms-template.html"),restrict:"A",scope:{onMauve:"@"},link:function(t,i){function g(){var n,i=t.scContent.searchshuttlesurl,h=window.location.href.toLowerCase(),r,u,f,e,s;r=h.match(/book/i)?t.scContent.cartrawlerclientidbookpage:t.scContent.cartrawlerclientidhomepage;n={clientID:r,residenceID:t.scContent.cartrawlerresidencyidparam,curr:t.scContent.cartrawlercurrencycodeparam,adults:t.model.shuttlePassengers,oneway:Boolean(t.tripType===1),pickupName:t.model.pickUpLocation.DisplayName};u=moment(t.model.departDate).format("YYYY-MM-DD");f="T"+d(t.model.pickUpHour,t.model.pickUpMinute);n.pickupDateTime=u+f;t.model.pickUpLocation.Code?(n.countryID=t.model.pickUpLocation.CountryCode,n.pickupIATACode=t.model.pickUpLocation.Code):t.model.pickUpLocation.geocode&&(n.countryID=t.model.pickUpLocation.countryCode||"US",n.pkLat=t.model.pickUpLocation.geocode.lat,n.pkLng=t.model.pickUpLocation.geocode.long);t.model.dropOffLocation&&t.model.dropOffLocation.DisplayName&&(n.returnName=t.model.dropOffLocation.DisplayName,t.model.dropOffLocation.Code?n.returnIATACode=t.model.dropOffLocation.Code:t.model.dropOffLocation.geocode&&(n.rtLat=t.model.dropOffLocation.geocode.lat,n.rtLng=t.model.dropOffLocation.geocode.long),t.tripType===2&&(e=moment(t.model.returnDate).format("YYYY-MM-DD"),s="T"+d(t.model.returnHour,t.model.returnMinute),n.returnDateTime=e+s));i=o(i,n);window.location.href=i}function nt(){var i,a,r,p,w;window.digitalData.rentalCarPayment={};a=t.model.carPricing.toLowerCase()==="dollars"?"Dollars":t.model.carPricing.toLowerCase()==="miles"?"Miles":"Miles/Dollars";document.body.dispatchEvent(new CustomEvent("StandaloneCarBooking",{detail:{name:"StandaloneCarBooking",timestamp:(new Date).getTime(),paid:a,requestFrom:"StandaloneBooking"}}));var n=t.scContent.searchcarrentalsurl,s="AmazonCarRentalKey",y=t.model.destinationCity.Code,k=t.model.carDropoff?t.model.carDropoff.Code:y,l=t.model.pickupTime;if(+l==24&&(l=10),r=t.model.dropoffTime,+r==24&&(r=11),p=tt(),i={ops:"spec",srch:"car",eapid:"11428-30001",GOTO:"CARSEARCH",lang:t.scContent.cartrawlerlanguageparam,rfrr:"-34980",age:"30",pickupIATACode:y,returnIATACode:k,pickupYear:t.model.departDate instanceof Date?t.model.departDate.getFullYear():"",pickupMonth:t.model.departDate instanceof Date?t.model.departDate.getMonth():"",pickupDate:t.model.departDate instanceof Date?t.model.departDate.getDate():"",pickupHour:l,pickupMinute:"00",returnYear:t.model.returnDate instanceof Date?t.model.returnDate.getFullYear():"",returnMonth:t.model.returnDate instanceof Date?t.model.returnDate.getMonth():"",returnDate:t.model.returnDate instanceof Date?t.model.returnDate.getDate():"",returnHour:r,returnMinute:"00",currency:t.scContent.cartrawlercurrencycodeparam||"USD",residencyId:t.scContent.cartrawlerresidencyidparam||"US",c:t.scContent.cartrawlerlanguageparam,clientID:p},t.model.carPricing.toLowerCase()==="dollars"&&t.model.carDiscount&&t.model.carDiscount.selected&&t.model.discountCode){var u=t.model.discountCode.avisWizard,f=t.model.discountCode.budgetFastbreak,e=t.model.discountCode.paylessPerks;if(t.encryptionEnabled){var d=u&&u!==""?h.EncryptString(u,s):v(),g=f&&f!==""?h.EncryptString(f,s):v(),nt=e&&e!==""?h.EncryptString(e,s):v(),it=[d,g,nt];c.allSettled(it).then(function(t){var r=b(t[0].value,t[1].value,t[2].value);n=o(n,i,r);window.location.href=n})}else w=b(u,f,e),n=o(n,i,w),window.location.href=n}else n=o(n,i),window.location.href=n}function tt(){var i=window.location.href.toLowerCase(),n=t.model.carPricing&&t.model.carPricing.toLowerCase()==="dollars",r=i.match(/book/i);return r?n?t.scContent.cartrawlercarsclientidbookpage:t.scContent.cartrawlercarsclientidmilesbook:n?t.scContent.cartrawlercarsclientidhomepage:t.scContent.cartrawlercarsclientidmileshome}function v(){return new Promise(function(n){n("")})}function b(n,i,r){return{AV:{CORPORATE_RATE:t.model.discountCode.awd,MEMBERSHIP_NUMBER:n,PROMOTIONAL_CODE:t.model.discountCode.avisCoupon},BG:{CORPORATE_RATE:t.model.discountCode.bcd,MEMBERSHIP_NUMBER:i,PROMOTIONAL_CODE:t.model.discountCode.budgetCoupon},ZA:{CORPORATE_RATE:t.model.discountCode.pdn,MEMBERSHIP_NUMBER:r,PROMOTIONAL_CODE:t.model.discountCode.paylessCoupon}}}function o(t,i,r){var u=n.splitUrl(t);return u.params.length>0?t=u.url+n.createQueryString(i,r,u.params):t+=n.createQueryString(i,r),t}function k(n){var i=n.substr(0,10),t=i.split("-");return new Date(t[0],t[1]-1,t[2])}function d(n,t){var i=parseInt(n);return n.indexOf("pm")>-1&&i!==12&&(i+=12),i===12&&n.indexOf("am")>-1&&(i=0),n="0"+i,n.slice(-2)+":"+t+":00"}var y,l="https://maps.googleapis.com/maps/api/js?",f,a,u,p,w;for(l+="libraries=places&key=",l+=s.get("GoogleMapApiKey"),n.injectScriptDependency(i,l),t.scContent={},t.scDiscountContent={},t.scBookingContent={},t.Error="",t.showTabGroup=!1,t.model={transportType:"car",departDate:"",returnDate:"",originCity:"",destinationCity:"",onMauve:t.onMauve,transp_datepicker_config:{start:"[name=_TranspFromDate]",end:"[name=_TranspToDate]",depart_cal_title:"",return_cal_title:"",namespace:"cartrawler",onRender:function(n){t.tripType===2?n.addClass("double-wide"):n.removeClass("double-wide")}},dropOffLocation:"",shuttlePassengers:1,pickupTime:"24",dropoffTime:"24",carPricing:"dollars"},t.tripType=2,t.legs=[],t.shuttlePassengers=[],f=1;f<=7;f++)t.shuttlePassengers.push(f);t.encryptionEnabled=!1;e.get("CarTrawler").then(function(n){t.scContent=n;t.carPickUpTimes=t.scContent.cartimes.slice();t.carDropOffTimes=t.scContent.cartimes.slice();t.showTabGroup=t.scContent.enablervs||t.scContent.enableshuttles;t.model.thirdPartyPartnerImage=t.onMauve==="true"?t.scContent.bgcarsthirdpartypartnerimage:t.scContent.nobgcarsthirdpartypartnerimage;t.scContent.enableencryptionforvendorloyalty==="1"&&(t.encryptionEnabled=!0)});e.get("BookingWidget").then(function(n){t.scBookingContent=n;y=n.pleasecorrecttheerrorsbelow});t.showDiscountBanners=!1;e.get("CarRentalDiscountCode").then(function(n){t.scDiscountContent=n;var i=t.scDiscountContent.discountbanners;i&&(t.discountBanners=i.slice(),t.discountBanners&&t.discountBanners.length>0&&(t.showDiscountBanners=!0))});t.$emit("cartrawlerFormsLoaded");t.setCarPricing=function(n){t.model.carPricing=n;t.$broadcast("car pricing changed",t.model.carPricing)};t.setTripType=function(n){t.tripType=n;t.$broadcast("trip type changed",t.tripType)};t.$watch("model.transportType",function(n){n&&(n==="shuttle"?(t.setTripType(1),t.model.thirdPartyPartnerImage=t.onMauve==="true"?t.scContent.bgshuttlesthirdpartypartnerimage:t.scContent.nobgshuttlesthirdpartypartnerimage):(t.setTripType(2),t.model.thirdPartyPartnerImage=n==="rv"?t.onMauve==="true"?t.scContent.bgrvsthirdpartypartnerimage:t.scContent.nobgrvsthirdpartypartnerimage:t.onMauve==="true"?t.scContent.bgcarsthirdpartypartnerimage:t.scContent.nobgcarsthirdpartypartnerimage))});t.$on("airportOrAddressInputChanged",function(n,i){if(t.model.transportType==="shuttle"){var r=!0;(i.model.Code&&i.model.Code==="MKK"||i.model.Code==="LNY"||i.model.Code==="ITO")&&(r=!1);i.model.isAddress&&i.model.DisplayName.match(/\sLanai\,\s|Lanai\sCity\,|Molokai\,?\s|\sHoolehua\,\s|Ho\'olehua\,?\s|Kaunakakai\,?\s|\sHilo\,?\s/g)&&(r=!1);t.form[i.name].$setValidity("location",r);t.Error=r?"":t.scContent.shuttleservicenotavailabletext}});t.submitButtonText=function(){if(t.scContent&&t.scContent.searchcarrentalstext)switch(t.model.transportType){case"shuttle":return t.scContent.searchshuttlestext;default:return t.scContent.searchcarrentalstext}else return""};t.updateDropOffTimes=function(){if(t.scContent.cartimes&&t.model.departDate&&t.model.returnDate)if(t.model.departDate.getTime()===t.model.returnDate.getTime()){var n=+t.model.pickupTime;n!==24?(t.carDropOffTimes=t.scContent.cartimes.slice(n+1),+t.model.dropoffTime<=n&&(t.model.dropoffTime=String(n+1))):t.carDropOffTimes=t.scContent.cartimes.slice()}else t.carDropOffTimes=t.scContent.cartimes.slice()};t.$watch(function(n){if(n.model)return n.model.departDate},t.updateDropOffTimes);t.$watch(function(n){if(n.model)return n.model.returnDate},t.updateDropOffTimes);t.$watch(function(n){if(n.model)return n.model.pickupTime},t.updateDropOffTimes);a=function(){return t.model.departDate&&t.model.returnDate&&t.model.departDate.getTime()===t.model.returnDate.getTime()&&t.model.pickUpHour&&t.model.returnHour&&(parseInt(t.model.pickUpHour)>parseInt(t.model.returnHour)||t.model.pickUpHour===t.model.returnHour&&t.model.pickUpMinute&&t.model.returnMinute&&parseInt(t.model.pickUpMinute)>=parseInt(t.model.returnMinute))?!1:!0};t.$watchGroup(["model.pickUpHour","model.pickUpMinute","model.departDate"],function(){a()||(t.model.returnHour=t.model.returnMinute=undefined)});t.$watchGroup(["model.returnHour","model.returnMinute","model.returnDate"],function(){a()||(t.model.pickUpHour=t.model.pickUpMinute=undefined)});t.$watch("model.pickUpLocation",function(n){n&&t.model.dropOffLocation&&(n.placeId&&n.placeId===t.model.dropOffLocation.placeId?t.model.dropOffLocation=undefined:n.Name&&n.Name===t.model.dropOffLocation.Name&&(t.model.dropOffLocation=undefined))});t.$watch("model.dropOffLocation",function(n){n&&t.model.pickUpLocation&&(n.placeId&&n.placeId===t.model.pickUpLocation.placeId?t.model.pickUpLocation=undefined:n.Name&&n.Name===t.model.pickUpLocation.Name&&(t.model.pickUpLocation=undefined))});u=n.getFlightQueryModelCookie();u&&(u.FlightSearchSegmentList[0]&&(p=u.FlightSearchSegmentList[0].OriginCityCode,w=u.FlightSearchSegmentList[0].DestinationCityCode,r.getCityByCode(p).then(function(n){t.model.originCity=n}),r.getCityByCode(w).then(function(n){t.model.destinationCity=n}),t.model.departDate=k(u.FlightSearchSegmentList[0].DepartureDate)),u.FlightSearchSegmentList[1]&&(t.model.returnDate=k(u.FlightSearchSegmentList[1].DepartureDate)));t.setForm=function(n){t.form=n};t.submitCarForm=function(n){if(n.preventDefault(),!t.form.$valid){t.Error=y;return}t.Error="";t.model.transportType==="shuttle"?g():t.model.transportType==="car"&&nt()}}}}])}(angular),function(n){"use strict";var t=n.module("haPrimaryNavAccountMenuModule",[]);t.directive("haPrimaryNavAccountMenu",["haHttpService","haConfig","$compile","$timeout","haGlobals","$q","$rootScope",function(n,t,i,r,u,f,e){var o=function(t,o,s){function h(n){t.accountMenuIsOpen=n}function c(n){t.myTripsMenuIsOpen=n}if(t.theme=s.theme,window.returnUrlQs!==undefined&&!e.isMobile){t.retURL=window.returnUrlQs;$scs.get("Header.SignInText").then(function(n){t.signInText=n});$scs.get("Header.JoinNowText").then(function(n){t.joinNowText=n});t.navLoggedOut=!0;return}var l="/Header/GetMyAccountMenu/",a=f.defer();if(window.onunload=function(){a.resolve()},u("areaName",function(n){n&&(l+="?area="+n)}),n.GET(l,{timeout:a.promise}).success(function(n){o.replaceWith(i(n)(t));r(function(){u(["registrationUrl"],function(n){t.$root.registrationUrl=n})},0)}).error(function(){console.error("haPrimaryNavAccountMenu ajax call to /Header/GetMyAccountMenu/ failed")}),t.toggleAccountMenu=function(){t.accountMenuIsOpen?h(!1):h(!0)},t.toggleMyTripsMenu=function(){t.myTripsMenuIsOpen?c(!1):c(!0)},!t.$root.isMobile){$("html").on("click",function(n){t.myTripsMenuIsOpen&&!$(n.target).closest(".parent").hasClass("my-trips")&&r(function(){c(!1)});t.accountMenuIsOpen&&!$(n.target).closest(".parent").hasClass("my-account")&&r(function(){h(!1)})});$("body").delegate("a:not(.my-account)","focus",function(){t.accountMenuIsOpen&&r(function(){h(!1)})}).delegate("a:not(.my-trips)","focus",function(){t.myTripsMenuIsOpen&&r(function(){c(!1)})});$("body").on("keyup",function(n){n.keyCode===27&&(n.preventDefault(),t.myTripsMenuIsOpen&&r(function(){$("a.my-trips").first().focus();c(!1)}),t.accountMenuIsOpen&&r(function(){$("a.my-account").first().focus();h(!1)}))})}};return{restrict:"A",scope:!0,link:o,templateUrl:t.getTemplateUrl("ha-primary-nav-account-menu.html")}}])}(angular),function(n){"use strict";var t=n.module("haPrimaryNavAlertsModule",[]);t.directive("haPrimaryNavAlerts",["haHttpService","$compile","$location",function(n,t,i){var r=function(r,u){var f=i.absUrl(),e=f.indexOf("?")>-1?f.split("?")[1]:"",o="/Header/GetAlerts/";e!==""&&(o+="?"+e);n.GET(o).success(function(n){u.replaceWith(t(n)(r))}).error(function(){console.error("haPrimaryNavAlerts ajax call to /Header/GetAlerts/ failed")})};return{restrict:"A",scope:!0,link:r}}])}(angular),function(){"use strict";function n(n,r,u,f,e,o,s,h,c,l){i(n,r,u,f,e,o,s,h,c,l);t(s,l)}function t(n,t){n.get("Accessibility").then(function(n){var f=n.externallinkregex,e=n.subdomainexcludes,o=n.cssselector,s=n.externallinkmessage,r,u,i;try{r=new RegExp(f,"i");u=new RegExp(e,"i")}catch(h){t.error("invalid regex from sitecore for accessibility");return}(i=$(o),i.length)&&i.each(function(){var t=$(this),n=t.prop("href");n&&(!r.test(n)||u.test(n))&&t.append($('<span class="sr-only">{0}<\/span>'.format(s)))})})}function i(n,t,i,r,u,f,e,o,s,h){function it(){n.userTimeLeft>l?(n.myAccountAccess=window.location.href.search("dashboard"),n.userTimeLeft-=1e3):n.userTimeLeft===l?(n.showSessionTimeoutWarningModal(),n.userTimeLeft-=1e3):n.userTimeLeft<=l&&n.userTimeLeft>0?n.userTimeLeft-=1e3:n.stopSessionCounter();n.$digest()}function rt(n){window.location.href="/Book/Error?ErrorCode="+n}function w(){return o.restartUserSessionTime().then(function(t){t&&t.status===200&&t.data&&!isNaN(+t.data)?n.userTimeLeft=+t.data*6e4:rt("SessionExtendFailed")}).catch(function(n){h.error("ExtendSession API call Failed: ",n)})}var b=t.$switch("Global:EnableSessionTimeout"),k=t.$switch("Global:EnableSessionTimeoutBookingPath"),d=t.$switch("Global:EnableSessionTimeoutMyAccount"),a=/^\/book/i.test(location.pathname),v=/^\/my-account/i.test(location.pathname);if(n.showGlobalHeader=!0,b&&(!a||k)&&(!v||d)&&!/^\/$/.test(location.pathname)){if(a){if(/\/flights|\/home|\/activities-and-cruises|\/hotels|\/car-rentals|\/vacation-packages|\/confirmation|\/expertbooking/i.test(location.pathname))return;n.showGlobalHeader=!1}if(!v||!/\/login|\/hawaiianmiles|\/join-hawaiianmiles/i.test(location.pathname)){var c,y=!0,l,g="/book/shared/startover?redirect=myacount",nt="/book/shared/startover?redirect=home",tt="/Book/Home/Index",p="/my-account";n.userTimeLeft=0;n.myAccountAccess="";n.userTimeLeft=12e5;(a||v)&&e.get("SessionExpiration").then(function(n){l=parseInt(n.sessionseconds,10)*1e3;c=r(it,1e3,1e5,!1)});n.showSessionTimeoutWarningModal=function(){f(i.getTemplateUrl("ha-session-timeout-warning.html"),{id:"session-timeout-modal",backdrop:"true",modalLock:!0,scope:n,extendScope:{userTimeLeft:n.userTimeLeft},size:"modal-md"})};n.stopSessionCounter=function(){angular.isDefined(c)&&(r.cancel(c),c=undefined,y=!1)};n.resumeSession=function(){return w().then(function(){angular.isDefined(n.$modalCancel)&&n.$modalCancel()})};n.$on("$destroy",function(){n.stopSessionCounter()});t.$on("$locationChangeStart",function(t,i,r){/\#/.test(r)&&(n.myAccountAccess=window.location.href.search("dashboard"),y&&w())});n.accountPageRedirect=function(){n.isLoggedIn=!0;window.location.href=p};n.resetSession=function(){window.location.href=window.location.pathname===p?g:nt};n.restartBooking=function(){window.location.href=tt}}}}angular.module("haBodyExtensionModule",[]).directive("body",function(){return{restrict:"E",scope:!0,controller:n}});n.$inject=["$scope","$rootScope","haConfig","$interval","$q","haModal","haSitecoreStrings","haSessionTimeoutAPI","$location","$log"]}(),function(n){"use strict";var t=n.module("haAirportOrAddressInputModule",["haCitiesModule","ui.bootstrap.typeahead.ha"]);t.directive("haAirportOrAddressInput",["haConfig","$timeout","haCitiesSvc","$q","$parse","$log",function(n,t,i,r,u,f){return{templateUrl:n.getTemplateUrl("ha-airport-or-address-input-template.html"),restrict:"A",scope:{ngModel:"=",name:"@",label:"@",placeholder:"@",required:"@",disabled:"@"},link:function(n,t){function s(t){f.error(t);n.Error=t}function c(){google&&google.maps&&google.maps.places?(u=new google.maps.places.AutocompleteService,h=new google.maps.Geocoder,e=new google.maps.places.PlacesService($("#"+n.name+"-details")[0]),o={east:-66.828,north:49.0324,south:-39.4678,west:100.0187},n.Error=""):s("Google API service not yet loaded or is not linked")}function l(n){var t=r.defer();return u||c(),u.getPlacePredictions({input:n,bounds:o},function(n,i){i!==google.maps.places.PlacesServiceStatus.OK&&i!==google.maps.places.PlacesServiceStatus.ZERO_RESULTS&&t.reject("Google Places API status: "+i);var r=[];n&&n.length&&(r=n.slice());t.resolve(r)}),t.promise}function a(n){for(var i,r,f,t=0,u=n.address_components.length;t<u;t++)for(i=n.address_components[t],r=0,f=i.types.length;r<u;r++)if(i.types[r]==="country")return i.short_name;return""}function v(n){return i.getMatchingCities(n)}var u,e,o,h;n.getComboResultsForInput=function(n){var t=r.defer();return r.all([v(n),l(n)]).then(function(n){var i=[],e=n[0],f=n[1],r,u,o;if(e.length&&(e[0].firstAirportResult=!0,i=i.concat(e)),f.length){for(r=[],u=0,o=f.length;u<o;u++)r.push({DisplayName:f[u].description,isAddress:!0,placeId:f[u].place_id});r[0].firstPlacesResult=!0;r[0].isFromGoogle=!0;i=i.concat(r)}t.resolve(i)},function(n){t.reject(n)}),t.promise};n.onSelect=function(){n.ngModel.isAddress&&e.getDetails({placeId:n.ngModel.placeId},function(t,i){if(i==="OK"){var r=t.geometry.location.lat(),u=t.geometry.location.lng();n.ngModel.geocode={lat:r,long:u};n.ngModel.countryCode=a(t)}else s("PlacesService error:",i)});t.find('input[type="text"]').focus();n.$emit("airportOrAddressInputChanged",{model:n.ngModel,name:n.name})};n.onFocus=function(){n.$root.isMobile&&$("html, body").animate({scrollTop:t.offset().top-10})}}}}])}(angular),function(n){"use strict";var t=n.module("haHotelsInputModule",["haCitiesModule","ui.bootstrap.typeahead.ha"]);t.directive("haHotelsInput",["haConfig","haUtils","haCitiesSvc","$q","$log","$timeout",function(n,t,i,r,u,f){return{templateUrl:n.getTemplateUrl("ha-hotels-input-template.html"),restrict:"A",scope:{ngModel:"=",name:"@",label:"@",placeholder:"@",required:"@",disabled:"@"},link:function(n,e){function o(t){u.error(t);n.Error=t}function s(n){return i.getHotelCities(n)}function h(n){return i.getMatchingCities(n)}n.getComboResultsForInput=function(n){var i=r.defer();return r.all([h(n),s(n)]).then(function(n){var e=[],u=n[0],o=n[1],s,f,r,h;if(u&&u.length){for(u=t.removeDuplicatesFromArray(u,"DisplayName").slice(0,5),s=[],r=0,h=u.length;r<h;r++)s.push({DisplayName:u[r].DisplayName,IsHACity:u[r].IsHACity,Code:u[r].Code});s[0].firstAirportResult=!0;e=e.concat(s)}if(o&&o.length){for(f=[],r=0,h=o.length;r<h;r++)f.push({DisplayName:o[r].regionNames.fullName,isAddress:!0});f=t.removeDuplicatesFromArray(f,"DisplayName");f[0].firstPlacesResult=!0;e=e.concat(f)}i.resolve(e)},function(n){o(n);i.reject(n)}),i.promise};n.onSelected=function(t){n.ngModel=t;f(function(){n.focus()},0)};n.onSelect=function(){f(function(){n.focus()},0)};n.onClick=function(n){n.target.select()};n.onFocus=function(){n.$root.isMobile&&$("html, body").animate({scrollTop:e.offset().top-10})};n.pinClicked=function(){n.$emit("haWhereWeFlyPinClicked")};n.focus=function(){setTimeout(function(){e.find('input[type="text"]').focus()},0)}}}}])}(angular),function(n){"use strict";var t=n.module("haRVFormModule",[]);t.directive("haRvForm",["haConfig","haUtils","$log","$http",function(n,t,i,r){return{templateUrl:n.getTemplateUrl("ha-rv-form.html"),restrict:"A",link:function(n){function e(t){return t.countryCode===""?!0:n.model.rvCountry&&n.model.rvCountry.length?t.countryCode===n.model.rvCountry?!0:!1:!0}function u(n){i.error(n)}function o(){if(!n.scContent.countrycitylisturl){u("Missing URL for RV country and city list");return}r.get(n.scContent.countrycitylisturl,{cache:!0}).then(function(t){var i,e;if(t&&t.data){var r=t.data,o=["AU","NZ","US"],f=[];for(i=0,e=r.length;i<e;i++)o.indexOf(r[i].CountryCode)>=0&&(n.model.rvCities.push({name:r[i].Name+", "+r[i].State,value:r[i].Name,country:r[i].CountryName,countryCode:r[i].CountryCode}),f.indexOf(r[i].CountryCode)<0&&(n.model.rvCountries.push({name:r[i].CountryName,code:r[i].CountryCode}),f.push(r[i].CountryCode)));n.model.rvDestCities=n.model.rvCities.slice();n.model.rvDestCities.unshift({name:n.scContent.rvlocationplaceholdertext,value:"",countryCode:""});n.model.rvReturnCities=n.model.rvCities.slice();n.model.rvReturnCities.unshift({name:n.scContent.sameaspickuptext,value:"SAME",countryCode:""})}else u("Error getting RV cities: incomplete response")},function(n){u("Error getting RV cities: "+n)})}var f=100,t;for(n.model.rvCountries||(n.model.rvCountries=[],n.model.rvCities=[],n.model.rvPickUp="",n.model.rvDropOffDisplay="SAME",n.model.rvDropOff="",n.model.driverAge="",n.model.countryOfResidence="US"),n.model.thirdPartyPartnerImage=n.onMauve==="true"?n.scContent.bgrvsthirdpartypartnerimage:n.scContent.nobgrvsthirdpartypartnerimage,n.driverAgesUS=[],t=21;t<=f;t++)n.driverAgesUS.push(t);for(n.driverAgesElsewhere=[],t=18;t<=f;t++)n.driverAgesElsewhere.push(t);n.$watch("model.rvCountry",function(t){t&&t==="US"?(n.driverAges=n.driverAgesUS,n.driverAgeLabel=n.scContent.driverageustext):(n.driverAges=n.driverAgesElsewhere,n.driverAgeLabel=n.scContent.driveragetext);t&&(n.model.rvDropOffDisplay="SAME")});n.$watch("model.rvPickUp",function(t){if(t&&!n.model.rvCountry)for(var i=0,r=n.model.rvCities.length;i<r;i++)if(n.model.rvCities[i].value===t){n.model.rvCountry=n.model.rvCities[i].countryCode;break}t&&n.model.rvDropOffDisplay==="SAME"&&(n.model.rvDropOff=t)});n.$watch("model.rvDropOffDisplay",function(t){t&&t!=="SAME"?n.model.rvDropOff=t:t&&t==="SAME"&&n.model.rvPickUp&&(n.model.rvDropOff=n.model.rvPickUp)});n.citiesForSelectedCountry=function(t){return n.model.rvDestCities&&n.model.rvReturnCities?t?n.model.rvReturnCities.filter(e):n.model.rvDestCities.filter(e):[]};n.model.rvCountries.length===0&&o()}}}])}(angular),function(n){"use strict";var t=n.module("haPairLinksModule",[]);t.directive("pairLinksMenu",["$window","$timeout",function(t,i){return{restrict:"A",scope:!0,link:function(r,u,f){function c(t){var i={};return n.forEach(t,function(n){i[n.ItemA+n.ItemB]=n.Link}),i}function h(t){var i="",r=!1;return n.forEach(t,function(n){(n.IsGroupHeader||n.IsTopLevel)&&r&&(i+="<\/optgroup>",r=!1);n.IsGroupHeader?(i+='<optgroup label="'+n.Label+'">',r=!0):i+='<option value="'+n.Id+'">'+n.Label+"<\/option>"}),r&&(i+="<\/optgroup>",r=!1),i}var o=u.find("select").first(),s=u.find("select").last(),e;f.$observe("name",function(n){e=r[n]});f.$observe("listA",function(n){n=JSON.parse(n);o.html(h(n));r.listA=n});f.$observe("listB",function(n){n=JSON.parse(n);s.html(h(n));r.listB=n});f.$observe("pairs",function(n){r.pairs=JSON.parse(n);r.pairMap=c(r.pairs)});f.$observe("defaultA",function(n){i(function(){o.val(n.Id).change()})});f.$observe("defaultB",function(n){i(function(){s.val(n.Id).change()})});r.$watchGroup(["itemA","itemB"],function(){e.itemA.$setValidity("notfound",!0);e.itemB.$setValidity("notfound",!0)});r.go=function(n){var i,u,f;n.preventDefault();i=r.pairMap[r.itemA+r.itemB];i&&i.Url?(u=i.Url,f=i.Target,t.open(u,f||"_self")):(e.itemA.$setValidity("notfound",!1),e.itemB.$setValidity("notfound",!1))}}}}])}(angular),function(n){"use strict";var t=n.module("haName",[]);t.directive("haName",["$compile","$interpolate",function(n,t){return{restrict:"A",terminal:!0,priority:1e5,scope:!1,link:function(i,r){var u=r.attr("ha-name"),f=t(u,!1,null,!0)(i);r.removeAttr("ha-name");r.attr("name",f);n(r)(i)}}}])}(angular),function(n){"use strict";var t=n.module("haCustomDropdownModule",[]);t.directive("haCustomDropdown",["haConfig","$timeout",function(t,i){return{restrict:"A",scope:{label:"@"},transclude:!0,templateUrl:t.getTemplateUrl("ha-custom-dropdown-base-template.html"),link:function(t,r){function f(n){r.has(n.target).length||(i(t.customDropdownDeactivate),$(n.target).is(":focusable")||u.focus())}function e(n){n.keyCode===27&&(n.stopPropagation(),i(t.customDropdownDeactivate),u.focus())}var u=n.element([]);t.customDropdownActivate=function(){n.element("body").on("focusin touchstart click",f);n.element(r).on("keydown",e);t.active=!0};t.customDropdownDeactivate=function(){n.element("body").off("focusin touchstart click",f);n.element(r).off("keydown",e);t.active=!1};t.toggleCustomDropdownActive=function(i){u=n.element(i.target);t.active?t.customDropdownDeactivate():t.customDropdownActivate()};t.$on("$closeCustomDropdown",function(){u.focus();t.customDropdownDeactivate()});t.$on("$openCustomDropdown",function(){t.customDropdownActivate()})}}}])}(angular),function(n){"use strict";var t=n.module("haFormValidationModule",[]);t.directive("haFormValidation",["$timeout",function(n){var t=function(){},i;return t.$inject=["$scope"],i=function(t,i){n(function(){t.theFormName=i.attr("name");t.theForm=t[t.theFormName];t.$emit("$haFormValidationReady",t.theForm);t.theForm.validate=t.fireValidation},0);t.fireValidation=function(i){var u,r,f,e;t.$broadcast("validateForm");t.theForm.$valid?t.$emit("haFormValidationSuccess",{formName:t.theFormName,formScope:t.theForm,event:i}):(u=$("input.ng-invalid:first"),r=null,$("form[name='"+t.theFormName+"']").get(0)&&(u=$("form[name='"+t.theFormName+"']").find("input.ng-invalid:first"),r=$("form[name='"+t.theFormName+"']").parents().find(".ha-modal")),r!=null&&r.get(0)?(f=$(u).offset().top,e=$(r).offset().top,$(r).animate({scrollTop:e-f},"slow")):$("body, html").animate({scrollTop:$(".ng-invalid:not(form.ng-invalid):first").offset().top-140},"slow"),n(function(){$(u).focus()},300),i&&i.preventDefault&&i.preventDefault())};t.safeApply=function(n){var t=this.$root.$$phase;t==="$apply"||t==="$digest"?n&&typeof n=="function"&&n():this.$apply(n)};i.on("reset",function(){t.$broadcast("pristine");t.theForm.$setPristine()});i.on("submit",t.fireValidation)},{restrict:"A",scope:!0,link:i,controller:t}}])}(angular),function(n){"use strict";var t=function(){function n(n,t,i){return n<t&&n<i?n:t<n&&t<i?t:i}return function(t,i){var c,o,e,h,r,s,u,f;if(t===i)return 0;if(t.Length===0)return i.length;if(i.Length===0)return t.length;if(t.indexOf(i)>-1)return 0;for(o=t.length,e=i.length,o<e&&(h=t,t=i,i=h,h=o,o=e,e=h),r=[],r[0]=[],s=0;s<e+1;++s)r[0][s]=s;for(u=1;u<o+1;++u)for(r[u]=[],r[u][0]=u,f=1;f<e+1;++f)c=t.charAt(u-1)===i.charAt(f-1)?0:1,r[u][f]=n(r[u-1][f]+1,r[u][f-1]+1,r[u-1][f-1]+c);return r[r.length-1][r[r.length-1].length-1]}}(),i=n.module("haPasswordStrengthModule",[]);i.directive("haPasswordStrength",["$log","haRegexService",function(n,i){var r=["$scope",function(n){this.user=undefined;this.email=undefined;this.hmno=undefined;this.pass=undefined;n.$parent.pwStrength="NONE";this.test=function(r){var f,s,h,c,l,a,v,e,o,u;if(r.$setValidity("tooShort",!0),r.$setValidity("tooLong",!0),r.$setValidity("pattern",!0),r.$setValidity("alikeness",!0),this.pass&&this.pass.length<10){r.$setValidity("tooShort",!1);n.$parent.pwStrength="SHORT";return}if(this.pass&&this.pass.length>16){r.$setValidity("tooLong",!1);n.$parent.pwStrength="LONG";return}if(f=5,this.pass&&this.pass.length&&(this.user||this.email||this.hmno)&&(this.user&&(l=t(this.pass.toUpperCase(),this.user.toUpperCase()),s=l<f),this.email&&(a=t(this.pass.toUpperCase(),this.email.toUpperCase()),h=a<f),this.hmno&&(v=t(this.pass.toUpperCase(),this.hmno),c=v<f),e=s||h||c,r.$setValidity("alikeness",!e),e)){n.$parent.pwStrength="ALIKE";return}return o=!1,u="NONE",this.pass&&this.pass.length&&(u="WEAK",r.$setValidity("pattern",!1),i.password.test(this.pass)&&(r.$setValidity("pattern",!0),u="GOOD",o=!0,/[^A-Za-z0-9]+/.test(this.pass)&&(u="STRONG"))),n.$parent.pwStrength=u,o}}],u=function(n,t,i,r){var u=r[0],f=r[1];f.$parsers.unshift(function(n){return u.pass=n,u.test(f),n});n.$watch(i.usernameModel,function(n){n&&n.length&&(u.user=n,u.test(f))});n.$watch(i.emailModel,function(n){n&&n.length&&(u.email=n.substr(0,n.indexOf("@")),u.test(f))});n.$watch(i.hmnoModel,function(n){n&&n.toString().length&&(u.hmno=n.toString(),u.test(f))})};return{restrict:"A",require:["haPasswordStrength","ngModel"],link:u,controller:r,transclude:!0,templateUrl:""}}]);i.directive("haPasswordMatch",[function(){return{require:"ngModel",link:function(n,t,i,r){function e(){u!=null&&f!=null&&r.$setValidity("passwordMatch",u===f)}var u,f;r.$parsers.unshift(function(n){return u=n,e(),n});n.$watch(i.haPasswordMatch,function(n){f=n;e()})}}}])}(angular),function(n){"use strict";var t=n.module("haWindowEventsModule",[]);t.directive("body",function(){var n=function(n,t){t.on("click",function(t){n.$root.$emit("HaWindow:clicked",t)});n.$emit("$haWindowEventsReady")};return{restrict:"E",scope:!1,link:n}})}(angular),function(n){"use strict";var t=n.module("noClickFocusModule",[]);t.directive("noClickFocus",function(){var n=function(n,t){t.click(function(){t.blur()})};return{restrict:"A",scope:!1,link:n}})}(angular),function(n){"use strict";var t=n.module("haToggleModule",[]);t.directive("haToggle",["haConfig",function(n){return{restrict:"A",scope:{ngModel:"=",onLabel:"=",offLabel:"="},templateUrl:n.getTemplateUrl("ha-toggle-base-template.html"),transclude:!0,link:function(n,t){t.find("input").prop("checked",n.ngModel);n.toggle=function(){n.ngModel=!n.ngModel;t.find("input").prop("checked",n.ngModel)}}}}])}(angular),function(n){"use strict";var t=n.module("haKeyboardModule",[]);t.directive("haKeyEnter",function(){return function(n,t,i){t.bind("keydown keypress",function(t){t.which===13&&(n.$apply(function(){n.$eval(i.haKeyEnter)}),t.preventDefault())})}});t.directive("haKeyUp",function(){return function(n,t,i){t.bind("keydown keypress",function(t){t.which===38&&(n.$apply(function(){n.$eval(i.haKeyUp)}),t.preventDefault())})}});t.directive("haKeyDown",function(){return function(n,t,i){t.bind("keydown keypress",function(t){t.which===40&&(n.$apply(function(){n.$eval(i.haKeyDown)}),t.preventDefault())})}})}(angular),function(n){"use strict";var t=n.module("haErrorsModule",[]),i=["haSitecoreStrings","$timeout",function(t,i){var r={editable:t.get("Forms.patternError").then(function(n){return r.editable=n}),required:t.get("Forms.requiredError").then(function(n){return r.required=n}),language:t.get("Forms.languageError").then(function(n){return r.language=n}),pattern:t.get("Forms.patternError").then(function(n){return r.pattern=n}),date:t.get("Forms.dateError").then(function(n){return r.date=n}),parse:""};return{require:["?^form","?ngModel","?^haInput"],restrict:"E",link:function(t,u,f,e){function p(n){var t;if(o||(o=n),o.attempts++,o.$submitted=!0,t=$('[name="'+o.$name+'"]'),t.addClass("submitted"),i(function(){},0),o.$invalid){var r=$(".ng-invalid:not(div):first",t),u=r.closest(".modalContainer"),f=u.size()?u:$("html,body");f.animate({scrollTop:r.offset().top-50},function(){r.focus().select()})}return o.$valid}function b(){if(!(o.$submitted||s.$touched))return!1;if(c.required)return"required";if(c.language)return"language";if(c.pattern)return"pattern";for(var n in c)if(c.hasOwnProperty(n)&&c[n])return n}function k(n){var t=l[n];return typeof t=="undefined"?(console.error('Missing "'+n+'" message for input:',u[0]),"Unknown Error"):t.then?(t.then(function(t){h.html(l[n]=t)}),"..."):l[n]}var a=u[0].name,o=e[0],s=e[1],w=e[2],v=typeof f.allowNonEnglish!="undefined",c,l,h,y;if(!o||!s||w||!u.is("[ha-errors]")){if(v||!u.is(":not([ha-errors]):not(select):not(:checkbox):not(:radio):not(:hidden):not(:submit):not(:button)"))return;u.on("keydown input",function(n){if(n.ctrlKey||n.altKey||n.shiftKey||n.metaKey)return!0;var t=$(this).val(),i=!/[^\u0000-\u007F]+/.test(t);return n.type==="input"&&!i?(u.val(t.replace(/[^\u0000-\u007F]+/g,"")),!0):i});return}if(typeof o.attempts=="undefined"){o.attempts=0;$(u[0].form).on("submit",p)}if(c=s.$error,l=n.extend({},r,t.$eval(f.haErrors||"{}")),n.version.major===1&&n.version.minor<7){u.one("blur",function(){t.$evalAsync(function(){s.$untouched=!(s.$touched=!0);u.removeClass("ng-untouched").addClass("ng-touched")})});u.addClass("ng-untouched");s.$untouched=!(s.$touched=!1);o.$validate=p.bind(u[0].form)}i(function(){h=$('em[for="'+a+'"]');h.length||(h=$("<em>").attr("for",a),u.is("[required]:radio,[required]:checkbox")?u.closest(":not(ul):not(ol):not(li):not(input)").append(h):h.insertAfter(u));y=$(document.createComment("ha-errors for="+a)).insertBefore(h);!v&&u.is(":not(select):not(:checkbox):not(:radio):not(:hidden):not(:submit):not(:button)")&&t.$watch(function(){return u.val()},function(n){n&&s.$setValidity("language",!/[^\u0000-\u007F]+/.test(n))});t.$watch(b,function(n){u.attr("aria-invalid",s.$invalid);h.text("").detach();n&&h.html(k(n)).insertAfter(y)})})}}}];t.directive("input",i);t.directive("textarea",i);t.directive("select",i)}(angular),function(n){"use strict";var t=n.module("haFootNoteModule",[]),i=0,r=1;t.directive("haFootNote",["haConfig",function(n){var t=function(n,t){t.footnotes=t.footnotes||{};n.addFootnote=function(i){t.footnotes[n.type]=t.footnotes[n.type]||[];t.footnotes[n.type].push({id:n.id,label:n.label,text:i})}},u;return t.$inject=["$scope","$rootScope"],u=function(n,t,u){n.setValues=function(){typeof u.labelNumber=="string"?(n.type="numeric",n.id=r++):(n.type="static",n.label=u.label,n.id=String.fromCharCode(65+i++))};n.setValues();n.DisclaimerFootNote!==""?n.addFootnote(n.DisclaimerFootNote):n.addFootnote(t.find("[ng-transclude]").text())},{restrict:"A",transclude:!0,scope:!0,link:u,templateUrl:n.getTemplateUrl("ha-foot-note-base-template.html"),controller:t}}])}(angular),function(n){"use strict";var t=n.module("selectOnClickModule",[]);t.directive("selectOnClick",function(){return function(n,t){t.bind("click",function(){this.select()})}})}(angular),function(n){"use strict";var t=n.module("haRevealOnLoadModule",[]);t.directive("haRevealOnLoad",function(){return{restrict:"A",scope:!1,link:function(n,t){setTimeout(function(){t.addClass("ha-reveal-on-load-active");n.contentLoaded=!0},0)}}})}(angular),function(n){"use strict";var t=n.module("haWhenReadyModule",[]);t.directive("haWhenReady",[function(){return{priority:Number.MIN_SAFE_INTEGER,restrict:"A",link:function(){document.lazyLoadInstance.update()}}}])}(angular),function(n){"use strict";var t=n.module("haDraggableModule",[]);t.directive("haDraggableContainer",function(){var n=function(n,t){n.exampleMethod=function(){return t.scope()};n.$emit("$methodsBound")};return{restrict:"A",scope:!0,link:n}});t.directive("haDraggable",function(){var n=function(n,t){t.draggable({start:function(t){n.$emit("$dragStart",t)},drag:function(t){n.$emit("$dragging",t)},stop:function(t,i){n.$emit("$dragEnd",t,i)}});n.updateDraggableSettings=function(n){return t.draggable(n),t.scope()}};return{restrict:"A",scope:!0,priority:10,link:n}})}(angular),function(n){"use strict";n.module("haScrollModule",["duScroll"]).directive("haScrollTo",["duSmoothScrollDirective",function(n){var t=function(t,i,r){var f="#"+r.haScrollTo,u=90;r.offset!=null&&(u=r.offset);r.$set("href",f);r.$set("offset",u);n[0].link(t,i,r)};return{restrict:"A",priority:-1,link:t}}])}(angular),function(n){"use strict";var t=n.module("haDataModule",["haDataCacheService"]),i=function(n){var t=function(t,i,r){t.haDataHref=r.haData||r.haDataCache;n.get(t.haDataHref).success(function(n){$.extend(t,n);t.$emit("$haDataLoaded")})};return{restrict:"A",scope:!0,priority:-1,link:t}};t.directive("haData",["haDataCacheService",i]);t.directive("haDataCache",["haDataCacheService",i])}(angular),function(n){"use strict";var t=n.module("haTailModule",["ng"]);t.directive("haTail",["$parse","$interval",function(n,t){var i=function(i,r,u){function f(n){if(o(i)){var t=$(n).get(0);t!=null&&(t.scrollTop=t.scrollHeight)}}var o=n(u.haTail),e;u.ngModel!=null?i.$watch(u.ngModel,function(){f(r)}):(e=t(function(){f(r)},500,!1),i.$on("$destroy",function(){t.cancel(e)}))};return{restrict:"A",priority:-1,link:i}}])}(angular),function(n){"use strict";var t=n.module("haJson",[]);t.filter("haJson",function(){function n(n){return n&&n.document&&n.location&&n.alert&&n.setInterval}function t(n){return n&&n.$evalAsync&&n.$watch}function i(i,r){var u=r;return n(r)?u="$WINDOW":r&&document===r?u="$DOCUMENT":t(r)&&(u="$SCOPE"),u}return function(n){return typeof n=="undefined"?undefined:JSON.stringify(n,i,"  ")}})}(angular),function(n){"use strict";var t=n.module("haInputName",[]);t.directive("haInputName",["$interpolate",function(n){return{restrict:"A",priority:1e3,scope:!1,link:function(t,i){var u=n(i.attr("ha-input-name"),!1,null,!0)(t),r;i.removeAttr("ha-input-name");r=i.find("input");r.attr("name",u)}}}])}(angular),function(n){"use strict";var t=n.module("haWatchTrailerModule",[]);t.directive("haWatchTrailer",["$window","haModal","haConfig",function(n,t,i){var r=function(n){var r=i.getTemplateUrl("ha-watch-trailer-modal-template.html");n.$root.isMobile&&(r=i.getTemplateUrl("ha-watch-trailer-modal-mobile-template.html"));n.showTrailer=function(i){n.youtubeURL="//www.youtube.com/embed/"+i+"?autoplay=1&rel=0&origin=http://hawaiianairliens.comyoutubeID";t(r,{backdrop:"true",id:"watch-video",scope:n})}};return r.$inject=["$scope"],{restrict:"A",scope:!0,controller:r}}])}(angular),function(n){"use strict";var t=n.module("haLoadingSpinnerModule",[]);t.directive("haLoadingSpinner",function(){var n=function(n,t,i){i.small!==undefined&&t.children(".ha-loading-spinner").addClass("small");i.white!==undefined&&t.children(".ha-loading-spinner").addClass("white");n.loadingText="";i.loadingText!==undefined&&(n.loadingText=i.loadingText);n.$emit("$haLoadingSpinnerReady")};return{restrict:"A",scope:!0,link:n,transclude:!0,template:'<div class="ha-loading-spinner" tabindex="0"><span class="sr-only">{{loadingText}}<\/span><div class="spin"><div><\/div><\/div><\/div>'}});t.directive("haLoadingSpinnerWithText",function(){var n=function(n){n.$emit("$haLoadingSpinnerWithTextReady")};return{restrict:"A",scope:!0,link:n,transclude:!0,template:'<div class="ha-loading-spinner-with-text" ha-reveal-on-load tabindex="0"><div class="ha-loading-spinner small"><div class="spin"><div><\/div><\/div><\/div><div class="ha-loading-text"><span ng-transclude><\/span><\/div><\/div>'}})}(angular),function(n){"use strict";var t=n.module("focusOnDisplayModule",[]);t.directive("focusOnDisplay",function(){return{restrict:"A",link:function(n,t,i){$("html").hasClass("lte-ie9")||i.$observe("focusOnDisplay",function(){t.focus()})}}})}(angular),function(n){"use strict";var t=n.module("haElementDirectivesModule",[]);t.directive("select",["$interval","$timeout",function(n,t){return{restrict:"E",link:function(i,r){var u,f;$("html").hasClass("lte-ie9")&&(r.children("option").length<=1?(f=0,u=n(function(){f++;r.children("option").length>1&&(n.cancel(u),r.width(r.css("width")));f>40&&n.cancel(u)},50)):t(function(){r.width(r.css("width"))},50))}}}])}(angular),function(n){"use strict";var t=n.module("haButtonSpinnerModule",[]);t.directive("haButtonSpinner",function(){return{template:'<span class="button-spinner"><span><span><\/span><\/span><\/span><span ng-transclude><\/span>',transclude:!0,restrict:"A",scope:{showSpinner:"="},link:function(n,t){n.$watch(function(n){return n.showSpinner},function(n){t.blur();n?(t.children(".button-spinner").css({opacity:1}),t.css({paddingLeft:60}),t.prop("disabled",!0)):(t.children(".button-spinner").css({opacity:0}),t.css({paddingLeft:30}),t.prop("disabled",!1))})}}})}(angular),function(n){"use strict";var t=n.module("haDisableOnClickModule",[]);t.directive("haDisableOnClick",["$timeout","$window",function(n,t){function i(i,r,u){var f=u.white!==undefined?"white ":"",e='<div class="ha-loading-spinner '+f+'small"><div><div><\/div><\/div><\/div>';i.disableHref=function(){if(!i.hrefIsDisabled&&!!u.href){var f=u.href;i.hrefIsDisabled=!0;r.append(e).focus().attr("href","#");n(function(){t.location=f;n(function(){r.attr("href",f);i.hrefIsDisabled=!1},6e4)},300)}};r.on("$destroy",function(){i.hrefIsDisabled=!1})}return{restrict:"A",link:i,scope:!0,template:'<a ng-mouseup="disableHref()" ng-transclude><\/a>',transclude:!0,replace:!0}}])}(angular),function(n){"use strict";var t=n.module("haLaunchDarklyModule");t.directive("launchDarklyFeature",["haLaunchDarklyService",function(n){return{restrict:"A",controller:["$scope",function(n){n.launchDarklyFlagReady=!1}],scope:!0,link:function(t,i,r){var u=t.$eval(r.launchDarklyFeature),f=u.useCache==undefined||u.useCache!==!0?!1:!0;i.addClass("hidden");n.GetFlagVariant(u.key,u.type,u.variant,f).then(function(n){n.data==="DISABLED"&&i.remove();n.data==="ENABLED"&&(t.launchDarklyFlagReady=!0,i.removeClass("hidden"))},function(n){console.error("Launch Darkly Error: "+n+"\tKEY: "+u.key);i.remove()})}}}])}(angular),function(n){"use strict";var t=n.module("haTimedHideModule",["ngCookies"]),i="HA_TIMED_HIDE_";t.directive("haTimedHide",["$cookies",function(n){return{restrict:"A",scope:!0,link:function(t,r,u){var f=parseInt(u.hideMinutes),o,e;if(f=isNaN(f)?0:f,o=u.hideId,!o){r.addClass("shown");console.log("No id for ha-timed-hide");return}e=i+o;n.get(e)?n.get(e)!=f&&(n.remove(e),r.addClass("shown")):r.addClass("shown");t.timedClose=function(){if(r.removeClass("shown"),f&&o){var t=new Date;t.setMinutes(t.getMinutes()+f);n.put(e,f,{expires:t,path:"/"})}}}}}])}(angular),function(n){"use strict";var t=n.module("haResponsiveAttributeModule",[]);t.directive("haResponsiveAttribute",["$window","$parse",function(t,i){return{restrict:"A",link:function(r,u,f){var s=f.attributeName,h=f.baseValue,e=i(f.breakpoints)(),o=function(){for(var i=t.innerWidth,r=1,n=0;n<e.length;n++)if(i>e[n][0]&&i<e[n][1]){r=e[n][2];break}u.css(s,"calc("+h+" * "+r+")")};o();n.element(t).on("resize",o);r.$on("$destroy",function(){n.element(t).off("resize",o)})}}}])}(angular),function(n){"use strict";var t=n.module("haDomModalModule",[]);t.directive("haDomModal",["haModal",function(n){var t=function(t){t.showModal=function(){!t.hasError&&t.modalContent&&n(t.modalContent,{id:t.modalId,backdrop:"true"})}},i;return t.$inject=["$scope","$rootScope"],i=function(n,t,i){n.domId=i.domId;n.modalId=i.modalId;n.modalContent=i.domId;$(t).on("click",function(){n.showModal()})},{restrict:"A",scope:!0,link:i,controller:t}}])}(angular),function(n){"use strict";var t=n.module("haDelayAutoplayModule",[]);t.directive("haDelayAutoplay",[function(){return{link:function(t,i){var f,r,u,e;(console.log("haDelayAutoplay Link"),f=i[0],r=i.find("video")[0],r)&&(IntersectionObserver||r.play(),u=!1,r.addEventListener("ended",function(){u=!0},!1),e=new IntersectionObserver(function(t){n.forEach(t,function(n){n.intersectionRatio>.5&&!u&&r.play()})},{threshold:.5}),e.observe(f))}}}])}(angular),function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=typeof globalThis!="undefined"?globalThis:n||self,n.LazyLoad=t())}(this,function(){"use strict";function d(){return d=Object.assign||function(n){for(var i,r,t=1;t<arguments.length;t++){i=arguments[t];for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},d.apply(this,arguments)}var r=typeof window!="undefined",lt=r&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),at=r&&"IntersectionObserver"in window,vt=r&&"classList"in document.createElement("p"),yt=r&&window.devicePixelRatio>1,ir={elements_selector:".lazy",container:lt||r?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},pt=function(n){return d({},ir,n)},wt=function(n,t){var i,r="LazyLoad::Initialized",u=new n(t);try{i=new CustomEvent(r,{detail:{instance:u}})}catch(f){i=document.createEvent("CustomEvent");i.initCustomEvent(r,!1,!1,{instance:u})}window.dispatchEvent(i)},rr=function(n,t){if(t)if(t.length)for(var i=0,r;r=t[i];i+=1)wt(n,r);else wt(n,t)},i="src",g="srcset",nt="sizes",bt="poster",c="llOriginalAttrs",kt="data",tt="loading",dt="loaded",gt="applied",ur="entered",it="error",ni="native",ti="data-",ii="ll-status",n=function(n,t){return n.getAttribute(ti+t)},fr=function(n,t,i){var r=ti+t;if(i===null){n.removeAttribute(r);return}n.setAttribute(r,i)},l=function(t){return n(t,ii)},e=function(n,t){return fr(n,ii,t)},y=function(n){return e(n,null)},rt=function(n){return l(n)===null},er=function(n){return l(n)===tt},or=function(n){return l(n)===it},ut=function(n){return l(n)===ni},sr=[tt,dt,gt,it],hr=function(n){return sr.indexOf(l(n))>=0},u=function(n,t,i,r){if(n){if(r!==undefined){n(t,i,r);return}if(i!==undefined){n(t,i);return}n(t)}},s=function(n,t){if(vt){n.classList.add(t);return}n.className+=(n.className?" ":"")+t},t=function(n,t){if(vt){n.classList.remove(t);return}n.className=n.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},cr=function(n){n.llTempImage=document.createElement("IMG")},lr=function(n){delete n.llTempImage},ri=function(n){return n.llTempImage},p=function(n,t){if(t){var i=t._observer;i&&i.unobserve(n)}},ar=function(n){n.disconnect()},vr=function(n,t,i){t.unobserve_entered&&p(n,i)},ft=function(n,t){n&&(n.loadingCount+=t)},yr=function(n){n&&(n.toLoadCount-=1)},ui=function(n,t){n&&(n.toLoadCount=t)},pr=function(n){return n.loadingCount>0},wr=function(n){return n.toLoadCount>0},fi=function(n){for(var i=[],r=0,t;t=n.children[r];r+=1)t.tagName==="SOURCE"&&i.push(t);return i},et=function(n,t){var i=n.parentNode,r;i&&i.tagName==="PICTURE"&&(r=fi(i),r.forEach(t))},ei=function(n,t){var i=fi(n);i.forEach(t)},w=[i],oi=[i,bt],a=[i,g,nt],si=[kt],b=function(n){return!!n[c]},hi=function(n){return n[c]},ci=function(n){return delete n[c]},h=function(n,t){if(!b(n)){var i={};t.forEach(function(t){i[t]=n.getAttribute(t)});n[c]=i}},br=function(n){b(n)||(n[c]={backgroundImage:n.style.backgroundImage})},kr=function(n,t,i){if(!i){n.removeAttribute(t);return}n.setAttribute(t,i)},o=function(n,t){if(b(n)){var i=hi(n);t.forEach(function(t){kr(n,t,i[t])})}},dr=function(n){if(b(n)){var t=hi(n);n.style.backgroundImage=t.backgroundImage}},li=function(n,t,i){(s(n,t.class_applied),e(n,gt),i)&&(t.unobserve_completed&&p(n,t),u(t.callback_applied,n,i))},ai=function(n,t,i){(s(n,t.class_loading),e(n,tt),i)&&(ft(i,1),u(t.callback_loading,n,i))},f=function(n,t,i){i&&n.setAttribute(t,i)},vi=function(t,r){f(t,nt,n(t,r.data_sizes));f(t,g,n(t,r.data_srcset));f(t,i,n(t,r.data_src))},gr=function(n,t){et(n,function(n){h(n,a);vi(n,t)});h(n,a);vi(n,t)},nu=function(t,r){h(t,w);f(t,i,n(t,r.data_src))},tu=function(t,r){ei(t,function(t){h(t,w);f(t,i,n(t,r.data_src))});h(t,oi);f(t,bt,n(t,r.data_poster));f(t,i,n(t,r.data_src));t.load()},iu=function(t,i){h(t,si);f(t,kt,n(t,i.data_src))},ru=function(t,r,u){var o=n(t,r.data_bg),e=n(t,r.data_bg_hidpi),f=yt&&e?e:o;f&&(t.style.backgroundImage='url("'.concat(f,'")'),ri(t).setAttribute(i,f),ai(t,r,u))},uu=function(t,i,r){var e=n(t,i.data_bg_multi),u=n(t,i.data_bg_multi_hidpi),f=yt&&u?u:e;f&&(t.style.backgroundImage=f,li(t,i,r))},fu=function(t,i,r){var e=n(t,i.data_bg_set),f,u;e&&(f=e.split("|"),u=f.map(function(n){return"image-set(".concat(n,")")}),t.style.backgroundImage=u.join(),t.style.backgroundImage===""&&(u=f.map(function(n){return"-webkit-image-set(".concat(n,")")}),t.style.backgroundImage=u.join()),li(t,i,r))},yi={IMG:gr,IFRAME:nu,VIDEO:tu,OBJECT:iu},eu=function(n,t){var i=yi[n.tagName];i&&i(n,t)},ou=function(n,t,i){var r=yi[n.tagName];r&&(r(n,t),ai(n,t,i))},su=["IMG","IFRAME","VIDEO","OBJECT"],hu=function(n){return su.indexOf(n.tagName)>-1},pi=function(n,t){!t||pr(t)||wr(t)||u(n.callback_finish,t)},wi=function(n,t,i){n.addEventListener(t,i);n.llEvLisnrs[t]=i},cu=function(n,t,i){n.removeEventListener(t,i)},ot=function(n){return!!n.llEvLisnrs},lu=function(n,t,i){ot(n)||(n.llEvLisnrs={});var r=n.tagName==="VIDEO"?"loadeddata":"load";wi(n,r,t);wi(n,"error",i)},st=function(n){var t,i,r;if(ot(n)){t=n.llEvLisnrs;for(i in t)r=t[i],cu(n,i,r);delete n.llEvLisnrs}},bi=function(n,i,r){lr(n);ft(r,-1);yr(r);t(n,i.class_loading);i.unobserve_completed&&p(n,r)},au=function(n,t,i,r){var f=ut(t);bi(t,i,r);s(t,i.class_loaded);e(t,dt);u(i.callback_loaded,t,r);f||pi(i,r)},vu=function(n,t,i,r){var f=ut(t);bi(t,i,r);s(t,i.class_error);e(t,it);u(i.callback_error,t,r);i.restore_on_error&&o(t,a);f||pi(i,r)},ht=function(n,t,i){var r=ri(n)||n,u,f;ot(r)||(u=function(u){au(u,n,t,i);st(r)},f=function(u){vu(u,n,t,i);st(r)},lu(r,u,f))},yu=function(n,t,i){cr(n);ht(n,t,i);br(n);ru(n,t,i);uu(n,t,i);fu(n,t,i)},pu=function(n,t,i){ht(n,t,i);ou(n,t,i)},ct=function(n,t,i){hu(n)?pu(n,t,i):yu(n,t,i)},wu=function(n,t,i){n.setAttribute("loading","lazy");ht(n,t,i);eu(n,t);e(n,ni)},ki=function(n){n.removeAttribute(i);n.removeAttribute(g);n.removeAttribute(nt)},bu=function(n){et(n,function(n){ki(n)});ki(n)},di=function(n){et(n,function(n){o(n,a)});o(n,a)},ku=function(n){ei(n,function(n){o(n,w)});o(n,oi);n.load()},du=function(n){o(n,w)},gu=function(n){o(n,si)},nf={IMG:di,IFRAME:du,VIDEO:ku,OBJECT:gu},tf=function(n){var t=nf[n.tagName];if(!t){dr(n);return}t(n)},rf=function(n,i){rt(n)||ut(n)||(t(n,i.class_entered),t(n,i.class_exited),t(n,i.class_applied),t(n,i.class_loading),t(n,i.class_loaded),t(n,i.class_error))},uf=function(n,t){tf(n);rf(n,t);y(n);ci(n)},ff=function(n,i,r,f){r.cancel_on_exit&&er(n)&&n.tagName==="IMG"&&(st(n),bu(n),di(n),t(n,r.class_loading),ft(f,-1),y(n),u(r.callback_cancel,n,i,f))},ef=function(n,i,r,f){var o=hr(n);(e(n,ur),s(n,r.class_entered),t(n,r.class_exited),vr(n,r,f),u(r.callback_enter,n,i,f),o)||ct(n,r,f)},of=function(n,t,i,r){rt(n)||(s(n,i.class_exited),ff(n,t,i,r),u(i.callback_exit,n,t,r))},sf=["IMG","IFRAME","VIDEO"],gi=function(n){return n.use_native&&"loading"in HTMLImageElement.prototype},hf=function(n,t,i){n.forEach(function(n){sf.indexOf(n.tagName)!==-1&&wu(n,t,i)});ui(i,0)},cf=function(n){return n.isIntersecting||n.intersectionRatio>0},lf=function(n){return{root:n.container===document?null:n.container,rootMargin:n.thresholds||n.threshold+"px"}},af=function(n,t,i){n.forEach(function(n){return cf(n)?ef(n.target,n,t,i):of(n.target,n,t,i)})},vf=function(n,t){t.forEach(function(t){n.observe(t)})},yf=function(n,t){ar(n);vf(n,t)},pf=function(n,t){at&&!gi(n)&&(t._observer=new IntersectionObserver(function(i){af(i,n,t)},lf(n)))},nr=function(n){return Array.prototype.slice.call(n)},k=function(n){return n.container.querySelectorAll(n.elements_selector)},wf=function(n){return nr(n).filter(rt)},bf=function(n){return or(n)},kf=function(n){return nr(n).filter(bf)},tr=function(n,t){return wf(n||k(t))},df=function(n,i){var r=kf(k(n));r.forEach(function(i){t(i,n.class_error);y(i)});i.update()},gf=function(n,t){r&&(t._onlineHandler=function(){df(n,t)},window.addEventListener("online",t._onlineHandler))},ne=function(n){r&&window.removeEventListener("online",n._onlineHandler)},v=function(n,t){var i=pt(n);this._settings=i;this.loadingCount=0;pf(i,this);gf(i,this);this.update(t)};return v.prototype={update:function(n){var i=this._settings,t=tr(n,i);if(ui(this,t.length),lt||!at){this.loadAll(t);return}if(gi(i)){hf(t,i,this);return}yf(this._observer,t)},destroy:function(){this._observer&&this._observer.disconnect();ne(this);k(this._settings).forEach(function(n){ci(n)});delete this._observer;delete this._settings;delete this._onlineHandler;delete this.loadingCount;delete this.toLoadCount},loadAll:function(n){var t=this,i=this._settings,r=tr(n,i);r.forEach(function(n){p(n,t);ct(n,i,t)})},restoreAll:function(){var n=this._settings;k(n).forEach(function(t){uf(t,n)})}},v.load=function(n,t){var i=pt(t);ct(n,i)},v.resetStatus=function(n){y(n)},r&&rr(v,window.lazyLoadOptions),v}),function(n){"use strict";var t=n.module("haAccordionModule",[]);t.directive("haAccordion",function(){return{restrict:"A",link:function(t,i,r){var e=r.linkPanels,f=i.find("[accordion-panel]"),u=!1;f.each(function(t,i){i=n.element(i);var r=i.find("[accordion-panel-header]"),o=i.find("[accordion-panel-body]");r.click(function(){u||(u=!0,e&&f.not(i).addClass("collapsed").removeClass("expanded").find("[accordion-panel-body]").slideUp({duration:300,queue:!1}),o.slideToggle({duration:300,queue:!1,start:function(){i.toggleClass("expanded");i.toggleClass("collapsed")},always:function(){u=!1}}))})})}}})}(angular),function(n){"use strict";var t=n.module("haCurrencyModule",[]);t.filter("localCurrency",["$compile",function(){var i={USD:' <span class="currency-type">USD<\/span>',AUD:' <span class="currency-type">AUD<\/span>',NZD:' <span class="currency-type">NZD<\/span>',TWD:'<span class="currency-type">NT<\/span>',MILES:' <span class="currency-type">'+n.element("#SC_MilesText_Display").html()+"<\/span>"},t={USD:'<span class="currency-symbol">$<\/span>{{ amount }}{0}',AUD:'<span class="currency-symbol">$<\/span>{{ amount }}{0}',NZD:'<span class="currency-symbol">$<\/span>{{ amount }}{0}',CNY:'<span class="currency-symbol">¥<\/span>{{ amount }}',KRW:'<span class="currency-symbol">₩<\/span>{{ amount }}',JPY:'<span class="currency-symbol">¥<\/span>{{ amount }}',TWD:'{0}<span class="currency-symbol">$<\/span>{{ amount }}',MILES:"{{ amount }}{0}"},r=function(n){var t=n.toString().split(".");return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t.join(".")},u=function(t,i){return t>-1?i+" "+n.element("#MoreText").val():i.replace(/-([1-9]+)/g,function(n,t){return t})+" "+n.element("#LessText").val()},f=function(n,t){return t==="CNY"?Math.ceil(n/10)*10:t==="KRW"||t==="JPY"?Math.ceil(n/100)*100:Math.ceil(n)};return function(n,e,o,s,h,c,l,a){var v,y,p,w;return e&&!o&&(o="USD AUD NZD".indexOf(e.toUpperCase())===-1),v=h?n:o?l?f(n,e):Math.round(n):(Math.round(n*100)/100).toFixed(2),typeof v!="undefined"&&v!=null&&(y=r(v)),e==="MILES"&&(y=y.split(".")[0]),t[e]?(p=t[e].format(c?"":i[e]||""),e!="USD"||a||(p=t[e].format("")),w=p.replace(/\{\{.*\}\}/,y),s?u(n,w):w):void 0}}]);t.filter("superCurrency",["$log","$filter","$locale","$sce",function(n,t,i,r){var u={USD:'<span class="currency-symbol">$<\/span><span class="currency-dollars">{{ dollars }}<\/span><span class="currency-cents">{{ cents }}<\/span>',AUD:'<span class="currency-symbol">$<\/span><span class="currency-dollars">{{ dollars }}<\/span><span class="currency-cents">{{ cents }}<\/span> <span class="currency-type">AUD<\/span>',NZD:'<span class="currency-symbol">$<\/span><span class="currency-dollars">{{ dollars }}<\/span><span class="currency-cents">{{ cents }}<\/span> <span class="currency-type">NZD<\/span>',CNY:'<span class="currency-symbol">¥<\/span><span class="currency-dollars">{{ dollars }}<\/span><span class="currency-cents">{{ cents }}<\/span>',KRW:'<span class="currency-symbol">₩<\/span><span class="currency-dollars">{{ dollars }}<\/span><span class="currency-cents">{{ cents }}<\/span>',JPY:'<span class="currency-symbol">¥<\/span><span class="currency-dollars">{{ dollars }}<\/span><span class="currency-cents">{{ cents }}<\/span>',TWD:'<span class="currency-type">NT<\/span><span class="currency-symbol">$<\/span><span class="currency-dollars">{{ dollars }}<\/span><span class="currency-cents">{{ cents }}<\/span>'},f=function(n,t,i){var f=u[n].replace("{{ dollars }}",t).replace("{{ cents }}",i);return r.trustAsHtml(f)};return function(n,r,u){r=r||"USD";var s=i.NUMBER_FORMATS,e=t("currency")(n,""),h=e.substring(0,e.indexOf(s.DECIMAL_SEP)),o=e.substring(e.indexOf(s.DECIMAL_SEP));return u===!0&&(o=""),u==="roundPrice"&&(n>=1||n<=-1)&&(o=""),u==="roundSavings"&&(n>=1||n<=-1)&&(o=""),f(r,h,o)}}]);t.filter("noFractionCurrency",["$filter","$locale",function(n,t){var i=n("currency"),r=t.NUMBER_FORMATS;return function(n,t){var u=i(n,t),f=u.indexOf(r.DECIMAL_SEP);return u.substring(0,f)}}]);t.directive("wholeCurrency",function(){return{require:"ngModel",link:function(n,t,i,r){function e(n){if(n){if(n=n+"",n.match(/\d/g)){var t=Number(n.match(/\d/g).join("")).toFixed(),i=f[u]+""+t;return i!=n&&(r.$setViewValue(i),r.$render()),parseInt(t)}return f[u]!=n&&(r.$setViewValue(f[u]),r.$render()),0}}function o(n){return f[u]+n}var u=n.$root.$currency,f={USD:"$",AUD:"$",NZD:"$",CNY:"¥",KRW:"₩",JPY:"¥",TWD:"NT$"};r.$parsers.unshift(e);r.$formatters.unshift(o)}}})}(angular),function(n){"use strict";var t=n.module("haLocalizeNameModule",[]);t.filter("localName",[function(){var n={en:"{{ firstName }} {{ lastName }}","en-au":"{{ firstName }} {{ lastName }}","en-nz":"{{ firstName }} {{ lastName }}","zh-cn":"{{ lastName }} {{ firstName }}","ko-kr":"{{ lastName }} {{ firstName }}","ja-jp":"{{ lastName }} {{ firstName }}","zh-tw":"{{ lastName }} {{ firstName }}"};return function(t,i,r){if(n[r]){var u=n[r].replace(/\{\{ firstName \}\}/,t);return u.replace(/\{\{ lastName \}\}/,i)}}}])}(angular),function(n){"use strict";var t=n.module("haLocalizeDateModule",[]);t.filter("localDate",["$filter",function(n){var t={en:"EEE M/d","en-au":"EEE M/d","en-nz":"EEE M/d","zh-cn":"M月d日 EEE","ko-kr":"M월 d일 EEE","ja-jp":"M月d日(EEE)","zh-tw":"M月d日 EEE"};return function(i,r){var u=new Date,f=n("date");if(t[r])return u=i instanceof Date?i:new Date(i),f(u,t[r])}}]);t.filter("localShortDate",["$filter",function(n){var t={en:"MM/dd/yyyy","en-au":"MM/dd/yyyy","en-nz":"MM/dd/yyyy","zh-cn":"yyyy/MM/dd","ko-kr":"yyyy/MM/dd","ja-jp":"yyyy/MM/dd","zh-tw":"yyyy/MM/dd"};return function(i,r){var f=new Date,e=n("date"),u;if(t[r])return i instanceof Date?f=i:/^\d{4}-\d{1,2}-\d{1,2}/gi.test(i)?(u=i.split("T")[0].split("-"),f=u.length===3?new Date(parseInt(u[0],10),parseInt(u[1],10)-1,parseInt(u[2],10)):new Date):f=new Date(i),e(f,t[r])}}]);t.filter("dateWithDayButNoYear",["$filter",function(n){var t="EEE, MMM d",i={en:"EEE, MMM d","en-au":"EEE, MMM d","en-nz":"EEE, MMM d","zh-cn":"M月d日 EEE","ko-kr":"M월 d일 EEE","ja-jp":"M月d日(EEE)","zh-tw":"M月d日 EEE"};return function(r,u){return n("date")(r,i[u]||t)}}]);t.filter("localShortDateWithMonthandDay",["$filter",function(n){var t="MMM d",i={en:"MMM d","en-au":"MMM d","en-nz":"MMM d","zh-cn":"M月d日","ko-kr":"M월 d일","ja-jp":"M月d日","zh-tw":"M月d日"};return function(r,u){return n("date")(r,i[u]||t)}}]);t.filter("localTime",["$filter",function(n){var t="hh:mma",i={en:"h:mma","en-au":"h:mma","en-nz":"h:mma","zh-cn":"H:mm","ko-kr":"H:mm","ja-jp":"H:mm","zh-tw":"H:mm"};return function(r,u){return n("date")(r,i[u]||t)}}]);t.filter("localFullDateAbbreviated",["$filter",function(n){var t="EEE MMM d,yyyy",i={en:"EEE MMM d,yyyy"};return function(r,u){return n("date")(r,i[u]||t)}}])}(angular),function(n){"use strict";var t=n.module("currencyNoDecimalsFilter",[]);t.filter("currencyNoDecimalsFilter",["$filter","$locale",function(n,t){var i=n("currency"),r=t.NUMBER_FORMATS;return function(n,t){var u=i(n,t),f=u.indexOf(r.DECIMAL_SEP);return n>=0?u.substring(0,f):u.substring(0,f)+")"}}])}(angular),function(n){"use strict";var t=n.module("haRoundingFiltersModule",[]);t.filter("roundPrice",[function(){return function(n){return n>1||n<-1?Math.ceil(n):n}}]);t.filter("roundSavings",[function(){return function(n){return n>1||n<-1?Math.floor(n):n}}])}(angular),function(n){"use strict";var t=n.module("TitleCaseModule",[]);t.filter("TitleCase",[function(){return function(n){return n.toLowerCase().split(" ").map(function(n,t){return(n=="or"||n=="and"||n=="but")&&t!=0?n:n.charAt(0).toUpperCase()+n.slice(1)}).join(" ")}}])}(angular),function(n){"use strict";var t=n.module("haHomepageModule",[]);t.controller("haHomepageCtrl",["$rootScope","$scope","$window","haLaunchDarklyAPI",function(n,t,i,r){t.$emit("$haHomepageReady");t.departureDateToday=typeof i.serverShortDate!="undefined"?new Date(i.serverShortDate):new Date;t.departureDateTomorrow=typeof i.serverShortDate!="undefined"?new Date(i.serverShortDate):new Date;t.departureDateYesterday=typeof i.serverShortDate!="undefined"?new Date(i.serverShortDate):new Date;t.departureDateTomorrow.setDate(t.departureDateToday.getDate()+1);t.departureDateYesterday.setDate(t.departureDateToday.getDate()-1);t.tab="bookflights";t.flightStatusType="byFlightNumber";t.flightStatusSpaEnabled=!1;t.expanded=!1;r.getFeatureFlag(HA.FLAGS.FlightStatusSpaEnabledKey,"boolean",!0,!0).then(function(n){if(n.data==="ENABLED")t.flightStatusSpaEnabled=!0;else return null});t.$on("haFormValidationSuccess",function(n,t){t.formName==="flightStatusByNumber"&&typeof Storage!="undefined"&&(sessionStorage.FlightNumber=t.formScope.FlightNumber.$modelValue,sessionStorage.selectedDepartureDateID=$("#flightStatusByNumber div[ha-radio] input:checked").attr("id"))});t.$on("cartrawlerFormsLoaded",function(){t.cartrawlerFormsLoaded=!0});var u=!1;t.$watch("tab",function(t){if(!u){u=!0;return}if(t==="flightstatus"){var i=new Date;n.DepartureDate=[i.getMonth()+1,i.getDate(),i.getFullYear()].join("/")}});t.submitItineraryLookup=function(n){n.$valid&&(t.disableItineraryLookupBtn=!0,$(n).submit())}}])}(angular),function(n){"use strict";var t=n.module("formValidation",[]);t.directive("showErrors",function(t,i){var r,u;return r=function(n){var t;return t=i.showSuccess,n&&n.showSuccess!=null&&(t=n.showSuccess),t},u=function(t,i,u,f){var s=!1,c=t.$eval(u.showErrors),l=r(c),a=i[0].querySelector("[name]"),h=n.element(a),e=h.attr("name"),o;if(!e)throw"show-errors element has no child input elements with a 'name' attribute";return h.bind("blur",function(){return s=!0,o(f[e].$invalid)}),t.$watch(function(){return f[e]&&f[e].$invalid},function(n){if(s)return o(n)}),t.$on("show-errors-check-validity",function(){return o(f[e].$invalid)}),o=function(n){return i.toggleClass("has-error",n),l?i.toggleClass("has-success",!n):void 0}},{restrict:"A",require:"^form",compile:function(n){if(!n.hasClass("form-group"))throw"show-errors element does not have the 'form-group' class";return u}}});t.provider("showErrorsConfig",function(){var n=!1;this.showSuccess=function(t){return n=t};this.$get=function(){return{showSuccess:n}}});t.controller("formController",function(n){n.save=function(){n.$broadcast("show-errors-check-validity")};n.saveHA=function(){n.$broadcast("show-errors-check-validity")}})}(angular),function(n){"use strict";var t=n.module("haHomepageStoriesAndEventsModule",[]);t.controller("HomepageStoriesAndEventsController",["$scope","$locale","haDateUtils",function(n,t,i){n.dateStringToMonthAbbrev=function(n){var i=moment(n).toDate(),r=i.getMonth();return t.DATETIME_FORMATS.SHORTMONTH[r]};n.msToDate=i.msToDate}])}(angular)