(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&l(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function l(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var jn,pe,nr,qt,Jo,ir,or,Pi,$n,un,sr,Qi,zi,Oi,On={},Vn=[],Na=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Kn=Array.isArray;function Ot(e,t){for(var n in t)e[n]=t[n];return e}function Zi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function za(e,t,n){var l,o,s,a={};for(s in t)s=="key"?l=t[s]:s=="ref"?o=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?jn.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(s in e.defaultProps)a[s]===void 0&&(a[s]=e.defaultProps[s]);return Fn(e,a,l,o,null)}function Fn(e,t,n,l,o){var s={type:e,props:t,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++nr,__i:-1,__u:0};return o==null&&pe.vnode!=null&&pe.vnode(s),s}function et(e){return e.children}function Rn(e,t){this.props=e,this.context=t}function _l(e,t){if(t==null)return e.__?_l(e.__,e.__i+1):null;for(var n;tt&&qt.sort(or),e=qt.shift(),t=qt.length,Oa(e)}finally{qt.length=Bn.__r=0}}function ar(e,t,n,l,o,s,a,d,_,p,v){var g,u,y,P,D,$,H=l&&l.__k||Vn,b=t.length;for(_=Va(n,t,H,_,b),g=0;g0?a=e.__k[s]=Fn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[s]=a,_=s+u,a.__=e,a.__b=e.__b+1,d=null,(p=a.__i=Ba(a,n,_,g))!=-1&&(g--,(d=n[p])&&(d.__u|=2)),d==null||d.__v==null?(p==-1&&(o>v?u--:o_?u--:u++,a.__u|=4))):e.__k[s]=null;if(g)for(s=0;s(v?1:0)){for(o=n-1,s=n+1;o>=0||s=0?o--:s++])!=null&&(2&p.__u)==0&&d==p.key&&_==p.type)return a}return-1}function Zo(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Na.test(t)?n:n+"px"}function Pn(e,t,n,l,o){var s,a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof l=="string"&&(e.style.cssText=l=""),l)for(t in l)n&&t in n||Zo(e.style,t,"");if(n)for(t in n)l&&n[t]==l[t]||Zo(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")s=t!=(t=t.replace(sr,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?l?n[un]=l[un]:(n[un]=Qi,e.addEventListener(t,s?Oi:zi,s)):e.removeEventListener(t,s?Oi:zi,s);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Xo(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[$n]==null)t[$n]=Qi++;else if(t[$n]0?e:Kn(e)?e.map(dr):e.constructor!==void 0?null:Ot({},e)}function Wa(e,t,n,l,o,s,a,d,_){var p,v,g,u,y,P,D,$=n.props||On,H=t.props,b=t.type;if(b=="svg"?o="http://www.w3.org/2000/svg":b=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),s!=null){for(p=0;p=n.__.length&&n.__.push({}),n.__[e]}function ye(e){return Wn=1,Ya(mr,e)}function Ya(e,t,n){var l=to(pn++,2);if(l.t=e,!l.__c&&(l.__=[mr(void 0,t),function(d){var _=l.__N?l.__N[0]:l.__[0],p=l.t(_,d);_!==p&&(l.__N=[p,l.__[1]],l.__c.setState({}))}],l.__c=Pe,!Pe.__f)){var o=function(d,_,p){if(!l.__c.__H)return!0;var v=!1,g=l.__c.props!==d;if(l.__c.__H.__.some(function(y){if(y.__N){v=!0;var P=y.__[0];y.__=y.__N,y.__N=void 0,P!==y.__[0]&&(g=!0)}}),s){var u=s.call(this,d,_,p);return v?u||g:u}return!v||g};Pe.__f=!0;var s=Pe.shouldComponentUpdate,a=Pe.componentWillUpdate;Pe.componentWillUpdate=function(d,_,p){if(this.__e){var v=s;s=void 0,o(d,_,p),s=v}a&&a.call(this,d,_,p)},Pe.shouldComponentUpdate=o}return l.__N||l.__}function Wt(e,t){var n=to(pn++,3);!De.__s&&_r(n.__H,t)&&(n.__=e,n.u=t,Pe.__H.__h.push(n))}function fn(e){return Wn=5,dl(function(){return{current:e}},[])}function dl(e,t){var n=to(pn++,7);return _r(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ja(){for(var e;e=pr.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Hn),t.__h.some(Vi),t.__h=[]}catch(n){t.__h=[],De.__e(n,e.__v)}}}De.__b=function(e){Pe=null,ts&&ts(e)},De.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ss&&ss(e,t)},De.__r=function(e){ls&&ls(e),pn=0;var t=(Pe=e.__c).__H;t&&(Ci===Pe?(t.__h=[],Pe.__h=[],t.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.some(Hn),t.__h.some(Vi),t.__h=[],pn=0)),Ci=Pe},De.diffed=function(e){ns&&ns(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pr.push(t)!==1&&es===De.requestAnimationFrame||((es=De.requestAnimationFrame)||Ka)(ja)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Ci=Pe=null},De.__c=function(e,t){t.some(function(n){try{n.__h.some(Hn),n.__h=n.__h.filter(function(l){return!l.__||Vi(l)})}catch(l){t.some(function(o){o.__h&&(o.__h=[])}),t=[],De.__e(l,n.__v)}}),is&&is(e,t)},De.unmount=function(e){os&&os(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(l){try{Hn(l)}catch(o){t=o}}),n.__H=void 0,t&&De.__e(t,n.__v))};var rs=typeof requestAnimationFrame=="function";function Ka(e){var t,n=function(){clearTimeout(l),rs&&cancelAnimationFrame(t),setTimeout(e)},l=setTimeout(n,35);rs&&(t=requestAnimationFrame(n))}function Hn(e){var t=Pe,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),Pe=t}function Vi(e){var t=Pe;e.__c=e.__(),Pe=t}function _r(e,t){return!e||e.length!==t.length||t.some(function(n,l){return n!==e[l]})}function mr(e,t){return typeof t=="function"?t(e):t}const gr="https://modelpulse.ifsp.dev",Cn=new Map;function Nl(e){if(!Cn.has(e)){const t=fetch(gr+e).then(async n=>{if(!n.ok){const l=await n.json().catch(()=>({}));throw Cn.delete(e),new Error(l.detail||`Request failed (${n.status})`)}return n.json()});Cn.set(e,t)}return Cn.get(e)}const hl={model:e=>Nl(`/api/model/${e}`),author:e=>Nl(`/api/author/${encodeURIComponent(e)}`),search:e=>Nl(`/api/search?q=${encodeURIComponent(e)}`),leaderboards:()=>Nl("/api/leaderboards"),hub:()=>Nl("/api/hub"),meta:()=>Nl("/api/meta")},qa=new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}),Ja=new Intl.NumberFormat("en"),Re=e=>e==null?"–":qa.format(e),$e=e=>e==null?"–":Ja.format(Math.round(e)),mn=e=>e==null?"–":`${e>=0?"+":"−"}${Math.abs(e*100)>=10?Math.abs(e*100).toFixed(0):Math.abs(e*100).toFixed(1)}%`,vr=e=>e?e>=1e9?`${(e/1e9).toFixed(e>=1e10?0:1)}B params`:e>=1e6?`${(e/1e6).toFixed(0)}M params`:`${(e/1e3).toFixed(0)}K params`:null,Qt=(e,t={month:"short",day:"numeric",year:"numeric"})=>new Date(typeof e=="string"?e+(e.length===10?"T00:00:00Z":""):e).toLocaleDateString("en",{timeZone:"UTC",...t}),Qa=e=>{if(e==null)return"–";const t=["th","st","nd","rd"],n=e%100;return e.toLocaleString("en")+(t[(n-20)%10]||t[n]||t[0])},Wl=e=>e?e.replace(/-/g," "):"untagged",as=86400,qn=e=>Date.parse(e+"T00:00:00Z")/1e3;function wr(e,t){const n=[],l=[];let o=null,s=null;for(let a=0;a=t&&(l-=e[o-t]),n.push(l/Math.min(o+1,t));return n}function Za(e){const t=e.dl_all.findIndex(s=>s!=null);if(t<0)return[];const n=e.dl_all[e.dl_all.length-1]??0,l=[];for(const[s,a]of[[1e3,"1K"],[1e4,"10K"],[1e5,"100K"],[1e6,"1M"],[1e7,"10M"],[1e8,"100M"],[1e9,"1B"]]){if((e.dl_all[t]??0)>=s){l.push({value:s,label:a,day:null,before:e.day[t]});continue}const d=e.dl_all.findIndex(_=>_!=null&&_>=s);if(d>=0)l.push({value:s,label:a,day:e.day[d],before:null});else if(l.push({value:s,label:a,day:null,before:null}),s>n*10)break}const o=l.map(s=>!!s.before).lastIndexOf(!0);return l.filter((s,a)=>!s.before||a===o)}function cs(){var t;const e=new URLSearchParams(location.search);return{model:e.get("model")||void 0,author:e.get("author")||void 0,compare:(t=e.get("compare"))==null?void 0:t.split(",").filter(Boolean),view:e.get("view")||void 0}}function yr(e){var n;const t=new URLSearchParams;return e.model&&t.set("model",e.model),e.author&&t.set("author",e.author),(n=e.compare)!=null&&n.length&&t.set("compare",e.compare.join(",")),e.view&&t.set("view",e.view),t.toString().replace(/%2F/g,"/").replace(/%2C/g,",")}const no="https://huggingface.co/spaces/modelpulse/model-pulse";function Xa(e){const t=yr(e);return no+(t?`?${t}`:"")}function Xe(e,t=!1){var o;const n=yr(e),l=location.pathname+(n?`?${n}`:"");t?history.replaceState(null,"",l):history.pushState(null,"",l);try{(o=window.parent)==null||o.postMessage({queryString:n,hash:""},"https://huggingface.co")}catch{}window.dispatchEvent(new Event("routechange")),t||window.scrollTo({top:0})}function us(e){e=e.trim();const t=e.match(/(?:huggingface\.co|hf\.co)\/(?!spaces\/|datasets\/)([^/\s?#]+\/[^/\s?#]+)/);return t?t[1]:/^[\w.-]+\/[\w.-]+$/.test(e)?e:null}const ec=!0,He="u-",tc="uplot",lc=He+"hz",nc=He+"vt",ic=He+"title",oc=He+"wrap",sc=He+"under",rc=He+"over",ac=He+"axis",fl=He+"off",cc=He+"select",uc=He+"cursor-x",fc=He+"cursor-y",dc=He+"cursor-pt",hc=He+"legend",pc=He+"live",_c=He+"inline",mc=He+"series",gc=He+"marker",fs=He+"label",vc=He+"value",rn="width",an="height",on="top",ds="bottom",zl="left",Di="right",io="#000",hs=io+"0",Li="mousemove",ps="mousedown",Ai="mouseup",_s="mouseenter",ms="mouseleave",gs="dblclick",wc="resize",yc="scroll",vs="change",In="dppxchange",oo="--",jl=typeof window<"u",Bi=jl?document:null,Bl=jl?window:null,bc=jl?navigator:null;let ae,Dn;function Wi(){let e=devicePixelRatio;ae!=e&&(ae=e,Dn&&Ui(vs,Dn,Wi),Dn=matchMedia(`(min-resolution: ${ae-.001}dppx) and (max-resolution: ${ae+.001}dppx)`),pl(vs,Dn,Wi),Bl.dispatchEvent(new CustomEvent(In)))}function ct(e,t){if(t!=null){let n=e.classList;!n.contains(t)&&n.add(t)}}function Ii(e,t){let n=e.classList;n.contains(t)&&n.remove(t)}function we(e,t,n){e.style[t]=n+"px"}function Mt(e,t,n,l){let o=Bi.createElement(e);return t!=null&&ct(o,t),n!=null&&n.insertBefore(o,l),o}function vt(e,t){return Mt("div",e,t)}const ws=new WeakMap;function Rt(e,t,n,l,o){let s="translate("+t+"px,"+n+"px)",a=ws.get(e);s!=a&&(e.style.transform=s,ws.set(e,s),t<0||n<0||t>l||n>o?ct(e,fl):Ii(e,fl))}const ys=new WeakMap;function bs(e,t,n){let l=t+n,o=ys.get(e);l!=o&&(ys.set(e,l),e.style.background=t,e.style.borderColor=n)}const ks=new WeakMap;function Ss(e,t,n,l){let o=t+""+n,s=ks.get(e);o!=s&&(ks.set(e,o),e.style.height=n+"px",e.style.width=t+"px",e.style.marginLeft=l?-t/2+"px":0,e.style.marginTop=l?-n/2+"px":0)}const so={passive:!0},kc={...so,capture:!0};function pl(e,t,n,l){t.addEventListener(e,n,l?kc:so)}function Ui(e,t,n,l){t.removeEventListener(e,n,so)}jl&&Wi();function Tt(e,t,n,l){let o;n=n||0,l=l||t.length-1;let s=l<=2147483647;for(;l-n>1;)o=s?n+l>>1:ut((n+l)/2),t[o]{let s=-1,a=-1;for(let d=l;d<=o;d++)if(e(n[d])){s=d;break}for(let d=o;d>=l;d--)if(e(n[d])){a=d;break}return[s,a]}}const kr=e=>e!=null,Sr=e=>e!=null&&e>0,Jn=br(kr),Sc=br(Sr);function xc(e,t,n,l=0,o=!1){let s=o?Sc:Jn,a=o?Sr:kr;[t,n]=s(e,t,n);let d=e[t],_=e[t];if(t>-1)if(l==1)d=e[t],_=e[n];else if(l==-1)d=e[n],_=e[t];else for(let p=t;p<=n;p++){let v=e[p];a(v)&&(v_&&(_=v))}return[d??de,_??-de]}function Qn(e,t,n,l){let o=Ts(e),s=Ts(t);e==t&&(o==-1?(e*=n,t/=n):(e/=n,t*=n));let a=n==10?Vt:xr,d=o==1?ut:wt,_=s==1?wt:ut,p=d(a(Fe(e))),v=_(a(Fe(t))),g=Il(n,p),u=Il(n,v);return n==10&&(p<0&&(g=he(g,-p)),v<0&&(u=he(u,-v))),l||n==2?(e=g*o,t=u*s):(e=Cr(e,g),t=Zn(t,u)),[e,t]}function ro(e,t,n,l){let o=Qn(e,t,n,l);return e==0&&(o[0]=0),t==0&&(o[1]=0),o}const ao=.1,xs={mode:3,pad:ao},dn={pad:0,soft:null,mode:0},Mc={min:dn,max:dn};function Un(e,t,n,l){return Xn(n)?Ms(e,t,n):(dn.pad=n,dn.soft=l?0:null,dn.mode=l?3:0,Ms(e,t,Mc))}function se(e,t){return e??t}function Tc(e,t,n){for(t=se(t,0),n=se(n,e.length-1);t<=n;){if(e[t]!=null)return!0;t++}return!1}function Ms(e,t,n){let l=n.min,o=n.max,s=se(l.pad,0),a=se(o.pad,0),d=se(l.hard,-de),_=se(o.hard,de),p=se(l.soft,de),v=se(o.soft,-de),g=se(l.mode,0),u=se(o.mode,0),y=t-e,P=Vt(y),D=tt(Fe(e),Fe(t)),$=Vt(D),H=Fe($-P);(y<1e-24||H>10)&&(y=0,(e==0||t==0)&&(y=1e-24,g==2&&p!=de&&(s=0),u==2&&v!=-de&&(a=0)));let b=y||D||1e3,F=Vt(b),S=Il(10,ut(F)),x=b*(y==0?e==0?.1:1:s),k=he(Cr(e-x,S/10),24),T=e>=p&&(g==1||g==3&&k<=p||g==2&&k>=p)?p:de,R=tt(d,k=T?T:Pt(T,k)),V=b*(y==0?t==0?.1:1:a),W=he(Zn(t+V,S/10),24),L=t<=v&&(u==1||u==3&&W>=v||u==2&&W<=v)?v:-de,Q=Pt(_,W>L&&t<=L?L:tt(L,W));return R==Q&&R==0&&(Q=100),[R,Q]}const Pc=new Intl.NumberFormat(jl?bc.language:"en-US"),co=e=>Pc.format(e),ft=Math,zn=ft.PI,Fe=ft.abs,ut=ft.floor,Ee=ft.round,wt=ft.ceil,Pt=ft.min,tt=ft.max,Il=ft.pow,Ts=ft.sign,Vt=ft.log10,xr=ft.log2,Cc=(e,t=1)=>ft.sinh(e)*t,Ei=(e,t=1)=>ft.asinh(e/t),de=1/0;function Ps(e){return(Vt((e^e>>31)-(e>>31))|0)+1}function Gi(e,t,n){return Pt(tt(e,t),n)}function Mr(e){return typeof e=="function"}function ne(e){return Mr(e)?e:()=>e}const Dc=()=>{},Tr=e=>e,Pr=(e,t)=>t,Lc=e=>null,Cs=e=>!0,Ds=(e,t)=>e==t,Ac=/\.\d*?(?=9{6,}|0{6,})/gm,ml=e=>{if(Lr(e)||Zt.has(e))return e;const t=`${e}`,n=t.match(Ac);if(n==null)return e;let l=n[0].length-1;if(t.indexOf("e-")!=-1){let[o,s]=t.split("e");return+`${ml(o)}e${s}`}return he(e,l)};function cl(e,t){return ml(he(ml(e/t))*t)}function Zn(e,t){return ml(wt(ml(e/t))*t)}function Cr(e,t){return ml(ut(ml(e/t))*t)}function he(e,t=0){if(Lr(e))return e;let n=10**t,l=e*n*(1+Number.EPSILON);return Ee(l)/n}const Zt=new Map;function Dr(e){return((""+e).split(".")[1]||"").length}function _n(e,t,n,l){let o=[],s=l.map(Dr);for(let a=t;a=0?0:d)+(a>=s[p]?0:s[p]),u=e==10?v:he(v,g);o.push(u),Zt.set(u,g)}}return o}const hn={},uo=[],Ul=[null,null],Jt=Array.isArray,Lr=Number.isInteger,Ec=e=>e===void 0;function Ls(e){return typeof e=="string"}function Xn(e){let t=!1;if(e!=null){let n=e.constructor;t=n==null||n==Object}return t}function $c(e){return e!=null&&typeof e=="object"}const Fc=Object.getPrototypeOf(Uint8Array),Ar="__proto__";function Gl(e,t=Xn){let n;if(Jt(e)){let l=e.find(o=>o!=null);if(Jt(l)||t(l)){n=Array(e.length);for(let o=0;os){for(o=a-1;o>=0&&e[o]==null;)e[o--]=null;for(o=a+1;oa-d)],o=l[0].length,s=new Map;for(let a=0;a"u"?e=>Promise.resolve().then(e):queueMicrotask;function Bc(e){let t=e[0],n=t.length,l=Array(n);for(let s=0;st[s]-t[a]);let o=[];for(let s=0;s=l&&e[o]==null;)o--;if(o<=l)return!0;const s=tt(1,ut((o-l+1)/t));for(let a=e[l],d=l+s;d<=o;d+=s){const _=e[d];if(_!=null){if(_<=a)return!1;a=_}}return!0}const Er=["January","February","March","April","May","June","July","August","September","October","November","December"],$r=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Fr(e){return e.slice(0,3)}const Uc=$r.map(Fr),Gc=Er.map(Fr),Yc={MMMM:Er,MMM:Gc,WWWW:$r,WWW:Uc};function sn(e){return(e<10?"0":"")+e}function jc(e){return(e<10?"00":e<100?"0":"")+e}const Kc={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>sn(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>sn(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>sn(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>sn(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>sn(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>jc(e.getMilliseconds())};function fo(e,t){t=t||Yc;let n=[],l=/\{([a-z]+)\}|[^{]+/gi,o;for(;o=l.exec(e);)n.push(o[0][0]=="{"?Kc[o[1]]:o[0]);return s=>{let a="";for(let d=0;de%1==0,Gn=[1,2,2.5,5],Qc=_n(10,-32,0,Gn),Hr=_n(10,0,32,Gn),Zc=Hr.filter(Rr),ul=Qc.concat(Hr),ho=` `,Nr="{YYYY}",As=ho+Nr,zr="{M}/{D}",cn=ho+zr,Ln=cn+"/{YY}",Or="{aa}",Xc="{h}:{mm}",Vl=Xc+Or,Es=ho+Vl,$s=":{ss}",ce=null;function Vr(e){let t=e*1e3,n=t*60,l=n*60,o=l*24,s=o*30,a=o*365,_=(e==1?_n(10,0,3,Gn).filter(Rr):_n(10,-3,0,Gn)).concat([t,t*5,t*10,t*15,t*30,n,n*5,n*10,n*15,n*30,l,l*2,l*3,l*4,l*6,l*8,l*12,o,o*2,o*3,o*4,o*5,o*6,o*7,o*8,o*9,o*10,o*15,s,s*2,s*3,s*4,s*6,a,a*2,a*5,a*10,a*25,a*50,a*100]);const p=[[a,Nr,ce,ce,ce,ce,ce,ce,1],[o*28,"{MMM}",As,ce,ce,ce,ce,ce,1],[o,zr,As,ce,ce,ce,ce,ce,1],[l,"{h}"+Or,Ln,ce,cn,ce,ce,ce,1],[n,Vl,Ln,ce,cn,ce,ce,ce,1],[t,$s,Ln+" "+Vl,ce,cn+" "+Vl,ce,Es,ce,1],[e,$s+".{fff}",Ln+" "+Vl,ce,cn+" "+Vl,ce,Es,ce,1]];function v(g){return(u,y,P,D,$,H)=>{let b=[],F=$>=a,S=$>=s&&$=o?o:$,W=ut(P)-ut(k),L=R+W+Zn(k-R,V);b.push(L);let Q=g(L),I=Q.getHours()+Q.getMinutes()/n+Q.getSeconds()/l,G=$/l,U=u.axes[y]._space,ee=H/U;for(;L=he(L+$,e==1?0:3),!(L>D);)if(G>1){let j=ut(he(I+G,6))%24,A=g(L).getHours()-j;A>1&&(A=-1),L-=A*l,I=(I+G)%24;let te=b[b.length-1];he((L-te)/$,3)*ee>=.7&&b.push(L)}else b.push(L)}return b}}return[_,p,v]}const[eu,tu,lu]=Vr(1),[nu,iu,ou]=Vr(.001);_n(2,-53,53,[1]);function Fs(e,t){return e.map(n=>n.map((l,o)=>o==0||o==8||l==null?l:t(o==1||n[8]==0?l:n[1]+l)))}function Rs(e,t){return(n,l,o,s,a)=>{let d=t.find(P=>a>=P[0])||t[t.length-1],_,p,v,g,u,y;return l.map(P=>{let D=e(P),$=D.getFullYear(),H=D.getMonth(),b=D.getDate(),F=D.getHours(),S=D.getMinutes(),x=D.getSeconds(),k=$!=_&&d[2]||H!=p&&d[3]||b!=v&&d[4]||F!=g&&d[5]||S!=u&&d[6]||x!=y&&d[7]||d[1];return _=$,p=H,v=b,g=F,u=S,y=x,k(D)})}}function su(e,t){let n=fo(t);return(l,o,s,a,d)=>o.map(_=>n(e(_)))}function $i(e,t,n){return new Date(e,t,n)}function Hs(e,t){return t(e)}const ru="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function Ns(e,t){return(n,l,o,s)=>s==null?oo:t(e(l))}function au(e,t){let n=e.series[t];return n.width?n.stroke(e,t):n.points.width?n.points.stroke(e,t):null}function cu(e,t){return e.series[t].fill(e,t)}const uu={show:!0,live:!0,isolate:!1,mount:Dc,markers:{show:!0,width:2,stroke:au,fill:cu,dash:"solid"},idx:null,idxs:null,values:[]};function fu(e,t){let n=e.cursor.points,l=vt(),o=n.size(e,t);we(l,rn,o),we(l,an,o);let s=o/-2;we(l,"marginLeft",s),we(l,"marginTop",s);let a=n.width(e,t,o);return a&&we(l,"borderWidth",a),l}function du(e,t){let n=e.series[t].points;return n._fill||n._stroke}function hu(e,t){let n=e.series[t].points;return n._stroke||n._fill}function pu(e,t){return e.series[t].points.size}const Fi=[0,0];function _u(e,t,n){return Fi[0]=t,Fi[1]=n,Fi}function An(e,t,n,l=!0){return o=>{o.button==0&&(!l||o.target==t)&&n(o)}}function Ri(e,t,n,l=!0){return o=>{(!l||o.target==t)&&n(o)}}const mu={show:!0,x:!0,y:!0,lock:!1,move:_u,points:{one:!1,show:fu,size:pu,width:0,stroke:hu,fill:du},bind:{mousedown:An,mouseup:An,click:An,dblclick:An,mousemove:Ri,mouseleave:Ri,mouseenter:Ri},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,n,l,o)=>l-o,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},Br={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},po=Le({},Br,{filter:Pr}),Wr=Le({},po,{size:10}),Ir=Le({},Br,{show:!1}),_o='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Ur="bold "+_o,Gr=1.5,zs={show:!0,scale:"x",stroke:io,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:Ur,side:2,grid:po,ticks:Wr,border:Ir,font:_o,lineGap:Gr,rotate:0},gu="Value",vu="Time",Os={show:!0,scale:"x",auto:!1,sorted:1,min:de,max:-de,idxs:[]};function wu(e,t,n,l,o){return t.map(s=>s==null?"":co(s))}function yu(e,t,n,l,o,s,a){let d=[],_=Zt.get(o)||0;n=a?n:he(Zn(n,o),_);for(let p=n;p<=l;p=he(p+o,_))d.push(Object.is(p,-0)?0:p);return d}function Yi(e,t,n,l,o,s,a){const d=[],_=e.scales[e.axes[t].scale].log,p=_==10?Vt:xr,v=ut(p(n));o=Il(_,v),_==10&&(o=ul[Tt(o,ul)]);let g=n,u=o*_;_==10&&(u=ul[Tt(u,ul)]);do d.push(g),g=g+o,_==10&&!Zt.has(g)&&(g=he(g,Zt.get(o))),g>=u&&(o=g,u=o*_,_==10&&(u=ul[Tt(u,ul)]));while(g<=l);return d}function bu(e,t,n,l,o,s,a){let _=e.scales[e.axes[t].scale].asinh,p=l>_?Yi(e,t,tt(_,n),l,o):[_],v=l>=0&&n<=0?[0]:[];return(n<-_?Yi(e,t,tt(_,-l),-n,o):[_]).reverse().map(u=>-u).concat(v,p)}const Yr=/./,ku=/[12357]/,Su=/[125]/,Vs=/1/,ji=(e,t,n,l)=>e.map((o,s)=>t==4&&o==0||s%l==0&&n.test(o.toExponential()[o<0?1:0])?o:null);function xu(e,t,n,l,o){let s=e.axes[n],a=s.scale,d=e.scales[a],_=e.valToPos,p=s._space,v=_(10,a),g=_(9,a)-v>=p?Yr:_(7,a)-v>=p?ku:_(5,a)-v>=p?Su:Vs;if(g==Vs){let u=Fe(_(1,a)-v);if(uo,Is={show:!0,auto:!0,sorted:0,gaps:jr,alpha:1,facets:[Le({},Ws,{scale:"x"}),Le({},Ws,{scale:"y"})]},Us={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:jr,alpha:1,points:{show:Cu,filter:null},values:null,min:de,max:-de,idxs:[],path:null,clip:null};function Du(e,t,n,l,o){return n/10}const Kr={time:ec,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},Lu=Le({},Kr,{time:!1,ori:1}),Gs={};function qr(e,t){let n=Gs[e];return n||(n={key:e,plots:[],sub(l){n.plots.push(l)},unsub(l){n.plots=n.plots.filter(o=>o!=l)},pub(l,o,s,a,d,_,p){for(let v=0;v{let H=a.pxRound;const b=p.dir*(p.ori==0?1:-1),F=p.ori==0?Kl:ql;let S,x;b==1?(S=n,x=l):(S=l,x=n);let k=H(g(d[S],p,D,y)),T=H(u(_[S],v,$,P)),R=H(g(d[x],p,D,y)),V=H(u(s==1?v.max:v.min,v,$,P)),W=new Path2D(o);return F(W,R,V),F(W,k,V),F(W,k,T),W})}function ei(e,t,n,l,o,s){let a=null;if(e.length>0){a=new Path2D;const d=t==0?ni:vo;let _=n;for(let g=0;gu[0]){let y=u[0]-_;y>0&&d(a,_,l,y,l+s),_=u[1]}}let p=n+o-_,v=10;p>0&&d(a,_,l-v/2,p,l+s+v)}return a}function Eu(e,t,n){let l=e[e.length-1];l&&l[0]==t?l[1]=n:e.push([t,n])}function go(e,t,n,l,o,s,a){let d=[],_=e.length;for(let p=o==1?n:l;p>=n&&p<=l;p+=o)if(t[p]===null){let g=p,u=p;if(o==1)for(;++p<=l&&t[p]===null;)u=p;else for(;--p>=n&&t[p]===null;)u=p;let y=s(e[g]),P=u==g?y:s(e[u]),D=g-o;y=a<=0&&D>=0&&D<_?s(e[D]):y;let H=u+o;P=a>=0&&H>=0&&H<_?s(e[H]):P,P>=y&&d.push([y,P])}return d}function Ys(e){return e==0?Tr:e==1?Ee:t=>cl(t,e)}function Jr(e){let t=e==0?ti:li,n=e==0?(o,s,a,d,_,p)=>{o.arcTo(s,a,d,_,p)}:(o,s,a,d,_,p)=>{o.arcTo(a,s,_,d,p)},l=e==0?(o,s,a,d,_)=>{o.rect(s,a,d,_)}:(o,s,a,d,_)=>{o.rect(a,s,_,d)};return(o,s,a,d,_,p=0,v=0)=>{p==0&&v==0?l(o,s,a,d,_):(p=Pt(p,d/2,_/2),v=Pt(v,d/2,_/2),t(o,s+p,a),n(o,s+d,a,s+d,a+_,p),n(o,s+d,a+_,s,a+_,v),n(o,s,a+_,s,a,v),n(o,s,a,s+d,a,p),o.closePath())}}const ti=(e,t,n)=>{e.moveTo(t,n)},li=(e,t,n)=>{e.moveTo(n,t)},Kl=(e,t,n)=>{e.lineTo(t,n)},ql=(e,t,n)=>{e.lineTo(n,t)},ni=Jr(0),vo=Jr(1),Qr=(e,t,n,l,o,s)=>{e.arc(t,n,l,o,s)},Zr=(e,t,n,l,o,s)=>{e.arc(n,t,l,o,s)},Xr=(e,t,n,l,o,s,a)=>{e.bezierCurveTo(t,n,l,o,s,a)},ea=(e,t,n,l,o,s,a)=>{e.bezierCurveTo(n,t,o,l,a,s)};function ta(e){return(t,n,l,o,s)=>gl(t,n,(a,d,_,p,v,g,u,y,P,D,$)=>{let{pxRound:H,points:b}=a,F,S;p.ori==0?(F=ti,S=Qr):(F=li,S=Zr);const x=he(b.width*ae,3);let k=(b.size-b.width)/2*ae,T=he(k*2,3),R=new Path2D,V=new Path2D,{left:W,top:L,width:Q,height:I}=t.bbox;ni(V,W-T,L-T,Q+T*2,I+T*2);const G=U=>{if(_[U]!=null){let ee=H(g(d[U],p,D,y)),j=H(u(_[U],v,$,P));F(R,ee+k,j),S(R,ee,j,k,0,zn*2)}};if(s)s.forEach(G);else for(let U=l;U<=o;U++)G(U);return{stroke:x>0?R:null,fill:R,clip:V,flags:Yl|Ki}})}function la(e){return(t,n,l,o,s,a)=>{l!=o&&(s!=l&&a!=l&&e(t,n,l),s!=o&&a!=o&&e(t,n,o),e(t,n,a))}}const $u=la(Kl),Fu=la(ql);function na(e){const t=se(e==null?void 0:e.alignGaps,0);return(n,l,o,s)=>gl(n,l,(a,d,_,p,v,g,u,y,P,D,$)=>{[o,s]=Jn(_,o,s);let H=a.pxRound,b=I=>H(g(I,p,D,y)),F=I=>H(u(I,v,$,P)),S,x;p.ori==0?(S=Kl,x=$u):(S=ql,x=Fu);const k=p.dir*(p.ori==0?1:-1),T={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Yl},R=T.stroke;let V=!1;if(s-o>=D*4){let I=Y=>n.posToVal(Y,p.key,!0),G=null,U=null,ee,j,Ie,fe=b(d[k==1?o:s]),A=b(d[o]),te=b(d[s]),J=I(k==1?A+1:te-1);for(let Y=k==1?o:s;Y>=o&&Y<=s;Y+=k){let xe=d[Y],be=(k==1?xeJ)?fe:b(xe),ie=_[Y];be==fe?ie!=null?(j=ie,G==null?(S(R,be,F(j)),ee=G=U=j):jU&&(U=j)):ie===null&&(V=!0):(G!=null&&x(R,fe,F(G),F(U),F(ee),F(j)),ie!=null?(j=ie,S(R,be,F(j)),G=U=ee=j):(G=U=null,ie===null&&(V=!0)),fe=be,J=I(fe+k))}G!=null&&G!=U&&Ie!=fe&&x(R,fe,F(G),F(U),F(ee),F(j))}else for(let I=k==1?o:s;I>=o&&I<=s;I+=k){let G=_[I];G===null?V=!0:G!=null&&S(R,b(d[I]),F(G))}let[L,Q]=mo(n,l);if(a.fill!=null||L!=0){let I=T.fill=new Path2D(R),G=a.fillTo(n,l,a.min,a.max,L),U=F(G),ee=b(d[o]),j=b(d[s]);k==-1&&([j,ee]=[ee,j]),S(I,j,U),S(I,ee,U)}if(!a.spanGaps){let I=[];V&&I.push(...go(d,_,o,s,k,b,t)),T.gaps=I=a.gaps(n,l,o,s,I),T.clip=ei(I,p.ori,y,P,D,$)}return Q!=0&&(T.band=Q==2?[Bt(n,l,o,s,R,-1),Bt(n,l,o,s,R,1)]:Bt(n,l,o,s,R,Q)),T})}function Ru(e){const t=se(e.align,1),n=se(e.ascDesc,!1),l=se(e.alignGaps,0),o=se(e.extend,!1);return(s,a,d,_)=>gl(s,a,(p,v,g,u,y,P,D,$,H,b,F)=>{[d,_]=Jn(g,d,_);let S=p.pxRound,{left:x,width:k}=s.bbox,T=A=>S(P(A,u,b,$)),R=A=>S(D(A,y,F,H)),V=u.ori==0?Kl:ql;const W={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:Yl},L=W.stroke,Q=u.dir*(u.ori==0?1:-1);let I=R(g[Q==1?d:_]),G=T(v[Q==1?d:_]),U=G,ee=G;o&&t==-1&&(ee=x,V(L,ee,I)),V(L,G,I);for(let A=Q==1?d:_;A>=d&&A<=_;A+=Q){let te=g[A];if(te==null)continue;let J=T(v[A]),Y=R(te);t==1?V(L,J,I):V(L,U,Y),V(L,J,Y),I=Y,U=J}let j=U;o&&t==1&&(j=x+k,V(L,j,I));let[Ie,fe]=mo(s,a);if(p.fill!=null||Ie!=0){let A=W.fill=new Path2D(L),te=p.fillTo(s,a,p.min,p.max,Ie),J=R(te);V(A,j,J),V(A,ee,J)}if(!p.spanGaps){let A=[];A.push(...go(v,g,d,_,Q,T,l));let te=p.width*ae/2,J=n||t==1?te:-te,Y=n||t==-1?-te:te;A.forEach(xe=>{xe[0]+=J,xe[1]+=Y}),W.gaps=A=p.gaps(s,a,d,_,A),W.clip=ei(A,u.ori,$,H,b,F)}return fe!=0&&(W.band=fe==2?[Bt(s,a,d,_,L,-1),Bt(s,a,d,_,L,1)]:Bt(s,a,d,_,L,fe)),W})}function js(e,t,n,l,o,s,a=de){if(e.length>1){let d=null;for(let _=0,p=1/0;_{}),{fill:g,stroke:u}=p;return(y,P,D,$)=>gl(y,P,(H,b,F,S,x,k,T,R,V,W,L)=>{let Q=H.pxRound,I=n,G=l*ae,U=d*ae,ee=_*ae,j,Ie;S.ori==0?[j,Ie]=s(y,P):[Ie,j]=s(y,P);const fe=S.dir*(S.ori==0?1:-1);let A=S.ori==0?ni:vo,te=S.ori==0?v:(O,_e,Ae,bl,tl,Dt,ll)=>{v(O,_e,Ae,tl,bl,ll,Dt)},J=se(y.bands,uo).find(O=>O.series[0]==P),Y=J!=null?J.dir:0,xe=H.fillTo(y,P,H.min,H.max,Y),Ke=Q(T(xe,x,L,V)),be,ie,yt,it=W,Se=Q(H.width*ae),Ct=!1,Ht=null,dt=null,It=null,vl=null;g!=null&&(Se==0||u!=null)&&(Ct=!0,Ht=g.values(y,P,D,$),dt=new Map,new Set(Ht).forEach(O=>{O!=null&&dt.set(O,new Path2D)}),Se>0&&(It=u.values(y,P,D,$),vl=new Map,new Set(It).forEach(O=>{O!=null&&vl.set(O,new Path2D)})));let{x0:wl,size:Jl}=p;if(wl!=null&&Jl!=null){I=1,b=wl.values(y,P,D,$),wl.unit==2&&(b=b.map(Ae=>y.posToVal(R+Ae*W,S.key,!0)));let O=Jl.values(y,P,D,$);Jl.unit==2?ie=O[0]*W:ie=k(O[0],S,W,R)-k(0,S,W,R),it=js(b,F,k,S,W,R,it),yt=it-ie+G}else it=js(b,F,k,S,W,R,it),yt=it*a+G,ie=it-yt;yt<1&&(yt=0),Se>=ie/2&&(Se=0),yt<5&&(Q=Tr);let gn=yt>0,Xt=it-yt-(gn?Se:0);ie=Q(Gi(Xt,ee,U)),be=(I==0?ie/2:I==fe?0:ie)-I*fe*((I==0?G/2:0)+(gn?Se/2:0));const qe={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},yl=Ct?null:new Path2D;let Nt=null;if(J!=null)Nt=y.data[J.series[1]];else{let{y0:O,y1:_e}=p;O!=null&&_e!=null&&(F=_e.values(y,P,D,$),Nt=O.values(y,P,D,$))}let el=j*ie,X=Ie*ie;for(let O=fe==1?D:$;O>=D&&O<=$;O+=fe){let _e=F[O];if(_e==null)continue;if(Nt!=null){let lt=Nt[O]??0;if(_e-lt==0)continue;Ke=T(lt,x,L,V)}let Ae=S.distr!=2||p!=null?b[O]:O,bl=k(Ae,S,W,R),tl=T(se(_e,xe),x,L,V),Dt=Q(bl-be),ll=Q(tt(tl,Ke)),ot=Q(Pt(tl,Ke)),ht=ll-ot;if(_e!=null){let lt=_e<0?X:el,bt=_e<0?el:X;Ct?(Se>0&&It[O]!=null&&A(vl.get(It[O]),Dt,ot+ut(Se/2),ie,tt(0,ht-Se),lt,bt),Ht[O]!=null&&A(dt.get(Ht[O]),Dt,ot+ut(Se/2),ie,tt(0,ht-Se),lt,bt)):A(yl,Dt,ot+ut(Se/2),ie,tt(0,ht-Se),lt,bt),te(y,P,O,Dt-Se/2,ot,ie+Se,ht)}}return Se>0?qe.stroke=Ct?vl:yl:Ct||(qe._fill=H.width==0?H._fill:H._stroke??H._fill,qe.width=0),qe.fill=Ct?dt:yl,qe})}function Nu(e,t){const n=se(t==null?void 0:t.alignGaps,0);return(l,o,s,a)=>gl(l,o,(d,_,p,v,g,u,y,P,D,$,H)=>{[s,a]=Jn(p,s,a);let b=d.pxRound,F=j=>b(u(j,v,$,P)),S=j=>b(y(j,g,H,D)),x,k,T;v.ori==0?(x=ti,T=Kl,k=Xr):(x=li,T=ql,k=ea);const R=v.dir*(v.ori==0?1:-1);let V=F(_[R==1?s:a]),W=V,L=[],Q=[];for(let j=R==1?s:a;j>=s&&j<=a;j+=R)if(p[j]!=null){let fe=_[j],A=F(fe);L.push(W=A),Q.push(S(p[j]))}const I={stroke:e(L,Q,x,T,k,b),fill:null,clip:null,band:null,gaps:null,flags:Yl},G=I.stroke;let[U,ee]=mo(l,o);if(d.fill!=null||U!=0){let j=I.fill=new Path2D(G),Ie=d.fillTo(l,o,d.min,d.max,U),fe=S(Ie);T(j,W,fe),T(j,V,fe)}if(!d.spanGaps){let j=[];j.push(...go(_,p,s,a,R,F,n)),I.gaps=j=d.gaps(l,o,s,a,j),I.clip=ei(j,v.ori,P,D,$,H)}return ee!=0&&(I.band=ee==2?[Bt(l,o,s,a,G,-1),Bt(l,o,s,a,G,1)]:Bt(l,o,s,a,G,ee)),I})}function zu(e){return Nu(Ou,e)}function Ou(e,t,n,l,o,s){const a=e.length;if(a<2)return null;const d=new Path2D;if(n(d,e[0],t[0]),a==2)l(d,e[1],t[1]);else{let _=Array(a),p=Array(a-1),v=Array(a-1),g=Array(a-1);for(let u=0;u0!=p[u]>0?_[u]=0:(_[u]=3*(g[u-1]+g[u])/((2*g[u]+g[u-1])/p[u-1]+(g[u]+2*g[u-1])/p[u]),isFinite(_[u])||(_[u]=0));_[a-1]=p[a-2];for(let u=0;u{Ye.pxRatio=ae}));const Vu=na(),Bu=ta();function qs(e,t,n,l){return(l?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((s,a)=>Ji(s,a,t,n))}function Wu(e,t){return e.map((n,l)=>l==0?{}:Le({},t,n))}function Ji(e,t,n,l){return Le({},t==0?n:l,e)}function ia(e,t,n){return t==null?Ul:[t,n]}const Iu=ia;function Uu(e,t,n){return t==null?Ul:Un(t,n,ao,!0)}function oa(e,t,n,l){return t==null?Ul:Qn(t,n,e.scales[l].log,!1)}const Gu=oa;function sa(e,t,n,l){return t==null?Ul:ro(t,n,e.scales[l].log,!1)}const Yu=sa;function ju(e,t,n,l,o){let s=tt(Ps(e),Ps(t)),a=t-e,d=Tt(o/l*a,n);do{let _=n[d],p=l*_/a;if(p>=o&&s+(_<5?Zt.get(_):0)<=17)return[_,p]}while(++d(t=Ee((n=+o)*ae))+"px"),[e,t,n]}function Ku(e){e.show&&[e.font,e.labelFont].forEach(t=>{let n=he(t[2]*ae,1);t[0]=t[0].replace(/[0-9.]+px/,n+"px"),t[1]=n})}function Ye(e,t,n){const l={mode:se(e.mode,1)},o=l.mode;function s(i,r,f,h){let m=r.valToPct(i);return h+f*(r.dir==-1?1-m:m)}function a(i,r,f,h){let m=r.valToPct(i);return h+f*(r.dir==-1?m:1-m)}function d(i,r,f,h){return r.ori==0?s(i,r,f,h):a(i,r,f,h)}l.valToPosH=s,l.valToPosV=a;let _=!1;l.status=0;const p=l.root=vt(tc);if(e.id!=null&&(p.id=e.id),ct(p,e.class),e.title){let i=vt(ic,p);i.textContent=e.title}const v=Mt("canvas"),g=l.ctx=v.getContext("2d"),u=vt(oc,p);pl("click",u,i=>{i.target===P&&(me!=El||ke!=$l)&&Ge.click(l,i)},!0);const y=l.under=vt(sc,u);u.appendChild(v);const P=l.over=vt(rc,u);e=Gl(e);const D=+se(e.pxAlign,1),$=Ys(D);(e.plugins||[]).forEach(i=>{i.opts&&(e=i.opts(l,e)||e)});const H=e.ms||.001,b=l.series=o==1?qs(e.series||[],Os,Us,!1):Wu(e.series||[null],Is),F=l.axes=qs(e.axes||[],zs,Bs,!0),S=l.scales={},x=l.bands=e.bands||[];x.forEach(i=>{i.fill=ne(i.fill||null),i.dir=se(i.dir,-1)});const k=o==2?b[1].facets[0].scale:b[0].scale,T={axes:ka,series:ga},R=(e.drawOrder||["axes","series"]).map(i=>T[i]);function V(i){const r=i.distr==3?f=>Vt(f>0?f:i.clamp(l,f,i.min,i.max,i.key)):i.distr==4?f=>Ei(f,i.asinh):i.distr==100?f=>i.fwd(f):f=>f;return f=>{let h=r(f),{_min:m,_max:w}=i,M=w-m;return(h-m)/M}}function W(i){let r=S[i];if(r==null){let f=(e.scales||hn)[i]||hn;if(f.from!=null){W(f.from);let h=Le({},S[f.from],f,{key:i});h.valToPct=V(h),S[i]=h}else{r=S[i]=Le({},i==k?Kr:Lu,f),r.key=i;let h=r.time,m=r.range,w=Jt(m);if((i!=k||o==2&&!h)&&(w&&(m[0]==null||m[1]==null)&&(m={min:m[0]==null?xs:{mode:1,hard:m[0],soft:m[0]},max:m[1]==null?xs:{mode:1,hard:m[1],soft:m[1]}},w=!1),!w&&Xn(m))){let M=m;m=(C,E,N)=>E==null?Ul:Un(E,N,M)}r.range=ne(m||(h?Iu:i==k?r.distr==3?Gu:r.distr==4?Yu:ia:r.distr==3?oa:r.distr==4?sa:Uu)),r.auto=ne(w?!1:r.auto),r.clamp=ne(r.clamp||Du),r._min=r._max=null,r.valToPct=V(r)}}}W("x"),W("y"),o==1&&b.forEach(i=>{W(i.scale)}),F.forEach(i=>{W(i.scale)});for(let i in e.scales)W(i);const L=S[k],Q=L.distr;let I,G;L.ori==0?(ct(p,lc),I=s,G=a):(ct(p,nc),I=a,G=s);const U={};for(let i in S){let r=S[i];(r.min!=null||r.max!=null)&&(U[i]={min:r.min,max:r.max},r.min=r.max=null)}const ee=e.tzDate||(i=>new Date(Ee(i/H))),j=e.fmtDate||fo,Ie=H==1?lu(ee):ou(ee),fe=Rs(ee,Fs(H==1?tu:iu,j)),A=Ns(ee,Hs(ru,j)),te=[],J=l.legend=Le({},uu,e.legend),Y=l.cursor=Le({},mu,{drag:{y:o==2}},e.cursor),xe=J.show,Ke=Y.show,be=J.markers;J.idxs=te,be.width=ne(be.width),be.dash=ne(be.dash),be.stroke=ne(be.stroke),be.fill=ne(be.fill);let ie,yt,it,Se=[],Ct=[],Ht,dt=!1,It={};if(J.live){const i=b[1]?b[1].values:null;dt=i!=null,Ht=dt?i(l,1,0):{_:0};for(let r in Ht)It[r]=oo}if(xe)if(ie=Mt("table",hc,p),it=Mt("tbody",null,ie),J.mount(l,ie),dt){yt=Mt("thead",null,ie,it);let i=Mt("tr",null,yt);Mt("th",null,i);for(var vl in Ht)Mt("th",fs,i).textContent=vl}else ct(ie,_c),J.live&&ct(ie,pc);const wl={show:!0},Jl={show:!1};function gn(i,r){if(r==0&&(dt||!J.live||o==2))return Ul;let f=[],h=Mt("tr",mc,it,it.childNodes[r]);ct(h,i.class),i.show||ct(h,fl);let m=Mt("th",null,h);if(be.show){let C=vt(gc,m);if(r>0){let E=be.width(l,r);E&&(C.style.border=E+"px "+be.dash(l,r)+" "+be.stroke(l,r)),C.style.background=be.fill(l,r)}}let w=vt(fs,m);i.label instanceof HTMLElement?w.appendChild(i.label):w.textContent=i.label,r>0&&(be.show||(w.style.color=i.width>0?be.stroke(l,r):be.fill(l,r)),qe("click",m,C=>{if(Y._lock)return;il(C);let E=b.indexOf(i);if((C.ctrlKey||C.metaKey)!=J.isolate){let N=b.some((z,B)=>B>0&&B!=E&&z.show);b.forEach((z,B)=>{B>0&&At(B,N?B==E?wl:Jl:wl,!0,Ce.setSeries)})}else At(E,{show:!i.show},!0,Ce.setSeries)},!1),Sl&&qe(_s,m,C=>{Y._lock||(il(C),At(b.indexOf(i),Rl,!0,Ce.setSeries))},!1));for(var M in Ht){let C=Mt("td",vc,h);C.textContent="--",f.push(C)}return[h,f]}const Xt=new Map;function qe(i,r,f,h=!0){const m=Xt.get(r)||{},w=Y.bind[i](l,r,f,h);w&&(pl(i,r,m[i]=w),Xt.set(r,m))}function yl(i,r,f){const h=Xt.get(r)||{};for(let m in h)(i==null||m==i)&&(Ui(m,r,h[m]),delete h[m]);i==null&&Xt.delete(r)}let Nt=0,el=0,X=0,O=0,_e=0,Ae=0,bl=_e,tl=Ae,Dt=X,ll=O,ot=0,ht=0,lt=0,bt=0;l.bbox={};let ii=!1,vn=!1,kl=!1,nl=!1,wn=!1,pt=!1;function oi(i,r,f){(f||i!=l.width||r!=l.height)&&yo(i,r),Cl(!1),kl=!0,vn=!0,Dl()}function yo(i,r){l.width=Nt=X=i,l.height=el=O=r,_e=Ae=0,ua(),fa();let f=l.bbox;ot=f.left=cl(_e*ae,.5),ht=f.top=cl(Ae*ae,.5),lt=f.width=cl(X*ae,.5),bt=f.height=cl(O*ae,.5)}const ra=3;function aa(){let i=!1,r=0;for(;!i;){r++;let f=ya(r),h=ba(r);i=r==ra||f&&h,i||(yo(l.width,l.height),vn=!0)}}function ca({width:i,height:r}){oi(i,r)}l.setSize=ca;function ua(){let i=!1,r=!1,f=!1,h=!1;F.forEach((m,w)=>{if(m.show&&m._show){let{side:M,_size:C}=m,E=M%2,N=m.label!=null?m.labelSize:0,z=C+N;z>0&&(E?(X-=z,M==3?(_e+=z,h=!0):f=!0):(O-=z,M==0?(Ae+=z,i=!0):r=!0))}}),ol[0]=i,ol[1]=f,ol[2]=r,ol[3]=h,X-=Ut[1]+Ut[3],_e+=Ut[3],O-=Ut[2]+Ut[0],Ae+=Ut[0]}function fa(){let i=_e+X,r=Ae+O,f=_e,h=Ae;function m(w,M){switch(w){case 1:return i+=M,i-M;case 2:return r+=M,r-M;case 3:return f-=M,f+M;case 0:return h-=M,h+M}}F.forEach((w,M)=>{if(w.show&&w._show){let C=w.side;w._pos=m(C,w._size),w.label!=null&&(w._lpos=m(C,w.labelSize))}})}if(Y.dataIdx==null){let i=Y.hover,r=i.skip=new Set(i.skip??[]);r.add(void 0);let f=i.prox=ne(i.prox),h=i.bias??(i.bias=0);Y.dataIdx=(m,w,M,C)=>{if(w==0)return M;let E=M,N=f(m,w,M,C)??de,z=N>=0&&N0;)r.has(oe[K])||(le=K);if(h==0||h==1)for(K=M;q==null&&K++N&&(E=null);return E}}const il=i=>{Y.event=i};Y.idxs=te,Y._lock=!1;let je=Y.points;je.show=ne(je.show),je.size=ne(je.size),je.stroke=ne(je.stroke),je.width=ne(je.width),je.fill=ne(je.fill);const Lt=l.focus=Le({},e.focus||{alpha:.3},Y.focus),Sl=Lt.prox>=0,xl=Sl&&je.one;let _t=[],Ml=[],Tl=[];function bo(i,r){let f=je.show(l,r);if(f instanceof HTMLElement)return ct(f,dc),ct(f,i.class),Rt(f,-10,-10,X,O),P.insertBefore(f,_t[r]),f}function ko(i,r){if(o==1||r>0){let f=o==1&&S[i.scale].time,h=i.value;i.value=f?Ls(h)?Ns(ee,Hs(h,j)):h||A:h||Tu,i.label=i.label||(f?vu:gu)}if(xl||r>0){i.width=i.width==null?1:i.width,i.paths=i.paths||Vu||Lc,i.fillTo=ne(i.fillTo||Au),i.pxAlign=+se(i.pxAlign,D),i.pxRound=Ys(i.pxAlign),i.stroke=ne(i.stroke||null),i.fill=ne(i.fill||null),i._stroke=i._fill=i._paths=i._focus=null;let f=Pu(tt(1,i.width),1),h=i.points=Le({},{size:f,width:tt(1,f*.2),stroke:i.stroke,space:f*2,paths:Bu,_stroke:null,_fill:null},i.points);h.show=ne(h.show),h.filter=ne(h.filter),h.fill=ne(h.fill),h.stroke=ne(h.stroke),h.paths=ne(h.paths),h.pxAlign=i.pxAlign}if(xe){let f=gn(i,r);Se.splice(r,0,f[0]),Ct.splice(r,0,f[1]),J.values.push(null)}if(Ke){te.splice(r,0,null);let f=null;xl?r==0&&(f=bo(i,r)):r>0&&(f=bo(i,r)),_t.splice(r,0,f),Ml.splice(r,0,0),Tl.splice(r,0,0)}Be("addSeries",r)}function da(i,r){r=r??b.length,i=o==1?Ji(i,r,Os,Us):Ji(i,r,{},Is),b.splice(r,0,i),ko(b[r],r)}l.addSeries=da;function ha(i){if(b.splice(i,1),xe){J.values.splice(i,1),Ct.splice(i,1);let r=Se.splice(i,1)[0];yl(null,r.firstChild),r.remove()}Ke&&(te.splice(i,1),_t.splice(i,1)[0].remove(),Ml.splice(i,1),Tl.splice(i,1)),Be("delSeries",i)}l.delSeries=ha;const ol=[!1,!1,!1,!1];function pa(i,r){if(i._show=i.show,i.show){let f=i.side%2,h=S[i.scale];h==null&&(i.scale=f?b[1].scale:k,h=S[i.scale]);let m=h.time;i.size=ne(i.size),i.space=ne(i.space),i.rotate=ne(i.rotate),Jt(i.incrs)&&i.incrs.forEach(M=>{!Zt.has(M)&&Zt.set(M,Dr(M))}),i.incrs=ne(i.incrs||(h.distr==2?Zc:m?H==1?eu:nu:ul)),i.splits=ne(i.splits||(m&&h.distr==1?Ie:h.distr==3?Yi:h.distr==4?bu:yu)),i.stroke=ne(i.stroke),i.grid.stroke=ne(i.grid.stroke),i.ticks.stroke=ne(i.ticks.stroke),i.border.stroke=ne(i.border.stroke);let w=i.values;i.values=Jt(w)&&!Jt(w[0])?ne(w):m?Jt(w)?Rs(ee,Fs(w,j)):Ls(w)?su(ee,w):w||fe:w||wu,i.filter=ne(i.filter||(h.distr>=3&&h.log==10?xu:h.distr==3&&h.log==2?Mu:Pr)),i.font=Js(i.font),i.labelFont=Js(i.labelFont),i._size=i.size(l,null,r,0),i._space=i._rotate=i._incrs=i._found=i._splits=i._values=null,i._size>0&&(ol[r]=!0,i._el=vt(ac,u))}}function Ql(i,r,f,h){let[m,w,M,C]=f,E=r%2,N=0;return E==0&&(C||w)&&(N=r==0&&!m||r==2&&!M?Ee(zs.size/3):0),E==1&&(m||M)&&(N=r==1&&!w||r==3&&!C?Ee(Bs.size/2):0),N}const So=l.padding=(e.padding||[Ql,Ql,Ql,Ql]).map(i=>ne(se(i,Ql))),Ut=l._padding=So.map((i,r)=>i(l,r,ol,0));let Ue,Ne=null,ze=null;const yn=o==1?b[0].idxs:null;let kt=null,Zl=!1;function xo(i,r){if(t=i??[],l.data=l._data=t,o==2){Ue=0;for(let f=1;f=0,pt=!0,Dl()}}l.setData=xo;function si(){Zl=!0;let i,r;o==1&&(Ue>0?(Ne=yn[0]=0,ze=yn[1]=Ue-1,i=t[0][Ne],r=t[0][ze],Q==2?(i=Ne,r=ze):i==r&&(Q==3?[i,r]=Qn(i,i,L.log,!1):Q==4?[i,r]=ro(i,i,L.log,!1):L.time?r=i+Ee(86400/H):[i,r]=Un(i,r,ao,!0))):(Ne=yn[0]=i=null,ze=yn[1]=r=null)),Yt(k,i,r)}let bn,Pl,ri,ai,ci,ui,fi,di,hi,nt;function Mo(i,r,f,h,m,w){i??(i=hs),f??(f=uo),h??(h="butt"),m??(m=hs),w??(w="round"),i!=bn&&(g.strokeStyle=bn=i),m!=Pl&&(g.fillStyle=Pl=m),r!=ri&&(g.lineWidth=ri=r),w!=ci&&(g.lineJoin=ci=w),h!=ui&&(g.lineCap=ui=h),f!=ai&&g.setLineDash(ai=f)}function To(i,r,f,h){r!=Pl&&(g.fillStyle=Pl=r),i!=fi&&(g.font=fi=i),f!=di&&(g.textAlign=di=f),h!=hi&&(g.textBaseline=hi=h)}function pi(i,r,f,h,m=0){if(h.length>0&&i.auto(l,Zl)&&(r==null||r.min==null)){let w=se(Ne,0),M=se(ze,h.length-1),C=f.min==null?xc(h,w,M,m,i.distr==3):[f.min,f.max];i.min=Pt(i.min,f.min=C[0]),i.max=tt(i.max,f.max=C[1])}}const Po={min:null,max:null};function _a(){for(let h in S){let m=S[h];U[h]==null&&(m.min==null||U[k]!=null&&m.auto(l,Zl))&&(U[h]=Po)}for(let h in S){let m=S[h];U[h]==null&&m.from!=null&&U[m.from]!=null&&(U[h]=Po)}U[k]!=null&&Cl(!0);let i={};for(let h in U){let m=U[h];if(m!=null){let w=i[h]=Gl(S[h],$c);if(m.min!=null)Le(w,m);else if(h!=k||o==2)if(Ue==0&&w.from==null){let M=w.range(l,null,null,h);w.min=M[0],w.max=M[1]}else w.min=de,w.max=-de}}if(Ue>0){b.forEach((h,m)=>{if(o==1){let w=h.scale,M=U[w];if(M==null)return;let C=i[w];if(m==0){let E=C.range(l,C.min,C.max,w);C.min=E[0],C.max=E[1],Ne=Tt(C.min,t[0]),ze=Tt(C.max,t[0]),ze-Ne>1&&(t[0][Ne]C.max&&ze--),h.min=kt[Ne],h.max=kt[ze]}else h.show&&h.auto&&pi(C,M,h,t[m],h.sorted);h.idxs[0]=Ne,h.idxs[1]=ze}else if(m>0&&h.show&&h.auto){let[w,M]=h.facets,C=w.scale,E=M.scale,[N,z]=t[m],B=i[C],Z=i[E];B!=null&&pi(B,U[C],w,N,w.sorted),Z!=null&&pi(Z,U[E],M,z,M.sorted),h.min=M.min,h.max=M.max}});for(let h in i){let m=i[h],w=U[h];if(m.from==null&&(w==null||w.min==null)){let M=m.range(l,m.min==de?null:m.min,m.max==-de?null:m.max,h);m.min=M[0],m.max=M[1]}}}for(let h in i){let m=i[h];if(m.from!=null){let w=i[m.from];if(w.min==null)m.min=m.max=null;else{let M=m.range(l,w.min,w.max,h);m.min=M[0],m.max=M[1]}}}let r={},f=!1;for(let h in i){let m=i[h],w=S[h];if(w.min!=m.min||w.max!=m.max){w.min=m.min,w.max=m.max;let M=w.distr;w._min=M==3?Vt(w.min):M==4?Ei(w.min,w.asinh):M==100?w.fwd(w.min):w.min,w._max=M==3?Vt(w.max):M==4?Ei(w.max,w.asinh):M==100?w.fwd(w.max):w.max,r[h]=f=!0}}if(f){b.forEach((h,m)=>{o==2?m>0&&r.y&&(h._paths=null):r[h.scale]&&(h._paths=null)});for(let h in r)kl=!0,Be("setScale",h);Ke&&Y.left>=0&&(nl=pt=!0)}for(let h in U)U[h]=null}function ma(i){let r=Gi(Ne-1,0,Ue-1),f=Gi(ze+1,0,Ue-1);for(;i[r]==null&&r>0;)r--;for(;i[f]==null&&f0){let i=b.some(r=>r._focus)&&nt!=Lt.alpha;i&&(g.globalAlpha=nt=Lt.alpha),b.forEach((r,f)=>{if(f>0&&r.show&&(Co(f,!1),Co(f,!0),r._paths==null)){let h=nt;nt!=r.alpha&&(g.globalAlpha=nt=r.alpha);let m=o==2?[0,t[f][0].length-1]:ma(t[f]);r._paths=r.paths(l,f,m[0],m[1]),nt!=h&&(g.globalAlpha=nt=h)}}),b.forEach((r,f)=>{if(f>0&&r.show){let h=nt;nt!=r.alpha&&(g.globalAlpha=nt=r.alpha),r._paths!=null&&Do(f,!1);{let m=r._paths!=null?r._paths.gaps:null,w=r.points.show(l,f,Ne,ze,m),M=r.points.filter(l,f,w,m);(w||M)&&(r.points._paths=r.points.paths(l,f,Ne,ze,M),Do(f,!0))}nt!=h&&(g.globalAlpha=nt=h),Be("drawSeries",f)}}),i&&(g.globalAlpha=nt=1)}}function Co(i,r){let f=r?b[i].points:b[i];f._stroke=f.stroke(l,i),f._fill=f.fill(l,i)}function Do(i,r){let f=r?b[i].points:b[i],{stroke:h,fill:m,clip:w,flags:M,_stroke:C=f._stroke,_fill:E=f._fill,_width:N=f.width}=f._paths;N=he(N*ae,3);let z=null,B=N%2/2;r&&E==null&&(E=N>0?"#fff":C);let Z=f.pxAlign==1&&B>0;if(Z&&g.translate(B,B),!r){let re=ot-N/2,oe=ht-N/2,le=lt+N,q=bt+N;z=new Path2D,z.rect(re,oe,le,q)}r?_i(C,N,f.dash,f.cap,E,h,m,M,w):va(i,C,N,f.dash,f.cap,E,h,m,M,z,w),Z&&g.translate(-B,-B)}function va(i,r,f,h,m,w,M,C,E,N,z){let B=!1;E!=0&&x.forEach((Z,re)=>{if(Z.series[0]==i){let oe=b[Z.series[1]],le=t[Z.series[1]],q=(oe._paths||hn).band;Jt(q)&&(q=Z.dir==1?q[0]:q[1]);let K,ve=null;oe.show&&q&&Tc(le,Ne,ze)?(ve=Z.fill(l,re)||w,K=oe._paths.clip):q=null,_i(r,f,h,m,ve,M,C,E,N,z,K,q),B=!0}}),B||_i(r,f,h,m,w,M,C,E,N,z)}const Lo=Yl|Ki;function _i(i,r,f,h,m,w,M,C,E,N,z,B){Mo(i,r,f,h,m),(E||N||B)&&(g.save(),E&&g.clip(E),N&&g.clip(N)),B?(C&Lo)==Lo?(g.clip(B),z&&g.clip(z),Sn(m,M),kn(i,w,r)):C&Ki?(Sn(m,M),g.clip(B),kn(i,w,r)):C&Yl&&(g.save(),g.clip(B),z&&g.clip(z),Sn(m,M),g.restore(),kn(i,w,r)):(Sn(m,M),kn(i,w,r)),(E||N||B)&&g.restore()}function kn(i,r,f){f>0&&(r instanceof Map?r.forEach((h,m)=>{g.strokeStyle=bn=m,g.stroke(h)}):r!=null&&i&&g.stroke(r))}function Sn(i,r){r instanceof Map?r.forEach((f,h)=>{g.fillStyle=Pl=h,g.fill(f)}):r!=null&&i&&g.fill(r)}function wa(i,r,f,h){let m=F[i],w;if(h<=0)w=[0,0];else{let M=m._space=m.space(l,i,r,f,h),C=m._incrs=m.incrs(l,i,r,f,h,M);w=ju(r,f,C,h,M)}return m._found=w}function mi(i,r,f,h,m,w,M,C,E,N){let z=M%2/2;D==1&&g.translate(z,z),Mo(C,M,E,N,C),g.beginPath();let B,Z,re,oe,le=m+(h==0||h==3?-w:w);f==0?(Z=m,oe=le):(B=m,re=le);for(let q=0;q{if(!f.show)return;let m=S[f.scale];if(m.min==null){f._show&&(r=!1,f._show=!1,Cl(!1));return}else f._show||(r=!1,f._show=!0,Cl(!1));let w=f.side,M=w%2,{min:C,max:E}=m,[N,z]=wa(h,C,E,M==0?X:O);if(z==0)return;let B=m.distr==2,Z=f._splits=f.splits(l,h,C,E,N,z,B),re=m.distr==2?Z.map(K=>kt[K]):Z,oe=m.distr==2?kt[Z[1]]-kt[Z[0]]:N,le=f._values=f.values(l,f.filter(l,re,h,z,oe),h,z,oe);f._rotate=w==2?f.rotate(l,le,h,z):0;let q=f._size;f._size=wt(f.size(l,le,h,i)),q!=null&&f._size!=q&&(r=!1)}),r}function ba(i){let r=!0;return So.forEach((f,h)=>{let m=f(l,h,ol,i);m!=Ut[h]&&(r=!1),Ut[h]=m}),r}function ka(){for(let i=0;ikt[Qe]):re,le=z.distr==2?kt[re[1]]-kt[re[0]]:E,q=r.ticks,K=r.border,ve=q.show?q.size:0,Me=Ee(ve*ae),We=Ee((r.alignTo==2?r._size-ve-r.gap:r.gap)*ae),ue=r._rotate*-zn/180,Te=$(r._pos*ae),st=(Me+We)*C,Je=Te+st;w=h==0?Je:0,m=h==1?Je:0;let mt=r.font[0],St=r.align==1?zl:r.align==2?Di:ue>0?zl:ue<0?Di:h==0?"center":f==3?Di:zl,$t=ue||h==1?"middle":f==2?on:ds;To(mt,M,St,$t);let rt=r.font[1]*r.lineGap,gt=re.map(Qe=>$(d(Qe,z,B,Z))),xt=r._values;for(let Qe=0;Qe{f>0&&(r._paths=null,i&&(o==1?(r.min=null,r.max=null):r.facets.forEach(h=>{h.min=null,h.max=null})))})}let xn=!1,gi=!1,Xl=[];function Sa(){gi=!1;for(let i=0;i0&&queueMicrotask(Sa)}l.batch=xa;function Ao(){if(ii&&(_a(),ii=!1),kl&&(aa(),kl=!1),vn){if(we(y,zl,_e),we(y,on,Ae),we(y,rn,X),we(y,an,O),we(P,zl,_e),we(P,on,Ae),we(P,rn,X),we(P,an,O),we(u,rn,Nt),we(u,an,el),v.width=Ee(Nt*ae),v.height=Ee(el*ae),F.forEach(({_el:i,_show:r,_size:f,_pos:h,side:m})=>{if(i!=null)if(r){let w=m===3||m===0?f:0,M=m%2==1;we(i,M?"left":"top",h-w),we(i,M?"width":"height",f),we(i,M?"top":"left",M?Ae:_e),we(i,M?"height":"width",M?O:X),Ii(i,fl)}else ct(i,fl)}),bn=Pl=ri=ci=ui=fi=di=hi=ai=null,nt=1,ln(!0),_e!=bl||Ae!=tl||X!=Dt||O!=ll){Cl(!1);let i=X/Dt,r=O/ll;if(Ke&&!nl&&Y.left>=0){Y.left*=i,Y.top*=r,Ll&&Rt(Ll,Ee(Y.left),0,X,O),Al&&Rt(Al,0,Ee(Y.top),X,O);for(let f=0;f<_t.length;f++){let h=_t[f];h!=null&&(Ml[f]*=i,Tl[f]*=r,Rt(h,wt(Ml[f]),wt(Tl[f]),X,O))}}if(ge.show&&!wn&&ge.left>=0&&ge.width>0){ge.left*=i,ge.width*=i,ge.top*=r,ge.height*=r;for(let f in Si)we(Fl,f,ge[f])}bl=_e,tl=Ae,Dt=X,ll=O}Be("setSize"),vn=!1}Nt>0&&el>0&&(g.clearRect(0,0,v.width,v.height),Be("drawClear"),R.forEach(i=>i()),Be("draw")),ge.show&&wn&&(Mn(ge),wn=!1),Ke&&nl&&(rl(null,!0,!1),nl=!1),J.show&&J.live&&pt&&(bi(),pt=!1),_||(_=!0,l.status=1,Be("ready")),Zl=!1,xn=!1}l.redraw=(i,r)=>{kl=r||!1,i!==!1?Yt(k,L.min,L.max):Dl()};function vi(i,r){let f=S[i];if(f.from==null){if(Ue==0){let h=f.range(l,r.min,r.max,i);r.min=h[0],r.max=h[1]}if(r.min>r.max){let h=r.min;r.min=r.max,r.max=h}if(Ue>1&&r.min!=null&&r.max!=null&&r.max-r.min<1e-16)return;i==k&&f.distr==2&&Ue>0&&(r.min=Tt(r.min,t[0]),r.max=Tt(r.max,t[0]),r.min==r.max&&r.max++),U[i]=r,ii=!0,Dl()}}l.setScale=vi;let wi,yi,Ll,Al,Eo,$o,El,$l,Fo,Ro,me,ke,Gt=!1;const Ge=Y.drag;let Oe=Ge.x,Ve=Ge.y;Ke&&(Y.x&&(wi=vt(uc,P)),Y.y&&(yi=vt(fc,P)),L.ori==0?(Ll=wi,Al=yi):(Ll=yi,Al=wi),me=Y.left,ke=Y.top);const ge=l.select=Le({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Fl=ge.show?vt(cc,ge.over?P:y):null;function Mn(i,r){if(ge.show){for(let f in i)ge[f]=i[f],f in Si&&we(Fl,f,i[f]);r!==!1&&Be("setSelect")}}l.setSelect=Mn;function Ma(i){if(b[i].show)xe&&Ii(Se[i],fl);else if(xe&&ct(Se[i],fl),Ke){let f=xl?_t[0]:_t[i];f!=null&&Rt(f,-10,-10,X,O)}}function Yt(i,r,f){vi(i,{min:r,max:f})}function At(i,r,f,h){r.focus!=null&&La(i),r.show!=null&&b.forEach((m,w)=>{w>0&&(i==w||i==null)&&(m.show=r.show,Ma(w),o==2?(Yt(m.facets[0].scale,null,null),Yt(m.facets[1].scale,null,null)):Yt(m.scale,null,null),Dl())}),f!==!1&&Be("setSeries",i,r),h&&nn("setSeries",l,i,r)}l.setSeries=At;function Ta(i,r){Le(x[i],r)}function Pa(i,r){i.fill=ne(i.fill||null),i.dir=se(i.dir,-1),r=r??x.length,x.splice(r,0,i)}function Ca(i){i==null?x.length=0:x.splice(i,1)}l.addBand=Pa,l.setBand=Ta,l.delBand=Ca;function Da(i,r){b[i].alpha=r,Ke&&_t[i]!=null&&(_t[i].style.opacity=r),xe&&Se[i]&&(Se[i].style.opacity=r)}let zt,jt,sl;const Rl={focus:!0};function La(i){if(i!=sl){let r=i==null,f=Lt.alpha!=1;b.forEach((h,m)=>{if(o==1||m>0){let w=r||m==0||m==i;h._focus=r?null:w,f&&Da(m,w?1:Lt.alpha)}}),sl=i,f&&Dl()}}xe&&Sl&&qe(ms,ie,i=>{Y._lock||(il(i),sl!=null&&At(null,Rl,!0,Ce.setSeries))});function Et(i,r,f){let h=S[r];f&&(i=i/ae-(h.ori==1?Ae:_e));let m=X;h.ori==1&&(m=O,i=m-i),h.dir==-1&&(i=m-i);let w=h._min,M=h._max,C=i/m,E=w+(M-w)*C,N=h.distr;return N==3?Il(10,E):N==4?Cc(E,h.asinh):N==100?h.bwd(E):E}function Aa(i,r){let f=Et(i,k,r);return Tt(f,t[0],Ne,ze)}l.valToIdx=i=>Tt(i,t[0]),l.posToIdx=Aa,l.posToVal=Et,l.valToPos=(i,r,f)=>S[r].ori==0?s(i,S[r],f?lt:X,f?ot:0):a(i,S[r],f?bt:O,f?ht:0),l.setCursor=(i,r,f)=>{me=i.left,ke=i.top,rl(null,r,f)};function Ho(i,r){we(Fl,zl,ge.left=i),we(Fl,rn,ge.width=r)}function No(i,r){we(Fl,on,ge.top=i),we(Fl,an,ge.height=r)}let en=L.ori==0?Ho:No,tn=L.ori==1?Ho:No;function Ea(){if(xe&&J.live)for(let i=o==2?1:0;i{te[h]=f}):Ec(i.idx)||te.fill(i.idx),J.idx=te[0]),xe&&J.live){for(let f=0;f0||o==1&&!dt)&&$a(f,te[f]);Ea()}pt=!1,r!==!1&&Be("setLegend")}l.setLegend=bi;function $a(i,r){let f=b[i],h=i==0&&Q==2?kt:t[i],m;dt?m=f.values(l,i,r)??It:(m=f.value(l,r==null?null:h[r],i,r),m=m==null?It:{_:m}),J.values[i]=m}function rl(i,r,f){Fo=me,Ro=ke,[me,ke]=Y.move(l,me,ke),Y.left=me,Y.top=ke,Ke&&(Ll&&Rt(Ll,Ee(me),0,X,O),Al&&Rt(Al,0,Ee(ke),X,O));let h,m=Ne>ze;zt=de,jt=null;let w=L.ori==0?X:O,M=L.ori==1?X:O;if(me<0||Ue==0||m){h=Y.idx=null;for(let C=0;C0&&ve.show){let st=ue==null?-10:ue==h?N:I(o==1?t[0][ue]:t[K][0][ue],L,w,0),Je=Te==null?-10:G(Te,o==1?S[ve.scale]:S[ve.facets[1].scale],M,0);if(Sl&&Te!=null){let mt=L.ori==1?me:ke,St=Fe(Lt.dist(l,K,ue,Je,mt));if(St=0?1:-1,xt=rt>=0?1:-1;xt==gt&&(xt==1?$t==1?Te>=rt:Te<=rt:$t==1?Te<=rt:Te>=rt)&&(zt=St,jt=K)}else zt=St,jt=K}}if(pt||xl){let mt,St;L.ori==0?(mt=st,St=Je):(mt=Je,St=st);let $t,rt,gt,xt,Ft,Qe,at=!0,al=je.bbox;if(al!=null){at=!1;let Ze=al(l,K);gt=Ze.left,xt=Ze.top,$t=Ze.width,rt=Ze.height}else gt=mt,xt=St,$t=rt=je.size(l,K);if(Qe=je.fill(l,K),Ft=je.stroke(l,K),xl)K==jt&&zt<=Lt.prox&&(z=gt,B=xt,Z=$t,re=rt,oe=at,le=Qe,q=Ft);else{let Ze=_t[K];Ze!=null&&(Ml[K]=gt,Tl[K]=xt,Ss(Ze,$t,rt,at),bs(Ze,Qe,Ft),Rt(Ze,wt(gt),wt(xt),X,O))}}}}if(xl){let K=Lt.prox,ve=sl==null?zt<=K:zt>K||jt!=sl;if(pt||ve){let Me=_t[0];Me!=null&&(Ml[0]=z,Tl[0]=B,Ss(Me,Z,re,oe),bs(Me,le,q),Rt(Me,wt(z),wt(B),X,O))}}}if(ge.show&&Gt)if(i!=null){let[C,E]=Ce.scales,[N,z]=Ce.match,[B,Z]=i.cursor.sync.scales,re=i.cursor.drag;if(Oe=re._x,Ve=re._y,Oe||Ve){let{left:oe,top:le,width:q,height:K}=i.select,ve=i.scales[B].ori,Me=i.posToVal,We,ue,Te,st,Je,mt=C!=null&&N(C,B),St=E!=null&&z(E,Z);mt&&Oe?(ve==0?(We=oe,ue=q):(We=le,ue=K),Te=S[C],st=I(Me(We,B),Te,w,0),Je=I(Me(We+ue,B),Te,w,0),en(Pt(st,Je),Fe(Je-st))):en(0,w),St&&Ve?(ve==1?(We=oe,ue=q):(We=le,ue=K),Te=S[E],st=G(Me(We,Z),Te,M,0),Je=G(Me(We+ue,Z),Te,M,0),tn(Pt(st,Je),Fe(Je-st))):tn(0,M)}else xi()}else{let C=Fe(Fo-Eo),E=Fe(Ro-$o);if(L.ori==1){let Z=C;C=E,E=Z}Oe=Ge.x&&C>=Ge.dist,Ve=Ge.y&&E>=Ge.dist;let N=Ge.uni;N!=null?Oe&&Ve&&(Oe=C>=N,Ve=E>=N,!Oe&&!Ve&&(E>C?Ve=!0:Oe=!0)):Ge.x&&Ge.y&&(Oe||Ve)&&(Oe=Ve=!0);let z,B;Oe&&(L.ori==0?(z=El,B=me):(z=$l,B=ke),en(Pt(z,B),Fe(B-z)),Ve||tn(0,M)),Ve&&(L.ori==1?(z=El,B=me):(z=$l,B=ke),tn(Pt(z,B),Fe(B-z)),Oe||en(0,w)),!Oe&&!Ve&&(en(0,0),tn(0,0))}if(Ge._x=Oe,Ge._y=Ve,i==null){if(f){if(Ko!=null){let[C,E]=Ce.scales;Ce.values[0]=C!=null?Et(L.ori==0?me:ke,C):null,Ce.values[1]=E!=null?Et(L.ori==1?me:ke,E):null}nn(Li,l,me,ke,X,O,h)}if(Sl){let C=f&&Ce.setSeries,E=Lt.prox;sl==null?zt<=E&&At(jt,Rl,!0,C):zt>E?At(null,Rl,!0,C):jt!=sl&&At(jt,Rl,!0,C)}}pt&&(J.idx=h,bi()),r!==!1&&Be("setCursor")}let Kt=null;Object.defineProperty(l,"rect",{get(){return Kt==null&&ln(!1),Kt}});function ln(i=!1){i?Kt=null:(Kt=P.getBoundingClientRect(),Be("syncRect",Kt))}function zo(i,r,f,h,m,w,M){Y._lock||Gt&&i!=null&&i.movementX==0&&i.movementY==0||(ki(i,r,f,h,m,w,M,!1,i!=null),i!=null?rl(null,!0,!0):rl(r,!0,!1))}function ki(i,r,f,h,m,w,M,C,E){if(Kt==null&&ln(!1),il(i),i!=null)f=i.clientX-Kt.left,h=i.clientY-Kt.top;else{if(f<0||h<0){me=-10,ke=-10;return}let[N,z]=Ce.scales,B=r.cursor.sync,[Z,re]=B.values,[oe,le]=B.scales,[q,K]=Ce.match,ve=r.axes[0].side%2==1,Me=L.ori==0?X:O,We=L.ori==1?X:O,ue=ve?w:m,Te=ve?m:w,st=ve?h:f,Je=ve?f:h;if(oe!=null?f=q(N,oe)?d(Z,S[N],Me,0):-10:f=Me*(st/ue),le!=null?h=K(z,le)?d(re,S[z],We,0):-10:h=We*(Je/Te),L.ori==1){let mt=f;f=h,h=mt}}E&&(r==null||r.cursor.event.type==Li)&&((f<=1||f>=X-1)&&(f=cl(f,X)),(h<=1||h>=O-1)&&(h=cl(h,O))),C?(Eo=f,$o=h,[El,$l]=Y.move(l,f,h)):(me=f,ke=h)}const Si={width:0,height:0,left:0,top:0};function xi(){Mn(Si,!1)}let Oo,Vo,Bo,Wo;function Io(i,r,f,h,m,w,M){Gt=!0,Oe=Ve=Ge._x=Ge._y=!1,ki(i,r,f,h,m,w,M,!0,!1),i!=null&&(qe(Ai,Bi,Uo,!1),nn(ps,l,El,$l,X,O,null));let{left:C,top:E,width:N,height:z}=ge;Oo=C,Vo=E,Bo=N,Wo=z}function Uo(i,r,f,h,m,w,M){Gt=Ge._x=Ge._y=!1,ki(i,r,f,h,m,w,M,!1,!0);let{left:C,top:E,width:N,height:z}=ge,B=N>0||z>0,Z=Oo!=C||Vo!=E||Bo!=N||Wo!=z;if(B&&Z&&Mn(ge),Ge.setScale&&B&&Z){let re=C,oe=N,le=E,q=z;if(L.ori==1&&(re=E,oe=z,le=C,q=N),Oe&&Yt(k,Et(re,k),Et(re+oe,k)),Ve)for(let K in S){let ve=S[K];K!=k&&ve.from==null&&ve.min!=de&&Yt(K,Et(le+q,K),Et(le,K))}xi()}else Y.lock&&(Y._lock=!Y._lock,rl(r,!0,i!=null));i!=null&&(yl(Ai,Bi),nn(Ai,l,me,ke,X,O,null))}function Fa(i,r,f,h,m,w,M){if(Y._lock)return;il(i);let C=Gt;if(Gt){let E=!0,N=!0,z=10,B,Z;L.ori==0?(B=Oe,Z=Ve):(B=Ve,Z=Oe),B&&Z&&(E=me<=z||me>=X-z,N=ke<=z||ke>=O-z),B&&E&&(me=me{let m=Ce.match[2];f=m(l,r,f),f!=-1&&At(f,h,!0,!1)},Ke&&(qe(ps,P,Io),qe(Li,P,zo),qe(_s,P,i=>{il(i),ln(!1)}),qe(ms,P,Fa),qe(gs,P,Go),qi.add(l),l.syncRect=ln);const Tn=l.hooks=e.hooks||{};function Be(i,r,f){gi?Xl.push([i,r,f]):i in Tn&&Tn[i].forEach(h=>{h.call(null,l,r,f)})}(e.plugins||[]).forEach(i=>{for(let r in i.hooks)Tn[r]=(Tn[r]||[]).concat(i.hooks[r])});const jo=(i,r,f)=>f,Ce=Le({key:null,setSeries:!1,filters:{pub:Cs,sub:Cs},scales:[k,b[1]?b[1].scale:null],match:[Ds,Ds,jo],values:[null,null]},Y.sync);Ce.match.length==2&&Ce.match.push(jo),Y.sync=Ce;const Ko=Ce.key,Mi=qr(Ko);function nn(i,r,f,h,m,w,M){Ce.filters.pub(i,r,f,h,m,w,M)&&Mi.pub(i,r,f,h,m,w,M)}Mi.sub(l);function Ra(i,r,f,h,m,w,M){Ce.filters.sub(i,r,f,h,m,w,M)&&Hl[i](null,r,f,h,m,w,M)}l.pub=Ra;function Ha(){Mi.unsub(l),qi.delete(l),Xt.clear(),Ui(In,Bl,Yo),p.remove(),ie==null||ie.remove(),Be("destroy")}l.destroy=Ha;function Ti(){Be("init",e,t),xo(t||e.data,!1),U[k]?vi(k,U[k]):si(),wn=ge.show&&(ge.width>0||ge.height>0),nl=pt=!0,oi(e.width,e.height)}return b.forEach(ko),F.forEach(pa),n?n instanceof HTMLElement?(n.appendChild(p),Ti()):n(l,Ti):Ti(),l}Ye.assign=Le;Ye.fmtNum=co;Ye.rangeNum=Un;Ye.rangeLog=Qn;Ye.rangeAsinh=ro;Ye.orient=gl;Ye.pxRatio=ae;Ye.join=Oc;Ye.fmtDate=fo,Ye.tzDate=Jc;Ye.sync=qr;{Ye.addGap=Eu,Ye.clipGaps=ei;let e=Ye.paths={points:ta};e.linear=na,e.stepped=Ru,e.bars=Hu,e.spline=zu}const Ol=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim();function Hi(e,t){if(e.startsWith("#")){const n=parseInt(e.slice(1),16);return`rgba(${n>>16&255},${n>>8&255},${n&255},${t})`}return e}function wo({lines:e,range:t,log:n,markers:l=[],height:o=360,stacked:s,onZoom:a,valueLabel:d}){const _=fn(null),p=fn(null),v=fn(null);return Wt(()=>{const g=_.current;if(!e.length)return;const u=Ol("--muted"),y=Ol("--rule-2");Ol("--ink");const P=Ol("--mark"),D=`12px ${Ol("--font")}`;let $;e.length===1?$=[e[0].t,e[0].v]:$=Ye.join(e.map(k=>[k.t,k.v]));let H=$;if(s){const k=$.slice();for(let T=2;T(R??0)+(k[T-1][V]??0));H=$,$=k}const b={width:g.clientWidth,height:o,padding:[18,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},points:{size:8,width:2},y:!1},legend:{show:!1},scales:{x:{time:!0},y:{distr:n?3:1,range:(k,T,R)=>[n?Math.max(1,T):0,R*1.08||1]}},axes:[{stroke:u,font:D,grid:{show:!1},ticks:{show:!0,stroke:y,size:4},gap:6,values:[[86400*365,"{YYYY}",null,null,null,null,null,null,1],[86400*28,"{MMM}",` {YYYY}`,null,null,null,null,null,1],[86400,"{MMM} {D}",` {YYYY}`,null,"{D}",null,"{MMM} {D}",null,1]]},{stroke:u,font:D,size:56,gap:8,grid:{stroke:y,width:1},ticks:{show:!1},values:(k,T)=>T.map(R=>R==null?"":Re(R))}],series:[{},...e.map((k,T)=>({label:k.label,stroke:k.color,width:k.width??(e.length===1?2.25:2),dash:k.dash?[5,4]:void 0,spanGaps:!0,points:{show:!1},fill:s?Hi(k.color,.85):k.fill?R=>{const V=R.ctx.createLinearGradient(0,R.bbox.top,0,R.bbox.top+R.bbox.height);return V.addColorStop(0,Hi(k.color,.26)),V.addColorStop(1,Hi(k.color,0)),V}:void 0,...s&&T>0?{}:{}}))],bands:s?e.slice(1).map((k,T)=>({series:[T+2,T+1]})):void 0,hooks:{draw:[k=>{if(!l.length)return;const{ctx:T}=k;T.save();for(const R of l){const V=Math.round(k.valToPos(R.t,"x",!0));if(Vk.bbox.left+k.bbox.width)continue;T.strokeStyle=P,T.lineWidth=2*devicePixelRatio,T.setLineDash([3*devicePixelRatio,3*devicePixelRatio]),T.beginPath(),T.moveTo(V,k.bbox.top),T.lineTo(V,k.bbox.top+k.bbox.height),T.stroke(),T.setLineDash([]),T.font=`600 ${11*devicePixelRatio}px ${Ol("--font")}`;const W=T.measureText(R.label).width+10*devicePixelRatio,L=18*devicePixelRatio;T.fillStyle=P,T.beginPath(),T.roundRect(V-W/2,k.bbox.top-L+4*devicePixelRatio,W,L,4*devicePixelRatio),T.fill(),T.fillStyle="#151833",T.textAlign="center",T.textBaseline="middle",T.fillText(R.label,V,k.bbox.top-L/2+4*devicePixelRatio)}T.restore()}],setCursor:[k=>{const T=p.current,R=k.cursor.idx;if(R==null||k.cursor.left==null||k.cursor.left<0){T.style.display="none";return}const V=e.map((G,U)=>({l:G,v:H[U+1][R]})).filter(G=>G.v!=null);if(!V.length){T.style.display="none";return}const W=Qt(new Date($[0][R]*1e3),{weekday:"short",month:"short",day:"numeric",year:"numeric"});T.innerHTML=`
${W}
`+V.map(G=>`
${e.length>1?qu(G.l.label):d?"":"Value"}${d?d(G.v):$e(G.v)}
`).join(""),T.style.display="block";const L=k.cursor.left+k.bbox.left/devicePixelRatio,Q=Math.min(...V.map((G,U)=>k.valToPos(s?$[e.indexOf(G.l)+1][R]:G.v,"y")))+k.bbox.top/devicePixelRatio,I=T.offsetWidth/2;T.style.left=Math.min(Math.max(L,I),g.clientWidth-I)+"px",T.style.top=Math.max(Q-12,T.offsetHeight)+"px"}],setSelect:[],setScale:[(k,T)=>{if(T!=="x"||!a)return;const R=k.scales.x.min,V=k.scales.x.max;a([R,V])}]}},F=new Ye(b,$,g);v.current=F,t&&F.setScale("x",{min:t[0],max:t[1]});const S=new ResizeObserver(()=>F.setSize({width:g.clientWidth,height:o}));S.observe(g);const x=()=>p.current.style.display="none";return g.addEventListener("mouseleave",x),()=>{S.disconnect(),g.removeEventListener("mouseleave",x),F.destroy(),v.current=null}},[e,n,l,o,s]),Wt(()=>{const g=v.current;if(!g)return;const u=g.data[0];t?g.setScale("x",{min:t[0],max:t[1]}):g.setScale("x",{min:u[0],max:u[u.length-1]})},[t]),c("div",{class:"chart-box",children:[c("div",{ref:_,onDblClick:()=>a==null?void 0:a(null)}),c("div",{ref:p,class:"tip",style:{display:"none"}})]})}function qu(e){return e.replace(/[&<>"]/g,t=>({"&":"&","<":"<",">":">",'"':"""})[t])}function Ju({v:e,w:t=96,h:n=26,color:l="var(--signal)"}){if(!e||e.length<2)return c("svg",{width:t,height:n});const o=Math.max(...e)||1,s=e.map((a,d)=>`${(d/(e.length-1)*(t-2)+1).toFixed(1)},${(n-2-a/o*(n-4)).toFixed(1)}`);return c("svg",{width:t,height:n,viewBox:`0 0 ${t} ${n}`,"aria-hidden":"true",style:{display:"block"},children:[c("path",{d:`M${s.join(" L")} L${t-1},${n} L1,${n}Z`,fill:l,opacity:"0.12"}),c("path",{d:`M${s.join(" L")}`,fill:"none",stroke:l,"stroke-width":"1.5","stroke-linejoin":"round"})]})}function Qu({route:e}){const t=e.author,[n,l]=ye(null),[o,s]=ye(null),[a,d]=ye("daily"),[_,p]=ye(30);Wt(()=>{l(null),s(null),hl.author(t).then(u=>{l(u),document.title=`${t} downloads · Model Pulse`}).catch(u=>s(u.message))},[t]);const v=dl(()=>{if(!n)return[];const u=getComputedStyle(document.documentElement).getPropertyValue("--c1").trim(),y=n.series;if(a==="daily"){const D=wr(y.day,y.dl_all);return[{label:t,color:u,t:D.t,v:lo(D.v,7),fill:!0}]}const P=Nn(y.day,a==="month"?y.dl30:y.dl_all);return[{label:t,color:u,t:P.t,v:P.v,fill:!0}]},[n,a]);if(o)return c("div",{class:"wrap err",children:[c("h1",{children:["No models found for ",t]}),c("p",{class:"muted",children:o})]});if(!n)return c("div",{class:"wrap hero",children:[c("div",{class:"model-name",children:t}),c("div",{class:"skeleton",style:{marginTop:40}})]});const g=n.models.reduce((u,y)=>({all:u.all+(y.dl_all??0),m30:u.m30+(y.dl30??0),w:u.w+(y.dl_7d??0),likes:u.likes+(y.likes??0)}),{all:0,m30:0,w:0,likes:0});return c(et,{children:[c("div",{class:"wrap hero",children:[c("div",{class:"crumbs",children:[c("span",{class:"chip",children:[n.models.length>=200?"200+":n.models.length," tracked models"]}),c("a",{class:"chip",href:`https://huggingface.co/${t}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"})]}),c("h1",{class:"model-name",children:t}),c("div",{class:"figures",children:[c("div",{class:"fig fig-main",children:[c("div",{class:"num",children:$e(g.all)}),c("div",{class:"label",children:"downloads all time, across all models"})]}),c("div",{class:"fig",children:[c("div",{class:"val",children:Re(g.m30)}),c("div",{class:"label",children:"last 30 days"})]}),c("div",{class:"fig",children:[c("div",{class:"val",children:Re(g.w)}),c("div",{class:"label",children:"last 7 days"})]}),c("div",{class:"fig",children:[c("div",{class:"val",children:Re(g.likes)}),c("div",{class:"label",children:"likes"})]})]}),c("div",{class:"chart-bar",children:c("div",{class:"left",children:c("div",{class:"seg",role:"group","aria-label":"Metric",children:[c("button",{"aria-pressed":a==="daily",onClick:()=>d("daily"),children:"Daily"}),c("button",{"aria-pressed":a==="month",onClick:()=>d("month"),children:"Rolling 30 days"}),c("button",{"aria-pressed":a==="total",onClick:()=>d("total"),children:"All time"})]})})}),c(wo,{lines:v,height:340})]}),c("section",{class:"section",children:c("div",{class:"wrap",children:[c("div",{class:"section-head",children:c("div",{children:[c("h2",{children:["Models by ",t]}),c("p",{children:"Sorted by downloads in the last 30 days."})]})}),c("div",{class:"table-scroll",children:c("table",{class:"list",children:[c("thead",{children:c("tr",{children:[c("th",{children:"Model"}),c("th",{children:"This week"}),c("th",{children:"Change"}),c("th",{children:"30 days"}),c("th",{children:"All time"}),c("th",{children:"Likes"})]})}),c("tbody",{children:n.models.slice(0,_).map(u=>c("tr",{children:[c("td",{class:"name",children:[c("a",{href:`?model=${u.id}`,onClick:y=>{y.preventDefault(),Xe({model:u.id})},children:u.id.split("/").slice(1).join("/")}),c("span",{class:"sub",children:[Wl(u.pipeline_tag),vr(u.params)].filter(Boolean).join(", ")})]}),c("td",{children:c("b",{children:Re(u.dl_7d)})}),c("td",{class:u.growth_7d==null?"muted":u.growth_7d>=0?"up":"down",children:mn(u.growth_7d)}),c("td",{children:Re(u.dl30)}),c("td",{children:Re(u.dl_all)}),c("td",{children:Re(u.likes)})]},u.id))})]})}),n.models.length>_&&c("button",{class:"btn",style:{marginTop:16},onClick:()=>p(_+30),children:"Show 30 more"})]})})]})}const Zu=({size:e=16})=>c("svg",{class:"icon",width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","aria-hidden":"true",children:[c("circle",{cx:"11",cy:"11",r:"7"}),c("path",{d:"m20 20-3.5-3.5"})]});function Yn({onPick:e,big:t,placeholder:n,autoFocus:l,hotkey:o,exclude:s=[]}){const[a,d]=ye(""),[_,p]=ye([]),[v,g]=ye(0),[u,y]=ye(!1),P=fn(null),D=fn(0);Wt(()=>{if(!o)return;const S=x=>{var k,T;(x.key==="k"&&(x.metaKey||x.ctrlKey)||x.key==="/"&&((k=document.activeElement)==null?void 0:k.tagName)!=="INPUT")&&(x.preventDefault(),(T=P.current)==null||T.focus())};return addEventListener("keydown",S),()=>removeEventListener("keydown",S)},[o]),Wt(()=>{const S=a.trim();if(S.length<2){p([]);return}const x=us(S),k=x&&S.includes("huggingface.co")?x:S,T=++D.current,R=setTimeout(()=>{hl.search(k).then(V=>{T===D.current&&(p(V.filter(W=>!s.includes(W.id))),g(0))}).catch(()=>{})},120);return()=>clearTimeout(R)},[a]);const $=S=>{var x;d(""),p([]),y(!1),(x=P.current)==null||x.blur(),e(S)},H=S=>{var x;if(S.key==="ArrowDown")S.preventDefault(),g(k=>Math.min(k+1,_.length-1));else if(S.key==="ArrowUp")S.preventDefault(),g(k=>Math.max(k-1,0));else if(S.key==="Escape")y(!1),(x=P.current)==null||x.blur();else if(S.key==="Enter")if(S.preventDefault(),_[v])$(_[v].id);else{const k=us(a);k&&$(k)}},b=a.trim().toLowerCase(),F=S=>{const x=S.toLowerCase().indexOf(b);return x<0||!b?S:c(et,{children:[S.slice(0,x),c("b",{children:S.slice(x,x+b.length)}),S.slice(x+b.length)]})};return c("div",{class:`search${t?" big":""}`,children:[c(Zu,{size:t?20:16}),c("input",{ref:P,value:a,autoFocus:l,placeholder:n??"Search models","aria-label":"Search models",role:"combobox","aria-expanded":u&&_.length>0,"aria-controls":"search-results",autocomplete:"off",spellcheck:!1,onInput:S=>{d(S.target.value),y(!0)},onFocus:()=>y(!0),onBlur:()=>setTimeout(()=>y(!1),150),onKeyDown:H}),o&&!a&&c("kbd",{children:"⌘K"}),u&&_.length>0&&c("ul",{class:"results",id:"search-results",role:"listbox",children:_.map((S,x)=>c("li",{role:"option","aria-selected":x===v,onMouseEnter:()=>g(x),onMouseDown:k=>{k.preventDefault(),$(S.id)},children:[c("span",{class:"rid",children:F(S.id)}),c("span",{class:"rmeta",children:[Wl(S.pipeline_tag)," · ",Re(S.dl30),"/mo"]})]},S.id))})]})}const Ni=[{key:"gainers_7d",label:"Most downloaded this week",note:"Downloads in the last 7 days."},{key:"growth_7d",label:"Fastest growing",note:"Downloads this week compared with the average of the three weeks before, among models with at least 1,000 weekly downloads."},{key:"breakouts",label:"New this month",note:"Models created in the last 30 days, by downloads this week."},{key:"likes_7d",label:"Most liked this week",note:"Likes gained in the last 7 days, among models with at least 1,000 downloads this month."},{key:"families",label:"Biggest families",note:"Base models ranked by the 30-day downloads of the model plus all its derivatives."},{key:"authors_7d",label:"Organizations",note:"Authors ranked by downloads across all their models this week.",author:!0}],Qs=e=>getComputedStyle(document.documentElement).getPropertyValue(e).trim(),Xu=["--c1","--c2","--c3","--c4","--c5"];function ef(){const[e,t]=ye(null),[n,l]=ye(null),[o,s]=ye(null),[a,d]=ye(Ni[0].key);Wt(()=>{document.title="Model Pulse · Download history for every Hugging Face model",hl.leaderboards().then(t),hl.hub().then(l),hl.meta().then(s)},[]);const _=dl(()=>{if(!n)return[];const u=[...new Set(n.day)],y=new Map(u.map((b,F)=>[b,F])),P=n.tags.map(()=>new Array(u.length).fill(0));n.day.forEach((b,F)=>{P[n.tags.indexOf(n.tag[F])][y.get(b)]+=n.dl[F]});const D=u.map(qn),$=[...Xu.map(Qs),"#9aa0bd","#c1c5d8","#7f86a8"];return n.tags.map((b,F)=>({tag:b,v:lo(P[F],7)})).map((b,F)=>({label:Wl(b.tag),color:b.tag==="other"?Qs("--rule"):$[F],t:D,v:b.v}))},[n]),p=(e==null?void 0:e.gainers_7d.slice(0,5).map(u=>u.id))??[],v=Ni.find(u=>u.key===a),g=(e==null?void 0:e[a])??[];return c(et,{children:[c("div",{class:"wrap home-hero",children:[c("h1",{children:"Download history for every model on the Hub"}),c("p",{class:"lede",children:["Daily downloads, likes and derivative families for ",o?$e(o.models):"a million"," models, going back to"," ",o?Qt(o.first,{month:"long",year:"numeric"}):"July 2024",". Search for a model or paste its Hugging Face link."]}),c(Yn,{big:!0,autoFocus:!0,placeholder:"Qwen/Qwen3-8B or https://huggingface.co/…",onPick:u=>Xe({model:u})}),p.length>0&&c("div",{class:"examples",children:[c("span",{class:"muted",children:"Popular this week:"}),p.map(u=>c("a",{class:"chip",href:`?model=${u}`,onClick:y=>{y.preventDefault(),Xe({model:u})},children:u},u))]})]}),c("div",{class:"wrap hub-chart",children:[c("h2",{children:"Daily downloads across the Hub"}),c("p",{class:"muted",style:{margin:"0 0 12px"},children:["All public models, by task, 7-day average. ",o&&`Updated ${Qt(o.last)}.`]}),_.length?c(et,{children:[c("div",{class:"legend",style:{marginBottom:10},children:_.map(u=>c("span",{class:"chip",children:[c("i",{class:"sw",style:{background:u.color,height:10}}),u.label]},u.label))}),c(wo,{lines:_,stacked:!0,height:300,valueLabel:u=>$e(u)})]}):c("div",{class:"skeleton",style:{height:300}})]}),c("section",{class:"section",style:{marginTop:28},children:c("div",{class:"wrap",children:[c("div",{class:"section-head",children:c("div",{children:[c("h2",{children:v.label}),c("p",{children:[v.note,e?` Week ending ${Qt(e.updated)}.`:""]})]})}),c("div",{class:"seg lb-tabs",role:"tablist",children:Ni.map(u=>c("button",{role:"tab","aria-pressed":a===u.key,"aria-selected":a===u.key,onClick:()=>d(u.key),children:u.label},u.key))}),e?c(tf,{rows:g,kind:a,author:!!v.author}):c("div",{class:"skeleton"})]})})]})}function tf({rows:e,kind:t,author:n}){const[l,o]=ye(25),s=d=>Xe(n?{author:d.author}:{model:d.id}),a=d=>n?`?author=${d.author}`:`?model=${d.id}`;return c(et,{children:[c("div",{class:"table-scroll",children:c("table",{class:"list",children:[c("thead",{children:c("tr",{children:[c("th",{children:n?"Organization":"Model"}),!n&&c("th",{children:"Last 4 weeks"}),t==="likes_7d"?c("th",{children:"Likes this week"}):c("th",{children:"This week"}),c("th",{children:"Change"}),c("th",{children:t==="families"?"Family, 30 days":"30 days"}),c("th",{children:n?"Models":t==="likes_7d"?"Likes":"All time"})]})}),c("tbody",{children:e.slice(0,l).map((d,_)=>c("tr",{children:[c("td",{class:"name",children:[c("span",{class:"rank",children:_+1}),c("a",{href:a(d),onClick:p=>{p.preventDefault(),s(d)},children:n?d.author:d.id}),!n&&c("span",{class:"sub",style:{paddingLeft:"2.5em"},children:[Wl(d.pipeline_tag),t==="families"&&d.fam_members?`, ${$e(d.fam_members)} derivatives`:""]})]}),!n&&c("td",{children:c(Ju,{v:d.spark??[]})}),c("td",{children:c("b",{children:t==="likes_7d"?`+${$e(d.likes_7d)}`:Re(d.dl_7d)})}),c("td",{class:d.growth_7d==null?"muted":d.growth_7d>=0?"up":"down",children:mn(d.growth_7d)}),c("td",{children:Re(t==="families"?d.fam_dl30:d.dl30)}),c("td",{children:n?$e(d.models):Re(t==="likes_7d"?d.likes:d.dl_all)})]},d.id??d.author))})]})}),e.length>l&&c("button",{class:"btn",style:{marginTop:16},onClick:()=>o(l+25),children:"Show 25 more"})]})}const Zs="https://modelpulse.ifsp.dev";function Xs({text:e,label:t="Copy"}){const[n,l]=ye(!1);return c("button",{class:"btn",onClick:async()=>{try{await navigator.clipboard.writeText(e)}catch{const o=document.createElement("textarea");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),o.remove()}l(!0),setTimeout(()=>l(!1),1600)},children:n?"Copied":t})}async function lf(e){await document.fonts.ready;const t=1200,n=675,l=2,o=document.createElement("canvas");o.width=t*l,o.height=n*l;const s=o.getContext("2d");s.scale(l,l);const a=v=>getComputedStyle(document.documentElement).getPropertyValue(v).trim();s.fillStyle=a("--paper"),s.fillRect(0,0,t,n),s.fillStyle=a("--ink"),s.beginPath(),s.roundRect(56,48,34,34,9),s.fill(),s.strokeStyle="#FFD43B",s.lineWidth=3,s.lineCap="round",s.lineJoin="round",s.beginPath(),s.moveTo(62,66),s.lineTo(68,66),s.lineTo(72,57),s.lineTo(78,75),s.lineTo(81,67),s.lineTo(85,67),s.stroke(),s.fillStyle=a("--ink"),s.font=`700 20px ${a("--font")}`,s.fillText("Model Pulse",102,72),s.fillStyle=a("--muted"),s.font=`400 18px ${a("--font")}`,s.textAlign="right",s.fillText("huggingface.co/spaces/modelpulse/model-pulse",t-56,72),s.textAlign="left",s.fillStyle=a("--ink"),s.font=`600 36px ${a("--font")}`,s.fillText(e.id.length>48?e.id.slice(0,47)+"…":e.id,56,148),s.font=`600 88px ${a("--font-cond")}`;const d=(e.dl_all??e.dl30??0).toLocaleString("en");s.fillText(d,56,248);const _=s.measureText(d).width;s.fillStyle=a("--muted"),s.font=`400 20px ${a("--font")}`,s.fillText(e.dl_all!=null?"downloads all time":"downloads, last 30 days",60,280),e.growth_7d!=null&&(s.fillStyle=e.growth_7d>=0?a("--up"):a("--down"),s.font=`600 30px ${a("--font")}`,s.fillText(`${mn(e.growth_7d)} this week`,56+_+28,240));const p=document.querySelector(".chart-box canvas");if(p){const v=t-112,g=n-330-40,u=Math.min(v/p.width,g/p.height);s.drawImage(p,(t-p.width*u)/2,320,p.width*u,p.height*u)}return new Promise(v=>o.toBlob(g=>v(g),"image/png"))}function nf({model:e,url:t}){const[n,l]=ye("month"),o=`${Zs}/badge/${e.id}.svg${n==="month"?"":`?metric=${n}`}`,s=`[![Model Pulse](${o})](${no}?model=${e.id})`,a=e.growth_7d!=null?` (${mn(e.growth_7d)} week over week)`:"",d=`${e.id} has ${Re(e.dl_all??e.dl30)} downloads on Hugging Face${a}. Full download history:`;return c("section",{class:"section",children:c("div",{class:"wrap",children:[c("div",{class:"section-head",children:c("div",{children:[c("h2",{children:"Share this model's numbers"}),c("p",{children:"Every link opens this page with the same chart and comparison."})]})}),c("div",{class:"share-grid",children:[c("div",{children:[c("h3",{children:"Link"}),c("p",{children:"Opens Model Pulse on Hugging Face, ready to explore."}),c("div",{class:"code",children:[c("code",{children:t}),c(Xs,{text:t})]}),c("div",{style:{display:"flex",gap:8,marginTop:12,flexWrap:"wrap"},children:[c("button",{class:"btn",onClick:async()=>{const _=await lf(e),p=document.createElement("a");p.href=URL.createObjectURL(_),p.download=`${e.id.replace("/","_")}-model-pulse.png`,p.click(),setTimeout(()=>URL.revokeObjectURL(p.href),2e3)},children:"Download image"}),c("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://x.com/intent/post?text=${encodeURIComponent(d)}&url=${encodeURIComponent(t)}`,children:"Post on X"}),c("a",{class:"btn",target:"_blank",rel:"noopener",href:`https://www.linkedin.com/sharing/share-offsite/?url=${encodeURIComponent(t)}`,children:"Share on LinkedIn"})]})]}),c("div",{children:[c("h3",{children:"Badge for your model card"}),c("p",{children:["Updates daily. Paste it into the README of ",e.id.split("/").pop(),"."]}),c("div",{class:"seg badge-opts",role:"group","aria-label":"Badge metric",children:[c("button",{"aria-pressed":n==="month",onClick:()=>l("month"),children:"Monthly downloads"}),c("button",{"aria-pressed":n==="all",onClick:()=>l("all"),children:"All time"}),c("button",{"aria-pressed":n==="likes",onClick:()=>l("likes"),children:"Likes"})]}),c("div",{class:"badge-preview",children:c("img",{src:o.replace(Zs,gr),alt:"Model Pulse badge preview",height:22})}),c("div",{class:"code",children:[c("code",{children:s}),c(Xs,{text:s,label:"Copy markdown"})]})]}),c("div",{children:[c("h3",{children:"Keep Model Pulse on model pages"}),c("p",{children:"Hugging Face lists the most-liked Spaces on each model page. A like keeps download history one click away for everyone."}),c("a",{class:"btn primary",href:"https://huggingface.co/spaces/modelpulse/model-pulse",target:"_top",children:[c("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"#ff6b81","aria-hidden":"true",children:c("path",{d:"M12 21s-7.5-4.6-9.6-9.3C.9 8.2 3 4.5 6.6 4.5c2.1 0 3.6 1.1 5.4 3 1.8-1.9 3.3-3 5.4-3 3.6 0 5.7 3.7 4.2 7.2C19.5 16.4 12 21 12 21z"})}),"Like on Hugging Face"]})]})]})]})})}const er={"1M":30,"3M":91,"6M":182,"1Y":365,All:null},tr=["--c1","--c2","--c3","--c4","--c5"],En=e=>getComputedStyle(document.documentElement).getPropertyValue(tr[e%tr.length]).trim();function lr(e,t,n){const l=n&&e.family?e.family:e.series;if(t==="daily"){const{t:o,v:s}=wr(l.day,l.dl_all);return{t:o,v:lo(s,7),raw:s}}return t==="month"?Nn(l.day,l.dl30):t==="total"?Nn(l.day,l.dl_all):Nn(e.series.day,e.series.likes)}function of({route:e}){var fe;const t=e.model,n=e.compare??[],[l,o]=ye(null),[s,a]=ye([]),[d,_]=ye(null),[p,v]=ye("daily"),[g,u]=ye("1Y"),[y,P]=ye(null),[D,$]=ye(!1),[H,b]=ye(!1),[F,S]=ye(!1);Wt(()=>{o(null),_(null),$(!1),P(null),hl.model(t).then(A=>{o(A),A.model.id!==t&&Xe({...e,model:A.model.id},!0),document.title=`${A.model.id} downloads · Model Pulse`}).catch(A=>_(A.message))},[t]),Wt(()=>{Promise.all(n.map(A=>hl.model(A).catch(()=>null))).then(A=>a(A.filter(Boolean)))},[n.join(",")]);const x=l==null?void 0:l.model,k=!!l&&l.series.dl_all.filter(A=>A!=null).length>7,T=p==="daily"&&!k?"month":p,R=dl(()=>{if(!l)return[];const A=lr(l,T,D),te=[];return te.push({label:D?`${l.model.id} + derivatives`:l.model.id,color:En(0),t:A.t,v:A.v,fill:!s.length}),s.forEach((J,Y)=>{const xe=lr(J,T,!1);te.push({label:J.model.id,color:En(Y+1),t:xe.t,v:xe.v})}),te},[l,s,T,D]),V=dl(()=>l?Za(D&&l.family?{...l.series,...l.family}:l.series):[],[l,D]),W=dl(()=>T==="likes"||s.length?[]:V.filter(A=>A.day).map(A=>({t:qn(A.day),label:A.label})),[V,T,s.length]),L=dl(()=>{if(y)return y;const A=er[g];if(!A||!R.length)return null;const te=Math.max(...R.map(J=>J.t[J.t.length-1]??0));return[te-A*86400,te]},[g,y,R]);if(d)return c("div",{class:"wrap err",children:[c("h1",{children:["No history for ",t]}),c("p",{class:"muted",children:d}),c("p",{children:"Check the spelling, or try one of the models below."}),c(Yn,{onPick:A=>Xe({model:A}),placeholder:"Search another model",autoFocus:!0})]});if(!l||!x)return c("div",{class:"wrap hero",children:[c("div",{class:"model-name",children:t}),c("div",{class:"skeleton",style:{marginTop:40}})]});const[Q,I]=x.id.includes("/")?[x.id.split("/")[0],x.id.split("/").slice(1).join("/")]:[null,x.id],G=vr(x.params),U=(fe=x.base_ids)==null?void 0:fe[0],ee={quantized:"Quantized from",finetune:"Fine-tuned from",adapter:"Adapter for",merge:"Merged from"},j=D&&x.fam_all?x.fam_all:x.dl_all??x.dl30,Ie=A=>Xe({model:x.id,compare:A.length?A:void 0},!0);return c(et,{children:[c("div",{class:"wrap hero",children:[c("div",{class:"crumbs",children:[x.pipeline_tag&&c("span",{class:"chip",children:Wl(x.pipeline_tag)}),G&&c("span",{class:"chip",children:G}),x.license&&c("span",{class:"chip",children:x.license}),x.likes!=null&&c("span",{class:"chip",title:x.likes_7d?`${$e(x.likes_7d)} new likes in the last 7 days`:void 0,children:[c("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"#ff6b81","aria-hidden":"true",children:c("path",{d:"M12 21s-7.5-4.6-9.6-9.3C.9 8.2 3 4.5 6.6 4.5c2.1 0 3.6 1.1 5.4 3 1.8-1.9 3.3-3 5.4-3 3.6 0 5.7 3.7 4.2 7.2C19.5 16.4 12 21 12 21z"})}),$e(x.likes)," likes",x.likes_7d?c("span",{class:"up",children:["+",$e(x.likes_7d)]}):null]}),U&&c("a",{class:"chip",href:`?model=${U}`,onClick:A=>{A.preventDefault(),Xe({model:U})},children:[ee[x.base_relation??""]??"Based on"," ",U]}),c("a",{class:"chip",href:`https://huggingface.co/${x.id}`,target:"_blank",rel:"noopener",children:"Open on Hugging Face ↗"})]}),c("h1",{class:"model-name",children:[Q&&c("a",{href:`?author=${Q}`,onClick:A=>{A.preventDefault(),Xe({author:Q})},class:"org",children:[Q,"/"]}),I]}),c("div",{class:"figures",children:[c("div",{class:"fig fig-main",children:[c("div",{class:"num",title:$e(j),children:$e(j)}),c("div",{class:"label",children:[x.dl_all!=null?"downloads all time":"downloads in the last 30 days",D?`, including ${$e(x.fam_members)} derivatives`:""]})]}),c("div",{class:"fig",children:[c("div",{class:"val",children:Re(D?x.fam_dl30:x.dl30)}),c("div",{class:"label",children:"last 30 days"})]}),c("div",{class:"fig",children:[c("div",{class:"val",children:[Re(D?x.fam_7d:x.dl_7d),!D&&x.growth_7d!=null&&c("small",{class:x.growth_7d>=0?"up":"down",children:mn(x.growth_7d)})]}),c("div",{class:"label",children:["last 7 days",!D&&x.growth_7d!=null?", vs. 3-week average":""]})]}),c("div",{class:"fig",children:[c("div",{class:"val",children:["#",$e(x.rank_dl30)]}),c("div",{class:"label",children:["on the Hub",x.rank_task&&x.pipeline_tag?`, ${Qa(x.rank_task)} in ${Wl(x.pipeline_tag)}`:""]})]})]}),c("div",{class:"chart-bar",children:[c("div",{class:"left",children:[c("div",{class:"seg",role:"group","aria-label":"Metric",children:[k&&c("button",{"aria-pressed":T==="daily",onClick:()=>v("daily"),children:"Daily"}),c("button",{"aria-pressed":T==="month",onClick:()=>v("month"),children:"Rolling 30 days"}),k&&c("button",{"aria-pressed":T==="total",onClick:()=>v("total"),children:"All time"}),c("button",{"aria-pressed":T==="likes",onClick:()=>{v("likes"),$(!1)},children:"Likes"})]}),c("div",{class:"seg",role:"group","aria-label":"Time range",children:Object.keys(er).map(A=>c("button",{"aria-pressed":!y&&g===A,onClick:()=>{P(null),u(A)},children:A},A))})]}),c("div",{class:"right",children:[!!l.family&&!s.length&&T!=="likes"&&c("div",{class:"seg",children:c("button",{"aria-pressed":D,onClick:()=>$(!D),children:["Include ",$e(x.fam_members)," derivatives"]})}),s.length>0&&c("div",{class:"seg",children:c("button",{"aria-pressed":H,onClick:()=>b(!H),children:"Log scale"})}),c("div",{class:"add-compare",children:[c("button",{class:"btn",onClick:()=>S(!F),"aria-expanded":F,disabled:n.length>=4,children:[c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.4","stroke-linecap":"round",children:c("path",{d:"M12 5v14M5 12h14"})}),"Compare"]}),F&&c(Yn,{autoFocus:!0,placeholder:"Add a model to compare",exclude:[x.id,...n],onPick:A=>{S(!1),Ie([...n,A])}})]})]})]}),s.length>0&&c("div",{class:"legend",style:{marginBottom:8},children:[c("span",{class:"chip",children:[c("i",{class:"sw",style:{background:En(0)}}),x.id]}),s.map((A,te)=>c("span",{class:"chip",children:[c("i",{class:"sw",style:{background:En(te+1)}}),c("a",{href:`?model=${A.model.id}`,onClick:J=>{J.preventDefault(),Xe({model:A.model.id})},children:A.model.id}),c("button",{"aria-label":`Remove ${A.model.id}`,onClick:()=>Ie(n.filter(J=>J!==A.model.id)),children:"✕"})]},A.model.id))]}),c(wo,{lines:R,range:L,log:H,markers:W,onZoom:A=>P(A),height:380,valueLabel:T==="daily"?A=>$e(A)+"/day":void 0}),c("p",{class:"chart-note",children:[T==="daily"&&"7-day average of daily downloads. ",T!=="likes"&&`Daily figures start on ${Qt("2025-02-27")}, when the Hub began reporting all-time totals; the rolling 30-day view goes back to ${Qt("2024-07-29")}. `,"The Hub sometimes books delayed downloads in a single day, which shows up as a short spike. Drag on the chart to zoom, double-click to reset."]})]}),V.length>0&&T!=="likes"&&c("section",{class:"section",children:c("div",{class:"wrap",children:[c("div",{class:"section-head",children:c("div",{children:[c("h2",{children:"Milestones"}),c("p",{children:["The day ",D?"the family":"the model"," first crossed each mark in all-time downloads."]})]})}),c("ol",{class:"timeline",children:V.map(A=>c("li",{class:A.day||A.before?"":"pending",children:[c("div",{class:"m",children:A.label}),c("div",{class:"when",children:A.day?Qt(A.day):A.before?`Before ${Qt(A.before,{month:"short",year:"numeric"})}`:"Not yet"})]},A.label))})]})}),(x.fam_members>0||l.children.length>0)&&c(sf,{data:l}),c(nf,{model:x,url:Xa({model:x.id,compare:n.length?n:void 0})})]})}function sf({data:e}){const t=e.model,n=[{k:"Quantized",n:t.n_quantized??0,c:"var(--c1)"},{k:"Fine-tuned",n:t.n_finetune??0,c:"var(--c2)"},{k:"Adapters",n:t.n_adapter??0,c:"var(--c3)"},{k:"Merges",n:t.n_merge??0,c:"var(--c4)"}],l=n.reduce((s,a)=>s+a.n,0)||1,o=t.fam_dl30&&t.dl30!=null?1-t.dl30/t.fam_dl30:null;return c("section",{class:"section",children:c("div",{class:"wrap",children:c("div",{class:"family-top",children:[c("div",{class:"family-sum",children:[c("h2",{children:"Family"}),c("p",{children:t.fam_members>0?c(et,{children:[$e(t.fam_members)," models build on ",t.id.split("/").pop(),", directly or through other derivatives. Together with the original they were downloaded ",c("b",{children:Re(t.fam_dl30)})," times in the last 30 days",o!=null&&o>.01?c(et,{children:[", and ",c("b",{children:[Math.round(o*100),"%"]})," of that went to derivatives"]}):null,"."]}):c(et,{children:["Derivatives of ",t.id.split("/").pop()," on the Hub."]})}),t.fam_members>0&&c(et,{children:[c("div",{class:"big",children:$e(t.fam_all)}),c("div",{class:"muted",style:{marginBottom:18},children:"family downloads all time"}),c("div",{class:"rel","aria-hidden":"true",children:n.filter(s=>s.n).map(s=>c("span",{style:{width:`${s.n/l*100}%`,background:s.c}},s.k))}),c("div",{class:"rel-legend",children:n.map(s=>c("div",{children:[c("span",{children:[c("i",{style:{background:s.c}}),s.k]}),c("b",{children:$e(s.n)})]},s.k))})]})]}),e.children.length>0&&c("div",{children:c("div",{class:"table-scroll",children:c("table",{class:"list",children:[c("thead",{children:c("tr",{children:[c("th",{children:"Most downloaded direct derivatives"}),c("th",{children:"Type"}),c("th",{children:"30 days"}),c("th",{children:"All time"})]})}),c("tbody",{children:e.children.slice(0,12).map(s=>c("tr",{children:[c("td",{class:"name",children:c("a",{href:`?model=${s.id}`,onClick:a=>{a.preventDefault(),Xe({model:s.id})},children:s.id})}),c("td",{class:"muted",children:s.relation}),c("td",{children:Re(s.dl30)}),c("td",{children:Re(s.dl_all)})]},s.id))})]})})})]})})})}const rf=()=>c("svg",{width:"28",height:"28",viewBox:"0 0 32 32","aria-hidden":"true",children:[c("rect",{width:"32",height:"32",rx:"8",fill:"var(--ink)"}),c("path",{d:"M5 17h5l3-8 5 15 3-7h6",fill:"none",stroke:"#FFD43B","stroke-width":"2.6","stroke-linecap":"round","stroke-linejoin":"round"})]});function af(){const[e,t]=ye(cs());Wt(()=>{var o;const l=()=>t(cs());addEventListener("popstate",l),addEventListener("routechange",l);try{(o=window.parent)==null||o.postMessage({queryString:location.search.slice(1),hash:""},"https://huggingface.co")}catch{}return()=>{removeEventListener("popstate",l),removeEventListener("routechange",l)}},[]);const n=!e.model&&!e.author;return c(et,{children:[c("header",{class:"top",children:c("div",{class:"wrap",children:[c("a",{class:"brand",href:"?",onClick:l=>{l.preventDefault(),Xe({})},children:[c(rf,{}),c("span",{children:"Model Pulse"})]}),!n&&c(Yn,{hotkey:!0,onPick:l=>Xe({model:l})}),c("nav",{children:[!n&&c("a",{class:"hide-sm",href:"?",onClick:l=>{l.preventDefault(),Xe({})},children:"Rankings"}),c("a",{class:"like",href:no,target:"_top",title:"Like Model Pulse on Hugging Face",children:[c("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:c("path",{d:"M12 21s-7.5-4.6-9.6-9.3C.9 8.2 3 4.5 6.6 4.5c2.1 0 3.6 1.1 5.4 3 1.8-1.9 3.3-3 5.4-3 3.6 0 5.7 3.7 4.2 7.2C19.5 16.4 12 21 12 21z"})}),c("span",{class:"t",children:"Like"})]})]})]})}),c("main",{children:e.model?c(of,{route:e},e.model):e.author?c(Qu,{route:e},e.author):c(ef,{})}),c("footer",{class:"foot",children:c("div",{class:"wrap",children:[c("span",{children:["Data from daily snapshots of ",c("a",{href:"https://huggingface.co/datasets/cfahlgren1/hub-stats",target:"_blank",rel:"noopener",children:"cfahlgren1/hub-stats"}),", refreshed every day. An independent project, not affiliated with Hugging Face."]}),c("span",{children:["Download counts follow the ",c("a",{href:"https://huggingface.co/docs/hub/models-download-stats",target:"_blank",rel:"noopener",children:"Hub's own counting rules"}),"."]})]})})]})}Ua(c(af,{}),document.getElementById("app"));