/*! For license information please see index.js.LICENSE.txt */ (()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:I(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),g}},r}function o(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var i=t.apply(e,r);function c(t){o(i,n,a,c,u,"next",t)}function u(t){o(i,n,a,c,u,"throw",t)}c(void 0)}))}}window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){var t=arguments;if("event"===t[0]){var e=t[1],r=t[2]||{},n=Object.assign({event:e,sendToGA:!0},r);window.dataLayer.push(n),window.dataLayer.push({sendToGA:!1})}else window.dataLayer.push(t)};var i,c,u,s,l,f,h,p=function(){var t=a(n().mark((function t(){var e,r,o,a,i;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("undefined"!=typeof ipapiKey&&ipapiKey){t.next=2;break}throw new Error("IP-API key not configured. Add it in Settings → Vida Pages → Integrations.");case 2:if(e="geoip",t.prev=3,!(r=sessionStorage.getItem(e))){t.next=7;break}return t.abrupt("return",JSON.parse(r));case 7:return o="https://pro.ip-api.com/json/?key=".concat(ipapiKey),t.next=10,fetch(o);case 10:if((a=t.sent).ok){t.next=13;break}throw new Error("HTTP error! status: ".concat(a.status));case 13:return t.next=15,a.json();case 15:return i=t.sent,sessionStorage.setItem(e,JSON.stringify(i)),t.abrupt("return",i);case 20:throw t.prev=20,t.t0=t.catch(3),console.error("Error fetching IP data:",t.t0),t.t0;case 24:case"end":return t.stop()}}),t,null,[[3,20]])})));return function(){return t.apply(this,arguments)}}();function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function d(t){return function(t){if(Array.isArray(t))return w(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(){v=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var a=e&&e.prototype instanceof w?e:w,i=Object.create(a.prototype),c=new T(n||[]);return o(i,"_invoke",{value:j(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",g={};function w(){}function b(){}function x(){}var L={};s(L,i,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,i)&&(L=S);var O=x.prototype=w.prototype=Object.create(L);function k(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==y(l)&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(l).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function j(e,r,n){var o=h;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=P(c,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var s=f(e,r,n);if("normal"===s.type){if(o=n.done?m:p,s.arg===g)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function A(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,s=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){s=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r8?(console.log("".concat(e,": days_ahead value of ").concat(t," exceeds API limit, capping at 8 days")),8):t}function h(t,e,r){var n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(n,"g");!function n(a){if(a.nodeType===Node.TEXT_NODE)a.textContent.includes(e)&&(a.textContent=a.textContent.replace(o,r));else if(a.nodeType===Node.ELEMENT_NODE){if(a!==t&&a.matches(".lp_weather, .lp_weather_condition, .lp_weather_alerts"))return;Array.from(a.childNodes).forEach(n)}}(t)}function p(t,e){if("DIV"===t.tagName)for(var r=0,n=Object.entries(e);r=l?e.style.display="none":(e.style.display="",e.classList.add("loaded"))):e.style.display="none",t.next=21;break;case 17:t.prev=17,t.t0=t.catch(0),console.error("Weather placeholder error:",t.t0),e.style.display="none";case 21:case"end":return t.stop()}}),t,null,[[0,17]])})))).apply(this,arguments)}function w(t,e){return b.apply(this,arguments)}function b(){return(b=x(v().mark((function t(e,r){var n,o,a;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,n=e.dataset.showWhen||"exists",t.next=4,c(r.lat,r.lon);case 4:if(o=t.sent){t.next=8;break}return e.style.display="none",t.abrupt("return");case 8:a=o.count>0,"exists"===n&&a||"none"===n&&!a?(a&&o.alerts&&o.alerts.length>0&&(e.innerHTML=o.alerts.map((function(t){var e=t.event||"Weather Alert",r=t.description||"",n=t.sender_name||"",o="".concat(e,"");return n&&(o+=" (".concat(n,")")),r&&(o+="
".concat(r)),o})).join("

")),e.style.display="",e.classList.add("loaded")):e.style.display="none",t.next=17;break;case 13:t.prev=13,t.t0=t.catch(0),console.error("Alerts placeholder error:",t.t0),e.style.display="none";case 17:case"end":return t.stop()}}),t,null,[[0,13]])})))).apply(this,arguments)}function L(t,e){return E.apply(this,arguments)}function E(){return(E=x(v().mark((function t(e,r){var n,o,a,i;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,n=e.dataset.condition||null,o=e.dataset.conditionId||null,a=f(parseInt(e.dataset.daysAhead)||7,"Weather condition"),n||o){t.next=8;break}return console.error("Missing condition or condition_id parameter:",e),e.style.display="none",t.abrupt("return");case 8:return t.next=10,s(n,o,a,r.lat,r.lon);case 10:if((i=t.sent)&&i.found){t.next=14;break}return e.style.display="none",t.abrupt("return");case 14:i.weather&&p(e,{"{weather.id}":i.weather.id||"","{weather.main}":i.weather.main||"","{weather.description}":i.weather.description||"","{weather.icon}":i.weather.icon||""}),e.style.display="",e.classList.add("loaded"),t.next=23;break;case 19:t.prev=19,t.t0=t.catch(0),console.error("Condition placeholder error:",t.t0),e.style.display="none";case 23:case"end":return t.stop()}}),t,null,[[0,19]])})))).apply(this,arguments)}function S(){return O.apply(this,arguments)}function O(){return(O=x(v().mark((function t(){var r,n,o,a,i;return v().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=document.querySelectorAll(".lp_weather"),n=document.querySelectorAll(".lp_weather_alerts"),o=document.querySelectorAll(".lp_weather_condition"),0!==r.length||0!==n.length||0!==o.length){t.next=5;break}return t.abrupt("return");case 5:return t.next=7,e();case 7:if(a=t.sent){t.next=14;break}return console.error("Unable to determine location"),r.forEach((function(t){return t.style.display="none"})),n.forEach((function(t){return t.style.display="none"})),o.forEach((function(t){return t.style.display="none"})),t.abrupt("return");case 14:return i=[].concat(d(Array.from(r).map((function(t){return y(t,a)}))),d(Array.from(n).map((function(t){return w(t,a)}))),d(Array.from(o).map((function(t){return L(t,a)})))),t.next=17,Promise.allSettled(i);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",S):S()}();var L=["tracking.smartlifestyletrends.com","t.roofingcosts.org","tracking.perftrk.com","t.savingsaccounts.com","t.insure.com","t.walkinbathtubs.org","t.moneyrates.com","t.americanhomewarranty.org","t.hvacpros.org","t.bathandshowerpros.com","tracking.lifestyletipstoday.com","t.eriehomeroofers.com","tracking.smartestlifestyletrends.com","t.homewindowprices.org"];function E(t){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},E(t)}document.addEventListener("DOMContentLoaded",(function(){L.forEach((function(t){document.querySelectorAll('a[href*="'.concat(t,'"]')).forEach((function(t){t.target="_blank"}))}))})),document.addEventListener("DOMContentLoaded",(function(){var t=new URLSearchParams(window.location.search),e="disclaimer";if(t.has(e)){var r=t.get(e);if("no"==r||!r)document.querySelector(".advertorial-disclaimer").style.display="none"}})),document.addEventListener("DOMContentLoaded",(function(){var t;if("undefined"!=typeof dynamicDate){var e=document.querySelectorAll(".post-date"),r=new Date,n=["January","February","March","April","May","June","July","August","September","October","November","December"][r.getMonth()],o=(t=r.getDate())+(t%10==1&&11!=t?"st":t%10==2&&12!=t?"nd":t%10==3&&13!=t?"rd":"th"),a=r.getFullYear();e.forEach((function(t){return t.innerText="".concat(n," ").concat(o,", ").concat(a)}))}})),document.addEventListener("DOMContentLoaded",(function(t){var e=new URLSearchParams(window.location.search);if(e.has("o")){var r=document.querySelector(".posts__loop"),n=r.querySelectorAll(".wp-block-group"),o=n.item(0).previousSibling;e.get("o").split("-").reverse().forEach((function(t){var e=n.item(parseInt(--t));r.insertBefore(e,o.nextSibling)}))}document.querySelectorAll(".attrakt--listicle-item").forEach((function(t,e){var r=t.querySelector("h1,h2,h3,h4,h5,h6");console.log(r),r.prepend("".concat(e+1,". "))}))})),document.addEventListener("DOMContentLoaded",(function(){var t=new URLSearchParams(window.location.search),e="click_index";if(t.has(e)){var r=document.querySelectorAll("a[href*='tracking.smartestlifestyletrends.com']"),n=t.get(e);r.forEach((function(t){t.href=t.href.replace(/\/click(\/)?/gm,"/click/".concat(n))}))}}));var S,O,k,_,j,P=["phoneAssignmentKey"];function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function N(t){for(var e=1;e=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function q(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function D(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){q(a,n,o,i,c,"next",t)}function c(t){q(a,n,o,i,c,"throw",t)}i(void 0)}))}}S=window.location.host,O=S.includes("test.")||S.includes("staging.")||"localhost"===S,k=function(t){if(10===t.length)return"(".concat(t.slice(0,3),") ").concat(t.slice(3,6),"-").concat(t.slice(6));if(t.length>10){var e=t.slice(0,10),r=t.slice(11);return"(".concat(e.slice(0,3),") ").concat(e.slice(3,6),"-").concat(e.slice(6)," ext. ").concat(r)}return t},_=function(){var t=D(G().mark((function t(e,r,n){var o,a,i,c,u;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,o=new URLSearchParams({PublisherSubID:r||"",Publisher_TrxID:n||"",quadTagId:e||""}),a="".concat(O?"https://ivr.quinstage.com":"https://ivr.quinstreet.com","/number/?service=assign&BusinessUnit=SH&vendorKeys=-1&PortalServiceCode=AUTOINSURANCE&QS_CATEGORY=Insurance%2C+Auto&assignNonOverflowOnly=Y"),i="".concat(a,"&").concat(o.toString()),t.next=7,fetch(i);case 7:if((c=t.sent).ok){t.next=10;break}throw new Error("HTTP error! status: ".concat(c.status));case 10:return t.next=12,c.json();case 12:return u=t.sent,t.abrupt("return",u);case 16:return t.prev=16,t.t0=t.catch(0),console.error("Error fetching phone number:",t.t0),t.abrupt("return",null);case 20:case"end":return t.stop()}}),t,null,[[0,16]])})));return function(e,r,n){return t.apply(this,arguments)}}(),j=function(){var t=D(G().mark((function t(){var e,r,n,o,a,i,c,u,s,l,f;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=new URLSearchParams(window.location.search),r=e.get("PublisherSubID"),n=e.get("Publisher_TrxID"),o=O?128216763:204687271,t.next=6,_(o,r,n);case 6:if(a=t.sent){t.next=9;break}return t.abrupt("return",null);case 9:return i=Object.values(a),c=i[0],u="".concat(c.ccPhoneNum),"Y"===c.overflowPhoneFlag&&(u+=",".concat(c.extn)),s=k(u),(l=i[0]).phoneAssignmentKey,f=I(l,P),t.abrupt("return",{phone:{html:u,formatted:s},response:N({},f)});case 16:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),window.aquavida=window.aquavida||{},window.aquavida.ivr=window.aquavida.ivr||{formatPhoneNumber:k,getPhoneNumber:j}})();