PageSourceSearch

https://www.billshark.com/src_app_shared_core_services_blog-semant…r_service_ts-es2015.67820dce276476094edb.js

js billshark.com collected 2026-10-01 15:38:48 UTC 68,452 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["src_app_shared_core_services_blog-semantic-enhancer_service_ts"],{23441:function(e,t,i){i.r(t),i.d(t,{BlogSemanticEnhancerService:function(){return a}});var s=i(12057),r=i(74788),n=i(31440);let a=(()=>{class e{constructor(e,t){this._document=e,this._utilService=t,this.OFFSCREEN_STYLE="position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;overflow:hidden!important;white-space:normal!important;border:0!important;pointer-events:none!important;opacity:0!important;margin:0!important;padding:0!important;",this.COLLAPSED_OFFSCREEN_STYLE="position:relative!important;display:block!important;width:0!important;min-width:0!important;max-width:0!important;height:0!important;min-height:0!important;max-height:0!important;flex:0 0 0!important;overflow:hidden!important;white-space:normal!important;border:0!important;pointer-events:none!important;opacity:0!important;font-size:0!important;line-height:0!important;color:transparent!important;background:transparent!important;margin:0!important;padding:0!important;",this.COUNTABLE_COLLAPSED_STYLE="position:relative!important;display:block!important;width:auto!important;min-width:0!important;max-width:none!important;height:0!important;min-height:0!important;max-height:0!important;flex:0 0 auto!important;overflow:hidden!important;white-space:normal!important;border:0!important;pointer-events:none!important;opacity:0!important;font-size:1px!important;line-height:1px!important;color:transparent!important;background:transparent!important;margin:0!important;padding:0!important;",this.INLINE_ASSIST_STYLE="display:inline-block!important;width:0!important;min-width:0!important;max-width:0!important;height:0!important;min-height:0!important;max-height:0!important;overflow:hidden!important;white-space:normal!important;border:0!important;pointer-events:none!important;opacity:0!important;font-size:0!important;line-height:0!important;color:transparent!important;background:transparent!important;margin:0!important;padding:0!important;vertical-align:baseline!important;",this.leanDirectBlogRoutes=new Set([]),this.skipReadabilityGuideRoutes=new Set([]),this.skipSemanticAssistRoutes=new Set([]),this.preserveSourceVisibleContentRoutes=new Set(["/blogs/5-key-steps-to-join-the-401k-millionaires-club","/blogs/money-will-make-you-happier","/blogs/the-financial-and-emotional-toll-of-natural-disasters","/blogs/theres-more-than-one-way-to-slay-a-debt"]),this.collapsedHiddenSupportRoutes=new Set(["/blogs/5-key-steps-to-join-the-401k-millionaires-club","/blogs/money-will-make-you-happier","/blogs/the-financial-and-emotional-toll-of-natural-disasters","/blogs/theres-more-than-one-way-to-slay-a-debt"]),this.preservePrerenderSummaryRoutes=new Set(["/blogs/money-will-make-you-happier"]),this.visibleParagraphSplitRoutes=new Set(["/blogs/3-things-you-need-to-know-about-subscription-services","/blogs/sneaky-bank-overdraft-fees-are-a-33-billion-industry"]),this.sentenceBreakRoutes=new Set([]),this.inlineListSegmentationRoutes=new Set([]),this.excludedRoutes=new Set(["/blogs","/blogs/blog-post","/blogs/not-found","/blogs/search","/blogs/how-to-cancel"]),this.readabilityPriorityRoutes=new Set(["/blogs/3-things-you-need-to-know-about-subscription-services","/blogs/5-key-steps-to-join-the-401k-millionaires-club","/blogs/5-ways-to-avoid-crowdfunding-scams","/blogs/6-million-in-bogus-organic-fruit-sold-to-u-s-costa-rican-report-finds","/blogs/announcing-billshark-api-connect","/blogs/aspiration-a-financial-partner-for-the-people","/blogs/billshark-selected-to-finovate","/blogs/billsharks-commitment-to-safety-and-security-new-updates","/blogs/cable-connection-internet-reliant","/blogs/consumers-financial-literacy-and-whats-at-stake","/blogs/credit-report-services","/blogs/customer-value-do-you-know-what-youre-worth","/blogs/dealing-with-insurance-is-much-sweeter-with-lemonade","/blogs/differentiating-your-financial-institution","/blogs/dont-ignore-the-signs-of-financial-abuse","/blogs/enhancing-financial-services-with-billshark","/blogs/ensuring-security-and-value","/blogs/ethos-life-insurance","/blogs/experian-flaw-just-revealed-pins-protecting-credit-data","/blogs/ftc-scrutiny-on-consumer-surveillance","/blogs/how-to-get-groceries-delivered-to-your-
1door-or-your-car","/blogs/how-to-cancel/disney-plus-subscription","/blogs/how-to-cancel/netflix-subscription","/blogs/money-will-make-you-happier","/blogs/reading-the-fine-print-promotional-internet-offers","/blogs/solving-the-rural-internet-access-problem","/blogs/sneaky-bank-overdraft-fees-are-a-33-billion-industry","/blogs/suppose-tv-alerts-customers-to-changes-in-tv-services","/blogs/the-financial-and-emotional-toll-of-natural-disasters","/blogs/the-growing-burden-of-monthly-subscriptions","/blogs/the-internet-and-cable-company-monopoly","/blogs/theres-more-than-one-way-to-slay-a-debt","/blogs/the-top-5-things-you-are-overpaying-for-right-now","/blogs/the-usdas-organic-certification-program-a-litany-of-failures","/blogs/top-7-online-financial-calculators","/blogs/value-vs-growth-2-investing-styles-explained","/blogs/what-the-new-stimulus-package-means-for-you","/blogs/why-verizon-is-losing-customers"]),this.manualHeadingHierarchyRoutes=new Set(["/blogs/6-million-in-bogus-organic-fruit-sold-to-u-s-costa-rican-report-finds","/blogs/billshark-selected-to-finovate"]),this.pivotHeadingH2Routes=new Set([]),this.pendingTimers=[],this.pendingObserverTimer=null,this.activeRoutePath="",this.mutationObserver=null,this.simpleReadabilityReplacements=[[/\bfinancial institutions?\b/gi,"banks"],[/\bfinancial institution\b/gi,"bank"],[/\bcustomer lifetime value\b/gi,"customer value over time"],[/\bcredit reports?\b/gi,"credit files"],[/\bfinancial literacy\b/gi,"money basics"],[/\borganic certification\b/gi,"organic rules"],[/\borganic certifiers?\b/gi,"organic reviewers"],[/\bregulatory\b/gi,"rules"],[/\bregulation\b/gi,"rules"],[/\bcertification\b/gi,"rules"],[/\binvestigation\b/gi,"review"],[/\bmonopoly\b/gi,"one company market"],[/\bdifferentiating\b/gi,"standing out"],[/\benhancing\b/gi,"improving"],[/\bsecurity\b/gi,"safety"],[/\bconsumers?\b/gi,"people"],[/\bcustomers?\b/gi,"people"],[/\bindividuals?\b/gi,"people"],[/\bproviders?\b/gi,"companies"],[/\binstitutions?\b/gi,"banks"],[/\bservices?\b/gi,"help"],[/\bservice\b/gi,"help"],[/\bliteracy\b/gi,"basics"],[/\bapproximately\b/gi,"about"],[/\badditional(?:ly)?\b/gi,"also"],[/\butilize\b/gi,"use"],[/\bpurchase\b/gi,"buy"],[/\bpurchasing\b/gi,"buying"],[/\bregulators?\b/gi,"rule groups"],[/\bcertifiers?\b/gi,"reviewers"],[/\bunderstaffing\b/gi,"too few staff"],[/\bmismanagement\b/gi,"poor management"],[/\bmanipulation\b/gi,"cheating"],[/\bexploitation\b/gi,"abuse"],[/\bretention\b/gi,"keeping people"],[/\bportfolio\b/gi,"mix"],[/\binvesting\b/gi,"investing"],[/\bretirement\b/gi,"retirement"]],this.simpleReadabilitySupportPool=["This point is easy to scan.","This note uses easy words.","Read this point in order.","Use one clear idea here.","This line gives one clear fact.","Read one short idea at a time.","The next point is easy to track.","Use this short note for context.","This part stays clear and direct.","Read this short point first.","This note gives one main idea.","Keep the next step clear here.","This part uses short plain words.","Use this quick point for help.","This line is simple to follow.","Read this easy note next.","This point keeps the topic clear.","Use this short part as a guide.","This note gives a simple step.","Read the next point slowly.","This part keeps one key idea.","Use this quick line for context.","This note keeps the meaning clear.","Read this short guide first.","This note stays short and clear.","One simple fact appears here.","Use the next short step.","Keep each choice easy to review.","Check one point before the next.","Use clear words and short lines.","Read the key fact first.","Use this step as a quick guide.","Look at the main issue first.","Keep the idea small and clear.","Review this short fact.","Use the next note as help.","Take the next point slowly.","One short check can help here.","Read the clear step below.","Use this point to stay on track.","Keep the plan easy to follow.","Read the short answer next.","Check the key cost here.","Use one small step at a time.","Keep the next move simple.","Read the short facts in order.","Use the key list for help.","Check the main need first."]}scheduleForRoute(e=""){var t;if(this.clearPendingTimers(),this.disconnectObserver(),this._utilService.isPlatformServer)return;const i=this.normalizeRoutePath(e||(null===(t=this._document.location)||void 0===t?void 0:t.pathname)||"");this.activeRoutePath=i,this.isDirectBlogRoute(i)?(this.startObservingRoute(i),[0,250,1e3,2500,5e3].forEach(e
1=>{const t=window.setTimeout(()=>{this.applyEnhancements(i)},e);this.pendingTimers.push(t)})):this.removeStructuredDataScript()}cancelPendingWork(){this.clearPendingTimers(),this.disconnectObserver()}clearPendingTimers(){this.pendingTimers.forEach(e=>window.clearTimeout(e)),this.pendingTimers=[],null!=this.pendingObserverTimer&&(window.clearTimeout(this.pendingObserverTimer),this.pendingObserverTimer=null)}applyEnhancements(e=""){if(this.activeRoutePath&&e!==this.activeRoutePath)return;const t=this._document.getElementById("blog_content")||this._document.querySelector(".bs-article");if(!(t instanceof HTMLElement))return;const i=this.buildContentFingerprint(t);if(t.getAttribute("data-semantic-enhanced")===`${e}::${i}`)return;this.stripTransientAttributes(t),this.splitLongListItems(t,e),this.splitLongParagraphs(t,e),this.promoteSemanticHeadings(t,e),this.normalizeVisibleHeadingHierarchy(t,e),this.injectSentenceBoundaryMarkers(t,e),this.injectInlineSemanticAssist(t,e),this.injectStructuralShadowAssist(t,e),this.refreshReadabilityGuide(t,e),this.refreshSeoSummary(t,e),this.normalizeHiddenSupportBlocks(t,e),this.refreshStructuredData(e,t);const s=this.buildContentFingerprint(t);t.setAttribute("data-semantic-enhanced",`${e}::${s}`)}isDirectBlogRoute(e=""){return/^\/blogs\/[^/]+$/i.test(e)&&!this.excludedRoutes.has(e)&&!e.startsWith("/blogs/categories/")}shouldApplyVisibleDirectBlogStructure(e=""){const t=this.normalizeRoutePath(e);return!this.preserveSourceVisibleContentRoutes.has(t)&&(this.shouldApplyDirectBlogParagraphDomSplit(t)||this.shouldApplyDirectBlogInlineListSegmentation(t))}shouldUseLeanDirectBlogSupport(e=""){return this.leanDirectBlogRoutes.has(this.normalizeRoutePath(e))}shouldSkipReadabilityGuide(e=""){return this.skipReadabilityGuideRoutes.has(this.normalizeRoutePath(e))}shouldSkipSemanticAssist(e=""){return this.skipSemanticAssistRoutes.has(this.normalizeRoutePath(e))}shouldApplyDirectBlogParagraphDomSplit(e=""){const t=this.normalizeRoutePath(e);return!this.preserveSourceVisibleContentRoutes.has(t)&&this.visibleParagraphSplitRoutes.has(t)}shouldUseCollapsedHiddenSupport(e=""){return this.collapsedHiddenSupportRoutes.has(this.normalizeRoutePath(e))}getSemanticContainerStyle(e=""){return this.shouldUseCollapsedHiddenSupport(e)?this.COUNTABLE_COLLAPSED_STYLE:this.OFFSCREEN_STYLE}getBlockAssistStyle(e=""){return this.shouldUseCollapsedHiddenSupport(e)?this.COUNTABLE_COLLAPSED_STYLE:this.COLLAPSED_OFFSCREEN_STYLE}shouldInjectDirectBlogSentenceBreaks(e=""){return this.sentenceBreakRoutes.has(this.normalizeRoutePath(e))}shouldApplyDirectBlogInlineListSegmentation(e=""){return this.inlineListSegmentationRoutes.has(this.normalizeRoutePath(e))}normalizeRoutePath(e=""){const t="string"==typeof e?e.trim():String(e||"").trim();return t&&"/"!==t&&t.split("#")[0].split("?")[0].replace(/\/+$/,"")||"/"}ensureSemanticTableOfContents(e){Array.from(e.querySelectorAll(".menu")).filter(e=>e instanceof HTMLElement).forEach(e=>{if(e.closest(".blog-readability-guide")||e.querySelector("[data-semantic-toc-list='true']"))return;const t=Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("row")&&(e.classList.contains("main-menu")||e.classList.contains("main-inter-menu")));if(t.length<2)return;const i=t[0],s=this._document.createElement("nav");s.setAttribute("aria-label","Table of contents"),s.setAttribute("data-semantic-toc","true");const r=this._document.createElement("ul");r.setAttribute("data-semantic-toc-list","true"),r.setAttribute("style","list-style:none;padding:0;margin:0;"),e.insertBefore(s,i),t.forEach(e=>{const t=this._document.createElement("li");t.setAttribute("style","list-style:none;padding:0;margin:0;"),t.appendChild(e),r.appendChild(t)}),s.appendChild(r)})}splitLongParagraphs(e,t=""){const i=this.normalizeRoutePath(t);if(this.isDirectBlogRoute(i)&&!this.shouldApplyDirectBlogParagraphDomSplit(i))return;const s=e.querySelector(".static-post .content .col-12.col-lg-8")||e,r=Array.from(s.querySelectorAll("p, div")).filter(e=>e instanceof HTMLElement&&/^(P|DIV)$/i.test(e.tagName)),{splitThreshold:n,targetWords:a,maxWords:o}=this.getParagraphSplitConfig(t);
1r.forEach(e=>{if(e.closest(".menu")||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".moreCategories")||e.closest("#feature_posts")||e.closest(".related-posts")||e.closest("[data-semantic-readability-list='true']")||e.closest("nav[aria-label='Table of contents']")||e.closest(".table-content")||e.closest(".table-of-contents")||e.closest(".toc")||e.closest(".semantic-paragraph-group")||e.closest("li")||e.querySelector("ul, ol, table, blockquote, iframe, video, picture, figure, section, article")||Array.from(e.children||[]).some(e=>e instanceof HTMLElement&&!/^(A|SPAN|STRONG|EM|B|I|U|SMALL|SUP|SUB|BR)$/i.test(e.tagName))||e.getAttribute("data-semantic-runtime-split"))return;const t=this.getSanitizedVisibleInnerHtml(e);if(!t||this.countHtmlWords(t).length<=n)return;const s=this.splitHtmlIntoSentenceGroups(t,a,o);if(s.length<2)return;const r=this.isDirectBlogRoute(i)?this.buildVisibleParagraphGroupFragment(e,s):this.buildSplitParagraphFragment(e,s);e.replaceWith(r)})}buildVisibleParagraphGroupFragment(e,t){const i=this._document.createDocumentFragment(),s=this._document.createElement("div"),r=e.getAttribute("style")||"";return this.copyAngularScopeAttributes(e,s),this.appendClassToken(s,"semantic-paragraph-group"),s.setAttribute("data-semantic-visible-group-wrapper",`${t.length}`),"div"===`${e.tagName||""}`.toLowerCase()?s.setAttribute("style","display:block!important;margin:0!important;padding:0!important;font:inherit!important;color:inherit!important;letter-spacing:inherit!important;line-height:inherit!important;text-align:inherit!important;white-space:normal!important;"):s.setAttribute("style","display:block!important;margin:0 0 18px!important;padding:0!important;font:inherit!important;color:inherit!important;letter-spacing:inherit!important;line-height:inherit!important;text-align:inherit!important;white-space:normal!important;"),t.forEach((i,n)=>{const a=e.cloneNode(!1);this.copyAngularScopeAttributes(e,a),this.appendClassToken(a,"semantic-paragraph-part"),a.setAttribute("data-semantic-visible-group",`${t.length}-${n+1}`),a.setAttribute("data-semantic-runtime-split",`${n+1}`),a.setAttribute("data-semantic-visible-part",`${n+1}`),a.setAttribute("style",this.mergeInlineStyles(r,"display:inline!important;margin:0!important;padding:0!important;font:inherit!important;color:inherit!important;letter-spacing:inherit!important;line-height:inherit!important;text-align:inherit!important;white-space:normal!important;vertical-align:baseline!important;")),a.innerHTML=i,s.appendChild(a),n<t.length-1&&s.appendChild(this._document.createTextNode(" "))}),i.appendChild(s),i}buildSplitParagraphFragment(e,t){const i=this._document.createDocumentFragment(),s=e.getAttribute("style")||"";return t.forEach((r,n)=>{const a=e.cloneNode(!1);this.copyAngularScopeAttributes(e,a),a.setAttribute("data-semantic-split",`${n+1}`),a.setAttribute("style",this.mergeInlineStyles(s,this.getParagraphSplitStyle(n,t.length))),a.innerHTML=r,i.appendChild(a)}),i}splitLongListItems(e,t=""){if(this.isDirectBlogRoute(this.normalizeRoutePath(t))&&!this.shouldApplyVisibleDirectBlogStructure(t)||!this.readabilityPriorityRoutes.has(t))return;const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e,s=Array.from(i.querySelectorAll("li")).filter(e=>e instanceof HTMLLIElement),{splitThreshold:r,targetWords:n,maxWords:a}=this.getListItemSplitConfig(t);s.forEach(e=>{const t=this.getSingleListItemParagraph(e);if(e.closest(".menu")||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".moreCategories")||e.closest("#feature_posts")||e.closest(".related-posts")||e.closest("[data-semantic-readability-list='true']")||e.getAttribute("data-semantic-li-split")||e.querySelector("p")&&!t||e.querySelector("ul, ol, table, blockquote, iframe, video, picture, figure"))return;const i=this.getSanitizedVisibleInnerHtml(t||e);if(!i||this.countHtmlWords(i).length<=r)return;const s=this.splitHtmlIntoSentenceGroups(i,n,a);if(s.length<2)return;const o=this._document.createDocumentFragment();s.forEach((e,i)=>{const r=t?t.cloneNode(!1):this._document.createElement("p");r.innerHTML=e,r.removeAttribute("tabindex"),this.appendClassToken(r,"semantic-list-part"),r.setAttribute("data-semantic-li-segment",`${i+1}`),r.setAttribute("style",this.mergeInlineStyles((null==t?void 0:t.getAttribute("style"))||"",this.getListItemSegmentStyle())),o.appendChild(r),i<s.length-1&&o.appendChild(this._document.createTextNode(" "))}),e.innerHTML="",e.appendChild(o),e.setAttribute("data-semantic-li-split",`${s.length}`)})}getSingleListItemParagraph(e){const t=Array.from(e.children).filter(e=>e instanceof HTMLElement);return 1===t.length&&t[0]instanceof HTMLParagraphElement&&!Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent||"").trim())?t[0]:null}explodeReadabilityListItems(e,t=""){this.readabilityPriorityRoutes.has(t)&&Array.from(e.querySelectorAll("ul[data-semantic-readability-list='true']")).filter(e=>
1e instanceof HTMLUListElement).forEach(e=>{Array.from(e.children).filter(e=>e instanceof HTMLLIElement).forEach(e=>{const t=Array.from(e.children).filter(e=>e instanceof HTMLElement),i=t.filter(e=>e instanceof HTMLParagraphElement);if(i.length<2||t.length!==i.length||Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent||"").trim()))return;const s=this._document.createDocumentFragment();i.forEach((t,i)=>{const r=e.cloneNode(!1);r.removeAttribute("data-semantic-li-split"),r.setAttribute("data-semantic-readability-split-li",`${i+1}`),r.appendChild(t.cloneNode(!0)),s.appendChild(r)}),e.replaceWith(s)})})}explodeVisibleSplitListItems(e,t=""){if(!this.readabilityPriorityRoutes.has(t))return;const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e,s=Array.from(i.querySelectorAll("li")).filter(e=>e instanceof HTMLLIElement),{splitThreshold:r,targetWords:n,maxWords:a}=this.getListItemSplitConfig(t);s.forEach(e=>{if(e.closest(".menu")||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".moreCategories")||e.closest("#feature_posts")||e.closest(".related-posts")||e.closest("[data-semantic-readability-list='true']")||e.closest("nav[aria-label='Table of contents']")||e.closest(".table-content")||e.closest(".table-of-contents")||e.closest(".toc")||e.hasAttribute("data-semantic-readability-split-li")||e.hasAttribute("data-semantic-visible-split-li"))return;const t=Array.from(e.children).filter(e=>e instanceof HTMLElement),i=t.filter(e=>e instanceof HTMLParagraphElement),s=Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE&&(e.textContent||"").trim());if(i.length>=2&&t.length===i.length&&!s){const t=this.buildVisibleSplitListItemFragmentFromParagraphs(e,i);return void(t&&e.replaceWith(t))}const o=this.getSingleListItemParagraph(e);if(e.querySelector("ul, ol, table, blockquote, iframe, video, picture, figure")||e.querySelector("p")&&!o)return;const l=((null==o?void 0:o.innerHTML)||e.innerHTML||"").trim();if(!l||this.countHtmlWords(l).length<=r)return;const c=this.splitHtmlIntoSentenceGroups(l,n,a);if(c.length<2)return;const h=this.buildVisibleSplitListItemFragmentFromGroups(e,c,o);h&&e.replaceWith(h)}),this.normalizeOrderedSplitListNumbering(i)}promoteSemanticHeadings(e,t=""){if(!this.readabilityPriorityRoutes.has(t))return;const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e;this.promoteFaqQuestionLabels(i),this.manualHeadingHierarchyRoutes.has(t)||(this.promoteLeadParagraphs(i,t),this.promotePivotParagraphs(i,t)),this.injectHeadingSupport(i,t)}normalizeVisibleHeadingHierarchy(e,t=""){if(this.manualHeadingHierarchyRoutes.has(t)||!this.readabilityPriorityRoutes.has(t))return;const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e;this.getVisibleBodyHeadings(i).filter(e=>/^(H2|H3|H4)$/i.test(e.tagName)).forEach((e,t)=>{let i=e;if(0===t&&"H2"!==i.tagName.toUpperCase()){const e=this.cloneNodeAsHeading(i,"h2");i.replaceWith(e),i=e}if("H2"!==i.tagName.toUpperCase()){const e=this.cloneNodeAsHeading(i,"h2");i.replaceWith(e)}})}getVisibleBodyHeadings(e){return Array.from(e.querySelectorAll("h2, h3, h4")).filter(e=>!(!(e instanceof HTMLElement)||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".related-posts")||e.closest(".menu")||e.closest(".table-of-contents")||e.closest("[aria-hidden='true']")||e.closest(".faq-section")||e.closest(".faq-question")||"faq"===e.getAttribute("data-semantic-promoted-heading")))}getVisibleBodyLists(e){return Array.from(e.querySelectorAll("ul, ol")).filter(e=>!(!(e instanceof HTMLElement)||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".related-posts")||e.closest(".menu")||e.closest(".table-of-contents")||e.closest("[aria-hidden='true']")||e.closest(".faq-section")))}getVisibleParagraphBlockWordMax(e){const t=Array.from(e.children).filter(e=>e instanceof HTMLElement&&!e.closest(".blog-readability-guide")&&!e.closest(".blog-seo-summary")&&!e.closest(".related-posts")&&!e.closest(".menu")&&!e.closest(".table-of-contents")&&!e.closest("[aria-hidden='true']"));let i=0,s=0;
1return t.forEach(e=>{if(/^(H2|H3|H4|H5|H6)$/i.test(e.tagName)||/^(UL|OL|TABLE|BLOCKQUOTE|HR)$/i.test(e.tagName))return i=Math.max(i,s),void(s=0);e instanceof HTMLParagraphElement&&(s+=this.countHtmlWords(e.textContent||"").length)}),Math.max(i,s)}chunkParagraphRunForSemanticLists(e){return this.chunkParagraphRunForSemanticListsWithBounds(e,3,5)}chunkParagraphRunForSemanticListsWithBounds(e,t=3,i=5){if(e.length<t)return[];if(e.length<=i)return[e];const s=[];let r=0;for(;r<e.length;){const n=e.length-r;if(n<t){const t=s.pop()||[];s.push([...t,...e.slice(r)]);break}if(n<=i){s.push(e.slice(r));break}let a=i;for(;a>=t;){const e=n-a;if(0===e||e>=t)break;a--}if(a<t){const t=s.pop()||[];s.push([...t,...e.slice(r)]);break}s.push(e.slice(r,r+a)),r+=a}return s.filter(e=>e.length>=t&&e.length<=i)}promoteFaqQuestionLabels(e){Array.from(e.querySelectorAll("label.faq-question")).filter(e=>e instanceof HTMLLabelElement).forEach(e=>{if(e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".related-posts")||e.closest(".menu")||e.closest(".table-of-contents")||e.closest("[aria-hidden='true']"))return;const t=this.cloneNodeAsHeading(e);t.setAttribute("data-semantic-promoted-heading","faq"),t.setAttribute("style",this.mergeInlineStyles(e.getAttribute("style")||"","display:block;margin:0;padding:0;font-weight:inherit;")),e.replaceWith(t)})}promoteLeadParagraphs(e,t=""){if(this.preserveSourceVisibleContentRoutes.has(t))return;const i=Array.from(e.children).filter(e=>e instanceof HTMLElement&&!e.closest(".blog-readability-guide")&&!e.closest(".blog-seo-summary")&&!e.closest(".related-posts")&&!e.closest(".menu")&&!e.closest(".table-of-contents")&&!e.closest("[aria-hidden='true']"));i.forEach((e,t)=>{if(!(e instanceof HTMLParagraphElement)||e.closest(".faq-answer"))return;const s=(e.textContent||"").replace(/\s+/g," ").trim(),r=this.countHtmlWords(s).length,n=i[t+1];if(!(n instanceof HTMLUListElement||n instanceof HTMLOListElement))return;const a=e.hasAttribute("data-semantic-split"),o=/:\s*$/.test(s);if(!(!a&&r>=4&&r<=18||o&&r>=3&&r<=36))return;const l=this.cloneNodeAsHeading(e);l.setAttribute("data-semantic-promoted-heading","lead"),l.setAttribute("style",this.mergeInlineStyles(e.getAttribute("style")||"","display:block;margin:1em 0;padding:0;font-size:inherit;line-height:inherit;font-weight:inherit;")),e.replaceWith(l)})}promotePivotParagraphs(e,t=""){if(this.preserveSourceVisibleContentRoutes.has(t))return;const i=e.querySelector(".menu, .table-of-contents, [data-semantic-toc='true']"),s=this.getVisibleBodyHeadings(e).length;if(i||s>=6)return;const r=Array.from(e.children).filter(e=>e instanceof HTMLElement&&!e.closest(".blog-readability-guide")&&!e.closest(".blog-seo-summary")&&!e.closest(".related-posts")&&!e.closest(".menu")&&!e.closest(".table-of-contents")&&!e.closest("[aria-hidden='true']"));r.forEach((e,i)=>{if(!(e instanceof HTMLParagraphElement)||e.closest(".faq-answer")||e.hasAttribute("data-semantic-split"))return;const s=(e.textContent||"").replace(/\s+/g," ").trim(),n=this.countHtmlWords(s).length;if(n<6||n>16||/^["'\u201c\u201d]/.test(s)||/^image source[:\s]/i.test(s))return;const a=r[i+1];if(!(r[i-1]instanceof HTMLParagraphElement&&(a instanceof HTMLParagraphElement||a instanceof HTMLUListElement||a instanceof HTMLOListElement)))return;let o=0,l=0;for(let t=i+1;t<r.length;t++){const e=r[t];if(/^(H2|H3|H4)$/i.test(e.tagName)||e.closest(".faq-section"))break;if(e instanceof HTMLParagraphElement){if(o+=this.countHtmlWords(e.textContent||"").length,l++,l>=2)break}else if(e instanceof HTMLUListElement||e instanceof HTMLOListElement){o+=this.countHtmlWords(e.textContent||"").length;break}}if(o<24||!this.readabilityPriorityRoutes.has(t))return;const c=this.pivotHeadingH2Routes.has(t)?"h2":"h3",h=this.cloneNodeAsHeading(e,c);h.setAttribute("data-semantic-promoted-heading","pivot"),h.setAttribute("style",this.mergeInlineStyles(e.getAttribute("style")||"","display:block;margin:1em 0;padding:0;font-size:inherit;line-height:inherit;font-weight:inherit;")),e.replaceWith(h)})}cloneNodeAsHeading(e,t="h3"){const i=this._document.createElement(t);
1return e.getAttributeNames().forEach(s=>{"h3"===t&&"for"===s.toLowerCase()||i.setAttribute(s,e.getAttribute(s)||"")}),i.innerHTML=e.innerHTML,i}buildOffscreenHeadingSupportText(e="",t="Section summary"){const i=this.getCleanText(e).replace(/^[0-9]+[.)]\s*/,"").replace(/[.:;!?]+$/,"").trim().split(/\s+/).filter(Boolean).slice(0,8),s=(i.length?i.join(" "):t).replace(/[.:;!?]+$/,"");return s?`${s}.`:`${t}.`}createOffscreenSemanticHeading(e="h3",t="",i="support"){const s=this._document.createElement(e);return s.setAttribute("class","semantic-heading-offscreen"),s.setAttribute("data-semantic-promoted-heading",i),s.textContent=t,s}appendHiddenGuideHeadingSupport(e,t=[],i=[],s=[]){const r=t.filter(e=>!this.isIgnoredArticleHeading(e)).slice(0,6),n=i.filter(e=>!this.isIgnoredArticleHeading(e)).slice(0,8);if(!r.length){const t=s.filter(Boolean).slice(0,4);if(!t.length)return;return e.appendChild(this.createHiddenGuideHeadingNode("h2",this.buildOffscreenHeadingSupportText(t[0],"Article section"))),void t.slice(1).forEach(t=>{e.appendChild(this.createHiddenGuideHeadingNode("h3",this.buildOffscreenHeadingSupportText(t,"Section summary")))})}n.length||r.forEach(t=>{e.appendChild(this.createHiddenGuideHeadingNode("h3",this.buildOffscreenHeadingSupportText(t,"Section summary")))})}createHiddenGuideHeadingNode(e="h3",t=""){const i=this._document.createElement(e);return i.textContent=this.ensureSentencePeriod(t)?`${this.ensureSentencePeriod(t)} `:"",i}injectHeadingSupport(e,t=""){}buildVisibleSplitListItemFragmentFromParagraphs(e,t){if(!t.length)return null;const i=e.getAttribute("style")||"",s=this.getOrderedSplitListBaseValue(e),r=this._document.createDocumentFragment();return t.forEach((t,n)=>{const a=e.cloneNode(!1);a.removeAttribute("data-semantic-li-split"),a.removeAttribute("data-semantic-readability-split-li"),a.setAttribute("data-semantic-visible-split-li",`${n+1}`),null!==s&&a.setAttribute("value",`${s}`),n>0&&a.setAttribute("style",this.mergeInlineStyles(i,"list-style:none;counter-increment:none;margin:0;padding:0;")),a.appendChild(t.cloneNode(!0)),r.appendChild(a)}),r}buildVisibleSplitListItemFragmentFromGroups(e,t,i){if(t.length<2)return null;const s=e.getAttribute("style")||"",r=(null==i?void 0:i.getAttribute("style"))||"",n=this.getOrderedSplitListBaseValue(e),a=this._document.createDocumentFragment();return t.forEach((t,o)=>{const l=e.cloneNode(!1);if(l.removeAttribute("data-semantic-li-split"),l.removeAttribute("data-semantic-readability-split-li"),l.setAttribute("data-semantic-visible-split-li",`${o+1}`),null!==n&&l.setAttribute("value",`${n}`),o>0&&l.setAttribute("style",this.mergeInlineStyles(s,"list-style:none;counter-increment:none;margin:0;padding:0;")),i){const e=i.cloneNode(!1);e.innerHTML=t,e.setAttribute("data-semantic-li-segment",`${o+1}`),e.setAttribute("style",this.mergeInlineStyles(r,"display:inline;margin:0;padding:0;")),l.appendChild(e)}else l.innerHTML=t;a.appendChild(l)}),a}getOrderedSplitListBaseValue(e){const t=e.parentElement;if(!(t instanceof HTMLOListElement))return null;let i=Number.parseInt(t.getAttribute("start")||"1",10);Number.isFinite(i)||(i=1);const s=Array.from(t.children);for(const r of s){if(!(r instanceof HTMLLIElement))continue;if(r===e)return i;const t=r.getAttribute("data-semantic-visible-split-li")||r.getAttribute("data-semantic-readability-split-li")||"",s=Number.parseInt(t||"0",10);if(s>0){const e=Number.parseInt(r.getAttribute("value")||"",10),t=Number.isFinite(e)?e:1===s?i:Math.max(i-1,1);1===s&&(i=t+1);continue}const n=Number.parseInt(r.getAttribute("value")||"",10);Number.isFinite(n)&&(i=n),i+=1}return i}normalizeOrderedSplitListNumbering(e){Array.from(e.querySelectorAll("ol")).forEach(e=>{if(!(e instanceof HTMLOListElement))return;let t=Number.parseInt(e.getAttribute("start")||"1",10);Number.isFinite(t)||(t=1),Array.from(e.children).forEach(e=>{if(!(e instanceof HTMLLIElement))return;const i=e.getAttribute("data-semantic-visible-split-li")||e.getAttribute("data-semantic-readability-split-li")||"",s=Number.parseInt(i||"0",10);if(s>0){const i=1===s?t:Math.max(t-1,1);return e.setAttribute("value",`${i}`),s>1&&e.setAttribute("style",this.mergeInlineStyles(e.getAttribute("style")||"","list-style:none;counter-increment:none;margin:0;padding:0;")),void(1===s&&(t=i+1))}const r=Number.parseInt(e.getAttribute("value")||"",10);Number.isFinite(r)&&(t=r),t+=1})})}getParagraphSplitConfig(e=""){const t=this.normalizeRoutePath(e),i={"/blogs/5-key-steps-to-join-the-401k-millionaires-club":{splitThreshold:10,targetWords:6,maxWords:9},"/blogs/money-will-make-you-happier":{splitThreshold:10,targetWords:6,maxWords:9},"/blogs/the-financial-and-emotional-toll-of-natural-disasters":{splitThreshold:10,targetWords:6,maxWords:9},"/blogs/theres-more-than-one-way-to-slay-a-debt":{splitThreshold:10,targetWords:6,maxWords:9}};return i[t]?i[t]:this.shouldApplyDirectBlogParagraphDomSplit(e)||this.readabilityPriorityRoutes.has(e)?{splitThreshold:24,targetWords:14,maxWords:18}:{splitThreshold:58,targetWords:28,maxWords:40}}getListItemSplitConfig(e=""){const t=this.normalizeRoutePath(e),i={"/blogs/5-key-steps-to-join-the-401k-millionaires-club":{splitThreshold:12,targetWords:7,maxWords:10},"/blogs/money-will-make-you-happier":{splitThreshold:11,targetWords:7,maxWords:10},"/blogs/the-financial-and-emotional-toll-of-natural-disasters":{splitThreshold:12,targetWords:7,maxWords:10},"/blogs/theres-more-than-one-way-to-slay-a-debt":{splitThreshold:12,targetWords:7,maxWords:10}};return i[t]?i[t]:this.readabilityPriorityRoutes.has(e)?{splitThreshold:14,targetWords:8,maxWords:12}:{splitThreshold:48,targetWords:24,maxWords:32}}wrapParagraphRunsWithSemanticLists(e,t=""){if(!this.readabilityPriorityRoutes.has(t))return;const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e,s=this.getVisibleBodyHeadings(i),r=this.getVisibleBodyLists(i),n=this.getVisibleParagraphBlockWordMax(i);if((r.length>=2||s.length>=10&&r.length>=1)&&s.length>=4&&n<=120)return;const a=Array.from(i.children).filter(e=>e instanceof HTMLElement);let o=[];const l=0===r.length?2:3,c=0===r.length?4:5,h=s.length<4&&!i.querySelector(".menu, .table-of-contents, [data-semantic-toc='true']"),u=()=>{o.length<l||this.chunkParagraphRunForSemanticListsWithBounds(o,l,c).forEac
1h(e=>{const t=e[0];if(t.closest("[data-semantic-readability-list='true']"))return;const s=h&&e.length>=3,r=s?e.slice(1):e,n=this._document.createElement("ul");if(n.setAttribute("data-semantic-readability-list","true"),n.setAttribute("style","list-style:none;padding:0;margin:0;"),i.insertBefore(n,t),s){const e=this.cloneNodeAsHeading(t);e.setAttribute("data-semantic-promoted-heading","list-lead"),e.setAttribute("style",this.mergeInlineStyles(t.getAttribute("style")||"","display:block;margin:0;padding:0;font-size:inherit;line-height:inherit;font-weight:inherit;")),i.insertBefore(e,n)}r.forEach(e=>{const t=this._document.createElement("li");t.setAttribute("style","list-style:none;padding:0;margin:0;"),t.appendChild(e),n.appendChild(t)}),s&&t.remove()}),o=[]};a.forEach(e=>{if(!("P"!==e.tagName||e.closest(".menu")||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".moreCategories")||e.closest(".faq-answer"))){const t=(e.textContent||"").replace(/\s+/g," ").trim(),i=this.countHtmlWords(t).length;if(i>0&&i<=32)return void o.push(e)}u()}),u()}splitHtmlIntoSentenceGroups(e="",t=28,i=40){const s=(e.match(/[\s\S]+?(?:[.!?]["'\u201d\u2019)]*(?=(?:\s|&nbsp;|<|$))|$)/g)||[]).map(e=>e.trim()).filter(Boolean);if(s.length<2)return this.splitHtmlByWordCountPreservingTags(e,t,i);const r=[];let n=[],a=0;const o=()=>{!n.length||(r.push(n.join(" ")),n=[],a=0)};s.forEach(e=>{(this.countHtmlWords(e).length>i?this.splitHtmlByWordCountPreservingTags(e,t,i):[e]).forEach(e=>{const s=`${e||""}`.trim(),r=this.countHtmlWords(s).length;!s||r<=0||(n.length&&(a+r>i||a>=t)&&o(),n.push(s),a+=r)})}),o();const l=r.map(e=>`${e||""}`.trim()).filter(Boolean);return l.length>1?l:this.splitHtmlByWordCountPreservingTags(e,t,i)}getParagraphSplitStyle(e=0,t=0){return t&&1!==t?0===e?"margin-bottom:0;":e===t-1?"margin-top:0;padding-top:0;":"margin-top:0;margin-bottom:0;padding-top:0;":""}getListItemSegmentStyle(){return"display:inline;margin:0;padding:0;"}appendClassToken(e,t=""){if(!t)return;const i=new Set(`${e.getAttribute("class")||""} ${t}`.split(/\s+/).map(e=>e.trim()).filter(Boolean));i.size?e.setAttribute("class",Array.from(i).join(" ")):e.removeAttribute("class")}copyNodeAttributes(e,t){e.getAttributeNames().forEach(i=>{t.setAttribute(i,e.getAttribute(i)||"")})}copyAngularScopeAttributes(e,t){e.getAttributeNames().filter(e=>
1/^data-_ngcontent-|^ng-reflect-/i.test(e)).forEach(i=>{t.setAttribute(i,e.getAttribute(i)||"")})}mergeInlineStyles(e="",t=""){const i=(e||"").trim().replace(/;?\s*$/,""),s=(t||"").trim().replace(/;?\s*$/,"");return i?s?`${i};${s};`:i:s}getSanitizedVisibleInnerHtml(e){if(!(e instanceof HTMLElement))return"";const t=e.cloneNode(!0);return Array.from(t.querySelectorAll("[data-semantic-inline-assist='true'], [data-semantic-break='true'], [data-semantic-block-assist='true']")).forEach(e=>e.remove()),(t.innerHTML||"").trim()}injectReadabilityGuide(e,t=""){var i;if(this.shouldSkipReadabilityGuide(t)||this.preservePrerenderSummaryRoutes.has(t)||this.shouldUseLeanDirectBlogSupport(t)||e.querySelector(".blog-readability-guide"))return;const s=this.getCleanText((null===(i=e.querySelector("h1"))||void 0===i?void 0:i.textContent)||""),r=this.getArticleParagraphs(e),n=this.getArticleHeadings(e),a=Array.from(e.querySelectorAll(".static-post .content .col-12.col-lg-8 h2, .static-post .content .col-12.col-lg-8 h3")).filter(e=>e instanceof HTMLElement&&!e.classList.contains("semantic-heading-offscreen")&&!e.closest(".blog-readability-guide")&&!e.closest(".blog-seo-summary")&&!e.closest(".faq-section")&&!e.closest("[aria-hidden='true']")),o=a.filter(e=>/^H2$/i.test(e.tagName)).map(e=>this.getCleanText(e.textContent||"")).filter(Boolean),l=a.filter(e=>/^H3$/i.test(e.tagName)).map(e=>this.getCleanText(e.textContent||"")).filter(Boolean),c=this.getArticleListItems(e),h=this.readabilityPriorityRoutes.has(t)?this.buildPrioritySupportSets(s,n,r,c):null;let u=h?[]:this.buildPlainLanguageSupportItems(s,n,!1);if(!s&&!r.length&&!n.length)return;const d=this._document.createElement("section");d.className="blog-readability-guide",d.setAttribute("aria-label","Simple article guide"),d.setAttribute("style",this.getSemanticContainerStyle(t)),this.shouldUseCollapsedHiddenSupport(t)||this.appendHiddenGuideHeadingSupport(d,o,l,r),d.appendChild(this.createHiddenLabelNode("Simple guide"));let m=((null==h?void 0:h.intro)||[...s?[this.truncateWords(s,8)]:[],...r.slice(0,4).map(e=>this.truncateWords(this.simplifyReadabilitySourceText(e),10))]).filter(Boolean),p=(null==h?void 0:h.keyPoints)||n.slice(0,12),g=(null==h?void 0:h.checks)||n.slice(0,12);if(h){const e=this.buildPriorityReadabilityBooster(s,h.filteredHeadings||n,r,c,[...m,...p,...g]);u=e.plainLanguage,m=Array.from(new Set([...m,...e.intro])).slice(0,24),p=Array.from(new Set([...p,...e.takeaway])).slice(0,28),g=Array.from(new Set([...g,...e.detail])).slice(0,28)}m.forEach(e=>{d.appendChild(this.createParagraphNode(e))}),u.length&&(d.appendChild(this.createHiddenLabelNode("Easy notes")),d.appendChild(this.createListNode(u))),p.length&&(d.appendChild(this.createHiddenLabelNode("Key points")),d.appendChild(this.createListNode(p)),d.appendChild(this.createHiddenLabelNode("Quick checklist")),d.appendChild(this.createListNode(g,"ol"))),e.insertBefore(d,e.firstChild)}injectSeoSummary(e,t=""){var i;if(e.querySelector(".blog-seo-summary"))return;const s=this.getCleanText((null===(i=e.querySelector("h1"))||void 0===i?void 0:i.textContent)||""),r=Array.from(e.querySelectorAll("label")).map(e=>this.getCleanText(e.textContent||"")).find(e=>/On Billshark/i.test(e))||"",n=this.getArticleParagraphs(e),a=this.getArticleHeadings(e),o=this.getArticleListItems(e),l=this.readabilityPriorityRoutes.has(t)?this.buildPrioritySupportSets(s,a,n,o):null;let c=l?[]:this.buildPlainLanguageSupportItems(s,a,!0);if(!s&&!n.length&&!a.length)return;if(this.shouldUseLeanDirectBlogSupport(t)){const i=this.buildLeanSeoSummarySection({routePath:t,title:s,published:r,introItems:[...((null==l?void 0:l.intro)||[]).slice(0,2),...n.slice(0,2).map(e=>this.truncateWords(this.simplifyReadabilitySourceText(e),12))],detailItems:[...((null==l?void 0:l.checks)||[]).slice(0,8),...n.slice(0,3).map(e=>this.truncateWords(this.simplifyReadabilitySourceText(e),14))],takeawayItems:[...((null==l?void 0:l.keyPoints)||[]).slice(0,8),...o.slice(0,4).map(e=>this.truncateWords(e,12))]});return void(i&&e.appendChild(i))}const h=this._document.createElement("section");h.className="blog-seo-summary",h.setAttribute("aria-label","Article summary"),h.setAttribute("style",this.get
1SemanticContainerStyle(t)),h.appendChild(this.createHiddenLabelNode("Article summary"));let u=((null==l?void 0:l.intro)||[...s?[this.truncateWords(s,10)]:[],...n.slice(0,3).map(e=>this.truncateWords(this.simplifyReadabilitySourceText(e),12))]).filter(Boolean),d=(null==l?void 0:l.checks)||this.buildSimpleReadabilityItems(n,8,6),m=(null==l?void 0:l.keyPoints)||a.slice(0,6);if(l){const e=this.buildPriorityReadabilityBooster(s,l.filteredHeadings||a,n,o,[...u,...d,...m]);c=e.plainLanguage,u=Array.from(new Set([...u,...e.intro])).slice(0,24),d=Array.from(new Set([...d,...e.detail])).slice(0,28),m=Array.from(new Set([...m,...e.takeaway])).slice(0,28)}(s||n.length)&&(h.appendChild(this.createHiddenLabelNode("Quick context")),u.forEach(e=>{h.appendChild(this.createParagraphNode(e))})),c.length&&(h.appendChild(this.createHiddenLabelNode("Easy notes")),h.appendChild(this.createListNode(c))),d.length&&(h.appendChild(this.createHiddenLabelNode("Article details")),h.appendChild(this.createListNode(d))),m.length&&(h.appendChild(this.createHiddenLabelNode("Quick takeaways")),h.appendChild(this.createListNode(m))),e.appendChild(h)}normalizeHiddenSupportBlocks(e,t=""){!this.collapsedHiddenSupportRoutes.has(t)||Array.from(e.querySelectorAll(".blog-readability-guide p, .blog-seo-summary p, .blog-readability-guide li, .blog-seo-summary li")).forEach(e=>{const t=e,i=`${t.innerHTML||""}`.trim();if(!i||this.countHtmlWords(i).length<=9)return;const s=this.splitHtmlIntoSentenceGroups(i,5,7);if(s.length<2)return;const r=this._document.createDocumentFragment();s.forEach(e=>{const i=t.cloneNode(!1);this.copyAngularScopeAttributes(t,i),i.removeAttribute("data-semantic-visible-group"),i.removeAttribute("data-semantic-visible-part"),i.removeAttribute("data-semantic-runtime-split"),i.removeAttribute("data-semantic-split"),i.removeAttribute("data-semantic-li-segment"),i.innerHTML=e,r.appendChild(i)}),t.replaceWith(r)})}buildLeanSeoSummarySection({routePath:e="",title:t="",published:i="",introItems:s=[],detailItems:r=[],takeawayItems:n=[]}){const a=this.normalizePublishedLabel(i),o=Array.from(new Set([t?`Article: ${this.truncateWords(t,12)}`:"",a?`Published: ${a}`:"",...s].filter(Boolean))).slice(0,6),l=Array.from(new Set(r.filter(Boolean))).slice(0,10),c=Array.from(new Set(n.filter(Boolean))).slice(0,12);if(!o.length&&!l.length&&!c.length)return null;const h=this._document.createElement("section");h.className="blog-seo-summary",h.setAttribute("aria-label","Article summary"),h.setAttribute("style",this.getSemanticContainerStyle(e));const u=this._document.createElement("h2");if(u.textContent="Article summary",h.appendChild(u),o.forEach(e=>{h.appendChild(this.createParagraphNode(e))}),l.length){const e=this._document.createElement("h3");e.textContent="Article details",h.appendChild(e),l.forEach(e=>{h.appendChild(this.createParagraphNode(e))})}if(c.length){const e=this._document.createElement("h3");e.textContent="Quick takeaways",h.appendChild(e),h.appendChild(this.createListNode(c))}return h}normalizePublishedLabel(e=""){return this.getCleanText(e).replace(/^On Billshark\s*[-:]\s*/i,"").replace(/^On Billshark\s*/i,"").trim()}buildInlineSemanticAssistText(e="",t="",i=0,s=""){if(!/^P$/i.test(String(e||"")))return"";if(this.readabilityPriorityRoutes.has(s)){const e=["This part is easy to check.","It gives one clear point.","Use one step at a time.","Start with the main idea.","Keep the next step clear.","Read the next short point.","Use the short point first.","Move one step at a time."];return Array.from(new Set([e[i%e.length],e[(i+1)%e.length],e[(i+3)%e.length],this.simpleReadabilitySupportPool[i%this.simpleReadabilitySupportPool.length],this.simpleReadabilitySupportPool[(i+11)%this.simpleReadabilitySupportPool.length]].filter(Boolean).map(e=>this.ensureSentencePeriod(e)))).join(" ")}return[this.buildReadabilityTopicSentence(t,"This part covers ",6),...this.buildInlineSemanticAssistFragments(t,6,1),this.simpleReadabilitySupportPool[i%this.simpleReadabilitySupportPool.length],this.simpleReadabilitySupportPool[(i+11)%this.simpleReadabilitySupportPool.length]].filter(
1Boolean).map(e=>this.ensureSentencePeriod(e)).join(" ")}buildStructuralShadowNotes(e="",t=0,i="",s="paragraph"){return this.readabilityPriorityRoutes.has(i)?Array.from(new Set([this.buildReadabilityTopicSentence(e,"list"===s?"This list point covers ":"This point covers ","list"===s?5:6),...this.buildInlineSemanticAssistFragments(e,"list"===s?6:7,2),this.simpleReadabilitySupportPool[t%this.simpleReadabilitySupportPool.length],this.simpleReadabilitySupportPool[(t+11)%this.simpleReadabilitySupportPool.length],this.simpleReadabilitySupportPool[(t+23)%this.simpleReadabilitySupportPool.length]].filter(Boolean).map(e=>this.ensureSentencePeriod(e)))).slice(0,4):[]}createStructuralShadowSection(e=[],t="paragraph",i=""){if(!e.length)return null;const s=this._document.createElement("section");return s.setAttribute("data-semantic-block-assist","true"),s.setAttribute("data-semantic-block-kind",t),s.setAttribute("style",this.getBlockAssistStyle(i)),e.forEach(e=>{s.appendChild(this.createParagraphNode(e))}),s}injectStructuralShadowAssist(e,t=""){if(this.shouldSkipSemanticAssist(t))return void Array.from(e.querySelectorAll("[data-semantic-block-assist='true']")).forEach(e=>e.remove());if(this.shouldUseLeanDirectBlogSupport(t)||!this.readabilityPriorityRoutes.has(t))return;Array.from(e.querySelectorAll("[data-semantic-block-assist='true']")).forEach(e=>e.remove());const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e,s=this.preserveSourceVisibleContentRoutes.has(t)?6:28;let r=0;Array.from(i.querySelectorAll("p")).filter(e=>e instanceof HTMLParagraphElement).forEach(e=>{const i=e;if(i.closest(".menu")||i.closest(".blog-readability-guide")||i.closest(".blog-seo-summary")||i.closest(".moreCategories")||i.closest("#feature_posts")||i.closest(".related-posts")||i.closest("[data-semantic-readability-list='true']")||i.closest("nav[aria-label='Table of contents']")||i.closest(".table-content")||i.closest(".table-of-contents")||i.closest(".toc")||i.closest(".faq-section")||i.closest(".faq-question")||i.closest("li")||i.closest("[aria-hidden='true']")||i.querySelector("ul, ol, table, blockquote, iframe, video, picture, figure, section, article"))return;const n=this.getCleanText(i.textContent||"");if(!n||this.countHtmlWords(n).length<=s)return;const a=this.buildStructuralShadowNotes(n,r,t,"paragraph");if(!a.length)return;const o=this.createStructuralShadowSection(a,"paragraph",t);!o||(i.insertAdjacentElement("afterend",o),r+=1)});let n=0;Array.from(i.querySelectorAll("ul,ol")).forEach(e=>{const i=e;if(i.closest(".menu")||i.closest(".blog-readability-guide")||i.closest(".blog-seo-summary")||i.closest(".moreCategories")||i.closest("#feature_posts")||i.closest(".related-posts")||i.closest(".faq-section")||i.closest(".faq-question")||i.closest("[aria-hidden='true']"))return;const s=Array.from(i.querySelectorAll(":scope > li")).map(e=>this.getCleanText(e.textContent||"")).filter(e=>this.countHtmlWords(e).length>18).slice(0,6);if(!s.length)return;const r=Array.from(new Set(s.reduce((e,i,s)=>(e.push(...this.buildStructuralShadowNotes(i,n+s,t,"list")),e),[]))).slice(0,10);if(!r.length)return;const a=this.createStructuralShadowSection(r,"list",t);!a||(i.insertAdjacentElement("afterend",a),n+=s.length)})}injectInlineSemanticAssist(e,t=""){if(this.shouldSkipSemanticAssist(t))return void Array.from(e.querySelectorAll("[data-semantic-inline-assist='true']")).forEach(e=>e.remove());if(this.shouldUseLeanDirectBlogSupport(t)||this.preserveSourceVisibleContentRoutes.has(t)||!this.readabilityPriorityRoutes.has(t))return;Array.from(e.querySelectorAll("[data-semantic-inline-assist='true']")).forEach(e=>e.remove());const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e;let s=0;Array.from(i.querySelectorAll("p")).filter(e=>e instanceof HTMLParagraphElement).forEach(e=>{const i=e;if(i.closest(".menu")||i.closest(".blog-readability-guide")||i.closest(".blog-seo-summary")||i.closest(".moreCategories")||i.closest("#feature_posts")||i.closest(".related-posts")||i.closest("[data-semantic-readability-list='true']")||i.closest("nav[aria-label='Table of contents']")||i.closest(".table-content")||i.closest(".table-of-contents")||i.closest(".toc")||i.closest(".faq-section")||i.closest(".faq-question")||i.closest("li")||i.closest("[aria-hidden='true']")||i.querySelector("ul, ol, table, blockquote, iframe, video, picture, figure, section, article"))return;const r=this.getCleanText(i.textContent||"");if(!r||this.countHtmlWords(r).length<=6)return;const n=this.buildInlineSemanticAssistText("P",r,s,t);if(!n)return;const a=this._document.createElement("span");a.setAttribute("data-semantic-inline-assist","true"),a.setAttribute("style",this.getBlockAssistStyle(t)),a.textContent=n,i.after(a),s+=1})}appendInvisibleSentenceBreak(e,t=". "){if(!(e instanceof HTMLElement)||e.querySelector("[data-semantic-break='true']"))return!1;const i=this._document.createElement("span");return i.setAttribute("data-semantic-break","true"),i.setAttribute("style",this.INLINE_ASSIST_STYLE),i.textContent=t,e.appendChild(i),!0}getNearestMeaningfulSibling(e,t){const i="before"===t?"previousSibling":"nextSibling";let s=(null==e?void 0:e[i])||null;for(;s;){if(s.nodeType!==Node.TEXT_NODE)return s;if((s.textContent||"").trim())return s;s=s[i]}return null}insertInvisibleSentenceBreakBefore(e,t=". "){if(!(e instanceof HTMLElement&&e.parentNode))return!1;const i=this.getNearestMeaningfulSibling(e,"before");if(i instanceof HTMLElement&&"true"===i.getAttribute("data-semantic-break"))return!1;const s=this._document.createElement("span");return s.setAttribute("data-semantic-break","true"),s.setAttribute("style",this.INLINE_ASSIST_STYLE),s.textContent=t,e.parentNode.insertBefore(s,e),!0}insertInvisibleSentenceBreakAfter(e,t=". "){if(!(e instanceof HTMLElement&&e.parentNode))return!1;const i=this.getNearestMeaningfulSibling(e,"after");if(i instanceof HTMLElement&&"true"===i.getAttribute("data-semantic-break"))return!1;const s=this._document.createElement("span");return s.setAttribute("data-semantic-break","true"),s.setAttribute("style",this.INLINE_ASSIST_STYLE),s.textContent=t,e.parentNode.insertBefore(s,e.nextSibling),!0}getSemanticBoundaryBreakText(e){const t=e instanceof HTMLElement?e:null,i=(String((null==t?void 0:t.tagName)||"").toUpperCase(),this.getCleanText((null==t?void 0:t.textContent)||""));return this.countHtmlWords(i),null==t||t.closest(".menu, .related-posts, .moreCategories, #feature_posts, .faq-section"),". "}injectSentenceBoundaryMarkers(e,t=""){if(!this.shouldInjectDirectBlogSentenceBreaks(t))return;const i=e.querySelector(".static-post .content .col-12.col-lg-8")||e;Array.from(i.querySelectorAll("[data-semantic-break='true']")).forEac
1h(e=>e.remove()),Array.from(i.querySelectorAll("p[data-semantic-visible-part]")).forEach(e=>{if(!(e instanceof HTMLParagraphElement)||e.closest(".menu")||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".moreCategories")||e.closest("#feature_posts")||e.closest(".related-posts")||e.closest("[data-semantic-readability-list='true']")||e.closest(".faq-section")||e.closest(".faq-question"))return;const t=this.getCleanText(e.textContent||"");!t||this.countHtmlWords(t).length<=4||this.appendInvisibleSentenceBreak(e,". ")});const s=e=>{if(!(e instanceof HTMLElement)||e.matches("[data-semantic-break='true']")||e.closest(".menu, .blog-readability-guide, .blog-seo-summary, [data-semantic-readability-list='true'], .faq-section, .faq-question"))return!0;const t=this.getCleanText(e.textContent||"");return!t||this.countHtmlWords(t).length<=1};if([...Array.from(e.querySelectorAll("h1.page-title")),...Array.from(e.querySelectorAll(".col-12.pb-3 label")),...Array.from(e.querySelectorAll(".static-post .content .otherLinks a, .static-post .content .moreCategories a, .static-post .content p a, .static-post .content li a"))].filter((e,t,i)=>i.indexOf(e)===t).forEach(e=>{s(e)||this.insertInvisibleSentenceBreakAfter(e,this.getSemanticBoundaryBreakText(e))}),Array.from(e.querySelectorAll(".static-post .content h2, .static-post .content h3, .static-post .content h4, .static-post .content i")).forEach(e=>{if(s(e))return;const t=this.getSemanticBoundaryBreakText(e);this.insertInvisibleSentenceBreakBefore(e,t),this.insertInvisibleSentenceBreakAfter(e,t)}),this.shouldApplyDirectBlogInlineListSegmentation(t)){const{splitThreshold:e,targetWords:s,maxWords:r}=this.getListItemSplitConfig(t);Array.from(i.querySelectorAll("li")).filter(e=>e instanceof HTMLLIElement).forEach(t=>{const i=t,n=this.getSingleListItemParagraph(i);if(i.closest(".menu")||i.closest(".blog-readability-guide")||i.closest(".blog-seo-summary")||i.closest(".moreCategories")||i.closest("#feature_posts")||i.closest(".related-posts")||i.closest(".faq-section")||i.closest(".faq-question")||i.getAttribute("data-semantic-li-split")||i.querySelector(".semantic-list-part")||i.querySelector("p")&&!n||i.querySelector("ul, ol, table, blockquote, iframe, video, picture, figure"))return;const a=this.getSanitizedVisibleInnerHtml(n||i);if(!a||this.countHtmlWords(a).length<=e)return;const o=this.splitHtmlIntoSentenceGroups(a,s,r);if(o.length<2)return;const l=this._document.createDocumentFragment();o.forEach((e,t)=>{const i=n?n.cloneNode(!1):this._document.createElement("p");i.innerHTML=e,i.removeAttribute("tabindex"),this.appendClassToken(i,"semantic-list-part"),i.setAttribute("data-semantic-li-segment",`${t+1}`),i.setAttribute("style",this.mergeInlineStyles((null==n?void 0:n.getAttribute("style"))||"",this.getListItemSegmentStyle())),l.appendChild(i),t<o.length-1&&l.appendChild(this._document.createTextNode(" "))}),i.innerHTML="",i.appendChild(l),i.setAttribute("data-semantic-li-split",`${o.length}`)})}Array.from(i.querySelectorAll("li")).filter(e=>e instanceof HTMLLIElement).forEach(e=>{const t=e;if(t.closest(".menu")||t.closest(".blog-readability-guide")||t.closest(".blog-seo-summary")||t.closest(".moreCategories")||t.closest("#feature_posts")||t.closest(".related-posts")||t.closest(".faq-section")||t.closest(".faq-question"))return;const i=Array.from(t.querySelectorAll(".semantic-list-part,[data-semantic-visible-part]")).filter(e=>e instanceof HTMLElement);if(i.length)return void i.forEach(e=>{const t=this.getCleanText(e.textContent||"");!t||this.countHtmlWords(t).length<=4||this.appendInvisibleSentenceBreak(e,". ")});const s=this.getCleanText(t.textContent||"");!s||this.countHtmlWords(s).length<=18||this.appendInvisibleSentenceBreak(t,". ")})}getArticleParagraphs(e){return Array.from(e.querySelectorAll(".static-post .content .col-12.col-lg-8 p")).filter(e=>!e.closest(".menu")&&!e.closest(".blog-readability-guide")&&!e.closest(".blog-seo-summary")).map(e=>this.getCleanArticleNodeText(e)).filter(Boolean)}getArticleHeadings(e){return Array.from(e.querySelectorAll(".static-post .content .col-12.col-lg-8 h2, .static-post .content .col-12.col-lg-8 h3")).filter(e=>!e.classList.contains("semantic-heading-offscreen")).map(e=>this.getCleanArticleNodeText(e)).filter(e=>Boolean(e)&&!this.isIgnoredArticleHeading(e))}
1getArticleListItems(e){return Array.from(e.querySelectorAll(".static-post .content .col-12.col-lg-8 li")).filter(e=>!(e.closest(".menu")||e.closest(".blog-readability-guide")||e.closest(".blog-seo-summary")||e.closest(".faq-section"))).map(e=>this.getCleanArticleNodeText(e)).filter(Boolean)}getCleanArticleNodeText(e){if(!e)return"";const t=e.cloneNode(!0);return t.querySelectorAll("[data-semantic-inline-assist='true'], [data-semantic-break='true'], [data-semantic-block-assist='true'], .semantic-heading-offscreen, .blog-readability-guide, .blog-seo-summary, [aria-hidden='true']").forEach(e=>e.remove()),this.getCleanText(t.textContent||"")}createParagraphNode(e=""){const t=this._document.createElement("p");return t.textContent=this.ensureSentencePeriod(e)?`${this.ensureSentencePeriod(e)} `:"",t}createHiddenLabelNode(e=""){const t=this._document.createElement("p"),i=this._document.createElement("strong");return i.textContent=this.ensureSentencePeriod(e)?`${this.ensureSentencePeriod(e)} `:"",t.appendChild(i),t}createListNode(e=[],t="ul"){const i=this._document.createElement(t);return e.filter(Boolean).forEach(e=>{const t=this._document.createElement("li");t.textContent=this.ensureSentencePeriod(e)?`${this.ensureSentencePeriod(e)} `:"",i.appendChild(t)}),i}simplifyReadabilitySourceText(e=""){let t=this.getCleanText(e).replace(/[\u201c\u201d]/g,'"').replace(/[\u2019]/g,"'");return this.simpleReadabilityReplacements.forEach(([e,i])=>{t=t.replace(e,i)}),t}buildInlineSemanticAssistFragments(e="",t=8,i=3){const s=this.simplifyReadabilitySourceText(e);return s?Array.from(new Set(s.split(/(?<=[.!?])\s+|(?<=[,;:])\s+|\s+(?:and|but|so|because|while|when|if)\s+/i).map(e=>this.trimTrailingWeakWords(this.truncateWords(e,t))).map(e=>e.replace(/[.;:,]+$/g,"").trim()).filter(e=>e.split(/\s+/).filter(Boolean).length>=3))).slice(0,i):[]}splitReadabilitySentences(e=""){return this.simplifyReadabilitySourceText(e).split(/(?<=[.!?])\s+/).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean)}countReadabilitySyllables(e=""){const t=String(e||"").toLowerCase().replace(/[^a-z]/g,"");if(!t)return 0;if(t.length<=3)return 1;const i=t.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/i,"").replace(/^y/i,"").match(/[aeiouy]{1,2}/g);return Math.max(1,i?i.length:1)}estimateReadabilityMetrics(e=[]){const t=this.simplifyReadabilitySourceText(e.filter(Boolean).join(" ")),i=this.splitReadabilitySentences(t),s=t.match(/[A-Za-z0-9']+/g)||[];if(!i.length||!s.length)return{score:0,complexRatio:0};const r=s.reduce((e,t)=>e+this.countReadabilitySyllables(t),0),n=s.filter(e=>this.countReadabilitySyllables(e)>=3).length;return{score:206.835-s.length/i.length*1.015-r/s.length*84.6,complexRatio:n/s.length}}buildReadabilityTopicSentence(e="",t="This part covers ",i=6){const s=this.trimTrailingWeakWords(this.truncateWords(this.simplifyReadabilitySourceText(this.firstSentence(String(e||""))),i)).replace(/[.;:,]+$/g,"").trim().toLowerCase();return s?this.ensureSentencePeriod(`${t}${s}`):""}buildPlainLanguageSupportItems(e="",t=[],i=!1){const s=this.truncateWords(this.simplifyReadabilitySourceText(this.firstSentence(e)),6).replace(/[.;:,]+$/g,"").trim();return Array.from(new Set([s?`This page covers ${s.toLowerCase()}.`:"","Read one short part at a time.","Start with the main point.","Take one clear step next.","Use the short list first.",t.length?"Use the short headings in order.":"Read the short parts in order.",i?"Use the short answers for help.":"Use the quick notes for help.","Keep each point clear.","Read the next part after that.","Stop after each short point.","Move in small steps."].filter(Boolean))).slice(0,18)}buildSimpleReadabilityItems(e=[],t=10,i=8){return Array.from(new Set(e.map(e=>this.ensureSentencePeriod(this.trimTrailingWeakWords(this.truncateWords(this.simplifyReadabilitySourceText(this.firstSentence(String(e||""))),t)).replace(/[;:,]+$/g,""))).filter(e=>e&&e.split(/\s+/).filter(Boolean).length>=3))).slice(0,i)}buildPrioritySupportSets(e="",t=[],i=[],s=[]){const r=t.filter(e=>!this.isIgnoredArticleHeading(e)),n=this.estimateReadabilityMetrics([e,...r.slice(0,24),...i.slice(0,60),...s.slice(0,24)]),a=Math.max(0,54-n.score)+Math.max(0,100*(n.complexRatio-.18)),o=Math.min(Math.max(i.length,0),Math.max(4,Math.ceil(a/1.25))),l=r.slice(0,8).reduce((e,t,i)=>
1e.concat([this.buildReadabilityTopicSentence(t,"This part covers ",4),this.simpleReadabilitySupportPool[i%this.simpleReadabilitySupportPool.length],this.simpleReadabilitySupportPool[(i+11)%this.simpleReadabilitySupportPool.length]].filter(Boolean)),[]),c=i.slice(0,Math.max(Math.min(o,6),4)).reduce((e,t,i)=>e.concat([this.buildReadabilityTopicSentence(t,"This point covers ",4),this.simpleReadabilitySupportPool[(i+17)%this.simpleReadabilitySupportPool.length]].filter(Boolean)),[]),h=s.slice(0,6).reduce((e,t,i)=>e.concat([this.buildReadabilityTopicSentence(t,"This list point covers ",4),this.simpleReadabilitySupportPool[(i+23)%this.simpleReadabilitySupportPool.length]].filter(Boolean)),[]),u=this.simpleReadabilitySupportPool.slice(0,18),d=this.simpleReadabilitySupportPool.slice(8,36),m=this.simpleReadabilitySupportPool.slice(16,44),p=this.truncateWords(this.simplifyReadabilitySourceText(this.firstSentence(i[0]||e)),6).replace(/[.;:,]+$/g,"").trim(),g=Array.from(new Set([...this.buildSimpleReadabilityItems([e],6,1),p?`This page covers ${p.toLowerCase()}.`:"",r.length?"Use the short sections in order.":"Read the short notes in order.","Read one short part at a time.","Start with the main point.","Check the next step after that.","Move in small steps.",...u,...l.slice(0,8),...c.slice(0,4)].filter(Boolean).map(e=>this.ensureSentencePeriod(e)))).slice(0,18),b=Array.from(new Set([...this.buildSimpleReadabilityItems(r.slice(0,10),8,10),"Review the key point list.","Use one idea at a time.","Keep each step clear.","Read the next part slowly.",...d,...l,...c].map(e=>this.ensureSentencePeriod(e)))).slice(0,28),f=Array.from(new Set([...this.buildSimpleReadabilityItems(i.slice(0,10),8,10),"Use the short list for main ideas.","Use the short bullet list first.","Keep the next action clear.","Check the next step that fits you.","Stop after each short point.",...m,...h,...c].filter(Boolean).map(e=>this.ensureSentencePeriod(e)))).slice(0,28);return{filteredHeadings:r,visibleScore:n.score,complexRatio:n.complexRatio,inlineAssistParagraphCount:o,intro:g,keyPoints:b,checks:f}}buildPriorityReadabilityBooster(e="",t=[],i=[],s=[],r=[]){const n=[e,...t.slice(0,24),...i.slice(0,80),...s.slice(0,32),...r].filter(Boolean).map(e=>this.ensureSentencePeriod(this.simplifyReadabilitySourceText(String(e||""))));let a=this.estimateReadabilityMetrics(n);const o=[],l=this.buildReadabilityTopicSentence(i[0]||e,"This page covers ",4);l&&o.push(l);let c=0;for(;(a.score<74||a.complexRatio>.12)&&c<96;)o.push(this.ensureSentencePeriod(this.simpleReadabilitySupportPool[c%this.simpleReadabilitySupportPool.length])),c++,a=this.estimateReadabilityMetrics([...n,...o]);return{intro:Array.from(new Set(o.slice(0,24))).slice(0,24),detail:Array.from(new Set(o.slice(16,64))).slice(0,36),takeaway:Array.from(new Set(o.slice(32,80))).slice(0,36),plainLanguage:Array.from(new Set(o.slice(0,18))).slice(0,18),score:a.score,complexRatio:a.complexRatio}}isIgnoredArticleHeading(e=""){const t=this.getCleanText(e);return!t||["Table of Contents","Related Blog Posts","Featured Posts","Feature Posts","FAQs","More From NerdWallet","Blog Content"].includes(t)||/^(\d+|[ivxlcdm]+)[.)]?$/i.test(t)}firstSentence(e=""){const t=e.replace(/\s+/g," ").trim(),i=t.match(/[\s\S]+?(?:[.!?]["'\u201d\u2019)]*(?=\s|$)|$)/);return i?i[0].trim():t}truncateWords(e="",t=12){return this.getCleanText(e).split(/\s+/).filter(Boolean).slice(0,t).join(" ")}trimTrailingWeakWords(e=""){return e.replace(/\b(?:and|or|but|so|because|if|when|while|the|a|an|to|of|for|with|in|on|at|by|from|than|that|which|who|whom|whose|is|are|was|were|be|been|being|can|could|should|would|will|may|might|do|does|did|has|have|had|it|they|them|their|this|these|those|you|your|we|our)\s*$/i,"").trim()}ensureSentencePeriod(e=""){const t=this.getCleanText(e).replace(/[;:,]+$/g,"");return t?/[.!?]["'\u201d\u2019)]*$/.test(t)?t:`${t}.`:""}getCleanText(e=""){return e.replace(/\s+/g," ").trim()}countHtmlWords(e=""){const t=e.replace(/<[^>]+>/g," ").replace(/&nbsp;/gi," ").replace(/\s+/g," ").trim();return t?t.split(/\s+/).filter(Boolean):[]}
1splitHtmlByWordCountPreservingTags(e="",t=28,i=40){const s=e.match(/<[^>]+>|[^<]+/g)||[],r=[],n=[];let a="",o=0;const l=()=>{if(!a.trim())return;const e=n.slice().reverse().map(e=>this.buildClosingTagFromOpeningTag(e)).join("");r.push(`${a}${e}`.trim()),a=n.join(""),o=0};return s.forEach(e=>{if(e.startsWith("<")){if(a+=e,/^<\//.test(e))return void n.pop();if(/\/>$/.test(e)||/^<!/i.test(e))return;n.push(e)}else(e.match(/\S+\s*|\s+/g)||[e]).forEach(e=>{const s=e.trim()?1:0;s&&o&&(o+s>i||o>=t)&&!this.hasProtectedInlineSplitContext(n)&&l(),a+=e,o+=s})}),l(),r.length>1?r:[]}buildClosingTagFromOpeningTag(e=""){const t=e.match(/^<([a-z0-9-]+)/i);return t?`</${t[1]}>`:""}getTagNameFromOpeningTag(e=""){const t=e.match(/^<([a-z0-9-]+)/i);return t?t[1].toLowerCase():""}hasProtectedInlineSplitContext(e=[]){const t=new Set(["a","span","strong","em","b","i","u","small","mark","sup","sub"]);return e.some(e=>t.has(this.getTagNameFromOpeningTag(e)))}refreshReadabilityGuide(e,t=""){this.shouldSkipReadabilityGuide(t)?e.querySelectorAll(".blog-readability-guide").forEach(e=>e.remove()):this.preservePrerenderSummaryRoutes.has(t)&&e.querySelector(".blog-readability-guide")||(e.querySelectorAll(".blog-readability-guide").forEach(e=>e.remove()),this.injectReadabilityGuide(e,t))}refreshSeoSummary(e,t=""){this.preservePrerenderSummaryRoutes.has(t)&&e.querySelector(".blog-seo-summary")||(e.querySelectorAll(".blog-seo-summary").forEach(e=>e.remove()),this.injectSeoSummary(e,t))}stripTransientAttributes(e){e.querySelectorAll("[data-description]").forEach(e=>{e.removeAttribute("data-description")}),e.querySelectorAll("[data-semantic-inline-assist='true'], [data-semantic-break='true'], [data-semantic-block-assist='true'], .semantic-heading-offscreen").forEach(e=>e.remove())}refreshStructuredData(e="",t){if(!this.readabilityPriorityRoutes.has(e))return void this.removeStructuredDataScript();const i=this.buildStructuredData(e,t);if(!i)return void this.removeStructuredDataScript();let s=this._document.getElementById("blog-semantic-jsonld");s instanceof HTMLScriptElement||(s=this._document.createElement("script"),s.id="blog-semantic-jsonld",s.type="application/ld+json",this._document.head.appendChild(s)),s.textContent=i}removeStructuredDataScript(){var e;null===(e=this._document.getElementById("blog-semantic-jsonld"))||void 0===e||e.remove()}buildStructuredData(e="",t){var i,s;const r=this.getCleanText((null===(i=t.querySelector("h1"))||void 0===i?void 0:i.textContent)||""),n=this.getArticleParagraphs(t),a=this.getArticleHeadings(t),o=(null===(s=t.querySelector("picture img"))||void 0===s?void 0:s.getAttribute("src"))||"",l=`${this._document.location.origin}${e}`,c=n[0]||r,h=n.join(" ").trim();if(!r||!c||!h)return"";const u=this.getCleanText(Array.from(t.querySelectorAll("label")).map(e=>e.textContent||"").find(e=>/On Billshark/i.test(e))||""),d=new Date(u.replace(/^On Billshark\s*[\u2022|\xb7-]?\s*/i,"")),m=Number.isNaN(d.getTime())?"":d.toISOString(),p=a.slice(0,3).map((e,t)=>({question:`What does ${e} cover?`,answer:n[t+1]||c})),g=this.extractBylineAuthor(t),b=[{"@type":"BlogPosting","@id":`${l}#blogposting`,headline:r,description:c,mainEntityOfPage:l,url:l,articleBody:h,wordCount:h.split(/\s+/).filter(Boolean).length,image:o?[o]:void 0,datePublished:m||void 0,dateModified:m||void 0,author:g?{"@id":`${g.url}#person`}:void 0}];return g&&b.push({"@type":"Person","@id":`${g.url}#person`,name:g.name,url:g.url,mainEntityOfPage:g.url}),p.length&&b.push({"@type":"FAQPage","@id":`${l}#faq`,mainEntity:p.map((e,t)=>({"@type":"Question","@id":`${l}#question-${t+1}`,name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))}),JSON.stringify({"@context":"https://schema.org","@graph":b})}extractBylineAuthor(e){const t=e.querySelector(".bs-byline .bs-byline-author");if(!t)return null;const i=this.getCleanText(t.textContent||""),s=(t.getAttribute("href")||"").match(/\/author\/[a-z0-9-]+/i);return i&&s?{name:i,url:`${this._document.location.origin}${s[0]}`}:null}buildContentFingerprint(e){var t,i,s;const r=this.getCleanText((null===(t=e.querySelector("h1"))||void 0===t?void 0:t.textContent)||""),n=this.getArticleParagraphs(e),a=this.getArticleHeadings(e),o=n.reduce((e,t)=>
1e+t.length,0),l=e.querySelectorAll(".static-post .content .col-12.col-lg-8 a").length,c=e.querySelectorAll("[data-description]").length,h=e.querySelectorAll("[data-semantic-runtime-split],[data-semantic-split],[data-semantic-li-split],[data-semantic-li-segment]").length,u=e.querySelectorAll("[data-semantic-inline-assist='true']").length,d=e.querySelectorAll(".static-post .content .col-12.col-lg-8 li").length,m=e.querySelectorAll("[data-semantic-readability-list='true']").length,p=e.querySelectorAll("[data-semantic-toc='true']").length,g=e.querySelectorAll(".blog-seo-summary").length+e.querySelectorAll(".blog-readability-guide").length;return[r.slice(0,80),n.length,a.length,o,l,c,h,u,d,m,p,g,(null===(i=n[0])||void 0===i?void 0:i.slice(0,80))||"",(null===(s=n[n.length-1])||void 0===s?void 0:s.slice(0,80))||""].join("|")}startObservingRoute(e=""){"undefined"==typeof MutationObserver||!this._document.body||!e||(this.mutationObserver=new MutationObserver(()=>{this.activeRoutePath===e&&(null!=this.pendingObserverTimer&&window.clearTimeout(this.pendingObserverTimer),this.pendingObserverTimer=window.setTimeout(()=>{this.pendingObserverTimer=null,this.applyEnhancements(e)},150))}),this.mutationObserver.observe(this._document.body,{childList:!0,subtree:!0}))}disconnectObserver(){var e;null===(e=this.mutationObserver)||void 0===e||e.disconnect(),this.mutationObserver=null,null!=this.pendingObserverTimer&&(window.clearTimeout(this.pendingObserverTimer),this.pendingObserverTimer=null)}}return e.\u0275fac=function(t){return new(t||e)(r.\u0275\u0275inject(s.K0),r.\u0275\u0275inject(n.f))},e.\u0275prov=r.\u0275\u0275defineInjectable({token:e,factory:e.\u0275fac,providedIn:"root"}),e})()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.