The heart of the internet

[]

Reddit - The heart of the internet {r.setAttribute(e.name,e.value)})),r.onerror=function(){console.error("[polyfills-loader] failed to load: "+e+" check the network tab for HTTP status."),l()},t&&(r.type=t),document.head.appendChild(r)}))}var t=[];function o(){}"noModule"in HTMLScriptElement.prototype||t.push(e("https://www.redditstatic.com/shreddit/polyfills/regenerator-runtime.8710f32f34292d0b9a2da4993cb85d94.js")),"fetch"in window||t.push(e("https://www.redditstatic.com/shreddit/polyfills/fetch.a1ad5fb96dc0cb61b9454244c9bd7fe6.js")),"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||t.push(e("https://www.redditstatic.com/shreddit/polyfills/intersection-observer.e09cbb4189f6808e65aaf9f27b007c02.js")),(!("attachShadow"in Element.prototype)||!("getRootNode"in Element.prototype)||window.ShadyDOM&&window.ShadyDOM.force)&&t.push(e("https://www.redditstatic.com/shreddit/polyfills/webcomponents.ed846db3e7c3b1354dcb129b8858e4d4.js")),!("noModule"in HTMLScriptElement.prototype)&&"getRootNode"in Element.prototype&&t.push(e("https://www.redditstatic.com/shreddit/polyfills/custom-elements-es5-adapter.3342b468203af1a14ca005e80d14148f.js")),"attachShadow"in Element.prototype||t.push(e("https://www.redditstatic.com/shreddit/polyfills/lit-polyfill-support.2e7548e448acb656e34764769ec320e0.js")),t.length&&Promise.all(t).then(o)}if("noModule"in HTMLScriptElement.prototype)e();else{var t=document.createElement("script");function o(){document.head.removeChild(t),e()}t.src="https://www.redditstatic.com/shreddit/polyfills/core-js.1c7aca84f142889ea448de106c19e2ec.js",t.onload=o,t.onerror=function(){console.error("[polyfills-loader] failed to load: "+t.src+" check the network tab for HTTP status."),o()},document.head.appendChild(t)}}(),"object"!=typeof globalThis&&(Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__); ]]> {e=s,t=i})),this.resolve=e,this.reject=t}}class ShredditModuleLoader{addModulePromise(e){var t,s,i;this.moduleRegistry[e]?.promise||((t=this.moduleRegistry)[s=e]??(t[s]={}),this.moduleRegistry[e].isResolved=!1,(i=this.moduleRegistry[e]).promise??(i.promise=new Promise((t=>{this.moduleRegistry[e].resolver=t}))))}resolveModule(e){this.moduleRegistry[e].resolver?.(),this.moduleRegistry[e].isResolved=!0}preDeclareModules(e){for(const t of e)this.moduleRegistry[t]||this.addModulePromise(t),this.moduleRegistry[t].isLoading=!0}dm(e,t,s){this.moduleRegistry[e]?.isDeclared||(this.moduleRegistry[e]={...this.moduleRegistry[e],deps:t,factory:s,moduleExports:void 0,isDeclared:!0},this.addModulePromise(e),this._evaluateModule(e,!0).then((()=>{this.resolveModule(e)})))}async _evaluateModule(e,t=!1){if(this.moduleRegistry[e]?.isEvaluated)return this.moduleRegistry[e].moduleExports;this.addModulePromise(e),this.moduleRegistry[e].isResolved||t||await this.moduleRegistry[e].promise;const s=this.moduleRegistry[e];return s.isEvaluated||s.isEvaluating?s.promise?.then((()=>s.moduleExports)):(s.isEvaluating=!0,new Promise((e=>{setTimeout((()=>{Promise.all(s.deps?.map((e=>this._evaluateModule(e)))||[]).then((t=>{const i=s.factory?.apply(null,t);s.moduleExports=i??{},s.isEvaluated=!0,s.isEvaluating=!1,e(s.moduleExports)}))}),0)})))}async di(e,t,s){if(this.moduleRegistry[s])return this._evaluateModule(s);const i=//[^/]*$/;if(!this._diState.concatMode){const o=new URL(t).href.replace(i,"/"),r=new URL(e,o);r.pathname;const d=r.href;return import(d).then((()=>this._evaluateModule(s,!0)))}const o=new URL(t).searchParams.get("prefix")??this._diState.lastPrefix,r=e.replaceAll(/(^./|.js$)/g,"");return this.addModulePromise(s),this._diState.queue.push([[r],o,void 0]),this.debounce(this.debounceTimeout,25),this.moduleRegistry[s].promise.then((()=>this._evaluateModule(s,!0)))}debounce(e,t=25){var s;clearTimeout(this._diState.debounceTimeout),(s=this._diState).debounceStart||(s.debounceStart=Date.now()),Date.now()-this._diState.debounceStart>3*t?e():this._diState.debounceTimeout=setTimeout(this.debounceTimeout,t)}processDIQueue(){const e=[...this._diState.queue];this._diState.queue=[],this._diState.debounceStart=0;const t=e.reduce(((e,[t,s,i])=>(e[s]||(e[s]={chunkIds:[],deferreds:[]}),e[s].chunkIds.push(...t),i&&e[s].deferreds.push(i),e)),{});return Object.entries(t).map((([e,{chunkIds:t,deferreds:s}])=>[e,t,s]))}load(t,s="",i="auto"){this._diState.concatMode=!0;const o=new e;return"high"===i?this._load(t,s,i,[o]):(this._diState.queue.push([t,s,o]),this.debounce(this.debounceTimeout)),o.promise}_load(e,t="",s="auto",i){t&&(this._diState.lastPrefix=t);const o=e.filter((e=>{const t=this.moduleRegistry[this.urlToName(e)];return!t||!t.isLoading&&!t.isResolved})),r=()=>{i.forEach((e=>e?.resolve()))};if(0===o.length)return void r();if(o.length>this.maxChunks){const e=function(e,t){const s=[];for(let i=0;ithis.urlToName(e)));this.preDeclareModules(d);const u=`${window.CONCAT_BASE_URL??"/js/concat"}?prefix=${t}&chunks=${o.sort().join(",")}`;if("loading"===document.readyState)return this._createPreloadTag(u,s),void document.addEventListener("DOMContentLoaded",(()=>this._createScript(u,s).then(r)),{once:!0});this._createScript(u,s).then((()=>{o.map((e=>{this.moduleRegistry[e]?.factory||this.resolveModule(e)})),r()}))}_createScript(e,t){const s=document.createElement("script");return s.type="module",s.src=e,s.fetchPriority=t,document.body.appendChild(s),new Promise(((e,t)=>{s.onload=()=>e(),s.onerror=()=>t()}))}_createPreloadTag(e,t){const s=document.createElement("link");s.rel="modulepreload",s.href=e,s.as="script",s.fetchPriority=t,s.crossOrigin="anonymous",document.head.appendChild(s)}urlToName(e){return e.replaceAll(/(^.+/|.js$)/g,"")}constructor(e={},t=75){this._diState={queue:[],debounceStart:0,lastPrefix:"en-US/"},this.debounceTimeout=()=>this.processDIQueue().forEach((([e,t,s])=>this._load(t,e,void 0,s??[]))),this.moduleRegistry=e,this.maxChunks=t}}window.ShredditModuleLoader=ShredditModuleLoader,window.SML=Object.freeze(new ShredditModuleLoader); ; ]]> {const r=(a=navigator.userAgent,!e.test(a));var a;return!!((e=>!!t.some((t=>e?.originalException?.message?.includes(t))))(o)||(e=>!!n.some((t=>e?.originalException?.stack?.includes(t))))(o)||r)};let r=null;async function a(){return r||(r=async function(){if(!window.navigation)try{const{applyPolyfill:e}=await import("https://www.redditstatic.com/shreddit/apply-polyfill-qHX7md7_.js");e()}catch(e){window.Sentry?.captureException(new Error("Navigation polyfill failed to initialize.",{cause:e}))}return window.navigation}()),r}((e,t,n,o,r,i,s)=>{var c=!1,d=!1,u=[],l=function(e){("e"in e||"p"in e||e.f&&e.f.indexOf("capture")>-1||e.f&&e.f.indexOf("withScope")>-1||e.f&&e.f.indexOf("showReportDialog")>-1)&&f(u),l.data.push(e)};function f(t){function n(){a().then((()=>import("https://www.redditstatic.com/shreddit/sentry-DV8wuxS_.js"))).then((n=>{try{e[i]=n.default,e[o]=m,e[r]=p;var a=e[i],c=a.init;a.init=function(e){var t=s;for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);c(t)},function(t,n){try{for(var a=l.data,i=0;i{const n=(e=>{if(!e)return;let t;try{const{searchParams:n}=new URL(e),o=n.get("embed_host_url"),r=o&&decodeURIComponent(o);if(!r)return;t={url:r,domain:new URL(r).hostname}}catch(e){}return t})(t);if(n)return n;let o="";try{o=e&&new URL(e)?.hostname||""}catch(e){}return{url:e,domain:o}},l=e=>{let t={};try{t=JSON.parse(document.getElementsByTagName("shreddit-screenview-data")?.[0]?.getAttribute("data")??"{}")}catch(e){throw new Error("Unable to parse screenview data")}return e?t[e]:t},f=(e,t,n=l)=>{if(t?.[e])return{};const o=n(e);return o?{[e]:o}:{}},m=({source:e,action:t,noun:n,...o},r={})=>function(e,t){if(!("request"in e))return{...e,request:t};const n={...e.request?.shreddit_client_timestamps??{},...t.shreddit_client_timestamps},o={...e.request??{},shreddit_client_timestamps:n};return{...e,request:o}}({...r,source:e,action:t,noun:n,referrer:u(document.getElementsByTagName("shreddit-app")?.[0]?.getAttribute("referrer")||document.referrer,window.location.href),client_timestamp:Date.now(),...f("post",r),...o},{shreddit_client_timestamps:{[d]:Date.now()}}),p=["js","css"],w={script:"js",link:e=>e.endsWith(".js")?"js":e.endsWith(".css")?"css":null,css:"css"},_=e=>new Promise((t=>setTimeout(t,e))),h=6e5;async function v(e=!1,t=window.performance){if(!PerformanceObserver.supportedEntryTypes.includes("longtask"))return;const n=e?t.now():0;t.mark("total-page-load-start");let o=!1,r=!1,a=-1;window.addEventListener("beforeRoute",(()=>o=!0)),window.addEventListener("afterRoute",(()=>{r=!0,a=t.now()}));let i=-1;new PerformanceObserver((e=>{e.getEntries().forEach((e=>{"longtask"===e.entryType&&e.duration>=50&&(i=e.startTime+e.duration)}))})).observe({type:"longtask"});const s=p.reduce(((e,t)=>(e[t]={type:t,count:0,cached:0,total_download_size_bytes:0,total_load_time_ms:0,cumulative_load_time_ms:0,earliestResourceStart:1/0,latestResourceEnd:-1/0,blocking_count:0},e)),{});new PerformanceObserver((e=>{e.getEntries().forEach((e=>{if("resource"===e.entryType){const{name:t,initiatorType:n,startTime:o,responseEnd:r,transferSize:a,renderBlockingStatus:i=""}=e;if((t.includes(CLIENT_CONFIG.STATIC_BASE_URL)||t.includes(CLIENT_CONFIG.RUNTIME_CONCAT_BASE_URL))&&w[n]){const e="function"==typeof w[n]?w[n](t):w[n];if(!e)return;const c=s[e];if(!c)return;c.count++,0===a?c.cached++:(c.total_download_size_bytes+=a,c.cumulative_load_time_ms+=r-o,c.earliestResourceStart=Math.min(c.earliestResourceStart,o),c.latestResourceEnd=Math.max(c.latestResourceEnd,r)),"blocking"===i&&c.blocking_count++}}}))})).observe({type:"resource",buffered:!0});let d=0,u=-1;const l=e=>"FACEPLATE-IMG"===e.target?.nodeName;window.addEventListener("faceplate-load-start",(e=>{l(e)||d++})),window.addEventListener("faceplate-load",(e=>{l(e)||(d--,u=t.now())})),"complete"!==document.readyState&&await new Promise((e=>window.addEventListener("load",e,{once:!0})));let f=t.now();for(;t.now()-n0)){if(-1===i)return v(Math.max(f,u,a));if(iv(!0))),function(){const e=new PerformanceObserver((t=>{t.getEntries().forEach((t=>{const{domContentLoadedEventStart:n}=t;if(n){!function(e){const t=document.querySelector("shreddit-app");if(!t)return;const n=new CustomEvent("faceplate-track",{detail:{source:"client",action:"emit",noun:"metric",client_timestamp:Date.now(),metric:{name:"shreddit_dom_content_loaded_seconds",value:e,label_values:[`page_type,${t.getAttribute("pagetype")}`,`device_type,${t.getAttribute("devicetype")}`]}}});t.dispatchEvent(n)}(n/1e3),e.disconnect()}}))}));e.observe({type:"navigation",buffered:!0})}(),v();let y=!0;const E=[];function g(e){y&&E.push(e)}window.addEventListener("faceplate-alert",g),window.setTimeout((()=>{if(y=!1,window.removeEventListener("faceplate-alert",g),E.length)for(const e of E)e.target&&window.navigator.onLine&&e.target.dispatchEvent(s("faceplate-alert",e.detail))}),5e3),window.addEventListener("no-resolve",(function(e){console.error("Request resolution halted due to issue with GVS event",e.detail)})); ]]> { window.__servedByRes = resolve; });]]> Skip to main content

Veja todos os detalhes em:clique aqui para ler a matéria completa

Posts relacionados

Go up

Utilizamos cookies para melhorar sua experiência de navegação, veicular anúncios ou conteúdo personalizado e analisar nosso tráfego. Ao clicar em Aceitar todos, você concorda com o uso de cookies. Política de Cookies