var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),LegacyAppFederation,User,Marginal,Core;(function(n){var t=function(n){function t(){return n.call(this)||this}return __extends(t,n),t.prototype.RedirectToLegacyApplication=function(n){var t=this;this.getJsonWebToken().then(function(i){var r="".concat(i.Data.LegacyAppEntryPointUrl,"?targetAppId=").concat(n),u="".concat(i.Data.LegacyAppTarget);t.submitTokenAndRedirectToLegacyApp(r,i.Data.LegacyApplicationToken,u)})},t.prototype.submitTokenAndRedirectToLegacyApp=function(n,t,i){$('<form action="'.concat(n,'" method="post" target="').concat(i,'" style="display: none;">\n          <input name="Token" value="').concat(t,'" />\n        <\/form>')).appendTo("body").submit()},t.prototype.getJsonWebToken=function(){return this.getJson("/private/user/api/legacyapplicationtoken")},t}(Ajax.HttpService);n.LegacyAppFederationService=t})(LegacyAppFederation||(LegacyAppFederation={}));__extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),function(n){var t=function(n){function t(){var t=n.call(this)||this;return t.endpoint="/private/user/api/",t}return __extends(t,n),t.prototype.GetFeatureLinksDisplayFlags=function(){return this.getJson(this.getEndpoint("featurelinksdisplayflags"))},t.prototype.GetPrivateDocumentModel=function(){return this.getJson(this.getEndpoint("private-document-model-get"))},t.prototype.GetUserFeaturePermissions=function(){return this.getJson(this.getEndpoint("user-feature-permissions-get"))},t.prototype.OnLatestTermsAndConditionsVersion=function(){return this.getJson(this.getEndpoint("onLatestTermsAndConditionsVersion"))},t.prototype.GetUiRules=function(n){return this.postJson(this.getEndpoint("ui-rules-get"),n)},t.prototype.getEndpoint=function(n){return this.endpoint+n},t}(Ajax.HttpService);n.UserService=t}(User||(User={})),function(n){var t=function(){function n(){}return n}();n.HeaderNavigationModel=t}(Marginal||(Marginal={})),function(n){var t=function(){function t(t){var i=this;this.signInService=t;this.signInV2Enabled=$.dataJs("headerContainer").data("sign-in-v2-enabled");this.signInV2RedirectUrl=$.dataJs("headerContainer").data("sign-in-v2-url");this.storage=new Navigation.LocalStorage(Navigation.LocalStorageKeys.SignInComponent);$(function(){i.signInV2Enabled.toString().toLowerCase()==="true"?(Smile.Events.subscribe(Events.Action.OpenSignInPanel,function(n){if(n.username){var t={key:"username",value:n.username.toString()};i.storage.setItem(t)}window.location.href=n.redirectUrl?i.signInV2RedirectUrl+"?rp="+encodeURIComponent(n.redirectUrl):i.signInV2RedirectUrl}),Smile.Events.subscribe(Events.Action.ToggleSignInPanel,function(){window.location.href=i.signInV2RedirectUrl})):i.signInPanel=new n.SignInPanel(i.signInService)})}return t}();n.SignInV2Interceptor=t}(Marginal||(Marginal={}));Smile.createNamespace(Smile,"Smile.Marginal.SignInV2Interceptor");Smile.Marginal.SignInV2Interceptor=new Marginal.SignInV2Interceptor(new Ajax.SignInService),function(n){var t=function(){function n(n,t){var i=this;this.setCurrentPage=function(){var i=Smile.Core.getUserCookie(),n=[],r=null,t;if(i&&($("[data-js=userSelectLink]").each(function(t,u){u.removeAttribute("aria-current");r=u.getAttribute("data-user-type");i.toLowerCase()===r.toLowerCase()&&n.push(u)}),n.length>0))for(t=0;t<n.length;t++)n[t].setAttribute("aria-current","page")};this.openSignInPanelWithUsername=function(n,t){Smile.Events.fire(Events.Action.OpenSignInPanel,{redirectUrl:t,username:n})};this.openSignInPanel=function(n){i.userSelectionPanelVisible()&&i.toggleUserSelectionPanel();Smile.Layout.isTabletOrMobile()&&(Smile.Marginal.HeaderNavigation.closeAnyOpenMegaMenu(),Smile.Marginal.HeaderNavigation.closeMobileItems());Smile.Events.fire(Events.Action.OpenSignInPanel,{redirectUrl:n})};this.toggleSignInPanel=function(){i.userSelectionPanelVisible()&&i.toggleUserSelectionPanel();Smile.Marginal.MobileMenu.isVisible()&&Smile.Marginal.MobileMenu.toggleMobileMenu("hide");Smile.Events.fire(Events.Action.ToggleSignInPanel)};this.toggleSignedInMenu=function(){var n,t;i.userSelectionPanelVisible()&&i.toggleUserSelectionPanel();n=$("#myAccountButton");n.attr("aria-expanded","".concat(!i.signedInMenuVisible()));i.isMouseAction||i.signedInMenuVisible()||(t=i.$headerContainer.dataJs("signOut"),Core.JQueryUtils.trapFocusInMenu(i.$signedInMenu,n,t));i.$signedInMenu.slideToggle()};this.setMyAccountFocus=function(){i.isMouseAction?($("#myAccountButton").focus(),i.isMouseAction=!1):setTimeout(function(){$("#myAccountButton").focus().toggleClass("is-focused-by-tab")},60)};this.toggleUserSelectionPanel=function(){Smile.Layout.isTabletOrMobile()&&(i.signInPanelVisible()&&i.toggleSignInPanel(),i.signedInMenuVisible()&&i.toggleSignedInMenu(),i.$mobileUserSelectionPanel.slideToggle({complete:function(){var t=$.dataJs("toggleUserSelectionPanel"),n;t.toggleClass("active");n=t.find("a");n.attr("aria-expanded",(n.attr("aria-expanded")!=="true").toString())}}))};this.skipToBodyContent=function(){$("#page-body-content").focus()};this.signOut=function(){return i.signInService.signOut()};this.userSelectionPanelVisible=function(){return i.$mobileUserSelectionPanel.is(":visible")};this.signInPanelVisible=function(){return $.dataJs("signInPanel").is(":visible")};this.signedInMenuVisible=function(){return i.$signedInMenu.is(":visible")};this.bindView=function(){i.$headerContainer=$.dataJs("headerContainer");i.$mobileUserSelectionPanel=i.$headerContainer.dataJs("mobileUserSelectionPanel");i.$signedInMenu=i.$headerContainer.dataJs("signedInMenu");i.$mobileUserSelectionPanelHeader=i.$headerContainer.dataJs("mobileUserSelectionPanelHeader");i.$desktopUserSelectionPanel=i.$headerContainer.dataJs("desktopUserSelectionPanel")};this.handleUserSelection=function(n){n.preventDefault();var t=$(n.currentTarget),r=t.data("userType");if(Smile.Core.getUserCookie()===r.toLowerCase()){i.toggleUserSelectionPanel();return}Smile.User.IsLegacyUser&&r.toLowerCase()==="patient"&&Smile.Core.clearSaiCookie();Smile.Core.setUserCookie(r);t.attr("aria-current","page");window.location.href=t.attr("href")};this.forceUserSelectionPanelToDisplay=function(){i.$mobileUserSelectionPanel.show();$.dataJs("toggleUserSelectionPanel").addClass("active")};this.showHideHeaderComponents=function(){var n=Smile.Core.getUserCookie()===undefined;Smile.Layout.isDesktop()&&(i.$desktopUserSelectionPanel.show(),i.$mobileUserSelectionPanelHeader.hide(),i.$mobileUserSelectionPanel.hide());Smile.Layout.isTablet()&&(i.$mobileUserSelectionPanelHeader.show(),i.$desktopUserSelectionPanel.hide(),i.viewData.displayOnTablet&&n?i.forceUserSelectionPanelToDisplay():i.$mobileUserSelectionPanel.hide());Smile.Layout.isMobile()&&(i.$mobileUserSelectionPanelHeader.show(),i.$desktopUserSelectionPanel.hide(),i.viewData.displayOnMobile&&n?i.forceUserSelectionPanelToDisplay():i.$mobileUserSelectionPanel.hide())};this.signInService=n;this.viewData=t;$(function(){var n;i.bindView();i.$headerContainer.on("click","[data-js=toggleSignInPanel]",function(n){n.preventDefault();i.toggleSignInPanel()}).on("click","[data-js=toggleSignedInMenu]",function(n){n.preventDefault();i.toggleSignedInMenu()}).on("click","[data-js=toggleUserSelectionPanel]",function(){i.toggleUserSelectionPanel()}).on("click","[data-js=userSelectLink]",function(n){i.handleUserSelection(n)}).on("click","[data-js=signOut]",function(){i.signOut()}).on("click","[data-js=skipToMainContent]",function(){i.skipToBodyContent()}).on("keydown","[data-js=signedInMenu]",function(n){n.key==="Escape"&&(n.preventDefault(),i.toggleSignedInMenu(),i.setMyAccountFocus())}).on("keydown","#myAccountButton",function(n){n.key==="Enter"&&(i.isMouseAction=!1)}).on("mouseover","#myAccountButton",function(){i.isMouseAction=!0}).on("click","#closeMenuButton",function(){i.setMyAccountFocus()});(n=Core.JQueryUtils)===null||n===void 0?void 0:n.addCustomTooltip("closeMenuButton","Close");Smile.Events.subscribe(Events.Action.SignOut,i.signOut);$(window).on("resize",function(){i.showHideHeaderComponents()});i.showHideHeaderComponents();i.setCurrentPage()})}return n}();n.HeaderBar=t}(Marginal||(Marginal={}));Smile.createNamespace(Smile,"Smile.Marginal");Smile.createNamespace(Smile,"Smile.Marginal.HeaderBar"),function(n){var t=function(){function t(t,i){var r=this;this.legacyAppFederationService=t;this.userService=i;this.showMegaMenu=function(n,t){var e=n.dataJs("navToggleButton"),f,i,u;(e.attr("aria-expanded","true"),f=n.hasClass("jqMenuOpened"),t==="click"&&Smile.Layout.isTabletOrMobile()&&(n.find("a").first().removeAttr("href"),r.closeAnyOpenMegaMenu()),f)||(Smile.Marginal.MobileMenu.isVisible()&&Smile.Marginal.MobileMenu.toggleMobileMenu("hide"),i=n.dataJs("navToggleSection"),i&&(n.addClass("jqMenuOpened"),i.css({display:"block",opacity:"0"}),u={display:"block",maxHeight:260,height:"100%",opacity:1},Smile.Layout.viewportWidth()<=980&&!Smile.Layout.isMobile()?(u.maxHeight=n.find(".col-1").height(),i.stop(!0).animate(u,1e3)):i.stop(!0).animate(u,400)))};this.hideMegaMenu=function(n){var t=n.dataJs("navToggleSection"),r=n.dataJs("navToggleButton"),i;r.attr("aria-expanded","false");n.removeClass("jqMenuOpened");i={display:"none",maxHeight:0,height:"0%"};t&&t.stop(!0).animate(i,400,function(){t.hide()})};this.closeAnyOpenMegaMenu=function(){var n=jQuery("li.jqMenuOpened");n.length>0&&r.hideMegaMenu(n)};this.closeMobileItems=function(){Smile.Marginal.MobileMenu.toggleMobileMenu("hide");Smile.Marginal.MobileSearch.hideMobileSearch();Smile.Layout.mobileNoScroll.unset()};this.getNavItems=function(){return r.$headerNavItems};this.navigationMenu=function(){return r.$navigationMenu};this.toggleSignInPanel=function(){Smile.Marginal.HeaderBar.toggleSignInPanel()};this.toggleMobileMenu=function(){var n=$("[data-js=toggleMobileMenu]");n.attr("aria-expanded","true");Smile.Marginal.MobileMenu.toggleMobileMenu(null,250)};this.showMobileSearch=function(){var n=$("[data-js=showSearchBox]");n.attr("aria-expanded","true");Smile.Marginal.MobileSearch.showMobileSearch(250)};this.documentClickedHandler=function(n){r.$headerNavItems.is(n.target)||r.$headerNavItems.has(n.target).length!==0||r.closeAnyOpenMegaMenu()};this.toggleComponentVisibility=function(){Smile.Layout.isDesktop()&&(Smile.Marginal.MobileMenu.toggleMobileMenu("hide"),r.$navigationMenu.is(":visible")||r.$navigationMenu.show(),r.$navSearchBox.is(":visible")||r.$navSearchBox.show());Smile.Layout.isTablet()&&(Smile.Marginal.MobileSearch.isVisible()?r.$navigationMenu.hide():(r.$navigationMenu.show(),r.$navSearchBox.hide()));Smile.Layout.isMobile()||Smile.Layout.mobileNoScroll.unset()};this.doSearch=function(){var t=r.$navSearchInput,n;t.val()&&(n=new URLSearchParams,n.set("q",t.val().toString()),window.location.href="/search-results?"+n.toString())};this.fixedEncodeURIComponent=function(n){return encodeURIComponent(n).replace(/[!'()*]/g,function(n){return"%"+n.charCodeAt(0).toString(16).toUpperCase()})};this.bindView=function(){r.$headerNavigation=$.dataJs("headerNavigation");r.$headerNavItems=r.$headerNavigation.dataJs("toggleNavItem");r.$navigationMenu=r.$headerNavigation.dataJs("navigationMenu");r.$navSearchBox=r.$headerNavigation.dataJs("navSearchBox");r.$navSearchSubmit=r.$headerNavigation.dataJs("submitSearchButton");r.$screenReaderInstructions=r.$headerNavigation.dataJs("screenReaderInstructions");r.$navSearchInput=r.$headerNavigation.dataJs("searchSubmitInput");r.$legacySignOutBtn=$.dataJs("legacySignoutBtn");r.vm=new n.HeaderNavigationModel;r.vm.GoToApplication=function(n){r.userService.OnLatestTermsAndConditionsVersion().then(function(t){t.Data.OnLatestTermsAndConditionsVersion?r.redirectToLegacyApplicationEntryPointUrl(n):document.location.href=t.Data.RedirectUrl})};r.vm.DisplayApplicationLink=function(n,t,i,r){return r=="oe"&&n||r=="op"&&t||r=="or"&&i};ko.applyBindings(r.vm,r.$headerNavigation[0])};this.changeSignOutButtonToLegacy=function(){var n=$.dataJs("legacyLogoutBtnFromModel").attr("href");r.$legacySignOutBtn.attr("href",n)};$(function(){r.bindView();r.$headerNavigation.on("click","[data-js=toggleSignInPanel]",function(n){n.preventDefault();r.toggleSignInPanel()}).on("click","[data-js=toggleMobileMenu]",function(n){n.preventDefault();r.toggleMobileMenu()}).on("click","[data-js=showSearchBox]",function(n){n.preventDefault();r.showMobileSearch()}).on("click","[data-js=signOut]",function(){Smile.Marginal.HeaderBar.signOut()});if(Smile.Layout.isDesktop()){r.$headerNavItems.hover(function(n){return r.showMegaMenu($(n.currentTarget),n.type)},function(n){return r.hideMegaMenu($(n.currentTarget))}).on("click","button.chevron",function(n){return r.toggleMegaMenu(n)});$("html").on("keyup",function(n){return r.handleKeyInputMegaMenu(n)})}else{r.$headerNavItems.on("click",function(n){return r.showMegaMenu($(n.currentTarget),n.type)});$("html").on("click",function(n){return r.documentClickedHandler(n)})}$(window).on("resize",function(){r.toggleComponentVisibility()});r.$navSearchSubmit.on("click",function(n){n.preventDefault();r.doSearch()});r.$navSearchBox.keypress(function(n){n.keyCode===13&&(n.preventDefault(),r.doSearch())});r.$navSearchInput.on("focus",function(){r.$screenReaderInstructions.attr("aria-hidden","false")});r.$navSearchInput.on("blur",function(){r.$screenReaderInstructions.attr("aria-hidden","true")});var n=$(".ui-helper-hidden-accessible"),t=$("#ClientID_SolrSearchInterface");n.insertAfter(t);Smile.User.IsLegacyAuth&&r.changeSignOutButtonToLegacy()})}return t.prototype.toggleMegaMenu=function(n){n.preventDefault();var t=$(n.currentTarget).parents(".nav-item"),i=t.hasClass("jqMenuOpened");this.closeAnyOpenMegaMenu();i||this.showMegaMenu(t,n.type)},t.prototype.handleKeyInputMegaMenu=function(n){var t=$(document.activeElement).parents(".smile_megapanel_icon, .smile_megapanel_list").length!==0;n.keyCode!==9||t?n.keyCode===27&&t&&this.closeAnyOpenMegaMenu():this.closeAnyOpenMegaMenu()},t.prototype.redirectToLegacyApplicationEntryPointUrl=function(n){this.legacyAppFederationService.RedirectToLegacyApplication(n.toUpperCase())},t}();n.HeaderNavigation=t}(Marginal||(Marginal={}));Smile.createNamespace(Smile,"Smile.Marginal.HeaderNavigation");Smile.Marginal.HeaderNavigation=new Marginal.HeaderNavigation(new LegacyAppFederation.LegacyAppFederationService,new User.UserService),function(n){var t=function(){function n(n){var t=this;this.toggleSignInPanel=function(){t.isVisible()&&t.hideMobileMenu();Smile.Marginal.HeaderBar.toggleSignInPanel()};this.toggleMobileMenu=function(n,i){i=i||0;n||(t.isVisible()?t.hideMobileMenu(i):t.showMobileMenu(i));n==="show"?t.showMobileMenu(i):n==="hide"&&t.hideMobileMenu(i)};this.isVisible=function(){return t.$mobileMenu.is(":visible")};this.toggleNavItem=function(n){var u=n.currentTarget,t=$(u||n),i=t.dataJs("navToggleButton"),r=t.dataJs("navToggleSection");r.length&&(t.toggleClass("jqMobileMenuOpen"),i.attr("aria-expanded",(i.attr("aria-expanded")!=="true").toString()),r.slideToggle(1e3))};this.showMobileMenu=function(n){n===void 0&&(n=0);Smile.Marginal.HeaderBar.signInPanelVisible()&&Smile.Marginal.HeaderBar.toggleSignInPanel();Smile.Marginal.MobileSearch.isVisible()&&Smile.Marginal.MobileSearch.hideMobileSearch();t.$mobileMenu.fadeIn(n);t.$mobileMenuButton.addClass("active");Smile.Layout.isMobile()&&Smile.Layout.mobileNoScroll.set();Core.JQueryUtils.trapFocusInMenuForMobile(t.$mobileMenu);(Smile.User.IsAuth||Smile.User.IsLegacyAuth)&&!t.$myAccountNavItem.hasClass("jqMobileMenuOpen")&&t.toggleNavItem(t.$myAccountNavItem)};this.hideMobileMenu=function(n){n===void 0&&(n=0);t.$mobileMenu.fadeOut(n,function(){t.$mobileMenuButton.focus();t.$mobileMenuButton.addClass("is-focused-by-tab");Core.JQueryUtils.releaseFocusTrap(t.$mobileMenu)});t.$mobileMenuButton.removeClass("active");t.$mobileMenuButton.attr("aria-expanded","false");Smile.Layout.isMobile()&&Smile.Layout.mobileNoScroll.unset()};this.showMobileSearch=function(n){Smile.Marginal.MobileSearch.isVisible()||Smile.Marginal.MobileSearch.showMobileSearch(n)};this.addMenuItems=function(){var n,i,r;(Smile.User.IsAuth||Smile.User.IsLegacyAuth)&&(n=$.dataJs("signedInMenuList"),n.children().each(function(n,i){t.$myAccountLinks.append($(i).clone())}));i=Smile.Marginal.HeaderNavigation.getNavItems();r=t.$mobileMenu.dataJs("toggleNavItem");i.reverse().each(function(n,t){var i=$(t).clone(),u=i[0].getAttribute("name");u!=="ItemNoMenu"&&i.find("a").first().removeAttr("href");r.first().after(i)})};this.bindView=function(){t.$mobileMenuButton=$.dataJs("toggleMobileMenu");t.$mobileMenu=$.dataJs("mobileMenu");t.$myAccountLinks=t.$mobileMenu.dataJs("myAccountLinks");t.$myAccountNavItem=t.$mobileMenu.dataJs("toggleNavItem").first();t.$legacySignoutButton=$.dataJs("legacySignout")};this.signOut=function(){return t.signInService.signOut()};this.changeSignOutButtonToLegacy=function(){var n=$.dataJs("legacyLogoutBtnFromModel").attr("href");t.$legacySignoutButton.attr("href",n)};$(function(){t.signInService=n;t.bindView();t.$mobileMenu.on("click","[data-js=closeMobileMenu]",function(n){n.preventDefault();t.hideMobileMenu(250)});t.$mobileMenu.on("click","[data-js=openMobileSearch]",function(n){n.preventDefault();t.showMobileSearch(250)});t.$mobileMenu.on("click","[data-js=toggleSignInPanel]",function(n){n.preventDefault();t.toggleSignInPanel()});t.$mobileMenu.on("click","[data-js=toggleNavItem]",function(n){return t.toggleNavItem(n)});t.$mobileMenu.on("click","[data-js=signOut]",function(){t.signOut()});t.addMenuItems();Smile.User.IsLegacyAuth&&t.changeSignOutButtonToLegacy()})}return n}();n.MobileMenu=t}(Marginal||(Marginal={}));Smile.createNamespace(Smile,"Smile.Marginal.MobileMenu");Smile.Marginal.MobileMenu=new Marginal.MobileMenu(new Ajax.SignInService),function(n){var t=function(){function n(){var n=this;this.showMobileSearch=function(t){t=t||0;Smile.Marginal.MobileMenu.isVisible()&&Smile.Marginal.MobileMenu.toggleMobileMenu("hide",t);Smile.Marginal.HeaderBar.userSelectionPanelVisible()&&Smile.Marginal.HeaderBar.toggleUserSelectionPanel();Smile.Marginal.HeaderBar.signInPanelVisible()&&Smile.Marginal.HeaderBar.toggleSignInPanel();n.$navSearchButton.addClass("active");n.$navigationMenu.fadeOut(t);n.$navButtons.fadeOut(t,function(){n.$navSearchBox.fadeIn(t).css("display","table-cell").dataJs("searchSubmit").focus();Core.JQueryUtils.trapFocusInMenuForMobile(n.$navSearchBox)});n.visible=!0;Smile.Layout.isMobile()&&Smile.Layout.mobileNoScroll.set()};this.hideMobileSearch=function(t){t=t||0;n.$navSearchButton.removeClass("active");n.$navSearchButton.attr("aria-expanded","false");n.$navSearchBox.fadeOut(t,function(){n.$navigationMenu.fadeIn(t);n.$navButtons.fadeIn(t);n.$navSearchButton.focus();n.$navSearchButton.addClass("is-focused-by-tab");Core.JQueryUtils.releaseFocusTrap(n.$navSearchBox)});n.visible=!1;Smile.Layout.isMobile()&&Smile.Layout.mobileNoScroll.unset()};this.isVisible=function(){return n.visible};this.bindView=function(){n.$navigationMenu=Smile.Marginal.HeaderNavigation.navigationMenu();n.$navButtons=$.dataJs("navButtons");n.$navSearchBox=$.dataJs("navSearchBox");n.$navSearchButton=n.$navButtons.dataJs("showSearchBox")};$(function(){n.bindView();n.visible=!1;n.$navSearchBox.on("click","[data-js=hideMobileSearch]",function(t){t.preventDefault();n.hideMobileSearch(250)})})}return n}();n.MobileSearch=t}(Marginal||(Marginal={}));Smile.createNamespace(Smile,"Smile.Marginal.MobileSearch");Smile.Marginal.MobileSearch=new Marginal.MobileSearch,function(n){var t=function(){function n(n){var t=this;this.bindView=function(){t.$messageContainer=$.dataJs("globalMessage-alertContainer");t.$dismissLinkContainer=t.$messageContainer.dataJs("globalMessage-dismissLinkContainer");t.$messageItemsContainer=t.$messageContainer.dataJs("alert-mesage-container")};this.setDismissalCookie=function(){Core.setCookie("AlertMessageLastDismissDate",t.$serverDate,365)};this.hideDimissibleAlerts=function(){t.$dismissLinkContainer.hide();jQuery('div[data-alertdismissible="True"]').hide();t.checkForOpen()};this.checkForOpen=function(){t.$messageItemsContainer.children(":visible").length==0&&t.$messageContainer.css({display:"none"})};this.$serverDate=n;$(function(){t.bindView();jQuery(window).resize(function(){Smile.Layout.isMobile()?t.$dismissLinkContainer.dataJs("global-message-dismissal-link").html("Dismiss"):t.$dismissLinkContainer.dataJs("global-message-dismissal-link").html('<img src="/Assets/images/smile/green-close.svg" alt="Dismiss alert message panel">')});t.$messageContainer.on("click","[data-js=global-message-dismissal-link]",function(n){n.preventDefault();t.setDismissalCookie();t.hideDimissibleAlerts()})})}return n}();n.GlobalMessage=t}(Marginal||(Marginal={}));Smile.createNamespace(Smile,"Smile.Marginal");Smile.createNamespace(Smile,"Smile.Marginal.GlobalMessage"),function(n){var t=function(){function n(){}return n.InsuranceTypeCookie="dp_its",n.InsuranceTypeDataLoadedEvent="InsuranceTypeDataLoaded",n.MobilePanelDimissedSessionKey="MEMX_MPD",n.VISION="VISION",n}();n.InsuranceTypeConstants=t}(Marginal||(Marginal={})),function(n){var t=function(){function t(){var t=this;this.initWidget=function(){var i=t,r;window.onresize=function(){i.vueObject.$data.IsMobile=Smile.Layout.isMobile()};r={el:"#insuranceTypeSelectionContainer",store:null,computed:null,data:function(){return{SelectedInsuranceType:null,InsuranceTypes:[],IsMobile:Smile.Layout.isMobile(),MobilePanelExpanded:Smile.Layout.isMobile()&&sessionStorage.getItem(n.InsuranceTypeConstants.MobilePanelDimissedSessionKey)!="true",MenuItemsDisabled:!1,DefaultInsuranceType:"",MobileHeaderLabel:"",MobileHeaderClosureLabel:""}},methods:{onInsuranceTypeSelection:function(n,t){this.setSelectedInsuranceType(n);window.setTimeout(function(){window.location.href=t},0)},setRenderingProperties:function(n){this.$data.InsuranceTypes=n.InsuranceTypes;this.$data.SelectedInsuranceType=n.SelectedInsuranceType;this.$data.DefaultInsuranceType=n.DefaultInsuranceType;this.$data.MobileHeaderLabel=n.MobileHeaderLabel;this.$data.MobileHeaderClosureLabel=n.MobileHeaderClosureLabel;this.$data.MenuItemsDisabled=this.$data.InsuranceTypes.length<=1},toggleMobileExpansion:function(){this.$data.MobilePanelExpanded=!this.$data.MobilePanelExpanded;this.$data.MobilePanelExpanded||sessionStorage.setItem(n.InsuranceTypeConstants.MobilePanelDimissedSessionKey,"true")},setSelectedInsuranceType:function(n){var r=this,t=this.$data.InsuranceTypes.filter(function(t){return t.ReferenceKey==n})[0];t||(t=this.$data.InsuranceTypes.filter(function(n){return n.ReferenceKey==r.$data.DefaultInsuranceType})[0],t||(t=this.$data.InsuranceTypes[0]));this.$data.SelectedInsuranceType=t;i.setInsuranceTypeCookie(t.ReferenceKey)}},created:function(){var t=this;Smile.Events.subscribe(n.InsuranceTypeConstants.InsuranceTypeDataLoadedEvent,function(n){t.setRenderingProperties(n)});Smile.Events.subscribe(Events.Action.DashboardLoadedEvent,function(n){var i=t.$data.InsuranceTypes.filter(function(t){return t.Link==n.url})[0];i&&t.setSelectedInsuranceType(i.ReferenceKey)})},mounted:function(){var n=document.getElementById("insuranceTypeSelectionContainer");n&&n.classList.contains("hidden")&&n.classList.remove("hidden")}};t.vueObject=new Vue(r)};this.initWidget()}return t.prototype.loadExternalData=function(t){var i,u=t.SelectOptions,f=(i=Cookies.get(n.InsuranceTypeConstants.InsuranceTypeCookie))!==null&&i!==void 0?i:t.DefaultInsuranceType,r=u.filter(function(n){return n.ReferenceKey==f})[0];r||(r=u[0]);Smile.Events.fire(n.InsuranceTypeConstants.InsuranceTypeDataLoadedEvent,{InsuranceTypes:t.SelectOptions,SelectedInsuranceType:r,DefaultInsuranceType:t.DefaultInsuranceType,MobileHeaderLabel:t.MobileHeaderLabel,MobileHeaderClosureLabel:t.MobileHeaderClosureLabel})},t.prototype.setInsuranceTypeCookie=function(t){Cookies.set(n.InsuranceTypeConstants.InsuranceTypeCookie,t)},t}();n.InsuranceTypeSelectionView=t}(Marginal||(Marginal={}));Smile.createNamespace(Smile.Feature,"Smile.Marginal.InsuranceTypeSelection");Smile.Feature.InsuranceTypeSelection=new Marginal.InsuranceTypeSelectionView,function(n){var t=function(){function n(){}return n.customizeSmallDataTablePagination=function(n){var t=$(n).parents(".dataTables_wrapper"),i,r,u;t.find(".dataTables_info").parent().removeClass(["col-md-5","col-sm-12"]).addClass(["col-12","d-flex","justify-content-center"]);i=t.find(".dataTables_paginate").parent().removeClass(["col-md-7","col-sm-12"]).addClass("col-12");i.find("ul.pagination").addClass("justify-content-center");r=n+"_paginate";u=$("".concat(r," > ul")).children();u.filter(".disabled").each(function(){var n,t,i,r;(t=(n=this.querySelectorAll("a"))===null||n===void 0?void 0:n[0])===null||t===void 0?void 0:t.setAttribute("aria-disabled","true");(r=(i=this.querySelectorAll("a"))===null||i===void 0?void 0:i[0])===null||r===void 0?void 0:r.setAttribute("tabindex","-1")})},n.HandleCollapse=function(n){if(Smile.Layout.isMobile()||Smile.Layout.isTabletPortrait()){var t=jQuery(n.currentTarget).find(".chevron");t.length&&(t.toggleClass("closedAccord"),jQuery(n.currentTarget).next().animate({height:"toggle"},1e3))}},n.customizeAdaDataTablePagination=function(n){var i,r,u;$("".concat(n)).removeAttr("aria-describedby");var t=n+"_paginate",e=$("".concat(t," > ul")).children(),f=(i=e.filter(".active"))===null||i===void 0?void 0:i[0];!f||(f.setAttribute("aria-current","page"),(u=(r=f.querySelectorAll("a"))===null||r===void 0?void 0:r[0])===null||u===void 0?void 0:u.setAttribute("disabled","disabled"),e.filter(".disabled").each(function(){var n,t,i,r,u,f;(t=(n=this.querySelectorAll("a"))===null||n===void 0?void 0:n[0])===null||t===void 0?void 0:t.setAttribute("disabled","disabled");(r=(i=this.querySelectorAll("a"))===null||i===void 0?void 0:i[0])===null||r===void 0?void 0:r.setAttribute("aria-disabled","true");(f=(u=this.querySelectorAll("a"))===null||u===void 0?void 0:u[0])===null||f===void 0?void 0:f.setAttribute("tabindex","-1")}),$("".concat(t," > ul > li.paginate_button")).each(function(n,t){var i=$(t).html().replace('<a href="#"','<button role="button"').replace("a>","button>");$(t).children()[0].replaceWith($.parseHTML(i)[0]);$(t).children().removeAttr("aria-controls")}),$(t).parent()[0].nodeName!=="NAV"&&$(t).wrap('<nav aria-label="pagination"><\/nav>'))},n.customizeAdaDataTable=function(n,t){var r,i;for(t===void 0&&(t=!1),r=$("".concat(n," > thead > tr")),i=0;i<r.children().length;i++)r.children()[i].setAttribute("scope","col"),t&&r.children()[i].setAttribute("role","button"),r.children()[i].hasAttribute("aria-sort")||r.children()[i].setAttribute("aria-sort","none");$("".concat(n," > tbody > tr")).each(function(n,t){$(t).removeAttr("role");var i=$(t).html().trim().replace("<td",'<th scope="row" style="font-weight: 400 !important;"');$(t).children()[0].replaceWith($.parseHTML(i)[0])})},n.customizeAdaDataTableRemoveGridAndRowRoles=function(n){$("".concat(n," thead > tr, ").concat(n," tbody > tr")).each(function(n,t){$(t).removeAttr("role")});$("".concat(n)).removeAttr("role")},n.customizeAdaEmptyDataTable=function(n,t){$("".concat(n," .dataTables_empty")).length?($("".concat(n)).attr("role","presentation"),$("".concat(n," caption")).attr("aria-hidden","true"),$("".concat(n," thead")).attr("aria-hidden","true"),$("".concat(n," .dataTables_empty")).attr("role","alert"),$("".concat(n," .dataTables_empty")).text(t)):($("".concat(n)).removeAttr("role"),$("".concat(n," caption")).removeAttr("aria-hidden"),$("".concat(n," thead")).removeAttr("aria-hidden"))},n.trapFocusInMenu=function(n,t,i){setTimeout(function(){t.addClass("is-focused-by-tab");t.focus();n.on("keydown",function(n){n.target===t[0]&&n.key==="Tab"&&n.shiftKey?(n.preventDefault(),i.focus()):n.target!==i[0]||n.key!=="Tab"||n.shiftKey||(n.preventDefault(),t.focus())})},50)},n.addCustomTooltip=function(n,t){var i=document.getElementById(n),r,u,f;i&&(r=document.createElement("div"),r.innerHTML='<div id="customTooltip'.concat(n,'" class="custom-tooltip" role="tooltip">\n              ').concat(t,"\n            <\/div>"),i.appendChild(r.firstChild),u=function(){var t=document.getElementById("customTooltip".concat(n));t&&(t.style.display="block")},f=function(){var t=document.getElementById("customTooltip".concat(n));t&&(t.style.display="none")},i.addEventListener("focus",function(){u()}),i.addEventListener("mouseenter",function(){u()}),i.addEventListener("blur",function(){f()}),i.addEventListener("mouseleave",function(){f()}))},n.trapFocusInMenuForMobile=function(n){setTimeout(function(){var i=n.find('\n      a[href], area[href], input:not([disabled]), select:not([disabled]),\n      textarea:not([disabled]), button:not([disabled]),\n      iframe, object, embed, [tabindex]:not([tabindex="-1"]), [contenteditable]\n    ').filter(":visible"),t,u,r;if(i.length!==0){t=i[0];u=i[i.length-1];$(t).addClass("is-focused-by-tab").focus();n.on("keydown.trapFocus",function(n){n.key==="Tab"&&(n.shiftKey&&n.target===t?(n.preventDefault(),$(u).focus()):n.shiftKey||n.target!==u||(n.preventDefault(),$(t).focus()))});r=!1;$(document).on("focusin.trapFocus",function(i){r||n[0].contains(i.target)||(r=!0,$(t).focus(),setTimeout(function(){r=!1},0))})}},50)},n.releaseFocusTrap=function(n){n&&(n.off(".trapFocus"),$(document).off(".trapFocus"),n=null)},n}();n.JQueryUtils=t}(Core||(Core={}))