(()=>{"use strict";var t,e={822:()=>{function t(t){if(t.indexOf("https://thumbor.forbes.com/thumbor/")>-1){return`https://${t.split("/https://")[1]}`}return t}class e{constructor(){this.selectors={loadMore:document.querySelector(".rafeed__load-more"),postContainer:document.querySelector(".rafeed__grid-wrapper-dynamic")},this.thumborUrl=window._RaFeedData.thumborURL,this.deviceType=getDeviceTypeInNumber(window.deviceType),this.detectDesktop=1==this.deviceType||2==this.deviceType,this.detectMobile=3==this.deviceType,this.detectMobileLandscape=3==this.deviceType&&window.innerWidth>=661,this.rowPattern1Array=[0,3],this.rowPattern2Array=[1,4],this.rowPattern3Array=[2],this.rowPattern4Array=[5],this.triggerMutationInit()}triggerMutationInit(){"MutationObserver"in window&&"undefined"!=typeof MutationObserver&&this.mutationInit()}mutationInit(){new MutationObserver((t=>{t.forEach((t=>{"style"===t.attributeName&&"none"===window.getComputedStyle(this.selectors.loadMore).getPropertyValue("display")&&this.logTimeDynamicRaFeedHtmlIsAddedInDom()}))})).observe(this.selectors.loadMore,{attributes:!0})}logTimeDynamicRaFeedHtmlIsAddedInDom(){raFeedPerformanceLogger.addTimeMarker("timeWhenDynamicRaFeedHtmlIsAddedInDom"),raFeedPerformanceLogger.addTimeDifferenceMarker("timeTakenToLoadDynamicRaFeed","timeWhenDynamicRaFeedTriggerred","timeWhenDynamicRaFeedHtmlIsAddedInDom"),raFeedPerformanceLogger.sendBeacons()}raBlockGridHtml(e,r,a){let i=[],n=[],o=[],s=[],d=[],l=this.detectMobile,c=this.detectMobileLandscape,u=this.detectDesktop,h=this.thumborUrl,m=a,p=this.rowPattern1Array,g=this.rowPattern2Array,f=this.rowPattern3Array,v=this.rowPattern4Array;function A(t){return!!n.includes(t)}function b(t){return!!o.includes(t)}function w(t){return!!i.includes(t)}function y(t){return!!s.includes(t)}function k(){return!!d.includes(r)}function _(t){return w(t)&&u?"620x":c?"300x":l?"660x336":"300x"}p.includes(m)?(d=[0],n=[1,2],i=[4]):g.includes(m)?(n=[0,1],d=[2],i=[4],o=[6]):f.includes(m)?i=[3]:v.includes(m)&&(o=[0],s=[1],n=[2],i=[3]);let I=e.title,$=e.desc,C=e.url,R=e.authName,D=(e.authDesignation,e.linkAnnotation),T=e.imgAltTxt?e.imgAltTxt:"article-image",P=function(){let r=t(e.authImg),a=faglobal.theme_root+"assets/img/author.jpg";return r.indexOf("https://www.forbes.com/advisor/")>-1?`${h}24x24/${r}`:r||a}(),F=function(){let a=faglobal.theme_root+"assets/img/dummy-ra-image.png";return e.imgFtrd?`
\n\t\t\t\t\t\t\t${T}\t\n\t\t\t\t\t\t
`:`
\n\t\t\t\t\t\t\t${T}\n\t\t\t\t\t\t
`}();return`
\n\t\t\t\t\t\n\t\t\t\t\t\t${function(t){return!((A(t)||b(t)||!u)&&!l)}(r)?`${F}`:""}\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
${I}
\n\t\t\t\t\t\t\t${function(t){return!(!u||!(b(t)||y(t)||k()))}(r)?`

${$}

`:""}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t${u?`\n\t\t\t\t\t\t\t\t\t\t\t${R}\n\t\t\t\t\t\t\t\t\t\t`:""}\t\t\n\t\t\t\t\t\t\t\tBy ${R}\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
`}getArticleBatchData(t){let e=this,r=[],a=0;for(;t.length;){let i;i=e.detectMobile?t.splice(0,25):2===a||5===a?t.splice(0,6):t.splice(0,7),r.push(i),a++}r.forEach((function(t,r){let a="",i=r,n=e.rowPattern1Array,o=e.rowPattern2Array,s=e.rowPattern3Array,d=e.rowPattern4Array;a=function(t){let a=[[],[],[]],l=e.detectDesktop,c=e.detectMobile,u='
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
';return l&&(2===r||5===r?t.forEach((function(t,r){let n=`${e.raBlockGridHtml(t,r,i)}`;r<1?(a[0].push(`${u}`),a[0].push(`${n}`)):r<3?a[1].push(`${n}`):a[2].push(`${n}`)})):t.forEach((function(t,r){let n=`${e.raBlockGridHtml(t,r,i)}`;r<3?a[0].push(`${n}`):r<4?(a[1].push(`${n}`),3==r&&a[1].push(`${u}`)):a[2].push(`${n}`)}))),c?(t.forEach((function(t,r){let n=`${e.raBlockGridHtml(t,r,i)}`;a[2].push(`${n}`),(r+1)%5==0&&a[2].push(`${u}`)})),`
\n\t\t\t\t\t\t\t${a[2].join("")}\n\t\t\t\t\t\t
`):`
\n\t\t\t\t\t\t\t
${a[0].join("")}
\n\t\t\t\t\t\t\t
${a[1].join("")}
\n\t\t\t\t\t\t\t
${a[2].join("")}
\n\t\t\t\t\t\t
`}(t),e.selectors.postContainer.insertAdjacentHTML("beforeend",a),e.selectors.loadMore.style.display="none","MutationObserver"in window&&"undefined"!=typeof MutationObserver||this.logTimeDynamicRaFeedHtmlIsAddedInDom()}))}}(new class{constructor(){this.baseUrl=faglobal.rest_api_url+faglobal.version_one+"/relatedArticles",this.postId=window._RaFeedData.pid,this.deviceType=getDeviceTypeInNumber(window.deviceType),this.detectMobile=3==this.deviceType,this.isReleaseEnvironment=window._RaFeedData.isReleaseEnvironment,this.observer=null,this.rafeedUI=new e,this.raBlockData=[],window.loadDataRA=this.loadDataRACallback.bind(this),this.loadDataRACallbackInvocationCount=0,this.jsonAdsApiInvocationCount=0,this.relatedArticlesApiInvocationCount=0}loadDataRACallback(t,e){this.loadDataRACallbackInvocationCount++,raFeedPerformanceLogger.addTimeMarker("timeWhenProcessingOfApiResponseStarts_"+this.loadDataRACallbackInvocationCount),e?raFeedPerformanceLogger.addTimeMarker("timeWhenProcessingOfRelatedArticlesApiResponseStarts_"+this.relatedArticlesApiInvocationCount):raFeedPerformanceLogger.addTimeMarker("timeWhenProcessingOfJsonAdsApiResponseStarts_"+this.jsonAdsApiInvocationCount);let r=this.getProcessedData(t,e),a=this.getFallbackPostCount(r.length);this.raBlockData=this.raBlockData.concat(r).slice(0,a.finalCount),this.raBlockData.length({title:t.title,url:t.clickUrl,imgFtrd:t.imagePathOrg,imgAltTxt:t.title,authName:t.misc.tags.auth_name.value,authImg:t.misc.tags.author_image_url.value,authDesignation:t.misc.tags.auth_role.value,desc:t.description}))):[]}getProcessedData(t,e){let r,a=[];if(e){r=t?.posts||[];for(var i=0;i{if(200===e.status){const t=JSON.parse(e.responseText);this.loadDataRACallback(t,!0)}},raFeedPerformanceLogger.addTimeMarker("timeWhenRelatedArticlesApiCallIsFired_"+this.relatedArticlesApiInvocationCount),e.send()}getRelatedArticles(){let t=[...this.raBlockData];this.rafeedUI.getArticleBatchData(t),this.loadDfpAds(),function(){let t=0,e=0,r=document.documentElement,a=0;window.addEventListener("scroll",debounce((function(){a=(window.pageYOffset||r.scrollTop)-(r.clientTop||0),e p").length,e=Math.ceil(.25*t),r=[document.querySelector(`.article-body > p:nth-last-child(${e})`),document.querySelector(".rafeed")].filter((t=>null!==t));this.observer=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting)if("ra-ed-wrap"===t.target.className){let r=[],a=t.target.getAttribute("data-pos"),i=t.target.getAttribute("data-index");if(r.push(a),console.log("Placeholder and ra-ed-wrap found",t.target.querySelector(".bottom-ed-placeholder")),a&&i){var e=1==i?0:2;i=parseInt(i,10)+e,setTimeout((()=>{deviceType=getDeviceTypeInNumber(deviceType),[i,i+1,i+2].forEach((t=>{document.getElementById("ra-ed-"+t)&&!0!==window.placeHolderMap["bottomad-"+t]&&loadSingleUnit(["bottomad"],t,"ra-ed-"+t)}))}),100),this.observer.unobserve(t.target)}}else{r.forEach((t=>this.observer.unobserve(t))),this.jsonAdsApiInvocationCount++,1===this.jsonAdsApiInvocationCount&&raFeedPerformanceLogger.addTimeMarker("timeWhenDynamicRaFeedTriggerred"),new URLSearchParams(location.search).has("ra-feed-debug")?function(){let t=window._RaFeedData.isProductionEnvironment,e=3==getDeviceTypeInNumber(window.deviceType);const r=`https://rdap.media.net/jsonAds?keywords=forbes&pdn=advisor.forbes.com&cid=8CURNW6B8&crid=442226652&serveUrl=${t?encodeURIComponent(window.location.href.split("?")[0]):encodeURIComponent("https://www.forbes.com/advisor/retirement/cares-act-retirement-account-rules-covid-19/")}&productType=11&callback=loadDataRA&maxAdCount=${e?"31":"46"}&utm_source=ra&utm_medium=referral`;let a=document.createElement("script");a.setAttribute("src",r),a.setAttribute("id","jsonp");let i=document.getElementById("jsonp"),n=document.getElementsByTagName("head")[0];null==i?n.appendChild(a):n.replaceChild(a,i)}():this.loadDataRACallback([],!0),raFeedPerformanceLogger.addTimeMarker("timeWhenJsonAdsApiUrlPreparationStarts_"+this.jsonAdsApiInvocationCount),raFeedPerformanceLogger.addTimeMarker("timeWhenJsonAdsApiCallIsFired_"+this.jsonAdsApiInvocationCount)}}))})),r.forEach((t=>this.observer.observe(t)))}init(){this.startObserving()}}).init()},826:()=>{}},r={};function a(t){var i=r[t];if(void 0!==i)return i.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,a),n.exports}a.m=e,t=[],a.O=(e,r,i,n)=>{if(!r){var o=1/0;for(c=0;c=n)&&Object.keys(a.O).every((t=>a.O[t](r[d])))?r.splice(d--,1):(s=!1,n0&&t[c-1][2]>n;c--)t[c]=t[c-1];t[c]=[r,i,n]},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={337:0,59:0};a.O.j=e=>0===t[e];var e=(e,r)=>{var i,n,[o,s,d]=r,l=0;if(o.some((e=>0!==t[e]))){for(i in s)a.o(s,i)&&(a.m[i]=s[i]);if(d)var c=d(a)}for(e&&e(r);la(822)));var i=a.O(void 0,[59],(()=>a(826)));i=a.O(i)})();