"use strict";function _toConsumableArray(n){if(Array.isArray(n)){for(var t=0,i=Array(n.length);t<n.length;t++)i[t]=n[t];return i}return Array.from(n)}function _classCallCheck(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function deleteCookie(n,t,i){getCookie$1(n)&&(document.cookie=n+"="+(t?";path="+t:"")+(i?";domain="+i:"")+";expires=Thu, 01 Jan 1970 00:00:01 GMT")}function createCookie(n,t,i){var u,r;i?(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toGMTString()):u="";document.cookie=n+"="+t+u+"; path=/"}function getCookie$1(n){return document.cookie.split(";").some(function(t){return t.trim().startsWith(n+"=")})}function removeAllSfPersonalizationCookies(){document.cookie.split(";").forEach(function(n){if(n.trim().startsWith("sf-prs")){var t=n.trim().split("=")[0];deleteCookie(t)}})}function MapMarker(n,t,i){function o(n){return n*Math.PI/180}function a(n,t,i,r){var u=o(i-n),f=o(r-t);n=o(n);i=o(i);var e=Math.sin(u/2)*Math.sin(u/2)+Math.sin(f/2)*Math.sin(f/2)*Math.cos(n)*Math.cos(i),s=2*Math.atan2(Math.sqrt(e),Math.sqrt(1-e));return 6371*s/1.609}var s=null,r=document.querySelectorAll(".locations-listings article.enable-on-map"),h=-1,e={},u,f,l;if(e.position=new google.maps.LatLng(n.lat,n.long),e.map=t,n.icon&&(e.icon=n.icon),s=new google.maps.Marker(e),i.extend(s.position),t.fitBounds(i),r.length<6){for(u=0;u<r.length;u++)for(f=1;f<r.length;f++){var v=r[u].getAttribute("data-lat"),y=r[u].getAttribute("data-lng"),p=r[f].getAttribute("data-lat"),w=r[f].getAttribute("data-lng"),c;c=a(v,y,p,w);c>h&&(h=c)}h<=.5&&(l=google.maps.event.addListener(t,"idle",function(){t.getZoom()>15&&t.setZoom(15);google.maps.event.removeListener(l)}))}s.addListener("click",function(){var u=n.link,t=document.getElementById(n.id),f=document.querySelectorAll(".location-item.active"),i=document.querySelector(".location-search .location-details"),e=document.querySelector(".location-search"),r;if(t.classList.contains("active")){var c=document.querySelector(".location-item.active"),l=document.querySelector(".location-search .location-details"),a=document.querySelector(".location-search");l.classList.remove("open");a.classList.remove("showing-detail-pane");c.classList.remove("active")}else{i.classList.remove("open");f.forEach(function(n){n.classList.remove("active")});i.classList.add("open");LocationDetails.pullData(u);t.classList.add("active");e.classList.add("showing-detail-pane");var o=document.getElementById(n.id),s=document.querySelector("header.site-header").clientHeight,h=document.querySelector(".locations-listing").offsetTop-(s+30);window.scroll({top:h,behavior:"smooth"});document.querySelector(".locations-pane").scrollTop=o.getAttribute("data-top");r=LocationDetails.getSlugURL(n.name);LocationDetails.changeURL(r)}});this.id=n.id}var _createClass=function(){function n(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}return function(t,i,r){return i&&n(t.prototype,i),r&&n(t,r),t}}(),PolyfillHelpers=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"main",value:function(){window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach);Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);Element.prototype.closest||(Element.prototype.closest=function(n){var t=this;do{if(Element.prototype.matches.call(t,n))return t;t=t.parentElement||t.parentNode}while(t!==null&&t.nodeType===1);return null})}}]),n}(),ImageLoader=function(){function n(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,n);this.queue=[];this.backgroundQueue=[];this.lazyImageObserver=null;this.lazyBgObserver=null;this.options=t}return _createClass(n,[{key:"initialize",value:function(){var n=this;if(this.getImagesToLazyLoad(),!("IntersectionObserver"in window)){this.abort();return}this.onContentLoaded();this.setGenericPlaceholder();this.queue.forEach(function(t){n.lazyImageObserver.observe(t)});this.backgroundQueue.forEach(function(t){n.lazyBgObserver.observe(t)})}},{key:"getImagesToLazyLoad",value:function(){this.queue=document.querySelectorAll(".img-load-lazy");this.backgroundQueue=document.querySelectorAll(".lazy-load-bg")}},{key:"setGenericPlaceholder",value:function(){var n=this;this.options.genericImagePlaceholder&&this.queue.forEach(function(t){t.setAttribute("src",n.options.genericImagePlaceholder)});this.options.genericBgPlaceholder&&this.backgroundQueue.forEach(function(t){t.style.backgroundColor=n.options.genericBgPlaceholder})}},{key:"onContentLoaded",value:function(){var n=this;this.lazyImageObserver=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting){var i=t.target;i.src=i.dataset.src;i.dataset.srcset&&(i.srcset=i.dataset.srcset);i.classList.remove("img-load-lazy");n.lazyImageObserver.unobserve(i)}})});this.lazyBgObserver=new IntersectionObserver(function(t){t.forEach(function(t){t.isIntersecting&&(t.target.classList.remove("lazy-load-bg"),n.lazyBgObserver.unobserve(t.target))})})}},{key:"abort",value:function(){for(var t,n=0;n<this.queue.length;n++)this.queue[n].setAttribute("src",this.queue[n].getAttribute("data-src")),this.queue[n].classList.remove("img-load-lazy");for(t=0;t<this.backgroundQueue.length;t++)this.backgroundQueue[t].classList.remove("lazy-load-bg")}}]),n}(),getCookie=function(n){return document.cookie.split("; ").reduce(function(t,i){var r=i.split("=");return r[0]===n?decodeURIComponent(r[1]):t},"")},isIE=function(){var n=window.navigator.userAgent,t=n.indexOf("MSIE ");return t>0||!!navigator.userAgent.match(/Trident.*rv\:11\./)},StorageHelper=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"storeItem",value:function(n,t){this.localStorageIsSupported()&&localStorage.setItem(n,t)}},{key:"getItem",value:function(n){if(this.localStorageIsSupported())return localStorage.getItem(n)}},{key:"setCookie",value:function(n,t,i){var r=new Date,u;r.setTime(r.getTime()+i*864e5);u="expires="+r.toUTCString();document.cookie=n+"="+t+";"+u+";path=/"}},{key:"getCookie",value:function(n){for(var r=n+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)===" ";)t=t.substring(1);if(t.indexOf(r)===0)return t.substring(r.length,t.length)}return""}},{key:"localStorageIsSupported",value:function(){var n="test",t=window.sessionStorage;try{return t.setItem(n,"1"),t.removeItem(n),!0}catch(i){return!1}}}]),n}(),Alerts=function(){function n(){_classCallCheck(this,n);this.alerts=document.querySelectorAll(".alert");this.alertCloseBtn=document.querySelectorAll(".close-alert-btn");this.alerts.length&&this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.alertCloseBtn.forEach(function(t){t.addEventListener("click",function(t){t.preventDefault();n.closeAlert(t)})});this.checkStorage()}},{key:"checkStorage",value:function(){var n=getCookie("region_code");this.alerts.forEach(function(t){var r=t.getAttribute("id"),u=StorageHelper.getItem(r),i=t.getAttribute("data-segment");t.classList.contains("only-ie")||(u!=null?u=="closed"?document.querySelector("#"+r+"").style.display="none":(i==n||i==null||i==""||i=="all")&&(document.querySelector("#"+r+"").style.display="block",document.querySelector("body").classList.add("alerts-showing")):(i==n||i==null||i==""||i=="all")&&(document.querySelector("#"+r+"").style.display="block",document.querySelector("body").classList.add("alerts-showing")));t.classList.contains("only-ie")&&isIE()&&document.querySelector("body").classList.add("alerts-showing")})}},{key:"closeAlert",value:function(n){n.preventDefault();var t=n.currentTarget.closest(".alert"),i=t.getAttribute("id");t.style.display="none";StorageHelper.storeItem(i,"closed")}}]),n}(),AnchorLinks=function(){function n(){_classCallCheck(this,n);this.anchorLinks=document.querySelector(".anchor-links");this.h2s=document.querySelectorAll("h2.section-title, .generic-content h2");this.breakpoint=1323.98;this.anchorLinks&&this.h2s.length&&this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.h2s.forEach(function(t,i){var u=t.innerHTML,f=u.replace(/\s/g,"-").toLowerCase(),r="";t.id?r=t.id:(r="anchorlink-"+f+"-"+i+"",t.setAttribute("id",r));n.createAnchorLink(u,r)})}},{key:"createAnchorLink",value:function(n,t){var u=this,o=this.anchorLinks.querySelector("ul"),f=this.anchorLinks.querySelector(".js-mobile-anchor-list"),e=document.createElement("li"),i=document.createElement("a"),r;i.setAttribute("href","#"+t+"");i.setAttribute("class","anchor-link-item");i.setAttribute("aria-label","click to scroll down to "+n+"");i.innerHTML=n;e.appendChild(i);r=document.createElement("option");r.setAttribute("value",t);r.innerHTML=n;o.appendChild(e);f.appendChild(r);i.addEventListener("click",function(n){u.jumpToAnchor(n,t)});f.addEventListener("change",function(n){u.jumpToAnchor(n,n.currentTarget.value)})}},{key:"jumpToAnchor",value:function(n,t){n.preventDefault();var i=document.getElementById(t);i.scrollIntoView({behavior:"smooth",block:"center"})}}]),n}(),Accordions=function(){function n(){_classCallCheck(this,n);this.accordions=document.querySelectorAll(".accordion");this.accordionTitle=document.querySelectorAll(".accordion-title");this.accordions.length&&this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.accordionTitle.forEach(function(t){t.addEventListener("click",function(t){n.toggleAccordion(t)});t.addEventListener("keypress",function(t){n.toggleAccordion(t)})})}},{key:"toggleAccordion",value:function(n){var t=n.currentTarget.closest(".accordion"),i=t.querySelector(".accordion-content"),r=t.querySelector(".accordion-title"),u=t.parentNode.querySelectorAll(".accordion.open");t.classList.contains("open")?(t.classList.remove("open"),i.style.display="none",r.setAttribute("aria-expanded",!1),n.currentTarget.blur()):(u.forEach(function(n){n.classList.remove("open");n.querySelector(".accordion-content").style.display="none";n.querySelector(".accordion-title").setAttribute("aria-expanded",!1)}),t.classList.add("open"),i.style.display="block",r.setAttribute("aria-expanded",!0),window.outerWidth<991.98&&t.scrollIntoView())}}]),n}(),heroStandard=function(){function n(){_classCallCheck(this,n);this.breakpoint=991.98;this.isPageEditor=document.querySelector(".sfPageEditor");this.hero=document.querySelector(".hero-standard");this.heroText=document.querySelector(".hero-standard .hero-text-background");this.hero!="undefined"&&this.hero!=null&&(this.isPageEditor==="undefined"||this.isPageEditor===null)&&this.init()}return _createClass(n,[{key:"init",value:function(){this.hasDescription();this.hasStockTicker()}},{key:"makeBackgroundImage",value:function(){var n=document.querySelector(".hero-standard .js-hero-photo"),t;n&&(t=n.getAttribute("data-background-src"),this.hero.style.backgroundImage="url('"+t+"')")}},{key:"setMobileBackgroundImage",value:function(){var n=document.querySelector(".hero-standard .js-hero-photo"),t;n&&(t=n.getAttribute("data-background-src"),this.heroText.style.backgroundImage=window.innerWidth<this.breakpoint?"url('"+t+"')":"none")}},{key:"hasDescription",value:function(){var n=this.hero.querySelector(".hero-text .desc");n&&this.hero.classList.add("has-description")}},{key:"hasStockTicker",value:function(){var n=this.hero.querySelector(".optional-widgets .hero-stock-ticker");n&&(this.hero.classList.add("has-stock-ticker"),this.setStockTickerData())}},{key:"setStockTickerData",value:function(){var n=document.querySelector(".hero-stock-ticker .ticker-box");window.fetch&&fetch("/stock/get-stock-price").then(function(n){return n.json()}).then(function(t){t.Error&&(n.style.display="none");var i=JSON.parse(t.Price),r=(i.data[0].changeNumber+"").includes("-")?"down":"up";n.innerHTML='\n                    <header class="stock-header">\n                        <div class="ticker-symbol">\n                            <div class="symbol-text">NWE<\/div>\n                            <div class="symbol-indicator '+r+'">\n                                <svg><use href="/ResourcePackages/ST/library/img/svg-sprites.svg#triangle-up-skinny"><\/use><\/svg>\n                            <\/div>\n                        <\/div>\n                        <div class="ticker-price">'+i.data[0].lastTrade+'<\/div>\n                    <\/header>\n            \n                    <div class="differential">\n                        <span class="price-diff">'+(r=="up"?"+":"")+i.data[0].changeNumber+" ("+(r=="up"?"+":"")+i.data[0].changePercent+'%)<\/span>\n                        <span class="arrow-diff '+r+'">\n                            <svg><use href="/ResourcePackages/ST/library/img/svg-sprites.svg#triangle-up"><\/use><\/svg>\n                        <\/span>\n                    <\/div>\n\n                    '+function(){return i.data[0].date?'<div class="stock-date">Data as of '+new Date(i.data[0].date).toLocaleString()+"<\/div>":""}()+'\n            \n                    <div class="price-chart">\n                        <img\n                            src="/ResourcePackages/ST/library/img/stockticker-wavelength.png"\n                            alt="ticker price chart"\n                            role="presentation" />\n                    <\/div>\n                '}).catch(function(n){console.log(n)})}}]),n}(),AspectRatio=function(){function n(t){_classCallCheck(this,n);this.ratioX=t.ratio[0];this.ratioY=t.ratio[1];this.element=t.element}return _createClass(n,[{key:"maintain",value:function(){var n=this;this.setAspectRatio();window.addEventListener("resize",function(){n.setAspectRatio()})}},{key:"setAspectRatio",value:function(){var n=this.element.clientWidth,t=this.ratioY/this.ratioX,i=n*t;this.element.style.height=i+"px"}}]),n}(),maintainImageAspectRatios=function(){var i=!!window.MSInputMethodContext&&!!document.documentMode,t,n;i||(t=document.querySelectorAll("[data-ratio]"),n=[],t.forEach(function(t,i){var r=t.getAttribute("data-ratio").split(",");n[i]=new AspectRatio({ratio:[r[0],r[1]],element:t});n[i].maintain()}))},FeaturedMedia=function(){function n(){_classCallCheck(this,n);this.featuredMediaItems=document.querySelectorAll(".featured-media-item");this.closeMediaModal=document.querySelectorAll(".js-close-featured-media-modal");this.playVideoBtn=document.querySelectorAll(".js-play-icon");this.prevSlideBtn=document.querySelectorAll(".js-previous-media");this.nextSlideBtn=document.querySelectorAll(".js-next-media");this.loadMoreBtns=document.querySelectorAll(".js-load-more-media");this.featuredMediaItems.length&&this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.checkTotalItems();this.featuredMediaItems.forEach(function(t){t.querySelector(".js-open-media-modal").addEventListener("click",function(i){i.preventDefault();n.openModal(t)})});this.closeMediaModal.forEach(function(t){t.addEventListener("click",n.closeModal)});this.closeMediaModal.forEach(function(t){t.addEventListener("keypress",n.closeModal)});this.nextSlideBtn.forEach(function(t){t.addEventListener("click",function(t){n.nextSlide(t)})});this.prevSlideBtn.forEach(function(t){t.addEventListener("click",function(t){n.previousSlide(t)})});this.loadMoreBtns.forEach(function(t){t.addEventListener("click",function(t){n.loadMore(t)})})}},{key:"checkTotalItems",value:function(){var n=document.querySelectorAll(".featured-media-cards");n.forEach(function(n){var i=n.querySelectorAll(".featured-media-item"),r=n.querySelector(".js-load-more-media"),t;i.length>6&&(r.classList.add("show"),t=n.querySelectorAll(".featured-media-item"),t.forEach(function(n,t){t>5&&(n.closest("[class^=col-").style.display="none",n.closest("[class^=col-").classList.add("hide"))}))})}},{key:"loadMore",value:function(n){n.preventDefault();var i=n.currentTarget.closest(".featured-media-cards"),r=i.querySelectorAll(".featured-media-item"),t=i.querySelectorAll(".cards-row > .hide").length,u=r.length,f=u-t+6;t>0&&r.forEach(function(n,t){t<f&&(n.closest("[class^=col-").style.display="block",n.closest("[class^=col-").classList.remove("hide"))});t<6&&(n.currentTarget.style.display="none");maintainImageAspectRatios()}},{key:"openModal",value:function(n){var h=n.closest(".featured-media-cards"),t=h.querySelector(".featured-media-modal"),u=t.querySelector(".js-next-media"),f=t.querySelector(".js-previous-media"),c=t.querySelector(".js-close-featured-media-modal"),l=n.querySelector(".has-media"),r=[{stillImageHTML:t.querySelector(".js-still-image"),playIconHTML:t.querySelector(".still-image .js-play-icon"),videoHTML:t.querySelector(".js-video .video-wrapper"),headlineHTML:t.querySelector(".slide-headline"),descHTML:t.querySelector(".slide-desc"),downloadImageBtn:t.querySelector(".slide-download-btn")}],i=[{id:n.getAttribute("id"),title:n.querySelector(".card-title").innerHTML,desc:n.getAttribute("data-full-description"),fullImage:n.getAttribute("data-full-image"),imageAlt:n.querySelector(".js-open-media-modal .thumb").getAttribute("data-full-image-alt-text"),isVideo:n.classList.contains("video")?!0:!1,videoIframe:n.getAttribute("data-video-embed")}];r[0].headlineHTML.innerHTML=i[0].title;r[0].stillImageHTML.src=i[0].fullImage;r[0].stillImageHTML.setAttribute("alt",i[0].imageAlt);r[0].descHTML.innerHTML=i[0].desc;r[0].downloadImageBtn.setAttribute("href",i[0].fullImage);t.style.display="flex";n.closest("[class^=col-]").classList.add("open");c.focus();l&&i[0].isVideo&&(t.classList.add("video-type"),r[0].videoHTML.innerHTML=i[0].videoIframe);var e=n.closest("[class^=col-]"),o=e.nextElementSibling,s=e.previousElementSibling;!o||o.classList.contains("hide")?u.classList.add("disabled"):u.classList.remove("disabled");!s||s.classList.contains("hide")?f.classList.add("disabled"):f.classList.remove("disabled")}},{key:"closeModal",value:function(n){var r,i;n.preventDefault();var f=n.currentTarget.closest(".featured-media-cards"),u=f.querySelector(".cards-row > .open"),t=n.currentTarget.closest(".featured-media-modal");t.classList.contains("video-type")&&(r=t.querySelector(".js-video iframe"),r.parentNode.removeChild(r));t.style.display="none";t.classList.remove("video-type");u.classList.remove("open");i=n.code;i!=undefined&&(i=="Enter"||i=="Space")&&u.querySelector(".js-open-media-modal").focus()}},{key:"nextSlide",value:function(n){n.preventDefault();var i=n.currentTarget.closest(".featured-media-cards"),r=i.querySelector(".cards-row > .open"),t=r.nextElementSibling;this.closeModal(n);t?this.openModal(t.querySelector(".featured-media-item")):console.log("no more items")}},{key:"previousSlide",value:function(n){n.preventDefault();var i=n.currentTarget.closest(".featured-media-cards"),r=i.querySelector(".cards-row > .open"),t=r.previousElementSibling;this.closeModal(n);t?this.openModal(t.querySelector(".featured-media-item")):console.log("no more items")}}]),n}(),Menu=function(){function n(){_classCallCheck(this,n);this.mobileBreakpoint=1324;this.body=document.querySelector("body");this.mobileMenu=document.querySelector(".main-menu");this.mobileMenuBtn=document.querySelector(".js-mobile-menu-btn");this.tier1=document.querySelectorAll(".main-menu li.tier1.has-children");this.mobileSubmenuIcon=document.querySelectorAll(".main-menu li.tier1.has-children > a .toggle-icon");this.mobileMenuBtnHandler=this.mobileMenuBtnHandler.bind(this);this.MobileSubmenuIconHandler=this.MobileSubmenuIconHandler.bind(this);this.overlayClickHandler=this.overlayClickHandler.bind(this);this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.addBindingListeners();window.addEventListener("resize",function(){n.addBindingListeners()})}},{key:"addBindingListeners",value:function(){this.unbindMobile();this.unbindDesktop();window.innerWidth>this.mobileBreakpoint?(this.fixDesktopTabIndex(),this.desktopBindings()):(this.fixMobileTabIndex(),this.mobileBindings())}},{key:"fixMobileTabIndex",value:function(){document.querySelector(".skip-to-main-content").setAttribute("tabindex","1");document.querySelector(".utility-nav .js-open-service-area").setAttribute("tabindex","2");document.querySelector(".utility-nav .js-open-search").setAttribute("tabindex","3");document.querySelector(".utility-nav li.outages a").setAttribute("tabindex","4");document.querySelector(".utility-nav li.customer-service a").setAttribute("tabindex","5")}},{key:"fixDesktopTabIndex",value:function(){document.querySelector(".skip-to-main-content").setAttribute("tabindex","0");document.querySelector(".utility-nav .js-open-service-area").setAttribute("tabindex","0");document.querySelector(".utility-nav .js-open-search").setAttribute("tabindex","0");document.querySelector(".utility-nav li.outages a").setAttribute("tabindex","0");document.querySelector(".utility-nav li.customer-service a").setAttribute("tabindex","0")}},{key:"desktopBindings",value:function(){var t=this;this.tier1.forEach(function(i){i.addEventListener("mouseenter",t.openSubmenu);window.innerWidth>t.mobileBreakpoint&&i.addEventListener("mouseleave",n.closeSubmenu)});this.tier1.forEach(function(n){n.addEventListener("focusin",t.openSubmenu)});document.querySelector(".main-menu").addEventListener("mouseleave",n.closeSubmenu);document.querySelector(".main-menu .login-btn").addEventListener("mouseenter",n.closeSubmenu);document.querySelector("a").addEventListener("focusin",this.overlayClickHandler);document.querySelector("body").addEventListener("click",this.overlayClickHandler);document.querySelector("body").classList.contains("nav-open")&&(document.querySelector("body").classList.remove("nav-open"),document.querySelector(".js-mobile-menu-btn").classList.remove("open"),document.querySelector(".js-mobile-menu-btn .text").innerText="MENU")}},{key:"unbindDesktop",value:function(){var t=this;this.tier1.forEach(function(n){n.removeEventListener("mouseenter",t.openSubmenu);n.removeEventListener("focusin",t.openSubmenu)});document.querySelector(".main-menu").removeEventListener("mouseleave",n.closeSubmenu);document.querySelector(".main-menu .login-btn").removeEventListener("mouseenter",n.closeSubmenu);document.querySelector("body").removeEventListener("click",this.overlayClickHandler);document.querySelector("a").removeEventListener("focusin",this.overlayClickHandler)}},{key:"mobileBindings",value:function(){var n=this;this.mobileMenuBtn.addEventListener("click",this.mobileMenuBtnHandler);this.mobileSubmenuIcon.forEach(function(t){t.addEventListener("click",n.MobileSubmenuIconHandler)});this.mobileSubmenuIcon.forEach(function(t){t.addEventListener("keypress",n.MobileSubmenuIconHandler)})}},{key:"unbindMobile",value:function(){var n=this;this.mobileMenuBtn.removeEventListener("click",this.mobileMenuBtnHandler);this.mobileSubmenuIcon.forEach(function(t){t.removeEventListener("click",n.MobileSubmenuIconHandler)});this.mobileSubmenuIcon.forEach(function(t){t.removeEventListener("keypress",n.MobileSubmenuIconHandler)})}},{key:"overlayClickHandler",value:function(t){t.currentTarget.closest(".main-menu")||n.closeSubmenu()}},{key:"openSubmenu",value:function(n){var t=n.currentTarget,i=t.closest("li");document.querySelectorAll(".main-menu li.tier1.open").forEach(function(n){n.classList.remove("open")});i.classList.add("open");document.querySelector("body").classList.add("show-overlay")}},{key:"mobileMenuBtnHandler",value:function(t){t.preventDefault();document.querySelector("body").classList.contains("nav-open")?n.closeMobileMenu():this.openMobileMenu()}},{key:"openMobileMenu",value:function(){Login.closeMobileLogin();var n=document.querySelector(".main-menu");this.body.classList.add("nav-open");this.mobileMenuBtn.classList.add("open");this.mobileMenuBtn.querySelector(".text").textContent="CLOSE"}},{key:"MobileSubmenuIconHandler",value:function(t){var i,r;if(t.preventDefault(),i=t.code,i!=undefined&&i!=="Enter"&&i!=="Space")return!1;r=t.currentTarget.closest("li");r.classList.contains("open")?n.closeSubmenu():this.openSubmenu(t)}}],[{key:"closeSubmenu",value:function(){var n=document.querySelectorAll(".main-menu li.tier1.open");n.forEach(function(n){n.classList.remove("open")});document.querySelector("body").classList.remove("show-overlay")}},{key:"closeMobileMenu",value:function(){var n=document.querySelector(".js-mobile-menu-btn"),t=document.querySelector(".main-menu");document.querySelector("body").classList.remove("nav-open","show-overlay");n.classList.remove("open");n.querySelector(".text").textContent="MENU"}}]),n}(),SearchBox=function(){function n(){_classCallCheck(this,n);this.mobileBreakpoint=1324;this.openSearchBtn=document.querySelector(".js-open-search");this.closeSearchBtn=document.querySelector(".js-close-search");this.utilityNav=document.querySelector(".utility-nav");this.init()}return _createClass(n,[{key:"init",value:function(){var t=this;if(!this.closeSearchBtn||!this.openSearchBtn||!this.utilityNav){this.openSearchBtn&&(this.openSearchBtn.style.display="none");return}this.openSearchBtn.addEventListener("click",function(n){n.preventDefault();t.openSearch()});this.openSearchBtn.addEventListener("keypress",function(n){n.preventDefault();var i=n.which;(i===13||i===32)&&t.openSearch()});this.closeSearchBtn.addEventListener("click",function(t){t.preventDefault();n.closeSearch()});this.closeSearchBtn.addEventListener("keypress",function(t){t.preventDefault();var i=t.which;(i===13||i===32)&&n.closeSearch()})}},{key:"openSearch",value:function(){window.innerWidth<this.mobileBreakpoint&&(Menu.closeMobileMenu(),Login.closeMobileLogin());var n=document.querySelector(".utility-flyout.search-dropdown");n.classList.add("open");this.utilityNav.classList.add("flyout-open");document.querySelector("body").classList.add("utility-flyout-open");document.querySelector("#search-site").focus()}}],[{key:"closeSearch",value:function(){document.querySelector(".utility-flyout.search-dropdown").classList.remove("open");document.querySelector(".utility-nav").classList.remove("flyout-open");document.querySelector("body").classList.remove("utility-flyout-open");document.querySelector(".js-open-search").focus()}}]),n}(),setUserSegment=function(n){var t="";switch(n){case"montana":t="montana";break;case"south dakota":t="southdakota";break;case"nebraska":t="nebraska";break;default:t=null}t&&(removeAllSfPersonalizationCookies(),deleteCookie("region_code"),createCookie("region_code",t,365),setTimeout(function(){window.location.reload()},100))},ServiceArea=function(){function n(){(_classCallCheck(this,n),this.mobileBreakpoint=1324,this.openServiceBtn=document.querySelector(".js-open-service-area"),this.closeServiceBtn=document.querySelector(".js-close-service-area"),this.helpBtn=document.querySelector(".js-service-area-help-btn"),this.utilityNav=document.querySelector(".utility-nav"),this.openServiceBtn&&this.closeServiceBtn)&&this.init()}return _createClass(n,[{key:"init",value:function(){var i=this,t;this.openServiceBtn.addEventListener("click",function(n){n.preventDefault();i.openServiceArea()});this.openServiceBtn.addEventListener("keypress",function(n){n.preventDefault();var t=n.which;(t===13||t===32)&&i.openServiceArea()});this.closeServiceBtn.addEventListener("click",function(t){t.preventDefault();n.closeServiceArea()});this.closeServiceBtn.addEventListener("keypress",function(t){t.preventDefault();var i=t.which;console.log(keycode);(i===13||i===32)&&n.closeServiceArea()});this.helpBtn.addEventListener("click",function(t){t.preventDefault();n.toggleServiceHelpModal()});t=document.querySelector("#service-area-select");t&&(t.onchange=function(){setUserSegment(t.value.toLowerCase())});n.setSelectedRegionText()}},{key:"openServiceArea",value:function(){window.innerWidth<this.mobileBreakpoint&&(Menu.closeMobileMenu(),SearchBox.closeSearch(),Login.closeMobileLogin());var n=document.querySelector(".utility-flyout.service-area-dropdown");n.classList.add("open");this.utilityNav.classList.add("flyout-open");document.querySelector("body").classList.add("utility-flyout-open");document.querySelector("#service-area-select").focus()}}],[{key:"closeServiceArea",value:function(){document.querySelector(".utility-flyout.service-area-dropdown").classList.remove("open");document.querySelector(".utility-nav").classList.remove("flyout-open");document.querySelector("body").classList.remove("utility-flyout-open");document.querySelector(".js-open-service-area").focus();var n=document.querySelector(".js-service-area-help-btn"),t=document.querySelector(".js-service-area-help-btn .text"),i=document.querySelector("#help-info-modal");i.classList.remove("open");n.classList.remove("open");t.textContent="Why do we ask you to do this?"}},{key:"toggleServiceHelpModal",value:function(){var t=document.querySelector(".js-service-area-help-btn"),i=document.querySelector(".js-service-area-help-btn .text"),n=document.querySelector("#help-info-modal");n.classList.contains("open")?(n.classList.remove("open"),t.classList.remove("open"),i.textContent="Why do we ask you to do this?"):(n.classList.add("open"),t.classList.add("open"),i.textContent="Close Informational Panel")}},{key:"setSelectedRegionText",value:function(){var r=document.querySelector(".js-open-service-area .text"),t=getCookie("region_code"),u,n,i;t&&t!=""&&r&&(u={montana:"Montana",southdakota:"South Dakota",nebraska:"Nebraska"},n=u[t],n&&(r.innerText=n+", USA"),i=document.querySelector("#service-area-select"),i&&(i.value=n))}}]),n}(),Login=function(){function n(){_classCallCheck(this,n);this.mobileBreakpoint=1324;this.mobileLoginBtn=document.querySelector(".mobile-header .js-mobile-login-btn");this.loginDropdown=document.querySelector("header.site-header .mobile-login-dropdown");typeof this.mobileLoginBtn!="undefined"&&this.mobileLoginBtn!=null&&this.init()}return _createClass(n,[{key:"init",value:function(){var t=this;this.mobileLoginBtn.addEventListener("click",function(i){i.preventDefault();document.querySelector("body").classList.contains("login-open")?n.closeMobileLogin():t.openMobileLogin()})}},{key:"openMobileLogin",value:function(){window.innerWidth<this.mobileBreakpoint&&(Menu.closeMobileMenu(),SearchBox.closeSearch(),ServiceArea.closeServiceArea());document.querySelector("body").classList.add("login-open");this.mobileLoginBtn.classList.add("open");this.mobileLoginBtn.querySelector(".text").textContent="CLOSE";this.loginDropdown.classList.add("open");this.mobileLoginBtn.focus()}}],[{key:"closeMobileLogin",value:function(){var n=document.querySelector(".mobile-header .js-mobile-login-btn");document.querySelector("body").classList.remove("login-open");n.classList.remove("open");n.querySelector(".text").textContent="LOGIN";document.querySelector("header.site-header .mobile-login-dropdown").classList.remove("open")}}]),n}(),LocationDetails=function(){function n(){_classCallCheck(this,n);this.locationSearch=document.querySelector(".location-search");this.locationItems=document.querySelectorAll(".location-item");this.viewDetailsBtn=document.querySelectorAll(".location-item .js-view-details-btn");this.detailsBox=document.querySelector(".location-search .location-details");this.closeDetailsBtn=document.querySelectorAll(".location-search .js-close-location-detail");this.href=window.location.href;this.apiPath="";this.detailPath="/locationdetails/getdetails/";this.breakpoint=992;this.locationItems.length&&this.init()}return _createClass(n,[{key:"init",value:function(){var t=this;this.OpenDetailsOnPageLoad();this.viewDetailsBtn.forEach(function(n){n.addEventListener("click",function(n){t.openLocationDetails(n)})});this.closeDetailsBtn.forEach(function(t){t.addEventListener("click",function(t){t.preventDefault();n.closeDetailBox()})})}},{key:"openLocationDetails",value:function(t){t.preventDefault();this.apiPath=t.currentTarget.getAttribute("href");var i=t.target.closest(".location-item"),r=document.querySelectorAll(".location-item.active"),u=n.getSlugURL(i.querySelector(".location-title").innerHTML);i.classList.contains("active")?this.closeDetailBox():(this.detailsBox.classList.remove("open"),r.forEach(function(n){n.classList.remove("active")}),this.detailsBox.classList.add("open"),n.pullData(this.apiPath),i.classList.add("active"),this.locationSearch.classList.add("showing-detail-pane"));n.changeURL(u)}},{key:"OpenDetailsOnPageLoad",value:function(){var t=this,i=document.querySelectorAll(".location-item"),r=document.querySelector("#js-filter-locations-by-state");i.forEach(function(i){var r=n.getSlugURL(i.querySelector(".location-title").innerHTML);t.apiPath=i.querySelector(".js-view-details-btn").getAttribute("href");t.href.indexOf(r)>-1&&(t.detailsBox.classList.add("open"),n.pullData(t.apiPath),i.classList.add("active"),t.locationSearch.classList.add("showing-detail-pane"))})}}],[{key:"closeDetailBox",value:function(){var n=document.querySelectorAll(".location-item"),t=document.querySelector(".location-search .location-details"),i=document.querySelector(".location-search");t.classList.remove("open");i.classList.remove("showing-detail-pane");n.forEach(function(n){n.classList.remove("active")});window.history.replaceState(null,null,window.location.pathname)}},{key:"pullData",value:function(n){fetch(n).then(function(n){return n.ok?n.json():Promise.reject(n)}).then(function(n){var t=n.name===undefined?JSON.parse(n):n,l=document.querySelector(".location-details .location-title"),h=document.querySelector(".location-details .photo"),a=document.querySelector(".location-details .directions-btn"),v=document.querySelector(".location-details .call-btn"),y=document.querySelector(".location-details .location-address .street"),p=document.querySelector(".location-details .location-address .city"),w=document.querySelector(".location-details .location-address .state"),b=document.querySelector(".location-details .location-address .zip"),i=document.querySelector(".location-details .call-btn"),k=document.querySelector(".location-details .location-types"),r=document.querySelector(".location-details .location-info .hours-cat-1 .content"),d=document.querySelector(".location-details .location-info .hours-cat-1 .group-headline"),u=document.querySelector(".location-details .location-info .hours-cat-2 .content"),g=document.querySelector(".location-details .location-info .hours-cat-2 .group-headline"),f=document.querySelector(".location-details .location-info .available-services .content"),nt=document.querySelector(".location-details .location-info .available-services .group-headline"),e=document.querySelector(".location-details .generic-content-block"),s,c,o;h.style.backgroundImage="url('"+t.photo+"')";l.innerHTML=t.name;k.innerHTML=t.types;s=t.phone.replace(/\D/g,"");v.setAttribute("href","tel:+1"+s+"");a.setAttribute("href",""+t.googleMapsLink+"");y.innerHTML=t.street;p.innerHTML=t.city;w.innerHTML=t.state;b.innerHTML=t.zip;t.phone&&t.phone!=""?(i.setAttribute("href","tel:+1"+s+""),i.innerHTML=t.phone,i.parentNode.classList.remove("sr-only")):i.parentNode.classList.add("sr-only");t.hoursCategory1Headline&&t.hoursCategory1Headline!=""?(d.innerHTML=t.hoursCategory1Headline,r.innerHTML=t.hoursCategory1,r.closest(".hours-cat-1").style.display="block"):(r.innerHTML="",r.closest(".hours-cat-1").style.display="none");t.hoursCategory2Headline&&t.hoursCategory2Headline!=""?(g.innerHTML=t.hoursCategory2Headline,u.innerHTML=t.hoursCategory2,u.closest(".hours-cat-2").style.display="block"):(u.innerHTML="",u.closest(".hours-cat-2").style.display="none");t.availableServices?(c=t.availableServices.split("|"),o="<ul>",c.forEach(function(n){o+="<li>"+n+"<\/li>"}),o+="<\/ul>",nt.innerHTML=t.availableServicesHeadline,f.innerHTML=o,f.closest(".available-services").style.display="block"):(f.innerHTML="",f.closest(".available-services").style.display="none");t.genericContentBlock&&t.genericContentBlock!=""?(e.innerHTML=t.genericContentBlock,e.style.display="block"):(e.innerHTML="",e.style.display="none");h.style.display=t.photo?"block":"none"}).catch(function(n){console.warn("Error fetching location details.",n)})}},{key:"changeURL",value:function(n){var t=new URLSearchParams(window.location.search);t.set("id",n);t.set("state",encodeURI(document.querySelector("#js-filter-locations-by-state").value));t.set("type",encodeURI(document.querySelector("#js-filter-locations-by-type").value));history.replaceState(null,null,"?"+t.toString())}},{key:"getSlugURL",value:function(n){return n.toLowerCase().replace(/[^\w ]+/g,"").replace(/ +/g,"-")}}]),n}(),GoogleMap=function(){function n(t){_classCallCheck(this,n);this.locations=t.locations||[];this.container=t.container||"#not_available";this.map=null;this.mapBounds=null;this.markers=[];this.styling=t.styling||!1;this.onMarkerClick=t.onMarkerClick||function(){};this.allInfoWindows=[];this.searchedLocation=t.searchedLocation;this.searchedMarker=null}return _createClass(n,[{key:"main",value:function(){var t=this,u,f,n,s,r;if(this.container=document.querySelector(this.container),this.container!=="undefined"&&this.container!==null){this.mapBounds=new google.maps.LatLngBounds;this.searchedLocation.position&&this.mapBounds.extend(this.searchedLocation.position);this.map=new google.maps.Map(this.container,{disableDefaultUI:!0,zoomControl:!0,gestureHandling:"cooperative",styles:this.styling});this.map.fitBounds(this.mapBounds);this.locations.length==0?u=google.maps.event.addListener(this.map,"idle",function(){t.map.setZoom(13);google.maps.event.removeListener(u)}):f=google.maps.event.addListener(this.map,"idle",function(){t.map.fitBounds(t.mapBounds);google.maps.event.removeListener(f)});var i=!0,e=!1,o=undefined;try{for(n=this.locations[Symbol.iterator]();!(i=(s=n.next()).done);i=!0)r=s.value,this.setupMarker(r,this.allInfoWindows,r.id)}catch(h){e=!0;o=h}finally{try{!i&&n.return&&n.return()}finally{if(e)throw o;}}this.searchedLocation.position&&(this.searchedMarker=new google.maps.Marker({position:this.searchedLocation.position,map:this.map,animation:google.maps.Animation.DROP}))}}},{key:"linkMarker",value:function(){}},{key:"setupMarker",value:function(n,t,i){var f=this,r,u;if(Array.isArray(n.address)){this.makeMarker(n,n.address[0],n.address[1],t,i);return}if(typeof n.address=="string"){r=new google.maps.Geocoder;u={address:n.address};r.geocode(u,function(i,r){if(r!=google.maps.GeocoderStatus.OK){console.warn("Google maps Geocode: Can't convert "+n.address+" to lat/lon: "+r);return}f.makeMarker(n,i[0].geometry.location.lat(),i[0].geometry.location.lng(),t)});return}console.warn("Map Marker address for "+n.name+" is invalid or not set")}},{key:"makeMarker",value:function(n,t,i,r){var u=null,f="/ResourcePackages/ST/library/img/location-marker.png";n.nearestMarker&&(f="/ResourcePackages/ST/library/img/location-marker.png");u=new MapMarker({name:n.name,address:n.address,street:n.street,cityStateZip:n.cityStateZip,phone:n.phone,link:n.link,icon:f,lat:t,long:i,id:n.id},this.map,this.mapBounds,this.onMarkerClick,r);this.markers.push(u)}}]),n}(),Locations=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"displayLocations",value:function(){function s(){if(f!=="undefined"&&f!==null&&u.length){n=[];var t=void 0,r=void 0,o=document.querySelectorAll(".enable-on-map");o.length&&document.querySelectorAll(".enable-on-map").forEach(function(i){t=i.hasAttribute("data-lat")&&i.hasAttribute("data-lng")?[i.getAttribute("data-lat"),i.getAttribute("data-lng")]:i.getAttribute("data-address");r=i.hasAttribute("data-address")?i.getAttribute("data-address"):"";i.setAttribute("data-top",i.offsetTop);n.push({address:t,street:i.querySelector(".street").innerHTML,cityStateZip:i.getAttribute("data-address"),name:i.querySelector(".location-title").innerHTML,link:i.querySelector(".js-view-details-btn").getAttribute("href"),id:i.getAttribute("id")})});i=new GoogleMap({locations:n,container:"#map",onMarkerClick:function(n){document.querySelectorAll(".location-item").forEach(function(n){n.classList.remove("active")});var t=document.getElementById(n).getAttribute("data-top");document.getElementById(n).scrollIntoView({behavior:"smooth"});document.querySelector(".location-search .location-details").classList.remove("open")},searchedLocation:e});i.main()}}function h(n){n.style.display="none";n.classList.remove("enable-on-map")}function c(n){n.style.display="flex";n.classList.add("enable-on-map")}function r(){var n=document.querySelector("#js-filter-locations-by-state").value,t=document.querySelector("#js-filter-locations-by-type").value;document.querySelectorAll(".location-item").forEach(function(i){var f=i.getAttribute("data-types").split("|"),e=i.getAttribute("data-state"),r=!1,u=!1;(e.indexOf(n)>-1||n=="allstates")&&(u=!0);f.forEach(function(n){n=n.trim();(n.indexOf(t)>-1||t=="alltypes")&&(r=!0)});u&&r?c(i):h(i)});document.querySelectorAll(".locations-listings .enable-on-map").length>0?(document.querySelector(".no-locations-message").style.display="none",s()):document.querySelector(".no-locations-message").style.display="block"}function o(n){var i="; "+document.cookie,t=i.split("; "+n+"=");if(t.length===2)return t.pop().split(";").shift()}function l(){var u=document.querySelector("#js-filter-locations-by-state"),e=u.options,t="",n="",f,i;o("region_code")?(t=o("region_code"),console.log("Personalization Region: ",t)):console.log("no personalization found");typeof URLSearchParams!="undefined"&&(f=new URLSearchParams(window.location.search),i=f.get("state"),i?(n=i,console.log("Using state from url: ",n)):t&&(n=t,console.log("Using Personalization state: ",n)));n!=""&&Array.from(e).forEach(function(t){var i=t.value;n.indexOf(i)>-1&&(u.value=i,r())})}function a(){var t=document.querySelector("#js-filter-locations-by-type"),u=t.options,i,n;typeof URLSearchParams!="undefined"&&(i=new URLSearchParams(window.location.search),n=i.get("type"),n&&Array.from(u).forEach(function(i){var u=i.value;n.indexOf(u)>-1&&(t.value=u,r())}))}var u=document.querySelectorAll(".enable-on-map"),f=document.querySelector("#map"),e={},n,t,i;if(f==="undefined"||!u.length){console.log("no map or locations found");return}n=[];t=void 0;u.forEach(function(i){t=i.hasAttribute("data-lat")&&i.hasAttribute("data-lng")?[i.getAttribute("data-lat"),i.getAttribute("data-lng")]:i.getAttribute("data-address");i.setAttribute("data-top",i.offsetTop);n.push({address:t,street:i.querySelector(".street").innerHTML,cityStateZip:i.getAttribute("data-address"),name:i.querySelector(".location-title").innerHTML,link:i.querySelector(".js-view-details-btn").getAttribute("href"),id:i.getAttribute("id")})});i=new GoogleMap({locations:n,container:"#map",onMarkerClick:function(n){document.querySelectorAll(".location-item").forEach(function(n){n.classList.remove("active")});var t=document.getElementById(n).getAttribute("data-top");document.getElementById(n).scrollIntoView({behavior:"smooth"});document.querySelector(".location-search .location-details").classList.remove("open")},searchedLocation:e});i.main();document.querySelector("#js-filter-locations-by-state").addEventListener("change",function(){if(r(),LocationDetails.closeDetailBox(),typeof URLSearchParams!="undefined"){var n=new URLSearchParams(window.location.search);n.set("state",encodeURI(document.querySelector("#js-filter-locations-by-state").value))}});document.querySelector("#js-filter-locations-by-type").addEventListener("change",function(){r();LocationDetails.closeDetailBox()});l();a()}}]),n}(),ResourceCenter=function(){function n(){_classCallCheck(this,n);this.resourceSorting=document.querySelector(".resource-sorting");this.sortAtoZ=document.querySelector(".js-sort-a-z");this.sortZtoA=document.querySelector(".js-sort-z-a");this.sortDate=document.querySelector(".js-sort-date");this.form=document.querySelector(".resource-center-filter-form");this.resourceSorting&&this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.sortAtoZ&&(this.sortAtoZ.addEventListener("click",function(t){n.toggle_AtoZ_Icon(t)}),this.sortZtoA.addEventListener("click",function(t){n.toggle_ZtoA_Icon(t)}),this.sortDate.addEventListener("click",function(t){n.toggle_Date_Icon(t)}));this.toggleFilter();this.setExistingSortUi()}},{key:"setExistingSortUi",value:function(){var n=document.querySelector("#az-sort-param");if(n&&n.value&&n.value!=""){switch(n.value){case"Title|ASC":this.sortAtoZ.classList.add("sort-up");break;case"Title|DESC":this.sortZtoA.classList.add("sort-down");break;case"Date|ASC":this.sortDate.classList.add("sort-up");break;case"Date|DESC":this.sortDate.classList.add("sort-down")}this.form.scrollIntoView()}}},{key:"toggleFilter",value:function(){var i=this,n,t;this.form&&(n=this.form.querySelector(".js-clear-resource-filters"),t=this.form.querySelectorAll("select"),t.forEach(function(t){t.onchange=function(){t.getAttribute("id")=="filter-by-category"&&(document.getElementById("filter-by-asset").value=null);i.form.submit()};t.value!=null&&t.value!=""&&(n.style.display="inline-block")}),n.onclick=function(n){n.preventDefault();t.forEach(function(n){n.value=null});i.form.submit()})}},{key:"toggle_AtoZ_Icon",value:function(n){var t,i,r;n.preventDefault();t=n.currentTarget;this.sortZtoA.classList.remove("sort-down");this.sortDate.classList.remove("sort-down","sort-up");i=!1;t.classList.contains("sort-up")?t.classList.remove("sort-up"):(i=!0,t.classList.add("sort-up"));r=document.querySelector("#az-sort-param");r&&this.form&&(r.value=i?"Title|ASC":"",this.form.submit())}},{key:"toggle_ZtoA_Icon",value:function(n){var t,i,r;n.preventDefault();t=n.currentTarget;this.sortAtoZ.classList.remove("sort-up");this.sortDate.classList.remove("sort-down","sort-up");i=!1;t.classList.contains("sort-down")?t.classList.remove("sort-down"):(i=!0,t.classList.add("sort-down"));r=document.querySelector("#az-sort-param");r&&this.form&&(r.value=i?"Title|DESC":"",this.form.submit())}},{key:"toggle_Date_Icon",value:function(n){var t,i,r;n.preventDefault();t=n.currentTarget;this.sortAtoZ.classList.remove("sort-up");this.sortZtoA.classList.remove("sort-down");i=!1;t.classList.contains("sort-down")||t.classList.contains("sort-up")?t.classList.contains("sort-up")?(t.classList.remove("sort-up"),t.classList.add("sort-down"),i="DESC"):t.classList.contains("sort-down")&&(t.classList.remove("sort-down"),t.classList.remove("sort-up")):(t.classList.add("sort-up"),t.classList.remove("sort-down"),i="ASC");r=document.querySelector("#az-sort-param");r&&i&&this.form&&(r.value=i?"Date|"+i:"",this.form.submit())}}]),n}(),ScrollToTop=function(){function n(){_classCallCheck(this,n);this.scrollBtn=document.querySelector(".js-scroll-to-top");(this.scrollBtn!="undefined"||this.scrollBtn!=null)&&this.init()}return _createClass(n,[{key:"init",value:function(){this.scrollBtn.addEventListener("click",function(){window.scroll({top:0,left:0,behavior:"smooth"})});this.showOrHideSCrollBtn()}},{key:"showOrHideSCrollBtn",value:function(){var t=-1,i=window.pageYOffset,n=document.querySelector(".js-scroll-to-top");i>500?n.classList.add("show"):n.classList.remove("show");window.addEventListener("scroll",function(){i=window.pageYOffset;t&&window.clearTimeout(t);t=window.setTimeout(function(){i>500?n.classList.add("show"):n.classList.remove("show")},100)})}}]),n}(),search=function(){var n=document.querySelectorAll(".search-bar-form");n.forEach(function(n){doSearchForForm(n)})},doSearchForForm=function(n){var i=n.getAttribute("id"),t=window.searchParams[""+i];t&&(n.querySelectorAll('button[type="button"]').forEach(function(i){i.onclick=function(i){i.preventDefault();submitSearch(n,t)}}),n.querySelectorAll('input[type="text"]').forEach(function(i){i.onkeyup=function(i){(i.key==="Enter"||i.keyCode===13)&&(i.preventDefault(),submitSearch(n,t))}}),doSearchAutocomplete(n,t))},submitSearch=function(n,t){var i=n.querySelector('input[type="text"]').value;i&&(i+"").trim()!=""&&(n.querySelector('button[type="button"]').classList.add("waiting"),runSearch(t,i))},doSearchAutocomplete=function(n,t){var u=null,i=n.querySelector(".autocomplete-target"),r=n.querySelector('input[type="text"]');i&&r&&(r.onkeypress=function(n){u&&(window.clearTimeout(u),i.innerHTML="");u=setTimeout(function(){fetch("/restapi/search/suggestions?IndexName="+t.index+"&SuggestionFields=Title%2CContent&Text="+encodeURIComponent(n.target.value)).then(function(n){return n.json()}).then(function(n){n&&n.Suggestions&&n.Suggestions.length&&(i.innerHTML=autoCompleteTemplate(n.Suggestions),i.querySelectorAll("a").forEach(function(n){n.onclick=function(i){i.preventDefault();r.value=n.innerText;runSearch(t,n.innerText)}}))}).catch(function(n){console.log(n)})},250)},r.onblur=function(){setTimeout(function(){i.innerHTML=""},250)})},autoCompleteTemplate=function(n){return'\n        <div class="search-autocomplete-results">\n            '+n.map(function(n){return'<a href="#" class="autocomplete-result" aria-label="Search this term">'+n+"<\/a>"}).join("")+"\n        <\/div>\n    "},runSearch=function(n,t){window.location=n.resultsUrl+"?indexCatalogue="+n.index+"&searchQuery="+encodeURIComponent(t)+"&wordsMode=AllWords"},SpeedBump=function(){function n(){_classCallCheck(this,n);this.acceptBtn="";this.denyBtn="";this.speedbumpModal="";this.message="";this.url="";this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;document.addEventListener("click",function(t){t.target.classList.contains("speedbump-link")&&n.speedbumpClickHandler(t)})}},{key:"speedbumpClickHandler",value:function(n){n.preventDefault();this.message=n.target.hasAttribute("data-redirect-message")?n.target.getAttribute("data-redirect-message"):document.querySelector("meta[name=speedbump-message]").getAttribute("content");this.url=n.target.getAttribute("href");this.createSpeedBumpModal()}},{key:"bindButtons",value:function(){this.acceptBtn=document.querySelector(".speedBumpModal .acceptBtn");this.denyBtn=document.querySelector(".speedBumpModal .denyBtn");this.speedbumpModal=document.querySelector(".speedBumpModal")}},{key:"createSpeedBumpModal",value:function(){var n=this,t='\n        <div class="speedBumpModal">\n            <div class="modalBox">\n                <div class="modalHeader">\n                    <div class="title">External Link Disclaimer<\/div>\n                <\/div>\n                <div class="icon">\n                    <img src="/ResourcePackages/ST/library/img/logo-tagline.png" alt="Northwestern Energy Logo" />\n                <\/div>\n                <div class="notice">'+this.message+'<\/div>\n                <div class="ctas">\n                    <a href="'+this.url+'" class="acceptBtn btn btn-primary" target="_blank">Accept<\/a>\n                    <a href="#" class="denyBtn btn btn-secondary">Return To Site<\/a>\n                <\/div>\n            <\/div>\n        <\/div>';document.querySelector(".page-wrapper").insertAdjacentHTML("beforebegin",t);document.querySelector(".speedBumpModal .acceptBtn").addEventListener("click",function(t){n.allowLink(t)});document.querySelector(".speedBumpModal .denyBtn").addEventListener("click",function(t){n.returnToSite(t)})}},{key:"returnToSite",value:function(n){n.preventDefault();var t=document.querySelector(".speedBumpModal");t.parentNode.removeChild(t)}},{key:"allowLink",value:function(){var n=document.querySelector(".speedBumpModal");n.parentNode.removeChild(n)}}]),n}(),Splashscreen=function(){function n(){_classCallCheck(this,n);this.splash=document.querySelector(".splashscreen");this.skipSplashBtn=document.querySelector(".splashscreen .js-skip-splash");this.stateLogos=document.querySelectorAll(".splashscreen .state-logos a");this.stateSelectbox=document.querySelector(".splashscreen #js-state-selector");this.submitBtn=document.querySelector(".splashscreen .submit-splashscreen");typeof this.splash!="undefined"&&this.splash!=null&&this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.checkSessionStorage();this.skipSplashBtn.addEventListener("click",function(){n.closeSplash()});this.stateLogos.forEach(function(t){t.addEventListener("click",function(t){n.stateLogoSelected(t)})});this.stateSelectbox.addEventListener("change",function(t){n.selectBoxChange(t)});this.submitBtn.addEventListener("click",function(t){n.setPersonalization(t)})}},{key:"checkSessionStorage",value:function(){var t=sessionStorage.getItem("splashscreen"),n=getCookie("region_code"),i=n&&n!="";t!==null||i?(this.splash.style.display="none",document.querySelector("body").classList.remove("splash-open")):(this.splash.style.display="block",document.querySelector("body").classList.add("splash-open"))}},{key:"closeSplash",value:function(n){sessionStorage.setItem("splashscreen","closed");n||(this.splash.style.display="none",document.querySelector("body").classList.remove("splash-open"))}},{key:"stateLogoSelected",value:function(n){var i,t;for(n.preventDefault(),i=n.currentTarget.getAttribute("data-state"),this.stateLogos.forEach(function(n){n.classList.remove("selected")}),n.currentTarget.classList.add("selected"),t=0;t<this.stateSelectbox.options.length;t++)if(this.stateSelectbox.options[t].value===i){this.stateSelectbox.selectedIndex=t;break}}},{key:"selectBoxChange",value:function(n){var t=n.currentTarget.value.toLowerCase();this.stateLogos.forEach(function(n){n.getAttribute("data-state")==t?n.classList.add("selected"):n.classList.remove("selected")})}},{key:"setPersonalization",value:function(n){n.preventDefault();var t=this.stateSelectbox.value.toLowerCase();if(t=="montana"||t=="south dakota"||t=="nebraska")setUserSegment(t),this.submitBtn.classList.add("waiting"),this.closeSplash(!0);else{console.log("invalid state selector id for personalization");return}}}]),n}(),TeamMembers=function(){function n(){_classCallCheck(this,n);this.teamMembers=document.querySelectorAll(".team-member-item");this.closeBioBtn=document.querySelectorAll(".team-member-bio .js-close-member-bio");this.teamMembers.length&&this.init()}return _createClass(n,[{key:"init",value:function(){var n=this;this.teamMembers.forEach(function(t){t.addEventListener("click",n.openBio)});this.closeBioBtn.forEach(function(t){t.addEventListener("click",n.closeBio)})}},{key:"openBio",value:function(n){n.preventDefault();var u=n.currentTarget.closest(".team-member-item"),t=document.querySelector(".team-member-bio"),f=document.querySelector("header.site-header").clientHeight,i=[{headline:u.querySelector(".card-title").innerHTML,subheadline:u.querySelector(".card-text").innerHTML,desc:u.getAttribute("data-full-description"),image:u.querySelector(".photo").style.backgroundImage.split(/"/)[1]}],r=[{photoHTML:t.querySelector(".bio-photo"),headlineHTML:t.querySelector(".member-bio-headline"),subheadlineHTML:t.querySelector(".member-bio-subheadline"),descHTML:t.querySelector(".member-bio-desc")}];window.innerWidth<767.98&&document.querySelector("body").classList.add("show-overlay");r[0].photoHTML.setAttribute("src",i[0].image);r[0].photoHTML.setAttribute("alt",i[0].headline);r[0].headlineHTML.innerHTML=i[0].headline;r[0].subheadlineHTML.innerHTML=i[0].subheadline;r[0].descHTML.innerHTML=i[0].desc;t.style.display="block";t.scrollIntoView({behavior:"smooth",block:"center"})}},{key:"closeBio",value:function(n){n.preventDefault();var t=document.querySelector(".team-member-bio");t.style.display="none";window.innerWidth<767.98&&document.querySelector("body").classList.remove("show-overlay")}}]),n}(),events=function(){var n=document.querySelector(".news-events-filter-form"),t,i;n&&(t=!1,n.querySelectorAll("input").forEach(function(i){i.onchange=function(){n.submit()};i.value&&i.value!=""&&i.checked&&(t=!0)}),n.querySelectorAll("select").forEach(function(i){i.onchange=function(){n.submit()};i.value&&i.value!=""&&(t=!0)}),i=n.querySelector(".js-clear-events-filters"),i&&(t&&(n.querySelector(".clear-events-wrapper").style.display="block"),i.onclick=function(t){t.preventDefault();n.querySelectorAll("input").forEach(function(n){n.checked=n.getAttribute("id")=="js-show-all-filters"?!0:!1});n.querySelectorAll("select").forEach(function(n){n.value=null});n.submit()}))},calloutVideo=function(){var n=document.querySelectorAll(".standard-image-callout .js-show-video");n.forEach(function(n){n.onclick=function(t){t.preventDefault();var u=n.getAttribute("data-id"),i=document.querySelector("#"+u),f=i.getAttribute("data-embed"),r=i.querySelector(".inner");r.innerHTML+=f;i.style.display="flex";i.querySelector(".js-close-cta-popup").onclick=function(n){n.preventDefault();r.removeChild(r.querySelector("iframe"));i.style.display="none"};i.querySelector(".popup-overlay").onclick=function(n){n.preventDefault();r.removeChild(r.querySelector("iframe"));i.style.display="none"}}})},formatPhone=function(n){var t=(n+"").replace(/\D/g,"").match(/(\d{0,3})(\d{0,3})(\d{0,4})/);return t[2]?""+t[1]+"-"+t[2]+(t[3]?"-"+t[3]:""):t[1]},formatNumber=function(n){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"",t=(n+"").replace(/\D/g,"");return t!==""?i+t:""},formatZip=function(n){var t=(n+"").replace(/\D/g,"").match(/(\d{0,5})(\d{0,4})/);return t[2]?""+t[1]+"-"+t[2]:t[1]},formatAccountNumber=function(n){var t=n;return t.length>7&&t[7]!="-"?t.substring(0,7)+"-"+t[7]:t.substring(0,9)},RegionAutocomplete=function(n,t){var i={NE:{ALDA:"Grand Island","GRAND ISLAND":"Grand Island",KEARNEY:"Kearney","NORTH PLATTE":"North Platte"},WY:{"BRIDGE BAY":"Bozeman","FISHING BRIDGE":"Bozeman"},MT:{ABSAROKEE:"Billings",ALBERTON:"Missoula",ALDER:"Butte",AMSTERDAM:"Bozeman",ANACONDA:"Butte",ARMINGTON:"Great Falls","ARROW CREEK":"Billings",AUGUSTA:"Great Falls",AVON:"Helena",BARBER:"Billings",BASIN:"Helena",BEARCREEK:"Billings",BELFRY:"Billings",BELGRADE:"Bozeman",BELT:"Great Falls",BENCHLAND:"Billings","BIG MOUNTAIN":"Kalispell","BIG SANDY":"Havre","BIG SKY":"Bozeman","BIG TIMBER":"Bozeman",BIGFORK:"Kalispell",BILLINGS:"Billings","BLACK EAGLE":"Great Falls",BONNER:"Missoula",BOULDER:"Helena","BOX ELDER":"Havre",BOZEMAN:"Bozeman",BRADY:"Great Falls",BRIDGER:"Billings",BROADVIEW:"Billings",BROWNING:"Kalispell",BUFFALO:"Billings",BUTTE:"Butte",CAMERON:"Bozeman","CANYON CREEK":"Helena",CARDWELL:"Butte",CARTER:"Great Falls",CASCADE:"Great Falls",CENTERVILLE:"Great Falls",CHECKERBOARD:"Billings",CHESTER:"Havre",CHINOOK:"Havre",CHOTEAU:"Great Falls",CHURCHILL:"Bozeman",CLANCY:"Helena",CLINTON:"Missoula","COFFEE CREEK":"Billings",COLSTRIP:"Billings","COLUMBIA FALLS":"Kalispell",COLUMBUS:"Billings",CONRAD:"Great Falls",CORAM:"Kalispell",CORBIN:"Helena",CORVALLIS:"Missoula",CRAIG:"Helena",CUSTER:"Billings","CUT BANK":"Great Falls",DARBY:"Missoula","DE BORGIA":"Missoula","DEER LODGE":"Butte",DENTON:"Billings",DILLON:"Butte",DIVIDE:"Butte",DODSON:"Havre",DRUMMOND:"Butte",DUTTON:"Great Falls","EAST GLACIER PARK":"Kalispell","EAST HELENA":"Helena",EDGAR:"Billings",ELLISTON:"Helena",ENNIS:"Bozeman",ESSEX:"Kalispell",FAIRFIELD:"Great Falls",FLORENCE:"Missoula",FLOWEREE:"Great Falls","FORT BELKNAP":"Havre","FORT BENTON":"Great Falls","FORT HARRISON":"Helena","FORT SHAW":"Great Falls",FROMBERG:"Billings",GALATA:"Havre","GALLATIN GATEWAY":"Bozeman",GARDINER:"Bozeman",GARNEILL:"Billings",GARRISON:"Butte",GERALDINE:"Billings",GEYSER:"Great Falls",GILDFORD:"Havre",GLASGOW:"Havre",GLEN:"Butte","GOLD CREEK":"Butte","GRANT VILLAGE":"Bozeman",GRANTSDALE:"Missoula","GREAT FALLS":"Great Falls",GREYCLIFF:"Bozeman",HALL:"Butte",HAMILTON:"Missoula",HARDIN:"Billings",HARLEM:"Havre",HARLOWTON:"Billings",HARRISON:"Bozeman",HAUGAN:"Missoula",HAVRE:"Havre",HELENA:"Helena",HINGHAM:"Havre",HINSDALE:"Havre",HOBSON:"Billings","HUNGRY HORSE":"Kalispell",HUSON:"Missoula",INVERNESS:"Havre",JARDINE:"Bozeman",JEFFERS:"Bozeman","JEFFERSON CITY":"Helena",JOLIET:"Billings",JOPLIN:"Havre","JUDITH GAP":"Billings",KALISPELL:"Kalispell",KREMLIN:"Havre",LAKE:"Bozeman",LAUREL:"Billings",LAVINA:"Billings",LEDGER:"Great Falls",LENNEP:"Helena",LEWISTOWN:"Billings",LINCOLN:"Helena",LIVINGSTON:"Bozeman",LOGAN:"Bozeman",LOHMAN:"Havre",LOLO:"Missoula",LOMA:"Great Falls",LOTHAIR:"Havre","MADISON JUNCTION":"Bozeman",MALTA:"Havre",MAMMOTH:"Bozeman",MANHATTAN:"Bozeman","MARTIN CITY":"Kalispell",MARTINSDALE:"Helena",MARYSVILLE:"Helena",MAXVILLE:"Butte","MC ALLISTER":"Bozeman",MELROSE:"Butte",MELSTONE:"Billings",MELVILLE:"Bozeman",MILLTOWN:"Missoula",MISSOULA:"Missoula",MOCCASIN:"Billings",MOLT:"Billings",MONARCH:"Great Falls","MONTANA CITY":"Helena",MOORE:"Billings",MUSSELSHELL:"Billings",NASHUA:"Havre",NEIHART:"Great Falls","NEVADA CITY":"Butte",NORRIS:"Bozeman","NORRIS JUNCTION":"Bozeman",NYE:"Billings","OLD FAITHFUL":"Bozeman",PARADISE:"Missoula","PARK CITY":"Billings",PHILIPSBURG:"Butte",PLAINS:"Missoula",PONY:"Bozeman",POWER:"Great Falls",PRAY:"Bozeman",RADERSBURG:"Helena",RAMSAY:"Butte",RAYNESFORD:"Great Falls","RED LODGE":"Billings",REEDPOINT:"Bozeman",RINGLING:"Helena",ROBERTS:"Billings",ROCKER:"Butte",ROCKVALE:"Billings",ROSCOE:"Billings",ROUNDUP:"Billings",RUDYARD:"Havre",RYEGATE:"Billings",SACO:"Havre","SAINT MARIE":"Havre","SAINT REGIS":"Missoula",SALTESE:"Missoula","SAND COULEE":"Great Falls","SAPPHIRE VILLAGE":"Billings",SHAWMUT:"Bozeman",SHELBY:"Havre",SHERIDAN:"Butte",SILESIA:"Billings","SILVER STAR":"Butte",SILVERBOW:"Butte",SIMMS:"Great Falls",SOMERS:"Kalispell",SPRINGDALE:"Bozeman","SQUARE BUTTE":"Billings",STANFORD:"Billings",STEVENSVILLE:"Missoula",STOCKETT:"Great Falls",SUMATRA:"Billings","SUN RIVER":"Great Falls",SUNBURST:"Great Falls",SUPERIOR:"Missoula",TAFT:"Missoula",TAMPICO:"Havre","THOMPSON FALLS":"Missoula","THREE FORKS":"Bozeman",TOSTON:"Helena","TOWER JUNCTION":"Bozeman",TOWNSEND:"Helena",TRACY:"Great Falls",TURAH:"Missoula","TWIN BRIDGES":"Butte",TWODOT:"Billings",ULM:"Great Falls",UTICA:"Billings",VALIER:"Great Falls",VAUGHN:"Great Falls",VICTOR:"Missoula","VIRGINIA CITY":"Butte",WAGNER:"Havre",WALKERVILLE:"Butte","WARM SPRINGS":"Butte",WASHOE:"Billings","WEST GLACIER":"Kalispell","WEST THUMB":"Bozeman","WEST YELLOWSTONE":"Bozeman","WHITE SULPHUR SPRING":"Helena",WHITEFISH:"Kalispell",WHITEHALL:"Butte",WHITLASH:"Havre",WICKES:"Helena",WILLIAMSBURG:"Butte","WILLOW CREEK":"Bozeman",WINDHAM:"Billings",WINSTON:"Helena","WOLF CREEK":"Helena","YELLOWSTONE CLUB":"Bozeman","YELLOWSTONE NTL PARK":"Bozeman",ZURICH:"Havre"},SD:{ABERDEEN:"Aberdeen",ALEXANDRIA:"Mitchell",ALPENA:"Huron",ALTAMONT:"Brookings",AMHERST:"Aberdeen",ANDOVER:"Aberdeen",ARLINGTON:"Brookings",ARMOUR:"Mitchell",ASHTON:"Huron",ATHOL:"Huron",AURORA:"Brookings",AVON:"Yankton",BANCROFT:"Huron",BARNARD:"Aberdeen",BEMIS:"Huron","BIG STONE CITY":"Brookings",BLUNT:"Huron",BONILLA:"Huron",BRADLEY:"Huron",BRENTFORD:"Huron",BRISTOL:"Aberdeen",BROADLAND:"Huron",BROOKINGS:"Brookings",BRYANT:"Huron",BUTLER:"Aberdeen",CANISTOTA:"Yankton",CASTLEWOOD:"Brookings",CAVOUR:"Huron",CHAMBERLAIN:"Mitchell",CHELSEA:"Huron",CLAREMONT:"Aberdeen",CLARK:"Huron","CLEAR LAKE":"Brookings",COLUMBIA:"Aberdeen",CONDE:"Huron",CORSICA:"Mitchell",CRESBARD:"Huron",DANTE:"Yankton","DE SMET":"Huron",DELMONT:"Mitchell",DIMOCK:"Mitchell",DOLAND:"Huron",ESTELLINE:"Brookings",ETHAN:"Mitchell",FAULKTON:"Huron",FERNEY:"Aberdeen",FLORENCE:"Huron",FRANKFORT:"Huron",FREEMAN:"Yankton","GARDEN CITY":"Huron",GEDDES:"Mitchell",GOODWIN:"Huron",GROTON:"Aberdeen",GROVER:"Huron",HARRISBURG:"Yankton",HARROLD:"Huron",HAYTI:"Brookings",HAZEL:"Huron",HENRY:"Huron",HIGHMORE:"Huron",HITCHCOCK:"Huron",HOLABIRD:"Huron",HOLMQUIST:"Aberdeen",HUDSON:"Yankton",HURON:"Huron",IROQUOIS:"Huron",KAMPESKA:"Huron",KAYLOR:"Yankton",KIMBALL:"Mitchell",KRANZBURG:"Huron",LABOLT:"Brookings","LAKE ANDES":"Yankton","LAKE NORDEN":"Brookings","LAKE PRESTON":"Huron",LANE:"Huron",LESTERVILLE:"Yankton",LETCHER:"Mitchell",LILY:"Aberdeen",LOOMIS:"Mitchell",LOYALTON:"Huron",MADISON:"Brookings",MANCHESTER:"Huron",MANSFIELD:"Aberdeen",MARION:"Yankton",MARTY:"Yankton",MELLETTE:"Huron",MENNO:"Yankton",MILBANK:"Brookings",MIRANDA:"Huron","MISSION HILL":"Yankton",MITCHELL:"Mitchell",MONROE:"Yankton",MONTROSE:"Yankton","MOUNT VERNON":"Mitchell",NAPLES:"Huron","NNG BROOKINGS":"Brookings","NNG CLARK":"Huron","NNG DE SMET":"Huron","NNG DOLAND":"Huron","NNG HURON":"Huron","NNG LAKE PRESTON":"Huron","NNG MADISON":"Brookings","NNG MARION":"Yankton","NNG MITCHELL":"Mitchell","NNG WARNER":"Aberdeen","NNG WORTHING":"Yankton",NORTHVILLE:"Huron",OLDHAM:"Brookings",OLIVET:"Yankton",ORIENT:"Huron",PARKER:"Yankton",PARKSTON:"Mitchell",PIERPONT:"Aberdeen",PLATTE:"Mitchell",RAVINIA:"Yankton",RAYMOND:"Huron",REDFIELD:"Huron","REE HEIGHTS":"Huron",REVILLO:"Brookings",ROCKHAM:"Huron","RUNNING WATER":"Yankton","SAINT LAWRENCE":"Huron",SCOTLAND:"Yankton","SIOUX FALLS":"Yankton",SPENCER:"Mitchell",SPRINGFIELD:"Yankton",STICKNEY:"Mitchell",STORLA:"Huron",STRATFORD:"Aberdeen",TEA:"Yankton",TRIPP:"Mitchell",TULARE:"Huron",TURTON:"Huron",UTICA:"Yankton",VAYLAND:"Huron",VERDON:"Huron",VIENNA:"Huron",VIRGIL:"Huron",VOLGA:"Brookings",WAGNER:"Yankton",WALLACE:"Aberdeen",WARNER:"Aberdeen",WEBSTER:"Aberdeen",WECOTA:"Huron",WESSINGTON:"Huron",WESTPORT:"Aberdeen","WHITE LAKE":"Mitchell","WILLOW LAKE":"Huron",WINFRED:"Brookings",WOLSEY:"Huron",WOONSOCKET:"Huron",YALE:"Huron",YANKTON:"Yankton",ZELL:"Huron"}};return i[n]?i[n][t]?i[n][t]:"":""},getQueryString=function(n){for(var r="",i=[],u=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),t=0;t<u.length;t++)i=u[t].split("="),i[0].toUpperCase()==n.toUpperCase()&&(r=i[1]);return r},NweForm=function(){function n(t){_classCallCheck(this,n);this.form=t.form;this.fields=[]}return _createClass(n,[{key:"init",value:function(){var n=this,t=this.form.querySelectorAll(".form-control");t.forEach(function(t){var i=t.getAttribute("data-format"),r=t.getAttribute("data-autofill"),f=t.getAttribute("data-regionSelect"),u=t.getAttribute("data-labelOverride");n.fields.push({field:t,required:t.parentNode.classList.contains("required"),type:t.getAttribute("type"),label:u==null?t.parentNode.querySelector("label").innerText:u});i&&i=="phone"&&(t.oninput=function(){t.value=formatPhone(t.value)});i&&i=="number"&&(t.oninput=function(){t.value=formatNumber(t.value)});i&&i=="currency"&&(t.oninput=function(){t.value=formatNumber(t.value,"$")});i&&i=="account"&&(t.oninput=function(){t.value=formatAccountNumber(t.value)});i&&i=="zip"&&(t.oninput=function(){t.value=formatZip(t.value)});r&&(t.value=getQueryString(r));f&&(t.onchange=function(){n.form.querySelectorAll("[name=Region] option").forEach(function(t){t.value==RegionAutocomplete(n.form.querySelectorAll("[name=State]")[0].value.toUpperCase(),n.form.querySelectorAll("[name=City]")[0].value.toUpperCase())&&(t.selected=!0)})})});this.form.onsubmit=function(t){var i=n.form.querySelector(".recaptcha-token");if(!n.validateForm()){t.preventDefault();return}i&&!i.value&&(t.preventDefault(),grecaptcha.ready(function(){grecaptcha.execute(recaptchaClient,{action:"submit"}).then(function(t){i.value=t;n.form.submit()})}))}}},{key:"validateForm",value:function(){var t=this,n=!0;return this.form.querySelectorAll(".error").forEach(function(n){n.parentNode.removeChild(n)}),this.fields.forEach(function(i){var r=i.field.getAttribute("data-format"),f=i.field.getAttribute("data-fulfilledBy"),u;i.field.classList.contains("validation-ignore")||(i.required&&(!i.field.value||(i.field.value+"").trim()=="")&&t.inputfulfilledEmpty(f)?(n=!1,t.createErrorMssg(i.field,i.label+" is required.")):r=="phone"?i.field.value.length&&(i.field.value+"").length!=12&&(n=!1,t.createErrorMssg(i.field,i.label+" must be valid.")):r=="zip"?i.field.value.length&&(i.field.value+"").length!=10&&(i.field.value+"").length!=5&&(n=!1,t.createErrorMssg(i.field,i.label+" must be valid.")):r=="account"?i.field.value.length&&(i.field.value+"").length!=9&&(n=!1,t.createErrorMssg(i.field,i.label+" must be valid.")):r=="requiredcheck"?(n=i.field.checked,n||t.createErrorMssg(i.field,i.label+" must be checked.")):i.field.getAttribute("type")=="email"?i.field.value.length&&!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(i.field.value)&&t.createErrorMssg(i.field,i.label+" must be valid."):window.msCrypto&&(i.field.value+"").length&&i.field.getAttribute("type")=="date"&&(u=new Date(i.field.value+""),isNaN(u.getDay())&&(n=!1,t.createErrorMssg(i.field,i.label+" must be valid."))))}),n||this.form.querySelectorAll(".error")[0].scrollIntoView(),n}},{key:"createErrorMssg",value:function(n,t){var i=document.createElement("div");i.innerText=t;i.classList.add("error");n.parentNode.appendChild(i)}},{key:"inputfulfilledEmpty",value:function(n){if(!n)return!0;var t=document.getElementById(n);return t?(t.value+"").trim()=="":!0}}]),n}(),initiateCustomValidation=function(){var n=[];document.querySelectorAll("form.custom-validation").forEach(function(t,i){n.push(new NweForm({form:t}));n[i].init()})},FormMap=function(){function n(){_classCallCheck(this,n);this.init()}return _createClass(n,[{key:"init",value:function(){if(typeof ol!="undefined"){var n=new ol.Map({target:"map",layers:[new ol.layer.Tile({source:new ol.source.OSM}),new ol.layer.Vector],view:new ol.View({center:ol.proj.fromLonLat([-112.0507133,46.5934116]),zoom:14})});navigator.geolocation.getCurrentPosition(function(t){var i=new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([t.coords.longitude,t.coords.latitude]))}),r,u,f;i.setStyle(new ol.style.Style({image:new ol.style.Icon({anchor:[.5,.5],crossOrigin:"anonymous",src:"ResourcePackages/ST/library/img/icons/marker.png"})}));r=new ol.source.Vector({features:[i]});u=new ol.layer.Vector({source:r});n.addLayer(u);f=new ol.View({center:ol.proj.fromLonLat([t.coords.longitude,t.coords.latitude]),zoom:14});n.setView(f)})}}}]),n}(),SecFilingTemplate=function(n){return"\n        <tr>\n            <td>"+n.Type+'<\/td>\n            <td>\n                <a href="'+n.FormUrl+'" aria-label="'+n.FormName+'" target="_blank">'+n.FormName+"<\/a>\n            <\/td>\n            <td>"+n.FilingDate+"<\/td>\n            <td>\n                "+n.Files.map(function(n){var t="";return t=n.Type=="pdf"?'<svg><use href="/ResourcePackages/ST/library/img/svg-sprites.svg#pdf-icon"><\/use><\/svg>':n.Type=="html"?"<span>HTML<\/span>":'<svg><use href="/ResourcePackages/ST/library/img/svg-sprites.svg#file"><\/use><\/svg>','<a href="'+n.Url+'" title="Original SEC filename: '+n.Name+'" class="sec-file-link" target="_blank">'+t+"<\/a>"}).join("")+"\n            <\/td>\n        <\/tr>\n    "},SecFilingControlTemplate=function(n,t,i,r){for(var u=[],e,o,f=0;f<Math.ceil(n/t);f++)u.push(f+1);return u<=1?"":(e=Math.ceil(u.length/10),o=function(n){return Math.ceil(n/10)==r},'\n        <nav class="pagination-wrapper page-part-1" aria-label="SEC List Pagination">\n            <ul class="pagination">\n            '+(u.length>10&&r>1?'<li class="page-item page-control"><a href="#" class="page-link prev-pages" aria-label="See previous pages" data-page="'+(r-1)*10+'"><svg><use href="/ResourcePackages/ST/library/img/svg-sprites.svg#angle-left"><\/use><\/svg><\/a><\/li>':"")+"\n                "+u.map(function(n,t){return o(n)?'<li class="page-item '+(t===i?"active":"")+'">\n                       <a href="#" class="page-link" aria-label="page '+n+'" data-page="'+n+'">'+n+"<\/a>\n                    <\/li>":""}).join("")+"\n                "+(u.length>10&&r!=e?'<li class="page-item page-control"><a href="#" class="page-link more-pages" aria-label="See more pages" data-page="'+(r*10+1)+'"><svg><use href="/ResourcePackages/ST/library/img/svg-sprites.svg#angle-right"><\/use><\/svg><\/a><\/li>':"")+"\n            <\/ul>\n        <\/nav>\n    ")},SecFilingList=function(){function n(){_classCallCheck(this,n);this.list=document.querySelector(".sec-filing-table table");this.listTarget=document.querySelector("#sec-filing-table-src");this.controls=document.querySelector(".sec-controls");this.items=[];this.filteredItems=[];this.pageItems=[];this.currentIndex=0;this.perPage=0;this.pageSegment=1}return _createClass(n,[{key:"init",value:function(){this.list&&(this.perPage=itemsPerPage||20,this.getItems())}},{key:"getItems",value:function(){var n=this;fetch("/get-sec-filing-items").then(function(n){return n.json()}).then(function(t){n.items=t.Data;n.filteredItems=[].concat(_toConsumableArray(n.items));n.buildUi();n.list.querySelectorAll("select").forEach(function(t){t.onchange=function(){n.filterItems()}})}).catch(function(n){console.log(n)})}},{key:"buildUi",value:function(){this.getPage();this.renderPage()}},{key:"renderPage",value:function(){var n,t;this.pageItems&&this.pageItems.length?(n=this.pageItems.map(function(n){return SecFilingTemplate(n)}).join(""),this.listTarget.innerHTML=n,t=SecFilingControlTemplate(this.filteredItems.length,this.perPage,this.currentIndex,this.pageSegment),this.controls.innerHTML=t,this.goToPage()):(this.listTarget.innerHTML='<tr><td colspan="4" class="no-results">No Results. Please change filter selection.<\/td><\/tr>',this.controls.innerHTML="")}},{key:"getPage",value:function(){var n=this;this.pageItems=this.filteredItems.filter(function(t,i){return i>=n.currentIndex*n.perPage&&i<=n.currentIndex*n.perPage+(n.perPage-1)})}},{key:"goToPage",value:function(){var n=this,t=document.querySelectorAll(".sec-filing-table .page-link");t.forEach(function(t){t.onclick=function(i){i.preventDefault();t.classList.contains("more-pages")&&(n.pageSegment+=1);t.classList.contains("prev-pages")&&(n.pageSegment-=1);n.currentIndex=parseInt(t.getAttribute("data-page")-1);n.buildUi()}})}},{key:"filterItems",value:function(){this.filteredItems=[].concat(_toConsumableArray(this.items));var n=document.getElementById("filter-sec-type").value,t=document.getElementById("filter-sec-date").value;this.currentIndex=0;n&&n!=""&&(this.filteredItems=this.filteredItems.filter(function(t){var i=typeFilterMappings[t.Type];return i||(i="Other"),i==n}));t&&t!=null&&(this.filteredItems=this.filteredItems.filter(function(n){return n.FilingDate.indexOf(t)>-1}));this.buildUi()}}]),n}(),MainScripts=function(){function e(){t.initialize()}function o(n){if(window.jQuery)jQuery(document).ready(function(){personalizationManager.addPersonalizedContentLoaded(n)});else{var t=!1;document.addEventListener&&document.addEventListener("DOMContentLoaded",function(){t||(t=!0,personalizationManager.addPersonalizedContentLoaded(n))});window.onload=function(){t||(t=!0,personalizationManager.addPersonalizedContentLoaded(n))}}}var t,i,n;PolyfillHelpers.main();typeof svg4everybody=="function"&&svg4everybody();t=new ImageLoader;typeof personalizationManager!="undefined"?o(e):t.initialize();maintainImageAspectRatios();new Accordions;new AnchorLinks;new Alerts;new heroStandard;new FeaturedMedia;new Login;new Menu;new ResourceCenter;new ScrollToTop;search();new SearchBox;new ServiceArea;new SpeedBump;new Splashscreen;new TeamMembers;events();calloutVideo();initiateCustomValidation();new FormMap;i=new SecFilingList;i.init();document.querySelector(".location-search")!=undefined&&document.querySelector(".location-search")!=null&&(Locations.displayLocations(),new LocationDetails);try{if(n=window.location.hash,n){var r=n.slice(1),u=document.getElementById(r),f=document.querySelector(".site-header").clientHeight,s='<div id="'+r+'" class="hashlink" style="height: '+f+"px;margin-top: -"+f+'px;visibility: hidden"><\/div>';u.removeAttribute("id");u.insertAdjacentHTML("beforebegin",s);window.location.hash=n}}catch(h){console.warn("Could not scroll to hash")}}()