PageSourceSearch

https://www.homesandgardens.com/vite/assets/main-DVOBzlSN.js

js homesandgardens.com collected 2026-09-24 08:45:44 UTC 12,982 bytes, 1 lines download raw bytes

1var t,e,i,a,n,s,o,r;import{m as c,b as l,c as m,d,e as u,g as h}from"./vendor-6H_pG-cC.js";import{I as f,h as g}from"./html-B0DlZ5WR.js";import{s as p,i as v}from"./Nav/Nav.ts-agSe9QHG.js";import{g as y,s as C}from"./cookies-Btke1V1y.js";import{i as w}from"./lazy-iframe-DxRpt_oy.js";import{w as M}from"./MyAccount/Badges/index.ts-BO0oyNKo.js";import{r as E}from"./reduxStore-C7ydtzUl.js";import{o as A}from"./observeStore-B3rr3FPD.js";import{a as L,m as z,i as S}from"./index-DQXxj_Yu.js";import{s as b,a as k}from"./user-D_m6siNs.js";import{a as x}from"./initFreyr-BhPCZbEJ.js";import{p as D,h as j}from"./Viafoura/Core/Utils.ts-CMmvIm5U.js";import{c as R,b as F}from"./Viafoura/Core/Events.ts-BM7ZTNd2.js";import{d as P}from"./debouncer-DovBpx4g.js";import{S as G}from"./MyAccount/Badges/constants.ts-DWYI6TUO.js";import"./MyAccount/Badges/utils.ts-DWdwiSOD.js";import"./screen-size-Dw4LJ_p1.js";import"./preload-helper-DZ_bAA1L.js";const T=36e5,_=24*T,I=7*_,Q=30*_,U=365*_,$=()=>"undefined"!=typeof window&&window.ffte&&window.ffte.lang?window.ffte.lang:"en-US",B=(t,e=null,i=new Date)=>t>new Date(i).setDate(i.getDate()-3)&&t<i?q(t,e,i):H(t,e,!1),H=(t,e=null,i=!1)=>{const a=i?{timeStyle:"short"}:{};return new Intl.DateTimeFormat(e||$(),{dateStyle:"long",...a}).format(t)},q=(t,e=null,i=Date.now())=>{const a=i-t,n=new Intl.RelativeTimeFormat(e||$(),{numeric:"auto"});return a<6e4?n.format(-Math.round(a/1e3),"second"):a<T?n.format(-Math.round(a/6e4),"minute"):a<_?n.format(-Math.round(a/T),"hour"):a<I?n.format(-Math.round(a/_),"day"):a<Q?n.format(-Math.round(a/I),"week"):a<U?n.format(-Math.round(a/Q),"month"):n.format(-Math.round(a/U),"year")},O=(t,e=null,i=new Date)=>`${H(t,e,!0)} • ${q(t,e,i)}`,N=()=>{var t,e,i;return Boolean(null==(i=null==(e=null==(t=window.vanilla)?void 0:t.featureFlags)?void 0:e.liveReport)?void 0:i.absoluteWithRelativeDate)},W=(t,e)=>{Array.prototype.forEach.call(t,(function(t){t.innerHTML=e(new Date(t.getAttribute("datetime")))}))},V=()=>{W(document.querySelectorAll("time.relative-date"),(t=>B(t)));const t=N()?O:t=>H(t,null,!0);W(document.querySelectorAll("time.live-feed-date"),t)},J=Object.freeze(Object.defineProperty({__proto__:null,formatAbsoluteDate:H,formatAbsoluteWithRelativeDate:O,formatDate:B,formatRelativeDate:q,isAbsoluteWithRelativeDateEnabled:N,updateRelativeDates:V},Symbol.toStringTag,{value:"Module"})),K=["application/javascript","application/ecmascript","application/x-ecmascript","application/x-javascript","text/ecmascript","text/javascript","text/javascript1.0","text/javascript1.1","text/javascript1.2","text/javascript1.3","text/javascript1.4","text/javascript1.5","text/jscript","text/livescript","text/x-ecmascript","text/x-javascript"],X=Object.freeze(Object.defineProperty({__proto__:null,loadLazyIframes:function(t){t.querySelectorAll("iframe[data-lazy-src]").forEach((t=>{!t.src&&t.dataset&&t.dataset.lazySrc&&(t.src=t.dataset.lazySrc)}))},runScripts:function(t){t.querySelectorAll("script").forEach((function(t){const e=t.getAttribute("type");e&&!K.includes(e)||function(t){const e=document.createElement("script");e.type="text/javascript",t.src?e.src=t.src:e.textContent=t.innerText,document.head.appendChild(e),t.parentNode.removeChild(t)}(t)}))}},Symbol.toStringTag,{value:"Module"}));class Y{constructor(t){if(this.faviconLinkElements=[],this.processedFaviconData=[],this.options={faviconEl:t.faviconEl,dotSize:t.dotSize??"small",dotColor:t.dotColor??"#ff0000"},null===t.faviconEl)throw new Error("The favicon elements you have specified are not valid.");t.faviconEl instanceof NodeList?this.faviconLinkElements=Array.from(t.faviconEl):t.faviconEl instanceof HTMLLinkElement&&(this.faviconLinkElements=[t.faviconEl]),this.faviconLinkElements.forEach((t=>{this.processedFaviconData.push({originalFaviconHref:t.href,faviconElement:t})}))}getFaviconImages(){if(this.hasAlreadyLoadedImages())return new Promise((t=>{t(this.processedFaviconData)}));const t=this.processedFaviconData.map((t=>new Promise(((e,i)=>{const a=new Image;a.src=t.originalFaviconHref,a.crossOrigin="anonymous",a.onload=()=>{t.imgElement=a,e(t)},a.onerror=()=>i({reason:`The image url: ${t.originalFaviconHref} could not be loaded.`})}))));return Promise.all(t)}hasAlreadyLoadedImages(){return this.processedFaviconData.every((t=>t.imgElement instanceof HTMLImageElement))}getDotScaleDivider(){switch(this.options.dotSize){case"small":default:return 4.5;case"medium":return 3;case"large":return 2.5}}
1show(){this.getFaviconImages().then((t=>{t.forEach((t=>{if(t.imgElement){const e=document.createElement("canvas"),i=e.getContext("2d"),a=t.imgElement.naturalWidth,n=t.imgElement.naturalHeight;if(e.width=a,e.height=n,i){i.drawImage(t.imgElement,0,0,a,n);const s=this.getDotScaleDivider();i.beginPath(),i.arc(e.width-a/s,n/s,n/s,0,2*Math.PI),i.fillStyle=this.options.dotColor,i.fill(),t.faviconElement.href=e.toDataURL("image/png")}}}))}))}hide(){this.getFaviconImages().then((t=>{t.forEach((t=>{t.faviconElement.href=t.originalFaviconHref}))}))}}let Z=!0,tt=null;const et=(null==(e=null==(t=window.vanilla.featureFlags.notifications)?void 0:t.title)?void 0:e.enabled)??!1;if(null==(a=null==(i=window.vanilla.featureFlags.notifications)?void 0:i.favicon)?void 0:a.enabled){const t=document.querySelectorAll("head link[rel=icon]");t.length>0&&(tt=new Y({faviconEl:t,dotColor:(null==(s=null==(n=window.vanilla.featureFlags.notifications)?void 0:n.favicon)?void 0:s.dotColor)??"#ff0000",dotSize:(null==(r=null==(o=window.vanilla.featureFlags.notifications)?void 0:o.favicon)?void 0:r.dotSize)??"small"}))}const it={totalQuizzesPlayed:0,fetchedAt:0};let at;const nt=new Promise((t=>{at=t})),st={totalLikesCreated:0,totalCommentsCreated:0,fetchedAt:0};let ot;const rt=new Promise((t=>{ot=t}));let ct;const lt=new Promise((t=>{ct=t}));let mt;const dt=new Promise((t=>{mt=t}));function ut(){return Alpine.store("userMetrics")}async function ht(t){return await rt,t(ut())}c.plugin(l),c.plugin(m),c.plugin(d),c.plugin(u),c.plugin(h),window.Alpine=c,window.utils={screenSizes:p,getCookieValue:y,setCookie:C,scripts:X,dates:J,html:g,badges:M};const ft=()=>{N()&&V()};ft(),window.addEventListener("load",ft),b(),k(),A(E,(t=>t.tabNotifications.count),(t=>{Z&&0===t?Z=!1:(tt&&(0===t?tt.hide():tt.show()),et&&function(t){const e=new RegExp(/^\(\d+\)/),i=document.title;e.test(i)&&t>0?document.title=i.replace(e,`(${t})`):e.test(i)&&0===t?document.title=i.replace(e,""):t>0&&(document.title=`(${t}) ${i}`)}(t))})),w(),v(),function(){window.vanilla.userMetrics.readiness={initialised:dt,communityMetricsLoaded:rt,gamingMetricsLoaded:nt,articleMetricsLoaded:lt},window.vanilla.userMetrics.articles={totalArticlesRead:()=>async function(t){return await lt,(t=>t.articlesRead())(ut())}()},window.vanilla.userMetrics.gaming={totalQuizzesPlayed:()=>async function(t){return await nt,(t=>t.totalQuizzesPlayed())(ut())}()},window.vanilla.userMetrics.community={totalLikesCreated:()=>ht((t=>t.totalLikesCreated())),totalCommentsCreated:()=>ht((t=>t.totalCommentsCreated())),totalCommentsAndLikesCreated:()=>ht((t=>t.totalCommentsAndLikesCreated()))};const t=window.vanilla.featureFlags.userMetrics;Alpine.store("userMetrics",{cacheTtlMs:t.cacheTtlMs,...{articlesRead(){try{const t=localStorage.getItem(G.ARTICLES_HISTORY);if(t){const e=JSON.parse(window.atob(t));return Array.isArray(e)?e.length:0}}catch(t){console.error("Error loading articles count:",t)}return 0},initialiseArticleMetrics(){const t={articlesRead:this.articlesRead()};ct(t),document.dispatchEvent(new CustomEvent("vanilla:userMetrics:articlesLoaded",{detail:t}))}},...{community:Alpine.$persist({...st}).as("userMetrics_community_v1"),isCommunityMetricsLoading:!1,viafouraApiService:Alpine.raw(z()),totalLikesCreated(){return this.community.totalLikesCreated},totalCommentsCreated(){return this.community.totalCommentsCreated},totalCommentsAndLikesCreated(){return this.totalLikesCreated()+this.totalCommentsCreated()},hasCommunityMetricsBeenFetched(){return this.community.fetchedAt>0},hasCommunityMetricsCacheExpired(){return this.community.fetchedAt>0&&Date.now()-this.community.fetchedAt>this.cacheTtlMs},clearCommunityMetrics(){this.community={...st}},expireCommunityMetrics(){this.community={...this.community,fetchedAt:Date.now()-(this.cacheTtlMs+1e3)}},dispatchCommunityMetricsReady(){const t={totalLikesCreated:this.totalLikesCreated(),totalCommentsCreated:this.totalCommentsCreated(),totalCommentsAndLikesCreated:this.totalCommentsAndLikesCreated()};ot(t),document.dispatchEvent(new CustomEvent("vanilla:userMetrics:communityLoaded",{detail:t}))},async loadCommunityMetrics(t){if(!this.isCommunityMetricsLoading){this.isCommunityMetricsLoading=!0;try{const e=await this.viafouraApiService.getUserProfileStats(t);this.community={totalLikesCreated:e.likes_created,totalCommentsCreated:e.content_created,fetchedAt:Date.now()}}catch(t){console.error("Failed to load community metrics:",t)}finally{this.isCommunityMetricsLoading=!1,this.dispatchCommunityMetricsReady()}}},onCommunityContentCreated(){this.community={...this.community,totalCommentsCreated:this.community.totalCommentsCreated+1,fetchedAt:0},this.dispatchCommunityMetricsReady(),this.expireCommunityMetrics()},initCommunityLikeClickDetection(t,e){t.addEventListener("click",P((t=>{e&&t.target.closest(".vf-content-actions__like, .vf-remove-content button")&&this.expireCommunityMetrics()}),1e3))},communityMetricsEnabled:()=>window.vanilla.featureFlags.viafouraComments.enabled,initialiseCommunityMetrics(){this.authenticatedUserMetricsEnabled()&&this.communityMetricsEnabled()&&(!this.hasCommunityMetricsBeenFetched()||this.hasCommunityMetricsCacheExpired())?(D((()=>{window.vf.context.get("user").then((({user_privilege:t,uuid:e})=>{const i=e;"guest"!==t?(!this.hasCommunityMetricsBeenFetched()||this.hasCommunityMetricsCacheExpired()?this.loadCommunityMetrics(i):this.dispatchCommunityMetricsReady(),window.vf.$subscribe("comment","created",(({actor_uuid:t})=>{t===i&&this.onCommunityContentCreated()})),window.vf.$subscribe("comment-reply","posted",(({actor_uuid:t})=>{t===i&&this.onCommunityContentCreated()})),R.then((t=>{this.initCommunityLikeClickDetection(t,e)}))):this.dispatchCommunityMetricsReady()}))})),F.then((()=>{this.clearCommunityAndGamingMetrics()}))):this.dispatchCommunityMetricsReady()}},...{gaming:Alpine.$persist({...it}).as("userMetrics_gaming_v1"),isGamingMetricsLoading:!1,kwizlyApiService:Alpine.raw(L()),totalQuizzesPlayed(){return this.gaming.totalQuizzesPlayed},dispatchGamingMetricsReady(){const t={totalQuizzesPlayed:this.totalQuizzesPlayed()};at(t),document.dispatchEvent(new CustomEvent("vanilla:userMetrics:gamingLoaded",{detail:t}))},clearGamingMetrics(){this.gaming={...it}},expireGamingMetrics(){this.gaming={...this.gaming,fetchedAt:Date.now()-(this.cacheTtlMs+1e3)}},hasGamingMetricsBeenFetched(){return this.gaming.fetchedAt>0},hasGamingMetricsCacheExpired(){return this.gaming.fetchedAt>0&&Date.now()-this.gaming.fetchedAt>this.cacheTtlMs},incrementTotalQuizzesPlayed(){this.gaming={...this.gaming,totalQuizzesPlayed:this.gaming.totalQuizzesPlayed+1}},async loadGamingMetrics(t){if(!this.isGamingMetricsLoading){this.isGamingMetricsLoading=!0;try{const e=await this.kwizlyApiService.getUserProfileStats(t);
1this.gaming={totalQuizzesPlayed:e.played||0,fetchedAt:Date.now()}}catch(t){console.warn("Failed to load gaming metrics:",t)}finally{this.isGamingMetricsLoading=!1,this.dispatchGamingMetricsReady()}}},initialiseGamingMetrics(){var t,e,i;if(!this.authenticatedUserMetricsEnabled())return void this.dispatchGamingMetricsReady();const a=null==(i=null==(e=null==(t=window.FUTR)?void 0:t.Kiosq)?void 0:e.User)?void 0:i.sub;a?(!this.hasGamingMetricsBeenFetched()||this.hasGamingMetricsCacheExpired()?this.loadGamingMetrics(a):this.dispatchGamingMetricsReady(),document.addEventListener("kwizly:quiz-completed",(()=>{this.incrementTotalQuizzesPlayed(),this.expireGamingMetrics()}),{passive:!0})):this.dispatchGamingMetricsReady()}},authenticatedUserMetricsEnabled:()=>j()&&t.enabled,clearCommunityAndGamingMetrics(){this.clearCommunityMetrics(),this.clearGamingMetrics()},makeUserMetricsStoreDetail(){return{gaming:{totalQuizzesPlayed:this.totalQuizzesPlayed()},community:{totalLikesCreated:this.totalLikesCreated(),totalCommentsCreated:this.totalCommentsCreated(),totalCommentsAndLikesCreated:this.totalCommentsAndLikesCreated()},article:{articlesRead:this.articlesRead()}}},fireEventWhenAllStoresInitialised(){const t=[lt];this.authenticatedUserMetricsEnabled()&&(t.push(nt),this.communityMetricsEnabled()&&t.push(rt)),Promise.all(t).then((()=>{const t=this.makeUserMetricsStoreDetail();document.dispatchEvent(new CustomEvent("vanilla:userMetrics:initialised",{detail:t})),mt(t)}))},init(){this.fireEventWhenAllStoresInitialised(),this.initialiseArticleMetrics(),this.initialiseCommunityMetrics(),this.initialiseGamingMetrics(),window.vanilla.userMetrics.resolveStoreApiReady()}})}(),x(),window.vanilla.thirdparty=S(),window.vanilla.api={icons:{iconRendererApiService:new f}};

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.