(function(){Array.prototype.some||(Array.prototype.some=function(n){"use strict";var t;if(this==null)throw new TypeError("Array.prototype.some called on null or undefined");if(typeof n!="function")throw new TypeError;var i=Object(this),r=i.length>>>0,u=arguments.length>=2?arguments[1]:void 0;for(t=0;t<r;t++)if(t in i&&n.call(u,i[t],t,i))return!0;return!1});Array.prototype.filter||(Array.prototype.filter=function(n){"use strict";var i,f,r,e,t,u;if(this===void 0||this===null)throw new TypeError;if(i=Object(this),f=i.length>>>0,typeof n!="function")throw new TypeError;for(r=[],e=arguments.length>=2?arguments[1]:void 0,t=0;t<f;t++)t in i&&(u=i[t],n.call(e,u,t,i)&&r.push(u));return r});Array.prototype.find||(Array.prototype.find=function(n){"use strict";var t;if(this==null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof n!="function")throw new TypeError("predicate must be a function");var i=Object(this),u=i.length>>>0,f=arguments[1],r;for(t=0;t<u;t++)if(r=i[t],n.call(f,r,t,i))return r;return undefined});Array.prototype.map||(Array.prototype.map=function(n,t){var e,u,i,r,f,o,s;if(this==null)throw new TypeError(" this is null or not defined");if(r=Object(this),f=r.length>>>0,typeof n!="function")throw new TypeError(n+" is not a function");for(arguments.length>1&&(e=t),u=new Array(f),i=0;i<f;)i in r&&(o=r[i],s=n.call(e,o,i,r),u[i]=s),i++;return u});String.prototype.endsWith||(String.prototype.endsWith=function(n,t){var i=this.toString(),r;return(typeof t!="number"||!isFinite(t)||Math.floor(t)!==t||t>i.length)&&(t=i.length),t-=n.length,r=i.indexOf(n,t),r!==-1&&r===t});String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});String.prototype.includes||(String.prototype.includes=function(n,t){"use strict";return typeof t!="number"&&(t=0),t+n.length>this.length?!1:this.indexOf(n,t)!==-1});typeof Object.assign!="function"&&(Object.assign=function(n){"use strict";var u,i,t,r;if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(u=Object(n),i=1;i<arguments.length;i++)if(t=arguments[i],t!=null)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(u[r]=t[r]);return u})})(),function(n){n.performance=n.performance||{};n.performance.now||function(){var t=+new Date;n.performance.now=function(){return+new Date-t}}()}(window);String.prototype.padStart||(String.prototype.padStart=function(n,t){return n=n>>0,t=String(t||" "),this.length>n?String(this):(n=n-this.length,n>t.length&&(t+=t.repeat(n/t.length)),t.slice(0,n)+String(this))});var Route={_baseurl:"/api/sitecore/",apihelp:"apihelp",credits:"payment/GetCreditsList",documentsconfig:"DocumentCenter/GetDocumentConfig",getFleetManage:"AdminBar/GetFleetManage",checkSuperAdminExists:"ManageUsers/FindSuperAdmin",documents:"DocumentCenter/GetDocuments",error:"error",file:"file",paymentItems:"Payment/GetPendingPayments",login:"login/GetLoginResponse",updateCredentials:"login/SetNewCredentials",SetQuikQAccount:"login/AddQuickQAccountDetails",performlogin:"login/performlogin",getusertest:"login/GetUserDetails",forgotPasswordPageContent:"login/GetForgotPasswordPageDetails",messages:"messages",getusers:"manageusers/GetUsers",getperson:"manageusers/GetPerson",updateperson:"manageusers/UpdateUser",updateEulaDate:"manageusers/UpdateEulaDate",AddQuikQAccount:"manageusers/AddQuickQAccountDetails",getQuikQData:"manageusers/GetQuickQAccountDetails",removeQuikQData:"manageusers/RemoveQuickQAccountDetails",createperson:"manageusers/CreateUser",deleteperson:"manageusers/DeleteUser",unlockperson:"manageusers/UnlockUser",resetUserPassword:"manageusers/ResetUserPassword",updatepassword:"manageusers/UpdatePassword",updatecommunicationpref:"manageusers/UpdateCommunicationPreferences",loadmanageusersviewmodel:"manageusers/GetMangeUserJSViewModel",loadmyprofileviewmodel:"manageusers/GetUserProfileJSViewModel",updatesecurityquestions:"manageusers/UpdateQuestions",getUserSecurityQuestions:"manageusers/GetSecurityQuestions",getuserrepresentative:"manageusers/GetContactCardInfo",resendRegistrationEmail:"manageusers/ResendRegistrationEmail",loginResendRegistrationEmail:"Login/ResendRegistrationEmail",securityQuestions:"login/GetSecurityQuestions",sitemap:"sitemap",countries:"manageusers/GetCountries",states:"manageusers/GetStates",cities:"manageusers/GetCities",invoices:"Payment/GetCreditInvoiceList",disclaimerData:"Payment/GetDisclaimerData",invoiceList:"Payment/GetInvoiceList",postMessage:"PostServiceMessage/PostMessages",sendEmail:"Payment/SendCancelPaymentEmail",topics:"contactus/GetTopics",options:"AdminBar/GetOptions",getInvoice:"AccountsOverView/GetInvoiceRecords",getSearchUserItems:"AccountsOverView/GetUserSearchDetails",types:"PostServiceMessage/GetTypes",priorities:"PostServiceMessage/GetPriorities",roles:"AdminBar/GetRoles",postsecurityquestions:"login/postsecurityquestions",passwordresetconfirmationpage:"login/LoadForgotSecurityJsViewModel",setsecurityquestionspage:"login/LoadCreateSecurityQuestionsJsViewModel",internaladmindashboard:"AdminDashboard/LoadInternalAdminDashboardJsViewModel",contactUsEmail:"ContactUs/SendEmail",makePaymentEmail:"Payment/PaymentEmail",PostPayment:"Payment/PostPaymentConfirmation",downloadDailyPrice:"DocumentCenter/PdfViewDailyPrices",downloadTransaction:"DocumentCenter/PdfViewDailyTransactions",downloadDraft:"DocumentCenter/PdfViewDraftNotices",downloadContracts:"DocumentCenter/PdfViewContracts",downloadInvoices:"DocumentCenter/PdfViewInvoices",downloadRebate:"DocumentCenter/PdfViewRebateStatements",downloadTax:"DocumentCenter/PdfViewTaxes",achPaymentDetails:"Payment/GetBankDetails",download:"DocumentCenter/ExcelOrPdfView",getAccountsList:"Payment/GetAccountsList",createsecurityquestions:"login/SetSecurityQuestions",quickq:"login/LoadSecurityQuestionsJsViewModel",PostQuickQ:"login/PostQuickQ",setsecurityquestionsvalidation:"login/SetSecurityQuestionsValidation",resetPassword:"login/ResetPassword",postCancelPayment:"Payment/PostCancelPaymentConfirmation",getAccountBal:"AccountsOverView/GetAccountBalance",TopTenFuelLocations:"FuelLocations/GetTopTenFuelLocations",TireTopTenLocations:"FuelLocations/GetTopTenTireLocations",GetCurrentContracts:"FuelGoal/CheckCurrentContracts",GetCurrentFleetData:"FuelGoal/GetCurrentFleetData",GetFuelInitialData:"FuelGoal/GetInitialData",GetTireInitialData:"FuelGoal/GetInitialTireData",GetTireSummary:"FuelGoal/GetTireSummary",GetDailyPriceDocuments:"MonthlyFuelPerformance/GetDailyPriceDocuments",accounts:"DashboardAccounts/Get",accountbalance:"DashboardAccounts/GetAccountBalance",quikQAccountSummary:"DashboardAccounts/GetQuikQAccountSummary",GetMessages:"MessageCenter/GetMessages",getPaymentSelect:"Payment/GetPaymentSelect",loadcontactusviewmodel:"ContactUs/GetContactUsJsViewModel",getCreditSelect:"Payment/GetCreditSelect",getInternalAdminSelectedUser:"AdminBar/GetInternalAdminSelectedUser",SingleTransactionList:"Payment/getSelectedTransactions",SetUnReadMsgCount:"MessageCenter/SetUnreadMsgCount",GetFleets:"PostServiceMessage/GetFleets",facilityLookUp:"ContactUs/FacilityLookUp",GetSearchedUserResults:"AdminBar/GetSearchedUserResults",locationstates:"Location/GetStates",locationcities:"Location/GetCities",locationhighways:"Location/GetHighways",lovesLocations:"Location/GetLovesLocations",tireCareLocations:"Location/GetTireCareLocations",truckCareReportParameters:"truckcare/getreportparameters",truckCareGetReport:"truckcare/getreport",loyaltycountries:"LoyaltyAccount/GetCountries",driverTypes:"LoyaltyAccount/GetDriverTypes",loyaltystates:"LoyaltyAccount/GetStates",loyaltyLogin:"login/GetLoyaltyLoginResponse",loyaltyPeople:"LoyaltyManageUsers/GetProfile",loyaltyUserInfo:"LoyaltyAccount/GetLoyaltyUser",loyaltyWorkingEmailWarn:"LoyaltyAccount/GetWorkingEmailWarningContentForProfile",loyaltyEditPeople:"LoyaltyManageUsers/EditProfile",loyaltyMessages:"LoyaltyMessageCenter/GetMessages",loyaltyUserRegistration:"LoyaltyAccount/CreateLoyaltyUser",loyaltyAuth0Registration:"LoyaltyAccount/CreateLoyaltyUserAuth0",loyaltyDetails:"LoyaltyDashboardAccounts/GetLoyaltyDetail",dashboardStatus:"LoyaltyDashboardAccounts/GetDashboardStatusJsViewModel",loyaltyChangePIN:"LoyaltyManageUsers/UpdatePin",loyaltyResetPin:"LoyaltyAccount/ResetPin",loyaltyChangePINEmail:"LoyaltyAccount/ChangePinEmail",loyaltyChangeEmail:"LoyaltyAccount/ChangeEmail",loyaltySendResetEmail:"LoyaltyAccount/SendPasswordResetEmail",loyaltyResetPIN:"LoyaltyAccount/ResetCardPin",loyaltySearchUser:"AdminBar/GetSearchedLoyaltyUser",loyaltyInternalAdminGetUser:"AdminBar/GetInternalAdminLoyaltyUser",loyaltyProfileViewModel:"LoyaltyAccount/GetUserProfileViewModel",loyaltyPostMessage:"LoyaltyCreateMessage/PostMessages",messageTypes:"LoyaltyCreateMessage/GetTypes",messagePriorities:"LoyaltyCreateMessage/GetPriorities",verifyCard:"LoyaltyAccount/VerifyCardNumber",GetNewsList:"LandingPage5/GetLandingPage5DetailList",companySpotlight:"LandingPage5/GetSpotLights",getStoreTypes:"Location/GetStoreTypes",getAmenities:"Location/GetAmenities",getRestaurants:"Location/GetRestaurants",getFoodConcepts:"Location/GetFoodConcepts",searchLocations:"Location/SearchLocations",searchStores:"StoreSearch/SearchStores",searchStoresWithDetail:"StoreSearch/SearchStoresWithDetail",getHotelLinks:"StoreSearch/GetHotelLinks",getLocationsSearchResults:"Location/GetLocations",getLocationsBySiteIds:"Location/GetLocationsByIds",locationDirectionsItems:"Location/GetLocationSearchJsViewModel",locationfuelprices:"Location/GetFuelPrices",locationamenitiesrestaurants:"Location/GetSitecoreValuesForAmenitiesRestaurants",locationicons:"Location/GetAmenityIcon",Restaurants:"Restaurants/GetRestaurants",lovesStates:"TireCareExpressApplication/GetStates",logoRequestAppstates:"LogoRequest/GetStates",TireApplication:"TireCareExpressApplication/SendEmail",GetSearchResults:"LovesCommon/GetSearchResults",GetRestaurantDetails:"Restaurants/GetRestaurantDetails",loadGlobalSearchViewModel:"LovesCommon/LoadGlobalSearchViewModel",GetRelatedSearchResults:"LovesCommon/GetRelatedSearchResults",QuoteRequest:"Quote/SendEmail",LogoRequestApplication:"LogoRequest/SendEmail",lovesExpressCountries:"LovesExpressApplicationForm/GetCountries",lovesExpressStates:"LovesExpressApplicationForm/GetStates",lovesExpressAccounts:"LovesExpressApplicationForm/GetAccounts",lovesExpressSecondLine:"LovesExpressApplicationForm/GetSecondLine",ExpressApplication:"LovesExpressApplicationForm/SendEmail",getTabbedMenu:"LovesCommon/TabbedSubmenuContent",contactUsTopics:"LovescomContactUs/GetTopics",getLocations:"LovescomContactUs/GetLocations",RealEstateForm:"RealEstateInformation/SendEmail",NotificationConfigs:"TruckCare/GetNotificationConfigs",ActionNeededWorkOrders:"TruckCare/GetCountOfActionNeededWorkOrders",GetNotifications:"TruckCare/GetNotifications",PageActionIssues:"TruckCare/GetPageActionIssues",GetServiceRequestTypes:"ServiceRequest/GetServiceRequestTypes",BlogPointerItems:"Common/GetBlogPointerItems",GetPageSizes:"Common/PageSizes",GetLocationsWithBusinessInterruptions:"Common/LocationsWithBusinessInterruptions",getServiceTypesForBusinessInterruptions:"Common/ServiceTypesForBusinessInterruptions"};eval(function(n,t,i,r,u,f){if(u=function(n){return(n<t?"":u(parseInt(n/t)))+((n=n%t)>35?String.fromCharCode(n+29):n.toString(36))},!"".replace(/^/,String)){while(i--)f[u(i)]=r[i]||u(i);r=[function(n){return f[n]}];u=function(){return"\\w+"};i=1}while(i--)r[i]&&(n=n.replace(new RegExp("\\b"+u(i)+"\\b","g"),r[i]));return n}('7 8(a){a=a||{};r.s.1R.2k(2,3d);2.Q=a.1v||"";2.1H=a.1B||J;2.S=a.1G||0;2.H=a.1z||1h r.s.1Y(0,0);2.B=a.U||1h r.s.2E(0,0);2.15=a.13||t;2.1p=a.1t||"2h";2.1m=a.F||{};2.1E=a.1C||"3g";2.P=a.1j||"3b://38.r.33/2Y/2T/2N/1r.2K";3(a.1j===""){2.P=""}2.1f=a.1x||1h r.s.1Y(1,1);3(q a.A==="p"){3(q a.18==="p"){a.A=L}v{a.A=!a.18}}2.w=!a.A;2.17=a.1n||J;2.1I=a.2g||"2e";2.16=a.1l||J;2.4=t;2.z=t;2.14=t;2.V=t;2.E=t;2.R=t}8.9=1h r.s.1R();8.9.25=7(){5 i;5 f;5 a;5 d=2;5 c=7(e){e.20=L;3(e.1i){e.1i()}};5 b=7(e){e.30=J;3(e.1Z){e.1Z()}3(!d.16){c(e)}};3(!2.4){2.4=1e.2S("2Q");2.1d();3(q 2.Q.1u==="p"){2.4.O=2.G()+2.Q}v{2.4.O=2.G();2.4.1a(2.Q)}2.2J()[2.1I].1a(2.4);2.1w();3(2.4.6.D){2.R=L}v{3(2.S!==0&&2.4.Z>2.S){2.4.6.D=2.S;2.4.6.2D="2A";2.R=L}v{a=2.1P();2.4.6.D=(2.4.Z-a.W-a.11)+"12";2.R=J}}2.1F(2.1H);3(!2.16){2.E=[];f=["2t","1O","2q","2p","1M","2o","2n","2m","2l"];1o(i=0;i<f.1L;i++){2.E.1K(r.s.u.19(2.4,f[i],c))}2.E.1K(r.s.u.19(2.4,"1O",7(e){2.6.1J="2j"}))}2.V=r.s.u.19(2.4,"2i",b);r.s.u.T(2,"2f")}};8.9.G=7(){5 a="";3(2.P!==""){a="<2d";a+=" 2c=\'"+2.P+"\'";a+=" 2b=11";a+=" 6=\'";a+=" U: 2a;";a+=" 1J: 29;";a+=" 28: "+2.1E+";";a+="\'>"}K a};8.9.1w=7(){5 a;3(2.P!==""){a=2.4.3n;2.z=r.s.u.19(a,"1M",2.27())}v{2.z=t}};8.9.27=7(){5 a=2;K 7(e){e.20=L;3(e.1i){e.1i()}r.s.u.T(a,"3m");a.1r()}};8.9.1F=7(d){5 m;5 n;5 e=0,I=0;3(!d){m=2.1D();3(m 3l r.s.3k){3(!m.26().3h(2.B)){m.3f(2.B)}n=m.26();5 a=m.3e();5 h=a.Z;5 f=a.24;5 k=2.H.D;5 l=2.H.1k;5 g=2.4.Z;5 b=2.4.24;5 i=2.1f.D;5 j=2.1f.1k;5 o=2.23().3c(2.B);3(o.x<(-k+i)){e=o.x+k-i}v 3((o.x+g+k+i)>h){e=o.x+g+k+i-h}3(2.17){3(o.y<(-l+j+b)){I=o.y+l-j-b}v 3((o.y+l+j)>f){I=o.y+l+j-f}}v{3(o.y<(-l+j)){I=o.y+l-j}v 3((o.y+b+l+j)>f){I=o.y+b+l+j-f}}3(!(e===0&&I===0)){5 c=m.3a();m.39(e,I)}}}};8.9.1d=7(){5 i,F;3(2.4){2.4.37=2.1p;2.4.6.36="";F=2.1m;1o(i 35 F){3(F.34(i)){2.4.6[i]=F[i]}}2.4.6.32="31(0)";3(q 2.4.6.X!=="p"&&2.4.6.X!==""){2.4.6.2Z="\\"2X:2W.2V.2U(2R="+(2.4.6.X*1X)+")\\"";2.4.6.2P="2O(X="+(2.4.6.X*1X)+")"}2.4.6.U="2M";2.4.6.M=\'1c\';3(2.15!==t){2.4.6.13=2.15}}};8.9.1P=7(){5 c;5 a={1b:0,1g:0,W:0,11:0};5 b=2.4;3(1e.1s&&1e.1s.1W){c=b.2L.1s.1W(b,"");3(c){a.1b=C(c.1V,10)||0;a.1g=C(c.1U,10)||0;a.W=C(c.1T,10)||0;a.11=C(c.1S,10)||0}}v 3(1e.2I.N){3(b.N){a.1b=C(b.N.1V,10)||0;a.1g=C(b.N.1U,10)||0;a.W=C(b.N.1T,10)||0;a.11=C(b.N.1S,10)||0}}K a};8.9.2H=7(){3(2.4){2.4.2G.2F(2.4);2.4=t}};8.9.1y=7(){2.25();5 a=2.23().2C(2.B);2.4.6.W=(a.x+2.H.D)+"12";3(2.17){2.4.6.1g=-(a.y+2.H.1k)+"12"}v{2.4.6.1b=(a.y+2.H.1k)+"12"}3(2.w){2.4.6.M="1c"}v{2.4.6.M="A"}};8.9.2B=7(a){3(q a.1t!=="p"){2.1p=a.1t;2.1d()}3(q a.F!=="p"){2.1m=a.F;2.1d()}3(q a.1v!=="p"){2.1Q(a.1v)}3(q a.1B!=="p"){2.1H=a.1B}3(q a.1G!=="p"){2.S=a.1G}3(q a.1z!=="p"){2.H=a.1z}3(q a.1n!=="p"){2.17=a.1n}3(q a.U!=="p"){2.1q(a.U)}3(q a.13!=="p"){2.22(a.13)}3(q a.1C!=="p"){2.1E=a.1C}3(q a.1j!=="p"){2.P=a.1j}3(q a.1x!=="p"){2.1f=a.1x}3(q a.18!=="p"){2.w=a.18}3(q a.A!=="p"){2.w=!a.A}3(q a.1l!=="p"){2.16=a.1l}3(2.4){2.1y()}};8.9.1Q=7(a){2.Q=a;3(2.4){3(2.z){r.s.u.Y(2.z);2.z=t}3(!2.R){2.4.6.D=""}3(q a.1u==="p"){2.4.O=2.G()+a}v{2.4.O=2.G();2.4.1a(a)}3(!2.R){2.4.6.D=2.4.Z+"12";3(q a.1u==="p"){2.4.O=2.G()+a}v{2.4.O=2.G();2.4.1a(a)}}2.1w()}r.s.u.T(2,"2z")};8.9.1q=7(a){2.B=a;3(2.4){2.1y()}r.s.u.T(2,"21")};8.9.22=7(a){2.15=a;3(2.4){2.4.6.13=a}r.s.u.T(2,"2y")};8.9.2x=7(a){2.w=!a;3(2.4){2.4.6.M=(2.w?"1c":"A")}};8.9.2w=7(){K 2.Q};8.9.1A=7(){K 2.B};8.9.2v=7(){K 2.15};8.9.2u=7(){5 a;3((q 2.1D()==="p")||(2.1D()===t)){a=J}v{a=!2.w}K a};8.9.3i=7(){2.w=J;3(2.4){2.4.6.M="A"}};8.9.3j=7(){2.w=L;3(2.4){2.4.6.M="1c"}};8.9.2s=7(c,b){5 a=2;3(b){2.B=b.1A();2.14=r.s.u.2r(b,"21",7(){a.1q(2.1A())})}2.1N(c);3(2.4){2.1F()}};8.9.1r=7(){5 i;3(2.z){r.s.u.Y(2.z);2.z=t}3(2.E){1o(i=0;i<2.E.1L;i++){r.s.u.Y(2.E[i])}2.E=t}3(2.14){r.s.u.Y(2.14);2.14=t}3(2.V){r.s.u.Y(2.V);2.V=t}2.1N(t)};',62,210,"||this|if|div_|var|style|function|InfoBox|prototype||||||||||||||||undefined|typeof|google|maps|null|event|else|isHidden_|||closeListener_|visible|position_|parseInt|width|eventListeners_|boxStyle|getCloseBoxImg_|pixelOffset_|yOffset|false|return|true|visibility|currentStyle|innerHTML|closeBoxURL_|content_|fixedWidthSet_|maxWidth_|trigger|position|contextListener_|left|opacity|removeListener|offsetWidth||right|px|zIndex|moveListener_|zIndex_|enableEventPropagation_|alignBottom_|isHidden|addDomListener|appendChild|top|hidden|setBoxStyle_|document|infoBoxClearance_|bottom|new|stopPropagation|closeBoxURL|height|enableEventPropagation|boxStyle_|alignBottom|for|boxClass_|setPosition|close|defaultView|boxClass|nodeType|content|addClickHandler_|infoBoxClearance|draw|pixelOffset|getPosition|disableAutoPan|closeBoxMargin|getMap|closeBoxMargin_|panBox_|maxWidth|disableAutoPan_|pane_|cursor|push|length|click|setMap|mouseover|getBoxWidths_|setContent|OverlayView|borderRightWidth|borderLeftWidth|borderBottomWidth|borderTopWidth|getComputedStyle|100|Size|preventDefault|cancelBubble|position_changed|setZIndex|getProjection|offsetHeight|createInfoBoxDiv_|getBounds|getCloseClickHandler_|margin|pointer|relative|align|src|img|floatPane|domready|pane|infoBox|contextmenu|default|apply|touchmove|touchend|touchstart|dblclick|mouseup|mouseout|addListener|open|mousedown|getVisible|getZIndex|getContent|setVisible|zindex_changed|content_changed|auto|setOptions|fromLatLngToDivPixel|overflow|LatLng|removeChild|parentNode|onRemove|documentElement|getPanes|gif|ownerDocument|absolute|mapfiles|alpha|filter|div|Opacity|createElement|en_us|Alpha|Microsoft|DXImageTransform|progid|intl|MsFilter|returnValue|translateZ|WebkitTransform|com|hasOwnProperty|in|cssText|className|www|panBy|getCenter|http|fromLatLngToContainerPixel|arguments|getDiv|setCenter|2px|contains|show|hide|Map|instanceof|closeclick|firstChild".split("|"),0,{}));window.mapModule=window.mapModule||function(n,t,i,r){"use strict";function it(n,i){var e=new t.maps.LatLngBounds,r,u,f;if(nt(),n instanceof Array){if(n.length)for(r=0;r<n[0].Points.length;r++)n[0].Points[r].position=u=new t.maps.LatLng(n[0].Points[r].Latitude,n[0].Points[r].Longitude),f=n[0].Points[r],y(u,f,i),e.extend(u)}else for(r=0;r<n.Points.length;r++)u=new t.maps.LatLng(n.Points[r].Latitude,n.Points[r].Longitude),f=n.Points[r],y(u,f,i),e.extend(u);return e}function rt(){return new i({disableAutoPan:!1,pixelOffset:new t.maps.Size(-140,0),zIndex:null,boxStyle:{},closeBoxMargin:"5px 5px 0 0",closeBoxURL:"//www.google.com/intl/en_us/mapfiles/close.gif",infoBoxClearance:new t.maps.Size(1,1)})}function l(n){return n*Math.PI/180}function a(n,t){var i={lat:n.Latitude||n.lat(),lng:n.Longitude||n.lng()},r={lat:t.Latitude||t.lat(),lng:t.Longitude||t.lng()},u,f,e,o,s;return u=l(r.lat-i.lat),f=l(r.lng-i.lng),e=Math.sin(u/2)*Math.sin(u/2)+Math.cos(l(i.lat))*Math.cos(l(r.lat))*Math.sin(f/2)*Math.sin(f/2),o=2*Math.atan2(Math.sqrt(e),Math.sqrt(1-e)),s=6378137*o,s*.000621371}function y(i,r,e){var h=new t.maps.Marker({map:u,icon:"/~/media/"+r.MapPinId+".ashx",zIndex:r.MapPinZIndex,optimized:!1,position:i,title:r.Name}),l="",v,y;h.SiteId=r.SiteId;h.FacilityId=r.FacilityId;s.push(h);r.Address1||(r.Address1="");r.Address2||(r.Address2="");r.City||(r.City="");r.State||(r.State="");r.Zip||(r.Zip="");r.PhoneNumber||(r.PhoneNumber="");r.StoreUrl?(v=r.StoreUrl.split("."),y=v[0].split("loves"),l="#"+y[1],r.fullStoreNo=l):r.StoreUrl="";r.Highway||(r.Highway="");r.ExitNumber=r.ExitNumber?", Exit "+r.ExitNumber:"";t.maps.event.addListener(h,"click",function(){var t,s,l=function(){return f&&f.position?a(i,f.position).toFixed(2)+' miles from <img src="'+f.icon+'" alt="Search">':""};o&&o.close();o=rt();o.addListener("content_changed",function(){o.open(u,h)});e?e(o,r,l()):(t='<div id="iw-container">',t+='<div class="iw-title"><strong>'+r.fullStoreNo+" "+r.City+", "+r.State+"<\/strong><\/div>",t+='<div class="iw-content">',r.Highway&&r.ExitNumber?t+='<div class="iw_title">'+r.Highway+r.ExitNumber+"<\/div>":r.Highway&&(t+='<div class="iw_title">'+r.Highway+"<\/div>"),t+='<div class="iw_title">'+r.Address1+r.Address2+"<\/div>",t+='<div class="iw_title">'+r.City+", "+r.State+", "+r.Zip+"<\/div>",t+='<div class="iw_phone">'+r.PhoneNumber+"<\/div>",f&&f.position&&(t+='<div class="iw_title" style="float:right">'+l()+"<\/div>"),t+="<\/br>",t+='<div class="iw_directions">Directions <span onClick=showTo() class="click">'+c.FromHereItem+'<\/span> | <span onClick=showFrom() class="click">'+c.ToHereItem+"<\/span><\/div>",t+='<div id="searchTo">From here to: <div class="row collapse postfix-radius"><div class="small-9 columns"><input id="searchAddressTo" data-latlng="'+i+'" type="text"><\/div><div class="small-3 columns"><input type="button" onClick=getDir("fromHere","searchAddressTo") value="Go!" class="postfix"><\/div><\/div><\/div>',t+='<div id="searchFrom">To here from: <div class="row collapse postfix-radius"><div class="small-9 columns"><input id="searchAddressFrom" data-latlng="'+i+'" type="text"><\/div><div class="small-3 columns"><input type="button" onClick=getDir("toHere","searchAddressFrom") value="Go!" class="postfix"><\/div><\/div><\/div>',t+="<\/div>",t+="<\/div>",s=n('a.pin[latitude="'+r.Latitude+'"][longitude="'+r.Longitude+'"][href="#'+w+'"]'),s.length>0&&(s[0].innerHTML='Pinned <i class="fa fa-map-marker"><\/i>',s[0].style.color="red",n.each(n("a.pin").not(s[0]),function(n,t){t.innerHTML='Pin <i class="fa fa-map-marker"><\/i>';t.style.color="black"})),o.setContent(t))})}function nt(){for(var n=0;n<s.length;n++)s[n].setMap(null);s=[]}function ut(i,r,o,s){var l=new t.maps.LatLngBounds,v={mapTypeId:t.maps.MapTypeId.ROADMAP,minZoom:3,maxZoom:18,gestureHandling:"greedy"},a,c;w=i;d=o;u=new t.maps.Map(document.getElementById(i),v);r&&r.Site?(nt(),a=new t.maps.LatLng(r.Site.Latitude,r.Site.Longitude),c=r.Site.Addresses[0],c.ExitNumber=r.Site.ExitNumber,c.StoreUrl=n("#hdnStoreUrl").val().replace("{0}",r.Number),c.Highway=r.Site.Highway,c.PhoneNumber=r.ContactMethods.length>0?r.ContactMethods[0].Data:"",y(a,c,s),l.extend(a)):l=r.Points&&r.Points.length||r.length&&r[0].Points.length?it(r,s):new t.maps.LatLngBounds({lat:25.82,lng:-124.39},{lat:49.38,lng:-66.94});b=new t.maps.Geocoder;k=new t.maps.DirectionsService;h=new t.maps.DirectionsRenderer({suppressMarkers:!1});h.setPanel(document.getElementById("directionsPanel"));o&&e&&(f.setMap(u),l=new t.maps.LatLngBounds,l.extend(e));p(JSON.parse(JSON.stringify(l)),!1)}function p(i,r,f,e){var o=null,c,l=[],y,p;i.getCenter||(i=new t.maps.LatLngBounds({lat:i.south,lng:i.west},{lat:i.north,lng:i.east}));c=i.getCenter();y=i.getNorthEast().lat()-i.getSouthWest().lat()<1;v=r;h.setMap(null);l=s.filter(function(n){return i.contains(n.position)});l.length<=1&&(p=s.map(function(t){return n.extend({},t,{dist:a(t.position,c)})}).sort(function(n,t){return n.dist-t.dist}),o=e&&typeof e=="function"?e(p):null,o&&o.length>0&&(i=new t.maps.LatLngBounds,i.extend(c),o.forEach(function(n){i.extend(n.position)})));r&&tt(c,y);f&&(u.getZoom()?u.setZoom(f):u.addListener("bounds_changed",function(){t.maps.event.clearListeners(u,"bounds_changed");u.setZoom(f)}));u.fitBounds(i)}function tt(n,t){f.setMap(null);e=n;g.then(function(){var n={position:e,icon:"/~/media/"+c.SearchCenterPinId+".ashx",title:"Center of search"};t&&(n.map=u);f.setOptions(n)})}function ft(i,r){var u;if(i instanceof n&&i.length>0)u=i[0];else if(i instanceof HTMLInputElement)u=i;else return;return new t.maps.places.Autocomplete(u,r)}function et(){if(!u)return{then:function(){}};var i=u.getBounds(),r=n.Deferred(),f=function(){var t,f;i=i||u.getBounds();f=i.getCenter();t=s.filter(function(n){return i.contains(n.position)}).map(function(t){return n.extend({},t,{dist:a(t.position,f)})}).sort(function(n,t){return n.dist-t.dist});r.resolve(t.map(function(n){return n.FacilityId}))};return i?f():t.maps.event.addListener(u,"idle",function(){t.maps.event.clearListeners(u,"idle");f()}),r.promise()}function ot(){var i=n.Deferred();return e?i.resolve(e):t.maps.event.addListener(u,"center_changed",function(){i.resolve(u.getCenter())}),i.promise()}function st(i,r){var e=new t.maps.Geocoder,f=n.Deferred();return v=!0,e.geocode({address:i},function(n,i){var e,s,o;i==t.maps.GeocoderStatus.OK&&(e=n[0],s=e.geometry.bounds,o,o=s?s.getCenter():new t.maps.LatLng({lat:e.geometry.location.lat(),lng:e.geometry.location.lng()}),u.setOptions({center:o,zoom:r}),tt(o,!0),f.resolve())}),f.promise()}function ht(){return u.getBounds()}var u,w,o,b,k,h,s=[],v=!1,e,c,d,f=new t.maps.Marker({}),g=n.ajax({url:r._baseurl+r.locationDirectionsItems,type:"GET",cache:!1,success:function(n){c=n}});return navigator.geolocation&&navigator.geolocation.getCurrentPosition(function(n){var i;d===!1||v||(e=new t.maps.LatLng(n.coords.latitude,n.coords.longitude),console.log(n.coords),g.then(function(){f.setOptions({position:e,icon:"/~/media/"+c.MyLocationPinId+".ashx",title:"My location"})}),u&&(f.setMap(u),i=new t.maps.LatLngBounds,i.extend(e),p(JSON.parse(JSON.stringify(i)),!1)))},undefined,{enableHighAccuracy:!0}),window.showTo=function(){n("#searchTo").show();n("#searchFrom").hide();n(".iw_visit").hide();n(".iw_directions").hide()},window.showFrom=function(){n("#searchTo").hide();n("#searchFrom").show();n(".iw_visit").hide();n(".iw_directions").hide()},window.getDir=function(n,i){b.geocode({address:document.getElementById(i).value},function(r,f){var e,o,s,c,l,a;f==t.maps.GeocoderStatus.OK?(e=document.getElementById(i).getAttribute("data-latlng"),typeof e=="string"&&e.indexOf(",")>-1?(o=e.split(",")[0].split("(")[1],s=e.split(",")[1].split(")")[0],n==="toHere"?(c=r[0].geometry.location,l=new t.maps.LatLng(parseFloat(o),parseFloat(s))):n==="fromHere"&&(c=new t.maps.LatLng(parseFloat(o),parseFloat(s)),l=r[0].geometry.location),a={origin:c,destination:l,travelMode:t.maps.DirectionsTravelMode.DRIVING},k.route(a,function(n,i){i==t.maps.DirectionsStatus.OK&&(h.setDirections(n),h.setMap(u))})):document.getElementById(i).value="Directions cannot be computed at this time."):document.getElementById(i).value="Directions cannot be computed at this time."})},{initializeMap:ut,setBounds:function(n,t,i){p(n,!0,t,i)},createAutocomplete:ft,getShownStores:et,getCenter:ot,getBounds:ht,performSearch:st,getDistance:a}}(window.jQuery,window.google,window.InfoBox,window.Route)