supremeinfofeed.com Open in urlscan Pro
2606:4700:3037::ac43:a111  Public Scan

URL: https://supremeinfofeed.com/_nuxt/DgPSCewh.js
Submission: On November 28 via api from US — Scanned from US

Form analysis 0 forms found in the DOM

Text Content

import{m as useState,T as useClientOrigin,q as useRouter,_ as __vitePreload,U as clientQueryToString,V as getClientQuery,n as useStreamOptions,v as useSurferUuid,W as useNuxtApp,r as ref,o as onMounted,X as onUnmounted,Y as clientQueryToRecord}from"./DVbS82ZV.js";import{e as usePageView}from"./BFkohtdy.js";function randomInRange(e,t){const n=e+Math.random()*(t+1-e);return Math.floor(n)}function getRandomValuesFromList(e,t){const n=[];if(!e.length||t>e.length)return n;const r=[...e];for(let a=0;a<t;a++){const o=randomInRange(0,r.length-1),[i]=r.splice(o,1);n.push(i)}return n}function throttle(e,t){let n=!1,r;return(...a)=>{if(!n)return n=!0,setTimeout(()=>{n=!1},t),r=e(...a),r}}function debounce(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function setSearchParamsToUrl(e){const t=new URLSearchParams(e),n=new URL(window.location.href);n.search=t.toString(),window.history.replaceState(null,"",n.toString())}function getRandomHoursAgo(e){return new Intl.RelativeTimeFormat(e).format(-randomInRange(1,23).toString(),"hours")}function getRandomMinutesAgo(e){return new Intl.RelativeTimeFormat(e).format(-randomInRange(10,59).toString(),"minutes")}function getRandomTime(){const e=new Date(new Date(2023,0,1).getTime()+Math.random()*(new Date().getTime()-new Date(2023,0,1).getTime()));return`${e.getHours()<10?`0${e.getHours()}`:e.getHours()}:${e.getMinutes()<10?`0${e.getMinutes()}`:e.getMinutes()}`}function getTodayLabel(e){return new Intl.DateTimeFormat(e,{month:"long",day:"numeric"}).format(Date.now())}function getDateLabel(e,t){return new Intl.DateTimeFormat(t,{day:"numeric",month:"long"}).format(new Date(e))}function getYearLabel(e){const t=new Date;return new Intl.DateTimeFormat(e,{year:"numeric"}).format(t)}function getFullyTodayLabel(e){return`${getTodayLabel(e)} ${getYearLabel(e)}`}function getMonthYearTodayLabel(e){const t=new Date,n=new Intl.DateTimeFormat(e,{year:"numeric"}).format(t);return`${new Intl.DateTimeFormat(e,{month:"long"}).format(t)} ${n}`}function usePushScriptName(){return useState("server:psn",()=>"")}const PRODUCT_PAGE_NAME="product";function getProductPageUrl(){const e=useClientOrigin().value,t=useRouter().resolve({name:PRODUCT_PAGE_NAME}).fullPath;return addQuery(`${e}${t}`)}function useBacklink(){__vitePreload(async()=>{const{initBacklink:e}=await import("./BUBvW-Jo.js");return{initBacklink:e}},[],import.meta.url).then(({initBacklink:e})=>{e(getProductPageUrl(),!1)})}function extendQuery(){return useFc().value?{surfer_uuid:useSurferUuid().value,"no-trek":"1"}:{}}function addQuery(e){return`${e}${clientQueryToString(getClientQuery(),"?",extendQuery())}`}function getLinkToFullNews(e){const t=useRouter();return addQuery(t.resolve({name:"full-id",params:{id:e}}).fullPath)}function getAdArticleClickUrl({clickUrl:e,id:t}){return e??getLinkToFullNews(Number(t))}function hasNntQueryParam(e){return(e==null?void 0:e.includes("?nnt=1"))||(e==null?void 0:e.includes("&nnt=1"))}function targetByQuery(e){return hasNntQueryParam(e)?"_self":"_blank"}function relByQuery(e){return hasNntQueryParam(e)?"":"opener"}function getParamsFromShortNewsToFullNews(){const e=useRouter(),{id:t}=e.currentRoute.value.params,n=getLinkToFullNews(Number(t));return{link:n,target:targetByQuery(n),rel:relByQuery(n)}}function overrideBlankAnchorHandlers(){window.document.querySelectorAll("a").forEach(e=>{e.getAttribute("target")==="_blank"&&e.addEventListener("click",t=>{var n;t.preventDefault(),t.stopImmediatePropagation(),(n=window.open(t.currentTarget.href,"_blank"))==null||n.focus()})})}function redirectWithNews(){return!window.location.href.includes("/short/")||hasNntQueryParam(window.location.href)||setTimeout(()=>{useStreamOptions().value.is_backlink?window.history.back():window.location.href=getProductPageUrl()},0),!0}function getIsMobile(){return window.innerWidth<=768}function useMobileCheck(){const{$isMobile:e}=useNuxtApp(),t=ref(e);return onMounted(async()=>{function n(){t.value=getIsMobile()}n(),window.addEventListener("resize",n,{passive:!0}),onUnmounted(()=>{window.removeEventListener("resize",n)})}),{isMobile:t}}function usePush(){const{isMobile}=useMobileCheck();let isPushInitialized=!1;const pushScriptName=usePushScriptName().value||"false";function runPush(){isPushInitialized||(eval(`${pushScriptName} && ${pushScriptName}()`),isPushInitialized=!0)}!isMobile.value&&navigator.userAgent.includes("Edg")?window.addEventListener("click",runPush,{passive:!0}):runPush()}function useBacklinkInitialization(){useStreamOptions().value.is_backlink&&useBacklink()}function useQuerySynchronize(){setSearchParamsToUrl(clientQueryToRecord(getClientQuery())),overrideBlankAnchorHandlers()}function useFc(){return useState("server:fc",()=>!1)}function useExperimentSynchronize(){const e="showcase_experiment",t="showcase_experiment_variant",{experiment:n,experiment_variant:r}=usePageView().value||{};!n||!r?(localStorage.removeItem(e),localStorage.removeItem(t)):(localStorage.setItem(e,n),localStorage.setItem(t,r))}export{addQuery as a,getFullyTodayLabel as b,getRandomHoursAgo as c,randomInRange as d,useExperimentSynchronize as e,usePush as f,getMonthYearTodayLabel as g,useQuerySynchronize as h,useBacklinkInitialization as i,debounce as j,throttle as k,hasNntQueryParam as l,getAdArticleClickUrl as m,getParamsFromShortNewsToFullNews as n,getTodayLabel as o,relByQuery as p,getRandomTime as q,redirectWithNews as r,getDateLabel as s,targetByQuery as t,useMobileCheck as u,getRandomValuesFromList as v,getRandomMinutesAgo as w,getYearLabel as x};