PageSourceSearch

https://www.wwf.se/app/themes/wwf/dist/assets/hedgehog-counter-CNhjlP_O.js

js wwf.se collected 2026-09-24 17:41:32 UTC 1,460 bytes, 1 lines download raw bytes

1var h=Object.defineProperty;var u=(o,e,t)=>e in o?h(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var n=(o,e,t)=>u(o,typeof e!="symbol"?e+"":e,t);import{i as c}from"./countUp.min-NVMRH_d2.js";import{C as l}from"./main-scipts-ByAP7cHW.js";import{hedgehogData as g,getHedgehogRegistrationCount as s,fetchHedgehogData as m,getDisplayedRegistrationTotal as p}from"./hedgehog-data-KBulNdRX.js";class D extends l{constructor(t){super(t);n(this,"currentCount",0);n(this,"apiVersion");n(this,"frozenPublishedTotal",!1);n(this,"onReported",t=>{if(this.frozenPublishedTotal)return;const a=t,{count:i,state:r}=a.detail,d=r!==void 0?s(r):parseInt(String(i??"1"),10)||1;this.animateToCount(this.currentCount+d,this.currentCount)});n(this,"onDataFetched",t=>{const a=t;this.animateToCount(s(a.detail),0)});this.apiVersion=t.dataset.hedgehogApi==="v2"?"v2":"v1",this.apiVersion==="v2"?this.loadInitialCount():(g.getData(),document.addEventListener("hedgehogDataFetched",this.onDataFetched)),document.addEventListener("hedgehog:reported",this.onReported)}async loadInitialCount(){try{const t=await m("v2");this.frozenPublishedTotal=(t.published_registrations??0)>0,this.animateToCount(p(t),0)}catch(t){console.error("Failed to load hedgehog v2 data for counter",t)}}animateToCount(t,a){this.currentCount=t,new c(this.element,t,{decimal:"0",startVal:a,formattingFn:i=>new Intl.NumberFormat("sv-SE").format(i),scrollSpyOnce:!0}).start()}}export{D as default};

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.