vite-plugin-kiru 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +10 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5409,15 +5409,17 @@ function updatePluginState(state, config, opts) {
5409
5409
  }
5410
5410
 
5411
5411
  // ../devtools-host/dist/index.js
5412
- var dist_default = `var Dg=Object.create;var so=Object.defineProperty;var Ag=Object.getOwnPropertyDescriptor;var Og=Object.getOwnPropertyNames;var Rg=Object.getPrototypeOf,Ig=Object.prototype.hasOwnProperty;var Ng=(e,t,n)=>t in e?so(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t)=>()=>(e&&(t=e(e=0)),t);var Lg=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wr=(e,t)=>{for(var n in t)so(e,n,{get:t[n],enumerable:!0})},zg=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Og(t))!Ig.call(e,s)&&s!==n&&so(e,s,{get:()=>t[s],enumerable:!(i=Ag(t,s))||i.enumerable});return e};var Vg=(e,t,n)=>(n=e!=null?Dg(Rg(e)):{},zg(t||!e||!e.__esModule?so(n,"default",{value:e,enumerable:!0}):n,e));var F=(e,t,n)=>Ng(e,typeof t!="symbol"?t+"":t,n);var jr,R,rt,ct=M(()=>{"use strict";jr="production";if(jr!=="development"&&jr!=="production")throw new Error("NODE_ENV must either be set to development or production.");R=jr==="development",rt="window"in globalThis&&typeof window<"u"});var $r,On,Yt,Ur,ee,je,si,Nc,Gr,oi,ne,ie,Rn,Kt,$e,ji,Lc,Yr,oo,zc,at=M(()=>{"use strict";$r=Symbol.for("kiru.signal"),On=Symbol.for("kiru.context"),Yt=Symbol.for("kiru.fragment"),Ur=Symbol.for("kiru.error"),ee=Symbol.for("kiru.hmrAccept"),je=Symbol.for("kiru.errorBoundary"),si=Symbol.for("kiru.streamData"),Nc=Symbol.for("kiru.devFileLink"),Gr=50,oi="kiru:deferred",ne=2,ie=4,Rn=8,Kt=16,$e=128,ji=/^on:?/,Lc=new Set(["kiru-head-outlet","kiru-body-outlet","area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),Yr=new Set(["animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","path","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","title","tspan","use"]),oo=new Set(["allowfullscreen","autofocus","autoplay","async","checked","compact","controls","contenteditable","declare","default","defer","disabled","download","hidden","inert","ismap","multiple","nohref","noresize","noshade","novalidate","nowrap","open","popover","readonly","required","sandbox","scoped","selected","sortable","spellcheck","translate","wrap"]),zc=new Map([["acceptCharset","accept-charset"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["httpEquiv","http-equiv"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]])});var Vc=M(()=>{"use strict"});function Fc(e){return typeof e=="string"||typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"||e===void 0||e===null}var Hc=M(()=>{"use strict"});var K,pt,Bc,ri,ro,xt=M(()=>{"use strict";ct();K={current:null},pt={current:rt?"dom":"string"},Bc={current:"dynamic"},ri=new WeakMap,ro=[]});function Kr(){let e=document.activeElement;e===document.body||!(e instanceof HTMLElement)||(e.addEventListener("blur",Wc),In=e)}function Xr(){In&&(In.removeEventListener("blur",Wc),In.isConnected&&In.focus(),In=null)}function qr(e){return t=>{if(In){t.preventDefault(),t.stopPropagation();return}e(t)}}function Wc(e){e.preventDefault(),e.stopPropagation()}var In,Zr=M(()=>{"use strict";In=null});function lo(e){let{dom:t,prev:n,props:i,cleanups:s}=e,o=n?.props??{},r=i??{};if(Zg(t)){let p=r.nodeValue;!L.isSignal(p)&&t.nodeValue!==p&&(t.nodeValue=p);return}if(!n){jg(e,t,r,s);let p=r.ref;p&&Nn(p,t);return}let a=new Set,l,c;for(let p in o){let b=o[p],x=r[p];if(b!==x){if(p.length>=2&&p.charCodeAt(0)===111&&p.charCodeAt(1)===110&&!x){c??(c=cn.get(e)??{}),cn.set(e,c);let y=p.replace(ji,""),w=c[y];w&&(t.removeEventListener(y,w),delete c[y]);continue}L.isSignal(b)&&s?.[p]&&(s[p](),delete s[p]),a.add(p)}}for(let p in r)(!(p in o)||o[p]!==r[p])&&a.add(p);let u=Array.from(a);if(ao(t)&&u.length>1){let p=a,b=!1,x=!1,y=[],w=!1,_=!1;for(let T in r){let E=T.length>=2&&T.charCodeAt(0)===111&&T.charCodeAt(1)===110;E?w=!0:_=!0;let P=!E&&T.startsWith("bind:")?T.slice(5):T,O=Uc(P,E);O===1?(b=!0,p.has(T)&&(x=!0)):O===5&&y.push(T)}if(b&&x)for(let T of y)!p.has(T)&&T in r&&(u.push(T),p.add(T));(b&&x||w&&_)&&u.length>1&&$c(u)}for(let p=0;p<u.length;p++){let b=u[p],x=o[b],y=r[b];if(!Qr.has(b)){if(b.length>=2&&b.charCodeAt(0)===111&&b.charCodeAt(1)===110){c??(c=cn.get(e)??{}),cn.set(e,c);let w=b.replace(ji,""),_=c[w];if(!y){_&&(t.removeEventListener(w,_),delete c[w]);continue}let S=y.bind(void 0);if((w==="focus"||w==="blur")&&(S=qr(S)),_){_.handleEvent=S;continue}t.addEventListener(w,c[w]={handleEvent:S});continue}if(L.isSignal(y)){Yc(e,t,b,y,x);continue}if(b==="style"&&typeof y=="object"&&y!==null){if(s?.style&&(s.style(),delete s.style),l||(l=new Map),co(t,y,x,!0),l.size>0){let w=[];for(let[_,S]of l.entries())w.push(S.subscribe(_.startsWith("--")?T=>Ui(t,_,T):T=>Gi(t,_,T)));l.clear(),se(e,"style",()=>w.forEach(_=>_()))}continue}Yi(t,b,y,x)}}let d=o.ref,f=r.ref;d!==f&&(d&&Nn(d,null),f&&Nn(f,t))}function jc(e,t,n,i){let s;for(let r in n){let a=n[r];if(!Qr.has(r)){if(r.length>=2&&r.charCodeAt(0)===111&&r.charCodeAt(1)===110){s??(s=cn.get(e)??{}),cn.set(e,s);let l=r.replace(ji,""),c=s[l];c&&(t.removeEventListener(l,c),delete s[l]);continue}if(L.isSignal(a)&&i?.[r]){i[r](),delete i[r];continue}if(r==="style"){i?.style&&(i.style(),delete i.style),ao(t)&&co(t,void 0,a);continue}ao(t)&&Yi(t,r,void 0,a)}}let o=n.ref;o&&Nn(o,null)}function jg(e,t,n,i){let s=Object.keys(n);ao(t)&&s.length>1&&$c(s);let o;for(let r=0;r<s.length;r++){let a=s[r],l=n[a];if(!Qr.has(a)){if(a.length>=2&&a.charCodeAt(0)===111&&a.charCodeAt(1)===110){if(!l)continue;o??(o=cn.get(e)??{}),cn.set(e,o);let c=a.replace(ji,""),u=o[c],d=l.bind(void 0);(c==="focus"||c==="blur")&&(d=qr(d)),u?u.handleEvent=d:t.addEventListener(c,o[c]={handleEvent:d});continue}if(L.isSignal(l)){Yc(e,t,a,l,void 0);continue}if(a==="style"&&typeof l=="object"&&l!==null){if(co(t,l,void 0,!0),$i.size>0){i??(i={});for(let[c,u]of $i.entries()){let d=\`style-\${c}\`;i[d]?.(),i[d]=u.subscribe(c.startsWith("--")?f=>Ui(t,c,f):f=>Gi(t,c,f))}$i.clear()}continue}Yi(t,a,l,void 0)}}}function $c(e){if(e.length<=1)return;for(let n=0;n<7;n++)Jr[n].length=0;for(let n=0;n<e.length;n++){let i=e[n],s=i.length>=2&&i.charCodeAt(0)===111&&i.charCodeAt(1)===110,o=i;!s&&i.length>5&&i.charCodeAt(4)===58&&(o=i.slice(5));let r=Uc(o,s),a;r<=0?a=0:r===1?a=1:r===2?a=2:r===3?a=3:r===5?a=4:r>=9?a=6:a=5,Jr[a].push(i)}let t=0;for(let n=0;n<7;n++){let i=Jr[n];for(let s=0;s<i.length;s++)e[t++]=i[s]}}function Uc(e,t){if(t)return 9;switch(e){case"innerHTML":case"type":case"muted":case"autoplay":case"loop":return 0;case"min":case"max":case"step":case"pattern":case"accept":case"multiple":case"preload":case"minLength":case"maxLength":case"crossOrigin":case"decoding":case"loading":case"referrerPolicy":return 1;case"style":case"className":return 3;case"value":case"checked":case"selected":case"open":case"src":return 5;default:return 4}}function Gc(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}let n=e.options,i=n.length;for(let s=0;s<i;s++){let o=n[s];o.selected=t.indexOf(o.value)>-1}}function Yc(e,t,n,i,s){let o=n.indexOf(":"),r=o===-1?n:n.slice(0,o),a=o===-1?void 0:n.slice(o+1);if(r==="bind"){let u=Hg[a];if(!u){R&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let d=i.peek(),f=$g(e,t,a,u,i,d);se(e,n,f)}else{let u=i.subscribe((d,f)=>{d!==f&&(Yi(t,n,d,f),R&&Xc(e))});se(e,n,u)}let l=i.peek(),c=q(s);r!=="bind"&&l!==c&&Yi(t,a??r,l,c)}function $g(e,t,n,i,s,o){let r=b=>{s.sneak(b),s.notify(x=>x!==l)},a=t.nodeName==="SELECT"&&n==="value"?b=>Gc(t,b):b=>t[n]=b,l=b=>{a(b),R&&Xc(e)},c,u;n==="value"?(c=Kg(t),u=()=>r(c())):u=()=>{let b=t[n];n==="currentTime"&&s.peek()===b||r(b)},o!==void 0&&l(o);let d;n==="value"&&c?d=c():d=t[n];let f=s.peek();d!==f&&r(d),t.addEventListener(i,u);let p=s.subscribe(l);return()=>{t.removeEventListener(i,u),p()}}function Yi(e,t,n,i){switch(t){case"style":return co(e,n,i);case"className":return Yg(e,n);case"innerHTML":return Gg(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return Gc(e,n);let s=n==null?"":String(n);if(Wg.has(e.nodeName)){e.value=s;return}e.setAttribute("value",s);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!n;return}e.setAttribute("checked",String(n));return;default:return Ug(e,ea(t),n)}}function Ug(e,t,n){let i=oo.has(t);Kc(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}function Gg(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function Yg(e,t){let n=q(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function Ui(e,t,n){if(n==null){e.style.removeProperty(t);return}e.style.setProperty(t,String(n))}function Gi(e,t,n){e.style[t]=n!=null?String(n):""}function co(e,t,n,i=!1){if(Kc(e,"style",t))return;let s=q(t);if(s==null){e.removeAttribute("style");return}if(typeof s=="string"){e.setAttribute("style",s);return}let o={},r=q(n);typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r!==null&&(o=r);let a=s,l=Object.keys(o),c=Object.keys(a);if(l.length===0){for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=q(p);i&&L.isSignal(p)&&$i.set(f,p),f.startsWith("--")?Ui(e,f,b):Gi(e,f,b)}return}let u=new Set(c);for(let d=0;d<l.length;d++){let f=l[d];u.has(f)||(f.startsWith("--")?Ui(e,f,void 0):Gi(e,f,void 0))}for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=q(o[f]),x=q(p);i&&L.isSignal(p)&&$i.set(f,p),b!==x&&(f.startsWith("--")?Ui(e,f,x):Gi(e,f,x))}}function Kc(e,t,n,i=!1){if(n===null)return e.removeAttribute(t),!0;switch(typeof n){case"undefined":case"function":case"symbol":return e.removeAttribute(t),!0;case"boolean":if(i&&!n)return e.removeAttribute(t),!0}return!1}function Kg(e){return e.nodeName==="INPUT"?Xg(e):e.nodeName==="SELECT"?()=>qg(e):()=>e.value}function Xg(e){let t=e.type;return Bg.has(t)?()=>e.valueAsNumber:()=>e.value}function qg(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Xc(e){rt&&window.__kiru?.profilingContext?.emit("signalAttrUpdate",Lt(e))}function ao(e){return e.nodeType===1}function Zg(e){return e.nodeType===3}var cn,Qr,Jr,Hg,Bg,Wg,$i,ta=M(()=>{"use strict";Z();fe();Ln();at();ct();Zr();cn=new WeakMap,Qr=new Set(["children","ref","key"]),Jr=[[],[],[],[],[],[],[]],Hg={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},Bg=new Set(["progress","meter","number","range"]),Wg=new Set(["INPUT","TEXTAREA"]);$i=new Map});var Ki,zn,he,na=M(()=>{"use strict";Ki=[],zn=[],he={bumpChildIndex(){zn[zn.length-1]++},getCurrentChild(){let e=zn[zn.length-1];return this.getCurrentParent().childNodes[e]},getCurrentParent(){return Ki[Ki.length-1]},clear(){Ki.length=0,zn.length=0},pop(){Ki.pop(),zn.pop()},push(e){Ki.push(e),zn.push(0)}}});function Jg(e){let t=e,n=[];for(;t&&t.parent;)typeof t.type=="function"?n.push(Qg(t.type)):typeof t.type=="string"&&n.push(t.type),t=t.parent;let i=typeof e.type=="function"?e:ia(e,s=>typeof s.type=="function");return\`The above error occurred in the <\${Zc(i?.type||Jc)}> component:
5412
+ var dist_default = `var Og=Object.create;var oo=Object.defineProperty;var Ig=Object.getOwnPropertyDescriptor;var Ng=Object.getOwnPropertyNames;var Lg=Object.getPrototypeOf,zg=Object.prototype.hasOwnProperty;var Vg=(e,t,n)=>t in e?oo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t)=>()=>(e&&(t=e(e=0)),t);var Fg=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),jr=(e,t)=>{for(var n in t)oo(e,n,{get:t[n],enumerable:!0})},Hg=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ng(t))!zg.call(e,s)&&s!==n&&oo(e,s,{get:()=>t[s],enumerable:!(i=Ig(t,s))||i.enumerable});return e};var Bg=(e,t,n)=>(n=e!=null?Og(Lg(e)):{},Hg(t||!e||!e.__esModule?oo(n,"default",{value:e,enumerable:!0}):n,e));var F=(e,t,n)=>Vg(e,typeof t!="symbol"?t+"":t,n);var $r,A,ct,dt=M(()=>{"use strict";$r="production";if($r!=="development"&&$r!=="production")throw new Error("NODE_ENV must either be set to development or production.");A=$r==="development",ct="window"in globalThis&&typeof window<"u"});var Ur,In,Jt,Gr,re,Ke,ai,$i,Yr,li,ae,le,Nn,Qt,Xe,Ui,Lc,Kr,ro,zc,ut=M(()=>{"use strict";Ur=Symbol.for("kiru.signal"),In=Symbol.for("kiru.context"),Jt=Symbol.for("kiru.fragment"),Gr=Symbol.for("kiru.error"),re=Symbol.for("kiru.hmrAccept"),Ke=Symbol.for("kiru.errorBoundary"),ai=Symbol.for("kiru.streamData"),$i=Symbol.for("kiru.devFileLink"),Yr=50,li="kiru:deferred",ae=2,le=4,Nn=8,Qt=16,Xe=128,Ui=/^on:?/,Lc=new Set(["kiru-head-outlet","kiru-body-outlet","area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),Kr=new Set(["animateTransform","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","path","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","title","tspan","use"]),ro=new Set(["allowfullscreen","autofocus","autoplay","async","checked","compact","controls","contenteditable","declare","default","defer","disabled","download","hidden","inert","ismap","multiple","nohref","noresize","noshade","novalidate","nowrap","open","popover","readonly","required","sandbox","scoped","selected","sortable","spellcheck","translate","wrap"]),zc=new Map([["acceptCharset","accept-charset"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["httpEquiv","http-equiv"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]])});var Vc=M(()=>{"use strict"});function Fc(e){return typeof e=="string"||typeof e=="number"||typeof e=="bigint"||typeof e=="boolean"||e===void 0||e===null}var Hc=M(()=>{"use strict"});var K,mt,Bc,Ln,ao,yt=M(()=>{"use strict";dt();K={current:null},mt={current:ct?"dom":"string"},Bc={current:"dynamic"},Ln=new WeakMap,ao=[]});function Xr(){let e=document.activeElement;e===document.body||!(e instanceof HTMLElement)||(e.addEventListener("blur",Wc),zn=e)}function qr(){zn&&(zn.removeEventListener("blur",Wc),zn.isConnected&&zn.focus(),zn=null)}function Zr(e){return t=>{if(zn){t.preventDefault(),t.stopPropagation();return}e(t)}}function Wc(e){e.preventDefault(),e.stopPropagation()}var zn,Jr=M(()=>{"use strict";zn=null});function co(e){let{dom:t,prev:n,props:i,cleanups:s}=e,o=n?.props??{},r=i??{};if(tm(t)){let p=r.nodeValue;if(A&&L.isSignal(p)&&(p=J(p)),!L.isSignal(p)){t.nodeValue!==p&&(t.nodeValue=p);return}if(o.nodeValue===p)return;t.nodeValue=String(p.peek()??""),A&&(s?.nodeValue?.(),At(e,"nodeValue",p.subscribe((b,x)=>{b!==x&&(t.nodeValue=String(b??""),ct&&window.__kiru?.profilingContext?.emit("signalTextUpdate",Rt(e)))})));return}if(!n){Gg(e,t,r,s);let p=r.ref;p&&Vn(p,t);return}let a=new Set,l,c;for(let p in o){let b=o[p],x=r[p];if(b!==x){if(p.length>=2&&p.charCodeAt(0)===111&&p.charCodeAt(1)===110&&!x){c??(c=hn.get(e)??{}),hn.set(e,c);let y=p.replace(Ui,""),w=c[y];w&&(t.removeEventListener(y,w),delete c[y]);continue}L.isSignal(b)&&s?.[p]&&(s[p](),delete s[p]),a.add(p)}}for(let p in r)(!(p in o)||o[p]!==r[p])&&a.add(p);let u=Array.from(a);if(lo(t)&&u.length>1){let p=a,b=!1,x=!1,y=[],w=!1,_=!1;for(let E in r){let T=E.length>=2&&E.charCodeAt(0)===111&&E.charCodeAt(1)===110;T?w=!0:_=!0;let R=!T&&E.startsWith("bind:")?E.slice(5):E,O=Uc(R,T);O===1?(b=!0,p.has(E)&&(x=!0)):O===5&&y.push(E)}if(b&&x)for(let E of y)!p.has(E)&&E in r&&(u.push(E),p.add(E));(b&&x||w&&_)&&u.length>1&&$c(u)}for(let p=0;p<u.length;p++){let b=u[p],x=o[b],y=r[b];if(!ta.has(b)){if(b.length>=2&&b.charCodeAt(0)===111&&b.charCodeAt(1)===110){c??(c=hn.get(e)??{}),hn.set(e,c);let w=b.replace(Ui,""),_=c[w];if(!y){_&&(t.removeEventListener(w,_),delete c[w]);continue}let S=y.bind(void 0);if((w==="focus"||w==="blur")&&(S=Zr(S)),_){_.handleEvent=S;continue}t.addEventListener(w,c[w]={handleEvent:S});continue}if(L.isSignal(y)){Yc(e,t,b,y,x);continue}if(b==="style"&&typeof y=="object"&&y!==null){if(s?.style&&(s.style(),delete s.style),l||(l=new Map),uo(t,y,x,!0),l.size>0){let w=[];for(let[_,S]of l.entries())w.push(S.subscribe(_.startsWith("--")?E=>Yi(t,_,E):E=>Ki(t,_,E)));l.clear(),At(e,"style",()=>w.forEach(_=>_()))}continue}Xi(t,b,y,x)}}let d=o.ref,f=r.ref;d!==f&&(d&&Vn(d,null),f&&Vn(f,t))}function jc(e,t,n,i){let s;for(let r in n){let a=n[r];if(!ta.has(r)){if(r.length>=2&&r.charCodeAt(0)===111&&r.charCodeAt(1)===110){s??(s=hn.get(e)??{}),hn.set(e,s);let l=r.replace(Ui,""),c=s[l];c&&(t.removeEventListener(l,c),delete s[l]);continue}if(L.isSignal(a)&&i?.[r]){i[r](),delete i[r];continue}if(r==="style"){i?.style&&(i.style(),delete i.style),lo(t)&&uo(t,void 0,a);continue}lo(t)&&Xi(t,r,void 0,a)}}let o=n.ref;o&&Vn(o,null)}function Gg(e,t,n,i){let s=Object.keys(n);lo(t)&&s.length>1&&$c(s);let o;for(let r=0;r<s.length;r++){let a=s[r],l=n[a];if(!ta.has(a)){if(a.length>=2&&a.charCodeAt(0)===111&&a.charCodeAt(1)===110){if(!l)continue;o??(o=hn.get(e)??{}),hn.set(e,o);let c=a.replace(Ui,""),u=o[c],d=l.bind(void 0);(c==="focus"||c==="blur")&&(d=Zr(d)),u?u.handleEvent=d:t.addEventListener(c,o[c]={handleEvent:d});continue}if(L.isSignal(l)){Yc(e,t,a,l,void 0);continue}if(a==="style"&&typeof l=="object"&&l!==null){if(uo(t,l,void 0,!0),Gi.size>0){i??(i={});for(let[c,u]of Gi.entries()){let d=\`style-\${c}\`;i[d]?.(),i[d]=u.subscribe(c.startsWith("--")?f=>Yi(t,c,f):f=>Ki(t,c,f))}Gi.clear()}continue}Xi(t,a,l,void 0)}}}function $c(e){if(e.length<=1)return;for(let n=0;n<7;n++)Qr[n].length=0;for(let n=0;n<e.length;n++){let i=e[n],s=i.length>=2&&i.charCodeAt(0)===111&&i.charCodeAt(1)===110,o=i;!s&&i.length>5&&i.charCodeAt(4)===58&&(o=i.slice(5));let r=Uc(o,s),a;r<=0?a=0:r===1?a=1:r===2?a=2:r===3?a=3:r===5?a=4:r>=9?a=6:a=5,Qr[a].push(i)}let t=0;for(let n=0;n<7;n++){let i=Qr[n];for(let s=0;s<i.length;s++)e[t++]=i[s]}}function Uc(e,t){if(t)return 9;switch(e){case"innerHTML":case"type":case"muted":case"autoplay":case"loop":return 0;case"min":case"max":case"step":case"pattern":case"accept":case"multiple":case"preload":case"minLength":case"maxLength":case"crossOrigin":case"decoding":case"loading":case"referrerPolicy":return 1;case"style":case"className":return 3;case"value":case"checked":case"selected":case"open":case"src":return 5;default:return 4}}function Gc(e,t){if(!e.multiple||t===void 0||t===null||t===""){e.value=t;return}let n=e.options,i=n.length;for(let s=0;s<i;s++){let o=n[s];o.selected=t.indexOf(o.value)>-1}}function Yc(e,t,n,i,s){let o=n.indexOf(":"),r=o===-1?n:n.slice(0,o),a=o===-1?void 0:n.slice(o+1);if(r==="bind"){let u=jg[a];if(!u){A&&console.error(\`[kiru]: \${a} is not a valid element binding attribute.\`);return}let d=i.peek(),f=Yg(e,t,a,u,i,d);At(e,n,f)}else{let u=i.subscribe((d,f)=>{d!==f&&(Xi(t,n,d,f),A&&Xc(e))});At(e,n,u)}let l=i.peek(),c=Z(s);r!=="bind"&&l!==c&&Xi(t,a??r,l,c)}function Yg(e,t,n,i,s,o){let r=b=>{s.sneak(b),s.notify(x=>x!==l)},a=t.nodeName==="SELECT"&&n==="value"?b=>Gc(t,b):b=>t[n]=b,l=b=>{a(b),A&&Xc(e)},c,u;n==="value"?(c=Zg(t),u=()=>r(c())):u=()=>{let b=t[n];n==="currentTime"&&s.peek()===b||r(b)},o!==void 0&&l(o);let d;n==="value"&&c?d=c():d=t[n];let f=s.peek();d!==f&&r(d),t.addEventListener(i,u);let p=s.subscribe(l);return()=>{t.removeEventListener(i,u),p()}}function Xi(e,t,n,i){switch(t){case"style":return uo(e,n,i);case"className":return qg(e,n);case"innerHTML":return Xg(e,n);case"muted":e.muted=!!n;return;case"value":if(e.nodeName==="SELECT")return Gc(e,n);let s=n==null?"":String(n);if(Ug.has(e.nodeName)){e.value=s;return}e.setAttribute("value",s);return;case"checked":if(e.nodeName==="INPUT"){e.checked=!!n;return}e.setAttribute("checked",String(n));return;default:return Kg(e,na(t),n)}}function Kg(e,t,n){let i=ro.has(t);Kc(e,t,n,i)||e.setAttribute(t,i&&typeof n=="boolean"?"":String(n))}function Xg(e,t){if(t==null||typeof t=="boolean"){e.innerHTML="";return}e.innerHTML=String(t)}function qg(e,t){let n=Z(t);if(!n)return e.removeAttribute("class");e.setAttribute("class",n)}function Yi(e,t,n){if(n==null){e.style.removeProperty(t);return}e.style.setProperty(t,String(n))}function Ki(e,t,n){e.style[t]=n!=null?String(n):""}function uo(e,t,n,i=!1){if(Kc(e,"style",t))return;let s=Z(t);if(s==null){e.removeAttribute("style");return}if(typeof s=="string"){e.setAttribute("style",s);return}let o={},r=Z(n);typeof r=="string"?e.setAttribute("style",""):typeof r=="object"&&r!==null&&(o=r);let a=s,l=Object.keys(o),c=Object.keys(a);if(l.length===0){for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=Z(p);i&&L.isSignal(p)&&Gi.set(f,p),f.startsWith("--")?Yi(e,f,b):Ki(e,f,b)}return}let u=new Set(c);for(let d=0;d<l.length;d++){let f=l[d];u.has(f)||(f.startsWith("--")?Yi(e,f,void 0):Ki(e,f,void 0))}for(let d=0;d<c.length;d++){let f=c[d],p=a[f],b=Z(o[f]),x=Z(p);i&&L.isSignal(p)&&Gi.set(f,p),b!==x&&(f.startsWith("--")?Yi(e,f,x):Ki(e,f,x))}}function Kc(e,t,n,i=!1){if(n===null)return e.removeAttribute(t),!0;switch(typeof n){case"undefined":case"function":case"symbol":return e.removeAttribute(t),!0;case"boolean":if(i&&!n)return e.removeAttribute(t),!0}return!1}function Zg(e){return e.nodeName==="INPUT"?Jg(e):e.nodeName==="SELECT"?()=>Qg(e):()=>e.value}function Jg(e){let t=e.type;return $g.has(t)?()=>e.valueAsNumber:()=>e.value}function Qg(e){return e.multiple?Array.from(e.selectedOptions).map(t=>t.value):e.value}function Xc(e){ct&&window.__kiru?.profilingContext?.emit("signalAttrUpdate",Rt(e))}function lo(e){return e.nodeType===1}function tm(e){return e.nodeType===3}var hn,ta,Qr,jg,$g,Ug,Gi,ea=M(()=>{"use strict";q();ce();Fn();ut();dt();Jr();hn=new WeakMap,ta=new Set(["children","ref","key"]),Qr=[[],[],[],[],[],[],[]],jg={value:"input",checked:"change",open:"toggle",volume:"volumechange",playbackRate:"ratechange",currentTime:"timeupdate"},$g=new Set(["progress","meter","number","range"]),Ug=new Set(["INPUT","TEXTAREA"]);Gi=new Map});var qi,Hn,ye,ia=M(()=>{"use strict";qi=[],Hn=[],ye={bumpChildIndex(){Hn[Hn.length-1]++},getCurrentChild(){let e=Hn[Hn.length-1];return this.getCurrentParent().childNodes[e]},getCurrentParent(){return qi[qi.length-1]},clear(){qi.length=0,Hn.length=0},pop(){qi.pop(),Hn.pop()},push(e){qi.push(e),Hn.push(0)}}});function em(e){let t=e,n=[];for(;t&&t.parent;)typeof t.type=="function"?n.push(nm(t.type)):typeof t.type=="string"&&n.push(t.type),t=t.parent;let i=typeof e.type=="function"?e:sa(e,s=>typeof s.type=="function");return\`The above error occurred in the <\${Zc(i?.type||Jc)}> component:
5413
5413
 
5414
5414
  \${n.map(s=>\` at \${s}\`).join(\`
5415
5415
  \`)}
5416
- \`}function Qg(e){let t=Zc(e);if(R){let n=tm(e);n&&(t=\`\${t} (\${n})\`)}return t}function Zc(e){return e.displayName??(e.name||"Anonymous Function")}function tm(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var qc,Et,ai=M(()=>{"use strict";at();ct();Z();Et=class extends Error{constructor(t){let n=typeof t=="string"?t:t.message;super(n),this[qc]=!0,typeof t!="string"&&(R&&t?.vNode&&(this.customNodeStack=Jg(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Ur]===!0}};qc=Ur});function oa(e){let t=e.type;return t=="#text"?sm(e):Yr.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function ra(e){let t=e.type==="#text"?im(e):he.getCurrentChild();if(he.bumpChildIndex(),!t)throw new Et({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Yr.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Et({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&Kt)){lo(e);return}L.isSignal(e.props.nodeValue)&&sa(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){let o=s;he.bumpChildIndex();let r=String(q(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,L.isSignal(o.props.nodeValue)&&sa(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Qc(e){let t=e.parent,n=t?.dom;for(;t&&!n;)t=t.parent,n=t?.dom;if(!n||!t){if(!e.parent&&e.dom)return e;throw new Et({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function tu(e,t){let{node:n,lastChild:i}=t,s=e.dom;if(i){i.after(s);return}let o=em(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function em(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(ie|Kt))){let s=nm(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&Kt||n===t)return}}function nm(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&Kt)return;t=t.child}}function im(e){let t=e.props.nodeValue;if(!L.isSignal(t))return he.getCurrentChild();let n=t.peek();if(un(n))return he.getCurrentChild();let i=eu(e,t),s=he.getCurrentChild();return s?(s.before(i),i):he.getCurrentParent().appendChild(i)}function sa(e,t,n){let i=n.subscribe((s,o)=>{s!==o&&(t.nodeValue=s,R&&rt&&window.__kiru?.profilingContext?.emit("signalTextUpdate",Lt(e)))});se(e,"nodeValue",i)}function sm(e){let{nodeValue:t}=e.props;return L.isSignal(t)?eu(e,t):document.createTextNode(t)}function eu(e,t){let n=t.peek()??"",i=document.createTextNode(n);return sa(e,i,t),i}var aa=M(()=>{"use strict";at();fe();Ln();na();Z();ai();ct();ta()});function ca(e){if(pt.current==="hydrate")return dn(e,uo);let t={node:e.dom?e:Qc(e)};la(e,t,(e.flags&ie)>0),e.dom&&!(e.flags&Kt)&&nu(e,t,!1),uo(e)}function la(e,t,n){let i=e.child;for(;i;)i.dom?(la(i,{node:i},!1),i.flags&Kt||nu(i,t,n)):la(i,t,(i.flags&ie)>0||n),uo(i),i=i.sibling}function nu(e,t,n){if((n||!e.dom.isConnected||e.flags&ie)&&tu(e,t),R&&e.prev&&Xi()){let{dom:i,prev:s,cleanups:o}=e;jc(e,i,s.props,o),e.prev=null}(!e.prev||e.flags&ne)&&lo(e),t.lastChild=e.dom}function ua(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;R&&(t=Lt(e)),dn(e,n=>{let{subs:i,cleanups:s,dom:o,props:{ref:r},hooks:a}=n;if(i?.forEach(l=>l()),s&&Object.values(s).forEach(l=>l()),a){let{preCleanups:l,postCleanups:c}=a;ro.push(...c),l.forEach(zt),l.length=c.length=0}R&&(window.__kiru.profilingContext?.emit("removeNode",t),o instanceof Element&&delete o.__kiruNode),o&&(o.isConnected&&!(n.flags&Kt)&&o.remove(),r&&Nn(r,null),delete n.dom)}),e.parent=null}var iu=M(()=>{"use strict";Z();at();ct();xt();qi();ta();aa()});var su=M(()=>{"use strict";iu();Zr();aa()});function m(e,t=null,...n){e===vt&&(e=Yt);let i=t===null?{}:t,s=da(i.key),o=n.length;return o===1?i.children=n[0]:o>1&&(i.children=n),{type:e,key:s,props:i}}function vt({children:e,key:t}){return{type:Yt,key:da(t),props:{children:e}}}var li=M(()=>{"use strict";at();Z()});function fo(e,t=null,n={},i=null,s=0){e===vt&&(e=Yt);let o=t?t.depth+1:0;return{type:e,key:i,props:n,parent:t,index:s,depth:o,flags:0,child:null,sibling:null,prev:null,deletions:null}}var fa=M(()=>{"use strict";at();li()});function go(e,t){return R&&(ga=Lt(e)),Array.isArray(t)?(R&&(uu in t&&cm(e,t),lm(e,t)),rm(e,t)):om(e,t)}function om(e,t){let n=e.child;if(n===null)return lu(e,t);let i=n.sibling,s=ru(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?pa(e,n):i&&pa(e,i),s;{let o=du(n),r=cu(o,e,0,t);if(r!==null){let a=r.prev;if(a!==null){let l=a.key;o.delete(l===null?a.index:l)}ho(r,0,0)}return o.forEach(a=>po(e,a)),r}}function rm(e,t){let n=null,i=null,s=e.child,o=null,r=0,a=0;for(;s!==null&&a<t.length;a++){s.index>a?(o=s,s=null):o=s.sibling;let c=ru(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&po(e,s),r=ho(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return pa(e,s),n;if(s===null){for(;a<t.length;a++){let c=lu(e,t[a]);c!==null&&(r=ho(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}let l=du(s);for(;a<t.length;a++){let c=cu(l,e,a,t[a]);if(c!==null){let u=c.prev;if(u!==null){let d=u.key;l.delete(d===null?u.index:d)}r=ho(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>po(e,c)),n}function ru(e,t,n){let i=t===null?null:t.key;return un(n)?i!==null||t?.type==="#text"&&L.isSignal(t.props.nodeValue)?null:ou(e,t,""+n):L.isSignal(n)?t&&t.props.nodeValue!==n?null:ou(e,t,n):ci(n)?n.key!==i?null:am(e,t,n):Array.isArray(n)?i!==null?null:(R&&ma(n),au(e,t,n)):null}function ou(e,t,n){return t===null||t.type!=="#text"?Se(e,"#text",{nodeValue:n}):(R&&Zi(),t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ne),t.sibling=null,t)}function am(e,t,n){let{type:i,props:s,key:o}=n;return R&&typeof i=="function"&&(i=wt(i)),i===Yt?au(e,t,s.children||[],s):t?.type===i?(R&&Zi(),t.index=0,t.sibling=null,typeof i=="string"?pu(t.props,s)&&(t.flags|=ne):t.flags|=ne,t.props=s,t):Se(e,i,s,o)}function au(e,t,n,i={}){return t===null||t.type!==Yt?Se(e,Yt,{children:n,...i}):(R&&Zi(),t.props={...t.props,...i,children:n},t.flags|=ne,t.sibling=null,t)}function lu(e,t){return un(t)?Se(e,"#text",{nodeValue:""+t}):L.isSignal(t)?Se(e,"#text",{nodeValue:t}):ci(t)?Se(e,t.type,t.props,t.key):Array.isArray(t)?(R&&ma(t),Se(e,Yt,{children:t})):null}function ho(e,t,n){e.index=n;let i=e.prev;if(i!==null){let s=i.index;return s<t?(e.flags|=ie,t):s}else return e.flags|=ie,t}function cu(e,t,n,i){if(L.isSignal(i)||un(i)){let o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&L.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}return Se(t,"#text",{nodeValue:i},null,n)}if(ci(i)){let{type:o,props:r,key:a}=i,l=e.get(a===null?n:a);return l?.type===o?(R&&Zi(),typeof o=="string"?pu(l.props,r)&&(l.flags|=ne):l.flags|=ne,l.props=r,l.sibling=null,l.index=n,l):Se(t,o,r,a,n)}if(Array.isArray(i)){let o={children:i},r=e.get(n);return R&&ma(i),r?(R&&Zi(),r.flags|=ne,r.props=o,r):Se(t,Yt,o,null,n)}return null}function Zi(){rt&&window.__kiru.profilingContext?.emit("updateNode",ga)}function ma(e){Object.assign(e,{[uu]:!0})}function du(e){let t=new Map;for(;e;){let n=e.key;t.set(n===null?e.index:n,e),e=e.sibling}return t}function po(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function pa(e,t){for(;t;)po(e,t),t=t.sibling}function lm(e,t){let n=new Set,i=!1;for(let s of t){if(!ci(s))continue;let o=s.key;if(typeof o=="string"){if(!i&&n.has(o)){let r=hu(e);fu(\`\${r} component produced a child in a list with a duplicate key prop: "\${o}". Keys should be unique so that components maintain their identity across updates\`),i=!0}n.add(o)}}}function cm(e,t){let n=!1,i=!1;for(let s of t)ci(s)&&(typeof s.key=="string"?n=!0:i=!0);if(i&&n){let s=hu(e);fu(\`\${s} component produced a child in a list without a valid key prop\`)}}function fu(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}function hu(e){if(ha.has(e))return ha.get(e);let t=e.parent,n;for(;!n&&t;)typeof t.type=="function"&&(n=t.type),t=t.parent;let i=\`<\${n?.displayName||n?.name||"Anonymous Function"} />\`;return ha.set(e,i),i}function Se(e,t,n,i=null,s=0){let o=fo(t,e,n,i,s);return o.flags|=ie,R&&rt&&window.__kiru.profilingContext?.emit("createNode",ga),o}function pu(e,t){return mo(e,t,um)}var ga,uu,ha,um,gu=M(()=>{"use strict";at();Z();fe();ct();fa();uu=Symbol("kiru:marked-list-child");ha=new WeakMap;um=["children","key"]});function Ji(e){if(ui){ba.push(e);return}e()}function hn(){ui&&(window.cancelAnimationFrame(xu),vu())}function ka(e){e.flags|=$e,Me.push(e),ui=!0,hn()}function Vt(e){if(pt.current==="hydrate")return Ji(()=>mu(e));mu(e)}function yu(){let e=K.current;if(!e)throw new Error("useRequestUpdate must be called inside a Kiru component");return()=>Vt(e)}function mu(e){if(xa&&(ya=!0),K.current===e){R&&window.__kiru.profilingContext?.emit("updateDirtied",Ee),va=!0;return}if(!(e.flags&($e|Rn))){if(e.flags|=$e,!Me.length){Me.push(e),ui||(ui=!0,xu=window.requestAnimationFrame(vu));return}Me.push(e)}}function dm(e){dn(e,t=>t.flags|=Rn),xo.push(e)}function vu(){if(R){let t=xo[0]??Me[0];t?(Ee=Lt(t),window.__kiru.profilingContext?.beginTick(Ee)):Ee=null}let e=1;for(Kr();Me.length;){Me.length>e&&Me.sort(fm),fn=Me.shift(),e=Me.length;let t=fn.flags;if(!(t&Rn)&&t&$e){let n=fn;for(;n=hm(n););for(;xo.length;)ua(xo.pop());ca(fn),fn.flags&=~$e}}if(Xr(),xa=!0,bo(bu),xa=!1,ya)return ym(),bo(_a),ya=!1,wa++,R&&(window.__kiru.profilingContext?.endTick(Ee),window.__kiru.profilingContext?.emit("updateDirtied",Ee)),hn();for(wa=0,ui=!1;ba.length;)ba.shift()();queueMicrotask(()=>{bo(ro),bo(_a)}),R&&(window.__kiru.emit("update",Ee),window.__kiru.profilingContext?.emit("update",Ee),window.__kiru.profilingContext?.endTick(Ee))}function hm(e){let t=pm(e);if(e.deletions!==null&&(e.deletions.forEach(dm),e.deletions=null),t)return t;let n=e;for(;n;){let{hooks:i}=n;if(i&&(bu.push(...i.pre),_a.push(...i.post),i.pre.length=0,i.post.length=0),n===fn)return null;if(n.sibling)return n.sibling;n=n.parent,pt.current==="hydrate"&&n?.dom&&he.pop()}return null}function pm(e){let{type:t,props:n,prev:i,flags:s}=e;if(!(R&&Xi())){if(i&&(s&$e)===0&&(i.props===n||!mo(i.props,n)))return null}try{return typeof t=="string"?xm(e):yo(t)?gm(e):mm(e)}catch(o){R&&window.__kiru.emit("error",Ee,o instanceof Error?o:new Error(String(o)));let r=wu(e);if(r){let a=r.error=o instanceof Error?o:new Error(String(o));return r.props.onError?.(a),r.depth<fn.depth&&(fn=r),r}if(Et.isKiruError(o)){if(o.customNodeStack&&setTimeout(()=>{throw new Error(o.customNodeStack)}),o.fatal)throw o;return console.error(o),e.child}setTimeout(()=>{throw o})}return null}function gm(e){let{props:t,type:n}=e,i=t.children;if(n===je){let s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}return e.child=go(e,i)}function mm(e){let{type:t,props:n,subs:i}=e,s=(e.flags&$e)===0;try{K.current=e;let o,r=0;do{if(e.flags&=~$e,va=!1,i&&(i.forEach(zt),i.clear()),R&&Xi()){let{hooks:a,cleanups:l}=e;if(l&&(Object.values(l).forEach(zt),delete e.cleanups),a){let{preCleanups:c,postCleanups:u}=a;c.forEach(zt),u.forEach(zt),c.length=u.length=0}delete e.propSyncs,delete e.render}if(o=bm(e,t,n,s),++r>Gr){if(R)throw new Et({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});break}}while(va);return e.child=go(e,o)}finally{K.current=null}}function bm(e,t,n,i){let{render:s,propSyncs:o}=e;if(s){if(i){let a={...n};o?.forEach(l=>l(a))}return s(n)}let r=wt(t)(n);if(typeof r=="function"){if(e.subs?.forEach(zt),e.render=r,i){let a={...n};o?.forEach(l=>l(a))}r=r(n)}else if(R&&ri.has(e))throw new Error("setup() must not be called inside a render function");return r}function xm(e){let{props:t,type:n}=e;return R&&vo(e),e.dom||(pt.current==="hydrate"?ra(e):e.dom=oa(e),R&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),n!=="#text"&&(e.child=go(e,t.children),e.child&&pt.current==="hydrate"&&he.push(e.dom)),e.child}function ym(){if(wa>Gr)throw new Et("Maximum update depth exceeded. This can happen when a component repeatedly calls setState during render or in useLayoutEffect. Kiru limits the number of nested updates to prevent infinite loops.")}function bo(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var Ee,Me,ui,ba,xo,xa,ya,va,wa,bu,_a,xu,fm,fn,Ue=M(()=>{"use strict";at();su();Z();ct();ai();xt();na();gu();qi();Me=[],ui=!1,ba=[],xo=[],xa=!1,ya=!1,va=!1,wa=0,bu=[],_a=[],xu=-1;fm=(e,t)=>t.depth-e.depth,fn=null});var Xt,pe,di=M(()=>{"use strict";Xt=new Map,pe=new Map});function wo(e){let{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e,r;Xt.delete(t);let a=!!K.current&&!_t();a||(r=new Map,fi.stack.push(r));let l=i(...s.map(c=>c.value));if(!a){for(let[u,d]of n)r.has(u)||(d(),n.delete(u));let c=()=>{Xt.size||queueMicrotask(_o),Xt.set(t,o)};for(let[u,d]of r){if(n.has(u))continue;let f=d.subscribe(c);n.set(u,f)}fi.stack.pop()}return l}var fi,Qi=M(()=>{"use strict";xt();Z();di();Ln();fi={enabled:!0,stack:new Array,current:function(){return this.stack[this.stack.length-1]}}});var _u,L,D,fe=M(()=>{"use strict";Z();at();ct();xt();Ue();di();Qi();L=class e{constructor(t,n){this[_u]=!0,this.$id=hi(),this.$value=t,n&&(this.displayName=n),R?(pe.set(this.$id,new Set),this.$initialValue=ku(t),this[ee]={provide:()=>this,inject:s=>{rt&&window.__kiru.devtools?.untrack(s),pe.get(this.$id)?.clear?.(),pe.delete(this.$id),this.$id=s.$id,s.__next=this,this.$initialValue===s.$initialValue?this.$value=s.$value:this.notify()},destroy:()=>{}}):this.$subs=new Set;let i=K.current;i&&se(i,this.$id,e.dispose.bind(null,this))}get value(){if(R){let t=wt(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(R){let n=wt(this);if(Object.is(n.$value,t))return;n.$prevValue=n.$value,n.$value=t,n.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return R?wt(this).$value:this.$value}sneak(t){if(R){let n=wt(this);n.$prevValue=n.$value,n.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(R){let t=wt(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){return R?(pe.get(this.$id).add(t),()=>pe.get(this.$id)?.delete(t)):(this.$subs.add(t),()=>this.$subs.delete(t))}notify(t){if(R)return pe.get(this.$id)?.forEach(n=>{if(t&&!t(n))return;let{$value:i,$prevValue:s}=wt(this);return n(i,s)});this.$subs.forEach(n=>{if(!(t&&!t(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&$r in t}static subscribers(t){return R?pe.get(t.$id):t.$subs}static makeReadonly(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&!n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){let n=Object.getOwnPropertyDescriptor(t,"value");return n&&n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(i){this.$value=i,this.notify()},configurable:!0})}static entangle(t){if(fi.enabled===!1)return;let n=K.current,i=fi.current();if(i){(!n||n&&_t())&&i.set(t.$id,t);return}if(!n||!_t())return;let s=t.subscribe(()=>Vt(n));(n.subs??(n.subs=new Set)).add(s)}static dispose(t){if(t.$isDisposed=!0,R){pe.delete(t.$id),rt&&window.__kiru.devtools?.untrack(t);return}t.$subs.clear()}};_u=$r;D=(e,t)=>new L(e,t)});function q(e,t=!1){return L.isSignal(e)?t?e.value:e.peek():e}function _o(){Xt.forEach(zt),Xt.clear()}var Ln=M(()=>{"use strict";Z();fe();di();Qi()});function ut(...e){return e.filter(Boolean).join(" ")}function ko(e){return e.replace(vm,"&amp;").replace(wm,"&lt;").replace(_m,"&gt;").replace(Sm,"&quot;").replace(km,"&#039;").replace(Em,"&#47;")}function ea(e){switch(e){case"className":return"class";case"htmlFor":return"for";case"tabIndex":case"formAction":case"formMethod":case"formEncType":case"contentEditable":case"spellCheck":case"allowFullScreen":case"autoPlay":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"noModule":case"noValidate":case"popoverTarget":case"popoverTargetAction":case"playsInline":case"readOnly":case"itemscope":case"rowSpan":case"crossOrigin":return e.toLowerCase();default:return e.indexOf("-")>-1?e:e.startsWith("aria")?"aria-"+e.substring(4).toLowerCase():zc.get(e)||e}}function Tm(e){let t="";for(let n in e){let i=q(e[n]);if(i==null)continue;let s=n.replace(Mm,"-$&").toLowerCase();t+=\`\${s}:\${i};\`}return t}function Cm(e){return typeof e=="string"?e:typeof e=="object"&&e?Tm(e):""}function Mu(e){let t=[],{className:n,style:i,...s}=e;if(n){let r=q(n);r&&t.push(\`class="\${r}"\`)}if(i){let r=q(i);r&&t.push(\`style="\${Cm(r)}"\`)}let o=Object.keys(s).filter(Eu.isStringRenderableProperty);for(let r=0;r<o.length;r++){let a=o[r],l=q(e[a]);if(l==null)continue;a=a.split("bind:")[1]??a;let c=ea(a);switch(typeof l){case"function":case"symbol":continue;case"boolean":if(oo.has(c)){l&&t.push(c);continue}}t.push(\`\${c}="\${l}"\`)}return t.join(" ")}function ku(e,t={functions:!0}){let n=new WeakSet;return JSON.stringify(e,(i,s)=>{if(typeof s=="object"&&s!==null){if(n.has(s))return"[CIRCULAR]";n.add(s)}return typeof s=="function"?t.functions?s.toString():\`[FUNCTION (\${s.name||"anonymous"})]\`:s})}var vm,wm,_m,km,Sm,Em,Mm,Su,Eu,Tu=M(()=>{"use strict";Ln();at();vm=/&/g,wm=/</g,_m=/>/g,km=/'/g,Sm=/"/g,Em=/\\//g,Mm=/[A-Z]/g;Su=new Set(["children","ref","key","innerHTML"]),Eu={isInternalProp:e=>Su.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!Su.has(e)&&!Eu.isEvent(e)}});function zt(e){e()}function wt(e){let t=e;if(R)for(;"__next"in t;)t=t.__next;return t}function Nn(e,t){if(typeof e=="function"){e(t);return}if(L.isSignal(e)){e.value=t;return}e.current=t}function _t(){return pt.current==="dom"||pt.current==="hydrate"}var Jc,Sa=M(()=>{"use strict";fe();ct();xt();Jc=Object.freeze(()=>{})});function So(e){return(e.flags&Rn)!==0}function Cu(e){return typeof e=="object"&&e!==null&&"type"in e}function ci(e){return typeof e=="object"&&e!==null&&"type"in e}function un(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function yo(e){return e===Yt||e===On||e===je}function Lt(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function uo(e){let{props:t,key:n,index:i}=e;e.prev={props:t,key:n,index:i},e.flags&=~(ne|ie|Rn)}function dn(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&dn(n,t),n=n.sibling}function ia(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function wu(e){return ia(e,t=>t.type===je)}function vo(e){if("children"in e.props&&e.props.innerHTML)throw new Et({message:"Cannot use both children and innerHTML on an element",vNode:e});for(let t in e.props)if("bind:"+t in e.props)throw new Et({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function da(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}function ts(e){let t=[],n=e;for(;n;)t.push(n.index),t.push(n.depth),n=n.parent;return\`k:\${BigInt(t.join("")).toString(36)}\`}function se(e,t,n){(e.cleanups??(e.cleanups={}))[t]=n}function mo(e,t,n){let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!0;for(let o of i)if(!n?.includes(o)&&e[o]!==t[o])return!0;return!1}var Eo=M(()=>{"use strict";at();V();ai();xt()});function hi(e=10,t=Pm){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}var Pm,Pu=M(()=>{"use strict";Pm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"});var Z=M(()=>{"use strict";Vc();Hc();Tu();Sa();Eo();Pu()});function Xi(){return Ea}function Du(e){return!!e&&(typeof e=="object"||typeof e=="function")&&ee in e&&typeof e[ee]=="object"&&!!e[ee]}function Au(){let e=new Map,t=null,n=null,i=!1,s=()=>i,o=!1,r=[];return{register:d=>{if(n===null)throw new Error("[kiru]: HMR could not register: No active module");let f=new Set;for(let[p,b]of Object.entries(d)){let x=n.hotVars.get(p);if(b.value[Nc]=b.link,x?.value&&(x.value.__next=b.value),n.hotVars.set(p,b),!!x){if(Du(x.value)&&Du(b.value)){b.value[ee].inject(x.value[ee].provide()),x.value[ee].destroy();continue}x.type==="component"&&b.type==="component"&&window.__kiru.apps.forEach(y=>{dn(y.rootNode,w=>{w.type===x.value&&(w.type=b.value,f.add(w))})})}}f.size&&(Ea=!0,f.forEach(p=>Vt(p)),hn(),Ea=!1),i=!1,n=null,t=null},prepare:d=>{let f=e.get(d);if(i=!!f,!f)f={hotVars:new Map,unnamedEffects:[],hmrCallbacks:[]},e.set(d,f);else{for(;f.hmrCallbacks.length;)f.hmrCallbacks.shift()();for(;r.length;)r.shift()();for(let p of f.unnamedEffects)p.stop();f.unnamedEffects.length=0}n=f,t=d},isReplacement:s,moduleEffects:{registerNext(){o=!0},push(d){o&&(n.unnamedEffects.push(d),o=!1)}},onHmr:d=>{if(n){n.hmrCallbacks.push(d);return}r.push(d)},getCurrentFilePath(){return t}}}function Ou(e){"window"in globalThis&&window.__kiru.HMRContext&&window.__kiru.HMRContext.onHmr(e)}var Ea,qi=M(()=>{"use strict";at();Z();Ue();Ea=!1});function Ru(){let e=new Map,t=new Map;return{appStats:t,emit:(n,i)=>{e.get(n)?.forEach(s=>s(i))},addEventListener:(n,i)=>{e.has(n)||e.set(n,new Set),e.get(n).add(i)},removeEventListener:(n,i)=>{e.has(n)&&e.get(n).delete(i)},mountDuration:n=>{let i=t.get(n);return i?i.mountDuration:0},totalTicks:n=>{let i=t.get(n);return i?i.totalTicks:0},lastTickDuration:n=>{let i=t.get(n);if(!i)return 1/0;let s=i.timestamps[i.timestamps.length-1];return!s||(s.end===1/0&&(s=i.timestamps[i.timestamps.length-2]),!s)?1/0:s.end-s.start},averageTickDuration:n=>{let i=t.get(n);if(!i)return 0;let s=i.timestamps.filter(o=>o.end!==1/0);return s.reduce((o,r)=>o+(r.end-r.start),0)/s.length},beginTick:n=>{t.has(n)||t.set(n,{mountDuration:1/0,timestamps:[],totalTicks:0});let i=t.get(n);i.totalTicks++,i.timestamps.push({start:performance.now(),end:1/0})},endTick:n=>{let i=t.get(n),s=i.timestamps[i.timestamps.length-1];s.end=performance.now(),i.mountDuration===1/0&&(i.mountDuration=s.end-s.start),i.timestamps.length>100&&i.timestamps.shift()}}}var Iu=M(()=>{"use strict"});var Nu,Lu=M(()=>{"use strict";Nu={current:null}});function zu(){let e=new Set,t=new Map;function n(r,a,l){t.get(r)?.forEach(c=>c(a,l))}function i(r,a){t.has(r)||t.set(r,new Set),t.get(r).add(a)}function s(r,a){t.get(r)?.delete(a)}let o={get apps(){return Array.from(e)},emit:n,on:i,off:s};if(i("mount",r=>e.add(r)),i("unmount",r=>e.delete(r)),R){o.HMRContext=Au(),o.profilingContext=Ru(),o.fileRouterInstance=Nu;let r=new Set,a=new Set;o.devtools={track:(l,c)=>{r.add({label:c??l.displayName??"Unnamed Signal",signal:l}),a.forEach(u=>u(r))},untrack:l=>{r.forEach(c=>{c.signal===l&&r.delete(c)}),a.forEach(c=>c(r))},subscribe:l=>(a.add(l),l(r),()=>a.delete(l))}}return o}var Vu=M(()=>{"use strict";ct();qi();Iu();Lu()});function Mt(e,t){return new es(e,t)}var es,Fu=M(()=>{"use strict";ct();at();Z();di();Qi();fe();es=class e extends L{constructor(t,n){if(super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,R){let i=this[ee].inject;this[ee]={provide:()=>this,inject:s=>{i(s),e.stop(s),this.$isDirty=s.$isDirty},destroy:()=>{}}}}get value(){return this.ensureNotDirty(),super.value}set value(t){super.value=t}toString(){return this.ensureNotDirty(),super.toString()}peek(){return this.ensureNotDirty(),super.peek()}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),L.dispose(t)}static stop(t){R&&(t=wt(t));let{$id:n,$unsubs:i}=t;Xt.delete(n),i.forEach(zt),i.clear(),t.$isDirty=!0}static run(t){R&&(t=wt(t));let{$id:n,$getter:i,$unsubs:s}=t,o=wo({id:n,subs:s,fn:()=>i(t.$value),onDepChanged:()=>{if(t.$isDirty=!0,R){if(!pe?.get(n)?.size)return}else if(!t.$subs.size)return;e.run(t),!Object.is(t.$value,t.$prevValue)&&t.notify()}});t.sneak(o),t.$isDirty=!1}ensureNotDirty(){let t=this;if(R&&(t=wt(this)),!t.$isDirty){let n=Xt.get(t.$id);n&&(n(),Xt.delete(t.$id))}t.$isDirty&&(R&&t.$isDisposed||e.run(t))}}});function Ft(e,t){if(typeof e=="function")return new pi(e);let n=e,i=t;return new pi(i,n)}var pi,Ma=M(()=>{"use strict";ct();di();Qi();Z();xt();pi=class e{constructor(t,n){this.id=hi(),this.callback=t,this.deps=n,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,R&&rt&&window.__kiru.HMRContext.moduleEffects.push(this);let i=K.current;if(i){if(!_t())return;se(i,this.id,this.stop.bind(this))}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,R&&rt&&window.__kiru.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){Xt.delete(this.id),this.unsubs.forEach(zt),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let n=wt(t),{id:i,callback:s,unsubs:o,deps:r}=n;n.cleanup=wo({id:i,subs:o,fn:s,deps:r,onDepChanged:()=>{n.cleanup?.(),e.run(n)}})??null}}});var Hu=M(()=>{"use strict"});var gi=M(()=>{"use strict";fe();Fu();Ma();Ln();Hu()});function Dm(e){return async(...t)=>{let{execute:n,onError:i}=e(...t);try{return{error:null,data:await n()}}catch(s){let o=new Mo(s);return i?.(o),{error:o,data:null}}}}var Mo,Bu=M(()=>{"use strict";Mo=class extends Error{constructor(t){super("Error occurred during action execution",{cause:t})}}});function Om(e,t,n){if(R&&t.__kiruNode)throw new Error("[kiru]: container in use - call unmount on the previous app first.");let i=Rm(t),s=Am++,o={id:s,name:n?.name??\`App-\${s}\`,rootNode:i,render:r,unmount:a};function r(l){i.props={children:l},ka(i)}function a(){i.props={children:null},ka(i),R&&(delete t.__kiruNode,delete i.app),window.__kiru.emit("unmount",o)}return R&&(i.app=o),r(e),window.__kiru.emit("mount",o),R&&!globalThis.__KIRU_READY__&&(globalThis.__KIRU_READY__=!0,queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))})),o}function Rm(e){let t=fo(e.nodeName.toLowerCase());return t.flags|=Kt,t.dom=e,R&&(e.__kiruNode=t),t}var Am,Wu=M(()=>{"use strict";at();ct();Ue();fa();Am=0});function ju({children:e,fallback:t,onError:n}){return m(je,{children:e,fallback:t,onError:n})}var $u=M(()=>{"use strict";at();V()});function pn(e){return{current:e}}var Ta=M(()=>{"use strict"});function Ht(e){if(!_t())return;let t=K.current;if(!t)throw new Error("Cannot queue onCleanup effect outside of a component");se(t,hi(10),e)}var To=M(()=>{"use strict";xt();Z()});function Co(e){return typeof e=="object"&&!!e&&si in e}function Po(e){return e instanceof Promise&&"id"in e&&"state"in e}function Im(e){let t=K.current;if(!t)throw new Error("statefulPromise must be called inside a Kiru component");let n=ts(t),i=D(!0);i.value=!0;let s=new AbortController;Ht(()=>s.abort());let o=Uu.get(t)??0;Uu.set(t,o+1);let r=\`\${n}:data:\${o}\`,a;pt.current==="string"?a=Promise.resolve():pt.current==="hydrate"&&Bc.current==="dynamic"?a=Nm(r,s.signal):a=e(s.signal);let c=Object.assign(a,{id:r,state:"pending"});return c.then(u=>{c.state="fulfilled",c.value=u,i.value=!1}).catch(u=>{c.state="rejected",c.error=u instanceof Error?u:new Error(u)}),Object.assign(c,{isPending:i})}function Nm(e,t){return new Promise((n,i)=>{let s=window[oi]??(window[oi]=new Map),o=s.get(e);if(o){let{data:a,error:l}=o;return s.delete(e),l?i(l):n(a)}let r=a=>{let{detail:l}=a;if(l.id===e){s.delete(e),window.removeEventListener(oi,r);let{data:c,error:u}=l;if(u)return i(u);n(c)}};window.addEventListener(oi,r),t.addEventListener("abort",()=>{window.removeEventListener(oi,r),i()})})}var Uu,Do=M(()=>{"use strict";at();xt();fe();Eo();To();Uu=new WeakMap});var ge,Gu=M(()=>{"use strict";Z();gi();at();xt();Ta();Ue();Do();ge=()=>e=>{let{from:t,children:n,fallback:i,mode:s}=e,o=pn(null),r=new Set,a;if(Po(t))r.add(t),a=t.value;else if(L.isSignal(t))a=t.value;else{let l={};for(let c in t){let u=t[c];Po(u)&&r.add(u),l[c]=u.value}a=l}if(r.size===0)return n(a);if(!_t())throw{[si]:{fallback:i,data:Array.from(r)}};for(let l of r){if(l.state==="rejected")throw l.error;if(l.state==="pending"){let c=K.current;Promise.allSettled(r).then(()=>Vt(c));let u=o.current;return s!=="fallback"&&u?n(u,!0):i}}return o.current=a,n(a,!1)}});function Ge({each:e,fallback:t,children:n}){let i=q(e,!0);return i.length===0?t:i.map(n)}var Yu=M(()=>{"use strict";gi()});function Lm(e){function t(n){let{fallback:i=null,...s}=n,o=K.current;if(!_t())return i;let r=zm(e.toString()),a=Ku.get(r);if(!a){let l=e(),c={promise:l,result:null};return Ku.set(r,c),l.then(u=>{c.result=typeof u=="function"?u:u.default,Vt(o)}),i}return a.result===null?(a.promise.then(()=>Vt(o)),i):m(a.result,s)}return R&&(t.displayName="Kiru.lazy"),t}var Ku,zm,Xu=M(()=>{"use strict";li();ct();Sa();xt();Ue();Ku=rt?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;zm=e=>e.replace(/import\\((["'])([^?"']+)\\?[^)"']*\\1\\)/g,(t,n,i)=>\`import(\${n}\${i}\${n})\`)});function Vm({children:e,container:t}){let n=K.current;if(!n.dom)switch(n.flags|=Kt,pt.current){case"dom":if(n.dom=typeof t=="function"?t():t,!(n.dom instanceof HTMLElement)){if(R)throw new Et({message:\`Invalid portal container, expected HTMLElement, got \${n.dom}\`,vNode:n});return null}return e;case"hydrate":Ji(()=>Vt(n));case"stream":case"string":return null}return e}var qu=M(()=>{"use strict";at();ct();ai();xt();Ue()});function Fm({children:e,when:t,fallback:n}){let i=q(t,!0);return i?typeof e=="function"?e(i):e:n}var Zu=M(()=>{"use strict";gi()});function Hm(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??Ju;case"exited":return t?.out??Ju}}var mi,Ju,Qu=M(()=>{"use strict";To();fe();Ma();Ln();mi=e=>{let t=D(e.initialState||"exited"),n,i=o=>{clearTimeout(n),t.value=o,(o==="entered"||o==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(o)},s=o=>{n=window.setTimeout(()=>i(o),Hm(o,e.duration))};return Ft(()=>{let o=q(e.in,!0),r=t.peek();o&&r!=="entered"&&r!=="entering"?(i("entering"),s("entered")):!o&&r!=="exited"&&r!=="exiting"&&(i("exiting"),s("exited"))}),Ht(()=>clearTimeout(n)),o=>o.element(t.value)},Ju=150});var td=M(()=>{"use strict";$u();Gu();Yu();Xu();qu();Zu();Qu()});function Bm(e){let t=Object.assign(({value:n,children:i})=>m(On,{value:n,ctx:t},i),{[On]:()=>e});return t.displayName="Anonymous Context",t}function Wm(e,t){let n=e.parent;for(;n;){if(n.type===On){let i=n,{ctx:s,value:o}=i.props;if(s===t)return o}n=n.parent}return t[On]()}function jm(e){let t=K.current;if(!t)throw new Error("useContext must be called inside a Kiru component");return Wm(t,e)}var ed=M(()=>{"use strict";at();li();xt()});var Ca,nd=M(()=>{"use strict";Ca=class{constructor(){}static on(t,n){return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}static dispatch(t,n,i){(i||document).dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}}});var Pa,id=M(()=>{"use strict";(function(e){e.track=(t,n)=>{"window"in globalThis&&window.__kiru.devtools?.track(t,n)},e.untrack=t=>{"window"in globalThis&&window.__kiru.devtools?.untrack(t)},e.subscribe=t=>!("window"in globalThis)||!window.__kiru.devtools?()=>{}:window.__kiru.devtools.subscribe(t)})(Pa||(Pa={}))});function ns(){let e=K.current;return e?e.hooks??(e.hooks={pre:[],preCleanups:[],post:[],postCleanups:[]}):null}function is(e,t){return()=>{let n=e();typeof n=="function"&&t.push(n)}}var Ao=M(()=>{"use strict";xt()});function Tt(e){if(!_t())return;let t=ns();if(!t)throw new Error("Cannot queue onMount effect outside of a component");t.post.push(is(e,t.postCleanups))}var sd=M(()=>{"use strict";Z();Ao()});function Da(e){if(!_t())return;let t=ns();if(!t)throw new Error("Cannot queue beforeMount effect outside of a component");t.pre.push(is(e,t.preCleanups))}var od=M(()=>{"use strict";Z();Ao()});function Aa(){let e=K.current;if(R){if(!e)throw new Error("setup() must be called inside a Kiru component");if(e.render)throw new Error("setup() cannot be used inside a render function")}if(ri.has(e))return ri.get(e);let t=$m(e);return ri.set(e,t),t}function $m(e){let t,n=e.propSyncs=[],i=-1;return{derive(s){let o={...e.props},r=Mt(()=>s(o));return n.push(a=>r.value=s(a)),r},get id(){return t||(t=D(ts(e)),i=e.index,n.push(()=>{i!==e.index&&(t.value=ts(e),i=e.index)})),t}}}var rd=M(()=>{"use strict";gi();Eo();ct();xt()});var ad=M(()=>{"use strict";To();sd();od();rd();Ao()});function Te(e,t,n,i){if(t===null||t===void 0||typeof t=="boolean")return;if(typeof t=="string")return e.write(ko(t));if(typeof t=="number"||typeof t=="bigint")return e.write(t.toString());if(t instanceof Array)return t.forEach((l,c)=>Te(e,l,n,c));if(L.isSignal(t)){let l=t.peek();if(!Fc(l)){R&&console.error(\`[kiru]: expected primitive child but received \${l}\`);return}un(l)&&e.write(ko(String(l)));return}if(!Cu(t))return;t.parent=n,t.depth=(n?.depth??-1)+1,t.index=i;let{type:s,props:o={}}=t;if(s==="#text")return e.write(ko(o.nodeValue??""));let r=o.children;if(yo(s)){if(s===je){let l="",c=new Set,u={write(d){l+=d},onStreamData(d){d.forEach(f=>c.add(f))}};try{Te(u,r,t,i),e.write(l),e.onStreamData?.([...c])}catch(d){if(Co(d))throw d;let f=d instanceof Error?d:new Error(String(d)),{fallback:p,onError:b}=o;b?.(f);let x=typeof p=="function"?p(f):p;Te(e,x,t,0)}return}Te(e,r,t,i);return}if(typeof s=="function")try{K.current=t;let l=s(o);typeof l=="function"&&(l=l(o)),Te(e,l,t,i);return}catch(l){if(Co(l)){let{fallback:c,data:u}=l[si];return e.onStreamData?.(u),Te(e,c,t,0)}throw l}finally{K.current=null}R&&vo(t);let a=Mu(o);e.write(\`<\${s}\${a.length?\` \${a}\`:""}>\`),!Lc.has(s)&&("innerHTML"in o?e.write(String(L.isSignal(o.innerHTML)?o.innerHTML.peek():o.innerHTML)):Array.isArray(r)?r.forEach((l,c)=>Te(e,l,t,c)):Te(e,r,t,0),e.write(\`</\${s}>\`))}var ld=M(()=>{"use strict";xt();Z();Do();fe();at();ct()});function Um(e){let t=pt.current;pt.current="string";let n="";return Te({write(s){n+=s}},vt({children:e}),null,0),pt.current=t,n}var cd=M(()=>{"use strict";xt();li();ld()});var Oa,ud=M(()=>{"use strict";Ue();ct();(function(e){let t=[],n=!1,i=!1,s=null,o=rt&&typeof document.startViewTransition=="function";function r(u,d){let f=d?.signal;return new Promise(p=>{let b=async()=>{let x=await u();p(x)};t.push(b),f?.addEventListener("abort",()=>{let x=t.indexOf(b);x!==-1?t.splice(x,1):s?.skipTransition()},{once:!0}),l()})}e.run=r;function a(){s?.skipTransition(),s=null,t.length=0,n=!1,i=!1}e.stop=a;function l(){i||(i=!0,queueMicrotask(()=>{i=!1,c()}))}async function c(){if(n||t.length===0)return;n=!0;let u=[...t];t.length=0;let d=async()=>{await Promise.all(u.map(f=>f())),hn()};o?(s=document.startViewTransition(d),await s.finished):await d(),s=null,n=!1,t.length>0&&l()}})(Oa||(Oa={}))});var B={};Wr(B,{ActionError:()=>Mo,ComputedSignal:()=>es,CustomEvents:()=>Ca,Derive:()=>ge,DevTools:()=>Pa,Effect:()=>pi,ErrorBoundary:()=>ju,For:()=>Ge,Fragment:()=>vt,KiruError:()=>Et,Portal:()=>Vm,Show:()=>Fm,Signal:()=>L,Transition:()=>mi,ViewTransitions:()=>Oa,computed:()=>Mt,createContext:()=>Bm,createElement:()=>m,defineAction:()=>Dm,effect:()=>Ft,flushSync:()=>hn,getVNodeLifecycleHooks:()=>ns,isStatefulPromise:()=>Po,isStreamDataThrowValue:()=>Co,lazy:()=>Lm,mount:()=>Om,nextIdle:()=>Ji,onBeforeMount:()=>Da,onCleanup:()=>Ht,onHmr:()=>Ou,onMount:()=>Tt,ref:()=>pn,renderToString:()=>Um,requestUpdate:()=>Vt,setup:()=>Aa,signal:()=>D,statefulPromise:()=>Im,tick:()=>_o,unwrap:()=>q,useContext:()=>jm,useRequestUpdate:()=>yu,wrapLifecycleHookCallback:()=>is});var V=M(()=>{"use strict";Vu();ct();gi();Bu();Wu();td();ed();nd();id();li();ai();qi();ad();cd();Ta();Ue();Do();ud();rt&&(window.__kiru??(window.__kiru=zu()))});function Ye(e,t){if(!e)throw new Error(t)}function Vn(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function ss(e){try{return e[Gm]??null}catch{return null}}function oe(e){return e.name==="kiru.devtools"}function Ym(e){return Array.from(e.entries())}function Ke(e,t,n){return Math.min(Math.max(e,t),n)}function Km(e,t,n){if(e.key==="Tab"){let i=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],o=i[i.length-1];if(n&&!t.contains(n)&&s&&s instanceof HTMLElement)return s.focus();e.shiftKey?n===s&&o instanceof HTMLElement&&(o.focus(),e.preventDefault()):n===o&&s instanceof HTMLElement&&(s.focus(),e.preventDefault())}}function Xm(){return J.rootRef.value?.matches(":focus-within, :focus")}function Ra(e){let t=J.rootRef.value;return t?.matches(":focus-within, :focus")?e(t):null}function bi(e){let t=[],n=e;for(;n;){if(typeof n.type=="function"){let i=n.type,s=i.displayName??(i.name||"AnonymousFunction"),o=n.key!=null&&n.key!==void 0?\`k:\${String(n.key)}\`:\`i:\${n.index}\`;t.push(\`\${s}[\${o}]\`)}n=n.parent}return\`ch:\${t.join("/")}\`}function Ia(e,t){if(!e)return null;let n=[e];for(;n.length;){let i=n.pop();if(typeof i.type=="function"&&bi(i)===t)return i;i.child&&n.push(i.child),i.sibling&&n.push(i.sibling)}return null}var Gm,Fn=M(()=>{"use strict";Ce();Gm=Symbol.for("kiru.devFileLink")});function qm(e,t){let n=new BroadcastChannel(e),i=(l,c)=>{if(l.type==="SET"){let{key:u,version:d}=l;return dd[u]=c,n.postMessage({type:"SET",key:u,version:d})}n.postMessage(l)},s={},o={},r={};for(let l in t){let c=o[l]=D(t[l]);s[l]=0,r[l]=u=>{if(u.type==="GET"){let d=c.value,f=s[l];return i({type:"SET",key:l,version:f},d)}u.version>s[l]&&(c.value=dd[l],s[l]=u.version)},c.subscribe(u=>{let d=++s[l];i({type:"SET",key:l,version:d},u)})}n.addEventListener("message",({data:l})=>{r[l.key](l)});for(let l in o)i({type:"GET",key:l});return[o,()=>{n.close(),Object.values(o).forEach(l=>L.dispose(l))}]}var fd,dd,dt,J,Ce=M(()=>{"use strict";V();Fn();Z();dd=(fd=window.opener??window).__kiru_devtools_state_register??(fd.__kiru_devtools_state_register={}),dt=()=>window.opener?.__kiru??window.__kiru;[J]=qm("kiru-devtools:syncedState",{apps:[],rootRef:null,appSearchTerm:"",appSearchInput:null,componentSelection:{enabled:!1,componentNode:null},devtoolsViewMode:"embedded",devtoolsTab:"Apps",popupWindow:null,selectedApp:null,selectedNode:null,viewerSettings:{objectKeysChunkSize:10,arrayChunkSize:10}});if("window"in globalThis){let{apps:e,componentSelection:t,selectedNode:n,selectedApp:i,viewerSettings:s}=J;window.addEventListener("kiru:ready",()=>{e.value=[...dt().apps],dt().on("mount",a=>{oe(a)||(e.value=[...e.value,a])}),dt().on("unmount",a=>{oe(a)||(e.value=e.value.filter(l=>l!==a))})});let o="kiru-devtools:viewerSettings";s.subscribe(a=>{localStorage.setItem("kiru-devtools:viewerSettings",JSON.stringify(a))});let r=localStorage.getItem(o);if(r)try{let a=JSON.parse(r);Ye(typeof a.objectKeysChunkSize=="number"&&a.objectKeysChunkSize>0,"invalid objectKeysChunkSize"),Ye(typeof a.arrayChunkSize=="number"&&a.arrayChunkSize>0,"invalid arrayChunkSize"),s.sneak({objectKeysChunkSize:a.objectKeysChunkSize,arrayChunkSize:a.arrayChunkSize})}catch{s.sneak({objectKeysChunkSize:10,arrayChunkSize:10})}t.subscribe(({componentNode:a})=>{n.value=a,i.value=a?Lt(a):null})}});function Na(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),m("path",{d:"M12 9v11"}),m("path",{d:"M2 9h13a2 2 0 0 1 2 2v9"}))}var hd=M(()=>{"use strict";V()});function Xe(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"m9 18 6-6-6-6"}))}var Oo=M(()=>{"use strict";V()});function La(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M18 6 6 18"}),m("path",{d:"m6 6 12 12"}))}var pd=M(()=>{"use strict";V()});function za(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),m("circle",{cx:"12",cy:"12",r:"3"}))}var gd=M(()=>{"use strict";V()});function Zm(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}),m("path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}),m("path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}))}var md=M(()=>{"use strict";V()});function os(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M15 3h6v6"}),m("path",{d:"M10 14 21 3"}),m("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}))}var bd=M(()=>{"use strict";V()});function Va(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),m("path",{d:"M3 5a2 2 0 0 0 2 2h3"}),m("path",{d:"M3 3v13a2 2 0 0 0 2 2h3"}))}var xd=M(()=>{"use strict";V()});function Jm(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"m15 15 6 6"}),m("path",{d:"m15 9 6-6"}),m("path",{d:"M21 16v5h-5"}),m("path",{d:"M21 8V3h-5"}),m("path",{d:"M3 16v5h5"}),m("path",{d:"m3 21 6-6"}),m("path",{d:"M3 8V3h5"}),m("path",{d:"M9 9 3 3"}))}var yd=M(()=>{"use strict";V()});function Fa(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},m("path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"}))}var vd=M(()=>{"use strict";V()});function rs(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"m12 14 4-4"}),m("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}))}var wd=M(()=>{"use strict";V()});function Qm(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("circle",{cx:"12",cy:"5",r:"1"}),m("circle",{cx:"19",cy:"5",r:"1"}),m("circle",{cx:"5",cy:"5",r:"1"}),m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}),m("circle",{cx:"12",cy:"19",r:"1"}),m("circle",{cx:"19",cy:"19",r:"1"}),m("circle",{cx:"5",cy:"19",r:"1"}))}var _d=M(()=>{"use strict";V()});function as(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"}))}var kd=M(()=>{"use strict";V()});function tb(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6"}),m("path",{d:"m21 3-9 9"}),m("path",{d:"M15 3h6v6"}))}var Sd=M(()=>{"use strict";V()});function Ha(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}),m("path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}),m("path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}),m("path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}),m("circle",{cx:"12",cy:"12",r:"2"}))}var Ed=M(()=>{"use strict";V()});function Hn(e){return m("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",...e},m("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}),m("line",{x1:"9",y1:"5",x2:"5",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}))}var Md=M(()=>{"use strict";V()});function eb(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}))}var Td=M(()=>{"use strict";V()});var Cd=M(()=>{"use strict";hd();Oo();pd();gd();md();bd();xd();yd();vd();wd();_d();kd();Sd();Ed();Md();Td()});function qe(e){let t=[],n=()=>t.forEach(f=>f()),i=D(null),s=D(null),o=D(nb(e)),r=Mt(()=>o.value.type==="snapped"?o.value.side:null),a=D([0,0]),l=D(!1);t.push(a.subscribe(([f,p])=>{let b=i.value;b.style.transform=\`translate(\${f}px, \${p}px)\`}));let c=f=>{if(f.button!==0)return;let p=i.value,[b,x]=[f.clientX,f.clientY],y=p.getBoundingClientRect(),[w,_]=[b-y.left,x-y.top];l.value=!1;let S=E=>{if(!l.peek()&&(Math.abs(E.clientX-b)>5||Math.abs(E.clientY-x)>5)&&(l.value=!0),!l.peek())return;let[P,O]=[E.clientX-w,E.clientY-_],[A,N]=e.getDraggableBounds(),{width:j,height:H}=p.getBoundingClientRect(),G=P,ot=A-(P+j),Pt=O,Q=N-(O+H),tt=Math.min(G,ot,Pt,Q),mt=P+j/2,ue=O+H/2;e.allowFloat&&tt>(e.snapDistance??0)?o.value={type:"floating",x:mt/A,y:ue/N}:tt===G?o.value={type:"snapped",side:"left",percent:ue/N}:tt===ot?o.value={type:"snapped",side:"right",percent:ue/N}:tt===Pt?o.value={type:"snapped",side:"top",percent:mt/A}:o.value={type:"snapped",side:"bottom",percent:mt/A},u()},T=()=>{if(window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",T),!l.peek())return e.onclick?.();l.value=!1,e.storage.setItem(e.key,JSON.stringify(o.value))};window.addEventListener("mousemove",S),window.addEventListener("mouseup",T)},u=()=>{let f=i.value,{width:p,height:b}=f.getBoundingClientRect(),[x,y]=e.getDraggableBounds(),w=o.value;if(w.type==="floating"){let[P,O]=e.getPadding(null);a.value=[Ke(w.x*x-p/2,P,x-P-p),Ke(w.y*y-b/2,O,y-O-b)];return}let[_,S]=e.getPadding(w.side),T=0,E=0;switch(w.side){case"top":T=w.percent*x-p/2,E=0;break;case"bottom":T=w.percent*x-p/2,E=1/0;break;case"left":T=0,E=w.percent*y-b/2;break;case"right":T=1/0,E=w.percent*y-b/2;break}a.value=[Ke(T,_,x-_-p),Ke(E,S,y-S-b)]};return{init:()=>{let f=s.value;if(!f)return console.error("handle not found",new Error().stack);let p=i.value;if(!p)return console.error("container not found",new Error().stack);p.style.position="fixed",p.style.top="0",p.style.left="0",u();let b=new ResizeObserver(u);b.observe(p),window.addEventListener("resize",u),f.addEventListener("mousedown",c),t.push(()=>{b.disconnect(),window.removeEventListener("resize",u),f.removeEventListener("mousedown",c)})},isDragging:l,handleRef:s,containerRef:i,snapSide:r,containerPos:a,dispose:n}}function nb({storage:e,key:t,defaultPosition:n}){let i=e.getItem(t);if(i)try{let o=JSON.parse(i);if(o.type==="snapped")return Ye(["top","right","bottom","left"].includes(o.side),"invalid side"),Ye(typeof o.percent=="number"&&o.percent>=0&&o.percent<=1,"invalid percent"),o;if(o.type==="floating")return Ye(typeof o.x=="number"&&o.x>=0&&o.x<=1,"invalid x"),Ye(typeof o.y=="number"&&o.y>=0&&o.y<=1,"invalid y"),o}catch{}let s=n??{type:"floating",x:.5,y:.5};return e.setItem(t,JSON.stringify(s)),s}var Pd=M(()=>{"use strict";V();Fn()});function Ba(e,t={windowScroll:!0,windowResize:!0}){let n=[],i=()=>{n.forEach(_=>_()),n.length=0},s=t.windowScroll??!0,o=t.windowResize??!0,r=D(0),a=D(0),l=D(0),c=D(0),u=D(0),d=D(0),f=D(0),p=D(0),b=D(0),x=D(0),y=()=>{let _=e.current;if(!_){r.value=a.value=l.value=c.value=u.value=d.value=f.value=p.value=b.value=x.value=0;return}r.value=_.clientWidth,a.value=_.clientHeight;let S=_.getBoundingClientRect();l.value=S.top,c.value=S.left,u.value=S.right,d.value=S.bottom,f.value=S.x,p.value=S.y,b.value=window.scrollX,x.value=window.scrollY};return{state:{width:r,height:a,top:l,left:c,right:u,bottom:d,x:f,y:p,scrollX:b,scrollY:x},init:()=>{let _=e.current;if(!_)return console.error("element not found",new Error().stack);let S=new MutationObserver(y);S.observe(_,{attributeFilter:["style","class"],attributes:!0,childList:!0,subtree:!0}),n.push(()=>S.disconnect());let T=new ResizeObserver(y);T.observe(_),n.push(()=>T.disconnect()),s&&(window.addEventListener("scroll",y,{capture:!0,passive:!0}),n.push(()=>window.removeEventListener("scroll",y))),o&&(window.addEventListener("resize",y,{passive:!0}),n.push(()=>window.removeEventListener("resize",y))),y()},dispose:i}}var Dd=M(()=>{"use strict";V()});function Bn(e){let t=[],n=()=>t.forEach(d=>d()),i=D(null),s=D(null),o=D(!1),[r,a]=e.minSize??[0,0],l=e.aspectRatio??null,c=d=>{if(d.button!==0)return;d.stopPropagation(),d.preventDefault(),o.value=!0,document.body.style.cursor="se-resize",document.body.style.userSelect="none";let f=i.value,p=d.clientX,b=d.clientY,x=f.offsetWidth,y=f.offsetHeight,w=S=>{let T=S.clientX-p,E=S.clientY-b;if(l!==null){let P=(T*l+E)/(l*l+1),O=Math.max(r,x+P*l),A=O/l;A<a&&(A=a,O=A*l),f.style.width=\`\${O}px\`,f.style.height=\`\${A}px\`}else f.style.width=\`\${Math.max(r,x+T)}px\`,f.style.height=\`\${Math.max(a,y+E)}px\`},_=()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",_),o.value=!1,document.body.style.cursor="",document.body.style.userSelect="",e.storage.setItem(e.key,JSON.stringify({w:f.offsetWidth,h:f.offsetHeight}))};window.addEventListener("mousemove",w),window.addEventListener("mouseup",_)};return{containerRef:i,handleRef:s,isResizing:o,init:()=>{let d=s.value;if(!d)return console.error("resize handle not found",new Error().stack);let f=i.value;if(!f)return console.error("resize container not found",new Error().stack);let p=ib(e.storage,e.key);if(p){let b=p[0],x=l!==null?b/l:p[1];f.style.width=\`\${b}px\`,f.style.height=\`\${x}px\`}d.addEventListener("mousedown",c),t.push(()=>d.removeEventListener("mousedown",c))},dispose:n}}function ib(e,t){let n=e.getItem(t);if(!n)return null;try{let i=JSON.parse(n);if(typeof i.w=="number"&&typeof i.h=="number")return[i.w,i.h]}catch{}return null}var Ad=M(()=>{"use strict";V()});function ls(){let e=D({x:0,y:0}),t=n=>{e.value={x:n.clientX,y:n.clientY}};return window.addEventListener("mousemove",t),[e,()=>window.removeEventListener("mousemove",t)]}var Od=M(()=>{"use strict";V()});function ds(e){return e+.5|0}function cs(e){return gn(ds(e*2.55),0,255)}function mn(e){return gn(ds(e*255),0,255)}function Ze(e){return gn(ds(e/2.55)/100,0,1)}function Rd(e){return gn(ds(e*100),0,100)}function ab(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&re[e[1]]*17,g:255&re[e[2]]*17,b:255&re[e[3]]*17,a:t===5?re[e[4]]*17:255}:(t===7||t===9)&&(n={r:re[e[1]]<<4|re[e[2]],g:re[e[3]]<<4|re[e[4]],b:re[e[5]]<<4|re[e[6]],a:t===9?re[e[7]]<<4|re[e[8]]:255})),n}function cb(e){var t=rb(e)?sb:ob;return e?"#"+t(e.r)+t(e.g)+t(e.b)+lb(e.a,t):void 0}function zd(e,t,n){let i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function db(e,t,n){let i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function fb(e,t,n){let i=zd(e,1,.5),s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function hb(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function $a(e){let n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2,l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=hb(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Ua(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(mn)}function Ga(e,t,n){return Ua(zd,e,t,n)}function pb(e,t,n){return Ua(fb,e,t,n)}function gb(e,t,n){return Ua(db,e,t,n)}function Vd(e){return(e%360+360)%360}function mb(e){let t=ub.exec(e),n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?cs(+t[5]):mn(+t[5]));let s=Vd(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=pb(s,o,r):t[1]==="hsv"?i=gb(s,o,r):i=Ga(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function bb(e,t){var n=$a(e);n[0]=Vd(n[0]+t),n=Ga(n),e.r=n[0],e.g=n[1],e.b=n[2]}function xb(e){if(!e)return;let t=$a(e),n=t[0],i=Rd(t[1]),s=Rd(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${Ze(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}function yb(){let e={},t=Object.keys(Nd),n=Object.keys(Id),i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<n.length;s++)o=n[s],a=a.replace(o,Id[o]);o=parseInt(Nd[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}function vb(e){Io||(Io=yb(),Io.transparent=[0,0,0,0]);let t=Io[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function _b(e){let t=wb.exec(e),n=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];n=t[8]?cs(r):gn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?cs(i):gn(i,0,255)),s=255&(t[4]?cs(s):gn(s,0,255)),o=255&(t[6]?cs(o):gn(o,0,255)),{r:i,g:s,b:o,a:n}}}function kb(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${Ze(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}function Sb(e,t,n){let i=xi(Ze(e.r)),s=xi(Ze(e.g)),o=xi(Ze(e.b));return{r:mn(Wa(i+n*(xi(Ze(t.r))-i))),g:mn(Wa(s+n*(xi(Ze(t.g))-s))),b:mn(Wa(o+n*(xi(Ze(t.b))-o))),a:e.a+n*(t.a-e.a)}}function No(e,t,n){if(e){let i=$a(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Ga(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Fd(e,t){return e&&Object.assign(t||{},e)}function Ld(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=mn(e[3]))):(t=Fd(e,{r:0,g:0,b:0,a:1}),t.a=mn(t.a)),t}function Eb(e){return e.charAt(0)==="r"?_b(e):mb(e)}var gn,re,ja,sb,ob,Ro,rb,lb,ub,Id,Nd,Io,wb,Wa,xi,us,Hd=M(()=>{gn=(e,t,n)=>Math.max(Math.min(e,n),t);re={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ja=[..."0123456789ABCDEF"],sb=e=>ja[e&15],ob=e=>ja[(e&240)>>4]+ja[e&15],Ro=e=>(e&240)>>4===(e&15),rb=e=>Ro(e.r)&&Ro(e.g)&&Ro(e.b)&&Ro(e.a);lb=(e,t)=>e<255?t(e):"";ub=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Id={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Nd={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};wb=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;Wa=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,xi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);us=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,i;n==="object"?i=Ld(t):n==="string"&&(i=ab(t)||vb(t)||Eb(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Fd(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=Ld(t)}rgbString(){return this._valid?kb(this._rgb):void 0}hexString(){return this._valid?cb(this._rgb):void 0}hslString(){return this._valid?xb(this._rgb):void 0}mix(t,n){if(t){let i=this.rgb,s=t.rgb,o,r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=Sb(this._rgb,t._rgb,n)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=mn(t),this}clearer(t){let n=this._rgb;return n.a*=1-t,this}greyscale(){let t=this._rgb,n=ds(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){let n=this._rgb;return n.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return No(this._rgb,2,t),this}darken(t){return No(this._rgb,2,-t),this}saturate(t){return No(this._rgb,1,t),this}desaturate(t){return No(this._rgb,1,-t),this}rotate(t){return bb(this._rgb,t),this}}});function be(){}function X(e){return e==null}function et(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Y(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ht(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ot(e,t){return ht(e)?e:t}function W(e,t){return typeof e>"u"?t:e}function z(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function $(e,t,n,i){let s,o,r;if(et(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;s<o;s++)t.call(n,e[s],s);else if(Y(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function wi(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function hs(e){if(et(e))return e.map(hs);if(Y(e)){let t=Object.create(null),n=Object.keys(e),i=n.length,s=0;for(;s<i;++s)t[n[s]]=hs(e[n[s]]);return t}return e}function qd(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Zd(e,t,n,i){if(!qd(e))return;let s=t[e],o=n[e];Y(s)&&Y(o)?$n(s,o,i):t[e]=hs(o)}function $n(e,t,n){let i=et(t)?t:[t],s=i.length;if(!Y(e))return e;n=n||{};let o=n.merger||Zd,r;for(let a=0;a<s;++a){if(r=i[a],!Y(r))continue;let l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Un(e,t){return $n(e,t,{merger:Jd})}function Jd(e,t,n){if(!qd(e))return;let i=t[e],s=n[e];Y(i)&&Y(s)?Un(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=hs(s))}function Qd(e){let t=e.split("."),n=[],i="";for(let s of t)i+=s,i.endsWith("\\\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Mb(e){let t=Qd(e);return n=>{for(let i of t){if(i==="")break;n=n&&n[i]}return n}}function _i(e,t){return(Bd[t]||(Bd[t]=Mb(t)))(e)}function ms(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ja(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}function Ae(e,t,n){return Math.abs(e-t)<n}function Wo(e){let t=Math.round(e);e=Ae(e,t,e/1e3)?t:e;let n=Math.pow(10,Math.floor(De(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function Qa(e){let t=[],n=Math.sqrt(e),i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function Tb(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Gn(e){return!Tb(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function tl(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function jo(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Oe(e){return e*(ft/180)}function bs(e){return e*(180/ft)}function $o(e){if(!ht(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function el(e,t){let n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*ft&&(o+=Bt),{angle:o,distance:s}}function gs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function nf(e,t){return(e-t+tf)%Bt-ft}function qt(e){return(e%Bt+Bt)%Bt}function Uo(e,t,n,i){let s=qt(e),o=qt(t),r=qt(n),a=qt(o-s),l=qt(r-s),c=qt(s-o),u=qt(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function Wt(e,t,n){return Math.max(t,Math.min(n,e))}function nl(e){return Wt(e,-32768,32767)}function Yn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function xs(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}function sl(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}function ol(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),sf.forEach(n=>{let i="_onData"+ms(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Go(e,t){let n=e._chartjs;if(!n)return;let i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(sf.forEach(o=>{delete e[o]}),delete e._chartjs)}function rl(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function Ko(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Yo.call(window,()=>{i=!1,e.apply(t,n)}))}}function al(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}function cl(e,t,n){let i=t.length,s=0,o=i;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:d,max:f,minDefined:p,maxDefined:b}=r.getUserBounds();if(p){if(s=Math.min(Qe(l,u,d).lo,n?i:Qe(t,u,r.getPixelForValue(d)).lo),c){let x=l.slice(0,s+1).reverse().findIndex(y=>!X(y[a.axis]));s-=Math.max(0,x)}s=Wt(s,0,i-1)}if(b){let x=Math.max(Qe(l,r.axis,f,!0).hi+1,n?0:Qe(t,u,r.getPixelForValue(f),!0).hi+1);if(c){let y=l.slice(x-1).findIndex(w=>!X(w[a.axis]));x+=Math.max(0,y)}o=Wt(x,s,i)-s}else o=i-s}return{start:s,count:o}}function ul(e){let{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}function qo(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Zo(e){return qo(e)?e:new us(e)}function Fo(e){return qo(e)?e:new us(e).saturate(.5).darken(.1).hexString()}function Db(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Pb},numbers:{type:"number",properties:Cb}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ab(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function Ob(e,t){t=t||{};let n=e+JSON.stringify(t),i=$d.get(n);return i||(i=new Intl.NumberFormat(e,t),$d.set(n,i)),i}function ys(e,t,n){return Ob(t,n).format(e)}function Rb(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}function Ib(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:vs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}function fs(e,t){if(!t)return e;let n=t.split(".");for(let i=0,s=n.length;i<s;++i){let o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Ya(e,t,n){return typeof t=="string"?$n(fs(e,t),n):$n(fs(e,""),t)}function rf(e){return!e||X(e.size)||X(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function yi(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function dl(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0,a=n.length,l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!et(d))r=yi(e,s,o,r,d);else if(et(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!et(f)&&(r=yi(e,s,o,r,f));e.restore();let p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete s[o[l]];o.splice(0,p)}return r}function tn(e,t,n){let i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function Qo(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ws(e,t,n,i){tr(e,t,n,i,null)}function tr(e,t,n,i,s){let o,r,a,l,c,u,d,f,p=t.pointStyle,b=t.rotation,x=t.radius,y=(b||0)*ef;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),p){default:s?e.ellipse(n,i,s/2,x,0,0,Bt):e.arc(n,i,x,0,Bt),e.closePath();break;case"triangle":u=s?s/2:x,e.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ka,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Ka,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(y+bn)*l,d=Math.cos(y+bn)*(s?s/2-c:l),a=Math.sin(y+bn)*l,f=Math.sin(y+bn)*(s?s/2-c:l),e.arc(n-d,i-a,c,y-ft,y-At),e.arc(n+f,i-r,c,y-At,y),e.arc(n+d,i+a,c,y,y+At),e.arc(n-f,i+r,c,y+At,y+ft),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*x,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}y+=bn;case"rectRot":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+f,i-r),e.lineTo(n+d,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":y+=bn;case"cross":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),y+=bn,d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(y)*x,a=Math.sin(y)*x,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:x),i+Math.sin(y)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Zt(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function _s(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ks(e){e.restore()}function fl(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){let o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function hl(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Nb(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),X(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Lb(e,t,n,i,s){if(s.strikethrough||s.underline){let o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function zb(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function wn(e,t,n,i,s,o={}){let r=et(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Nb(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&zb(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),X(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Lb(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Si(e,t){let{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*ft,ft,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,ft,At,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,At,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-At,!0),e.lineTo(n+r.topLeft,i)}function af(e,t){let n=(""+e).match(Vb);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}function er(e,t){let n={},i=Y(t),s=i?Object.keys(t):t,o=Y(e)?i?r=>W(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)n[r]=Hb(o(r));return n}function pl(e){return er(e,{top:"y",right:"x",bottom:"y",left:"x"})}function _n(e){return er(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(e){let t=pl(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function gt(e,t){e=e||{},t=t||it.font;let n=W(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=W(e.style,t.style);i&&!(""+i).match(Fb)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:W(e.family,t.family),lineHeight:af(W(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:W(e.weight,t.weight),string:""};return s.string=rf(s),s}function Ei(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),n!==void 0&&et(a)&&(a=a[n%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function gl(e,t,n){let{min:i,max:s}=e,o=Za(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Re(e,t){return Object.assign(Object.create(e),t)}function Ss(e,t=[""],n,i,s=()=>e[0]){let o=n||e;typeof i>"u"&&(i=uf("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>Ss([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return lf(a,l,()=>Kb(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Gd(a).includes(l)},ownKeys(a){return Gd(a)},set(a,l,c){let u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function yn(e,t,n,i){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:nr(e,i),setContext:o=>yn(e,o,n,i),override:o=>yn(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return lf(o,r,()=>Wb(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function nr(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Pe(n)?n:()=>n,isIndexable:Pe(i)?i:()=>i}}function lf(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let i=n();return e[t]=i,i}function Wb(e,t,n){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e,a=i[t];return Pe(a)&&r.isScriptable(t)&&(a=jb(t,a,e,n)),et(a)&&a.length&&(a=$b(t,a,e,r.isIndexable)),ml(t,a)&&(a=yn(a,s,o&&o[t],r)),a}function jb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),ml(e,l)&&(l=bl(s._scopes,s,e,l)),l}function $b(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(Y(t[0])){let l=t,c=s._scopes.filter(u=>u!==l);t=[];for(let u of l){let d=bl(c,s,e,u);t.push(yn(d,o,r&&r[e],a))}}return t}function cf(e,t,n){return Pe(e)?e(t,n):e}function Gb(e,t,n,i,s){for(let o of t){let r=Ub(n,o);if(r){e.add(r);let a=cf(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function bl(e,t,n,i){let s=t._rootScopes,o=cf(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=Ud(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Ud(a,r,o,l,i),l===null)?!1:Ss(Array.from(a),[""],s,o,()=>Yb(t,n,i))}function Ud(e,t,n,i,s){for(;n;)n=Gb(e,t,n,i,s);return n}function Yb(e,t,n){let i=e._getTarget();t in i||(i[t]={});let s=i[t];return et(s)&&Y(n)?n:s||{}}function Kb(e,t,n,i){let s;for(let o of t)if(s=uf(Bb(o,e),n),typeof s<"u")return ml(e,s)?bl(n,i,e,s):s}function uf(e,t){for(let n of t){if(!n)continue;let i=n[e];if(typeof i<"u")return i}}function Gd(e){let t=e._keys;return t||(t=e._keys=Xb(e._scopes)),t}function Xb(e){let t=new Set;for(let n of e)for(let i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function ff(e,t,n,i){let s=e.skip?t:e,o=t,r=n.skip?t:n,a=gs(o,s),l=gs(r,o),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let d=i*c,f=i*u;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function Zb(e,t,n){let i=e.length,s,o,r,a,l,c=vi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=vi(e,u+1),!(!l||!c)){if(Ae(t[u],0,qb)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*t[u],n[u+1]=o*r*t[u])}}function Jb(e,t,n="x"){let i=df(n),s=e.length,o,r,a,l=vi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=vi(e,c+1),!a)continue;let u=a[n],d=a[i];r&&(o=(u-r[n])/3,a[\`cp1\${n}\`]=u-o,a[\`cp1\${i}\`]=d-o*t[c]),l&&(o=(l[n]-u)/3,a[\`cp2\${n}\`]=u+o,a[\`cp2\${i}\`]=d+o*t[c])}}function hf(e,t="x"){let n=df(t),i=e.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=vi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=vi(e,r+1),!!l){if(c){let u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?me(s[r-1])!==me(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Zb(e,s,o),Jb(e,o,t)}function zo(e,t,n){return Math.max(Math.min(e,n),t)}function Qb(e,t){let n,i,s,o,r,a=Zt(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&Zt(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=zo(s.cp1x,t.left,t.right),s.cp1y=zo(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=zo(s.cp2x,t.left,t.right),s.cp2y=zo(s.cp2y,t.top,t.bottom)))}function xl(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")hf(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=ff(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Qb(e,n)}function Es(){return typeof window<"u"&&typeof document<"u"}function Ms(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ho(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}function pf(e,t){return ir(e).getPropertyValue(t)}function jn(e,t,n){let i={};n=n?"-"+n:"";for(let s=0;s<4;s++){let o=tx[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function nx(e,t){let n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i,r=!1,a,l;if(ex(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Jt(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:i}=t,s=ir(n),o=s.boxSizing==="border-box",r=jn(s,"padding"),a=jn(s,"border","width"),{x:l,y:c,box:u}=nx(e,n),d=r.left+(u&&a.left),f=r.top+(u&&a.top),{width:p,height:b}=t;return o&&(p-=r.width+a.width,b-=r.height+a.height),{x:Math.round((l-d)/p*n.width/i),y:Math.round((c-f)/b*n.height/i)}}function ix(e,t,n){let i,s;if(t===void 0||n===void 0){let o=e&&Ms(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{let r=o.getBoundingClientRect(),a=ir(o),l=jn(a,"border","width"),c=jn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Ho(a.maxWidth,o,"clientWidth"),s=Ho(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||ps,maxHeight:s||ps}}function yl(e,t,n,i){let s=ir(e),o=jn(s,"margin"),r=Ho(s.maxWidth,e,"clientWidth")||ps,a=Ho(s.maxHeight,e,"clientHeight")||ps,l=ix(e,t,n),{width:c,height:u}=l;if(s.boxSizing==="content-box"){let f=jn(s,"border","width"),p=jn(s,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=xn(Math.min(c,r,l.maxWidth)),u=xn(Math.min(u,a,l.maxHeight)),c&&!u&&(u=xn(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=xn(Math.floor(u*i))),{width:c,height:u}}function sr(e,t,n){let i=t||1,s=xn(e.height*i),o=xn(e.width*i);e.height=xn(e.height),e.width=xn(e.width);let r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=\`\${e.height}px\`,r.style.width=\`\${e.width}px\`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}function or(e,t){let n=pf(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function Je(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function wl(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function _l(e,t,n,i){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Je(e,s,n),a=Je(s,o,n),l=Je(o,t,n),c=Je(r,a,n),u=Je(a,l,n);return Je(c,u,n)}function kn(e,t,n){return e?sx(t,n):ox()}function rr(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function ar(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function gf(e){return e==="angle"?{between:Uo,compare:nf,normalize:qt}:{between:Yn,compare:(t,n)=>t-n,normalize:t=>t}}function Yd({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function rx(e,t,n){let{property:i,start:s,end:o}=n,{between:r,normalize:a}=gf(i),l=t.length,{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function kl(e,t,n){if(!n)return[e];let{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=gf(i),{start:u,end:d,loop:f,style:p}=rx(e,t,n),b=[],x=!1,y=null,w,_,S,T=()=>l(s,S,w)&&a(s,S)!==0,E=()=>a(o,w)===0||l(o,S,w),P=()=>x||T(),O=()=>!x||E();for(let A=u,N=u;A<=d;++A)_=t[A%r],!_.skip&&(w=c(_[i]),w!==S&&(x=l(w,s,o),y===null&&P()&&(y=a(w,s)===0?A:N),y!==null&&O()&&(b.push(Yd({start:y,end:A,loop:f,count:r,style:p})),y=null),N=A,S=w));return y!==null&&b.push(Yd({start:y,end:d,loop:f,count:r,style:p})),b}function Sl(e,t){let n=[],i=e.segments;for(let s=0;s<i.length;s++){let o=kl(i[s],e.points,t);o.length&&n.push(...o)}return n}function ax(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function lx(e,t,n,i){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=n;++l){let c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function El(e,t){let n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=ax(n,s,o,i);if(i===!0)return Kd(e,[{start:r,end:a,loop:o}],n,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Kd(e,lx(n,r,l,c),n,t)}function Kd(e,t,n,i){return!i||!i.setContext||!n?t:cx(e,t,n,i)}function cx(e,t,n,i){let s=e._chart.getContext(),o=Xd(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[],u=o,d=t[0].start,f=d;function p(b,x,y,w){let _=a?-1:1;if(b!==x){for(b+=l;n[b%l].skip;)b-=_;for(;n[x%l].skip;)x+=_;b%l!==x%l&&(c.push({start:b%l,end:x%l,loop:y,style:w}),u=w,d=x%l)}}for(let b of t){d=a?d:b.start;let x=n[d%l],y;for(f=d+1;f<=b.end;f++){let w=n[f%l];y=Xd(i.setContext(Re(s,{type:"segment",p0:x,p1:w,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),ux(y,u)&&p(d,f-1,b.loop,u),x=w,u=y}d<f-1&&p(d,f-1,b.loop,u)}return c}function Xd(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function ux(e,t){if(!t)return!1;let n=[],i=function(s,o){return qo(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Vo(e,t,n){return e.options.clip?e[n]:t[n]}function dx(e,t){let{xScale:n,yScale:i}=e;return n&&i?{left:Vo(n,t,"left"),right:Vo(n,t,"right"),top:Vo(i,t,"top"),bottom:Vo(i,t,"bottom")}:t}function Ml(e,t){let n=t._clip;if(n.disabled)return!1;let i=dx(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}var qa,Za,Bd,ki,Pe,Bo,ft,Bt,tf,ps,ef,At,bn,Ka,De,me,Qe,il,sf,Yo,Xo,Rt,ll,Lo,Wd,jd,Wn,Cb,Pb,$d,of,vs,vn,Jo,Xa,it,Vb,Fb,Hb,Bb,ml,Ub,qb,vi,df,ir,tx,ex,xn,vl,sx,ox,Tl=M(()=>{Hd();qa=(()=>{let e=0;return()=>e++})();Za=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;Bd={"":e=>e,x:e=>e.x,y:e=>e.y};ki=e=>typeof e<"u",Pe=e=>typeof e=="function",Bo=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};ft=Math.PI,Bt=2*ft,tf=Bt+ft,ps=Number.POSITIVE_INFINITY,ef=ft/180,At=ft/2,bn=ft/4,Ka=ft*2/3,De=Math.log10,me=Math.sign;Qe=(e,t,n,i)=>xs(e,n,i?s=>{let o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),il=(e,t,n)=>xs(e,n,i=>e[i][t]>=n);sf=["push","pop","shift","splice","unshift"];Yo=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();Xo=e=>e==="start"?"left":e==="end"?"right":"center",Rt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,ll=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;Lo=e=>e===0||e===1,Wd=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Bt/n)),jd=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Bt/n)+1,Wn={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*At)+1,easeOutSine:e=>Math.sin(e*At),easeInOutSine:e=>-.5*(Math.cos(ft*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Lo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Lo(e)?e:Wd(e,.075,.3),easeOutElastic:e=>Lo(e)?e:jd(e,.075,.3),easeInOutElastic(e){return Lo(e)?e:e<.5?.5*Wd(e*2,.1125,.45):.5+.5*jd(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Wn.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Wn.easeInBounce(e*2)*.5:Wn.easeOutBounce(e*2-1)*.5+.5};Cb=["x","y","borderWidth","radius","tension"],Pb=["color","borderColor","backgroundColor"];$d=new Map;of={values(e){return et(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let i=this.chart.options.locale,s,o=e;if(n.length>1){let c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Rb(e,n)}let r=De(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ys(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";let i=n[t].significand||e/Math.pow(10,Math.floor(De(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?of.numeric.call(this,e,t,n):""}};vs={formatters:of};vn=Object.create(null),Jo=Object.create(null);Xa=class{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Fo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Fo(s.borderColor),this.hoverColor=(i,s)=>Fo(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ya(this,t,n)}get(t){return fs(this,t)}describe(t,n){return Ya(Jo,t,n)}override(t,n){return Ya(vn,t,n)}route(t,n,i,s){let o=fs(this,t),r=fs(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){let l=this[a],c=r[s];return Y(l)?Object.assign({},c,l):W(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}},it=new Xa({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Db,Ab,Ib]);Vb=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,Fb=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;Hb=e=>+e||0;Bb=(e,t)=>e?e+ms(t):t,ml=(e,t)=>Y(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);Ub=(e,t)=>e===!0?t:typeof e=="string"?_i(t,e):void 0;qb=Number.EPSILON||1e-14,vi=(e,t)=>t<e.length&&!e[t].skip&&e[t],df=e=>e==="x"?"y":"x";ir=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);tx=["top","right","bottom","left"];ex=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);xn=e=>Math.round(e*10)/10;vl=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Es()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();sx=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},ox=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}}});function gx(e,t){let n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function mx(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function bf(e,t){let n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function bx(e,t,n){if(n===!1)return!1;let i=bf(e,n),s=bf(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function xx(e){let t,n,i,s;return Y(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function sh(e,t){let n=[],i=e._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function xf(e,t,n,i={}){let s=e.keys,o=i.mode==="single",r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],ht(c)&&(o||t===0||me(t)===me(c))&&(t+=c)}return!u&&!i.all?0:t}function yx(e,t){let{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function Cl(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function vx(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function wx(e){let{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function _x(e,t,n){let i=e[t]||(e[t]={});return i[n]||(i[n]={})}function yf(e,t,n,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function vf(e,t){let{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=vx(o,r,i),d=t.length,f;for(let p=0;p<d;++p){let b=t[p],{[l]:x,[c]:y}=b,w=b._stacks||(b._stacks={});f=w[c]=_x(s,u,x),f[a]=y,f._top=yf(f,r,!0,i.type),f._bottom=yf(f,r,!1,i.type);let _=f._visualValues||(f._visualValues={});_[a]=y}}function Pl(e,t){let n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function kx(e,t){return Re(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Sx(e,t,n){return Re(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ts(e,t){let n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(let s of t){let o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function Tx(e,t,n,i){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?il:Qe;if(i){if(s._sharedOptions){let u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){let f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{let u=c(o,t,n);if(l){let{vScale:d}=s._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(x=>!X(x[d.axis]));u.lo-=Math.max(0,p);let b=f.slice(u.hi).findIndex(x=>!X(x[d.axis]));u.hi+=Math.max(0,b)}return u}}return{lo:0,hi:o.length-1}}function zs(e,t,n,i,s){let o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:u}=o[a],{lo:d,hi:f}=Tx(o[a],t,r,s);for(let p=d;p<=f;++p){let b=u[p];b.skip||i(b,c,p)}}}function Cx(e){let t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){let o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Al(e,t,n,i,s){let o=[];return!s&&!e.isPointInArea(t)||zs(e,n,t,function(a,l,c){!s&&!Zt(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Px(e,t,n,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:d}=el(r,{x:t.x,y:t.y});Uo(d,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return zs(e,n,t,o),s}function Dx(e,t,n,i,s,o){let r=[],a=Cx(n),l=Number.POSITIVE_INFINITY;function c(u,d,f){let p=u.inRange(t.x,t.y,s);if(i&&!p)return;let b=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(b))&&!p)return;let y=a(t,b);y<l?(r=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&r.push({element:u,datasetIndex:d,index:f})}return zs(e,n,t,c),r}function Ol(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Px(e,t,n,s):Dx(e,t,n,i,s,o)}function _f(e,t,n,i,s){let o=[],r=n==="x"?"inXRange":"inYRange",a=!1;return zs(e,n,t,(l,c,u)=>{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}function Cs(e,t){return e.filter(n=>n.pos===t)}function kf(e,t){return e.filter(n=>oh.indexOf(n.pos)===-1&&n.box.axis===t)}function Ps(e,t){return e.sort((n,i)=>{let s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Ox(e){let t=[],n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Rx(e){let t={};for(let n of e){let{stack:i,pos:s,stackWeight:o}=n;if(!i||!oh.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Ix(e,t){let n=Rx(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function Nx(e){let t=Ox(e),n=Ps(t.filter(c=>c.box.fullSize),!0),i=Ps(Cs(t,"left"),!0),s=Ps(Cs(t,"right")),o=Ps(Cs(t,"top"),!0),r=Ps(Cs(t,"bottom")),a=kf(t,"x"),l=kf(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Cs(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Sf(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function rh(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Lx(e,t,n,i){let{pos:s,box:o}=n,r=e.maxPadding;if(!Y(s)){n.size&&(e[s]-=n.size);let d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&rh(r,o.getPadding());let a=Math.max(0,t.outerWidth-Sf(r,e,"left","right")),l=Math.max(0,t.outerHeight-Sf(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function zx(e){let t=e.maxPadding;function n(i){let s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Vx(e,t){let n=t.maxPadding;function i(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function Os(e,t,n,i){let s=[],o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Vx(a.horizontal,t));let{same:d,other:f}=Lx(t,n,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&Os(s,t,n,i)||u}function lr(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function Ef(e,t,n,i){let s=n.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let d=t.w*u,f=c.size||l.height;ki(c.start)&&(r=c.start),l.fullSize?lr(l,s.left,r,n.outerWidth-s.right-s.left,f):lr(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{let d=t.h*u,f=c.size||l.width;ki(c.start)&&(o=c.start),l.fullSize?lr(l,o,s.top,f,n.outerHeight-s.bottom-s.top):lr(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}function Hx(e,t){let n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[gr]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Mf(s)){let o=or(e,"width");o!==void 0&&(e.width=o)}if(Mf(i))if(e.style.height==="")e.height=e.width/(t||2);else{let o=or(e,"height");o!==void 0&&(e.height=o)}return e}function Bx(e,t,n){e&&e.addEventListener(t,n,ah)}function Wx(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,ah)}function jx(e,t){let n=Fx[e.type]||e.type,{x:i,y:s}=Jt(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function yr(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function $x(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||yr(a.addedNodes,i),r=r&&!yr(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ux(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||yr(a.removedNodes,i),r=r&&!yr(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function lh(){let e=window.devicePixelRatio;e!==Tf&&(Tf=e,Ns.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Gx(e,t){Ns.size||window.addEventListener("resize",lh),Ns.set(e,t)}function Yx(e){Ns.delete(e),Ns.size||window.removeEventListener("resize",lh)}function Kx(e,t,n){let i=e.canvas,s=i&&Ms(i);if(!s)return;let o=Ko((a,l)=>{let c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Gx(e,o),r}function Rl(e,t,n){n&&n.disconnect(),t==="resize"&&Yx(e)}function Xx(e,t,n){let i=e.canvas,s=Ko(o=>{e.ctx!==null&&n(jx(o,e))},e);return Bx(i,t,s),s}function qx(e){return!Es()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?zl:Vl}function Zx(e,t){let n=e.options.ticks,i=Jx(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?t0(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return e0(t,c,o,r/s),c;let u=Qx(o,t,s);if(r>0){let d,f,p=r>1?Math.round((l-a)/(r-1)):null;for(cr(t,c,u,X(p)?0:a-p,a),d=0,f=r-1;d<f;d++)cr(t,c,u,o[d],o[d+1]);return cr(t,c,u,l,X(p)?t.length:l+p),c}return cr(t,c,u),c}function Jx(e){let t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function Qx(e,t,n){let i=n0(e),s=t.length/n;if(!i)return Math.max(s,1);let o=Qa(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function t0(e){let t=[],n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function e0(e,t,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=n[s*i])}function cr(e,t,n,i,s){let o=W(i,0),r=Math.min(W(s,e.length),e.length),a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function n0(e){let t=e.length,n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}function Df(e,t){let n=[],i=e.length/t,s=e.length,o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function s0(e,t,n){let i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function o0(e,t){$(e,n=>{let i=n.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ds(e){return e.drawTicks?e.tickLength:0}function Af(e,t){if(!e.display)return 0;let n=gt(e.font,t),i=kt(e.padding);return(et(e.text)?e.text.length:1)*n.lineHeight+i.height}function r0(e,t){return Re(e,{scale:t,type:"scale"})}function a0(e,t,n){return Re(e,{tick:n,index:t,type:"tick"})}function l0(e,t,n){let i=Xo(e);return(n&&t!=="right"||!n&&t==="right")&&(i=i0(i)),i}function c0(e,t,n,i){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l,d=0,f,p,b,x=r-s,y=a-o;if(e.isHorizontal()){if(p=Rt(i,o,a),Y(n)){let w=Object.keys(n)[0],_=n[w];b=u[w].getPixelForValue(_)+x-t}else n==="center"?b=(c.bottom+c.top)/2+x-t:b=Cf(e,n,t);f=a-o}else{if(Y(n)){let w=Object.keys(n)[0],_=n[w];p=u[w].getPixelForValue(_)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=Cf(e,n,t);b=Rt(i,r,s),d=n==="left"?-At:At}return{titleX:p,titleY:b,maxWidth:f,rotation:d}}function u0(e,t,n){let i=$n(Object.create(null),[n?it.get(n):{},it.get(t),e.defaults]);it.set(t,i),e.defaultRoutes&&d0(t,e.defaultRoutes),e.descriptors&&it.describe(t,e.descriptors)}function d0(e,t){Object.keys(t).forEach(n=>{let i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");it.route(o,s,l,a)})}function f0(e){return"id"in e&&"defaults"in e}function h0(e){let t={},n=[],i=Object.keys(Ne.plugins.items);for(let o=0;o<i.length;o++)n.push(Ne.getPlugin(i[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function p0(e,t){return!t&&e===!1?null:e===!0?{}:e}function g0(e,{plugins:t,localIds:n},i,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=p0(i[l],s);c!==null&&o.push({plugin:a,options:m0(e.config,{plugin:a,local:n[l]},c,r)})}return o}function m0(e,{plugin:t,local:n},i,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Bl(e,t){let n=it.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function b0(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function x0(e,t){return e===t?"_index_":"_value_"}function Of(e){if(e==="x"||e==="y"||e==="r")return e}function y0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Wl(e,...t){if(Of(e))return e;for(let n of t){let i=n.axis||y0(n.position)||e.length>1&&Of(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Rf(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function v0(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Rf(e,"x",n[0])||Rf(e,"y",n[0])}return{}}function w0(e,t){let n=vn[e.type]||{scales:{}},i=t.scales||{},s=Bl(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!Y(a))return console.error(\`Invalid scale configuration for scale: \${r}\`);if(a._proxy)return console.warn(\`Ignoring resolver passed as options for scale: \${r}\`);let l=Wl(r,a,v0(r,e),it.scales[a.type]),c=x0(l,s),u=n.scales||{};o[r]=Un(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Bl(a,t),u=(vn[a]||{}).scales||{};Object.keys(u).forEach(d=>{let f=b0(d,l),p=r[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),Un(o[p],[{axis:f},i[p],u[d]])})}),Object.keys(o).forEach(r=>{let a=o[r];Un(a,[it.scales[a.type],it.scale])}),o}function ch(e){let t=e.options||(e.options={});t.plugins=W(t.plugins,{}),t.scales=w0(e,t)}function uh(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function _0(e){return e=e||{},e.data=uh(e.data),ch(e),e}function ur(e,t){let n=If.get(e);return n||(n=t(),If.set(e,n),dh.add(n)),n}function Nf(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let s=n.join(),o=i.get(s);return o||(o={resolver:Ss(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}function S0(e,t){let{isScriptable:n,isIndexable:i}=nr(e);for(let s of t){let o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(Pe(a)||k0(a))||r&&et(a))return!0}return!1}function Lf(e,t){return e==="top"||e==="bottom"||M0.indexOf(e)===-1&&t==="x"}function zf(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Vf(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),z(n&&n.onComplete,[e],t)}function T0(e){let t=e.chart,n=t.options.animation;z(n&&n.onProgress,[e],t)}function fh(e){return Es()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}function C0(e,t,n){let i=Object.keys(e);for(let s of i){let o=+s;if(o>=t){let r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function P0(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function Hf(){return $(ae.instances,e=>e._plugins.invalidate())}function hh(e,t,n=t){e.lineCap=W(n.borderCapStyle,t.borderCapStyle),e.setLineDash(W(n.borderDash,t.borderDash)),e.lineDashOffset=W(n.borderDashOffset,t.borderDashOffset),e.lineJoin=W(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=W(n.borderWidth,t.borderWidth),e.strokeStyle=W(n.borderColor,t.borderColor)}function D0(e,t,n){e.lineTo(n.x,n.y)}function A0(e){return e.stepped?fl:e.tension||e.cubicInterpolationMode==="monotone"?hl:D0}function ph(e,t,n={}){let i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function O0(e,t,n,i){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ph(s,n,i),u=A0(o),{move:d=!0,reverse:f}=i||{},p,b,x;for(p=0;p<=c;++p)b=s[(a+(f?c-p:p))%r],!b.skip&&(d?(e.moveTo(b.x,b.y),d=!1):u(e,x,b,f,o.stepped),x=b);return l&&(b=s[(a+(f?c:0))%r],u(e,x,b,f,o.stepped)),!!l}function R0(e,t,n,i){let s=t.points,{count:o,start:r,ilen:a}=ph(s,n,i),{move:l=!0,reverse:c}=i||{},u=0,d=0,f,p,b,x,y,w,_=T=>(r+(c?a-T:T))%o,S=()=>{x!==y&&(e.lineTo(u,y),e.lineTo(u,x),e.lineTo(u,w))};for(l&&(p=s[_(0)],e.moveTo(p.x,p.y)),f=0;f<=a;++f){if(p=s[_(f)],p.skip)continue;let T=p.x,E=p.y,P=T|0;P===b?(E<x?x=E:E>y&&(y=E),u=(d*u+T)/++d):(S(),e.lineTo(T,E),b=P,d=0,x=y=E),w=E}S()}function $l(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?R0:O0}function I0(e){return e.stepped?wl:e.tension||e.cubicInterpolationMode==="monotone"?_l:Je}function N0(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),hh(e,t.options),e.stroke(s)}function L0(e,t,n,i){let{segments:s,options:o}=t,r=$l(t);for(let a of s)hh(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}function V0(e,t,n,i){z0&&!t.options.segment?N0(e,t,n,i):L0(e,t,n,i)}function Bf(e,t,n,i){let s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}function H0(e,t,n,i,s){let o=B0(i,e,t,n),r=W0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function B0(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+i.measureText(s).width}function W0(e,t,n){let i=e;return typeof t.text!="string"&&(i=gh(t,n)),i}function gh(e,t){let n=e.text?e.text.length:0;return t*n}function j0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}function Ie(e,t){return t&&(et(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function nn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
5416
+ \`}function nm(e){let t=Zc(e);if(A){let n=im(e);n&&(t=\`\${t} (\${n})\`)}return t}function Zc(e){return e.displayName??(e.name||"Anonymous Function")}function im(e){return e.toString().match(/\\/\\/ \\[kiru_devtools\\]:(.*)/)?.[1]??null}var qc,Tt,ci=M(()=>{"use strict";ut();dt();q();Tt=class extends Error{constructor(t){let n=typeof t=="string"?t:t.message;super(n),this[qc]=!0,typeof t!="string"&&(A&&t?.vNode&&(this.customNodeStack=em(t.vNode)),this.fatal=t?.fatal)}static isKiruError(t){return t instanceof Error&&t[Gr]===!0}};qc=Gr});function ra(e){let t=e.type;return t=="#text"?am(e):Kr.has(t)?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t)}function aa(e){let t=e.type==="#text"?rm(e):ye.getCurrentChild();if(ye.bumpChildIndex(),!t)throw new Tt({message:"Hydration mismatch - no node found",vNode:e});let n=t.nodeName;if(Kr.has(n)||(n=n.toLowerCase()),e.type!==n)throw new Tt({message:\`Hydration mismatch - expected node of type \${e.type.toString()} but received \${n}\`,vNode:e});if(e.dom=t,e.type!=="#text"&&!(e.flags&Qt)){co(e);return}L.isSignal(e.props.nodeValue)&&oa(e,t,e.props.nodeValue);let i=e,s=e.sibling;for(;s&&s.type==="#text";){let o=s;ye.bumpChildIndex();let r=String(Z(i.props.nodeValue)??""),a=i.dom.splitText(r.length);o.dom=a,L.isSignal(o.props.nodeValue)&&oa(o,a,o.props.nodeValue),i=s,s=s.sibling}}function Qc(e){let t=e.parent,n=t?.dom;for(;t&&!n;)t=t.parent,n=t?.dom;if(!n||!t){if(!e.parent&&e.dom)return e;throw new Tt({message:"No DOM parent found while attempting to place node.",vNode:e})}return t}function tu(e,t){let{node:n,lastChild:i}=t,s=e.dom;if(i){i.after(s);return}let o=sm(e,n);if(o){n.dom.insertBefore(s,o);return}n.dom.appendChild(s)}function sm(e,t){let n=e;for(;n;){let i=n.sibling;for(;i;){if(!(i.flags&(le|Qt))){let s=om(i);if(s?.isConnected)return s}i=i.sibling}if(n=n.parent,!n||n.flags&Qt||n===t)return}}function om(e){let t=e;for(;t;){if(t.dom)return t.dom;if(t.flags&Qt)return;t=t.child}}function rm(e){let t=e.props.nodeValue;if(!L.isSignal(t))return ye.getCurrentChild();let n=t.peek();if(pn(n))return ye.getCurrentChild();let i=eu(e,t),s=ye.getCurrentChild();return s?(s.before(i),i):ye.getCurrentParent().appendChild(i)}function oa(e,t,n){A&&(n=J(n));let i=n.subscribe((s,o)=>{s!==o&&(t.nodeValue=s,A&&ct&&window.__kiru?.profilingContext?.emit("signalTextUpdate",Rt(e)))});At(e,"nodeValue",i)}function am(e){let{nodeValue:t}=e.props;return L.isSignal(t)?eu(e,t):document.createTextNode(t)}function eu(e,t){A&&(t=J(t));let n=t.peek()??"",i=document.createTextNode(n);return oa(e,i,t),i}var la=M(()=>{"use strict";ut();ce();Fn();ia();q();ci();dt();ea()});function ua(e){if(mt.current==="hydrate")return gn(e,fo);let t={node:e.dom?e:Qc(e)};ca(e,t,(e.flags&le)>0),e.dom&&!(e.flags&Qt)&&nu(e,t,!1),fo(e)}function ca(e,t,n){let i=e.child;for(;i;)i.dom?(ca(i,{node:i},!1),i.flags&Qt||nu(i,t,n)):ca(i,t,(i.flags&le)>0||n),fo(i),i=i.sibling}function nu(e,t,n){if((n||!e.dom.isConnected||e.flags&le)&&tu(e,t),A&&e.prev&&Zi()){let{dom:i,prev:s,cleanups:o}=e;jc(e,i,s.props,o),e.prev=null}(!e.prev||e.flags&ae)&&co(e),t.lastChild=e.dom}function da(e){e===e.parent?.child&&(e.parent.child=e.sibling);let t;A&&(t=Rt(e)),gn(e,n=>{let{subs:i,cleanups:s,dom:o,props:{ref:r},hooks:a}=n;if(i?.forEach(l=>l()),s&&Object.values(s).forEach(l=>l()),a){let{preCleanups:l,postCleanups:c}=a;ao.push(...c),l.forEach(Ft),l.length=c.length=0}A&&(window.__kiru.profilingContext?.emit("removeNode",t),o instanceof Element&&delete o.__kiruNode),o&&(o.isConnected&&!(n.flags&Qt)&&o.remove(),r&&Vn(r,null),delete n.dom)}),e.parent=null}var iu=M(()=>{"use strict";q();ut();dt();yt();Ji();ea();la()});var su=M(()=>{"use strict";iu();Jr();la()});function g(e,t=null,...n){e===_t&&(e=Jt);let i=t===null?{}:t,s=fa(i.key),o=n.length;return o===1?i.children=n[0]:o>1&&(i.children=n),{type:e,key:s,props:i}}function _t({children:e,key:t}){return{type:Jt,key:fa(t),props:{children:e}}}var ui=M(()=>{"use strict";ut();q()});function ho(e,t=null,n={},i=null,s=0){e===_t&&(e=Jt);let o=t?t.depth+1:0;return{type:e,key:i,props:n,parent:t,index:s,depth:o,flags:0,child:null,sibling:null,prev:null,deletions:null}}var ha=M(()=>{"use strict";ut();ui()});function mo(e,t){return A&&(ma=Rt(e)),Array.isArray(t)?(A&&(uu in t&&fm(e,t),dm(e,t)),cm(e,t)):lm(e,t)}function lm(e,t){let n=e.child;if(n===null)return lu(e,t);let i=n.sibling,s=ru(e,n,t);if(s!==null)return n&&n!==s&&!s.prev?ga(e,n):i&&ga(e,i),s;{let o=du(n),r=cu(o,e,0,t);if(r!==null){let a=r.prev;if(a!==null){let l=a.key;o.delete(l===null?a.index:l)}po(r,0,0)}return o.forEach(a=>go(e,a)),r}}function cm(e,t){let n=null,i=null,s=e.child,o=null,r=0,a=0;for(;s!==null&&a<t.length;a++){s.index>a?(o=s,s=null):o=s.sibling;let c=ru(e,s,t[a]);if(c===null){s===null&&(s=o);break}s&&!c.prev&&go(e,s),r=po(c,r,a),i===null?n=c:i.sibling=c,i=c,s=o}if(a===t.length)return ga(e,s),n;if(s===null){for(;a<t.length;a++){let c=lu(e,t[a]);c!==null&&(r=po(c,r,a),i===null?n=c:i.sibling=c,i=c)}return n}let l=du(s);for(;a<t.length;a++){let c=cu(l,e,a,t[a]);if(c!==null){let u=c.prev;if(u!==null){let d=u.key;l.delete(d===null?u.index:d)}r=po(c,r,a),i===null?n=c:i.sibling=c,i=c}}return l.forEach(c=>go(e,c)),n}function ru(e,t,n){let i=t===null?null:t.key;return pn(n)?i!==null||t?.type==="#text"&&L.isSignal(t.props.nodeValue)?null:ou(e,t,""+n):L.isSignal(n)?t&&t.props.nodeValue!==n?null:ou(e,t,n):di(n)?n.key!==i?null:um(e,t,n):Array.isArray(n)?i!==null?null:(A&&ba(n),au(e,t,n)):null}function ou(e,t,n){return t===null||t.type!=="#text"?Pe(e,"#text",{nodeValue:n}):(A&&Qi(),t.props.nodeValue!==n&&(t.props.nodeValue=n,t.flags|=ae),t.sibling=null,t)}function um(e,t,n){let{type:i,props:s,key:o}=n;return A&&typeof i=="function"&&(i=J(i)),i===Jt?au(e,t,s.children||[],s):t?.type===i?(A&&Qi(),t.index=0,t.sibling=null,typeof i=="string"?pu(t.props,s)&&(t.flags|=ae):t.flags|=ae,t.props=s,t):Pe(e,i,s,o)}function au(e,t,n,i={}){return t===null||t.type!==Jt?Pe(e,Jt,{children:n,...i}):(A&&Qi(),t.props={...t.props,...i,children:n},t.flags|=ae,t.sibling=null,t)}function lu(e,t){return pn(t)?Pe(e,"#text",{nodeValue:""+t}):L.isSignal(t)?Pe(e,"#text",{nodeValue:t}):di(t)?Pe(e,t.type,t.props,t.key):Array.isArray(t)?(A&&ba(t),Pe(e,Jt,{children:t})):null}function po(e,t,n){e.index=n;let i=e.prev;if(i!==null){let s=i.index;return s<t?(e.flags|=le,t):s}else return e.flags|=le,t}function cu(e,t,n,i){if(L.isSignal(i)||pn(i)){let o=e.get(n);if(o){if(o.props.nodeValue===i)return o;o.type==="#text"&&L.isSignal(o.props.nodeValue)&&o.cleanups?.nodeValue?.()}return Pe(t,"#text",{nodeValue:i},null,n)}if(di(i)){let{type:o,props:r,key:a}=i,l=e.get(a===null?n:a);return l?.type===o?(A&&Qi(),typeof o=="string"?pu(l.props,r)&&(l.flags|=ae):l.flags|=ae,l.props=r,l.sibling=null,l.index=n,l):Pe(t,o,r,a,n)}if(Array.isArray(i)){let o={children:i},r=e.get(n);return A&&ba(i),r?(A&&Qi(),r.flags|=ae,r.props=o,r):Pe(t,Jt,o,null,n)}return null}function Qi(){ct&&window.__kiru.profilingContext?.emit("updateNode",ma)}function ba(e){Object.assign(e,{[uu]:!0})}function du(e){let t=new Map;for(;e;){let n=e.key;t.set(n===null?e.index:n,e),e=e.sibling}return t}function go(e,t){e.deletions===null?e.deletions=[t]:e.deletions.push(t)}function ga(e,t){for(;t;)go(e,t),t=t.sibling}function dm(e,t){let n=new Set,i=!1;for(let s of t){if(!di(s))continue;let o=s.key;if(typeof o=="string"){if(!i&&n.has(o)){let r=hu(e);fu(\`\${r} component produced a child in a list with a duplicate key prop: "\${o}". Keys should be unique so that components maintain their identity across updates\`),i=!0}n.add(o)}}}function fm(e,t){let n=!1,i=!1;for(let s of t)di(s)&&(typeof s.key=="string"?n=!0:i=!0);if(i&&n){let s=hu(e);fu(\`\${s} component produced a child in a list without a valid key prop\`)}}function fu(e){let t=\`[kiru]: \${e}. See https://kirujs.dev/keys-warning for more information.\`;console.error(t)}function hu(e){if(pa.has(e))return pa.get(e);let t=e.parent,n;for(;!n&&t;)typeof t.type=="function"&&(n=t.type),t=t.parent;let i=\`<\${n?.displayName||n?.name||"Anonymous Function"} />\`;return pa.set(e,i),i}function Pe(e,t,n,i=null,s=0){let o=ho(t,e,n,i,s);return o.flags|=le,A&&ct&&window.__kiru.profilingContext?.emit("createNode",ma),o}function pu(e,t){return bo(e,t,hm)}var ma,uu,pa,hm,gu=M(()=>{"use strict";ut();q();ce();dt();ha();uu=Symbol("kiru:marked-list-child");pa=new WeakMap;hm=["children","key"]});function ts(e){if(fi){xa.push(e);return}e()}function bn(){fi&&(window.cancelAnimationFrame(xu),vu())}function Sa(e){e.flags|=Xe,Ae.push(e),fi=!0,bn()}function Ht(e){if(mt.current==="hydrate")return ts(()=>mu(e));mu(e)}function yu(){let e=K.current;if(!e)throw new Error("useRequestUpdate must be called inside a Kiru component");return()=>Ht(e)}function mu(e){if(ya&&(va=!0),K.current===e){A&&window.__kiru.profilingContext?.emit("updateDirtied",De),wa=!0;return}if(!(e.flags&(Xe|Nn))){if(e.flags|=Xe,!Ae.length){Ae.push(e),fi||(fi=!0,xu=window.requestAnimationFrame(vu));return}Ae.push(e)}}function pm(e){gn(e,t=>t.flags|=Nn),yo.push(e)}function vu(){if(A){let t=yo[0]??Ae[0];t?(De=Rt(t),window.__kiru.profilingContext?.beginTick(De)):De=null}let e=1;for(Xr();Ae.length;){Ae.length>e&&Ae.sort(_u),mn=Ae.shift(),e=Ae.length;let t=mn.flags;if(!(t&Nn)&&t&Xe){let n=mn;for(;n=gm(n););for(;yo.length;)da(yo.pop());ua(mn),mn.flags&=~Xe}}if(qr(),ya=!0,xo(bu),ya=!1,va)return wm(),xo(ka),va=!1,_a++,A&&(window.__kiru.profilingContext?.endTick(De),window.__kiru.profilingContext?.emit("updateDirtied",De)),bn();for(_a=0,fi=!1;xa.length;)xa.shift()();queueMicrotask(()=>{xo(ao),xo(ka)}),A&&(window.__kiru.emit("update",De),window.__kiru.profilingContext?.emit("update",De),window.__kiru.profilingContext?.endTick(De))}function gm(e){let t=mm(e);if(e.deletions!==null&&(e.deletions.forEach(pm),e.deletions=null),t)return t;let n=e;for(;n;){let{hooks:i}=n;if(i&&(bu.push(...i.pre),ka.push(...i.post),i.pre.length=0,i.post.length=0),n===mn)return null;if(n.sibling)return n.sibling;n=n.parent,mt.current==="hydrate"&&n?.dom&&ye.pop()}return null}function mm(e){let{type:t,props:n,prev:i,flags:s}=e;if(!(A&&Zi())){if(i&&(s&Xe)===0&&(i.props===n||!bo(i.props,n)))return null}try{return typeof t=="string"?vm(e):vo(t)?bm(e):xm(e)}catch(o){A&&window.__kiru.emit("error",De,o instanceof Error?o:new Error(String(o)));let r=wu(e);if(r){let a=r.error=o instanceof Error?o:new Error(String(o));return r.props.onError?.(a),r.depth<mn.depth&&(mn=r),r}if(Tt.isKiruError(o)){if(o.customNodeStack&&setTimeout(()=>{throw new Error(o.customNodeStack)}),o.fatal)throw o;return console.error(o),e.child}setTimeout(()=>{throw o})}return null}function bm(e){let{props:t,type:n}=e,i=t.children;if(n===Ke){let s=e,{error:o}=s;o&&(i=typeof t.fallback=="function"?t.fallback(o):t.fallback,delete s.error)}return e.child=mo(e,i)}function xm(e){let{type:t,props:n,subs:i}=e,s=(e.flags&Xe)===0;try{K.current=e;let o,r=0;do{if(e.flags&=~Xe,wa=!1,i&&(i.forEach(Ft),i.clear()),A&&Zi()){let{hooks:a,cleanups:l}=e;if(l&&(Object.values(l).forEach(Ft),delete e.cleanups),a){let{preCleanups:c,postCleanups:u}=a;c.forEach(Ft),u.forEach(Ft),c.length=u.length=0}delete e.propSyncs,delete e.render}if(o=ym(e,t,n,s),++r>Yr){if(A)throw new Tt({message:"Too many re-renders. Kiru limits the number of renders to prevent an infinite loop.",fatal:!0,vNode:e});break}}while(wa);return e.child=mo(e,o)}finally{K.current=null}}function ym(e,t,n,i){let{render:s,propSyncs:o}=e;if(s){if(i){let a={...n};o?.forEach(l=>l(a))}return s(n)}let r=J(t)(n);if(typeof r=="function"){if(e.subs?.forEach(Ft),e.render=r,i){let a={...n};o?.forEach(l=>l(a))}r=r(n)}else if(A&&Ln.has(e))throw new Error("setup() must not be called inside a render function");return r}function vm(e){let{props:t,type:n}=e;return A&&wo(e),e.dom||(mt.current==="hydrate"?aa(e):e.dom=ra(e),A&&e.dom instanceof Element&&(e.dom.__kiruNode=e)),n!=="#text"&&(e.child=mo(e,t.children),e.child&&mt.current==="hydrate"&&ye.push(e.dom)),e.child}function wm(){if(_a>Yr)throw new Tt("Maximum update depth exceeded. This can happen when a component repeatedly calls setState during render or in useLayoutEffect. Kiru limits the number of nested updates to prevent infinite loops.")}function xo(e){for(let t=0;t<e.length;t++)e[t]();e.length=0}var De,Ae,fi,xa,yo,ya,va,wa,_a,bu,ka,xu,mn,qe=M(()=>{"use strict";ut();su();q();dt();ci();yt();ia();gu();Ji();Ae=[],fi=!1,xa=[],yo=[],ya=!1,va=!1,wa=!1,_a=0,bu=[],ka=[],xu=-1;mn=null});var te,Re,hi=M(()=>{"use strict";te=new Map,Re=new Map});function _o(e){let{id:t,subs:n,fn:i,deps:s=[],onDepChanged:o}=e,r;te.delete(t);let a=!!K.current&&!kt();a||(r=new Map,Ze.stack.push(r));let l=i(...s.map(c=>c.value));if(!a){for(let[u,d]of n)r.has(u)||(d(),n.delete(u));let c=()=>{te.size||queueMicrotask(ko),te.set(t,o)};for(let[u,d]of r){if(n.has(u))continue;let f=d.subscribe(c);n.set(u,f)}Ze.stack.pop()}return l}var Ze,pi=M(()=>{"use strict";yt();q();hi();Fn();Ze={enabled:!0,stack:new Array,current:function(){return this.stack[this.stack.length-1]}}});var ku,L,D,ce=M(()=>{"use strict";q();ut();dt();yt();qe();hi();pi();L=class e{constructor(t,n){this[ku]=!0,this.$id=gi(),this.$value=t,n&&(this.displayName=n),A?(Re.set(this.$id,new Set),this.$initialValue=Su(t),this[re]={provide:()=>this,inject:s=>{ct&&window.__kiru.devtools?.untrack(s),Re.get(this.$id)?.clear?.(),Re.delete(this.$id),this.$id=s.$id,s.__next=this,this.$initialValue===s.$initialValue?this.$value=s.$value:this.notify()},destroy:()=>{}}):this.$subs=new Set;let i=K.current;i&&At(i,this.$id,e.dispose.bind(null,this))}get value(){if(A){let t=J(this);return e.entangle(t),t.$value}return e.entangle(this),this.$value}set value(t){if(A){let n=J(this);if(Object.is(n.$value,t))return;n.$prevValue=n.$value,n.$value=t,n.notify();return}Object.is(this.$value,t)||(this.$prevValue=this.$value,this.$value=t,this.notify())}peek(){return A?J(this).$value:this.$value}sneak(t){if(A){let n=J(this);n.$prevValue=n.$value,n.$value=t;return}this.$prevValue=this.$value,this.$value=t}toString(){if(A){let t=J(this);return e.entangle(t),\`\${t.$value}\`}return e.entangle(this),\`\${this.$value}\`}subscribe(t){if(A){let n=J(this),i=Re.get(n.$id);if(A&&!i){let o=\`Attempting to subscribe to a signal that has been disposed: \${n.displayName??n.$id}\`;throw $i in n&&(o+=\`
5417
+ File: \${n[$i]}\`),o+=\`
5418
+ Initial value: \${n.$initialValue}\`,new Error(o)}return i.add(t),()=>i.delete(t)}return this.$subs.add(t),()=>this.$subs.delete(t)}notify(t){if(A){let n=J(this);return Re.get(n.$id)?.forEach(i=>{if(t&&!t(i))return;let{$value:s,$prevValue:o}=J(this);return i(s,o)})}this.$subs.forEach(n=>{if(!(t&&!t(n)))return n(this.$value,this.$prevValue)})}static isSignal(t){return typeof t=="object"&&!!t&&Ur in t}static subscribers(t){return A?(t=J(t),Re.get(t.$id)):t.$subs}static makeReadonly(t){A&&(t=J(t));let n=Object.getOwnPropertyDescriptor(t,"value");return n&&!n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},configurable:!0})}static makeWritable(t){A&&(t=J(t));let n=Object.getOwnPropertyDescriptor(t,"value");return n&&n.writable?t:Object.defineProperty(t,"value",{get:function(){return e.entangle(this),this.$value},set:function(i){this.$value=i,this.notify()},configurable:!0})}static entangle(t){if(Ze.enabled===!1)return;A&&(t=J(t));let n=K.current,i=Ze.current();if(i){(!n||n&&kt())&&i.set(t.$id,t);return}if(!n||!kt())return;let s=t.subscribe(()=>Ht(n));(n.subs??(n.subs=new Set)).add(s)}static dispose(t){if(t.$isDisposed=!0,A){t=J(t),Re.delete(t.$id),ct&&window.__kiru.devtools?.untrack(t);return}t.$subs.clear()}};ku=Ur;D=(e,t)=>new L(e,t)});function Z(e,t=!1){return L.isSignal(e)?t?e.value:e.peek():e}function ko(){te.forEach(Ft),te.clear()}var Fn=M(()=>{"use strict";q();ce();hi();pi()});function ft(...e){return e.filter(Boolean).join(" ")}function So(e){return e.replace(_m,"&amp;").replace(km,"&lt;").replace(Sm,"&gt;").replace(Mm,"&quot;").replace(Em,"&#039;").replace(Tm,"&#47;")}function na(e){switch(e){case"className":return"class";case"htmlFor":return"for";case"tabIndex":case"formAction":case"formMethod":case"formEncType":case"contentEditable":case"spellCheck":case"allowFullScreen":case"autoPlay":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"noModule":case"noValidate":case"popoverTarget":case"popoverTargetAction":case"playsInline":case"readOnly":case"itemscope":case"rowSpan":case"crossOrigin":return e.toLowerCase();default:return e.indexOf("-")>-1?e:e.startsWith("aria")?"aria-"+e.substring(4).toLowerCase():zc.get(e)||e}}function Pm(e){let t="";for(let n in e){let i=Z(e[n]);if(i==null)continue;let s=n.replace(Cm,"-$&").toLowerCase();t+=\`\${s}:\${i};\`}return t}function Dm(e){return typeof e=="string"?e:typeof e=="object"&&e?Pm(e):""}function Tu(e){let t=[],{className:n,style:i,...s}=e;if(n){let r=Z(n);r&&t.push(\`class="\${r}"\`)}if(i){let r=Z(i);r&&t.push(\`style="\${Dm(r)}"\`)}let o=Object.keys(s).filter(Mu.isStringRenderableProperty);for(let r=0;r<o.length;r++){let a=o[r],l=Z(e[a]);if(l==null)continue;a=a.split("bind:")[1]??a;let c=na(a);switch(typeof l){case"function":case"symbol":continue;case"boolean":if(ro.has(c)){l&&t.push(c);continue}}t.push(\`\${c}="\${l}"\`)}return t.join(" ")}function Su(e,t={functions:!0}){let n=new WeakSet;return JSON.stringify(e,(i,s)=>{if(typeof s=="object"&&s!==null){if(n.has(s))return"[CIRCULAR]";n.add(s)}return typeof s=="function"?t.functions?s.toString():\`[FUNCTION (\${s.name||"anonymous"})]\`:s})}var _m,km,Sm,Em,Mm,Tm,Cm,Eu,Mu,Cu=M(()=>{"use strict";Fn();ut();_m=/&/g,km=/</g,Sm=/>/g,Em=/'/g,Mm=/"/g,Tm=/\\//g,Cm=/[A-Z]/g;Eu=new Set(["children","ref","key","innerHTML"]),Mu={isInternalProp:e=>Eu.has(e),isEvent:e=>e.startsWith("on"),isStringRenderableProperty:e=>!Eu.has(e)&&!Mu.isEvent(e)}});function Ft(e){e()}function J(e){let t=e;if(A)for(;"__next"in t;)t=t.__next;return t}function Vn(e,t){if(typeof e=="function"){e(t);return}if(L.isSignal(e)){e.value=t;return}e.current=t}function kt(){return mt.current==="dom"||mt.current==="hydrate"}var Jc,Ea=M(()=>{"use strict";ce();dt();yt();Jc=Object.freeze(()=>{})});function Eo(e){return(e.flags&Nn)!==0}function Pu(e){return typeof e=="object"&&e!==null&&"type"in e}function di(e){return typeof e=="object"&&e!==null&&"type"in e}function pn(e){return typeof e=="string"&&e!==""||typeof e=="number"||typeof e=="bigint"}function vo(e){return e===Jt||e===In||e===Ke}function Rt(e){let t=e;for(;t;){if(t.app)return e.app=t.app;t=t.parent}return null}function fo(e){let{props:t,key:n,index:i}=e;e.prev={props:t,key:n,index:i},e.flags&=~(ae|le|Nn)}function gn(e,t){t(e);let n=e.child;for(;n;)t(n),n.child&&gn(n,t),n=n.sibling}function sa(e,t){let n=e.parent;for(;n;){if(t(n))return n;n=n.parent}return null}function wu(e){return sa(e,t=>t.type===Ke)}function wo(e){if("children"in e.props&&e.props.innerHTML)throw new Tt({message:"Cannot use both children and innerHTML on an element",vNode:e});for(let t in e.props)if("bind:"+t in e.props)throw new Tt({message:\`Cannot use both bind:\${t} and \${t} on an element\`,vNode:e})}function fa(e){return e===void 0?null:typeof e=="string"||typeof e=="number"?e:null}function es(e){let t=[],n=e;for(;n;)t.push(n.index),t.push(n.depth),n=n.parent;return\`k:\${BigInt(t.join("")).toString(36)}\`}function At(e,t,n){(e.cleanups??(e.cleanups={}))[t]=n}function bo(e,t,n){let i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!0;for(let o of i)if(!n?.includes(o)&&e[o]!==t[o])return!0;return!1}function _u(e,t){return e.depth-t.depth}var Mo=M(()=>{"use strict";ut();V();ci();yt()});function gi(e=10,t=Am){let n="";for(let i=0;i<e;i++)n+=t[Math.random()*t.length|0];return n}var Am,Du=M(()=>{"use strict";Am="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz-"});var q=M(()=>{"use strict";Vc();Hc();Cu();Ea();Mo();Du()});function Zi(){return Ma}function Au(e){return!!e&&(typeof e=="object"||typeof e=="function")&&re in e&&typeof e[re]=="object"&&!!e[re]}function Ru(){let e=new Map,t=null,n=null,i=!1,s=()=>i,o=!1,r=[];return{register:d=>{if(n===null)throw new Error("[kiru]: HMR could not register: No active module");let f=new Set;for(let[p,b]of Object.entries(d)){let x=n.hotVars.get(p);if(b.value[$i]=b.link,x?.value&&(x.value.__next=b.value),n.hotVars.set(p,b),!!x){if(Au(x.value)&&Au(b.value)){b.value[re].inject(x.value[re].provide()),x.value[re].destroy();continue}x.type==="component"&&b.type==="component"&&window.__kiru.apps.forEach(y=>{gn(y.rootNode,w=>{w.type===x.value&&(w.type=b.value,f.add(w))})})}}f.size&&(Ma=!0,f.forEach(p=>Ht(p)),bn(),Ma=!1),i=!1,n=null,t=null},prepare:d=>{let f=e.get(d);if(i=!!f,!f)f={hotVars:new Map,unnamedEffects:[],hmrCallbacks:[]},e.set(d,f);else{for(;f.hmrCallbacks.length;)f.hmrCallbacks.shift()();for(;r.length;)r.shift()();for(let p of f.unnamedEffects)p.stop();f.unnamedEffects.length=0}n=f,t=d},isReplacement:s,moduleEffects:{registerNext(){o=!0},push(d){o&&(n.unnamedEffects.push(d),o=!1)}},onHmr:d=>{if(n){n.hmrCallbacks.push(d);return}r.push(d)},getCurrentFilePath(){return t}}}function Ou(e){"window"in globalThis&&window.__kiru.HMRContext&&window.__kiru.HMRContext.onHmr(e)}var Ma,Ji=M(()=>{"use strict";ut();q();qe();Ma=!1});function Iu(){let e=new Map,t=new Map;return{appStats:t,emit:(n,i)=>{e.get(n)?.forEach(s=>s(i))},addEventListener:(n,i)=>{e.has(n)||e.set(n,new Set),e.get(n).add(i)},removeEventListener:(n,i)=>{e.has(n)&&e.get(n).delete(i)},mountDuration:n=>{let i=t.get(n);return i?i.mountDuration:0},totalTicks:n=>{let i=t.get(n);return i?i.totalTicks:0},lastTickDuration:n=>{let i=t.get(n);if(!i)return 1/0;let s=i.timestamps[i.timestamps.length-1];return!s||(s.end===1/0&&(s=i.timestamps[i.timestamps.length-2]),!s)?1/0:s.end-s.start},averageTickDuration:n=>{let i=t.get(n);if(!i)return 0;let s=i.timestamps.filter(o=>o.end!==1/0);return s.reduce((o,r)=>o+(r.end-r.start),0)/s.length},beginTick:n=>{t.has(n)||t.set(n,{mountDuration:1/0,timestamps:[],totalTicks:0});let i=t.get(n);i.totalTicks++,i.timestamps.push({start:performance.now(),end:1/0})},endTick:n=>{let i=t.get(n),s=i.timestamps[i.timestamps.length-1];s.end=performance.now(),i.mountDuration===1/0&&(i.mountDuration=s.end-s.start),i.timestamps.length>100&&i.timestamps.shift()}}}var Nu=M(()=>{"use strict"});var Lu,zu=M(()=>{"use strict";Lu={current:null}});function Vu(){let e=new Set,t=new Map;function n(r,a,l){t.get(r)?.forEach(c=>c(a,l))}function i(r,a){t.has(r)||t.set(r,new Set),t.get(r).add(a)}function s(r,a){t.get(r)?.delete(a)}let o={get apps(){return Array.from(e)},emit:n,on:i,off:s};if(i("mount",r=>e.add(r)),i("unmount",r=>e.delete(r)),A){o.HMRContext=Ru(),o.profilingContext=Iu(),o.fileRouterInstance=Lu;let r=new Set,a=new Set;o.devtools={track:(l,c)=>{r.add({label:c??l.displayName??"Unnamed Signal",signal:l}),a.forEach(u=>u(r))},untrack:l=>{r.forEach(c=>{c.signal===l&&r.delete(c)}),a.forEach(c=>c(r))},subscribe:l=>(a.add(l),l(r),()=>a.delete(l))}}return o}var Fu=M(()=>{"use strict";dt();Ji();Nu();zu()});function Ot(e,t){return new ns(e,t)}var ns,Hu=M(()=>{"use strict";dt();ut();q();hi();pi();ce();ns=class e extends L{constructor(t,n){if(super(void 0,n),this.$getter=t,this.$unsubs=new Map,this.$isDirty=!0,A){let i=this[re].inject;this[re]={provide:()=>this,inject:s=>{i(s),e.stop(s),this.$isDirty=!0,e.run(this),this.notify()},destroy:()=>{}}}}get value(){return this.ensureNotDirty(),super.value}set value(t){super.value=t}toString(){return this.ensureNotDirty(),super.toString()}peek(){return this.ensureNotDirty(),super.peek()}subscribe(t){return this.$isDirty&&e.run(this),super.subscribe(t)}static dispose(t){e.stop(t),L.dispose(t)}static stop(t){A&&(t=J(t));let{$id:n,$unsubs:i}=t;te.delete(n),i.forEach(Ft),i.clear(),t.$isDirty=!0}static run(t){A&&(t=J(t));let{$id:n,$getter:i,$unsubs:s}=t,o=_o({id:n,subs:s,fn:()=>i(t.$value),onDepChanged:()=>{if(t.$isDirty=!0,A){if(!Re?.get(n)?.size)return}else if(!t.$subs.size)return;e.run(t),!Object.is(t.$value,t.$prevValue)&&t.notify()}});t.sneak(o),t.$isDirty=!1}ensureNotDirty(){let t=this;if(A&&(t=J(this)),!t.$isDirty){let n=te.get(t.$id);n&&(n(),te.delete(t.$id))}t.$isDirty&&(A&&t.$isDisposed||e.run(t))}}});function Bt(e,t){if(typeof e=="function")return new mi(e);let n=e,i=t;return new mi(i,n)}var mi,Ta=M(()=>{"use strict";dt();hi();pi();q();yt();mi=class e{constructor(t,n){this.id=gi(),this.callback=t,this.deps=n,this.unsubs=new Map,this.isRunning=!1,this.cleanup=null,A&&ct&&window.__kiru.HMRContext.moduleEffects.push(this);let i=K.current;if(i){if(!kt())return;At(i,this.id,this.stop.bind(this))}this.start()}start(){if(!this.isRunning){if(this.isRunning=!0,A&&ct&&window.__kiru.HMRContext?.isReplacement())return queueMicrotask(()=>{this.isRunning&&e.run(this)});e.run(this)}}stop(){te.delete(this.id),this.unsubs.forEach(Ft),this.unsubs.clear(),this.cleanup?.(),this.cleanup=null,this.isRunning=!1}static run(t){let n=J(t),{id:i,callback:s,unsubs:o,deps:r}=n;n.cleanup=_o({id:i,subs:o,fn:s,deps:r,onDepChanged:()=>{n.cleanup?.(),e.run(n)}})??null}}});var Bu=M(()=>{"use strict"});var is=M(()=>{"use strict";ce();Hu();Ta();Fn();Bu()});function Rm(e){return async(...t)=>{let{execute:n,onError:i}=e(...t);try{return{error:null,data:await n()}}catch(s){let o=new To(s);return i?.(o),{error:o,data:null}}}}var To,Wu=M(()=>{"use strict";To=class extends Error{constructor(t){super("Error occurred during action execution",{cause:t})}}});function Im(e,t,n){if(A&&t.__kiruNode)return t.__kiruNode.app;let i=Nm(t),s=Om++,o=n?.name??\`App-\${s}\`,r={id:s,name:o,rootNode:i,render:a,unmount:l};function a(c){i.props={children:c},Sa(i)}function l(){i.props={children:null},Sa(i),A&&(delete t.__kiruNode,delete i.app),window.__kiru.emit("unmount",r)}return A&&(i.app=r),a(e),window.__kiru.emit("mount",r),A&&!globalThis.__KIRU_READY__&&(globalThis.__KIRU_READY__=!0,queueMicrotask(()=>{window.dispatchEvent(new Event("kiru:ready"))})),r}function Nm(e){let t=ho(e.nodeName.toLowerCase());return t.flags|=Qt,t.dom=e,A&&(e.__kiruNode=t),t}var Om,ju=M(()=>{"use strict";ut();dt();qe();ha();Om=0});function $u({children:e,fallback:t,onError:n}){return g(Ke,{children:e,fallback:t,onError:n})}var Uu=M(()=>{"use strict";ut();V()});function xn(e){return{current:e}}var Ca=M(()=>{"use strict"});function Wt(e){if(!kt())return;let t=K.current;if(!t)throw new Error("Cannot queue onCleanup effect outside of a component");At(t,gi(10),e)}var Co=M(()=>{"use strict";yt();q()});function Po(e){return typeof e=="object"&&!!e&&ai in e}function Do(e){return e instanceof Promise&&"id"in e&&"state"in e}function Lm(e){let t=K.current;if(!t)throw new Error("statefulPromise must be called inside a Kiru component");let n=es(t),i=D(!0);i.value=!0;let s=new AbortController;Wt(()=>s.abort());let o=Gu.get(t)??0;Gu.set(t,o+1);let r=\`\${n}:data:\${o}\`,a;mt.current==="string"?a=Promise.resolve():mt.current==="hydrate"&&Bc.current==="dynamic"?a=zm(r,s.signal):a=e(s.signal);let c=Object.assign(a,{id:r,state:"pending"});return c.then(u=>{c.state="fulfilled",c.value=u,i.value=!1}).catch(u=>{c.state="rejected",c.error=u instanceof Error?u:new Error(u)}),Object.assign(c,{isPending:i})}function zm(e,t){return new Promise((n,i)=>{let s=window[li]??(window[li]=new Map),o=s.get(e);if(o){let{data:a,error:l}=o;return s.delete(e),l?i(l):n(a)}let r=a=>{let{detail:l}=a;if(l.id===e){s.delete(e),window.removeEventListener(li,r);let{data:c,error:u}=l;if(u)return i(u);n(c)}};window.addEventListener(li,r),t.addEventListener("abort",()=>{window.removeEventListener(li,r),i()})})}var Gu,Ao=M(()=>{"use strict";ut();yt();ce();Mo();Co();Gu=new WeakMap});var ve,Yu=M(()=>{"use strict";q();is();ut();yt();Ca();qe();Ao();ve=()=>e=>{let{from:t,children:n,fallback:i,mode:s}=e,o=xn(null),r=new Set,a;if(Do(t))r.add(t),a=t.value;else if(L.isSignal(t))a=t.value;else{let l={};for(let c in t){let u=t[c];Do(u)&&r.add(u),l[c]=u.value}a=l}if(r.size===0)return n(a);if(!kt())throw{[ai]:{fallback:i,data:Array.from(r)}};for(let l of r){if(l.state==="rejected")throw l.error;if(l.state==="pending"){let c=K.current;Promise.allSettled(r).then(()=>Ht(c));let u=o.current;return s!=="fallback"&&u?n(u,!0):i}}return o.current=a,n(a,!1)}});function Je({each:e,fallback:t,children:n}){let i=Z(e,!0);return i.length===0?t:i.map(n)}var Ku=M(()=>{"use strict";is()});function Vm(e){function t(n){let{fallback:i=null,...s}=n,o=K.current;if(!kt())return i;let r=Fm(e.toString()),a=Xu.get(r);if(!a){let l=e(),c={promise:l,result:null};return Xu.set(r,c),l.then(u=>{c.result=typeof u=="function"?u:u.default,Ht(o)}),i}return a.result===null?(a.promise.then(()=>Ht(o)),i):g(a.result,s)}return A&&(t.displayName="Kiru.lazy"),t}var Xu,Fm,qu=M(()=>{"use strict";ui();dt();Ea();yt();qe();Xu=ct?window.__KIRU_LAZY_CACHE??(window.__KIRU_LAZY_CACHE=new Map):new Map;Fm=e=>e.replace(/import\\((["'])([^?"']+)\\?[^)"']*\\1\\)/g,(t,n,i)=>\`import(\${n}\${i}\${n})\`)});function Hm({children:e,container:t}){let n=K.current;if(!n.dom)switch(n.flags|=Qt,mt.current){case"dom":if(n.dom=typeof t=="function"?t():t,!(n.dom instanceof HTMLElement)){if(A)throw new Tt({message:\`Invalid portal container, expected HTMLElement, got \${n.dom}\`,vNode:n});return null}return e;case"hydrate":ts(()=>Ht(n));case"stream":case"string":return null}return e}var Zu=M(()=>{"use strict";ut();dt();ci();yt();qe()});function Bm({children:e,when:t,fallback:n}){let i=Z(t,!0);return i?typeof e=="function"?e(i):e:n}var Ju=M(()=>{"use strict";is()});function Wm(e,t){if(typeof t=="number")return t;switch(e){case"entered":return t?.in??Qu;case"exited":return t?.out??Qu}}var bi,Qu,td=M(()=>{"use strict";Co();ce();Ta();Fn();bi=e=>{let t=D(e.initialState||"exited"),n,i=o=>{clearTimeout(n),t.value=o,(o==="entered"||o==="exited")&&e.onTransitionEnd&&e.onTransitionEnd(o)},s=o=>{n=window.setTimeout(()=>i(o),Wm(o,e.duration))};return Bt(()=>{let o=Z(e.in,!0),r=t.peek();o&&r!=="entered"&&r!=="entering"?(i("entering"),s("entered")):!o&&r!=="exited"&&r!=="exiting"&&(i("exiting"),s("exited"))}),Wt(()=>clearTimeout(n)),o=>o.element(t.value)},Qu=150});var ed=M(()=>{"use strict";Uu();Yu();Ku();qu();Zu();Ju();td()});function jm(e){let t=Object.assign(({value:n,children:i})=>g(In,{value:n,ctx:t},i),{[In]:()=>e});return t.displayName="Anonymous Context",t}function $m(e,t){let n=e.parent;for(;n;){if(n.type===In){let i=n,{ctx:s,value:o}=i.props;if(s===t)return o}n=n.parent}return t[In]()}function Um(e){let t=K.current;if(!t)throw new Error("useContext must be called inside a Kiru component");return $m(t,e)}var nd=M(()=>{"use strict";ut();ui();yt()});var Pa,id=M(()=>{"use strict";Pa=class{constructor(){}static on(t,n){return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}static dispatch(t,n,i){(i||document).dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0}))}}});var Da,sd=M(()=>{"use strict";(function(e){e.track=(t,n)=>{"window"in globalThis&&window.__kiru.devtools?.track(t,n)},e.untrack=t=>{"window"in globalThis&&window.__kiru.devtools?.untrack(t)},e.subscribe=t=>!("window"in globalThis)||!window.__kiru.devtools?()=>{}:window.__kiru.devtools.subscribe(t)})(Da||(Da={}))});function ss(){let e=K.current;return e?e.hooks??(e.hooks={pre:[],preCleanups:[],post:[],postCleanups:[]}):null}function os(e,t){return()=>{let n=e();typeof n=="function"&&t.push(n)}}var Ro=M(()=>{"use strict";yt()});function Ct(e){if(!kt())return;let t=ss();if(!t)throw new Error("Cannot queue onMount effect outside of a component");t.post.push(os(e,t.postCleanups))}var od=M(()=>{"use strict";q();Ro()});function Aa(e){if(!kt())return;let t=ss();if(!t)throw new Error("Cannot queue beforeMount effect outside of a component");t.pre.push(os(e,t.preCleanups))}var rd=M(()=>{"use strict";q();Ro()});function Ra(){let e=K.current;if(A){if(!e)throw new Error("setup() must be called inside a Kiru component");if(e.render)throw new Error("setup() cannot be used inside a render function")}if(Ln.has(e))return Ln.get(e);let t=Gm(e);return Ln.set(e,t),t}function Gm(e){let t,n=e.propSyncs=[],i=-1,s={current:{...e.props}},o=[],r=[];return n.push(l=>{let c=s.current,u=new Set;for(let d of r)d.accessedPaths.size>0&&Ym(c,l,d.accessedPaths)&&u.add(d);s.current=l;for(let d of r)u.has(d)||d.run()}),At(e,"vnode:setup",()=>{for(let l of o)l();Ln.delete(e)}),{derive(l){let c=D(void 0),u=new Map,d=new Set;function f(){d.clear();let b=ld(s.current,d),x=new Map;Ze.stack.push(x);let y=l(b);Ze.stack.pop(),c.value=y;for(let[w,_]of u)x.has(w)||(_(),u.delete(w));for(let[w,_]of x)if(!u.has(w))try{u.set(w,_.subscribe(f))}catch{}}f();let p={run:f,accessedPaths:d};return r.push(p),o.push(()=>{u.forEach(x=>x()),u.clear();let b=r.indexOf(p);b!==-1&&r.splice(b,1)}),c},get id(){return t||(t=D(es(e)),i=e.index,n.push(()=>{i!==e.index&&(t.value=es(e),i=e.index)})),t}}}function Ym(e,t,n){for(let i of n)if(!Object.is(ad(e,i),ad(t,i)))return!1;return!0}function ad(e,t){let n=e;for(let i of t.split(".")){if(n==null||typeof n!="object")return;n=n[i]}return n}function ld(e,t,n){return new Proxy(e,{get(i,s){let o=n?\`\${n}.\${s}\`:s,r=i[s];return L.isSignal(r)?(t.add(o),r):r!==null&&typeof r=="object"&&!Array.isArray(r)?ld(r,t,o):(t.add(o),r)}})}var cd=M(()=>{"use strict";ce();Mo();dt();yt();pi();q()});var ud=M(()=>{"use strict";Co();od();rd();cd();Ro()});function Oe(e,t,n,i){if(t===null||t===void 0||typeof t=="boolean")return;if(typeof t=="string")return e.write(So(t));if(typeof t=="number"||typeof t=="bigint")return e.write(t.toString());if(t instanceof Array)return t.forEach((l,c)=>Oe(e,l,n,c));if(L.isSignal(t)){let l=t.peek();if(!Fc(l)){A&&console.error(\`[kiru]: expected primitive child but received \${l}\`);return}pn(l)&&e.write(So(String(l)));return}if(!Pu(t))return;t.parent=n,t.depth=(n?.depth??-1)+1,t.index=i;let{type:s,props:o={}}=t;if(s==="#text")return e.write(So(o.nodeValue??""));let r=o.children;if(vo(s)){if(s===Ke){let l="",c=new Set,u={write(d){l+=d},onStreamData(d){d.forEach(f=>c.add(f))}};try{Oe(u,r,t,i),e.write(l),e.onStreamData?.([...c])}catch(d){if(Po(d))throw d;let f=d instanceof Error?d:new Error(String(d)),{fallback:p,onError:b}=o;b?.(f);let x=typeof p=="function"?p(f):p;Oe(e,x,t,0)}return}Oe(e,r,t,i);return}if(typeof s=="function")try{K.current=t;let l=s(o);typeof l=="function"&&(l=l(o)),Oe(e,l,t,i);return}catch(l){if(Po(l)){let{fallback:c,data:u}=l[ai];return e.onStreamData?.(u),Oe(e,c,t,0)}throw l}finally{K.current=null}A&&wo(t);let a=Tu(o);e.write(\`<\${s}\${a.length?\` \${a}\`:""}>\`),!Lc.has(s)&&("innerHTML"in o?e.write(String(L.isSignal(o.innerHTML)?o.innerHTML.peek():o.innerHTML)):Array.isArray(r)?r.forEach((l,c)=>Oe(e,l,t,c)):Oe(e,r,t,0),e.write(\`</\${s}>\`))}var dd=M(()=>{"use strict";yt();q();Ao();ce();ut();dt()});function Km(e){let t=mt.current;mt.current="string";let n="";return Oe({write(s){n+=s}},_t({children:e}),null,0),mt.current=t,n}var fd=M(()=>{"use strict";yt();ui();dd()});var Oa,hd=M(()=>{"use strict";qe();dt();(function(e){let t=[],n=!1,i=!1,s=null,o=ct&&typeof document.startViewTransition=="function";function r(u,d){let f=d?.signal;return new Promise(p=>{let b=async()=>{let x=await u();p(x)};t.push(b),f?.addEventListener("abort",()=>{let x=t.indexOf(b);x!==-1?t.splice(x,1):s?.skipTransition()},{once:!0}),l()})}e.run=r;function a(){s?.skipTransition(),s=null,t.length=0,n=!1,i=!1}e.stop=a;function l(){i||(i=!0,queueMicrotask(()=>{i=!1,c()}))}async function c(){if(n||t.length===0)return;n=!0;let u=[...t];t.length=0;let d=async()=>{await Promise.all(u.map(f=>f())),bn()};o?(s=document.startViewTransition(d),await s.finished):await d(),s=null,n=!1,t.length>0&&l()}})(Oa||(Oa={}))});var j={};jr(j,{ActionError:()=>To,ComputedSignal:()=>ns,CustomEvents:()=>Pa,Derive:()=>ve,DevTools:()=>Da,Effect:()=>mi,ErrorBoundary:()=>$u,For:()=>Je,Fragment:()=>_t,KiruError:()=>Tt,Portal:()=>Hm,Show:()=>Bm,Signal:()=>L,Transition:()=>bi,ViewTransitions:()=>Oa,computed:()=>Ot,createContext:()=>jm,createElement:()=>g,defineAction:()=>Rm,effect:()=>Bt,flushSync:()=>bn,getVNodeLifecycleHooks:()=>ss,isStatefulPromise:()=>Do,isStreamDataThrowValue:()=>Po,lazy:()=>Vm,mount:()=>Im,nextIdle:()=>ts,onBeforeMount:()=>Aa,onCleanup:()=>Wt,onHmr:()=>Ou,onMount:()=>Ct,ref:()=>xn,renderToString:()=>Km,requestUpdate:()=>Ht,setup:()=>Ra,signal:()=>D,statefulPromise:()=>Lm,tick:()=>ko,unwrap:()=>Z,useContext:()=>Um,useRequestUpdate:()=>yu,wrapLifecycleHookCallback:()=>os});var V=M(()=>{"use strict";Fu();dt();is();Wu();ju();ed();nd();id();sd();ui();ci();Ji();ud();fd();Ca();qe();Ao();hd();ct&&(window.__kiru??(window.__kiru=Vu()))});function Qe(e,t){if(!e)throw new Error(t)}function Bn(e){return e.type.displayName??(e.type.name||"Anonymous Function")}function rs(e){try{return e[Xm]??null}catch{return null}}function ue(e){return e.name==="kiru.devtools"}function qm(e){return Array.from(e.entries())}function tn(e,t,n){return Math.min(Math.max(e,t),n)}function Zm(e,t,n){if(e.key==="Tab"){let i=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),s=i[0],o=i[i.length-1];if(n&&!t.contains(n)&&s&&s instanceof HTMLElement)return s.focus();e.shiftKey?n===s&&o instanceof HTMLElement&&(o.focus(),e.preventDefault()):n===o&&s instanceof HTMLElement&&(s.focus(),e.preventDefault())}}function Jm(){return Q.rootRef.value?.matches(":focus-within, :focus")}function Ia(e){let t=Q.rootRef.value;return t?.matches(":focus-within, :focus")?e(t):null}function xi(e){let t=[],n=e;for(;n;){if(typeof n.type=="function"){let i=n.type,s=i.displayName??(i.name||"AnonymousFunction"),o=n.key!=null&&n.key!==void 0?\`k:\${String(n.key)}\`:\`i:\${n.index}\`;t.push(\`\${s}[\${o}]\`)}n=n.parent}return\`ch:\${t.join("/")}\`}function Na(e,t){if(!e)return null;let n=[e];for(;n.length;){let i=n.pop();if(typeof i.type=="function"&&xi(i)===t)return i;i.child&&n.push(i.child),i.sibling&&n.push(i.sibling)}return null}var Xm,Wn=M(()=>{"use strict";Ie();Xm=Symbol.for("kiru.devFileLink")});function Qm(e,t){let n=new BroadcastChannel(e),i=(l,c)=>{if(l.type==="SET"){let{key:u,version:d}=l;return pd[u]=c,n.postMessage({type:"SET",key:u,version:d})}n.postMessage(l)},s={},o={},r={};for(let l in t){let c=o[l]=D(t[l]);s[l]=0,r[l]=u=>{if(u.type==="GET"){let d=c.value,f=s[l];return i({type:"SET",key:l,version:f},d)}u.version>s[l]&&(c.value=pd[l],s[l]=u.version)},c.subscribe(u=>{let d=++s[l];i({type:"SET",key:l,version:d},u)})}n.addEventListener("message",({data:l})=>{r[l.key](l)});for(let l in o)i({type:"GET",key:l});return[o,()=>{n.close(),Object.values(o).forEach(l=>L.dispose(l))}]}var gd,pd,ht,Q,Ie=M(()=>{"use strict";V();Wn();q();pd=(gd=window.opener??window).__kiru_devtools_state_register??(gd.__kiru_devtools_state_register={}),ht=()=>window.opener?.__kiru??window.__kiru;[Q]=Qm("kiru-devtools:syncedState",{apps:[],rootRef:null,appSearchTerm:"",appSearchInput:null,componentSelection:{enabled:!1,componentNode:null},devtoolsViewMode:"embedded",devtoolsTab:"Apps",popupWindow:null,selectedApp:null,selectedNode:null,viewerSettings:{objectKeysChunkSize:10,arrayChunkSize:10}});if("window"in globalThis){let{apps:e,componentSelection:t,selectedNode:n,selectedApp:i,viewerSettings:s}=Q;window.addEventListener("kiru:ready",()=>{e.value=[...ht().apps],ht().on("mount",a=>{ue(a)||(e.value=[...e.value,a])}),ht().on("unmount",a=>{ue(a)||(e.value=e.value.filter(l=>l!==a))})});let o="kiru-devtools:viewerSettings";s.subscribe(a=>{localStorage.setItem("kiru-devtools:viewerSettings",JSON.stringify(a))});let r=localStorage.getItem(o);if(r)try{let a=JSON.parse(r);Qe(typeof a.objectKeysChunkSize=="number"&&a.objectKeysChunkSize>0,"invalid objectKeysChunkSize"),Qe(typeof a.arrayChunkSize=="number"&&a.arrayChunkSize>0,"invalid arrayChunkSize"),s.sneak({objectKeysChunkSize:a.objectKeysChunkSize,arrayChunkSize:a.arrayChunkSize})}catch{s.sneak({objectKeysChunkSize:10,arrayChunkSize:10})}t.subscribe(({componentNode:a})=>{n.value=a,i.value=a?Rt(a):null})}});function La(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},g("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),g("path",{d:"M12 9v11"}),g("path",{d:"M2 9h13a2 2 0 0 1 2 2v9"}))}var md=M(()=>{"use strict";V()});function en(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"m9 18 6-6-6-6"}))}var Oo=M(()=>{"use strict";V()});function za(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M18 6 6 18"}),g("path",{d:"m6 6 12 12"}))}var bd=M(()=>{"use strict";V()});function Va(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),g("circle",{cx:"12",cy:"12",r:"3"}))}var xd=M(()=>{"use strict";V()});function tb(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}),g("path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}),g("path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}),g("path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}))}var yd=M(()=>{"use strict";V()});function as(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M15 3h6v6"}),g("path",{d:"M10 14 21 3"}),g("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}))}var vd=M(()=>{"use strict";V()});function Fa(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),g("path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"}),g("path",{d:"M3 5a2 2 0 0 0 2 2h3"}),g("path",{d:"M3 3v13a2 2 0 0 0 2 2h3"}))}var wd=M(()=>{"use strict";V()});function eb(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"m15 15 6 6"}),g("path",{d:"m15 9 6-6"}),g("path",{d:"M21 16v5h-5"}),g("path",{d:"M21 8V3h-5"}),g("path",{d:"M3 16v5h5"}),g("path",{d:"m3 21 6-6"}),g("path",{d:"M3 8V3h5"}),g("path",{d:"M9 9 3 3"}))}var _d=M(()=>{"use strict";V()});function Ha(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e},g("path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"}))}var kd=M(()=>{"use strict";V()});function ls(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"m12 14 4-4"}),g("path",{d:"M3.34 19a10 10 0 1 1 17.32 0"}))}var Sd=M(()=>{"use strict";V()});function nb(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("circle",{cx:"12",cy:"5",r:"1"}),g("circle",{cx:"19",cy:"5",r:"1"}),g("circle",{cx:"5",cy:"5",r:"1"}),g("circle",{cx:"12",cy:"12",r:"1"}),g("circle",{cx:"19",cy:"12",r:"1"}),g("circle",{cx:"5",cy:"12",r:"1"}),g("circle",{cx:"12",cy:"19",r:"1"}),g("circle",{cx:"19",cy:"19",r:"1"}),g("circle",{cx:"5",cy:"19",r:"1"}))}var Ed=M(()=>{"use strict";V()});function cs(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"}))}var Md=M(()=>{"use strict";V()});function ib(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6"}),g("path",{d:"m21 3-9 9"}),g("path",{d:"M15 3h6v6"}))}var Td=M(()=>{"use strict";V()});function Ba(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478"}),g("path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134"}),g("path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134"}),g("path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478"}),g("circle",{cx:"12",cy:"12",r:"2"}))}var Cd=M(()=>{"use strict";V()});function jn(e){return g("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true",...e},g("line",{x1:"9",y1:"1",x2:"1",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}),g("line",{x1:"9",y1:"5",x2:"5",y2:"9",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"}))}var Pd=M(()=>{"use strict";V()});function sb(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}))}var Dd=M(()=>{"use strict";V()});var Ad=M(()=>{"use strict";md();Oo();bd();xd();yd();vd();wd();_d();kd();Sd();Ed();Md();Td();Cd();Pd();Dd()});function nn(e){let t=[],n=()=>t.forEach(x=>x()),i=D(null),s=D(null),o=D(ob(e)),r=Ot(()=>o.value.type==="snapped"?o.value.side:null),a=D(0),l=D(0),c=Ot(()=>[a.value,l.value]),u=D(!1),d=null;t.push(c.subscribe(([x,y])=>{let w=i.value;w.style.transform=\`translate(\${x}px, \${y}px)\`}));let f=x=>{if(x.button!==0)return;let y=i.value;if(!d){let B=y.getBoundingClientRect();d={width:B.width,height:B.height}}let[w,_]=[x.clientX,x.clientY],S=y.getBoundingClientRect(),[E,T]=[w-S.left,_-S.top];u.value=!1;let R=null,O=!1,P=!0,N=()=>{O=!1;let B=R;if(R=null,!B||!P||(!u.peek()&&(Math.abs(B.clientX-w)>5||Math.abs(B.clientY-_)>5)&&(u.value=!0),!u.peek()))return;let[st,Mt]=[B.clientX-E,B.clientY-T],[tt,nt]=e.getDraggableBounds(),{width:vt,height:Ee}=d??y.getBoundingClientRect(),$e=st+vt/2,ge=Mt+Ee/2,Vt=st,me=tt-(st+vt),Xt=Mt,qt=nt-(Mt+Ee),Zt=Math.min(Vt,me,Xt,qt);if(e.allowFloat&&Zt>(e.snapDistance??0))o.value={type:"floating",x:$e/tt,y:ge/nt};else{let et=o.peek(),be=et.type==="snapped"?et.side:null,lt={top:Xt,right:me,bottom:qt,left:Vt},ot;be&&lt[be]<=Zt?ot=be:Xt===Zt?ot="top":qt===Zt?ot="bottom":Vt===Zt?ot="left":ot="right";let oi=ot==="left"||ot==="right"?ge/nt:$e/tt;o.value={type:"snapped",side:ot,percent:oi}}p()},W=B=>{R=B,!O&&(O=!0,requestAnimationFrame(N))},H=()=>{if(P=!1,window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",H),!u.peek())return e.onclick?.();u.value=!1,e.storage.setItem(e.key,JSON.stringify(o.value))};window.addEventListener("mousemove",W),window.addEventListener("mouseup",H)},p=()=>{let x=i.value;if(!d){let N=x.getBoundingClientRect();d={width:N.width,height:N.height}}let{width:y,height:w}=d,[_,S]=e.getDraggableBounds(),E=o.value;if(E.type==="floating"){let[N,W]=e.getPadding(null);a.value=tn(E.x*_-y/2,N,_-N-y),l.value=tn(E.y*S-w/2,W,S-W-w);return}let[T,R]=e.getPadding(E.side),O=0,P=0;switch(E.side){case"top":O=E.percent*_-y/2,P=0;break;case"bottom":O=E.percent*_-y/2,P=1/0;break;case"left":O=0,P=E.percent*S-w/2;break;case"right":O=1/0,P=E.percent*S-w/2;break}a.value=tn(O,T,_-T-y),l.value=tn(P,R,S-R-w)};return{init:()=>{let x=s.value;if(!x)return console.error("handle not found",new Error().stack);let y=i.value;if(!y)return console.error("container not found",new Error().stack);let w=y.getBoundingClientRect();d={width:w.width,height:w.height},y.style.position="fixed",y.style.top="0",y.style.left="0",p();let _=new ResizeObserver(S=>{let{width:E,height:T}=S[0].contentRect;d={width:E,height:T},p()});_.observe(y),window.addEventListener("resize",p),x.addEventListener("mousedown",f),t.push(()=>{_.disconnect(),window.removeEventListener("resize",p),x.removeEventListener("mousedown",f)})},isDragging:u,handleRef:s,containerRef:i,snapSide:r,containerPos:c,dispose:n}}function ob({storage:e,key:t,defaultPosition:n}){let i=e.getItem(t);if(i)try{let o=JSON.parse(i);if(o.type==="snapped")return Qe(["top","right","bottom","left"].includes(o.side),"invalid side"),Qe(typeof o.percent=="number"&&o.percent>=0&&o.percent<=1,"invalid percent"),o;if(o.type==="floating")return Qe(typeof o.x=="number"&&o.x>=0&&o.x<=1,"invalid x"),Qe(typeof o.y=="number"&&o.y>=0&&o.y<=1,"invalid y"),o}catch{}let s=n??{type:"floating",x:.5,y:.5};return e.setItem(t,JSON.stringify(s)),s}var Rd=M(()=>{"use strict";V();Wn()});function Wa(e,t={windowScroll:!0,windowResize:!0}){let n=[],i=()=>{n.forEach(_=>_()),n.length=0},s=t.windowScroll??!0,o=t.windowResize??!0,r=D(0),a=D(0),l=D(0),c=D(0),u=D(0),d=D(0),f=D(0),p=D(0),b=D(0),x=D(0),y=()=>{let _=e.current;if(!_){r.value=a.value=l.value=c.value=u.value=d.value=f.value=p.value=b.value=x.value=0;return}r.value=_.clientWidth,a.value=_.clientHeight;let S=_.getBoundingClientRect();l.value=S.top,c.value=S.left,u.value=S.right,d.value=S.bottom,f.value=S.x,p.value=S.y,b.value=window.scrollX,x.value=window.scrollY};return{state:{width:r,height:a,top:l,left:c,right:u,bottom:d,x:f,y:p,scrollX:b,scrollY:x},init:()=>{let _=e.current;if(!_)return console.error("element not found",new Error().stack);let S=new MutationObserver(y);S.observe(_,{attributeFilter:["style","class"],attributes:!0,childList:!0,subtree:!0}),n.push(()=>S.disconnect());let E=new ResizeObserver(y);E.observe(_),n.push(()=>E.disconnect()),s&&(window.addEventListener("scroll",y,{capture:!0,passive:!0}),n.push(()=>window.removeEventListener("scroll",y))),o&&(window.addEventListener("resize",y,{passive:!0}),n.push(()=>window.removeEventListener("resize",y))),y()},dispose:i}}var Od=M(()=>{"use strict";V()});function $n(e){let t=[],n=()=>t.forEach(d=>d()),i=D(null),s=D(null),o=D(!1),[r,a]=e.minSize??[0,0],l=e.aspectRatio??null,c=d=>{if(d.button!==0)return;d.stopPropagation(),d.preventDefault(),o.value=!0,document.body.style.cursor="se-resize",document.body.style.userSelect="none";let f=i.value,p=d.clientX,b=d.clientY,x=f.offsetWidth,y=f.offsetHeight,w=S=>{let E=S.clientX-p,T=S.clientY-b;if(l!==null){let R=(E*l+T)/(l*l+1),O=Math.max(r,x+R*l),P=O/l;P<a&&(P=a,O=P*l),f.style.width=\`\${O}px\`,f.style.height=\`\${P}px\`}else f.style.width=\`\${Math.max(r,x+E)}px\`,f.style.height=\`\${Math.max(a,y+T)}px\`},_=()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",_),o.value=!1,document.body.style.cursor="",document.body.style.userSelect="",e.storage.setItem(e.key,JSON.stringify({w:f.offsetWidth,h:f.offsetHeight}))};window.addEventListener("mousemove",w),window.addEventListener("mouseup",_)};return{containerRef:i,handleRef:s,isResizing:o,init:()=>{let d=s.value;if(!d)return console.error("resize handle not found",new Error().stack);let f=i.value;if(!f)return console.error("resize container not found",new Error().stack);let p=rb(e.storage,e.key);if(p){let b=p[0],x=l!==null?b/l:p[1];f.style.width=\`\${b}px\`,f.style.height=\`\${x}px\`}d.addEventListener("mousedown",c),t.push(()=>d.removeEventListener("mousedown",c))},dispose:n}}function rb(e,t){let n=e.getItem(t);if(!n)return null;try{let i=JSON.parse(n);if(typeof i.w=="number"&&typeof i.h=="number")return[i.w,i.h]}catch{}return null}var Id=M(()=>{"use strict";V()});function us(){let e=D({x:0,y:0}),t=n=>{e.value={x:n.clientX,y:n.clientY}};return window.addEventListener("mousemove",t),[e,()=>window.removeEventListener("mousemove",t)]}var Nd=M(()=>{"use strict";V()});function hs(e){return e+.5|0}function ds(e){return yn(hs(e*2.55),0,255)}function vn(e){return yn(hs(e*255),0,255)}function sn(e){return yn(hs(e/2.55)/100,0,1)}function Ld(e){return yn(hs(e*100),0,100)}function ub(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&de[e[1]]*17,g:255&de[e[2]]*17,b:255&de[e[3]]*17,a:t===5?de[e[4]]*17:255}:(t===7||t===9)&&(n={r:de[e[1]]<<4|de[e[2]],g:de[e[3]]<<4|de[e[4]],b:de[e[5]]<<4|de[e[6]],a:t===9?de[e[7]]<<4|de[e[8]]:255})),n}function fb(e){var t=cb(e)?ab:lb;return e?"#"+t(e.r)+t(e.g)+t(e.b)+db(e.a,t):void 0}function Hd(e,t,n){let i=t*Math.min(n,1-n),s=(o,r=(o+e/30)%12)=>n-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function pb(e,t,n){let i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function gb(e,t,n){let i=Hd(e,1,.5),s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function mb(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Ua(e){let n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),r=Math.min(n,i,s),a=(o+r)/2,l,c,u;return o!==r&&(u=o-r,c=a>.5?u/(2-o-r):u/(o+r),l=mb(n,i,s,u,o),l=l*60+.5),[l|0,c||0,a]}function Ga(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(vn)}function Ya(e,t,n){return Ga(Hd,e,t,n)}function bb(e,t,n){return Ga(gb,e,t,n)}function xb(e,t,n){return Ga(pb,e,t,n)}function Bd(e){return(e%360+360)%360}function yb(e){let t=hb.exec(e),n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?ds(+t[5]):vn(+t[5]));let s=Bd(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=bb(s,o,r):t[1]==="hsv"?i=xb(s,o,r):i=Ya(s,o,r),{r:i[0],g:i[1],b:i[2],a:n}}function vb(e,t){var n=Ua(e);n[0]=Bd(n[0]+t),n=Ya(n),e.r=n[0],e.g=n[1],e.b=n[2]}function wb(e){if(!e)return;let t=Ua(e),n=t[0],i=Ld(t[1]),s=Ld(t[2]);return e.a<255?\`hsla(\${n}, \${i}%, \${s}%, \${sn(e.a)})\`:\`hsl(\${n}, \${i}%, \${s}%)\`}function _b(){let e={},t=Object.keys(Vd),n=Object.keys(zd),i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<n.length;s++)o=n[s],a=a.replace(o,zd[o]);o=parseInt(Vd[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}function kb(e){No||(No=_b(),No.transparent=[0,0,0,0]);let t=No[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function Eb(e){let t=Sb.exec(e),n=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];n=t[8]?ds(r):yn(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?ds(i):yn(i,0,255)),s=255&(t[4]?ds(s):yn(s,0,255)),o=255&(t[6]?ds(o):yn(o,0,255)),{r:i,g:s,b:o,a:n}}}function Mb(e){return e&&(e.a<255?\`rgba(\${e.r}, \${e.g}, \${e.b}, \${sn(e.a)})\`:\`rgb(\${e.r}, \${e.g}, \${e.b})\`)}function Tb(e,t,n){let i=yi(sn(e.r)),s=yi(sn(e.g)),o=yi(sn(e.b));return{r:vn(ja(i+n*(yi(sn(t.r))-i))),g:vn(ja(s+n*(yi(sn(t.g))-s))),b:vn(ja(o+n*(yi(sn(t.b))-o))),a:e.a+n*(t.a-e.a)}}function Lo(e,t,n){if(e){let i=Ua(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Ya(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Wd(e,t){return e&&Object.assign(t||{},e)}function Fd(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=vn(e[3]))):(t=Wd(e,{r:0,g:0,b:0,a:1}),t.a=vn(t.a)),t}function Cb(e){return e.charAt(0)==="r"?Eb(e):yb(e)}var yn,de,$a,ab,lb,Io,cb,db,hb,zd,Vd,No,Sb,ja,yi,fs,jd=M(()=>{yn=(e,t,n)=>Math.max(Math.min(e,n),t);de={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},$a=[..."0123456789ABCDEF"],ab=e=>$a[e&15],lb=e=>$a[(e&240)>>4]+$a[e&15],Io=e=>(e&240)>>4===(e&15),cb=e=>Io(e.r)&&Io(e.g)&&Io(e.b)&&Io(e.a);db=(e,t)=>e<255?t(e):"";hb=/^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;zd={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Vd={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};Sb=/^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;ja=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,yi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);fs=class e{constructor(t){if(t instanceof e)return t;let n=typeof t,i;n==="object"?i=Fd(t):n==="string"&&(i=ub(t)||kb(t)||Cb(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Wd(this._rgb);return t&&(t.a=sn(t.a)),t}set rgb(t){this._rgb=Fd(t)}rgbString(){return this._valid?Mb(this._rgb):void 0}hexString(){return this._valid?fb(this._rgb):void 0}hslString(){return this._valid?wb(this._rgb):void 0}mix(t,n){if(t){let i=this.rgb,s=t.rgb,o,r=n===o?.5:n,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=Tb(this._rgb,t._rgb,n)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=vn(t),this}clearer(t){let n=this._rgb;return n.a*=1-t,this}greyscale(){let t=this._rgb,n=hs(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){let n=this._rgb;return n.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Lo(this._rgb,2,t),this}darken(t){return Lo(this._rgb,2,-t),this}saturate(t){return Lo(this._rgb,1,t),this}desaturate(t){return Lo(this._rgb,1,-t),this}rotate(t){return vb(this._rgb,t),this}}});function _e(){}function X(e){return e==null}function it(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Y(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function gt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Nt(e,t){return gt(e)?e:t}function $(e,t){return typeof e>"u"?t:e}function z(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function U(e,t,n,i){let s,o,r;if(it(e))if(o=e.length,i)for(s=o-1;s>=0;s--)t.call(n,e[s],s);else for(s=0;s<o;s++)t.call(n,e[s],s);else if(Y(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(n,e[r[s]],r[s])}function _i(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function gs(e){if(it(e))return e.map(gs);if(Y(e)){let t=Object.create(null),n=Object.keys(e),i=n.length,s=0;for(;s<i;++s)t[n[s]]=gs(e[n[s]]);return t}return e}function Qd(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function tf(e,t,n,i){if(!Qd(e))return;let s=t[e],o=n[e];Y(s)&&Y(o)?Yn(s,o,i):t[e]=gs(o)}function Yn(e,t,n){let i=it(t)?t:[t],s=i.length;if(!Y(e))return e;n=n||{};let o=n.merger||tf,r;for(let a=0;a<s;++a){if(r=i[a],!Y(r))continue;let l=Object.keys(r);for(let c=0,u=l.length;c<u;++c)o(l[c],e,r,n)}return e}function Kn(e,t){return Yn(e,t,{merger:ef})}function ef(e,t,n){if(!Qd(e))return;let i=t[e],s=n[e];Y(i)&&Y(s)?Kn(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=gs(s))}function nf(e){let t=e.split("."),n=[],i="";for(let s of t)i+=s,i.endsWith("\\\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Pb(e){let t=nf(e);return n=>{for(let i of t){if(i==="")break;n=n&&n[i]}return n}}function ki(e,t){return($d[t]||($d[t]=Pb(t)))(e)}function xs(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Qa(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}function ze(e,t,n){return Math.abs(e-t)<n}function jo(e){let t=Math.round(e);e=ze(e,t,e/1e3)?t:e;let n=Math.pow(10,Math.floor(Le(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function tl(e){let t=[],n=Math.sqrt(e),i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function Db(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Xn(e){return!Db(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function el(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function $o(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ve(e){return e*(pt/180)}function ys(e){return e*(180/pt)}function Uo(e){if(!gt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function nl(e,t){let n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i),o=Math.atan2(i,n);return o<-.5*pt&&(o+=jt),{angle:o,distance:s}}function bs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function rf(e,t){return(e-t+sf)%jt-pt}function ee(e){return(e%jt+jt)%jt}function Go(e,t,n,i){let s=ee(e),o=ee(t),r=ee(n),a=ee(o-s),l=ee(r-s),c=ee(s-o),u=ee(s-r);return s===o||s===r||i&&o===r||a>l&&c<u}function $t(e,t,n){return Math.max(t,Math.min(n,e))}function il(e){return $t(e,-32768,32767)}function qn(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function vs(e,t,n){n=n||(r=>e[r]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}function ol(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}function rl(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),af.forEach(n=>{let i="_onData"+xs(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Yo(e,t){let n=e._chartjs;if(!n)return;let i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(af.forEach(o=>{delete e[o]}),delete e._chartjs)}function al(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function Xo(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,Ko.call(window,()=>{i=!1,e.apply(t,n)}))}}function ll(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}function ul(e,t,n){let i=t.length,s=0,o=i;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:d,max:f,minDefined:p,maxDefined:b}=r.getUserBounds();if(p){if(s=Math.min(rn(l,u,d).lo,n?i:rn(t,u,r.getPixelForValue(d)).lo),c){let x=l.slice(0,s+1).reverse().findIndex(y=>!X(y[a.axis]));s-=Math.max(0,x)}s=$t(s,0,i-1)}if(b){let x=Math.max(rn(l,r.axis,f,!0).hi+1,n?0:rn(t,u,r.getPixelForValue(f),!0).hi+1);if(c){let y=l.slice(x-1).findIndex(w=>!X(w[a.axis]));x+=Math.max(0,y)}o=$t(x,s,i)-s}else o=i-s}return{start:s,count:o}}function dl(e){let{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}function Zo(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Jo(e){return Zo(e)?e:new fs(e)}function Ho(e){return Zo(e)?e:new fs(e).saturate(.5).darken(.1).hexString()}function Ob(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:Rb},numbers:{type:"number",properties:Ab}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ib(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function Nb(e,t){t=t||{};let n=e+JSON.stringify(t),i=Yd.get(n);return i||(i=new Intl.NumberFormat(e,t),Yd.set(n,i)),i}function ws(e,t,n){return Nb(t,n).format(e)}function Lb(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}function zb(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:_s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}function ps(e,t){if(!t)return e;let n=t.split(".");for(let i=0,s=n.length;i<s;++i){let o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Ka(e,t,n){return typeof t=="string"?Yn(ps(e,t),n):Yn(ps(e,""),t)}function cf(e){return!e||X(e.size)||X(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function vi(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function fl(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let r=0,a=n.length,l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!it(d))r=vi(e,s,o,r,d);else if(it(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!it(f)&&(r=vi(e,s,o,r,f));e.restore();let p=o.length/2;if(p>n.length){for(l=0;l<p;l++)delete s[o[l]];o.splice(0,p)}return r}function an(e,t,n){let i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function tr(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ks(e,t,n,i){er(e,t,n,i,null)}function er(e,t,n,i,s){let o,r,a,l,c,u,d,f,p=t.pointStyle,b=t.rotation,x=t.radius,y=(b||0)*of;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(x)||x<=0)){switch(e.beginPath(),p){default:s?e.ellipse(n,i,s/2,x,0,0,jt):e.arc(n,i,x,0,jt),e.closePath();break;case"triangle":u=s?s/2:x,e.moveTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Xa,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),y+=Xa,e.lineTo(n+Math.sin(y)*u,i-Math.cos(y)*x),e.closePath();break;case"rectRounded":c=x*.516,l=x-c,r=Math.cos(y+wn)*l,d=Math.cos(y+wn)*(s?s/2-c:l),a=Math.sin(y+wn)*l,f=Math.sin(y+wn)*(s?s/2-c:l),e.arc(n-d,i-a,c,y-pt,y-It),e.arc(n+f,i-r,c,y-It,y),e.arc(n+d,i+a,c,y,y+It),e.arc(n-f,i+r,c,y+It,y+pt),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*x,u=s?s/2:l,e.rect(n-u,i-l,2*u,2*l);break}y+=wn;case"rectRot":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+f,i-r),e.lineTo(n+d,i+a),e.lineTo(n-f,i+r),e.closePath();break;case"crossRot":y+=wn;case"cross":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"star":d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r),y+=wn,d=Math.cos(y)*(s?s/2:x),r=Math.cos(y)*x,a=Math.sin(y)*x,f=Math.sin(y)*(s?s/2:x),e.moveTo(n-d,i-a),e.lineTo(n+d,i+a),e.moveTo(n+f,i-r),e.lineTo(n-f,i+r);break;case"line":r=s?s/2:Math.cos(y)*x,a=Math.sin(y)*x,e.moveTo(n-r,i-a),e.lineTo(n+r,i+a);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:x),i+Math.sin(y)*x);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function ne(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Ss(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Es(e){e.restore()}function hl(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){let o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function pl(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Vb(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),X(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Fb(e,t,n,i,s){if(s.strikethrough||s.underline){let o=e.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function Hb(e,t){let n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function En(e,t,n,i,s,o={}){let r=it(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Vb(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Hb(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),X(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),Fb(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function Ei(e,t){let{x:n,y:i,w:s,h:o,radius:r}=t;e.arc(n+r.topLeft,i+r.topLeft,r.topLeft,1.5*pt,pt,!0),e.lineTo(n,i+o-r.bottomLeft),e.arc(n+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,pt,It,!0),e.lineTo(n+s-r.bottomRight,i+o),e.arc(n+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,It,0,!0),e.lineTo(n+s,i+r.topRight),e.arc(n+s-r.topRight,i+r.topRight,r.topRight,0,-It,!0),e.lineTo(n+r.topLeft,i)}function uf(e,t){let n=(""+e).match(Bb);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}function nr(e,t){let n={},i=Y(t),s=i?Object.keys(t):t,o=Y(e)?i?r=>$(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)n[r]=jb(o(r));return n}function gl(e){return nr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Mn(e){return nr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function St(e){let t=gl(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bt(e,t){e=e||{},t=t||rt.font;let n=$(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=$(e.style,t.style);i&&!(""+i).match(Wb)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:$(e.family,t.family),lineHeight:uf($(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:$(e.weight,t.weight),string:""};return s.string=cf(s),s}function Mi(e,t,n,i){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),n!==void 0&&it(a)&&(a=a[n%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function ml(e,t,n){let{min:i,max:s}=e,o=Ja(t,(s-i)/2),r=(a,l)=>n&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Fe(e,t){return Object.assign(Object.create(e),t)}function Ms(e,t=[""],n,i,s=()=>e[0]){let o=n||e;typeof i>"u"&&(i=hf("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>Ms([a,...e],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return df(a,l,()=>Zb(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Xd(a).includes(l)},ownKeys(a){return Xd(a)},set(a,l,c){let u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function kn(e,t,n,i){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:ir(e,i),setContext:o=>kn(e,o,n,i),override:o=>kn(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return df(o,r,()=>Ub(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function ir(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Ne(n)?n:()=>n,isIndexable:Ne(i)?i:()=>i}}function df(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let i=n();return e[t]=i,i}function Ub(e,t,n){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=e,a=i[t];return Ne(a)&&r.isScriptable(t)&&(a=Gb(t,a,e,n)),it(a)&&a.length&&(a=Yb(t,a,e,r.isIndexable)),bl(t,a)&&(a=kn(a,s,o&&o[t],r)),a}function Gb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||i);return a.delete(e),bl(e,l)&&(l=xl(s._scopes,s,e,l)),l}function Yb(e,t,n,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(Y(t[0])){let l=t,c=s._scopes.filter(u=>u!==l);t=[];for(let u of l){let d=xl(c,s,e,u);t.push(kn(d,o,r&&r[e],a))}}return t}function ff(e,t,n){return Ne(e)?e(t,n):e}function Xb(e,t,n,i,s){for(let o of t){let r=Kb(n,o);if(r){e.add(r);let a=ff(r._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==i)return a}else if(r===!1&&typeof i<"u"&&n!==i)return null}return!1}function xl(e,t,n,i){let s=t._rootScopes,o=ff(t._fallback,n,i),r=[...e,...s],a=new Set;a.add(i);let l=Kd(a,r,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Kd(a,r,o,l,i),l===null)?!1:Ms(Array.from(a),[""],s,o,()=>qb(t,n,i))}function Kd(e,t,n,i,s){for(;n;)n=Xb(e,t,n,i,s);return n}function qb(e,t,n){let i=e._getTarget();t in i||(i[t]={});let s=i[t];return it(s)&&Y(n)?n:s||{}}function Zb(e,t,n,i){let s;for(let o of t)if(s=hf($b(o,e),n),typeof s<"u")return bl(e,s)?xl(n,i,e,s):s}function hf(e,t){for(let n of t){if(!n)continue;let i=n[e];if(typeof i<"u")return i}}function Xd(e){let t=e._keys;return t||(t=e._keys=Jb(e._scopes)),t}function Jb(e){let t=new Set;for(let n of e)for(let i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function gf(e,t,n,i){let s=e.skip?t:e,o=t,r=n.skip?t:n,a=bs(o,s),l=bs(r,o),c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;let d=i*c,f=i*u;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+f*(r.x-s.x),y:o.y+f*(r.y-s.y)}}}function tx(e,t,n){let i=e.length,s,o,r,a,l,c=wi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=wi(e,u+1),!(!l||!c)){if(ze(t[u],0,Qb)){n[u]=n[u+1]=0;continue}s=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=s*r*t[u],n[u+1]=o*r*t[u])}}function ex(e,t,n="x"){let i=pf(n),s=e.length,o,r,a,l=wi(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=wi(e,c+1),!a)continue;let u=a[n],d=a[i];r&&(o=(u-r[n])/3,a[\`cp1\${n}\`]=u-o,a[\`cp1\${i}\`]=d-o*t[c]),l&&(o=(l[n]-u)/3,a[\`cp2\${n}\`]=u+o,a[\`cp2\${i}\`]=d+o*t[c])}}function mf(e,t="x"){let n=pf(t),i=e.length,s=Array(i).fill(0),o=Array(i),r,a,l,c=wi(e,0);for(r=0;r<i;++r)if(a=l,l=c,c=wi(e,r+1),!!l){if(c){let u=c[t]-l[t];s[r]=u!==0?(c[n]-l[n])/u:0}o[r]=a?c?we(s[r-1])!==we(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}tx(e,s,o),ex(e,o,t)}function Vo(e,t,n){return Math.max(Math.min(e,n),t)}function nx(e,t){let n,i,s,o,r,a=ne(e[0],t);for(n=0,i=e.length;n<i;++n)r=o,o=a,a=n<i-1&&ne(e[n+1],t),o&&(s=e[n],r&&(s.cp1x=Vo(s.cp1x,t.left,t.right),s.cp1y=Vo(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Vo(s.cp2x,t.left,t.right),s.cp2y=Vo(s.cp2y,t.top,t.bottom)))}function yl(e,t,n,i,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")mf(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=gf(c,a,e[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&nx(e,n)}function Ts(){return typeof window<"u"&&typeof document<"u"}function Cs(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Bo(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}function bf(e,t){return sr(e).getPropertyValue(t)}function Gn(e,t,n){let i={};n=n?"-"+n:"";for(let s=0;s<4;s++){let o=ix[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}function ox(e,t){let n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i,r=!1,a,l;if(sx(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function ie(e,t){if("native"in e)return e;let{canvas:n,currentDevicePixelRatio:i}=t,s=sr(n),o=s.boxSizing==="border-box",r=Gn(s,"padding"),a=Gn(s,"border","width"),{x:l,y:c,box:u}=ox(e,n),d=r.left+(u&&a.left),f=r.top+(u&&a.top),{width:p,height:b}=t;return o&&(p-=r.width+a.width,b-=r.height+a.height),{x:Math.round((l-d)/p*n.width/i),y:Math.round((c-f)/b*n.height/i)}}function rx(e,t,n){let i,s;if(t===void 0||n===void 0){let o=e&&Cs(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{let r=o.getBoundingClientRect(),a=sr(o),l=Gn(a,"border","width"),c=Gn(a,"padding");t=r.width-c.width-l.width,n=r.height-c.height-l.height,i=Bo(a.maxWidth,o,"clientWidth"),s=Bo(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||ms,maxHeight:s||ms}}function vl(e,t,n,i){let s=sr(e),o=Gn(s,"margin"),r=Bo(s.maxWidth,e,"clientWidth")||ms,a=Bo(s.maxHeight,e,"clientHeight")||ms,l=rx(e,t,n),{width:c,height:u}=l;if(s.boxSizing==="content-box"){let f=Gn(s,"border","width"),p=Gn(s,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-o.width),u=Math.max(0,i?c/i:u-o.height),c=_n(Math.min(c,r,l.maxWidth)),u=_n(Math.min(u,a,l.maxHeight)),c&&!u&&(u=_n(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=_n(Math.floor(u*i))),{width:c,height:u}}function or(e,t,n){let i=t||1,s=_n(e.height*i),o=_n(e.width*i);e.height=_n(e.height),e.width=_n(e.width);let r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=\`\${e.height}px\`,r.style.width=\`\${e.width}px\`),e.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=i,r.height=s,r.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}function rr(e,t){let n=bf(e,t),i=n&&n.match(/^(\\d+)(\\.\\d+)?px$/);return i?+i[1]:void 0}function on(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function _l(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function kl(e,t,n,i){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=on(e,s,n),a=on(s,o,n),l=on(o,t,n),c=on(r,a,n),u=on(a,l,n);return on(c,u,n)}function Tn(e,t,n){return e?ax(t,n):lx()}function ar(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function lr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function xf(e){return e==="angle"?{between:Go,compare:rf,normalize:ee}:{between:qn,compare:(t,n)=>t-n,normalize:t=>t}}function qd({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function cx(e,t,n){let{property:i,start:s,end:o}=n,{between:r,normalize:a}=xf(i),l=t.length,{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&r(a(t[c%l][i]),s,o);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function Sl(e,t,n){if(!n)return[e];let{property:i,start:s,end:o}=n,r=t.length,{compare:a,between:l,normalize:c}=xf(i),{start:u,end:d,loop:f,style:p}=cx(e,t,n),b=[],x=!1,y=null,w,_,S,E=()=>l(s,S,w)&&a(s,S)!==0,T=()=>a(o,w)===0||l(o,S,w),R=()=>x||E(),O=()=>!x||T();for(let P=u,N=u;P<=d;++P)_=t[P%r],!_.skip&&(w=c(_[i]),w!==S&&(x=l(w,s,o),y===null&&R()&&(y=a(w,s)===0?P:N),y!==null&&O()&&(b.push(qd({start:y,end:P,loop:f,count:r,style:p})),y=null),N=P,S=w));return y!==null&&b.push(qd({start:y,end:d,loop:f,count:r,style:p})),b}function El(e,t){let n=[],i=e.segments;for(let s=0;s<i.length;s++){let o=Sl(i[s],e.points,t);o.length&&n.push(...o)}return n}function ux(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function dx(e,t,n,i){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=n;++l){let c=e[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function Ml(e,t){let n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=ux(n,s,o,i);if(i===!0)return Zd(e,[{start:r,end:a,loop:o}],n,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Zd(e,dx(n,r,l,c),n,t)}function Zd(e,t,n,i){return!i||!i.setContext||!n?t:fx(e,t,n,i)}function fx(e,t,n,i){let s=e._chart.getContext(),o=Jd(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=n.length,c=[],u=o,d=t[0].start,f=d;function p(b,x,y,w){let _=a?-1:1;if(b!==x){for(b+=l;n[b%l].skip;)b-=_;for(;n[x%l].skip;)x+=_;b%l!==x%l&&(c.push({start:b%l,end:x%l,loop:y,style:w}),u=w,d=x%l)}}for(let b of t){d=a?d:b.start;let x=n[d%l],y;for(f=d+1;f<=b.end;f++){let w=n[f%l];y=Jd(i.setContext(Fe(s,{type:"segment",p0:x,p1:w,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),hx(y,u)&&p(d,f-1,b.loop,u),x=w,u=y}d<f-1&&p(d,f-1,b.loop,u)}return c}function Jd(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function hx(e,t){if(!t)return!1;let n=[],i=function(s,o){return Zo(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Fo(e,t,n){return e.options.clip?e[n]:t[n]}function px(e,t){let{xScale:n,yScale:i}=e;return n&&i?{left:Fo(n,t,"left"),right:Fo(n,t,"right"),top:Fo(i,t,"top"),bottom:Fo(i,t,"bottom")}:t}function Tl(e,t){let n=t._clip;if(n.disabled)return!1;let i=px(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}var Za,Ja,$d,Si,Ne,Wo,pt,jt,sf,ms,of,It,wn,Xa,Le,we,rn,sl,af,Ko,qo,Lt,cl,zo,Ud,Gd,Un,Ab,Rb,Yd,lf,_s,Sn,Qo,qa,rt,Bb,Wb,jb,$b,bl,Kb,Qb,wi,pf,sr,ix,sx,_n,wl,ax,lx,Cl=M(()=>{jd();Za=(()=>{let e=0;return()=>e++})();Ja=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;$d={"":e=>e,x:e=>e.x,y:e=>e.y};Si=e=>typeof e<"u",Ne=e=>typeof e=="function",Wo=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};pt=Math.PI,jt=2*pt,sf=jt+pt,ms=Number.POSITIVE_INFINITY,of=pt/180,It=pt/2,wn=pt/4,Xa=pt*2/3,Le=Math.log10,we=Math.sign;rn=(e,t,n,i)=>vs(e,n,i?s=>{let o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),sl=(e,t,n)=>vs(e,n,i=>e[i][t]>=n);af=["push","pop","shift","splice","unshift"];Ko=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();qo=e=>e==="start"?"left":e==="end"?"right":"center",Lt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,cl=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;zo=e=>e===0||e===1,Ud=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*jt/n)),Gd=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*jt/n)+1,Un={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*It)+1,easeOutSine:e=>Math.sin(e*It),easeInOutSine:e=>-.5*(Math.cos(pt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>zo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>zo(e)?e:Ud(e,.075,.3),easeOutElastic:e=>zo(e)?e:Gd(e,.075,.3),easeInOutElastic(e){return zo(e)?e:e<.5?.5*Ud(e*2,.1125,.45):.5+.5*Gd(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Un.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Un.easeInBounce(e*2)*.5:Un.easeOutBounce(e*2-1)*.5+.5};Ab=["x","y","borderWidth","radius","tension"],Rb=["color","borderColor","backgroundColor"];Yd=new Map;lf={values(e){return it(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";let i=this.chart.options.locale,s,o=e;if(n.length>1){let c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Lb(e,n)}let r=Le(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ws(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";let i=n[t].significand||e/Math.pow(10,Math.floor(Le(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?lf.numeric.call(this,e,t,n):""}};_s={formatters:lf};Sn=Object.create(null),Qo=Object.create(null);qa=class{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Ho(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ho(s.borderColor),this.hoverColor=(i,s)=>Ho(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ka(this,t,n)}get(t){return ps(this,t)}describe(t,n){return Ka(Qo,t,n)}override(t,n){return Ka(Sn,t,n)}route(t,n,i,s){let o=ps(this,t),r=ps(this,i),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){let l=this[a],c=r[s];return Y(l)?Object.assign({},c,l):$(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}},rt=new qa({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ob,Ib,zb]);Bb=/^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/,Wb=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;jb=e=>+e||0;$b=(e,t)=>e?e+xs(t):t,bl=(e,t)=>Y(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);Kb=(e,t)=>e===!0?t:typeof e=="string"?ki(t,e):void 0;Qb=Number.EPSILON||1e-14,wi=(e,t)=>t<e.length&&!e[t].skip&&e[t],pf=e=>e==="x"?"y":"x";sr=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);ix=["top","right","bottom","left"];sx=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);_n=e=>Math.round(e*10)/10;wl=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Ts()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();ax=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},lx=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}}});function xx(e,t){let n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function yx(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function vf(e,t){let n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function vx(e,t,n){if(n===!1)return!1;let i=vf(e,n),s=vf(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function wx(e){let t,n,i,s;return Y(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function ah(e,t){let n=[],i=e._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function wf(e,t,n,i={}){let s=e.keys,o=i.mode==="single",r,a,l,c;if(t===null)return;let u=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===n){if(u=!0,i.all)continue;break}c=e.values[l],gt(c)&&(o||t===0||we(t)===we(c))&&(t+=c)}return!u&&!i.all?0:t}function _x(e,t){let{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,u;for(l=0,c=r.length;l<c;++l)u=r[l],a[l]={[s]:u,[o]:e[u]};return a}function Pl(e,t){let n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function kx(e,t,n){return\`\${e.id}.\${t.id}.\${n.stack||n.type}\`}function Sx(e){let{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Ex(e,t,n){let i=e[t]||(e[t]={});return i[n]||(i[n]={})}function _f(e,t,n,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function kf(e,t){let{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,u=kx(o,r,i),d=t.length,f;for(let p=0;p<d;++p){let b=t[p],{[l]:x,[c]:y}=b,w=b._stacks||(b._stacks={});f=w[c]=Ex(s,u,x),f[a]=y,f._top=_f(f,r,!0,i.type),f._bottom=_f(f,r,!1,i.type);let _=f._visualValues||(f._visualValues={});_[a]=y}}function Dl(e,t){let n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Mx(e,t){return Fe(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Tx(e,t,n){return Fe(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ps(e,t){let n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(let s of t){let o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}function Zn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function Dx(e,t,n,i){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?sl:rn;if(i){if(s._sharedOptions){let u=o[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){let f=c(o,t,n-d),p=c(o,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{let u=c(o,t,n);if(l){let{vScale:d}=s._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(x=>!X(x[d.axis]));u.lo-=Math.max(0,p);let b=f.slice(u.hi).findIndex(x=>!X(x[d.axis]));u.hi+=Math.max(0,b)}return u}}return{lo:0,hi:o.length-1}}function Fs(e,t,n,i,s){let o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:u}=o[a],{lo:d,hi:f}=Dx(o[a],t,r,s);for(let p=d;p<=f;++p){let b=u[p];b.skip||i(b,c,p)}}}function Ax(e){let t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){let o=t?Math.abs(i.x-s.x):0,r=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Rl(e,t,n,i,s){let o=[];return!s&&!e.isPointInArea(t)||Fs(e,n,t,function(a,l,c){!s&&!ne(a,e.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Rx(e,t,n,i){let s=[];function o(r,a,l){let{startAngle:c,endAngle:u}=r.getProps(["startAngle","endAngle"],i),{angle:d}=nl(r,{x:t.x,y:t.y});Go(d,c,u)&&s.push({element:r,datasetIndex:a,index:l})}return Fs(e,n,t,o),s}function Ox(e,t,n,i,s,o){let r=[],a=Ax(n),l=Number.POSITIVE_INFINITY;function c(u,d,f){let p=u.inRange(t.x,t.y,s);if(i&&!p)return;let b=u.getCenterPoint(s);if(!(!!o||e.isPointInArea(b))&&!p)return;let y=a(t,b);y<l?(r=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&r.push({element:u,datasetIndex:d,index:f})}return Fs(e,n,t,c),r}function Ol(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?Rx(e,t,n,s):Ox(e,t,n,i,s,o)}function Ef(e,t,n,i,s){let o=[],r=n==="x"?"inXRange":"inYRange",a=!1;return Fs(e,n,t,(l,c,u)=>{l[r]&&l[r](t[n],s)&&(o.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}function Ds(e,t){return e.filter(n=>n.pos===t)}function Mf(e,t){return e.filter(n=>lh.indexOf(n.pos)===-1&&n.box.axis===t)}function As(e,t){return e.sort((n,i)=>{let s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Nx(e){let t=[],n,i,s,o,r,a;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Lx(e){let t={};for(let n of e){let{stack:i,pos:s,stackWeight:o}=n;if(!i||!lh.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function zx(e,t){let n=Lx(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return n}function Vx(e){let t=Nx(e),n=As(t.filter(c=>c.box.fullSize),!0),i=As(Ds(t,"left"),!0),s=As(Ds(t,"right")),o=As(Ds(t,"top"),!0),r=As(Ds(t,"bottom")),a=Mf(t,"x"),l=Mf(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Ds(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Tf(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function ch(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Fx(e,t,n,i){let{pos:s,box:o}=n,r=e.maxPadding;if(!Y(s)){n.size&&(e[s]-=n.size);let d=i[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?o.height:o.width),n.size=d.size/d.count,e[s]+=n.size}o.getPadding&&ch(r,o.getPadding());let a=Math.max(0,t.outerWidth-Tf(r,e,"left","right")),l=Math.max(0,t.outerHeight-Tf(r,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Hx(e){let t=e.maxPadding;function n(i){let s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Bx(e,t){let n=t.maxPadding;function i(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return i(e?["left","right"]:["top","bottom"])}function Is(e,t,n,i){let s=[],o,r,a,l,c,u;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Bx(a.horizontal,t));let{same:d,other:f}=Fx(t,n,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&Is(s,t,n,i)||u}function cr(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function Cf(e,t,n,i){let s=n.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){let d=t.w*u,f=c.size||l.height;Si(c.start)&&(r=c.start),l.fullSize?cr(l,s.left,r,n.outerWidth-s.right-s.left,f):cr(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{let d=t.h*u,f=c.size||l.width;Si(c.start)&&(o=c.start),l.fullSize?cr(l,o,s.top,f,n.outerHeight-s.bottom-s.top):cr(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}function jx(e,t){let n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[mr]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Pf(s)){let o=rr(e,"width");o!==void 0&&(e.width=o)}if(Pf(i))if(e.style.height==="")e.height=e.width/(t||2);else{let o=rr(e,"height");o!==void 0&&(e.height=o)}return e}function $x(e,t,n){e&&e.addEventListener(t,n,uh)}function Ux(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,uh)}function Gx(e,t){let n=Wx[e.type]||e.type,{x:i,y:s}=ie(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vr(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function Yx(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||vr(a.addedNodes,i),r=r&&!vr(a.removedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Kx(e,t,n){let i=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||vr(a.removedNodes,i),r=r&&!vr(a.addedNodes,i);r&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function dh(){let e=window.devicePixelRatio;e!==Df&&(Df=e,zs.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Xx(e,t){zs.size||window.addEventListener("resize",dh),zs.set(e,t)}function qx(e){zs.delete(e),zs.size||window.removeEventListener("resize",dh)}function Zx(e,t,n){let i=e.canvas,s=i&&Cs(i);if(!s)return;let o=Xo((a,l)=>{let c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||o(c,u)});return r.observe(s),Xx(e,o),r}function Il(e,t,n){n&&n.disconnect(),t==="resize"&&qx(e)}function Jx(e,t,n){let i=e.canvas,s=Xo(o=>{e.ctx!==null&&n(Gx(o,e))},e);return $x(i,t,s),s}function Qx(e){return!Ts()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Vl:Fl}function t0(e,t){let n=e.options.ticks,i=e0(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?i0(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return s0(t,c,o,r/s),c;let u=n0(o,t,s);if(r>0){let d,f,p=r>1?Math.round((l-a)/(r-1)):null;for(ur(t,c,u,X(p)?0:a-p,a),d=0,f=r-1;d<f;d++)ur(t,c,u,o[d],o[d+1]);return ur(t,c,u,l,X(p)?t.length:l+p),c}return ur(t,c,u),c}function e0(e){let t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function n0(e,t,n){let i=o0(e),s=t.length/n;if(!i)return Math.max(s,1);let o=tl(i);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function i0(e){let t=[],n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function s0(e,t,n,i){let s=0,o=n[0],r;for(i=Math.ceil(i),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=n[s*i])}function ur(e,t,n,i,s){let o=$(i,0),r=Math.min($(s,e.length),e.length),a=0,l,c,u;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(c=Math.max(o,0);c<r;c++)c===u&&(t.push(e[c]),a++,u=Math.round(o+a*n))}function o0(e){let t=e.length,n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}function Of(e,t){let n=[],i=e.length/t,s=e.length,o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function a0(e,t,n){let i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function l0(e,t){U(e,n=>{let i=n.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Rs(e){return e.drawTicks?e.tickLength:0}function If(e,t){if(!e.display)return 0;let n=bt(e.font,t),i=St(e.padding);return(it(e.text)?e.text.length:1)*n.lineHeight+i.height}function c0(e,t){return Fe(e,{scale:t,type:"scale"})}function u0(e,t,n){return Fe(e,{tick:n,index:t,type:"tick"})}function d0(e,t,n){let i=qo(e);return(n&&t!=="right"||!n&&t==="right")&&(i=r0(i)),i}function f0(e,t,n,i){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:u}=l,d=0,f,p,b,x=r-s,y=a-o;if(e.isHorizontal()){if(p=Lt(i,o,a),Y(n)){let w=Object.keys(n)[0],_=n[w];b=u[w].getPixelForValue(_)+x-t}else n==="center"?b=(c.bottom+c.top)/2+x-t:b=Af(e,n,t);f=a-o}else{if(Y(n)){let w=Object.keys(n)[0],_=n[w];p=u[w].getPixelForValue(_)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=Af(e,n,t);b=Lt(i,r,s),d=n==="left"?-It:It}return{titleX:p,titleY:b,maxWidth:f,rotation:d}}function h0(e,t,n){let i=Yn(Object.create(null),[n?rt.get(n):{},rt.get(t),e.defaults]);rt.set(t,i),e.defaultRoutes&&p0(t,e.defaultRoutes),e.descriptors&&rt.describe(t,e.descriptors)}function p0(e,t){Object.keys(t).forEach(n=>{let i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),r=t[n].split("."),a=r.pop(),l=r.join(".");rt.route(o,s,l,a)})}function g0(e){return"id"in e&&"defaults"in e}function m0(e){let t={},n=[],i=Object.keys(Be.plugins.items);for(let o=0;o<i.length;o++)n.push(Be.getPlugin(i[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function b0(e,t){return!t&&e===!1?null:e===!0?{}:e}function x0(e,{plugins:t,localIds:n},i,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=b0(i[l],s);c!==null&&o.push({plugin:a,options:y0(e.config,{plugin:a,local:n[l]},c,r)})}return o}function y0(e,{plugin:t,local:n},i,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(i,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Wl(e,t){let n=rt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function v0(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function w0(e,t){return e===t?"_index_":"_value_"}function Nf(e){if(e==="x"||e==="y"||e==="r")return e}function _0(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function jl(e,...t){if(Nf(e))return e;for(let n of t){let i=n.axis||_0(n.position)||e.length>1&&Nf(e[0].toLowerCase());if(i)return i}throw new Error(\`Cannot determine type of '\${e}' axis. Please provide 'axis' or 'position' option.\`)}function Lf(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function k0(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return Lf(e,"x",n[0])||Lf(e,"y",n[0])}return{}}function S0(e,t){let n=Sn[e.type]||{scales:{}},i=t.scales||{},s=Wl(e.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!Y(a))return console.error(\`Invalid scale configuration for scale: \${r}\`);if(a._proxy)return console.warn(\`Ignoring resolver passed as options for scale: \${r}\`);let l=jl(r,a,k0(r,e),rt.scales[a.type]),c=w0(l,s),u=n.scales||{};o[r]=Kn(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Wl(a,t),u=(Sn[a]||{}).scales||{};Object.keys(u).forEach(d=>{let f=v0(d,l),p=r[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),Kn(o[p],[{axis:f},i[p],u[d]])})}),Object.keys(o).forEach(r=>{let a=o[r];Kn(a,[rt.scales[a.type],rt.scale])}),o}function fh(e){let t=e.options||(e.options={});t.plugins=$(t.plugins,{}),t.scales=S0(e,t)}function hh(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function E0(e){return e=e||{},e.data=hh(e.data),fh(e),e}function dr(e,t){let n=zf.get(e);return n||(n=t(),zf.set(e,n),ph.add(n)),n}function Vf(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let s=n.join(),o=i.get(s);return o||(o={resolver:Ms(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}function T0(e,t){let{isScriptable:n,isIndexable:i}=ir(e);for(let s of t){let o=n(s),r=i(s),a=(r||o)&&e[s];if(o&&(Ne(a)||M0(a))||r&&it(a))return!0}return!1}function Ff(e,t){return e==="top"||e==="bottom"||P0.indexOf(e)===-1&&t==="x"}function Hf(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Bf(e){let t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),z(n&&n.onComplete,[e],t)}function D0(e){let t=e.chart,n=t.options.animation;z(n&&n.onProgress,[e],t)}function gh(e){return Ts()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}function A0(e,t,n){let i=Object.keys(e);for(let s of i){let o=+s;if(o>=t){let r=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=r)}}}function R0(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}function jf(){return U(fe.instances,e=>e._plugins.invalidate())}function mh(e,t,n=t){e.lineCap=$(n.borderCapStyle,t.borderCapStyle),e.setLineDash($(n.borderDash,t.borderDash)),e.lineDashOffset=$(n.borderDashOffset,t.borderDashOffset),e.lineJoin=$(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=$(n.borderWidth,t.borderWidth),e.strokeStyle=$(n.borderColor,t.borderColor)}function O0(e,t,n){e.lineTo(n.x,n.y)}function I0(e){return e.stepped?hl:e.tension||e.cubicInterpolationMode==="monotone"?pl:O0}function bh(e,t,n={}){let i=e.length,{start:s=0,end:o=i-1}=n,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),u=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function N0(e,t,n,i){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=bh(s,n,i),u=I0(o),{move:d=!0,reverse:f}=i||{},p,b,x;for(p=0;p<=c;++p)b=s[(a+(f?c-p:p))%r],!b.skip&&(d?(e.moveTo(b.x,b.y),d=!1):u(e,x,b,f,o.stepped),x=b);return l&&(b=s[(a+(f?c:0))%r],u(e,x,b,f,o.stepped)),!!l}function L0(e,t,n,i){let s=t.points,{count:o,start:r,ilen:a}=bh(s,n,i),{move:l=!0,reverse:c}=i||{},u=0,d=0,f,p,b,x,y,w,_=E=>(r+(c?a-E:E))%o,S=()=>{x!==y&&(e.lineTo(u,y),e.lineTo(u,x),e.lineTo(u,w))};for(l&&(p=s[_(0)],e.moveTo(p.x,p.y)),f=0;f<=a;++f){if(p=s[_(f)],p.skip)continue;let E=p.x,T=p.y,R=E|0;R===b?(T<x?x=T:T>y&&(y=T),u=(d*u+E)/++d):(S(),e.lineTo(E,T),b=R,d=0,x=y=T),w=T}S()}function Ul(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?L0:N0}function z0(e){return e.stepped?_l:e.tension||e.cubicInterpolationMode==="monotone"?kl:on}function V0(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),mh(e,t.options),e.stroke(s)}function F0(e,t,n,i){let{segments:s,options:o}=t,r=Ul(t);for(let a of s)mh(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}function B0(e,t,n,i){H0&&!t.options.segment?V0(e,t,n,i):F0(e,t,n,i)}function $f(e,t,n,i){let s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}function j0(e,t,n,i,s){let o=$0(i,e,t,n),r=U0(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function $0(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+i.measureText(s).width}function U0(e,t,n){let i=e;return typeof t.text!="string"&&(i=xh(t,n)),i}function xh(e,t){let n=e.text?e.text.length:0;return t*n}function G0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}function He(e,t){return t&&(it(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function cn(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(\`
5417
5419
  \`)>-1?e.split(\`
5418
- \`):e}function $0(e,t){let{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function jf(e,t){let n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=gt(t.bodyFont),c=gt(t.titleFont),u=gt(t.footerFont),d=o.length,f=s.length,p=i.length,b=kt(t.padding),x=b.height,y=0,w=i.reduce((T,E)=>T+E.before.length+E.lines.length+E.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){let T=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=p*T+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0,S=function(T){y=Math.max(y,n.measureText(T).width+_)};return n.save(),n.font=c.string,$(e.title,S),n.font=l.string,$(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?r+2+t.boxPadding:0,$(i,T=>{$(T.before,S),$(T.lines,S),$(T.after,S)}),_=0,n.font=u.string,$(e.footer,S),n.restore(),y+=b.width,{width:y,height:x}}function U0(e,t){let{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function G0(e,t,n,i){let{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function Y0(e,t,n,i){let{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),G0(c,e,t,n)&&(c="center"),c}function $f(e,t,n){let i=n.yAlign||t.yAlign||U0(e,n);return{xAlign:n.xAlign||t.xAlign||Y0(e,t,n,i),yAlign:i}}function K0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function X0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Uf(e,t,n,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=_n(r),b=K0(t,a),x=X0(t,l,c);return l==="center"?a==="left"?b+=c:a==="right"&&(b-=c):a==="left"?b-=Math.max(u,f)+s:a==="right"&&(b+=Math.max(d,p)+s),{x:Wt(b,0,i.width-t.width),y:Wt(x,0,i.height-t.height)}}function dr(e,t,n){let i=kt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Gf(e){return Ie([],nn(e))}function q0(e,t,n){return Re(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Yf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}function jt(e,t,n,i){let s=e[t].call(n,i);return typeof s>"u"?bh[t].call(n,i):s}function J0(e,t,n,i){let s=e.indexOf(t);if(s===-1)return Z0(e,t,n,i);let o=e.lastIndexOf(t);return s!==o?n:s}function Kf(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function ty(e,t){let n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,b=u-1,{min:x,max:y}=t,w=!X(r),_=!X(a),S=!X(c),T=(y-x)/(d+1),E=Wo((y-x)/b/p)*p,P,O,A,N;if(E<1e-14&&!w&&!_)return[{value:x},{value:y}];N=Math.ceil(y/E)-Math.floor(x/E),N>b&&(E=Wo(N*E/b/p)*p),X(l)||(P=Math.pow(10,l),E=Math.ceil(E*P)/P),s==="ticks"?(O=Math.floor(x/E)*E,A=Math.ceil(y/E)*E):(O=x,A=y),w&&_&&o&&tl((a-r)/o,E/1e3)?(N=Math.round(Math.min((a-r)/E,u)),E=(a-r)/N,O=r,A=a):S?(O=w?r:O,A=_?a:A,N=c-1,E=(A-O)/N):(N=(A-O)/E,Ae(N,Math.round(N),E/1e3)?N=Math.round(N):N=Math.ceil(N));let j=Math.max($o(E),$o(O));P=Math.pow(10,X(l)?j:l),O=Math.round(O*P)/P,A=Math.round(A*P)/P;let H=0;for(w&&(f&&O!==r?(n.push({value:r}),O<r&&H++,Ae(Math.round((O+H*E)*P)/P,r,Xf(r,T,e))&&H++):O<r&&H++);H<N;++H){let G=Math.round((O+H*E)*P)/P;if(_&&G>a)break;n.push({value:G})}return _&&f&&A!==a?n.length&&Ae(n[n.length-1].value,a,Xf(a,T,e))?n[n.length-1].value=a:n.push({value:a}):(!_||A===a)&&n.push({value:A}),n}function Xf(e,t,{horizontal:n,minRotation:i}){let s=Oe(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}function qf(e){return e/Math.pow(10,Ls(e))===1}function Zf(e,t,n){let i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function ey(e,t){let n=t-e,i=Ls(n);for(;Zf(e,t,i)>10;)i++;for(;Zf(e,t,i)<10;)i--;return Math.min(i,Ls(e))}function ny(e,{min:t,max:n}){t=Ot(e.min,t);let i=[],s=Ls(t),o=ey(t,n),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10,d=Math.floor((c-u)/Math.pow(10,o)),f=Ot(e.min,Math.round((l+u+d*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:qf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),f=Math.round((l+u+d*Math.pow(10,o))*r)/r;let p=Ot(e.max,f);return i.push({value:p,major:qf(p),significand:d}),i}function Ul(e){let t=e.ticks;if(t.display&&e.display){let n=kt(t.backdropPadding);return W(t.font&&t.font.size,it.font.size)+n.height}return 0}function iy(e,t,n){return n=et(n)?n:[n],{w:dl(e,t.string,n),h:n.length*t.lineHeight}}function Jf(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function sy(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?ft/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let u=e.getPointPosition(l,e.drawingArea+s[l],a),d=gt(c.font),f=iy(e.ctx,d,e._pointLabels[l]);i[l]=f;let p=qt(e.getIndexAngle(l)+a),b=Math.round(bs(p)),x=Jf(b,u.x,f.w,0,180),y=Jf(b,u.y,f.h,90,270);oy(n,t,p,x,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ly(e,i,s)}function oy(e,t,n,i,s){let o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function ry(e,t,n){let i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(bs(qt(l.angle+At))),u=dy(l.y,a.h,c),d=cy(c),f=uy(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function ay(e,t){if(!t)return!0;let{left:n,top:i,right:s,bottom:o}=e;return!(Zt({x:n,y:i},t)||Zt({x:n,y:o},t)||Zt({x:s,y:i},t)||Zt({x:s,y:o},t))}function ly(e,t,n){let i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Ul(o)/2,additionalAngle:r?ft/s:0},c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];let d=ry(e,u,l);i.push(d),a==="auto"&&(d.visible=ay(d,c),d.visible&&(c=d))}return i}function cy(e){return e===0||e===180?"center":e<180?"left":"right"}function uy(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function dy(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function fy(e,t,n){let{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!X(a)){let l=_n(t.borderRadius),c=kt(t.backdropPadding);e.fillStyle=a;let u=i-c.left,d=s-c.top,f=o-i+c.width,p=r-s+c.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),Si(e,{x:u,y:d,w:f,h:p,radius:l}),e.fill()):e.fillRect(u,d,f,p)}}function hy(e,t){let{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(e.getPointLabelContext(s));fy(n,r,o);let a=gt(r.font),{x:l,y:c,textAlign:u}=o;wn(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function yh(e,t,n,i){let{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,Bt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function py(e,t,n,i,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),yh(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function gy(e,t,n){return Re(e,{label:n,index:t,type:"pointLabel"})}function Qf(e,t){return e-t}function th(e,t){if(X(t))return null;let n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),ht(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Gn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function eh(e,t,n,i){let s=$t.length;for(let o=$t.indexOf(e);o<s-1;++o){let r=wr[$t[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return $t[o]}return $t[s-1]}function my(e,t,n,i,s){for(let o=$t.length-1;o>=$t.indexOf(n);o--){let r=$t[o];if(wr[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return $t[n?$t.indexOf(n):0]}function by(e){for(let t=$t.indexOf(e)+1,n=$t.length;t<n;++t)if(wr[$t[t]].common)return $t[t]}function nh(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:i,hi:s}=xs(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function xy(e,t,n,i){let s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function ih(e,t,n){let i=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:xy(e,i,s,n)}function hr(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=Qe(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=Qe(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var Il,en,mf,px,Nl,br,Dl,wf,Ex,qn,Zn,Ll,Mx,Ax,oh,En,xr,zl,gr,Fx,Mf,ah,Ns,Tf,Vl,Le,i0,Cf,Pf,Qn,Ti,Fl,Ne,Hl,If,dh,As,jl,k0,E0,M0,mr,Ff,ae,z0,Sn,Jn,Wf,F0,vr,mh,Rs,bh,Is,xh,Z0,Q0,Ci,Ai,Pi,Ls,Xn,fr,Mi,wr,$t,Di,pr,vh=M(()=>{Tl();Il=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){let o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Yo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let o=i.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){let n=this._charts,i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){let n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){let n=this._charts.get(t);if(!n||!n.items.length)return;let i=n.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},en=new Il,mf="transparent",px={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let i=Zo(e||mf),s=i.valid&&Zo(t||mf);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Nl=class{constructor(t,n,i,s){let o=n[i];s=Ei([t.to,s,o,t.from]);let r=Ei([t.from,o,s]);this._active=!0,this._fn=t.fn||px[t.type||typeof r],this._easing=Wn[t.easing]||Wn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);let s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ei([t.to,n,s,t.from]),this._from=Ei([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){let n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}},br=class{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Y(t))return;let n=Object.keys(it.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!Y(o))return;let r={};for(let a of n)r[a]=o[a];(et(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){let i=n.options,s=mx(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&gx(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}let u=n[c],d=o[c],f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Nl(f,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}let i=this._createAnimations(t,n);if(i.length)return en.add(this._chart,i),!0}};Dl=e=>e==="reset"||e==="none",wf=(e,t)=>t?e:Object.assign({},e),Ex=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:sh(n,!0),values:null},qn=class{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Cl(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ts(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,f,p,b)=>d==="x"?f:d==="r"?b:p,o=n.xAxisID=W(i.xAxisID,Pl(t,"x")),r=n.yAxisID=W(i.yAxisID,Pl(t,"y")),a=n.rAxisID=W(i.rAxisID,Pl(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Go(this._data,this),t._stacked&&Ts(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Y(n)){let s=this._cachedMeta;this._data=yx(n,s)}else if(i!==n){if(i){Go(i,this);let s=this._cachedMeta;Ts(s),s._parsed=[]}n&&Object.isExtensible(n)&&ol(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=n._stacked;n._stacked=Cl(n.vScale,n),n.stack!==i.stack&&(s=!0,Ts(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(vf(this,n._parsed),n._stacked=Cl(n.vScale,n))}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{et(s[t])?f=this.parseArrayData(i,s,t,n):Y(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);let p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);i._sorted=l}r&&vf(this,f)}parsePrimitiveData(t,n,i,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,d=new Array(s),f,p,b;for(f=0,p=s;f<p;++f)b=f+i,d[f]={[a]:u||o.parse(c[b],b),[l]:r.parse(n[b],b)};return d}parseArrayData(t,n,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=n[u],a[l]={x:o.parse(d[0],u),y:r.parse(d[1],u)};return a}parseObjectData(t,n,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),u,d,f,p;for(u=0,d=s;u<d;++u)f=u+i,p=n[f],c[u]={x:o.parse(_i(p,a),f),y:r.parse(_i(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){let s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:sh(s,!0),values:n._stacks[t.axis]._visualValues};return xf(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){let o=i[n.axis],r=o===null?NaN:o,a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=xf(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Ex(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=wx(a),f,p;function b(){p=s[f];let x=p[a.axis];return!ht(p[t.axis])||u>x||d<x}for(f=0;f<r&&!(!b()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!b()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){let n=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],ht(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=xx(W(this.options.clip,bx(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){let d=s[u];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){let i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=Sx(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=kx(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){let s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&ki(i);if(a)return wf(a,l);let c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(it.elements[t]),b=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(f,p,b,d);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(wf(x,l))),x}_resolveAnimations(t,n,i){let s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,n))}let c=new br(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Dl(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){Dl(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Dl(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;let o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){let s=this._cachedMeta,o=s.data,r=t+n,a,l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,n);i._stacked&&Ts(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};F(qn,"defaults",{}),F(qn,"datasetElementType",null),F(qn,"dataElementType",null);Zn=class extends qn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled,{start:a,count:l}=cl(n,s,r);this._drawStart=a,this._drawCount=l,ul(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=r.axis,p=a.axis,{spanGaps:b,segment:x}=this.options,y=Gn(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",_=n+i,S=t.length,T=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){let P=t[E],O=w?P:{};if(E<n||E>=_){O.skip=!0;continue}let A=this.getParsed(E),N=X(A[p]),j=O[f]=r.getPixelForValue(A[f],E),H=O[p]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,A,l):A[p],E);O.skip=isNaN(j)||isNaN(H)||N,O.stop=E>0&&Math.abs(A[f]-T[f])>y,x&&(O.parsed=A,O.raw=c.data[E]),d&&(O.options=u||this.resolveDataElementOptions(E,P.active?"active":s)),w||this.updateElement(P,E,O,s),T=A}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};F(Zn,"id","line"),F(Zn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(Zn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});Ll=class e{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}},Mx={_date:Ll};Ax={evaluateInteractionItems:zs,modes:{index(e,t,n,i){let s=Jt(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Al(e,s,o,i,r):Ol(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){let s=Jt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1,a=n.intersect?Al(e,s,o,i,r):Ol(e,s,o,!1,i,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){let s=Jt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Al(e,s,o,i,r)},nearest(e,t,n,i){let s=Jt(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Ol(e,s,o,n.intersect,i,r)},x(e,t,n,i){let s=Jt(t,e);return _f(e,s,"x",n.intersect,i)},y(e,t,n,i){let s=Jt(t,e);return _f(e,s,"y",n.intersect,i)}}},oh=["left","top","right","bottom"];En={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;let s=kt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Nx(e.boxes),l=a.vertical,c=a.horizontal;$(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});let u=l.reduce((x,y)=>y.box.options&&y.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);rh(f,kt(i));let p=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),b=Ix(l.concat(c),d);Os(a.fullSize,p,d,b),Os(l,p,d,b),Os(c,p,d,b)&&Os(l,p,d,b),zx(p),Ef(a.leftAndTop,p,d,b),p.x+=p.w,p.y+=p.h,Ef(a.rightAndBottom,p,d,b),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},$(a.chartArea,x=>{let y=x.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},xr=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},zl=class extends xr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},gr="$chartjs",Fx={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mf=e=>e===null||e==="";ah=vl?{passive:!0}:!1;Ns=new Map,Tf=0;Vl=class extends xr{acquireContext(t,n){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Hx(t,n),i):null}releaseContext(t){let n=t.canvas;if(!n[gr])return!1;let i=n[gr].initial;["height","width"].forEach(o=>{let r=i[o];X(r)?n.removeAttribute(o):n.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[gr],!0}addEventListener(t,n,i){this.removeEventListener(t,n);let s=t.$proxies||(t.$proxies={}),r={attach:$x,detach:Ux,resize:Kx}[n]||Xx;s[n]=r(t,n,i)}removeEventListener(t,n){let i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Rl,detach:Rl,resize:Rl}[n]||Wx)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return yl(t,n,i,s)}isAttached(t){let n=t&&Ms(t);return!!(n&&n.isConnected)}};Le=class{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){let{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Gn(this.x)&&Gn(this.y)}getProps(t,n){let i=this.$animations;if(!n||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};F(Le,"defaults",{}),F(Le,"defaultRoutes");i0=e=>e==="left"?"right":e==="right"?"left":e,Cf=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Pf=(e,t)=>Math.min(t||e,e);Qn=class e extends Le{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=Ot(t,Number.POSITIVE_INFINITY),n=Ot(n,Number.NEGATIVE_INFINITY),i=Ot(i,Number.POSITIVE_INFINITY),s=Ot(s,Number.NEGATIVE_INFINITY),{min:Ot(t,i),max:Ot(n,s),minDefined:ht(t),maxDefined:ht(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:Ot(n,Ot(i,n)),max:Ot(i,Ot(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(t,n,i){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Df(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Zx(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let n=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=z(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,n=t.ticks,i=Pf(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation,r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=Wt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:p/(i-1),d+6>a&&(a=p/(i-(t.offset?.5:1)),l=this.maxHeight-Ds(t.grid)-n.padding-Af(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=bs(Math.min(Math.asin(Wt((u.highest.height+6)/a,-1,1)),Math.asin(Wt(l/c,-1,1))-Math.asin(Wt(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Af(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ds(o)+l):(t.height=this.maxHeight,t.width=Ds(o)+l),i.display&&this.ticks.length){let{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=i.padding*2,b=Oe(this.labelRotation),x=Math.cos(b),y=Math.sin(b);if(a){let w=i.mirror?0:y*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{let w=i.mirror?0:x*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,u,y,x)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,p=0;l?c?(f=s*t.width,p=i*n.height):(f=i*t.height,p=s*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+r)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)X(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let n=this.options.ticks.sampleSize,i=this.ticks;n<i.length&&(i=Df(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/Pf(n,i)),c=0,u=0,d,f,p,b,x,y,w,_,S,T,E;for(d=0;d<n;d+=l){if(b=t[d].label,x=this._resolveTickFontOptions(d),s.font=y=x.string,w=o[y]=o[y]||{data:{},gc:[]},_=x.lineHeight,S=T=0,!X(b)&&!et(b))S=yi(s,w.data,w.gc,S,b),T=_;else if(et(b))for(f=0,p=b.length;f<p;++f)E=b[f],!X(E)&&!et(E)&&(S=yi(s,w.data,w.gc,S,E),T+=_);r.push(S),a.push(T),c=Math.max(S,c),u=Math.max(T,u)}o0(o,n);let P=r.indexOf(c),O=a.indexOf(u),A=N=>({width:r[N]||0,height:a[N]||0});return{first:A(0),last:A(n-1),widest:A(P),highest:A(O),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let n=this._startPixel+t*this._length;return nl(this._alignToPixels?tn(this.chart,n,0):n)}getDecimalForPixel(t){let n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){let n=this.ticks||[];if(t>=0&&t<n.length){let i=n[t];return i.$context||(i.$context=a0(this.getContext(),t,i))}return this.$context||(this.$context=r0(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,n=Oe(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ds(o),p=[],b=a.setContext(this.getContext()),x=b.display?b.width:0,y=x/2,w=function(tt){return tn(i,tt,x)},_,S,T,E,P,O,A,N,j,H,G,ot;if(r==="top")_=w(this.bottom),O=this.bottom-f,N=_-y,H=w(t.top)+y,ot=t.bottom;else if(r==="bottom")_=w(this.top),H=t.top,ot=w(t.bottom)-y,O=_+y,N=this.top+f;else if(r==="left")_=w(this.right),P=this.right-f,A=_-y,j=w(t.left)+y,G=t.right;else if(r==="right")_=w(this.left),j=t.left,G=w(t.right)-y,P=_+y,A=this.left+f;else if(n==="x"){if(r==="center")_=w((t.top+t.bottom)/2+.5);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}H=t.top,ot=t.bottom,O=_+y,N=O+f}else if(n==="y"){if(r==="center")_=w((t.left+t.right)/2);else if(Y(r)){let tt=Object.keys(r)[0],mt=r[tt];_=w(this.chart.scales[tt].getPixelForValue(mt))}P=_-y,A=P-f,j=t.left,G=t.right}let Pt=W(s.ticks.maxTicksLimit,d),Q=Math.max(1,Math.ceil(d/Pt));for(S=0;S<d;S+=Q){let tt=this.getContext(S),mt=o.setContext(tt),ue=a.setContext(tt),ni=mt.lineWidth,rn=mt.color,ve=ue.dash||[],an=ue.dashOffset,Ve=mt.tickWidth,Fe=mt.tickColor,Cn=mt.tickBorderDash||[],nt=mt.tickBorderDashOffset;T=s0(this,S,l),T!==void 0&&(E=tn(i,T,ni),c?P=A=j=G=E:O=N=H=ot=E,p.push({tx1:P,ty1:O,tx2:A,ty2:N,x1:j,y1:H,x2:G,y2:ot,width:ni,color:rn,borderDash:ve,borderDashOffset:an,tickWidth:Ve,tickColor:Fe,tickBorderDash:Cn,tickBorderDashOffset:nt}))}return this._ticksLength=d,this._borderValue=_,p}_computeLabelItems(t){let n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=Ds(i.grid),p=f+u,b=d?-u:p,x=-Oe(this.labelRotation),y=[],w,_,S,T,E,P,O,A,N,j,H,G,ot="middle";if(s==="top")P=this.bottom-b,O=this._getXAxisLabelAlignment();else if(s==="bottom")P=this.top+b,O=this._getXAxisLabelAlignment();else if(s==="left"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(s==="right"){let Q=this._getYAxisLabelAlignment(f);O=Q.textAlign,E=Q.x}else if(n==="x"){if(s==="center")P=(t.top+t.bottom)/2+p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];P=this.chart.scales[Q].getPixelForValue(tt)+p}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")E=(t.left+t.right)/2-p;else if(Y(s)){let Q=Object.keys(s)[0],tt=s[Q];E=this.chart.scales[Q].getPixelForValue(tt)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?ot="top":l==="end"&&(ot="bottom"));let Pt=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){S=a[w],T=S.label;let Q=o.setContext(this.getContext(w));A=this.getPixelForTick(w)+o.labelOffset,N=this._resolveTickFontOptions(w),j=N.lineHeight,H=et(T)?T.length:1;let tt=H/2,mt=Q.color,ue=Q.textStrokeColor,ni=Q.textStrokeWidth,rn=O;r?(E=A,O==="inner"&&(w===_-1?rn=this.options.reverse?"left":"right":w===0?rn=this.options.reverse?"right":"left":rn="center"),s==="top"?c==="near"||x!==0?G=-H*j+j/2:c==="center"?G=-Pt.highest.height/2-tt*j+j:G=-Pt.highest.height+j/2:c==="near"||x!==0?G=j/2:c==="center"?G=Pt.highest.height/2-tt*j:G=Pt.highest.height-H*j,d&&(G*=-1),x!==0&&!Q.showLabelBackdrop&&(E+=j/2*Math.sin(x))):(P=A,G=(1-H)*j/2);let ve;if(Q.showLabelBackdrop){let an=kt(Q.backdropPadding),Ve=Pt.heights[w],Fe=Pt.widths[w],Cn=G-an.top,nt=0-an.left;switch(ot){case"middle":Cn-=Ve/2;break;case"bottom":Cn-=Ve;break}switch(O){case"center":nt-=Fe/2;break;case"right":nt-=Fe;break;case"inner":w===_-1?nt-=Fe:w>0&&(nt-=Fe/2);break}ve={left:nt,top:Cn,width:Fe+an.width,height:Ve+an.height,color:Q.backdropColor}}y.push({label:T,font:N,textOffset:G,options:{rotation:x,color:mt,strokeColor:ue,strokeWidth:ni,textAlign:rn,textBaseline:ot,translation:[E,P],backdrop:ve}})}return y}_getXAxisLabelAlignment(){let{position:t,ticks:n}=this.options;if(-Oe(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){let n=this.options.grid;if(!this._isVisible()||!n.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){let l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,d,f;this.isHorizontal()?(c=tn(t,this.left,r)-r/2,u=tn(t,this.right,a)+a/2,d=f=l):(d=tn(t,this.top,r)-r/2,f=tn(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&_s(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,u=r.textOffset;wn(i,c,0,u,l,a)}s&&ks(i)}drawTitle(){let{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;let o=gt(i.font),r=kt(i.padding),a=i.align,l=o.lineHeight/2;n==="bottom"||n==="center"||Y(n)?(l+=r.bottom,et(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:u,maxWidth:d,rotation:f}=c0(this,l,n,a);wn(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:f,textAlign:l0(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,i=W(t.grid&&t.grid.z,-1),s=W(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=n.length;o<r;++o){let a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let n=this.options.ticks.setContext(this.getContext(t));return gt(n.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Ti=class{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let n=Object.getPrototypeOf(t),i;f0(n)&&(i=this.register(n));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,u0(t,r,i),this.override&&it.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in it[s]&&(delete it[s][i],this.override&&delete vn[i])}};Fl=class{constructor(){this.controllers=new Ti(qn,"datasets",!0),this.elements=new Ti(Le,"elements"),this.plugins=new Ti(Object,"plugins"),this.scales=new Ti(Qn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):$(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){let s=ms(t);z(i["before"+s],[],i),n[t](i),z(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){let i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){let s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Ne=new Fl,Hl=class{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],l=[n,s,o.options];if(z(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){X(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){let i=t&&t.config,s=W(i.options&&i.options.plugins,{}),o=h0(i);return s===!1&&!n?[]:g0(t,o,s,n)}_notifyStateChanges(t){let n=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};If=new Map,dh=new Set;As=(e,t,n)=>{let i=_i(t,n);i!==void 0&&e.add(i)},jl=class{constructor(t){this._config=_0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=uh(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),ch(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ur(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return ur(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return ur(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){let n=t.id,i=this.type;return ur(\`\${i}-plugin-\${n}\`,()=>[[\`plugins.\${n}\`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){let i=this._scopeCache,s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;let l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>As(l,t,d))),u.forEach(d=>As(l,s,d)),u.forEach(d=>As(l,vn[o]||{},d)),u.forEach(d=>As(l,it,d)),u.forEach(d=>As(l,Jo,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),dh.has(n)&&r.set(n,c),c}chartOptionScopes(){let{options:t,type:n}=this;return[t,vn[n]||{},it.datasets[n]||{},{type:n},it,Jo]}resolveNamedOptions(t,n,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Nf(this._resolverCache,t,s),l=r;if(S0(r,n)){o.$shared=!1,i=Pe(i)?i():i;let c=this.createResolver(t,i,a);l=yn(r,i,c)}for(let c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){let{resolver:o}=Nf(this._resolverCache,t,i);return Y(n)?yn(o,n,void 0,s):o}};k0=e=>Y(e)&&Object.getOwnPropertyNames(e).some(t=>Pe(e[t]));E0="4.5.1",M0=["top","bottom","left","right","chartArea"];mr={},Ff=e=>{let t=fh(e);return Object.values(mr).filter(n=>n.canvas===t).pop()};ae=class{static register(...t){Ne.add(...t),Hf()}static unregister(...t){Ne.remove(...t),Hf()}constructor(t,n){let i=this.config=new jl(n),s=fh(t),o=Ff(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||qx(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=qa(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=al(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],mr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}en.listen(this,"complete",Vf),en.listen(this,"progress",T0),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return X(t)?n&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ne}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():sr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Qo(this.canvas,this.ctx),this}stop(){return en.stop(this),this}resize(t,n){en.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,sr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};$(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];n&&(o=o.concat(Object.keys(n).map(r=>{let a=n[r],l=Wl(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),$(o,r=>{let a=r.options,l=a.id,c=Wl(l,a),u=W(a.type,r.dtype);(a.position===void 0||Lf(a.position,c)!==Lf(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{let f=Ne.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),$(s,(r,a)=>{r||delete i[a]}),$(i,r=>{En.configure(this,r,r.options),En.addBox(this,r)})}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(zf("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){let o=n[i],r=this.getDatasetMeta(i),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Bl(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{let l=Ne.getController(a),{datasetElementType:c,dataElementType:u}=it.datasets[a];Object.assign(l,{dataElementType:Ne.getElement(u),datasetElementType:c&&Ne.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){$(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){let{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||$(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(zf("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){$(this.scales,t=>{En.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Bo(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of n){let r=i==="_removeElements"?-o:o;C0(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!Bo(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;En.update(this,this.width,this.height,t);let n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],$(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Pe(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(en.has(this)?this.attached&&!en.running(this)&&en.start(this):(this.draw(),Vf({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,i=[],s,o;for(s=0,o=n.length;s<o;++s){let r=n[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Ml(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&_s(n,s),t.controller.draw(),s&&ks(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return Zt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){let o=Ax.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let n=this.data.datasets[t],i=this._metasets,s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Re(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){let i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);ki(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),en.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Qo(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete mr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,i=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};$(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){$(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},$(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){let s=i?"set":"remove",o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!wi(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){let s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){let i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){let{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Ja(t),c=P0(t,this._lastEvent,i,l);i&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));let u=!wi(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};F(ae,"defaults",it),F(ae,"instances",mr),F(ae,"overrides",vn),F(ae,"registry",Ne),F(ae,"version",E0),F(ae,"getChart",Ff);z0=typeof Path2D=="function";Sn=class extends Le{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;xl(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=El(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){let i=this.options,s=t[n],o=this.points,r=Sl(this,{property:n,start:s,end:s});if(!r.length)return;let a=[],l=I0(i),c,u;for(c=0,u=r.length;c<u;++c){let{start:d,end:f}=r[c],p=o[d],b=o[f];if(p===b){a.push(p);continue}let x=Math.abs((s-p[n])/(b[n]-p[n])),y=l(p,b,x,i.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,i){return $l(this)(t,this,n,i)}path(t,n,i){let s=this.segments,o=$l(this),r=this._loop;n=n||0,i=i||this.points.length-n;for(let a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),V0(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};F(Sn,"id","line"),F(Sn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(Sn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(Sn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});Jn=class extends Le{constructor(n){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return Bf(this,n,"x",i)}inYRange(n,i){return Bf(this,n,"y",i)}getCenterPoint(n){let{x:i,y:s}=this.getProps(["x","y"],n);return{x:i,y:s}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);let s=i&&n.borderWidth||0;return(i+s)*2}draw(n,i){let s=this.options;this.skip||s.radius<.1||!Zt(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,ws(n,s,this.x,this.y))}getRange(){let n=this.options||{};return n.radius+n.hitRadius}};F(Jn,"id","point"),F(Jn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(Jn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Wf=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},F0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,vr=class extends Le{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},n=z(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){let{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=gt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Wf(i,o),c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a,d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((b,x)=>{let y=i+n/2+o.measureText(b.text).width;(x===0||c[c.length-1]+y+2*a>r)&&(d+=u,c[c.length-(x>0?0:1)]=0,p+=u,f++),l[x]={left:0,top:p,row:f,width:y,height:s},c[c.length-1]+=y+a}),d}_fitCols(t,n,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t,d=a,f=0,p=0,b=0,x=0;return this.legendItems.forEach((y,w)=>{let{itemWidth:_,itemHeight:S}=H0(i,n,o,y,s);w>0&&p+S+2*a>u&&(d+=f+a,c.push({width:f,height:p}),b+=f+a,x++,f=p=0),l[w]={left:b,top:p,col:x,width:_,height:S},f=Math.max(f,_),p+=S+a}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=kn(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Rt(i,this.left+s,this.right-this.lineWidths[a]);for(let c of n)a!==c.row&&(a=c.row,l=Rt(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=Rt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of n)c.col!==a&&(a=c.col,l=Rt(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;_s(t,this),this._draw(),ks(t)}}_draw(){let{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=it.color,l=kn(t.rtl,this.left,this.width),c=gt(r.font),{padding:u}=r,d=c.size,f=d/2,p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:b,boxHeight:x,itemHeight:y}=Wf(r,d),w=function(P,O,A){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;s.save();let N=W(A.lineWidth,1);if(s.fillStyle=W(A.fillStyle,a),s.lineCap=W(A.lineCap,"butt"),s.lineDashOffset=W(A.lineDashOffset,0),s.lineJoin=W(A.lineJoin,"miter"),s.lineWidth=N,s.strokeStyle=W(A.strokeStyle,a),s.setLineDash(W(A.lineDash,[])),r.usePointStyle){let j={radius:x*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:N},H=l.xPlus(P,b/2),G=O+f;tr(s,j,H,G,r.pointStyleWidth&&b)}else{let j=O+Math.max((d-x)/2,0),H=l.leftForLtr(P,b),G=_n(A.borderRadius);s.beginPath(),Object.values(G).some(ot=>ot!==0)?Si(s,{x:H,y:j,w:b,h:x,radius:G}):s.rect(H,j,b,x),s.fill(),N!==0&&s.stroke()}s.restore()},_=function(P,O,A){wn(s,A.text,P,O+y/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},S=this.isHorizontal(),T=this._computeTitleHeight();S?p={x:Rt(o,this.left+u,this.right-i[0]),y:this.top+u+T,line:0}:p={x:this.left+u,y:Rt(o,this.top+T+u,this.bottom-n[0].height),line:0},rr(this.ctx,t.textDirection);let E=y+u;this.legendItems.forEach((P,O)=>{s.strokeStyle=P.fontColor,s.fillStyle=P.fontColor;let A=s.measureText(P.text).width,N=l.textAlign(P.textAlign||(P.textAlign=r.textAlign)),j=b+f+A,H=p.x,G=p.y;l.setWidth(this.width),S?O>0&&H+j+u>this.right&&(G=p.y+=E,p.line++,H=p.x=Rt(o,this.left+u,this.right-i[p.line])):O>0&&G+E>this.bottom&&(H=p.x=H+n[p.line].width+u,p.line++,G=p.y=Rt(o,this.top+T+u,this.bottom-n[p.line].height));let ot=l.x(H);if(w(ot,G,P),H=ll(N,H+b+f,S?H+j:this.right,t.rtl),_(l.x(H),G,P),S)p.x+=j+u;else if(typeof P.text!="string"){let Pt=c.lineHeight;p.y+=gh(P,Pt)+u}else p.y+=E}),ar(this.ctx,t.textDirection)}drawTitle(){let t=this.options,n=t.title,i=gt(n.font),s=kt(n.padding);if(!n.display)return;let o=kn(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l,u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Rt(t.align,d,this.right-f);else{let b=this.columnSizes.reduce((x,y)=>Math.max(x,y.height),0);u=c+Rt(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}let p=Rt(a,d,d+f);r.textAlign=o.textAlign(Xo(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,wn(r,n.text,p,u,i)}_computeTitleHeight(){let t=this.options.title,n=gt(t.font),i=kt(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(Yn(t,this.left,this.right)&&Yn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],Yn(t,s.left,s.left+s.width)&&Yn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let n=this.options;if(!j0(t.type,n))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=F0(s,i);s&&!o&&z(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&z(n.onHover,[t,i,this],this)}else i&&z(n.onClick,[t,i,this],this)}};mh={id:"legend",_element:vr,start(e,t,n){let i=e.legend=new vr({ctx:e.ctx,options:n,chart:e});En.configure(e,i,n),En.addBox(e,i)},stop(e){En.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let i=e.legend;En.configure(e,i,n),i.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(n?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Rs={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=gs(t,c);u<s&&(s=u,a=l)}}if(a){let l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};bh={beforeTitle:be,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:be,beforeBody:be,beforeLabel:be,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return X(n)||(t+=n),t},labelColor(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be};Is=class extends Le{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new br(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=q0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:i}=n,s=jt(i,"beforeTitle",this,t),o=jt(i,"title",this,t),r=jt(i,"afterTitle",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}getBeforeBody(t,n){return Gf(jt(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:i}=n,s=[];return $(t,o=>{let r={before:[],lines:[],after:[]},a=Yf(i,o);Ie(r.before,nn(jt(a,"beforeLabel",this,o))),Ie(r.lines,jt(a,"label",this,o)),Ie(r.after,nn(jt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Gf(jt(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:i}=n,s=jt(i,"beforeFooter",this,t),o=jt(i,"footer",this,t),r=jt(i,"afterFooter",this,t),a=[];return a=Ie(a,nn(s)),a=Ie(a,nn(o)),a=Ie(a,nn(r)),a}_createItems(t){let n=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push($0(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),$(a,u=>{let d=Yf(t.callbacks,u);s.push(jt(d,"labelColor",this,u)),o.push(jt(d,"labelPointStyle",this,u)),r.push(jt(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=Rs[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);let l=this._size=jf(this,i),c=Object.assign({},a,l),u=$f(this.chart,i,c),d=Uf(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){let o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=_n(a),{x:f,y:p}=t,{width:b,height:x}=n,y,w,_,S,T,E;return o==="center"?(T=p+x/2,s==="left"?(y=f,w=y-r,S=T+r,E=T-r):(y=f+b,w=y+r,S=T-r,E=T+r),_=y):(s==="left"?w=f+Math.max(l,u)+r:s==="right"?w=f+b-Math.max(c,d)-r:w=this.caretX,o==="top"?(S=p,T=S-r,y=w-r,_=w+r):(S=p+x,T=S+r,y=w+r,_=w-r),E=S),{x1:y,x2:w,x3:_,y1:S,y2:T,y3:E}}drawTitle(t,n,i){let s=this.title,o=s.length,r,a,l;if(o){let c=kn(i.rtl,this.x,this.width);for(t.x=dr(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=gt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=gt(o.bodyFont),d=dr(this,"left",o),f=s.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,b=n.y+p;if(o.usePointStyle){let x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,w=b+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ws(t,x,y,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ws(t,x,y,w)}else{t.lineWidth=Y(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let x=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),w=_n(r.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Si(t,{x,y:b,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Si(t,{x:y,y:b+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,b,c,l),t.strokeRect(x,b,c,l),t.fillStyle=r.backgroundColor,t.fillRect(y,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=gt(i.bodyFont),f=d.lineHeight,p=0,b=kn(i.rtl,this.x,this.width),x=function(A){n.fillText(A,b.x(t.x+p),t.y+f/2),t.y+=f+o},y=b.textAlign(r),w,_,S,T,E,P,O;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=dr(this,y,i),n.fillStyle=i.bodyColor,$(this.beforeBody,x),p=a&&y!=="right"?r==="center"?c/2+u:c+2+u:0,T=0,P=s.length;T<P;++T){for(w=s[T],_=this.labelTextColors[T],n.fillStyle=_,$(w.before,x),S=w.lines,a&&S.length&&(this._drawColorBox(n,t,T,b,i),f=Math.max(d.lineHeight,l)),E=0,O=S.length;E<O;++E)x(S[E]),f=d.lineHeight;$(w.after,x)}p=0,f=d.lineHeight,$(this.afterBody,x),t.y-=o}drawFooter(t,n,i){let s=this.footer,o=s.length,r,a;if(o){let l=kn(i.rtl,this.x,this.width);for(t.x=dr(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=gt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:b}=_n(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-b),n.quadraticCurveTo(a+c,l+u,a+c-b,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=Rs[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=jf(this,t),l=Object.assign({},r,this._size),c=$f(n,t,l),u=Uf(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){let n=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(n);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let r=kt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),rr(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),ar(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!wi(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!wi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){let{caretX:i,caretY:s,options:o}=this,r=Rs[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}};F(Is,"positioners",Rs);xh={id:"tooltip",_element:Is,positioners:Rs,afterInit(e,t,n){n&&(e.tooltip=new Is({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:bh},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Z0=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);Q0=(e,t)=>e===null?null:Wt(Math.round(e),0,t);Ci=class extends Qn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let i=this.getLabels();for(let{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(X(t))return null;let i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:J0(i,t,W(n,t),this._addedLabels),Q0(n,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,n=this.max,i=this.options.offset,s=[],o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return Kf.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};F(Ci,"id","category"),F(Ci,"defaults",{ticks:{callback:Kf}});Ai=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){let l=me(s),c=me(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(\`scales.\${this.id}.ticks.stepSize: \${i} would result generating up to \${s} ticks. Limiting to 1000.\`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,n=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=ty(s,o);return t.bounds==="ticks"&&jo(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let t=this.ticks,n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return ys(t,this.chart.options.locale,this.options.ticks.format)}},Pi=class extends Ai{determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?t:0,this.max=ht(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),n=t?this.width:this.height,i=Oe(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};F(Pi,"id","linear"),F(Pi,"defaults",{ticks:{callback:vs.formatters.numeric}});Ls=e=>Math.floor(De(e)),Xn=(e,t)=>Math.pow(10,Ls(e)+t);fr=class extends Qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){let i=Ai.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return ht(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=ht(t)?Math.max(0,t):null,this.max=ht(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ht(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Xn(i,-1)),r(Xn(s,1)))),i<=0&&o(Xn(s,-1)),s<=0&&r(Xn(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,n={min:this._userMin,max:this._userMax},i=ny(n,this);return t.bounds==="ticks"&&jo(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":ys(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=De(t),this._valueRange=De(this.max)-De(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(De(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};F(fr,"id","logarithmic"),F(fr,"defaults",{ticks:{callback:vs.formatters.logarithmic,major:{enabled:!0}}});Mi=class extends Ai{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=kt(Ul(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!1);this.min=ht(t)&&!isNaN(t)?t:0,this.max=ht(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ul(this.options))}generateTickLabels(t){Ai.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{let s=z(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?sy(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){let n=Bt/(this._pointLabels.length||1),i=this.options.startAngle||0;return qt(t*n+Oe(i))}getDistanceFromCenterForValue(t){if(X(t))return NaN;let n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(X(t))return NaN;let n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){let n=this._pointLabels||[];if(t>=0&&t<n.length){let i=n[t];return gy(this.getContext(),t,i)}}getPointPosition(t,n,i=0){let s=this.getIndexAngle(t)-At+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:n}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),yh(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,r=this._pointLabels.length,a,l,c;if(n.pointLabels.display&&hy(this,r),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let f=this.getContext(d),p=s.setContext(f),b=o.setContext(f);py(this,p,l,r,b)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;let c=i.setContext(this.getContext(l)),u=gt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let d=kt(c.backdropPadding);t.fillRect(-r/2-d.left,-o-u.size/2-d.top,r+d.width,u.size+d.height)}wn(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};F(Mi,"id","radialLinear"),F(Mi,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:vs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),F(Mi,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(Mi,"descriptors",{angleLines:{_fallback:"grid"}});wr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},$t=Object.keys(wr);Di=class extends Qn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){let i=t.time||(t.time={}),s=this._adapter=new Mx._date(t.adapters.date);s.init(n),Un(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:th(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=ht(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=ht(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){let t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=sl(s,o,r);return this._unit=n.unit||(i.autoSkip?eh(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):my(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:by(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),ih(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;n=Wt(n,0,r),i=Wt(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){let t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||eh(o.minUnit,n,i,this._getLabelCapacity(n)),a=W(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Gn(l)||l===!0,u={},d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);let b=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<i;f=+t.add(f,a,r),p++)nh(u,f,b);return(f===i||s.bounds==="ticks"||p===1)&&nh(u,f,b),Object.keys(u).sort(Qf).map(x=>+x)}getLabelForValue(t){let n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){let s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){let o=this.options,r=o.ticks.callback;if(r)return z(r,[t,n,i],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[n],p=c&&d&&f&&f.major;return this._adapter.format(t,s||(p?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,i=this.ctx.measureText(t).width,s=Oe(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){let n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,ih(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,i;if(t.length)return t;let s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(th(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rl(t.sort(Qf))}};F(Di,"id","time"),F(Di,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});pr=class extends Di{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=hr(n,this.min),this._tableRange=hr(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:n,max:i}=this,s=[],o=[],r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,n=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(hr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return hr(this._table,i*this._tableRange+this._minPos,!0)}};F(pr,"id","timeseries"),F(pr,"defaults",Di.defaults)});var wh=Lg((vE,_r)=>{(function(e,t,n,i){"use strict";var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,l=Math.abs,c=Date.now;function u(h,g,v){return setTimeout(_(h,v),g)}function d(h,g,v){return Array.isArray(h)?(f(h,v[g],v),!0):!1}function f(h,g,v){var k;if(h)if(h.forEach)h.forEach(g,v);else if(h.length!==i)for(k=0;k<h.length;)g.call(v,h[k],k,h),k++;else for(k in h)h.hasOwnProperty(k)&&g.call(v,h[k],k,h)}function p(h,g,v){var k="DEPRECATED METHOD: "+g+\`
5420
+ \`):e}function Y0(e,t){let{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Gf(e,t){let n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=bt(t.bodyFont),c=bt(t.titleFont),u=bt(t.footerFont),d=o.length,f=s.length,p=i.length,b=St(t.padding),x=b.height,y=0,w=i.reduce((E,T)=>E+T.before.length+T.lines.length+T.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){let E=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;x+=p*E+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let _=0,S=function(E){y=Math.max(y,n.measureText(E).width+_)};return n.save(),n.font=c.string,U(e.title,S),n.font=l.string,U(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?r+2+t.boxPadding:0,U(i,E=>{U(E.before,S),U(E.lines,S),U(E.after,S)}),_=0,n.font=u.string,U(e.footer,S),n.restore(),y+=b.width,{width:y,height:x}}function K0(e,t){let{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function X0(e,t,n,i){let{x:s,width:o}=i,r=n.caretSize+n.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function q0(e,t,n,i){let{x:s,width:o}=n,{width:r,chartArea:{left:a,right:l}}=e,c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),X0(c,e,t,n)&&(c="center"),c}function Yf(e,t,n){let i=n.yAlign||t.yAlign||K0(e,n);return{xAlign:n.xAlign||t.xAlign||q0(e,t,n,i),yAlign:i}}function Z0(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function J0(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Kf(e,t,n,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=Mn(r),b=Z0(t,a),x=J0(t,l,c);return l==="center"?a==="left"?b+=c:a==="right"&&(b-=c):a==="left"?b-=Math.max(u,f)+s:a==="right"&&(b+=Math.max(d,p)+s),{x:$t(b,0,i.width-t.width),y:$t(x,0,i.height-t.height)}}function fr(e,t,n){let i=St(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Xf(e){return He([],cn(e))}function Q0(e,t,n){return Fe(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function qf(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}function Ut(e,t,n,i){let s=e[t].call(n,i);return typeof s>"u"?vh[t].call(n,i):s}function ey(e,t,n,i){let s=e.indexOf(t);if(s===-1)return ty(e,t,n,i);let o=e.lastIndexOf(t);return s!==o?n:s}function Zf(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function iy(e,t){let n=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=o||1,b=u-1,{min:x,max:y}=t,w=!X(r),_=!X(a),S=!X(c),E=(y-x)/(d+1),T=jo((y-x)/b/p)*p,R,O,P,N;if(T<1e-14&&!w&&!_)return[{value:x},{value:y}];N=Math.ceil(y/T)-Math.floor(x/T),N>b&&(T=jo(N*T/b/p)*p),X(l)||(R=Math.pow(10,l),T=Math.ceil(T*R)/R),s==="ticks"?(O=Math.floor(x/T)*T,P=Math.ceil(y/T)*T):(O=x,P=y),w&&_&&o&&el((a-r)/o,T/1e3)?(N=Math.round(Math.min((a-r)/T,u)),T=(a-r)/N,O=r,P=a):S?(O=w?r:O,P=_?a:P,N=c-1,T=(P-O)/N):(N=(P-O)/T,ze(N,Math.round(N),T/1e3)?N=Math.round(N):N=Math.ceil(N));let W=Math.max(Uo(T),Uo(O));R=Math.pow(10,X(l)?W:l),O=Math.round(O*R)/R,P=Math.round(P*R)/R;let H=0;for(w&&(f&&O!==r?(n.push({value:r}),O<r&&H++,ze(Math.round((O+H*T)*R)/R,r,Jf(r,E,e))&&H++):O<r&&H++);H<N;++H){let B=Math.round((O+H*T)*R)/R;if(_&&B>a)break;n.push({value:B})}return _&&f&&P!==a?n.length&&ze(n[n.length-1].value,a,Jf(a,E,e))?n[n.length-1].value=a:n.push({value:a}):(!_||P===a)&&n.push({value:P}),n}function Jf(e,t,{horizontal:n,minRotation:i}){let s=Ve(i),o=(n?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}function Qf(e){return e/Math.pow(10,Vs(e))===1}function th(e,t,n){let i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function sy(e,t){let n=t-e,i=Vs(n);for(;th(e,t,i)>10;)i++;for(;th(e,t,i)<10;)i--;return Math.min(i,Vs(e))}function oy(e,{min:t,max:n}){t=Nt(e.min,t);let i=[],s=Vs(t),o=sy(t,n),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,u=Math.floor((t-l)/a/10)*a*10,d=Math.floor((c-u)/Math.pow(10,o)),f=Nt(e.min,Math.round((l+u+d*Math.pow(10,o))*r)/r);for(;f<n;)i.push({value:f,major:Qf(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),f=Math.round((l+u+d*Math.pow(10,o))*r)/r;let p=Nt(e.max,f);return i.push({value:p,major:Qf(p),significand:d}),i}function Gl(e){let t=e.ticks;if(t.display&&e.display){let n=St(t.backdropPadding);return $(t.font&&t.font.size,rt.font.size)+n.height}return 0}function ry(e,t,n){return n=it(n)?n:[n],{w:fl(e,t.string,n),h:n.length*t.lineHeight}}function eh(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function ay(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?pt/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let u=e.getPointPosition(l,e.drawingArea+s[l],a),d=bt(c.font),f=ry(e.ctx,d,e._pointLabels[l]);i[l]=f;let p=ee(e.getIndexAngle(l)+a),b=Math.round(ys(p)),x=eh(b,u.x,f.w,0,180),y=eh(b,u.y,f.h,90,270);ly(n,t,p,x,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=dy(e,i,s)}function ly(e,t,n,i,s){let o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n)),a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function cy(e,t,n){let i=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=n,l=e.getPointPosition(t,i+s+r,o),c=Math.round(ys(ee(l.angle+It))),u=py(l.y,a.h,c),d=fy(c),f=hy(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function uy(e,t){if(!t)return!0;let{left:n,top:i,right:s,bottom:o}=e;return!(ne({x:n,y:i},t)||ne({x:n,y:o},t)||ne({x:s,y:i},t)||ne({x:s,y:o},t))}function dy(e,t,n){let i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Gl(o)/2,additionalAngle:r?pt/s:0},c;for(let u=0;u<s;u++){l.padding=n[u],l.size=t[u];let d=cy(e,u,l);i.push(d),a==="auto"&&(d.visible=uy(d,c),d.visible&&(c=d))}return i}function fy(e){return e===0||e===180?"center":e<180?"left":"right"}function hy(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function py(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function gy(e,t,n){let{left:i,top:s,right:o,bottom:r}=n,{backdropColor:a}=t;if(!X(a)){let l=Mn(t.borderRadius),c=St(t.backdropPadding);e.fillStyle=a;let u=i-c.left,d=s-c.top,f=o-i+c.width,p=r-s+c.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),Ei(e,{x:u,y:d,w:f,h:p,radius:l}),e.fill()):e.fillRect(u,d,f,p)}}function my(e,t){let{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(e.getPointLabelContext(s));gy(n,r,o);let a=bt(r.font),{x:l,y:c,textAlign:u}=o;En(n,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function _h(e,t,n,i){let{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,jt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function by(e,t,n,i,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),_h(e,n,r,i),o.closePath(),o.stroke(),o.restore())}function xy(e,t,n){return Fe(e,{label:n,index:t,type:"pointLabel"})}function nh(e,t){return e-t}function ih(e,t){if(X(t))return null;let n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),gt(r)||(r=typeof i=="string"?n.parse(r,i):n.parse(r)),r===null?null:(s&&(r=s==="week"&&(Xn(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,s)),+r)}function sh(e,t,n,i){let s=Gt.length;for(let o=Gt.indexOf(e);o<s-1;++o){let r=_r[Gt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=i)return Gt[o]}return Gt[s-1]}function yy(e,t,n,i,s){for(let o=Gt.length-1;o>=Gt.indexOf(n);o--){let r=Gt[o];if(_r[r].common&&e._adapter.diff(s,i,r)>=t-1)return r}return Gt[n?Gt.indexOf(n):0]}function vy(e){for(let t=Gt.indexOf(e)+1,n=Gt.length;t<n;++t)if(_r[Gt[t]].common)return Gt[t]}function oh(e,t,n){if(!n)e[t]=!0;else if(n.length){let{lo:i,hi:s}=vs(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function wy(e,t,n,i){let s=e._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=n[a],l>=0&&(t[l].major=!0);return t}function rh(e,t,n){let i=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!n?i:wy(e,i,s,n)}function pr(e,t,n){let i=0,s=e.length-1,o,r,a,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=rn(e,"pos",t)),{pos:o,time:a}=e[i],{pos:r,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=rn(e,"time",t)),{time:o,pos:a}=e[i],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var Nl,ln,yf,bx,Ll,xr,Al,Sf,Cx,Qn,ti,zl,Px,Ix,lh,Pn,yr,Vl,mr,Wx,Pf,uh,zs,Df,Fl,We,r0,Af,Rf,ni,Ci,Hl,Be,Bl,zf,ph,Os,$l,M0,C0,P0,br,Wf,fe,H0,Cn,ei,Uf,W0,wr,yh,Ns,vh,Ls,wh,ty,ny,Pi,Ri,Di,Vs,Jn,hr,Ti,_r,Gt,Ai,gr,kh=M(()=>{Cl();Nl=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){let o=n.listeners[s],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(i-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ko.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;let o=i.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){let n=this._charts,i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){let n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){let n=this._charts.get(t);if(!n||!n.items.length)return;let i=n.items,s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},ln=new Nl,yf="transparent",bx={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let i=Jo(e||yf),s=i.valid&&Jo(t||yf);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Ll=class{constructor(t,n,i,s){let o=n[i];s=Mi([t.to,s,o,t.from]);let r=Mi([t.from,o,s]);this._active=!0,this._fn=t.fn||bx[t.type||typeof r],this._easing=Un[t.easing]||Un.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);let s=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Mi([t.to,n,s,t.from]),this._from=Mi([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let n=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||n<i),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){let n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}},xr=class{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Y(t))return;let n=Object.keys(rt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!Y(o))return;let r={};for(let a of n)r[a]=o[a];(it(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,n){let i=n.options,s=yx(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&xx(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}let u=n[c],d=o[c],f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}o[c]=d=new Ll(f,t,c,u),s.push(d)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}let i=this._createAnimations(t,n);if(i.length)return ln.add(this._chart,i),!0}};Al=e=>e==="reset"||e==="none",Sf=(e,t)=>t?e:Object.assign({},e),Cx=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:ah(n,!0),values:null},Qn=class{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Pl(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ps(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(d,f,p,b)=>d==="x"?f:d==="r"?b:p,o=n.xAxisID=$(i.xAxisID,Dl(t,"x")),r=n.yAxisID=$(i.yAxisID,Dl(t,"y")),a=n.rAxisID=$(i.rAxisID,Dl(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,r,a),u=n.vAxisID=s(l,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Yo(this._data,this),t._stacked&&Ps(t)}_dataCheck(){let t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(Y(n)){let s=this._cachedMeta;this._data=_x(n,s)}else if(i!==n){if(i){Yo(i,this);let s=this._cachedMeta;Ps(s),s._parsed=[]}n&&Object.isExtensible(n)&&rl(n,this),this._syncList=[],this._data=n}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let n=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=n._stacked;n._stacked=Pl(n.vScale,n),n.stack!==i.stack&&(s=!0,Ps(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(kf(this,n._parsed),n._stacked=Pl(n.vScale,n))}configure(){let t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{it(s[t])?f=this.parseArrayData(i,s,t,n):Y(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);let p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)i._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);i._sorted=l}r&&kf(this,f)}parsePrimitiveData(t,n,i,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),u=o===r,d=new Array(s),f,p,b;for(f=0,p=s;f<p;++f)b=f+i,d[f]={[a]:u||o.parse(c[b],b),[l]:r.parse(n[b],b)};return d}parseArrayData(t,n,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=n[u],a[l]={x:o.parse(d[0],u),y:r.parse(d[1],u)};return a}parseObjectData(t,n,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),u,d,f,p;for(u=0,d=s;u<d;++u)f=u+i,p=n[f],c[u]={x:o.parse(ki(p,a),f),y:r.parse(ki(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){let s=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:ah(s,!0),values:n._stacks[t.axis]._visualValues};return wf(a,r,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){let o=i[n.axis],r=o===null?NaN:o,a=s&&i._stacks[n.axis];s&&a&&(s.values=a,r=wf(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Cx(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Sx(a),f,p;function b(){p=s[f];let x=p[a.axis];return!gt(p[t.axis])||u>x||d<x}for(f=0;f<r&&!(!b()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!b()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){let n=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=n.length;s<o;++s)r=n[s][t.axis],gt(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let n=this._cachedMeta;this.update(t||"default"),n._clip=wx($(this.options.clip,vx(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,u;for(i.dataset&&i.dataset.draw(t,o,a,l),u=a;u<a+l;++u){let d=s[u];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){let i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=Tx(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Mx(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){let s=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],l=this.enableOptionSharing&&Si(i);if(a)return Sf(a,l);let c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[\`\${t}Hover\`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(rt.elements[t]),b=()=>this.getContext(i,s,n),x=c.resolveNamedOptions(f,p,b,d);return x.$shared&&(x.$shared=l,o[r]=Object.freeze(Sf(x,l))),x}_resolveAnimations(t,n,i){let s=this.chart,o=this._cachedDataOpts,r=\`animation-\${n}\`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,n))}let c=new xr(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Al(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){let i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:r}}updateElement(t,n,i,s){Al(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!Al(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;let o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let n=this._data,i=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=i.length,o=n.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){let s=this._cachedMeta,o=s.data,r=t+n,a,l=c=>{for(c.length+=n,a=c.length-1;a>=r;a--)c[a]=c[a-n]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,n);i._stacked&&Ps(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[n,i,s]=t;this[n](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};F(Qn,"defaults",{}),F(Qn,"datasetElementType",null),F(Qn,"dataElementType",null);ti=class extends Qn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,r=this.chart._animationsDisabled,{start:a,count:l}=ul(n,s,r);this._drawStart=a,this._drawCount=l,dl(n)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,n,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,s),f=r.axis,p=a.axis,{spanGaps:b,segment:x}=this.options,y=Xn(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none",_=n+i,S=t.length,E=n>0&&this.getParsed(n-1);for(let T=0;T<S;++T){let R=t[T],O=w?R:{};if(T<n||T>=_){O.skip=!0;continue}let P=this.getParsed(T),N=X(P[p]),W=O[f]=r.getPixelForValue(P[f],T),H=O[p]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[p],T);O.skip=isNaN(W)||isNaN(H)||N,O.stop=T>0&&Math.abs(P[f]-E[f])>y,x&&(O.parsed=P,O.raw=c.data[T]),d&&(O.options=u||this.resolveDataElementOptions(T,R.active?"active":s)),w||this.updateElement(R,T,O,s),E=P}}getMaxOverflow(){let t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};F(ti,"id","line"),F(ti,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),F(ti,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});zl=class e{constructor(t){F(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return Zn()}parse(){return Zn()}format(){return Zn()}add(){return Zn()}diff(){return Zn()}startOf(){return Zn()}endOf(){return Zn()}},Px={_date:zl};Ix={evaluateInteractionItems:Fs,modes:{index(e,t,n,i){let s=ie(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Rl(e,s,o,i,r):Ol(e,s,o,!1,i,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){let s=ie(t,e),o=n.axis||"xy",r=n.includeInvisible||!1,a=n.intersect?Rl(e,s,o,i,r):Ol(e,s,o,!1,i,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,i){let s=ie(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Rl(e,s,o,i,r)},nearest(e,t,n,i){let s=ie(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Ol(e,s,o,n.intersect,i,r)},x(e,t,n,i){let s=ie(t,e);return Ef(e,s,"x",n.intersect,i)},y(e,t,n,i){let s=ie(t,e);return Ef(e,s,"y",n.intersect,i)}}},lh=["left","top","right","bottom"];Pn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){let n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;let s=St(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(n-s.height,0),a=Vx(e.boxes),l=a.vertical,c=a.horizontal;U(e.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});let u=l.reduce((x,y)=>y.box.options&&y.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),f=Object.assign({},s);ch(f,St(i));let p=Object.assign({maxPadding:f,w:o,h:r,x:s.left,y:s.top},s),b=zx(l.concat(c),d);Is(a.fullSize,p,d,b),Is(l,p,d,b),Is(c,p,d,b)&&Is(l,p,d,b),Hx(p),Cf(a.leftAndTop,p,d,b),p.x+=p.w,p.y+=p.h,Cf(a.rightAndBottom,p,d,b),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},U(a.chartArea,x=>{let y=x.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},yr=class{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}},Vl=class extends yr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},mr="$chartjs",Wx={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pf=e=>e===null||e==="";uh=wl?{passive:!0}:!1;zs=new Map,Df=0;Fl=class extends yr{acquireContext(t,n){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(jx(t,n),i):null}releaseContext(t){let n=t.canvas;if(!n[mr])return!1;let i=n[mr].initial;["height","width"].forEach(o=>{let r=i[o];X(r)?n.removeAttribute(o):n.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[mr],!0}addEventListener(t,n,i){this.removeEventListener(t,n);let s=t.$proxies||(t.$proxies={}),r={attach:Yx,detach:Kx,resize:Zx}[n]||Jx;s[n]=r(t,n,i)}removeEventListener(t,n){let i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:Il,detach:Il,resize:Il}[n]||Ux)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return vl(t,n,i,s)}isAttached(t){let n=t&&Cs(t);return!!(n&&n.isConnected)}};We=class{constructor(){F(this,"x");F(this,"y");F(this,"active",!1);F(this,"options");F(this,"$animations")}tooltipPosition(t){let{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Xn(this.x)&&Xn(this.y)}getProps(t,n){let i=this.$animations;if(!n||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};F(We,"defaults",{}),F(We,"defaultRoutes");r0=e=>e==="left"?"right":e==="right"?"left":e,Af=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Rf=(e,t)=>Math.min(t||e,e);ni=class e extends We{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=Nt(t,Number.POSITIVE_INFINITY),n=Nt(n,Number.NEGATIVE_INFINITY),i=Nt(i,Number.POSITIVE_INFINITY),s=Nt(s,Number.NEGATIVE_INFINITY),{min:Nt(t,i),max:Nt(n,s),minDefined:gt(t),maxDefined:gt(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:n,max:i};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,r.min)),o||(i=Math.max(i,r.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:Nt(n,Nt(i,n)),max:Nt(i,Nt(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(t,n,i){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ml(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Of(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=t0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let n=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=z(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,n=t.ticks,i=Rf(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation,r=s,a,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=$t(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:p/(i-1),d+6>a&&(a=p/(i-(t.offset?.5:1)),l=this.maxHeight-Rs(t.grid)-n.padding-If(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=ys(Math.min(Math.asin($t((u.highest.height+6)/a,-1,1)),Math.asin($t(l/c,-1,1))-Math.asin($t(f/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=If(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Rs(o)+l):(t.height=this.maxHeight,t.width=Rs(o)+l),i.display&&this.ticks.length){let{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=i.padding*2,b=Ve(this.labelRotation),x=Math.cos(b),y=Math.sin(b);if(a){let w=i.mirror?0:y*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{let w=i.mirror?0:x*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,u,y,x)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),f=0,p=0;l?c?(f=s*t.width,p=i*n.height):(f=i*t.height,p=s*n.width):o==="start"?p=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+r)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;o==="start"?(u=0,d=t.height):o==="end"&&(u=n.height,d=0),this.paddingTop=u+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){z(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)X(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let n=this.options.ticks.sampleSize,i=this.ticks;n<i.length&&(i=Of(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(n/Rf(n,i)),c=0,u=0,d,f,p,b,x,y,w,_,S,E,T;for(d=0;d<n;d+=l){if(b=t[d].label,x=this._resolveTickFontOptions(d),s.font=y=x.string,w=o[y]=o[y]||{data:{},gc:[]},_=x.lineHeight,S=E=0,!X(b)&&!it(b))S=vi(s,w.data,w.gc,S,b),E=_;else if(it(b))for(f=0,p=b.length;f<p;++f)T=b[f],!X(T)&&!it(T)&&(S=vi(s,w.data,w.gc,S,T),E+=_);r.push(S),a.push(E),c=Math.max(S,c),u=Math.max(E,u)}l0(o,n);let R=r.indexOf(c),O=a.indexOf(u),P=N=>({width:r[N]||0,height:a[N]||0});return{first:P(0),last:P(n-1),widest:P(R),highest:P(O),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let n=this._startPixel+t*this._length;return il(this._alignToPixels?an(this.chart,n,0):n)}getDecimalForPixel(t){let n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){let n=this.ticks||[];if(t>=0&&t<n.length){let i=n[t];return i.$context||(i.$context=u0(this.getContext(),t,i))}return this.$context||(this.$context=c0(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,n=Ve(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let n=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Rs(o),p=[],b=a.setContext(this.getContext()),x=b.display?b.width:0,y=x/2,w=function(nt){return an(i,nt,x)},_,S,E,T,R,O,P,N,W,H,B,st;if(r==="top")_=w(this.bottom),O=this.bottom-f,N=_-y,H=w(t.top)+y,st=t.bottom;else if(r==="bottom")_=w(this.top),H=t.top,st=w(t.bottom)-y,O=_+y,N=this.top+f;else if(r==="left")_=w(this.right),R=this.right-f,P=_-y,W=w(t.left)+y,B=t.right;else if(r==="right")_=w(this.left),W=t.left,B=w(t.right)-y,R=_+y,P=this.left+f;else if(n==="x"){if(r==="center")_=w((t.top+t.bottom)/2+.5);else if(Y(r)){let nt=Object.keys(r)[0],vt=r[nt];_=w(this.chart.scales[nt].getPixelForValue(vt))}H=t.top,st=t.bottom,O=_+y,N=O+f}else if(n==="y"){if(r==="center")_=w((t.left+t.right)/2);else if(Y(r)){let nt=Object.keys(r)[0],vt=r[nt];_=w(this.chart.scales[nt].getPixelForValue(vt))}R=_-y,P=R-f,W=t.left,B=t.right}let Mt=$(s.ticks.maxTicksLimit,d),tt=Math.max(1,Math.ceil(d/Mt));for(S=0;S<d;S+=tt){let nt=this.getContext(S),vt=o.setContext(nt),Ee=a.setContext(nt),$e=vt.lineWidth,ge=vt.color,Vt=Ee.dash||[],me=Ee.dashOffset,Xt=vt.tickWidth,qt=vt.tickColor,Zt=vt.tickBorderDash||[],et=vt.tickBorderDashOffset;E=a0(this,S,l),E!==void 0&&(T=an(i,E,$e),c?R=P=W=B=T:O=N=H=st=T,p.push({tx1:R,ty1:O,tx2:P,ty2:N,x1:W,y1:H,x2:B,y2:st,width:$e,color:ge,borderDash:Vt,borderDashOffset:me,tickWidth:Xt,tickColor:qt,tickBorderDash:Zt,tickBorderDashOffset:et}))}return this._ticksLength=d,this._borderValue=_,p}_computeLabelItems(t){let n=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=o,f=Rs(i.grid),p=f+u,b=d?-u:p,x=-Ve(this.labelRotation),y=[],w,_,S,E,T,R,O,P,N,W,H,B,st="middle";if(s==="top")R=this.bottom-b,O=this._getXAxisLabelAlignment();else if(s==="bottom")R=this.top+b,O=this._getXAxisLabelAlignment();else if(s==="left"){let tt=this._getYAxisLabelAlignment(f);O=tt.textAlign,T=tt.x}else if(s==="right"){let tt=this._getYAxisLabelAlignment(f);O=tt.textAlign,T=tt.x}else if(n==="x"){if(s==="center")R=(t.top+t.bottom)/2+p;else if(Y(s)){let tt=Object.keys(s)[0],nt=s[tt];R=this.chart.scales[tt].getPixelForValue(nt)+p}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")T=(t.left+t.right)/2-p;else if(Y(s)){let tt=Object.keys(s)[0],nt=s[tt];T=this.chart.scales[tt].getPixelForValue(nt)}O=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?st="top":l==="end"&&(st="bottom"));let Mt=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){S=a[w],E=S.label;let tt=o.setContext(this.getContext(w));P=this.getPixelForTick(w)+o.labelOffset,N=this._resolveTickFontOptions(w),W=N.lineHeight,H=it(E)?E.length:1;let nt=H/2,vt=tt.color,Ee=tt.textStrokeColor,$e=tt.textStrokeWidth,ge=O;r?(T=P,O==="inner"&&(w===_-1?ge=this.options.reverse?"left":"right":w===0?ge=this.options.reverse?"right":"left":ge="center"),s==="top"?c==="near"||x!==0?B=-H*W+W/2:c==="center"?B=-Mt.highest.height/2-nt*W+W:B=-Mt.highest.height+W/2:c==="near"||x!==0?B=W/2:c==="center"?B=Mt.highest.height/2-nt*W:B=Mt.highest.height-H*W,d&&(B*=-1),x!==0&&!tt.showLabelBackdrop&&(T+=W/2*Math.sin(x))):(R=P,B=(1-H)*W/2);let Vt;if(tt.showLabelBackdrop){let me=St(tt.backdropPadding),Xt=Mt.heights[w],qt=Mt.widths[w],Zt=B-me.top,et=0-me.left;switch(st){case"middle":Zt-=Xt/2;break;case"bottom":Zt-=Xt;break}switch(O){case"center":et-=qt/2;break;case"right":et-=qt;break;case"inner":w===_-1?et-=qt:w>0&&(et-=qt/2);break}Vt={left:et,top:Zt,width:qt+me.width,height:Xt+me.height,color:tt.backdropColor}}y.push({label:E,font:N,textOffset:B,options:{rotation:x,color:vt,strokeColor:Ee,strokeWidth:$e,textAlign:ge,textBaseline:st,translation:[T,R],backdrop:Vt}})}return y}_getXAxisLabelAlignment(){let{position:t,ticks:n}=this.options;if(-Ve(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,u;return n==="left"?s?(u=this.right+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?s?(u=this.left+o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){let n=this.options.grid;if(!this._isVisible()||!n.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,r=s.length;o<r;++o){let l=s[o];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,u,d,f;this.isHorizontal()?(c=an(t,this.left,r)-r/2,u=an(t,this.right,a)+a/2,d=f=l):(d=an(t,this.top,r)-r/2,f=an(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&Ss(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,u=r.textOffset;En(i,c,0,u,l,a)}s&&Es(i)}drawTitle(){let{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;let o=bt(i.font),r=St(i.padding),a=i.align,l=o.lineHeight/2;n==="bottom"||n==="center"||Y(n)?(l+=r.bottom,it(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;let{titleX:c,titleY:u,maxWidth:d,rotation:f}=f0(this,l,n,a);En(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:f,textAlign:d0(a,n,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,n=t.ticks&&t.ticks.z||0,i=$(t.grid&&t.grid.z,-1),s=$(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=n.length;o<r;++o){let a=n[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let n=this.options.ticks.setContext(this.getContext(t));return bt(n.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Ci=class{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let n=Object.getPrototypeOf(t),i;g0(n)&&(i=this.register(n));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,h0(t,r,i),this.override&&rt.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in rt[s]&&(delete rt[s][i],this.override&&delete Sn[i])}};Hl=class{constructor(){this.controllers=new Ci(Qn,"datasets",!0),this.elements=new Ci(We,"elements"),this.plugins=new Ci(Object,"plugins"),this.scales=new Ci(ni,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):U(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,i){let s=xs(t);z(i["before"+s],[],i),n[t](i),z(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){let i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){let s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},Be=new Hl,Bl=class{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],l=[n,s,o.options];if(z(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){X(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){let i=t&&t.config,s=$(i.options&&i.options.plugins,{}),o=m0(i);return s===!1&&!n?[]:x0(t,o,s,n)}_notifyStateChanges(t){let n=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}};zf=new Map,ph=new Set;Os=(e,t,n)=>{let i=ki(t,n);i!==void 0&&e.add(i)},$l=class{constructor(t){this._config=E0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=hh(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),fh(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return dr(t,()=>[[\`datasets.\${t}\`,""]])}datasetAnimationScopeKeys(t,n){return dr(\`\${t}.transition.\${n}\`,()=>[[\`datasets.\${t}.transitions.\${n}\`,\`transitions.\${n}\`],[\`datasets.\${t}\`,""]])}datasetElementScopeKeys(t,n){return dr(\`\${t}-\${n}\`,()=>[[\`datasets.\${t}.elements.\${n}\`,\`datasets.\${t}\`,\`elements.\${n}\`,""]])}pluginScopeKeys(t){let n=t.id,i=this.type;return dr(\`\${i}-plugin-\${n}\`,()=>[[\`plugins.\${n}\`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){let i=this._scopeCache,s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(n);if(a)return a;let l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Os(l,t,d))),u.forEach(d=>Os(l,s,d)),u.forEach(d=>Os(l,Sn[o]||{},d)),u.forEach(d=>Os(l,rt,d)),u.forEach(d=>Os(l,Qo,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),ph.has(n)&&r.set(n,c),c}chartOptionScopes(){let{options:t,type:n}=this;return[t,Sn[n]||{},rt.datasets[n]||{},{type:n},rt,Qo]}resolveNamedOptions(t,n,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Vf(this._resolverCache,t,s),l=r;if(T0(r,n)){o.$shared=!1,i=Ne(i)?i():i;let c=this.createResolver(t,i,a);l=kn(r,i,c)}for(let c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){let{resolver:o}=Vf(this._resolverCache,t,i);return Y(n)?kn(o,n,void 0,s):o}};M0=e=>Y(e)&&Object.getOwnPropertyNames(e).some(t=>Ne(e[t]));C0="4.5.1",P0=["top","bottom","left","right","chartArea"];br={},Wf=e=>{let t=gh(e);return Object.values(br).filter(n=>n.canvas===t).pop()};fe=class{static register(...t){Be.add(...t),jf()}static unregister(...t){Be.remove(...t),jf()}constructor(t,n){let i=this.config=new $l(n),s=gh(t),o=Wf(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Qx(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Za(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Bl,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ll(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],br[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ln.listen(this,"complete",Bf),ln.listen(this,"progress",D0),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return X(t)?n&&o?o:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Be}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():or(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return tr(this.canvas,this.ctx),this}stop(){return ln.stop(this),this}resize(t,n){ln.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){let i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,n,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,or(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let n=this.options.scales||{};U(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];n&&(o=o.concat(Object.keys(n).map(r=>{let a=n[r],l=jl(r,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),U(o,r=>{let a=r.options,l=a.id,c=jl(l,a),u=$(a.type,r.dtype);(a.position===void 0||Ff(a.position,c)!==Ff(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{let f=Be.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),U(s,(r,a)=>{r||delete i[a]}),U(i,r=>{Pn.configure(this,r,r.options),Pn.addBox(this,r)})}_updateMetasets(){let t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Hf("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],n=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){let o=n[i],r=this.getDatasetMeta(i),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Wl(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{let l=Be.getController(a),{datasetElementType:c,dataElementType:u}=rt.datasets[a];Object.assign(l,{dataElementType:Be.getElement(u),datasetElementType:c&&Be.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){U(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let n=this.config;n.update();let i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,u=this.data.datasets.length;c<u;c++){let{controller:d}=this.getDatasetMeta(c),f=!s&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||U(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Hf("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){U(this.scales,t=>{Pn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Wo(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of n){let r=i==="_removeElements"?-o:o;A0(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let n=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!Wo(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Pn.update(this,this.width,this.height,t);let n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],U(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Ne(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){let i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ln.has(this)?this.attached&&!ln.running(this)&&ln.start(this):(this.draw(),Bf({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let n=this._sortedMetasets,i=[],s,o;for(s=0,o=n.length;s<o;++s){let r=n[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Tl(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&Ss(n,s),t.controller.draw(),s&&Es(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ne(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){let o=Ix.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let n=this.data.datasets[t],i=this._metasets,s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Fe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let n=this.data.datasets[t];if(!n)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){let i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Si(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){let n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),ln.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),tr(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete br[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,n=this.platform,i=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};U(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){U(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},U(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){let s=i?"set":"remove",o,r,a,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let n=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!_i(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){let s=this.options.hover,o=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),r=o(n,t),a=i?t:o(t,n);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){let i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;let o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){let{_active:s=[],options:o}=this,r=n,a=this._getActiveElements(t,s,i,r),l=Qa(t),c=R0(t,this._lastEvent,i,l);i&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));let u=!_i(a,s);return(u||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};F(fe,"defaults",rt),F(fe,"instances",br),F(fe,"overrides",Sn),F(fe,"registry",Be),F(fe,"version",C0),F(fe,"getChart",Wf);H0=typeof Path2D=="function";Cn=class extends We{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;yl(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ml(this,this.options.segment))}first(){let t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){let t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){let i=this.options,s=t[n],o=this.points,r=El(this,{property:n,start:s,end:s});if(!r.length)return;let a=[],l=z0(i),c,u;for(c=0,u=r.length;c<u;++c){let{start:d,end:f}=r[c],p=o[d],b=o[f];if(p===b){a.push(p);continue}let x=Math.abs((s-p[n])/(b[n]-p[n])),y=l(p,b,x,i.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,i){return Ul(this)(t,this,n,i)}path(t,n,i){let s=this.segments,o=Ul(this),r=this._loop;n=n||0,i=i||this.points.length-n;for(let a of s)r&=o(t,this,a,{start:n,end:n+i-1});return!!r}draw(t,n,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),B0(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};F(Cn,"id","line"),F(Cn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),F(Cn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),F(Cn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});ei=class extends We{constructor(n){super();F(this,"parsed");F(this,"skip");F(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(n-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,i){return $f(this,n,"x",i)}inYRange(n,i){return $f(this,n,"y",i)}getCenterPoint(n){let{x:i,y:s}=this.getProps(["x","y"],n);return{x:i,y:s}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);let s=i&&n.borderWidth||0;return(i+s)*2}draw(n,i){let s=this.options;this.skip||s.radius<.1||!ne(this,i,this.size(s)/2)||(n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.fillStyle=s.backgroundColor,ks(n,s,this.x,this.y))}getRange(){let n=this.options||{};return n.radius+n.hitRadius}};F(ei,"id","point"),F(ei,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),F(ei,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Uf=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},W0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,wr=class extends We{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},n=z(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){let{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}let i=t.labels,s=bt(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Uf(i,o),c,u;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(r,o,a,l)+10):(u=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a,d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((b,x)=>{let y=i+n/2+o.measureText(b.text).width;(x===0||c[c.length-1]+y+2*a>r)&&(d+=u,c[c.length-(x>0?0:1)]=0,p+=u,f++),l[x]={left:0,top:p,row:f,width:y,height:s},c[c.length-1]+=y+a}),d}_fitCols(t,n,i,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=r-t,d=a,f=0,p=0,b=0,x=0;return this.legendItems.forEach((y,w)=>{let{itemWidth:_,itemHeight:S}=j0(i,n,o,y,s);w>0&&p+S+2*a>u&&(d+=f+a,c.push({width:f,height:p}),b+=f+a,x++,f=p=0),l[w]={left:b,top:p,col:x,width:_,height:S},f=Math.max(f,_),p+=S+a}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,r=Tn(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Lt(i,this.left+s,this.right-this.lineWidths[a]);for(let c of n)a!==c.row&&(a=c.row,l=Lt(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=Lt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of n)c.col!==a&&(a=c.col,l=Lt(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;Ss(t,this),this._draw(),Es(t)}}_draw(){let{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=rt.color,l=Tn(t.rtl,this.left,this.width),c=bt(r.font),{padding:u}=r,d=c.size,f=d/2,p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:b,boxHeight:x,itemHeight:y}=Uf(r,d),w=function(R,O,P){if(isNaN(b)||b<=0||isNaN(x)||x<0)return;s.save();let N=$(P.lineWidth,1);if(s.fillStyle=$(P.fillStyle,a),s.lineCap=$(P.lineCap,"butt"),s.lineDashOffset=$(P.lineDashOffset,0),s.lineJoin=$(P.lineJoin,"miter"),s.lineWidth=N,s.strokeStyle=$(P.strokeStyle,a),s.setLineDash($(P.lineDash,[])),r.usePointStyle){let W={radius:x*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:N},H=l.xPlus(R,b/2),B=O+f;er(s,W,H,B,r.pointStyleWidth&&b)}else{let W=O+Math.max((d-x)/2,0),H=l.leftForLtr(R,b),B=Mn(P.borderRadius);s.beginPath(),Object.values(B).some(st=>st!==0)?Ei(s,{x:H,y:W,w:b,h:x,radius:B}):s.rect(H,W,b,x),s.fill(),N!==0&&s.stroke()}s.restore()},_=function(R,O,P){En(s,P.text,R,O+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},S=this.isHorizontal(),E=this._computeTitleHeight();S?p={x:Lt(o,this.left+u,this.right-i[0]),y:this.top+u+E,line:0}:p={x:this.left+u,y:Lt(o,this.top+E+u,this.bottom-n[0].height),line:0},ar(this.ctx,t.textDirection);let T=y+u;this.legendItems.forEach((R,O)=>{s.strokeStyle=R.fontColor,s.fillStyle=R.fontColor;let P=s.measureText(R.text).width,N=l.textAlign(R.textAlign||(R.textAlign=r.textAlign)),W=b+f+P,H=p.x,B=p.y;l.setWidth(this.width),S?O>0&&H+W+u>this.right&&(B=p.y+=T,p.line++,H=p.x=Lt(o,this.left+u,this.right-i[p.line])):O>0&&B+T>this.bottom&&(H=p.x=H+n[p.line].width+u,p.line++,B=p.y=Lt(o,this.top+E+u,this.bottom-n[p.line].height));let st=l.x(H);if(w(st,B,R),H=cl(N,H+b+f,S?H+W:this.right,t.rtl),_(l.x(H),B,R),S)p.x+=W+u;else if(typeof R.text!="string"){let Mt=c.lineHeight;p.y+=xh(R,Mt)+u}else p.y+=T}),lr(this.ctx,t.textDirection)}drawTitle(){let t=this.options,n=t.title,i=bt(n.font),s=St(n.padding);if(!n.display)return;let o=Tn(t.rtl,this.left,this.width),r=this.ctx,a=n.position,l=i.size/2,c=s.top+l,u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Lt(t.align,d,this.right-f);else{let b=this.columnSizes.reduce((x,y)=>Math.max(x,y.height),0);u=c+Lt(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}let p=Lt(a,d,d+f);r.textAlign=o.textAlign(qo(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=i.string,En(r,n.text,p,u,i)}_computeTitleHeight(){let t=this.options.title,n=bt(t.font),i=St(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(qn(t,this.left,this.right)&&qn(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],qn(t,s.left,s.left+s.width)&&qn(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){let n=this.options;if(!G0(t.type,n))return;let i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=W0(s,i);s&&!o&&z(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&z(n.onHover,[t,i,this],this)}else i&&z(n.onClick,[t,i,this],this)}};yh={id:"legend",_element:wr,start(e,t,n){let i=e.legend=new wr({ctx:e.ctx,options:n,chart:e});Pn.configure(e,i,n),Pn.addBox(e,i)},stop(e){Pn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let i=e.legend;Pn.configure(e,i,n),i.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(n?0:void 0),u=St(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},Ns={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),u=bs(t,c);u<s&&(s=u,a=l)}}if(a){let l=a.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};vh={beforeTitle:_e,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:_e,beforeBody:_e,beforeLabel:_e,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let n=e.formattedValue;return X(n)||(t+=n),t},labelColor(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:_e,afterBody:_e,beforeFooter:_e,footer:_e,afterFooter:_e};Ls=class extends We{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new xr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Q0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){let{callbacks:i}=n,s=Ut(i,"beforeTitle",this,t),o=Ut(i,"title",this,t),r=Ut(i,"afterTitle",this,t),a=[];return a=He(a,cn(s)),a=He(a,cn(o)),a=He(a,cn(r)),a}getBeforeBody(t,n){return Xf(Ut(n.callbacks,"beforeBody",this,t))}getBody(t,n){let{callbacks:i}=n,s=[];return U(t,o=>{let r={before:[],lines:[],after:[]},a=qf(i,o);He(r.before,cn(Ut(a,"beforeLabel",this,o))),He(r.lines,Ut(a,"label",this,o)),He(r.after,cn(Ut(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,n){return Xf(Ut(n.callbacks,"afterBody",this,t))}getFooter(t,n){let{callbacks:i}=n,s=Ut(i,"beforeFooter",this,t),o=Ut(i,"footer",this,t),r=Ut(i,"afterFooter",this,t),a=[];return a=He(a,cn(s)),a=He(a,cn(o)),a=He(a,cn(r)),a}_createItems(t){let n=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(Y0(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),U(a,u=>{let d=qf(t.callbacks,u);s.push(Ut(d,"labelColor",this,u)),o.push(Ut(d,"labelPointStyle",this,u)),r.push(Ut(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=Ns[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);let l=this._size=Gf(this,i),c=Object.assign({},a,l),u=Yf(this.chart,i,c),d=Kf(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){let o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Mn(a),{x:f,y:p}=t,{width:b,height:x}=n,y,w,_,S,E,T;return o==="center"?(E=p+x/2,s==="left"?(y=f,w=y-r,S=E+r,T=E-r):(y=f+b,w=y+r,S=E-r,T=E+r),_=y):(s==="left"?w=f+Math.max(l,u)+r:s==="right"?w=f+b-Math.max(c,d)-r:w=this.caretX,o==="top"?(S=p,E=S-r,y=w-r,_=w+r):(S=p+x,E=S+r,y=w+r,_=w-r),T=S),{x1:y,x2:w,x3:_,y1:S,y2:E,y3:T}}drawTitle(t,n,i){let s=this.title,o=s.length,r,a,l;if(o){let c=Tn(i.rtl,this.x,this.width);for(t.x=fr(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",r=bt(i.titleFont),a=i.titleSpacing,n.fillStyle=i.titleColor,n.font=r.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,n,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,u=bt(o.bodyFont),d=fr(this,"left",o),f=s.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,b=n.y+p;if(o.usePointStyle){let x={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,w=b+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ks(t,x,y,w),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ks(t,x,y,w)}else{t.lineWidth=Y(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let x=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),w=Mn(r.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ei(t,{x,y:b,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Ei(t,{x:y,y:b+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(x,b,c,l),t.strokeRect(x,b,c,l),t.fillStyle=r.backgroundColor,t.fillRect(y,b+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=bt(i.bodyFont),f=d.lineHeight,p=0,b=Tn(i.rtl,this.x,this.width),x=function(P){n.fillText(P,b.x(t.x+p),t.y+f/2),t.y+=f+o},y=b.textAlign(r),w,_,S,E,T,R,O;for(n.textAlign=r,n.textBaseline="middle",n.font=d.string,t.x=fr(this,y,i),n.fillStyle=i.bodyColor,U(this.beforeBody,x),p=a&&y!=="right"?r==="center"?c/2+u:c+2+u:0,E=0,R=s.length;E<R;++E){for(w=s[E],_=this.labelTextColors[E],n.fillStyle=_,U(w.before,x),S=w.lines,a&&S.length&&(this._drawColorBox(n,t,E,b,i),f=Math.max(d.lineHeight,l)),T=0,O=S.length;T<O;++T)x(S[T]),f=d.lineHeight;U(w.after,x)}p=0,f=d.lineHeight,U(this.afterBody,x),t.y-=o}drawFooter(t,n,i){let s=this.footer,o=s.length,r,a;if(o){let l=Tn(i.rtl,this.x,this.width);for(t.x=fr(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",r=bt(i.footerFont),n.fillStyle=i.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:b}=Mn(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+d,l),r==="top"&&this.drawCaret(t,n,i,s),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(a+c,l+u-b),n.quadraticCurveTo(a+c,l+u,a+c-b,l+u),r==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),r==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){let n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=Ns[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=Gf(this,t),l=Object.assign({},r,this._size),c=Yf(n,t,l),u=Kf(t,l,c,n);(s._to!==u.x||o._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){let n=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(n);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let r=St(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),ar(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),lr(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){let i=this._active,s=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!_i(i,s),r=this._positionChanged(s,n);(o||r)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,i),a=this._positionChanged(r,t),l=n||!_i(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,n){let{caretX:i,caretY:s,options:o}=this,r=Ns[o.position].call(this,t,n);return r!==!1&&(i!==r.x||s!==r.y)}};F(Ls,"positioners",Ns);wh={id:"tooltip",_element:Ls,positioners:Ns,afterInit(e,t,n){n&&(e.tooltip=new Ls({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:vh},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},ty=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);ny=(e,t)=>e===null?null:$t(Math.round(e),0,t);Pi=class extends ni{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let n=this._addedLabels;if(n.length){let i=this.getLabels();for(let{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(X(t))return null;let i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:ey(i,t,$(n,t),this._addedLabels),ny(n,i.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){let t=this.min,n=this.max,i=this.options.offset,s=[],o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=n;r++)s.push({value:r});return s}getLabelForValue(t){return Zf.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};F(Pi,"id","category"),F(Pi,"defaults",{ticks:{callback:Zf}});Ri=class extends ni{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=n?s:l,a=l=>o=i?o:l;if(t){let l=we(s),c=we(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:n,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(\`scales.\${this.id}.ticks.stepSize: \${i} would result generating up to \${s} ticks. Limiting to 1000.\`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,n=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=iy(s,o);return t.bounds==="ticks"&&$o(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let t=this.ticks,n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return ws(t,this.chart.options.locale,this.options.ticks.format)}},Di=class extends Ri{determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=gt(t)?t:0,this.max=gt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),n=t?this.width:this.height,i=Ve(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};F(Di,"id","linear"),F(Di,"defaults",{ticks:{callback:_s.formatters.numeric}});Vs=e=>Math.floor(Le(e)),Jn=(e,t)=>Math.pow(10,Vs(e)+t);hr=class extends ni{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){let i=Ri.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return gt(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!0);this.min=gt(t)?Math.max(0,t):null,this.max=gt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!gt(this._userMin)&&(this.min=t===Jn(this.min,0)?Jn(this.min,-1):Jn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:n}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=n?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Jn(i,-1)),r(Jn(s,1)))),i<=0&&o(Jn(s,-1)),s<=0&&r(Jn(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,n={min:this._userMin,max:this._userMax},i=oy(n,this);return t.bounds==="ticks"&&$o(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":ws(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Le(t),this._valueRange=Le(this.max)-Le(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Le(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}};F(hr,"id","logarithmic"),F(hr,"defaults",{ticks:{callback:_s.formatters.logarithmic,major:{enabled:!0}}});Ti=class extends Ri{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=St(Gl(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){let{min:t,max:n}=this.getMinMax(!1);this.min=gt(t)&&!isNaN(t)?t:0,this.max=gt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gl(this.options))}generateTickLabels(t){Ri.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{let s=z(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?ay(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){let n=jt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ee(t*n+Ve(i))}getDistanceFromCenterForValue(t){if(X(t))return NaN;let n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(X(t))return NaN;let n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){let n=this._pointLabels||[];if(t>=0&&t<n.length){let i=n[t];return xy(this.getContext(),t,i)}}getPointPosition(t,n,i=0){let s=this.getIndexAngle(t)-It+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:n}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),_h(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,r=this._pointLabels.length,a,l,c;if(n.pointLabels.display&&my(this,r),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);let f=this.getContext(d),p=s.setContext(f),b=o.setContext(f);by(this,p,l,r,b)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;let c=i.setContext(this.getContext(l)),u=bt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let d=St(c.backdropPadding);t.fillRect(-r/2-d.left,-o-u.size/2-d.top,r+d.width,u.size+d.height)}En(t,a.label,0,-o,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};F(Ti,"id","radialLinear"),F(Ti,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_s.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),F(Ti,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),F(Ti,"descriptors",{angleLines:{_fallback:"grid"}});_r={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Gt=Object.keys(_r);Ai=class extends ni{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){let i=t.time||(t.time={}),s=this._adapter=new Px._date(t.adapters.date);s.init(n),Kn(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:ih(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,n=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=gt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=gt(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){let t=this.options,n=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=ol(s,o,r);return this._unit=n.unit||(i.autoSkip?sh(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):yy(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:vy(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),rh(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;n=$t(n,0,r),i=$t(i,0,r),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){let t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||sh(o.minUnit,n,i,this._getLabelCapacity(n)),a=$(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Xn(l)||l===!0,u={},d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,n,r)>1e5*a)throw new Error(n+" and "+i+" are too far apart with stepSize of "+a+" "+r);let b=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<i;f=+t.add(f,a,r),p++)oh(u,f,b);return(f===i||s.bounds==="ticks"||p===1)&&oh(u,f,b),Object.keys(u).sort(nh).map(x=>+x)}getLabelForValue(t){let n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){let s=this.options.time.displayFormats,o=this._unit,r=n||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,i,s){let o=this.options,r=o.ticks.callback;if(r)return z(r,[t,n,i],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[n],p=c&&d&&f&&f.major;return this._adapter.format(t,s||(p?d:u))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let n=this.options.ticks,i=this.ctx.measureText(t).width,s=Ve(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){let n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,rh(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],n,i;if(t.length)return t;let s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(ih(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return al(t.sort(nh))}};F(Ai,"id","time"),F(Ai,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});gr=class extends Ai{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=pr(n,this.min),this._tableRange=pr(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:n,max:i}=this,s=[],o=[],r,a,l,c,u;for(r=0,a=t.length;r<a;++r)c=t[r],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)u=s[r+1],l=s[r-1],c=s[r],Math.round((u+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,n=this.max,i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(pr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return pr(this._table,i*this._tableRange+this._minPos,!0)}};F(gr,"id","timeseries"),F(gr,"defaults",Ai.defaults)});var Sh=Fg((EE,kr)=>{(function(e,t,n,i){"use strict";var s=["","webkit","Moz","MS","ms","o"],o=t.createElement("div"),r="function",a=Math.round,l=Math.abs,c=Date.now;function u(h,m,v){return setTimeout(_(h,v),m)}function d(h,m,v){return Array.isArray(h)?(f(h,v[m],v),!0):!1}function f(h,m,v){var k;if(h)if(h.forEach)h.forEach(m,v);else if(h.length!==i)for(k=0;k<h.length;)m.call(v,h[k],k,h),k++;else for(k in h)h.hasOwnProperty(k)&&m.call(v,h[k],k,h)}function p(h,m,v){var k="DEPRECATED METHOD: "+m+\`
5419
5421
  \`+v+\` AT
5420
- \`;return function(){var C=new Error("get-stack-trace"),I=C&&C.stack?C.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",U=e.console&&(e.console.warn||e.console.log);return U&&U.call(e.console,k,I),h.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(g){if(g===i||g===null)throw new TypeError("Cannot convert undefined or null to object");for(var v=Object(g),k=1;k<arguments.length;k++){var C=arguments[k];if(C!==i&&C!==null)for(var I in C)C.hasOwnProperty(I)&&(v[I]=C[I])}return v}:b=Object.assign;var x=p(function(g,v,k){for(var C=Object.keys(v),I=0;I<C.length;)(!k||k&&g[C[I]]===i)&&(g[C[I]]=v[C[I]]),I++;return g},"extend","Use \`assign\`."),y=p(function(g,v){return x(g,v,!0)},"merge","Use \`assign\`.");function w(h,g,v){var k=g.prototype,C;C=h.prototype=Object.create(k),C.constructor=h,C._super=k,v&&b(C,v)}function _(h,g){return function(){return h.apply(g,arguments)}}function S(h,g){return typeof h==r?h.apply(g&&g[0]||i,g):h}function T(h,g){return h===i?g:h}function E(h,g,v){f(N(g),function(k){h.addEventListener(k,v,!1)})}function P(h,g,v){f(N(g),function(k){h.removeEventListener(k,v,!1)})}function O(h,g){for(;h;){if(h==g)return!0;h=h.parentNode}return!1}function A(h,g){return h.indexOf(g)>-1}function N(h){return h.trim().split(/\\s+/g)}function j(h,g,v){if(h.indexOf&&!v)return h.indexOf(g);for(var k=0;k<h.length;){if(v&&h[k][v]==g||!v&&h[k]===g)return k;k++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function G(h,g,v){for(var k=[],C=[],I=0;I<h.length;){var U=g?h[I][g]:h[I];j(C,U)<0&&k.push(h[I]),C[I]=U,I++}return v&&(g?k=k.sort(function(yt,Dt){return yt[g]>Dt[g]}):k=k.sort()),k}function ot(h,g){for(var v,k,C=g[0].toUpperCase()+g.slice(1),I=0;I<s.length;){if(v=s[I],k=v?v+C:g,k in h)return k;I++}return i}var Pt=1;function Q(){return Pt++}function tt(h){var g=h.ownerDocument||h;return g.defaultView||g.parentWindow||e}var mt=/mobile|tablet|ip(ad|hone|od)|android/i,ue="ontouchstart"in e,ni=ot(e,"PointerEvent")!==i,rn=ue&&mt.test(navigator.userAgent),ve="touch",an="pen",Ve="mouse",Fe="kinect",Cn=25,nt=1,Pn=2,lt=4,Nt=8,Ks=1,Li=2,zi=4,Vi=8,Fi=16,we=Li|zi,Dn=Vi|Fi,gc=we|Dn,mc=["x","y"],Xs=["clientX","clientY"];function Qt(h,g){var v=this;this.manager=h,this.callback=g,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(k){S(h.options.enable,[h])&&v.handler(k)},this.init()}Qt.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(tt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&P(this.element,this.evEl,this.domHandler),this.evTarget&&P(this.target,this.evTarget,this.domHandler),this.evWin&&P(tt(this.element),this.evWin,this.domHandler)}};function ig(h){var g,v=h.options.inputClass;return v?g=v:ni?g=Rr:rn?g=Js:ue?g=Ir:g=Zs,new g(h,sg)}function sg(h,g,v){var k=v.pointers.length,C=v.changedPointers.length,I=g&nt&&k-C===0,U=g&(lt|Nt)&&k-C===0;v.isFirst=!!I,v.isFinal=!!U,I&&(h.session={}),v.eventType=g,og(h,v),h.emit("hammer.input",v),h.recognize(v),h.session.prevInput=v}function og(h,g){var v=h.session,k=g.pointers,C=k.length;v.firstInput||(v.firstInput=bc(g)),C>1&&!v.firstMultiple?v.firstMultiple=bc(g):C===1&&(v.firstMultiple=!1);var I=v.firstInput,U=v.firstMultiple,bt=U?U.center:I.center,yt=g.center=xc(k);g.timeStamp=c(),g.deltaTime=g.timeStamp-I.timeStamp,g.angle=Or(bt,yt),g.distance=qs(bt,yt),rg(v,g),g.offsetDirection=vc(g.deltaX,g.deltaY);var Dt=yc(g.deltaTime,g.deltaX,g.deltaY);g.overallVelocityX=Dt.x,g.overallVelocityY=Dt.y,g.overallVelocity=l(Dt.x)>l(Dt.y)?Dt.x:Dt.y,g.scale=U?cg(U.pointers,k):1,g.rotation=U?lg(U.pointers,k):0,g.maxPointers=v.prevInput?g.pointers.length>v.prevInput.maxPointers?g.pointers.length:v.prevInput.maxPointers:g.pointers.length,ag(v,g);var ke=h.element;O(g.srcEvent.target,ke)&&(ke=g.srcEvent.target),g.target=ke}function rg(h,g){var v=g.center,k=h.offsetDelta||{},C=h.prevDelta||{},I=h.prevInput||{};(g.eventType===nt||I.eventType===lt)&&(C=h.prevDelta={x:I.deltaX||0,y:I.deltaY||0},k=h.offsetDelta={x:v.x,y:v.y}),g.deltaX=C.x+(v.x-k.x),g.deltaY=C.y+(v.y-k.y)}function ag(h,g){var v=h.lastInterval||g,k=g.timeStamp-v.timeStamp,C,I,U,bt;if(g.eventType!=Nt&&(k>Cn||v.velocity===i)){var yt=g.deltaX-v.deltaX,Dt=g.deltaY-v.deltaY,ke=yc(k,yt,Dt);I=ke.x,U=ke.y,C=l(ke.x)>l(ke.y)?ke.x:ke.y,bt=vc(yt,Dt),h.lastInterval=g}else C=v.velocity,I=v.velocityX,U=v.velocityY,bt=v.direction;g.velocity=C,g.velocityX=I,g.velocityY=U,g.direction=bt}function bc(h){for(var g=[],v=0;v<h.pointers.length;)g[v]={clientX:a(h.pointers[v].clientX),clientY:a(h.pointers[v].clientY)},v++;return{timeStamp:c(),pointers:g,center:xc(g),deltaX:h.deltaX,deltaY:h.deltaY}}function xc(h){var g=h.length;if(g===1)return{x:a(h[0].clientX),y:a(h[0].clientY)};for(var v=0,k=0,C=0;C<g;)v+=h[C].clientX,k+=h[C].clientY,C++;return{x:a(v/g),y:a(k/g)}}function yc(h,g,v){return{x:g/h||0,y:v/h||0}}function vc(h,g){return h===g?Ks:l(h)>=l(g)?h<0?Li:zi:g<0?Vi:Fi}function qs(h,g,v){v||(v=mc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.sqrt(k*k+C*C)}function Or(h,g,v){v||(v=mc);var k=g[v[0]]-h[v[0]],C=g[v[1]]-h[v[1]];return Math.atan2(C,k)*180/Math.PI}function lg(h,g){return Or(g[1],g[0],Xs)+Or(h[1],h[0],Xs)}function cg(h,g){return qs(g[0],g[1],Xs)/qs(h[0],h[1],Xs)}var ug={mousedown:nt,mousemove:Pn,mouseup:lt},dg="mousedown",fg="mousemove mouseup";function Zs(){this.evEl=dg,this.evWin=fg,this.pressed=!1,Qt.apply(this,arguments)}w(Zs,Qt,{handler:function(g){var v=ug[g.type];v&nt&&g.button===0&&(this.pressed=!0),v&Pn&&g.which!==1&&(v=lt),this.pressed&&(v&lt&&(this.pressed=!1),this.callback(this.manager,v,{pointers:[g],changedPointers:[g],pointerType:Ve,srcEvent:g}))}});var hg={pointerdown:nt,pointermove:Pn,pointerup:lt,pointercancel:Nt,pointerout:Nt},pg={2:ve,3:an,4:Ve,5:Fe},wc="pointerdown",_c="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(wc="MSPointerDown",_c="MSPointerMove MSPointerUp MSPointerCancel");function Rr(){this.evEl=wc,this.evWin=_c,Qt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(Rr,Qt,{handler:function(g){var v=this.store,k=!1,C=g.type.toLowerCase().replace("ms",""),I=hg[C],U=pg[g.pointerType]||g.pointerType,bt=U==ve,yt=j(v,g.pointerId,"pointerId");I&nt&&(g.button===0||bt)?yt<0&&(v.push(g),yt=v.length-1):I&(lt|Nt)&&(k=!0),!(yt<0)&&(v[yt]=g,this.callback(this.manager,I,{pointers:v,changedPointers:[g],pointerType:U,srcEvent:g}),k&&v.splice(yt,1))}});var gg={touchstart:nt,touchmove:Pn,touchend:lt,touchcancel:Nt},mg="touchstart",bg="touchstart touchmove touchend touchcancel";function kc(){this.evTarget=mg,this.evWin=bg,this.started=!1,Qt.apply(this,arguments)}w(kc,Qt,{handler:function(g){var v=gg[g.type];if(v===nt&&(this.started=!0),!!this.started){var k=xg.call(this,g,v);v&(lt|Nt)&&k[0].length-k[1].length===0&&(this.started=!1),this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}}});function xg(h,g){var v=H(h.touches),k=H(h.changedTouches);return g&(lt|Nt)&&(v=G(v.concat(k),"identifier",!0)),[v,k]}var yg={touchstart:nt,touchmove:Pn,touchend:lt,touchcancel:Nt},vg="touchstart touchmove touchend touchcancel";function Js(){this.evTarget=vg,this.targetIds={},Qt.apply(this,arguments)}w(Js,Qt,{handler:function(g){var v=yg[g.type],k=wg.call(this,g,v);k&&this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:ve,srcEvent:g})}});function wg(h,g){var v=H(h.touches),k=this.targetIds;if(g&(nt|Pn)&&v.length===1)return k[v[0].identifier]=!0,[v,v];var C,I,U=H(h.changedTouches),bt=[],yt=this.target;if(I=v.filter(function(Dt){return O(Dt.target,yt)}),g===nt)for(C=0;C<I.length;)k[I[C].identifier]=!0,C++;for(C=0;C<U.length;)k[U[C].identifier]&&bt.push(U[C]),g&(lt|Nt)&&delete k[U[C].identifier],C++;if(bt.length)return[G(I.concat(bt),"identifier",!0),bt]}var _g=2500,Sc=25;function Ir(){Qt.apply(this,arguments);var h=_(this.handler,this);this.touch=new Js(this.manager,h),this.mouse=new Zs(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}w(Ir,Qt,{handler:function(g,v,k){var C=k.pointerType==ve,I=k.pointerType==Ve;if(!(I&&k.sourceCapabilities&&k.sourceCapabilities.firesTouchEvents)){if(C)kg.call(this,v,k);else if(I&&Sg.call(this,k))return;this.callback(g,v,k)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function kg(h,g){h&nt?(this.primaryTouch=g.changedPointers[0].identifier,Ec.call(this,g)):h&(lt|Nt)&&Ec.call(this,g)}function Ec(h){var g=h.changedPointers[0];if(g.identifier===this.primaryTouch){var v={x:g.clientX,y:g.clientY};this.lastTouches.push(v);var k=this.lastTouches,C=function(){var I=k.indexOf(v);I>-1&&k.splice(I,1)};setTimeout(C,_g)}}function Sg(h){for(var g=h.srcEvent.clientX,v=h.srcEvent.clientY,k=0;k<this.lastTouches.length;k++){var C=this.lastTouches[k],I=Math.abs(g-C.x),U=Math.abs(v-C.y);if(I<=Sc&&U<=Sc)return!0}return!1}var Mc=ot(o.style,"touchAction"),Tc=Mc!==i,Cc="compute",Pc="auto",Nr="manipulation",An="none",Hi="pan-x",Bi="pan-y",Qs=Mg();function Lr(h,g){this.manager=h,this.set(g)}Lr.prototype={set:function(h){h==Cc&&(h=this.compute()),Tc&&this.manager.element.style&&Qs[h]&&(this.manager.element.style[Mc]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return f(this.manager.recognizers,function(g){S(g.options.enable,[g])&&(h=h.concat(g.getTouchAction()))}),Eg(h.join(" "))},preventDefaults:function(h){var g=h.srcEvent,v=h.offsetDirection;if(this.manager.session.prevented){g.preventDefault();return}var k=this.actions,C=A(k,An)&&!Qs[An],I=A(k,Bi)&&!Qs[Bi],U=A(k,Hi)&&!Qs[Hi];if(C){var bt=h.pointers.length===1,yt=h.distance<2,Dt=h.deltaTime<250;if(bt&&yt&&Dt)return}if(!(U&&I)&&(C||I&&v&we||U&&v&Dn))return this.preventSrc(g)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function Eg(h){if(A(h,An))return An;var g=A(h,Hi),v=A(h,Bi);return g&&v?An:g||v?g?Hi:Bi:A(h,Nr)?Nr:Pc}function Mg(){if(!Tc)return!1;var h={},g=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(v){h[v]=g?e.CSS.supports("touch-action",v):!0}),h}var to=1,te=2,ii=4,ln=8,He=ln,Wi=16,_e=32;function Be(h){this.options=b({},this.defaults,h||{}),this.id=Q(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=to,this.simultaneous={},this.requireFail=[]}Be.prototype={defaults:{},set:function(h){return b(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(d(h,"recognizeWith",this))return this;var g=this.simultaneous;return h=eo(h,this),g[h.id]||(g[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return d(h,"dropRecognizeWith",this)?this:(h=eo(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(d(h,"requireFailure",this))return this;var g=this.requireFail;return h=eo(h,this),j(g,h)===-1&&(g.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(d(h,"dropRequireFailure",this))return this;h=eo(h,this);var g=j(this.requireFail,h);return g>-1&&this.requireFail.splice(g,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var g=this,v=this.state;function k(C){g.manager.emit(C,h)}v<ln&&k(g.options.event+Dc(v)),k(g.options.event),h.additionalEvent&&k(h.additionalEvent),v>=ln&&k(g.options.event+Dc(v))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=_e},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(_e|to)))return!1;h++}return!0},recognize:function(h){var g=b({},h);if(!S(this.options.enable,[this,g])){this.reset(),this.state=_e;return}this.state&(He|Wi|_e)&&(this.state=to),this.state=this.process(g),this.state&(te|ii|ln|Wi)&&this.tryEmit(g)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Dc(h){return h&Wi?"cancel":h&ln?"end":h&ii?"move":h&te?"start":""}function Ac(h){return h==Fi?"down":h==Vi?"up":h==Li?"left":h==zi?"right":""}function eo(h,g){var v=g.manager;return v?v.get(h):h}function de(){Be.apply(this,arguments)}w(de,Be,{defaults:{pointers:1},attrTest:function(h){var g=this.options.pointers;return g===0||h.pointers.length===g},process:function(h){var g=this.state,v=h.eventType,k=g&(te|ii),C=this.attrTest(h);return k&&(v&Nt||!C)?g|Wi:k||C?v&lt?g|ln:g&te?g|ii:te:_e}});function no(){de.apply(this,arguments),this.pX=null,this.pY=null}w(no,de,{defaults:{event:"pan",threshold:10,pointers:1,direction:gc},getTouchAction:function(){var h=this.options.direction,g=[];return h&we&&g.push(Bi),h&Dn&&g.push(Hi),g},directionTest:function(h){var g=this.options,v=!0,k=h.distance,C=h.direction,I=h.deltaX,U=h.deltaY;return C&g.direction||(g.direction&we?(C=I===0?Ks:I<0?Li:zi,v=I!=this.pX,k=Math.abs(h.deltaX)):(C=U===0?Ks:U<0?Vi:Fi,v=U!=this.pY,k=Math.abs(h.deltaY))),h.direction=C,v&&k>g.threshold&&C&g.direction},attrTest:function(h){return de.prototype.attrTest.call(this,h)&&(this.state&te||!(this.state&te)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var g=Ac(h.direction);g&&(h.additionalEvent=this.options.event+g),this._super.emit.call(this,h)}});function zr(){de.apply(this,arguments)}w(zr,de,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[An]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&te)},emit:function(h){if(h.scale!==1){var g=h.scale<1?"in":"out";h.additionalEvent=this.options.event+g}this._super.emit.call(this,h)}});function Vr(){Be.apply(this,arguments),this._timer=null,this._input=null}w(Vr,Be,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Pc]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime>g.time;if(this._input=h,!k||!v||h.eventType&(lt|Nt)&&!C)this.reset();else if(h.eventType&nt)this.reset(),this._timer=u(function(){this.state=He,this.tryEmit()},g.time,this);else if(h.eventType&lt)return He;return _e},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===He&&(h&&h.eventType&lt?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Fr(){de.apply(this,arguments)}w(Fr,de,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[An]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&te)}});function Hr(){de.apply(this,arguments)}w(Hr,de,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:we|Dn,pointers:1},getTouchAction:function(){return no.prototype.getTouchAction.call(this)},attrTest:function(h){var g=this.options.direction,v;return g&(we|Dn)?v=h.overallVelocity:g&we?v=h.overallVelocityX:g&Dn&&(v=h.overallVelocityY),this._super.attrTest.call(this,h)&&g&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&l(v)>this.options.velocity&&h.eventType&lt},emit:function(h){var g=Ac(h.offsetDirection);g&&this.manager.emit(this.options.event+g,h),this.manager.emit(this.options.event,h)}});function io(){Be.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(io,Be,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Nr]},process:function(h){var g=this.options,v=h.pointers.length===g.pointers,k=h.distance<g.threshold,C=h.deltaTime<g.time;if(this.reset(),h.eventType&nt&&this.count===0)return this.failTimeout();if(k&&C&&v){if(h.eventType!=lt)return this.failTimeout();var I=this.pTime?h.timeStamp-this.pTime<g.interval:!0,U=!this.pCenter||qs(this.pCenter,h.center)<g.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!U||!I?this.count=1:this.count+=1,this._input=h;var bt=this.count%g.taps;if(bt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=He,this.tryEmit()},g.interval,this),te):He}return _e},failTimeout:function(){return this._timer=u(function(){this.state=_e},this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==He&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function We(h,g){return g=g||{},g.recognizers=T(g.recognizers,We.defaults.preset),new Br(h,g)}We.VERSION="2.0.7",We.defaults={domEvents:!1,touchAction:Cc,enable:!0,inputTarget:null,inputClass:null,preset:[[Fr,{enable:!1}],[zr,{enable:!1},["rotate"]],[Hr,{direction:we}],[no,{direction:we},["swipe"]],[io],[io,{event:"doubletap",taps:2},["tap"]],[Vr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Tg=1,Oc=2;function Br(h,g){this.options=b({},We.defaults,g||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=ig(this),this.touchAction=new Lr(this,this.options.touchAction),Rc(this,!0),f(this.options.recognizers,function(v){var k=this.add(new v[0](v[1]));v[2]&&k.recognizeWith(v[2]),v[3]&&k.requireFailure(v[3])},this)}Br.prototype={set:function(h){return b(this.options,h),h.touchAction&&this.touchAction.update(),h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init()),this},stop:function(h){this.session.stopped=h?Oc:Tg},recognize:function(h){var g=this.session;if(!g.stopped){this.touchAction.preventDefaults(h);var v,k=this.recognizers,C=g.curRecognizer;(!C||C&&C.state&He)&&(C=g.curRecognizer=null);for(var I=0;I<k.length;)v=k[I],g.stopped!==Oc&&(!C||v==C||v.canRecognizeWith(C))?v.recognize(h):v.reset(),!C&&v.state&(te|ii|ln)&&(C=g.curRecognizer=v),I++}},get:function(h){if(h instanceof Be)return h;for(var g=this.recognizers,v=0;v<g.length;v++)if(g[v].options.event==h)return g[v];return null},add:function(h){if(d(h,"add",this))return this;var g=this.get(h.options.event);return g&&this.remove(g),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(d(h,"remove",this))return this;if(h=this.get(h),h){var g=this.recognizers,v=j(g,h);v!==-1&&(g.splice(v,1),this.touchAction.update())}return this},on:function(h,g){if(h!==i&&g!==i){var v=this.handlers;return f(N(h),function(k){v[k]=v[k]||[],v[k].push(g)}),this}},off:function(h,g){if(h!==i){var v=this.handlers;return f(N(h),function(k){g?v[k]&&v[k].splice(j(v[k],g),1):delete v[k]}),this}},emit:function(h,g){this.options.domEvents&&Cg(h,g);var v=this.handlers[h]&&this.handlers[h].slice();if(!(!v||!v.length)){g.type=h,g.preventDefault=function(){g.srcEvent.preventDefault()};for(var k=0;k<v.length;)v[k](g),k++}},destroy:function(){this.element&&Rc(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Rc(h,g){var v=h.element;if(v.style){var k;f(h.options.cssProps,function(C,I){k=ot(v.style,I),g?(h.oldCssProps[k]=v.style[k],v.style[k]=C):v.style[k]=h.oldCssProps[k]||""}),g||(h.oldCssProps={})}}function Cg(h,g){var v=t.createEvent("Event");v.initEvent(h,!0,!0),v.gesture=g,g.target.dispatchEvent(v)}b(We,{INPUT_START:nt,INPUT_MOVE:Pn,INPUT_END:lt,INPUT_CANCEL:Nt,STATE_POSSIBLE:to,STATE_BEGAN:te,STATE_CHANGED:ii,STATE_ENDED:ln,STATE_RECOGNIZED:He,STATE_CANCELLED:Wi,STATE_FAILED:_e,DIRECTION_NONE:Ks,DIRECTION_LEFT:Li,DIRECTION_RIGHT:zi,DIRECTION_UP:Vi,DIRECTION_DOWN:Fi,DIRECTION_HORIZONTAL:we,DIRECTION_VERTICAL:Dn,DIRECTION_ALL:gc,Manager:Br,Input:Qt,TouchAction:Lr,TouchInput:Js,MouseInput:Zs,PointerEventInput:Rr,TouchMouseInput:Ir,SingleTouchInput:kc,Recognizer:Be,AttrRecognizer:de,Tap:io,Pan:no,Swipe:Hr,Pinch:zr,Rotate:Fr,Press:Vr,on:E,off:P,each:f,merge:y,extend:x,assign:b,inherit:w,bindFn:_,prefixed:ot});var Pg=typeof e<"u"?e:typeof self<"u"?self:{};Pg.Hammer=We,typeof define=="function"&&define.amd?define(function(){return We}):typeof _r<"u"&&_r.exports?_r.exports=We:e[n]=We})(window,document,"Hammer")});var _h=M(()=>{Tl();});var kh=M(()=>{_h()});function Mn(e,t,n){return e===void 0?!0:typeof e=="string"?e.indexOf(t)!==-1:typeof e=="function"?e({chart:n}).indexOf(t)!==-1:!1}function Gl(e,t){return typeof e=="function"&&(e=e({chart:t})),typeof e=="string"?{x:e.indexOf("x")!==-1,y:e.indexOf("y")!==-1}:{x:!1,y:!1}}function yy(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function vy({x:e,y:t},n){let i=n.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){let r=i[s[o]];if(t>=r.top&&t<=r.bottom&&e>=r.left&&e<=r.right)return r}return null}function zh(e,t,n){let{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=vy(t,n),a=Gl(i,n),l=Gl(s,n);if(o){let u=Gl(o,n);for(let d of["x","y"])u[d]&&(l[d]=a[d],a[d]=!1)}if(r&&l[r.axis])return[r];let c=[];return $(n.scales,function(u){a[u.axis]&&c.push(u)}),c}function st(e){let t=Yl.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},Yl.set(e,t)),t}function wy(e){Yl.delete(e)}function Vh(e,t,n,i){let s=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-s;return{min:i*s,max:i*o}}function Fh(e,t){let n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function Hh(e,t,n){let i=e.max-e.min,s=i*(t-1),o=Fh(e,n);return Vh(o,e.min,i,s)}function _y(e,t,n){let i=Fh(e,n);if(i===void 0)return{min:e.min,max:e.max};let s=Math.log10(e.min),o=Math.log10(e.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=Vh(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function ky(e,t){return t&&(t[e.id]||t[e.axis])||{}}function Sh(e,t,n,i,s){let o=n[i];if(o==="original"){let r=e.originalScaleLimits[t.id][i];o=W(r.options,r.scale)}return W(o,s)}function Sy(e,t,n){let i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function Ey(e,{min:t,max:n,minLimit:i,maxLimit:s},o){let r=(e-n+t)/2;t-=r,n+=r;let a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=e/1e6;return Ae(t,a,c)&&(t=a),Ae(n,l,c)&&(n=l),t<i?(t=i,n=Math.min(i+e,s)):n>s&&(n=s,t=Math.max(s-e,i)),{min:t,max:n}}function ti(e,{min:t,max:n},i,s=!1){let o=st(e.chart),{options:r}=e,a=ky(e,i),{minRange:l=0}=a,c=Sh(o,e,a,"min",-1/0),u=Sh(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;let d=e.max-e.min,f=s?Math.max(n-t,l):d;if(s&&f===l&&d<=l)return!0;let p=Ey(f,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=p.min,r.max=p.max,o.updatedScaleLimits[e.id]=p,e.parse(p.min)!==e.min||e.parse(p.max)!==e.max}function My(e,t,n,i){let s=Hh(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return ti(e,o,i,!0)}function Ty(e,t,n,i){let s=_y(e,t,n);return ti(e,s,i,!0)}function Cy(e,t,n,i){ti(e,Sy(e,t,n),i,!0)}function Py(e){let n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Dy(e,t,n,i){let s=Hh(e,t,n);e.min===e.max&&t<1&&Py(e);let o={min:e.min+Eh(s.min),max:e.max-Eh(s.max)};return ti(e,o,i,!0)}function Ay(e){return e.isHorizontal()?e.width:e.height}function Oy(e,t,n){let s=e.getLabels().length-1,{min:o,max:r}=e,a=Math.max(r-o,1),l=Math.round(Ay(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l)),u;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,u=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,u=o===0),ti(e,{min:o,max:r},n)||u}function Bh(e,t,n,i=!1){let{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Ry[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:ti(e,{min:c,max:u},n,i?"pan":!1)}function Mh(e,t,n){return Bh(e,t,n,!0)}function Iy(e,t,n){let{id:i,options:{min:s,max:o}}=e;if(!t[i]||!n[i])return!0;let r=n[i];return r.min!==s||r.max!==o}function Th(e,t){$(e,(n,i)=>{t[i]||delete e[i]})}function Ri(e,t){let{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return $(n,function(o){Iy(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Th(i,n),Th(s,n),i}function Ch(e,t,n,i){let s=Kl[e.type]||Kl.default;z(s,[e,t,n,i])}function Ph(e,t,n,i){let s=Xl[e.type]||Xl.default;z(s,[e,t,n,i])}function Ny(e){let t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function tc(e,t,n="none",i="api"){let{x:s=1,y:o=1,focalPoint:r=Ny(e)}=typeof t=="number"?{x:t,y:t}:t,a=st(e),{options:{limits:l,zoom:c}}=a;Ri(e,a);let u=s!==1,d=o!==1,f=zh(c,r,e);$(f||e.scales,function(p){p.isHorizontal()&&u?Ch(p,s,r,l):!p.isHorizontal()&&d&&Ch(p,o,r,l)}),e.update(n),z(c.onZoom,[{chart:e,trigger:i}])}function Wh(e,t,n,i="none",s="api"){let o=st(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;Ri(e,o);let c=Mn(l,"x",e),u=Mn(l,"y",e);$(e.scales,function(d){d.isHorizontal()&&c?Ph(d,t.x,n.x,r):!d.isHorizontal()&&u&&Ph(d,t.y,n.y,r)}),e.update(i),z(a.onZoom,[{chart:e,trigger:s}])}function Ly(e,t,n,i="none",s="api"){let o=st(e);Ri(e,o);let r=e.scales[t];ti(r,n,void 0,!0),e.update(i),z(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function zy(e,t="default"){let n=st(e),i=Ri(e,n);$(e.scales,function(s){let o=s.options;i[s.id]?(o.min=i[s.id].min.options,o.max=i[s.id].max.options):(delete o.min,delete o.max),delete n.updatedScaleLimits[s.id]}),e.update(t),z(n.options.zoom.onZoomComplete,[{chart:e}])}function Vy(e,t){let n=e.originalScaleLimits[t];if(!n)return;let{min:i,max:s}=n;return W(s.options,s.scale)-W(i.options,i.scale)}function Fy(e){let t=st(e),n=1,i=1;return $(e.scales,function(s){let o=Vy(t,s.id);if(o){let r=Math.round(o/(s.max-s.min)*100)/100;n=Math.min(n,r),i=Math.max(i,r)}}),n<1?n:i}function Dh(e,t,n,i){let{panDelta:s}=i,o=s[e.id]||0;me(o)===me(t)&&(t+=o);let r=ql[e.type]||ql.default;z(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function jh(e,t,n,i="none"){let{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=st(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};Ri(e,r);let u=s!==0,d=o!==0;$(n||e.scales,function(f){f.isHorizontal()&&u?Dh(f,s,l,r):!f.isHorizontal()&&d&&Dh(f,o,l,r)}),e.update(i),z(c,[{chart:e}])}function $h(e){let t=st(e);Ri(e,t);let n={};for(let i of Object.keys(e.scales)){let{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};n[i]={min:s.scale,max:o.scale}}return n}function Hy(e){let t=st(e),n={};for(let i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function By(e){let t=$h(e);for(let n of Object.keys(e.scales)){let{min:i,max:s}=t[n];if(i!==void 0&&e.scales[n].min!==i||s!==void 0&&e.scales[n].max!==s)return!0}return!1}function Ah(e){let t=st(e);return t.panning||t.dragging}function Ut(e,t){let{handlers:n}=st(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function Vs(e,t,n,i){let{handlers:s,options:o}=st(e),r=s[n];if(r&&r.target===t)return;Ut(e,n),s[n]=l=>i(e,l,o),s[n].target=t;let a=n==="wheel"?!1:void 0;t.addEventListener(n,s[n],{passive:a})}function Wy(e,t){let n=st(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function jy(e,t){let n=st(e);!n.dragStart||t.key!=="Escape"||(Ut(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Zl(e,t){if(e.target!==t.canvas){let n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return Jt(e,t)}function Uh(e,t,n){let{onZoomStart:i,onZoomRejected:s}=n;if(i){let o=Zl(t,e);if(z(i,[{chart:e,event:t,point:o}])===!1)return z(s,[{chart:e,event:t}]),!1}}function $y(e,t){if(e.legend){let o=Jt(t,e);if(Zt(o,e.legend))return}let n=st(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||Lh(Fs(i),t)||Ql(Fs(s.drag),t))return z(s.onZoomRejected,[{chart:e,event:t}]);Uh(e,t,s)!==!1&&(n.dragStart=t,Vs(e,e.canvas.ownerDocument,"mousemove",Wy),Vs(e,window.document,"keydown",jy))}function Uy({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y,o=Math.abs(i/s);o>n?i=Math.sign(i)*Math.abs(s*n):o<n&&(s=Math.sign(s)*Math.abs(i/n)),t.x=e.x+i,t.y=e.y+s}function Rh(e,t,n,{min:i,max:s,prop:o}){e[i]=Oh(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Oh(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Gy(e,t,n){let i={begin:Zl(t.dragStart,e),end:Zl(t.dragEnd,e)};if(n){let s=e.chartArea.width/e.chartArea.height;Uy(i,s)}return i}function Gh(e,t,n,i){let s=Mn(t,"x",e),o=Mn(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:d}=e.chartArea,f={top:r,left:a,right:l,bottom:c},p=Gy(e,n,i&&s&&o);s&&Rh(f,e.chartArea,p,{min:"left",max:"right",prop:"x"}),o&&Rh(f,e.chartArea,p,{min:"top",max:"bottom",prop:"y"});let b=f.right-f.left,x=f.bottom-f.top;return{...f,width:b,height:x,zoomX:s&&b?1+(u-b)/u:1,zoomY:o&&x?1+(d-x)/d:1}}function Yy(e,t){let n=st(e);if(!n.dragStart)return;Ut(e,"mousemove");let{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=Gh(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=Mn(i,"x",e)?a.width:0,c=Mn(i,"y",e)?a.height:0,u=Math.sqrt(l*l+c*c);if(n.dragStart=n.dragEnd=null,u<=o){n.dragging=!1,e.update("none");return}Wh(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,z(s,[{chart:e}])}function Ky(e,t,n){if(Ql(Fs(n.wheel),t)){z(n.onZoomRejected,[{chart:e,event:t}]);return}if(Uh(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Xy(e,t){let{handlers:{onZoomComplete:n},options:{zoom:i}}=st(e);if(!Ky(e,t,i))return;let s=t.target.getBoundingClientRect(),o=i.wheel.speed,r=t.deltaY>=0?2-1/(1-o):1+o,a={x:r,y:r,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}};tc(e,a,"zoom","wheel"),z(n,[{chart:e}])}function qy(e,t,n,i){n&&(st(e).handlers[t]=yy(()=>z(n,[{chart:e}]),i))}function Zy(e,t){let n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(Vs(e,n,"wheel",Xy),qy(e,"onZoomComplete",o,250)):Ut(e,"wheel"),s.enabled?(Vs(e,n,"mousedown",$y),Vs(e,n.ownerDocument,"mouseup",Yy)):(Ut(e,"mousedown"),Ut(e,"mousemove"),Ut(e,"mouseup"),Ut(e,"keydown"))}function Jy(e){Ut(e,"mousedown"),Ut(e,"mousemove"),Ut(e,"mouseup"),Ut(e,"wheel"),Ut(e,"click"),Ut(e,"keydown")}function Qy(e,t){return function(n,i){let{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;let r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(Ql(Fs(s),r)||Lh(Fs(o.drag),r))?(z(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function tv(e,t){let n=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY),s=n/i,o,r;return s>.3&&s<1.7?o=r=!0:n>i?o=!0:r=!0,{x:o,y:r}}function Yh(e,t,n){if(t.scale){let{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=tv(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Mn(l,"x",e)?o:1,y:a.y&&Mn(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};tc(e,c,"zoom","pinch"),t.scale=n.scale}}function ev(e,t,n){if(t.options.zoom.pinch.enabled){let i=Jt(n,e);z(t.options.zoom.onZoomStart,[{chart:e,event:n,point:i}])===!1?(t.scale=null,z(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function nv(e,t,n){t.scale&&(Yh(e,t,n),t.scale=null,z(t.options.zoom.onZoomComplete,[{chart:e}]))}function Kh(e,t,n){let i=t.delta;i&&(t.panning=!0,jh(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function iv(e,t,n){let{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;let r=n.target.getBoundingClientRect(),a={x:n.center.x-r.left,y:n.center.y-r.top};if(z(s,[{chart:e,event:n,point:a}])===!1)return z(o,[{chart:e,event:n}]);t.panScales=zh(t.options.pan,a,e),t.delta={x:0,y:0},Kh(e,t,n)}function sv(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,z(t.options.pan.onPanComplete,[{chart:e}]))}function Ih(e,t){let n=st(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Oi.default.Manager(i);o&&o.pinch.enabled&&(r.add(new Oi.default.Pinch),r.on("pinchstart",a=>ev(e,n,a)),r.on("pinch",a=>Yh(e,n,a)),r.on("pinchend",a=>nv(e,n,a))),s&&s.enabled&&(r.add(new Oi.default.Pan({threshold:s.threshold,enable:Qy(e,n)})),r.on("panstart",a=>iv(e,n,a)),r.on("panmove",a=>Kh(e,n,a)),r.on("panend",()=>sv(e,n))),Jl.set(e,r)}function Nh(e){let t=Jl.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Jl.delete(e))}function ov(e,t){let{pan:n,zoom:i}=e,{pan:s,zoom:o}=t;return i?.zoom?.pinch?.enabled!==o?.zoom?.pinch?.enabled||n?.enabled!==s?.enabled||n?.threshold!==s?.threshold}function kr(e,t,n){let i=n.zoom.drag,{dragStart:s,dragEnd:o}=st(e);if(i.drawTime!==t||!o)return;let{left:r,top:a,width:l,height:c}=Gh(e,n.zoom.mode,{dragStart:s,dragEnd:o},i.maintainAspectRatio),u=e.ctx;u.save(),u.beginPath(),u.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",u.fillRect(r,a,l,c),i.borderWidth>0&&(u.lineWidth=i.borderWidth,u.strokeStyle=i.borderColor||"rgba(225,225,225)",u.strokeRect(r,a,l,c)),u.restore()}var Oi,Fs,Lh,Ql,Yl,Eh,Ry,Kl,Xl,ql,Oh,Jl,rv,Xh,qh=M(()=>{Oi=Vg(wh());kh();Fs=e=>e&&e.enabled&&e.modifierKey,Lh=(e,t)=>e&&t[e+"Key"],Ql=(e,t)=>e&&!t[e+"Key"];Yl=new WeakMap;Eh=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);Ry={second:500,minute:30*1e3,hour:1800*1e3,day:720*60*1e3,week:3.5*24*60*60*1e3,month:360*60*60*1e3,quarter:1440*60*60*1e3,year:4368*60*60*1e3};Kl={category:Dy,default:My,logarithmic:Ty},Xl={default:Cy},ql={category:Oy,default:Bh,logarithmic:Mh,timeseries:Mh};Oh=(e,t,n)=>Math.min(n,Math.max(t,e));Jl=new WeakMap;rv="2.2.0";Xh={id:"zoom",version:rv,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){let i=st(e);i.options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option \`zoom.enabled\` is no longer supported. Please use \`zoom.wheel.enabled\`, \`zoom.drag.enabled\`, or \`zoom.pinch.enabled\`."),(Object.prototype.hasOwnProperty.call(n.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(n.pan,"overScaleMode"))&&console.warn("The option \`overScaleMode\` is deprecated. Please use \`scaleMode\` instead (and update \`mode\` as desired)."),Oi.default&&Ih(e,n),e.pan=(s,o,r)=>jh(e,s,o,r),e.zoom=(s,o)=>tc(e,s,o),e.zoomRect=(s,o,r)=>Wh(e,s,o,r),e.zoomScale=(s,o,r)=>Ly(e,s,o,r),e.resetZoom=s=>zy(e,s),e.getZoomLevel=()=>Fy(e),e.getInitialScaleBounds=()=>$h(e),e.getZoomedScaleBounds=()=>Hy(e),e.isZoomedOrPanned=()=>By(e),e.isZoomingOrPanning=()=>Ah(e)},beforeEvent(e,{event:t}){if(Ah(e))return!1;if(t.type==="click"||t.type==="mouseup"){let n=st(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){let i=st(e),s=i.options;i.options=n,ov(s,n)&&(Nh(e),Ih(e,n)),Zy(e,n)},beforeDatasetsDraw(e,t,n){kr(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){kr(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){kr(e,"beforeDraw",n)},afterDraw(e,t,n){kr(e,"afterDraw",n)},stop:function(e){Jy(e),Oi.default&&Nh(e),wy(e)},panFunctions:ql,zoomFunctions:Kl,zoomRectFunctions:Xl}});function ec(e){let t=[],n=()=>t.forEach(l=>l()),i=D(null),s=null;return{canvasRef:i,init:()=>{let l=i.value;if(!l)return console.error("createLineChart: canvas ref not set",new Error().stack),n;ae.register(Xh,Pi,Zn,Ci,Jn,Sn,mh,xh),s=new ae(l,{type:"line",data:e.data.peek(),options:{scales:{y:{min:0}},animation:!1,responsive:!0,plugins:{zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},mode:"x"}},legend:{align:"start",position:"bottom"},title:{display:!1}}}});let c=e.data.subscribe(d=>{s&&(s.data=d,s.update())}),u=new ResizeObserver(()=>s?.resize());return u.observe(l.parentElement),t.push(()=>{u.disconnect(),s?.destroy(),s=null,c()}),()=>n()},resetZoom:()=>s?.resetZoom(),getZoomLevel:()=>s?.getZoomLevel()??0}}var Zh=M(()=>{"use strict";V();vh();qh()});var Sr=M(()=>{"use strict";Pd();Dd();Ad();Od();Zh()});var nc,Jh=M(()=>{"use strict";V();Z();Sr();nc=e=>{let t=e.minContainerWidth??250,n=[],i=()=>{n.forEach(y=>y()),n.length=0},s=D(null),o=D(0),r=D(0),a=pn(null),l=pn(null),[c,u]=ls(),d=Ba(a);n.push(u);let f=y=>{y.preventDefault(),s.value={...c.value},o.value=r.value,console.log("onMouseDown",{startMouse:s.value,prevFirstContainerWidth:o.value,firstContainerWidth:r.value})},p=()=>s.value=null,b=y=>{if(s.value==null||l.current==null)return;let w=Math.max(o.value+y.x-s.value.x,t);r.value=Math.min(w,l.current.clientWidth-t),console.log("onMouseMove",w,r.value)},x=()=>{l.current!=null&&l.current.clientWidth-t<r.value&&(r.value=Math.max(l.current.clientWidth-t,t))};return window.addEventListener("mouseup",p),window.addEventListener("mousemove",b),window.addEventListener("resize",x),n.push(()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",b),window.removeEventListener("resize",x)}),Da(()=>{if(l.current)return r.value=l.current.clientWidth/2,d.init(),()=>{d.dispose()}}),d.state.width.subscribe(y=>{console.log("width",y)}),Ht(()=>i()),({children:y,className:w,..._})=>{let[S,T]=Array.isArray(y)?y:[];return m("div",{className:ut("flex-grow grid gap-2 items-start w-full relative",q(w)),ref:l,style:{gridTemplateColumns:\`\${r}px 1fr\`},..._},m("div",{ref:a,className:"firstContainer w-full h-full"},S),d.state.width.value!=0&&m("div",{className:"w-8 flex justify-center h-full absolute top-0 -translate-x-1/2 cursor-col-resize z-[9999]",style:{left:\`\${d.state.width.value}px\`},onmousedown:f},m("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),m("div",{className:"secondContainer h-full"},T))}}});function Tn({root:e,className:t}){let{objectKeysChunkSize:n}=J.viewerSettings.value,i=e.page.value,s=e.children.slice(0,(i+1)*n),o=s.length<e.children.length;return m(vt,null,m("div",{className:ut("flex flex-col items-start w-full",q(t))},s.map(r=>m("div",{key:r.path,className:"flex flex-col items-start w-full gap-2 pl-2 py-1 pr-1 border-b border-neutral-700 last:border-b-0"},m(Er,{node:r})))),o&&m("button",{onclick:()=>e.page.value++,title:"Show more",className:"p-1 border font-bold border-neutral-700 hover:bg-neutral-700"},m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},m("circle",{cx:"12",cy:"12",r:"1"}),m("circle",{cx:"19",cy:"12",r:"1"}),m("circle",{cx:"5",cy:"12",r:"1"}))))}function Er({node:e}){switch(e.kind){case"null":case"undefined":case"string":case"number":case"bigint":case"boolean":case"symbol":case"function":case"dom-node":case"error":return m(av,{node:e});case"object":return m(cv,{node:e});case"array":return m(uv,{node:e});case"array-chunk":return m(dv,{node:e});case"signal":return m(fv,{node:e})}}function av({node:e}){let{label:t,path:n,raw:i,kind:s}=e;return m(Mr,null,m("label",{className:"text-xs truncate",title:n},t),m(lv,{kind:s,raw:i}))}function lv({kind:e,raw:t}){switch(e){case"null":return m("small",{className:"text-neutral-300"},"null");case"undefined":return m("small",{className:"text-neutral-300"},"undefined");case"dom-node":return m("small",{className:"text-neutral-300"},"<",m("span",{style:"color: #f0a05e"},t.nodeName),"/>");case"error":{let n=t;return m("small",{className:"text-neutral-300"},n.message,"cause"in n&&!!n.cause&&\` (\${String(n.cause)})\`)}case"string":return m("small",{className:"text-neutral-300"},\`"\${t}"\`);case"number":case"bigint":return m("small",{className:"text-neutral-300"},t);case"boolean":return m("small",{className:"text-neutral-300"},t?"true":"false");case"symbol":return m("small",{className:"text-neutral-300"},t.toString());case"function":return m("small",{className:"text-neutral-300 italic"},\`\\u0192 \${t.name??"anonymous"}()\`)}}function cv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Mr,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n!==null&&m(Tn,{root:{children:n,page:e.page}}))}function uv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m(Mr,null,m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),t?m("small",{className:"text-neutral-300"},\`Array(\${e.length})\`):n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Er,{node:i}))))}function dv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return m("div",{className:"flex flex-col items-start gap-1 w-full"},m("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,m(Xe,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n&&m("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>m(Er,{node:i}))))}function fv({node:e}){let t=e.viewerNode.value;return m(Mr,null,m("div",{className:"flex items-center gap-2"},m("label",{className:"text-xs truncate",title:e.path},e.label),m("span",{className:"text-[10px] italic text-primary border border-primary/40 px-1 rounded leading-none py-px"},"signal")),m("div",{className:"pl-2 w-full"},m(Er,{node:t})))}function Mr({children:e}){return m("div",{className:"flex flex-col items-start gap-1 w-full"},e)}var ic=M(()=>{"use strict";V();V();Z();Oo();Ce()});function Ct(){return{collapsed:new Map,page:new Map,children:new Map,signalNodes:new Map}}function xe(e,t,n){n.page.set(t,e.page),Bs(e.children,n)}function Bs(e,t){for(let n of e)if(n.kind==="object"){t.collapsed.set(n.path,n.collapsed),t.page.set(n.path,n.page),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Bs(i,t)}else if(n.kind==="array"||n.kind==="array-chunk"){t.collapsed.set(n.path,n.collapsed),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&Bs(i,t)}else n.kind==="signal"&&(t.signalNodes.set(n.path,n),Bs([n.viewerNode.peek()],t))}function le(e){for(let t of e.collapsed.values())L.dispose(t);for(let t of e.page.values())L.dispose(t);for(let t of e.children.values())L.dispose(t);for(let t of e.signalNodes.values())t.unsubscribe(),L.dispose(t.viewerNode)}function hv(e){if(e===null)return"null";if(e===void 0)return"undefined";let t=window.opener?window.opener.Node:window.Node;if(e instanceof t)return"dom-node";let n=window.opener?window.opener.Error:window.Error;if(e instanceof n)return"error";let i=typeof e;return i==="string"?"string":i==="number"?"number":i==="bigint"?"bigint":i==="boolean"?"boolean":i==="symbol"?"symbol":i==="function"?"function":null}function Hs(e,t,n,i,s){let o=hv(e);if(o!==null)return{kind:o,label:t,path:n,raw:e};if(L.isSignal(e)){let d=e,f=\`\${n}.$value\`,p=Hs(d.peek(),"value",f,i,s),b=D(p),x=d.subscribe(y=>{let w=Ct();Bs([b.peek()],w),b.value=Hs(y,"value",f,w,s),le(w)});return{kind:"signal",label:t,path:n,signal:d,viewerNode:b,unsubscribe:x}}if(Array.isArray(e)){let d=i.collapsed.get(n)??D(!0);i.collapsed.delete(n);let f=D(null);return{kind:"array",label:t,path:n,collapsed:d,length:e.length,children:f,buildChildren:()=>{if(f.peek()===null)if(e.length>s.arrayChunkSize){let b=Math.ceil(e.length/s.arrayChunkSize);f.value=Array.from({length:b},(x,y)=>{let w=y*s.arrayChunkSize,_=Math.min((y+1)*s.arrayChunkSize,e.length),S=\`\${n}[\${w}..\${_-1}]\`,T=D(!0),E=D(null),P=e.slice(w,_);return{kind:"array-chunk",label:\`[\${w}..\${_-1}]\`,path:S,collapsed:T,range:{start:w,end:_},children:E,buildChildren:()=>{E.peek()===null&&(E.value=P.map((A,N)=>Hs(A,(w+N).toString(),\`\${n}[\${w+N}]\`,Ct(),s)))}}})}else f.value=e.map((b,x)=>Hs(b,x.toString(),\`\${n}[\${x}]\`,Ct(),s))}}}let r=i.collapsed.get(n)??D(!0);i.collapsed.delete(n);let a=i.page.get(n)??D(0);i.page.delete(n);let l=D(null),c=e;return{kind:"object",label:t,path:n,collapsed:r,page:a,children:l,buildChildren:()=>{l.peek()===null&&(l.value=Qh(c,n,Ct(),s))}}}function Qh(e,t,n,i){return Object.keys(e).map(s=>Hs(e[s],s,\`\${t}.\${s}\`,n,i))}function sn(e,t,n,i){let s=n.page.get(t)??D(0);n.page.delete(t);let o=Qh(e,t,n,i);return{page:s,children:o}}var sc=M(()=>{"use strict";V()});var Ws=M(()=>{"use strict";Cd();Jh();ic();sc()});function Tr(e){e&&("nodes"in e?e.nodes.forEach(Tr):(Tr(e.child),Tr(e.sibling)))}function tp(e,t,n){let i=new Map;Cr(n,i);let s=e.rootNode,o=rc();if(s){let r=t.trim().toLowerCase(),a=r?r.split(/\\s+/):[];o.nodes.push(...ip(s,a,i))}for(let{collapsed:r}of i.values())L.dispose(r);return o}function Cr(e,t){if(e)if("nodes"in e)for(let n of e.nodes)Cr(n,t);else{let{id:n,collapsed:i}=e;t.set(e.kiruNode,{id:n,collapsed:i}),Cr(e.child,t),Cr(e.sibling,t)}}function ip(e,t,n=new Map){let i=[],s=e;for(;s;){let o=ip(s.child,t,n);if(typeof s.type!="function")i.push(...o);else{let r=Vn(s);if(mv(t,r)){let a=bv(s,r,n);a.child=o[0]??null;for(let l=0;l<o.length;l++)o[l].parent=a,o[l].sibling=o[l+1]??null;i.push(a)}else i.push(...o)}s=s.sibling}return i}function mv(e,t){let n=t.toLowerCase();return e.every(i=>n.includes(i))}function rc(...e){return{value:"ROOT",nodes:e}}function bv(e,t,n=new Map){let{id:i,collapsed:s}=n.get(e)??{id:crypto.randomUUID(),collapsed:D(!0)};return n.delete(e),{id:i,name:t,kiruNode:e,collapsed:s,parent:null,child:null,sibling:null}}function oc(e){let t=Ii.peek();if(!t)return;let n=ac(e,t);if(!n)return;let i=n.parent;for(;i;)i.collapsed.value=!1,i=i.parent}function sp(e){e&&oc(Gt.peek())}function xv(e){let t=Ii.peek();if(!t)return;let n=ac(Gt.peek(),t);n?.child&&(n.collapsed.value=e)}function yv(e,t){let n=Array.from(e.querySelectorAll("[data-graph-node-id]"));if(n.length===0)return;let i=Ii.peek(),s=-1;if(i){let c=ac(Gt.peek(),i);c&&(s=n.findIndex(u=>u.dataset.graphNodeId===c.id))}let r=s===-1?t==="down"?0:n.length-1:(s+(t==="up"?-1:1)+n.length)%n.length,a=n[r];if(!a)return;let l=vv(Gt.peek(),a);l&&(Ii.sneak(l.kiruNode),Ii.notify(c=>c!==sp))}function vv(e,t){let n=t.dataset.graphNodeId;if(!n)return null;let i=s=>s?s.id===n?s:i(s.child)??i(s.sibling):null;for(let s of e.nodes){let o=i(s);if(o)return o}return null}function ac(e,t){let n=i=>i?i.kiruNode===t?i:n(i.child)??n(i.sibling):null;for(let i of e.nodes){let s=n(i);if(s)return s}return null}var pv,Ii,gv,Gt,np,ep,op=M(()=>{"use strict";V();Ce();Fn();({selectedApp:pv,selectedNode:Ii,appSearchTerm:gv}=J),Gt=D(rc()),np=()=>(window.addEventListener("keydown",ep),()=>window.removeEventListener("keydown",ep));Ft(()=>{let e=pv.value,t=gv.value;if(!e){Tr(Gt.peek()),Gt.value=rc();return}Gt.value=tp(e,t,Gt.peek()),oc(Gt.peek());let n=i=>{i===e&&(Gt.value=tp(i,t,Gt.peek()),oc(Gt.peek()))};return dt().on("update",n),()=>dt().off("update",n)});Ii.subscribe(sp);ep=e=>{Ra(t=>{if(e.key==="l"&&e.ctrlKey){e.preventDefault(),J.appSearchInput.value?.focus(),J.appSearchInput.value?.select();return}if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;if(J.appSearchInput.value?.matches(":focus")){if(!e.altKey)return;e.preventDefault()}let n=e.key==="ArrowUp"?"up":e.key==="ArrowDown"?"down":e.key==="ArrowLeft"?"left":"right";if(n==="left"||n==="right"){xv(n==="left");return}yv(t,n)})}});function ap(){return Tt(()=>np()),()=>m("div",{className:"flex-grow p-2 sticky top-0"},m("div",{className:"flex gap-4 pb-2 border-b-2 border-neutral-800 mb-2 items-center"},m("input",{autofocus:!0,ref:_v,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text","bind:value":wv})),m("div",{className:"flex flex-col"},m(ge,{from:Gt},e=>m(kv,{root:e}))))}function kv({root:e}){return e.nodes.map(t=>m(lc,{node:t,traverseSiblings:!0}))}function lc({node:e,traverseSiblings:t=!0}){let n=e.collapsed.value,i=rp.value===e.kiruNode,s=o=>{o.preventDefault(),o.stopPropagation(),e.collapsed.value=!e.collapsed.value};return m(vt,null,m("div",{"data-graph-node-id":e.id,className:"pl-4 mb-1 w-full"},m("button",{className:ut("flex gap-2 items-center px-2 py-0.5 w-full",i?"bg-crimson text-white":""),onclick:()=>rp.value=e.kiruNode},e.child&&m(Xe,{className:ut("transition-transform duration-200 w-4 h-4",n?"":"rotate-90"),onclick:s}),m("div",{className:e.child?"":"ml-6"},m("span",{className:i?"":"text-neutral-400"},"<"),m("span",{className:ut("font-medium",i?"":"text-crimson")},e.name),m("span",{className:i?"":"text-neutral-400"},">"))),!n&&e.child&&m(lc,{node:e.child})),t&&m(Sv,{node:e}))}function Sv({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return m(vt,null,t.map(i=>m(lc,{node:i,traverseSiblings:!1})))}var rp,wv,_v,lp=M(()=>{"use strict";V();Ce();op();Ws();Z();({selectedNode:rp,appSearchTerm:wv,appSearchInput:_v}=J)});function dp(e,t){let n=js.peek();if(!e){n&&fp(n.props),js.value=null;return}let i=n?.node===e,s=Ct();i&&n?xe(n.props.root,"props",s):n&&fp(n.props);let o={...e.props};delete o.children;let r=i?n?.props.collapsed??D(!0):D(!0),a=sn(o,"props",s,t);le(s),js.value={node:e,name:Vn(e),props:{root:a,collapsed:r}}}function fp(e){L.dispose(e.collapsed),L.dispose(e.root.page);let t=Ct();xe(e.root,"props",t),le(t)}var cp,Ev,up,js,hp=M(()=>{"use strict";V();Z();Ce();Fn();sc();({selectedNode:cp,selectedApp:Ev,viewerSettings:up}=J),js=D(null);Ft(()=>{let e=cp.value,t=Ev.value,n=up.value;if(dp(e,n),!e||!t)return;let i=s=>{if(s===t){if(So(e)){cp.value=null;return}dp(e,up.peek())}};return dt().on("update",i),()=>dt().off("update",i)})});function pp(){let e=js.value;if(!e)return null;let{name:t,props:n}=e,i=n.collapsed.value;return m("div",{className:"flex-grow p-2 sticky top-0"},m("h2",{className:"flex justify-between items-center font-bold mb-2 pb-2 border-b-2 border-neutral-800"},m("div",{className:"flex gap-2 items-center"},"<"+t+">")),m("div",{className:"flex flex-col"},m("button",{onclick:()=>n.collapsed.value=!n.collapsed.value,className:n.root.children.length===0?"opacity-50 cursor-default":"cursor-pointer"},m("span",{className:"flex items-center gap-2 font-medium"},m(Xe,{className:\`transition \${i?"":"rotate-90"}\`}),"props")),i?null:m("div",{className:"p-2",...n},m(Tn,{root:n.root}))))}var gp=M(()=>{"use strict";V();ic();Oo();hp()});function cc(){let e=bp.value;return m(vt,null,m("div",{className:"flex items-center justify-between gap-4 p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},m("div",{className:"flex items-center gap-4"},m("select",{className:"px-2 py-1 bg-neutral-800 text-neutral-100 rounded border border-white border-opacity-10",value:e?.name??"",onchange:t=>bp.value=mp.peek().find(n=>n.name===t.currentTarget.value)??null},m("option",{value:"",disabled:!0},"Select App"),m(Ge,{each:mp},t=>m("option",{key:t.id,value:t.name},t.name))),m("button",{title:"Toggle Component Inspection",onclick:Mv,className:\`p-1 rounded \${Tv.value?"bg-neutral-900":""}\`},m(as,null)))),m(nc,{minContainerWidth:100,className:"min-w-[480px]"},m(ap,null),m(pp,null)))}var mp,bp,Pr,Mv,Tv,xp=M(()=>{"use strict";V();Ce();Ws();lp();gp();({apps:mp,selectedApp:bp,componentSelection:Pr}=J),Mv=()=>{Pr.value={enabled:!Pr.value.enabled,componentNode:Pr.value.componentNode}},Tv=Mt(()=>Pr.value.enabled)});function Sp(e){if(vp)return;vp=!0;let t=e.profilingContext,n=s=>{if(oe(s)||ze.value.find(a=>a.app.name===s.name))return;let r=_p(e,t,s);ze.value=[...ze.value,r]},i=s=>{oe(s)||(console.log("onAppUnmounted",s),ze.value.find(o=>o.app.name===s.name)?.dispose())};t.appStats.forEach((s,o)=>{if(oe(o))return;let r=_p(e,t,o);ze.value=[...ze.value,r]}),e.on("mount",n),e.on("unmount",i)}function wp(e,t){return{mountDuration:e.mountDuration(t).toFixed(2),totalTicks:e.totalTicks(t).toLocaleString(),avgTickDuration:e.averageTickDuration(t).toFixed(2),lastTickDuration:e.lastTickDuration(t).toFixed(2)}}function _p(e,t,n){let i=[],s=()=>{i.forEach(u=>u()),ze.value=ze.value.filter(u=>u.app.name!==n.name)},o=Cv(),r=D({labels:[(performance.now()/1e3).toFixed(2)],datasets:kp(o)});i.push(()=>L.dispose(r)),Object.entries(o).forEach(([u,{values:d}])=>{let f=b=>{b.name===n.name&&d[d.length-1]++},p=u;t.addEventListener(p,f),i.push(()=>t.removeEventListener(p,f))});let a=setInterval(()=>{Object.values(o).forEach(d=>{d.values.push(0),d.values.length>yp&&d.values.shift()});let u=[...r.value.labels,(performance.now()/1e3).toFixed(2)];u.length>yp&&u.shift(),r.value={labels:u,datasets:kp(o)}},100);i.push(()=>clearInterval(a));let l=D(wp(t,n)),c=u=>{u.name===n.name&&(l.value=wp(t,u))};return e.on("update",c),i.push(()=>e.off("update",c)),{app:n,stats:l,chartData:r,dispose:s}}function kp(e){return Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:[...n],fill:!1,borderColor:i,tension:.1}))}function Cv(){return{update:{values:[0],color:"#ad981f"},updateDirtied:{values:[0],color:"#b21f3a"},createNode:{values:[0],color:"#198019"},removeNode:{values:[0],color:"#5F3691"},updateNode:{values:[0],color:"#2f2f9d"},signalAttrUpdate:{values:[0],color:"#28888f"},signalTextUpdate:{values:[0],color:"#9b3b98"}}}var yp,ze,vp,Ep=M(()=>{"use strict";V();Fn();yp=100,ze=D([]),vp=!1});function Mp(e){return m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},m("circle",{cx:"12",cy:"12",r:"10"}),m("path",{d:"M12 16v-4"}),m("path",{d:"M12 8h.01"}))}var Tp=M(()=>{"use strict";V()});function $s({pauseWhen:e}){let t=dt();return Tt(()=>Sp(t)),m("div",{className:"flex flex-col gap-2"},m(Ge,{each:ze},n=>m(Pv,{item:n,pauseWhen:e})))}function Pv({item:e,pauseWhen:t}){let n=D(!1),i=D(e.chartData.peek()),s=ec({data:i}),o=e.chartData.subscribe(c=>{n.peek()||t?.peek()||(i.value=c)});Ht(()=>o()),Tt(()=>s.init());let r=D(!1),a=()=>{n.value=!0},l=()=>{t?.peek()||(n.value=!1,i.value=e.chartData.peek(),s.resetZoom())};return()=>m("div",{title:e.app.name,className:"flex overflow-hidden"},m("canvas",{ref:s.canvasRef,className:"w-full max-w-full h-80 overflow-hidden",onmouseover:a,onmouseout:l,onmousedown:c=>{s.getZoomLevel()<=1||(c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation())}}),m("div",{className:"absolute top-1 right-1 flex flex-col gap-1 items-end"},m("button",{className:"p-1",onclick:()=>r.value=!r.value},m(Mp,{className:"w-4 h-4"})),m(ge,{from:{stats:e.stats,showStatsTooltip:r}},({stats:c,showStatsTooltip:u})=>u&&m("div",{className:"text-xs grid grid-cols-2 gap-x-4 bg-neutral-800 bg-opacity-60 hover:bg-opacity-80 rounded-md p-2",style:"grid-template-columns: auto auto;"},m("span",{className:"text-right"},"Mount duration:"),c.mountDuration," ms",m("span",{className:"text-right"},"Total updates:"),m("span",null,c.totalTicks),m("span",{className:"text-right"},"Avg. update duration:"),c.avgTickDuration," ms",m("span",{className:"text-right"},"Latest update:"),m("span",null,c.lastTickDuration," ms")))))}var Cp=M(()=>{"use strict";V();Sr();Ce();Ep();Tp()});var uc=M(()=>{"use strict";xp();Cp()});var Dr,Pp=M(()=>{"use strict";V();Ws();uc();Dr={Apps:{Icon:Na,View:cc},FileRouter:{Icon:Va,View:()=>m("div",null,"FileRouter")},Profiling:{Icon:rs,View:$s},Settings:{Icon:za,View:()=>m("div",null,"Settings")}}});function Av(){return m("button",{ref:J.rootRef,className:"flex gap-2 cursor-default"},m("nav",{className:"flex flex-col gap-2 justify-between"},m("div",{className:"flex flex-col gap-2"},Object.keys(Dr).map(e=>m(Ov,{key:e,id:e})))),m("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto p-2 bg-neutral-400/5 rounded"},m(ge,{from:Dv},e=>m(e.View,null))))}function Ov({id:e}){let{Icon:t}=Dr[e];return m("button",{key:e,onclick:()=>J.devtoolsTab.value=e,className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(J.devtoolsTab.value===e?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400"),title:e},m(t,{className:"text-primary"}),m("span",{className:"hidden sm:inline"},e))}var Dv,Dp=M(()=>{"use strict";V();Ce();Pp();Dv=Mt(()=>Dr[J.devtoolsTab.value])});var Ap={};Wr(Ap,{AppsIcon:()=>Na,AppsTabView:()=>cc,ChevronRightIcon:()=>Xe,CloseIcon:()=>La,CogIcon:()=>za,ComponentIcon:()=>Zm,DevtoolsApp:()=>Av,ExpandIcon:()=>Jm,ExternalLinkIcon:()=>os,FlameIcon:()=>Fa,FolderTreeIcon:()=>Va,GaugeIcon:()=>rs,GripIcon:()=>Qm,MouseIcon:()=>as,OpenIcon:()=>tb,ProfilingTabView:()=>$s,RadioIcon:()=>Ha,ResizableSplit:()=>nc,ResizeGripIcon:()=>Hn,ValueViewer:()=>Tn,ZapIcon:()=>eb,assert:()=>Ye,buildViewerRoot:()=>sn,clamp:()=>Ke,collectFromRoot:()=>xe,computeComponentHash:()=>bi,createDraggableController:()=>qe,createElementBoundingTracker:()=>Ba,createLineChart:()=>ec,createMousePositionTracker:()=>ls,createResizableController:()=>Bn,devtoolsAppRootHasFocus:()=>Xm,devtoolsState:()=>J,disposeCache:()=>le,emptyCache:()=>Ct,findComponentByHash:()=>Ia,getFileLink:()=>ss,getNodeName:()=>Vn,ifDevtoolsAppRootHasFocus:()=>Ra,isDevtoolsApp:()=>oe,kiruGlobal:()=>dt,trapFocus:()=>Km,typedMapEntries:()=>Ym});var ei=M(()=>{"use strict";Dp();Ws();Sr();Ce();uc();Fn()});var YM,Us,Gs,ye,St,Op,on,ce,Ni=M(()=>{"use strict";V();YM=D(!1),Us=D(!1),Gs=D(!1),ye=D(!1),St=D([]),Op=Mt(()=>St.value.length>0),on=50,ce=D(null)});var Ys=M(()=>{"use strict"});var Rv,Iv,Np,Nv,Lv,zv,Lp=M(()=>{"use strict";V();Z();ei();Ys();Ni();Rv="kiru.devtools.debuggerPosition",Iv="kiru.devtools.debuggerSize",Np=()=>{let e=qe({key:Rv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Iv,storage:sessionStorage,minSize:[320,180]});Tt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:ce.value==="debugger"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>ce.value="debugger"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"auto",scrollbarWidth:"thin",minHeight:0}},m(Nv,null)),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))},Nv=()=>{let e=D([]);return Tt(()=>{let t=dt().devtools.subscribe(n=>{e.value=Array.from(n).map(i=>({...i,link:ss(i.signal)}))});return()=>t()}),m("div",{className:"flex flex-col gap-2 p-2"},m(Ge,{each:e,fallback:m("div",{className:"flex flex-col items-center justify-center gap-2 py-8 px-4 text-center text-neutral-400 text-sm"},m("p",{className:"font-medium"},"No signals tracked"),m("p",{className:"text-xs text-neutral-500 max-w-[240px]"},"Use"," ",m("code",{className:"px-1 py-0.5 rounded bg-neutral-800 text-neutral-300 font-mono text-[11px]"},"DevTools.track(signal, label)")," ","in your app to inspect signal values here."))},t=>m(Lv,{key:\`\${t.signal.$id}:\${t.label}\${t.link}\`,entry:t})))},Lv=({entry:e})=>{let t=J.viewerSettings.peek(),n=s=>s!==null&&typeof s=="object"&&!Array.isArray(s)?s:{value:s},i=D(sn(n(e.signal.peek()),e.label,Ct(),t));return Tt(()=>{let s=e.signal.subscribe(o=>{let r=Ct();xe(i.peek(),e.label,r),i.value=sn(n(o),e.label,r,t),le(r)});return()=>{s();let o=Ct();xe(i.peek(),e.label,o),le(o)}}),()=>m("div",{className:"rounded border border-neutral-700 text-xs"},m("div",{className:"flex items-center justify-between px-2 py-1 border-b border-neutral-700 font-medium text-neutral-300"},e.label,m(zv,{link:e.link})),m(ge,{from:i},s=>m(Tn,{root:s})))},zv=({link:e})=>e?m("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:e,onclick:t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),window.open(e)},title:"Open in editor"},"Open in editor",m(os,{width:"0.65rem",height:"0.65rem"})):null});var Vv,Fv,Fp,Hp=M(()=>{"use strict";V();Z();ei();Ys();Ni();Vv="kiru.devtools.profilerPosition",Fv="kiru.devtools.profilerSize",Fp=()=>{let e=qe({key:Vv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=Bn({key:Fv,storage:sessionStorage,minSize:[320,180],aspectRatio:2/1});Tt(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>m("div",{ref:n,className:ut("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:ce.value==="profiler"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>ce.value="profiler"},m("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"hidden",minHeight:0}},m($s,{pauseWhen:e.isDragging})),m("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"})))}});function Ar({style:e,top:t,left:n,width:i,height:s,...o}){return m("div",{style:{...e,position:"absolute",zIndex:50,top:t+"px",left:n+"px",width:i+"px",height:s+"px",background:"linear-gradient(135deg, rgb(164 11 32 / 66%) 0%, rgb(82 14 47 / 80%) 80%)"},...o})}var dc=M(()=>{"use strict";V()});function Hv(e){let t=null,n=e;for(;n;){if(typeof n.type=="function"){let i=n,s=ss(i.type);if(s){t={component:i,link:s};break}}n=n.parent}return t?{...t,elements:Wp(t.component.child)}:null}function Wp(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Wp(n.child,t),n=n.sibling;return t}var Bp,jp=M(()=>{"use strict";V();ei();Ni();dc();Z();Bp=()=>{let[e,t]=ls();Ht(()=>t());let n=D(null),i=null,s=()=>{let u=ye.value,{x:d,y:f}=e.value;if(!u){n.value=null;return}let p=document.elementsFromPoint(d,f),b=null;for(let E of p){let P=E.__kiruNode;if(P&&(b=Hv(P),b))break}if(!b){n.value=null;return}let x=1/0,y=1/0,w=-1/0,_=-1/0;for(let E of b.elements){let{top:P,left:O,width:A,height:N}=E.getBoundingClientRect();x=Math.min(x,O),y=Math.min(y,P),w=Math.max(w,O+A),_=Math.max(_,P+N)}let S=w-x,T=_-y;n.value={name:Vn(b.component),top:y,left:x,width:S,height:T,link:b.link,component:b.component}},o=()=>{i==null&&(i=requestAnimationFrame(()=>{i=null,s()}))};Ft([ye,e],o);let r=u=>{if(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),!ye.value||!n.value)return;let{name:d,link:f,component:p}=n.value;if(!f)return;let b=bi(p);ye.value=!1;let x=St.value,y=x.findIndex(w=>w.hash===b&&w.link===f);if(y!==-1){let w=x[y],_={...w,pulseGeneration:(w.pulseGeneration??0)+1},S=x.filter(T=>T.id!==w.id);St.value=[...S,_],ce.value="componentInfo";return}St.value=[...x,{id:crypto.randomUUID(),name:d,link:f,component:p,unmounted:!1,hash:b,pulseGeneration:0}],ce.value="componentInfo"},a=u=>{oe(u)||o()};dt().on("update",a),window.addEventListener("resize",o),window.addEventListener("scroll",o);let l=new MutationObserver(o);l.observe(document.body,{childList:!0,subtree:!0});let c=new ResizeObserver(o);return c.observe(document.body),Ht(()=>{dt().off("update",a),window.removeEventListener("resize",o),window.removeEventListener("scroll",o),l.disconnect(),c.disconnect()}),({state:u})=>{let d=ye.value,f=n.value;return!d||!f||u==="exited"?null:m(Ar,{top:f.top+window.scrollY,left:f.left+window.scrollX,width:f.width,height:f.height,className:ut("text-white flex items-center justify-center",u==="entered"?"opacity-100":"opacity-90",u==="entered"?"scale-100":"scale-90"),onclick:r},m("span",{className:"font-medium text-sm truncate max-w-full"},\`<\${f.name}>\`))}}});function Gp(e){let t={...e.props};return delete t.children,t}function fc(e){let t=Ct();xe(e,"props",t),le(t)}function Yp(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Yp(n.child,t),n=n.sibling;return t}function $v(e){if(!e.child)return null;let t=Yp(e.child);if(t.size===0)return null;let n=1/0,i=1/0,s=-1/0,o=-1/0;for(let l of t){let{top:c,left:u,width:d,height:f}=l.getBoundingClientRect();n=Math.min(n,u),i=Math.min(i,c),s=Math.max(s,u+d),o=Math.max(o,c+f)}let r=s-n,a=o-i;return{top:i,left:n,width:r,height:a}}var Bv,Wv,jv,Uv,Kp,Xp=M(()=>{"use strict";V();Z();ei();Ys();Ni();dc();Bv="kiru.devtools.componentInfoPosition",Wv="kiru.devtools.componentInfoSize",jv=300;Uv=()=>{let e=D(null),t=D(null),n=D(null),i=D(!1),s=D(!1),o=-1;Ft(()=>{let u=n.value;if(!u){let _=e.peek();_&&(fc(_),e.value=null);return}let d=St.value,f=d.find(_=>_.id===u);if(!f){let _=e.peek();_&&(fc(_),e.value=null);return}if(f.pulseGeneration!==o&&(o=f.pulseGeneration,f.pulseGeneration>0&&(s.value=!0,setTimeout(()=>{o===f.pulseGeneration&&(s.value=!1)},jv))),!f.unmounted){let _=bi(f.component);t.value=_,f.hash!==_&&(St.value=d.map(S=>S.id===u?{...S,hash:_}:S))}if(f.unmounted)return;let p=e.peek(),b=Ct();p&&xe(p,"props",b);let x=J.viewerSettings.peek(),y=Gp(f.component),w=sn(y,"props",b,x);e.value=w,le(b)}),Ht(()=>{let u=e.peek();u&&(fc(u),e.value=null)});let r=qe({key:Bv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),a=Bn({key:Wv,storage:sessionStorage,minSize:[320,200]});Tt(()=>{r.init(),a.init();let u=d=>{let f=n.value;if(!f)return;let p=St.value,b=p.find(S=>S.id===f);if(!b||oe(d))return;let x=Lt(b.component);if(x&&x!==d)return;if(b.unmounted){let S=t.value;if(!S)return;let T=Ia(d.rootNode,S);if(!T)return;St.value=p.map(E=>E.id===f?{...E,component:T,unmounted:!1}:E);return}if(So(b.component)){St.value=p.map(S=>S.id===f?{...S,unmounted:!0}:S);return}let y=e.peek();if(!y)return;let w=J.viewerSettings.peek(),_=Ct();xe(y,"props",_),e.value=sn(Gp(b.component),"props",_,w),le(_)};return dt().on("update",u),()=>{r.dispose(),a.dispose(),dt().off("update",u)}});let l=u=>{r.containerRef.value=u,r.handleRef.value=u,a.containerRef.value=u},c=u=>{a.handleRef.value=u};return({panel:u,state:d})=>{n.value||(n.value=u.id);let p=St.value.find(_=>_.id===u.id);if(!p)return null;let b=()=>{let _=St.value,S=_.find(T=>T.id===u.id);S&&(St.value=[..._.filter(T=>T.id!==u.id),S],ce.value="componentInfo")},x=i.value,y=s.value,w=x&&!p.unmounted?$v(p.component):null;return m(vt,null,w&&m(Ar,{top:w.top+window.scrollY,left:w.left+window.scrollX,width:w.width,height:w.height,className:ut("pointer-events-none",d==="entered"?"opacity-100":"opacity-90")}),m("div",{ref:l,className:"fixed p-0.5 flex flex-col gap-2 select-none z-index-1001",style:{zIndex:ce.value==="componentInfo"?on+1:on,minWidth:\`\${320}px\`,minHeight:\`\${200}px\`,opacity:d==="entered"?1:0,cursor:a.isResizing.value?"se-resize":r.isDragging.value?"grabbing":"grab"},onclick:b,onmousedown:b,onmouseenter:()=>i.value=!0,onmouseleave:()=>i.value=!1},m("div",{style:{transition:"80ms ease-in-out",opacity:y?1:.75,flex:1,scrollbarWidth:"thin",minHeight:0,overflow:"hidden",boxShadow:y?"0 0 8px crimson":void 0},className:"rounded-lg bg-neutral-900 opacity-75 hover:opacity-100! shadow-lg"},m("div",{className:"flex flex-col text-sm overflow-auto"},m("div",{className:"flex items-center justify-between gap-2 p-2"},m("a",{href:p.link,className:ut("flex items-center justify-center gap-2","text-neutral-400 hover:text-neutral-200"),onclick:_=>{_.preventDefault(),_.stopPropagation(),window.open(p.link)},onmousedown:_=>_.stopPropagation(),title:"Open in editor"},\`<\${p.name}>\`,m(os,{className:"w-4 h-4 shrink-0 pointer-events-none"})),m("div",{className:"flex items-center gap-2"},p.unmounted&&m("span",{className:"rounded bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-medium text-amber-400"},"Unmounted"),m("button",{type:"button",className:"p-1 text-neutral-400 hover:text-neutral-200",onclick:()=>{St.value=St.value.filter(_=>_.id!==u.id)},title:"Close"},m(La,{className:"w-4 h-4 shrink-0 pointer-events-none"})))),m("div",{className:"pt-2 px-4"},m("div",{className:"mb-1.5 font-medium text-neutral-300 text-xs"},"Props"),m(ge,{from:e},_=>_?_.children.length===0?m("div",{className:"text-neutral-500 text-xs italic py-1"},"No props"):m(Tn,{root:_,className:"text-xs"}):null)))),m("div",{ref:c,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},m(Hn,{className:"text-neutral-500"}))))}},Kp=({state:e})=>m(Ge,{each:St},(t,n)=>m(Uv,{key:t.id,panel:t,index:n,state:e}))});var qp=M(()=>{"use strict";Lp();Hp();jp();Xp()});var eg={};Wr(eg,{default:()=>tg});function tg(){let e=qe({storage:localStorage,key:Gv,defaultPosition:{type:"snapped",side:"bottom",percent:.5},getPadding:()=>[10,10],getDraggableBounds:()=>[window.innerWidth,window.innerHeight],onclick:()=>hc.value=!hc.value}),t=Mt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"column":"row"}),n=Mt(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"row":"column"});return Tt(()=>{e.init();let i=e.containerRef.value,s=Jp.current;Ft([hc,e.snapSide,e.containerPos],(o,r,[a,l])=>{let[c,u]=[s.offsetWidth,s.offsetHeight],d=e.handleRef.value,f=d?.offsetWidth??0,p=d?.offsetHeight??0,b=0,x=0;if(r==="top"||r==="bottom"){let P=a+i.offsetWidth/2-c/2;b=Ke(P,10,window.innerWidth-10-c)-P}else{let P=l+i.offsetHeight/2-u/2;x=Ke(P,10,window.innerHeight-10-u)-P}let y=f/2+8+c/2,w=p/2+8+u/2,_=0,S=0;r==="left"?_=o?y:-y:r==="right"?_=o?-y:y:r==="top"?S=o?w:-w:S=o?-w:w;let T=-c/2+b+_,E=-u/2+x+S;s.style.transform=\`scale(\${o?1:0}) translate(\${T}px, \${E}px)\`,setTimeout(()=>{Qp.value=!0},50)})}),()=>m(vt,null,m("div",{ref:e.containerRef,style:{transition:"80ms",opacity:Yv,flexDirection:n},className:"z-999999 top-0 left-0 flex items-center justify-center"},m("button",{ref:e.handleRef,className:"rounded-full p-2 z-10",style:{background:"linear-gradient(135deg, rgb(143 1 1 / 90%) 0%, rgba(119, 14, 103, 0.89) 75%)"}},m(Fa,{className:"w-5 h-5"})),m("div",{ref:Jp,style:{transition:"80ms ease-in-out",transformOrigin:"0 0",flexDirection:t},className:ut("absolute left-1/2 top-1/2 z-0 flex p-1 gap-1","bg-neutral-900 rounded-xl shadow-sm")},m(pc,{active:Us,title:"Toggle Profiler",onclick:()=>Us.value=!Us.value},m(rs,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Profiler")),m(pc,{active:Gs,title:"Toggle Debugger",onclick:()=>Gs.value=!Gs.value},m(Ha,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Tracking")),m(pc,{active:ye,title:"Select Component",onclick:()=>{ye.value=!ye.value}},m(as,{className:"w-4 h-4 pointer-events-none"}),m("small",null,"Inspect")))),m(mi,{in:Us,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Fp,{state:i})}),m(mi,{in:Gs,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Np,{state:i})}),m(mi,{in:ye,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Bp,{state:i})}),m(mi,{in:Op,duration:{in:0,out:150},element:i=>i==="exited"?null:m(Kp,{state:i})}))}var Gv,Qp,hc,Jp,Yv,pc,ng=M(()=>{"use strict";V();Z();ei();Ni();Ys();qp();Gv="kiru.devtools.anchorPosition",Qp=D(!1),hc=D(!1),Jp=pn(null),Yv=Mt(()=>Qp.value?1:0);pc=()=>{let{derive:e}=Aa(),t=e(({className:i,active:s})=>{let o=!!s?.value;return ut("flex items-center px-1.5 py-0.5 gap-2","text-sm rounded-lg border border-white/10",o?"text-neutral-100":"bg-white/2.5 hover:bg-white/5 text-neutral-400","transition-colors duration-150",q(i,!0))}),n=e(({active:i})=>!!i?.value?"linear-gradient(135deg, rgb(143 1 1 / 75%) 0%, rgba(119, 14, 103, 0.89) 65%)":"transparent");return({className:i,active:s,...o})=>m("button",{className:t,style:{background:n},...o})}});var Ic=\`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
5422
+ \`;return function(){var C=new Error("get-stack-trace"),I=C&&C.stack?C.stack.replace(/^[^\\(]+?[\\n$]/gm,"").replace(/^\\s+at\\s+/gm,"").replace(/^Object.<anonymous>\\s*\\(/gm,"{anonymous}()@"):"Unknown Stack Trace",G=e.console&&(e.console.warn||e.console.log);return G&&G.call(e.console,k,I),h.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(m){if(m===i||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var v=Object(m),k=1;k<arguments.length;k++){var C=arguments[k];if(C!==i&&C!==null)for(var I in C)C.hasOwnProperty(I)&&(v[I]=C[I])}return v}:b=Object.assign;var x=p(function(m,v,k){for(var C=Object.keys(v),I=0;I<C.length;)(!k||k&&m[C[I]]===i)&&(m[C[I]]=v[C[I]]),I++;return m},"extend","Use \`assign\`."),y=p(function(m,v){return x(m,v,!0)},"merge","Use \`assign\`.");function w(h,m,v){var k=m.prototype,C;C=h.prototype=Object.create(k),C.constructor=h,C._super=k,v&&b(C,v)}function _(h,m){return function(){return h.apply(m,arguments)}}function S(h,m){return typeof h==r?h.apply(m&&m[0]||i,m):h}function E(h,m){return h===i?m:h}function T(h,m,v){f(N(m),function(k){h.addEventListener(k,v,!1)})}function R(h,m,v){f(N(m),function(k){h.removeEventListener(k,v,!1)})}function O(h,m){for(;h;){if(h==m)return!0;h=h.parentNode}return!1}function P(h,m){return h.indexOf(m)>-1}function N(h){return h.trim().split(/\\s+/g)}function W(h,m,v){if(h.indexOf&&!v)return h.indexOf(m);for(var k=0;k<h.length;){if(v&&h[k][v]==m||!v&&h[k]===m)return k;k++}return-1}function H(h){return Array.prototype.slice.call(h,0)}function B(h,m,v){for(var k=[],C=[],I=0;I<h.length;){var G=m?h[I][m]:h[I];W(C,G)<0&&k.push(h[I]),C[I]=G,I++}return v&&(m?k=k.sort(function(wt,Dt){return wt[m]>Dt[m]}):k=k.sort()),k}function st(h,m){for(var v,k,C=m[0].toUpperCase()+m.slice(1),I=0;I<s.length;){if(v=s[I],k=v?v+C:m,k in h)return k;I++}return i}var Mt=1;function tt(){return Mt++}function nt(h){var m=h.ownerDocument||h;return m.defaultView||m.parentWindow||e}var vt=/mobile|tablet|ip(ad|hone|od)|android/i,Ee="ontouchstart"in e,$e=st(e,"PointerEvent")!==i,ge=Ee&&vt.test(navigator.userAgent),Vt="touch",me="pen",Xt="mouse",qt="kinect",Zt=25,et=1,be=2,lt=4,ot=8,oi=1,zi=2,Vi=4,Fi=8,Hi=16,Me=zi|Vi,Rn=Fi|Hi,mc=Me|Rn,bc=["x","y"],qs=["clientX","clientY"];function se(h,m){var v=this;this.manager=h,this.callback=m,this.element=h.element,this.target=h.options.inputTarget,this.domHandler=function(k){S(h.options.enable,[h])&&v.handler(k)},this.init()}se.prototype={handler:function(){},init:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(nt(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&R(this.element,this.evEl,this.domHandler),this.evTarget&&R(this.target,this.evTarget,this.domHandler),this.evWin&&R(nt(this.element),this.evWin,this.domHandler)}};function rg(h){var m,v=h.options.inputClass;return v?m=v:$e?m=Ir:ge?m=Qs:Ee?m=Nr:m=Js,new m(h,ag)}function ag(h,m,v){var k=v.pointers.length,C=v.changedPointers.length,I=m&et&&k-C===0,G=m&(lt|ot)&&k-C===0;v.isFirst=!!I,v.isFinal=!!G,I&&(h.session={}),v.eventType=m,lg(h,v),h.emit("hammer.input",v),h.recognize(v),h.session.prevInput=v}function lg(h,m){var v=h.session,k=m.pointers,C=k.length;v.firstInput||(v.firstInput=xc(m)),C>1&&!v.firstMultiple?v.firstMultiple=xc(m):C===1&&(v.firstMultiple=!1);var I=v.firstInput,G=v.firstMultiple,xt=G?G.center:I.center,wt=m.center=yc(k);m.timeStamp=c(),m.deltaTime=m.timeStamp-I.timeStamp,m.angle=Or(xt,wt),m.distance=Zs(xt,wt),cg(v,m),m.offsetDirection=wc(m.deltaX,m.deltaY);var Dt=vc(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=Dt.x,m.overallVelocityY=Dt.y,m.overallVelocity=l(Dt.x)>l(Dt.y)?Dt.x:Dt.y,m.scale=G?fg(G.pointers,k):1,m.rotation=G?dg(G.pointers,k):0,m.maxPointers=v.prevInput?m.pointers.length>v.prevInput.maxPointers?m.pointers.length:v.prevInput.maxPointers:m.pointers.length,ug(v,m);var Ce=h.element;O(m.srcEvent.target,Ce)&&(Ce=m.srcEvent.target),m.target=Ce}function cg(h,m){var v=m.center,k=h.offsetDelta||{},C=h.prevDelta||{},I=h.prevInput||{};(m.eventType===et||I.eventType===lt)&&(C=h.prevDelta={x:I.deltaX||0,y:I.deltaY||0},k=h.offsetDelta={x:v.x,y:v.y}),m.deltaX=C.x+(v.x-k.x),m.deltaY=C.y+(v.y-k.y)}function ug(h,m){var v=h.lastInterval||m,k=m.timeStamp-v.timeStamp,C,I,G,xt;if(m.eventType!=ot&&(k>Zt||v.velocity===i)){var wt=m.deltaX-v.deltaX,Dt=m.deltaY-v.deltaY,Ce=vc(k,wt,Dt);I=Ce.x,G=Ce.y,C=l(Ce.x)>l(Ce.y)?Ce.x:Ce.y,xt=wc(wt,Dt),h.lastInterval=m}else C=v.velocity,I=v.velocityX,G=v.velocityY,xt=v.direction;m.velocity=C,m.velocityX=I,m.velocityY=G,m.direction=xt}function xc(h){for(var m=[],v=0;v<h.pointers.length;)m[v]={clientX:a(h.pointers[v].clientX),clientY:a(h.pointers[v].clientY)},v++;return{timeStamp:c(),pointers:m,center:yc(m),deltaX:h.deltaX,deltaY:h.deltaY}}function yc(h){var m=h.length;if(m===1)return{x:a(h[0].clientX),y:a(h[0].clientY)};for(var v=0,k=0,C=0;C<m;)v+=h[C].clientX,k+=h[C].clientY,C++;return{x:a(v/m),y:a(k/m)}}function vc(h,m,v){return{x:m/h||0,y:v/h||0}}function wc(h,m){return h===m?oi:l(h)>=l(m)?h<0?zi:Vi:m<0?Fi:Hi}function Zs(h,m,v){v||(v=bc);var k=m[v[0]]-h[v[0]],C=m[v[1]]-h[v[1]];return Math.sqrt(k*k+C*C)}function Or(h,m,v){v||(v=bc);var k=m[v[0]]-h[v[0]],C=m[v[1]]-h[v[1]];return Math.atan2(C,k)*180/Math.PI}function dg(h,m){return Or(m[1],m[0],qs)+Or(h[1],h[0],qs)}function fg(h,m){return Zs(m[0],m[1],qs)/Zs(h[0],h[1],qs)}var hg={mousedown:et,mousemove:be,mouseup:lt},pg="mousedown",gg="mousemove mouseup";function Js(){this.evEl=pg,this.evWin=gg,this.pressed=!1,se.apply(this,arguments)}w(Js,se,{handler:function(m){var v=hg[m.type];v&et&&m.button===0&&(this.pressed=!0),v&be&&m.which!==1&&(v=lt),this.pressed&&(v&lt&&(this.pressed=!1),this.callback(this.manager,v,{pointers:[m],changedPointers:[m],pointerType:Xt,srcEvent:m}))}});var mg={pointerdown:et,pointermove:be,pointerup:lt,pointercancel:ot,pointerout:ot},bg={2:Vt,3:me,4:Xt,5:qt},_c="pointerdown",kc="pointermove pointerup pointercancel";e.MSPointerEvent&&!e.PointerEvent&&(_c="MSPointerDown",kc="MSPointerMove MSPointerUp MSPointerCancel");function Ir(){this.evEl=_c,this.evWin=kc,se.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(Ir,se,{handler:function(m){var v=this.store,k=!1,C=m.type.toLowerCase().replace("ms",""),I=mg[C],G=bg[m.pointerType]||m.pointerType,xt=G==Vt,wt=W(v,m.pointerId,"pointerId");I&et&&(m.button===0||xt)?wt<0&&(v.push(m),wt=v.length-1):I&(lt|ot)&&(k=!0),!(wt<0)&&(v[wt]=m,this.callback(this.manager,I,{pointers:v,changedPointers:[m],pointerType:G,srcEvent:m}),k&&v.splice(wt,1))}});var xg={touchstart:et,touchmove:be,touchend:lt,touchcancel:ot},yg="touchstart",vg="touchstart touchmove touchend touchcancel";function Sc(){this.evTarget=yg,this.evWin=vg,this.started=!1,se.apply(this,arguments)}w(Sc,se,{handler:function(m){var v=xg[m.type];if(v===et&&(this.started=!0),!!this.started){var k=wg.call(this,m,v);v&(lt|ot)&&k[0].length-k[1].length===0&&(this.started=!1),this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:Vt,srcEvent:m})}}});function wg(h,m){var v=H(h.touches),k=H(h.changedTouches);return m&(lt|ot)&&(v=B(v.concat(k),"identifier",!0)),[v,k]}var _g={touchstart:et,touchmove:be,touchend:lt,touchcancel:ot},kg="touchstart touchmove touchend touchcancel";function Qs(){this.evTarget=kg,this.targetIds={},se.apply(this,arguments)}w(Qs,se,{handler:function(m){var v=_g[m.type],k=Sg.call(this,m,v);k&&this.callback(this.manager,v,{pointers:k[0],changedPointers:k[1],pointerType:Vt,srcEvent:m})}});function Sg(h,m){var v=H(h.touches),k=this.targetIds;if(m&(et|be)&&v.length===1)return k[v[0].identifier]=!0,[v,v];var C,I,G=H(h.changedTouches),xt=[],wt=this.target;if(I=v.filter(function(Dt){return O(Dt.target,wt)}),m===et)for(C=0;C<I.length;)k[I[C].identifier]=!0,C++;for(C=0;C<G.length;)k[G[C].identifier]&&xt.push(G[C]),m&(lt|ot)&&delete k[G[C].identifier],C++;if(xt.length)return[B(I.concat(xt),"identifier",!0),xt]}var Eg=2500,Ec=25;function Nr(){se.apply(this,arguments);var h=_(this.handler,this);this.touch=new Qs(this.manager,h),this.mouse=new Js(this.manager,h),this.primaryTouch=null,this.lastTouches=[]}w(Nr,se,{handler:function(m,v,k){var C=k.pointerType==Vt,I=k.pointerType==Xt;if(!(I&&k.sourceCapabilities&&k.sourceCapabilities.firesTouchEvents)){if(C)Mg.call(this,v,k);else if(I&&Tg.call(this,k))return;this.callback(m,v,k)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Mg(h,m){h&et?(this.primaryTouch=m.changedPointers[0].identifier,Mc.call(this,m)):h&(lt|ot)&&Mc.call(this,m)}function Mc(h){var m=h.changedPointers[0];if(m.identifier===this.primaryTouch){var v={x:m.clientX,y:m.clientY};this.lastTouches.push(v);var k=this.lastTouches,C=function(){var I=k.indexOf(v);I>-1&&k.splice(I,1)};setTimeout(C,Eg)}}function Tg(h){for(var m=h.srcEvent.clientX,v=h.srcEvent.clientY,k=0;k<this.lastTouches.length;k++){var C=this.lastTouches[k],I=Math.abs(m-C.x),G=Math.abs(v-C.y);if(I<=Ec&&G<=Ec)return!0}return!1}var Tc=st(o.style,"touchAction"),Cc=Tc!==i,Pc="compute",Dc="auto",Lr="manipulation",On="none",Bi="pan-x",Wi="pan-y",to=Pg();function zr(h,m){this.manager=h,this.set(m)}zr.prototype={set:function(h){h==Pc&&(h=this.compute()),Cc&&this.manager.element.style&&to[h]&&(this.manager.element.style[Tc]=h),this.actions=h.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var h=[];return f(this.manager.recognizers,function(m){S(m.options.enable,[m])&&(h=h.concat(m.getTouchAction()))}),Cg(h.join(" "))},preventDefaults:function(h){var m=h.srcEvent,v=h.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var k=this.actions,C=P(k,On)&&!to[On],I=P(k,Wi)&&!to[Wi],G=P(k,Bi)&&!to[Bi];if(C){var xt=h.pointers.length===1,wt=h.distance<2,Dt=h.deltaTime<250;if(xt&&wt&&Dt)return}if(!(G&&I)&&(C||I&&v&Me||G&&v&Rn))return this.preventSrc(m)},preventSrc:function(h){this.manager.session.prevented=!0,h.preventDefault()}};function Cg(h){if(P(h,On))return On;var m=P(h,Bi),v=P(h,Wi);return m&&v?On:m||v?m?Bi:Wi:P(h,Lr)?Lr:Dc}function Pg(){if(!Cc)return!1;var h={},m=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(v){h[v]=m?e.CSS.supports("touch-action",v):!0}),h}var eo=1,oe=2,ri=4,fn=8,Ue=fn,ji=16,Te=32;function Ge(h){this.options=b({},this.defaults,h||{}),this.id=tt(),this.manager=null,this.options.enable=E(this.options.enable,!0),this.state=eo,this.simultaneous={},this.requireFail=[]}Ge.prototype={defaults:{},set:function(h){return b(this.options,h),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(h){if(d(h,"recognizeWith",this))return this;var m=this.simultaneous;return h=no(h,this),m[h.id]||(m[h.id]=h,h.recognizeWith(this)),this},dropRecognizeWith:function(h){return d(h,"dropRecognizeWith",this)?this:(h=no(h,this),delete this.simultaneous[h.id],this)},requireFailure:function(h){if(d(h,"requireFailure",this))return this;var m=this.requireFail;return h=no(h,this),W(m,h)===-1&&(m.push(h),h.requireFailure(this)),this},dropRequireFailure:function(h){if(d(h,"dropRequireFailure",this))return this;h=no(h,this);var m=W(this.requireFail,h);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(h){return!!this.simultaneous[h.id]},emit:function(h){var m=this,v=this.state;function k(C){m.manager.emit(C,h)}v<fn&&k(m.options.event+Ac(v)),k(m.options.event),h.additionalEvent&&k(h.additionalEvent),v>=fn&&k(m.options.event+Ac(v))},tryEmit:function(h){if(this.canEmit())return this.emit(h);this.state=Te},canEmit:function(){for(var h=0;h<this.requireFail.length;){if(!(this.requireFail[h].state&(Te|eo)))return!1;h++}return!0},recognize:function(h){var m=b({},h);if(!S(this.options.enable,[this,m])){this.reset(),this.state=Te;return}this.state&(Ue|ji|Te)&&(this.state=eo),this.state=this.process(m),this.state&(oe|ri|fn|ji)&&this.tryEmit(m)},process:function(h){},getTouchAction:function(){},reset:function(){}};function Ac(h){return h&ji?"cancel":h&fn?"end":h&ri?"move":h&oe?"start":""}function Rc(h){return h==Hi?"down":h==Fi?"up":h==zi?"left":h==Vi?"right":""}function no(h,m){var v=m.manager;return v?v.get(h):h}function xe(){Ge.apply(this,arguments)}w(xe,Ge,{defaults:{pointers:1},attrTest:function(h){var m=this.options.pointers;return m===0||h.pointers.length===m},process:function(h){var m=this.state,v=h.eventType,k=m&(oe|ri),C=this.attrTest(h);return k&&(v&ot||!C)?m|ji:k||C?v&lt?m|fn:m&oe?m|ri:oe:Te}});function io(){xe.apply(this,arguments),this.pX=null,this.pY=null}w(io,xe,{defaults:{event:"pan",threshold:10,pointers:1,direction:mc},getTouchAction:function(){var h=this.options.direction,m=[];return h&Me&&m.push(Wi),h&Rn&&m.push(Bi),m},directionTest:function(h){var m=this.options,v=!0,k=h.distance,C=h.direction,I=h.deltaX,G=h.deltaY;return C&m.direction||(m.direction&Me?(C=I===0?oi:I<0?zi:Vi,v=I!=this.pX,k=Math.abs(h.deltaX)):(C=G===0?oi:G<0?Fi:Hi,v=G!=this.pY,k=Math.abs(h.deltaY))),h.direction=C,v&&k>m.threshold&&C&m.direction},attrTest:function(h){return xe.prototype.attrTest.call(this,h)&&(this.state&oe||!(this.state&oe)&&this.directionTest(h))},emit:function(h){this.pX=h.deltaX,this.pY=h.deltaY;var m=Rc(h.direction);m&&(h.additionalEvent=this.options.event+m),this._super.emit.call(this,h)}});function Vr(){xe.apply(this,arguments)}w(Vr,xe,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[On]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.scale-1)>this.options.threshold||this.state&oe)},emit:function(h){if(h.scale!==1){var m=h.scale<1?"in":"out";h.additionalEvent=this.options.event+m}this._super.emit.call(this,h)}});function Fr(){Ge.apply(this,arguments),this._timer=null,this._input=null}w(Fr,Ge,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Dc]},process:function(h){var m=this.options,v=h.pointers.length===m.pointers,k=h.distance<m.threshold,C=h.deltaTime>m.time;if(this._input=h,!k||!v||h.eventType&(lt|ot)&&!C)this.reset();else if(h.eventType&et)this.reset(),this._timer=u(function(){this.state=Ue,this.tryEmit()},m.time,this);else if(h.eventType&lt)return Ue;return Te},reset:function(){clearTimeout(this._timer)},emit:function(h){this.state===Ue&&(h&&h.eventType&lt?this.manager.emit(this.options.event+"up",h):(this._input.timeStamp=c(),this.manager.emit(this.options.event,this._input)))}});function Hr(){xe.apply(this,arguments)}w(Hr,xe,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[On]},attrTest:function(h){return this._super.attrTest.call(this,h)&&(Math.abs(h.rotation)>this.options.threshold||this.state&oe)}});function Br(){xe.apply(this,arguments)}w(Br,xe,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Me|Rn,pointers:1},getTouchAction:function(){return io.prototype.getTouchAction.call(this)},attrTest:function(h){var m=this.options.direction,v;return m&(Me|Rn)?v=h.overallVelocity:m&Me?v=h.overallVelocityX:m&Rn&&(v=h.overallVelocityY),this._super.attrTest.call(this,h)&&m&h.offsetDirection&&h.distance>this.options.threshold&&h.maxPointers==this.options.pointers&&l(v)>this.options.velocity&&h.eventType&lt},emit:function(h){var m=Rc(h.offsetDirection);m&&this.manager.emit(this.options.event+m,h),this.manager.emit(this.options.event,h)}});function so(){Ge.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(so,Ge,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Lr]},process:function(h){var m=this.options,v=h.pointers.length===m.pointers,k=h.distance<m.threshold,C=h.deltaTime<m.time;if(this.reset(),h.eventType&et&&this.count===0)return this.failTimeout();if(k&&C&&v){if(h.eventType!=lt)return this.failTimeout();var I=this.pTime?h.timeStamp-this.pTime<m.interval:!0,G=!this.pCenter||Zs(this.pCenter,h.center)<m.posThreshold;this.pTime=h.timeStamp,this.pCenter=h.center,!G||!I?this.count=1:this.count+=1,this._input=h;var xt=this.count%m.taps;if(xt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=Ue,this.tryEmit()},m.interval,this),oe):Ue}return Te},failTimeout:function(){return this._timer=u(function(){this.state=Te},this.options.interval,this),Te},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ue&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function Ye(h,m){return m=m||{},m.recognizers=E(m.recognizers,Ye.defaults.preset),new Wr(h,m)}Ye.VERSION="2.0.7",Ye.defaults={domEvents:!1,touchAction:Pc,enable:!0,inputTarget:null,inputClass:null,preset:[[Hr,{enable:!1}],[Vr,{enable:!1},["rotate"]],[Br,{direction:Me}],[io,{direction:Me},["swipe"]],[so],[so,{event:"doubletap",taps:2},["tap"]],[Fr]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Dg=1,Oc=2;function Wr(h,m){this.options=b({},Ye.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||h,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=h,this.input=rg(this),this.touchAction=new zr(this,this.options.touchAction),Ic(this,!0),f(this.options.recognizers,function(v){var k=this.add(new v[0](v[1]));v[2]&&k.recognizeWith(v[2]),v[3]&&k.requireFailure(v[3])},this)}Wr.prototype={set:function(h){return b(this.options,h),h.touchAction&&this.touchAction.update(),h.inputTarget&&(this.input.destroy(),this.input.target=h.inputTarget,this.input.init()),this},stop:function(h){this.session.stopped=h?Oc:Dg},recognize:function(h){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(h);var v,k=this.recognizers,C=m.curRecognizer;(!C||C&&C.state&Ue)&&(C=m.curRecognizer=null);for(var I=0;I<k.length;)v=k[I],m.stopped!==Oc&&(!C||v==C||v.canRecognizeWith(C))?v.recognize(h):v.reset(),!C&&v.state&(oe|ri|fn)&&(C=m.curRecognizer=v),I++}},get:function(h){if(h instanceof Ge)return h;for(var m=this.recognizers,v=0;v<m.length;v++)if(m[v].options.event==h)return m[v];return null},add:function(h){if(d(h,"add",this))return this;var m=this.get(h.options.event);return m&&this.remove(m),this.recognizers.push(h),h.manager=this,this.touchAction.update(),h},remove:function(h){if(d(h,"remove",this))return this;if(h=this.get(h),h){var m=this.recognizers,v=W(m,h);v!==-1&&(m.splice(v,1),this.touchAction.update())}return this},on:function(h,m){if(h!==i&&m!==i){var v=this.handlers;return f(N(h),function(k){v[k]=v[k]||[],v[k].push(m)}),this}},off:function(h,m){if(h!==i){var v=this.handlers;return f(N(h),function(k){m?v[k]&&v[k].splice(W(v[k],m),1):delete v[k]}),this}},emit:function(h,m){this.options.domEvents&&Ag(h,m);var v=this.handlers[h]&&this.handlers[h].slice();if(!(!v||!v.length)){m.type=h,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var k=0;k<v.length;)v[k](m),k++}},destroy:function(){this.element&&Ic(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Ic(h,m){var v=h.element;if(v.style){var k;f(h.options.cssProps,function(C,I){k=st(v.style,I),m?(h.oldCssProps[k]=v.style[k],v.style[k]=C):v.style[k]=h.oldCssProps[k]||""}),m||(h.oldCssProps={})}}function Ag(h,m){var v=t.createEvent("Event");v.initEvent(h,!0,!0),v.gesture=m,m.target.dispatchEvent(v)}b(Ye,{INPUT_START:et,INPUT_MOVE:be,INPUT_END:lt,INPUT_CANCEL:ot,STATE_POSSIBLE:eo,STATE_BEGAN:oe,STATE_CHANGED:ri,STATE_ENDED:fn,STATE_RECOGNIZED:Ue,STATE_CANCELLED:ji,STATE_FAILED:Te,DIRECTION_NONE:oi,DIRECTION_LEFT:zi,DIRECTION_RIGHT:Vi,DIRECTION_UP:Fi,DIRECTION_DOWN:Hi,DIRECTION_HORIZONTAL:Me,DIRECTION_VERTICAL:Rn,DIRECTION_ALL:mc,Manager:Wr,Input:se,TouchAction:zr,TouchInput:Qs,MouseInput:Js,PointerEventInput:Ir,TouchMouseInput:Nr,SingleTouchInput:Sc,Recognizer:Ge,AttrRecognizer:xe,Tap:so,Pan:io,Swipe:Br,Pinch:Vr,Rotate:Hr,Press:Fr,on:T,off:R,each:f,merge:y,extend:x,assign:b,inherit:w,bindFn:_,prefixed:st});var Rg=typeof e<"u"?e:typeof self<"u"?self:{};Rg.Hammer=Ye,typeof define=="function"&&define.amd?define(function(){return Ye}):typeof kr<"u"&&kr.exports?kr.exports=Ye:e[n]=Ye})(window,document,"Hammer")});var Eh=M(()=>{Cl();});var Mh=M(()=>{Eh()});function Dn(e,t,n){return e===void 0?!0:typeof e=="string"?e.indexOf(t)!==-1:typeof e=="function"?e({chart:n}).indexOf(t)!==-1:!1}function Yl(e,t){return typeof e=="function"&&(e=e({chart:t})),typeof e=="string"?{x:e.indexOf("x")!==-1,y:e.indexOf("y")!==-1}:{x:!1,y:!1}}function _y(e,t){let n;return function(){return clearTimeout(n),n=setTimeout(e,t),t}}function ky({x:e,y:t},n){let i=n.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){let r=i[s[o]];if(t>=r.top&&t<=r.bottom&&e>=r.left&&e<=r.right)return r}return null}function Hh(e,t,n){let{mode:i="xy",scaleMode:s,overScaleMode:o}=e||{},r=ky(t,n),a=Yl(i,n),l=Yl(s,n);if(o){let u=Yl(o,n);for(let d of["x","y"])u[d]&&(l[d]=a[d],a[d]=!1)}if(r&&l[r.axis])return[r];let c=[];return U(n.scales,function(u){a[u.axis]&&c.push(u)}),c}function at(e){let t=Kl.get(e);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},Kl.set(e,t)),t}function Sy(e){Kl.delete(e)}function Bh(e,t,n,i){let s=Math.max(0,Math.min(1,(e-t)/n||0)),o=1-s;return{min:i*s,max:i*o}}function Wh(e,t){let n=e.isHorizontal()?t.x:t.y;return e.getValueForPixel(n)}function jh(e,t,n){let i=e.max-e.min,s=i*(t-1),o=Wh(e,n);return Bh(o,e.min,i,s)}function Ey(e,t,n){let i=Wh(e,n);if(i===void 0)return{min:e.min,max:e.max};let s=Math.log10(e.min),o=Math.log10(e.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=Bh(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function My(e,t){return t&&(t[e.id]||t[e.axis])||{}}function Th(e,t,n,i,s){let o=n[i];if(o==="original"){let r=e.originalScaleLimits[t.id][i];o=$(r.options,r.scale)}return $(o,s)}function Ty(e,t,n){let i=e.getValueForPixel(t),s=e.getValueForPixel(n);return{min:Math.min(i,s),max:Math.max(i,s)}}function Cy(e,{min:t,max:n,minLimit:i,maxLimit:s},o){let r=(e-n+t)/2;t-=r,n+=r;let a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=e/1e6;return ze(t,a,c)&&(t=a),ze(n,l,c)&&(n=l),t<i?(t=i,n=Math.min(i+e,s)):n>s&&(n=s,t=Math.max(s-e,i)),{min:t,max:n}}function ii(e,{min:t,max:n},i,s=!1){let o=at(e.chart),{options:r}=e,a=My(e,i),{minRange:l=0}=a,c=Th(o,e,a,"min",-1/0),u=Th(o,e,a,"max",1/0);if(s==="pan"&&(t<c||n>u))return!0;let d=e.max-e.min,f=s?Math.max(n-t,l):d;if(s&&f===l&&d<=l)return!0;let p=Cy(f,{min:t,max:n,minLimit:c,maxLimit:u},o.originalScaleLimits[e.id]);return r.min=p.min,r.max=p.max,o.updatedScaleLimits[e.id]=p,e.parse(p.min)!==e.min||e.parse(p.max)!==e.max}function Py(e,t,n,i){let s=jh(e,t,n),o={min:e.min+s.min,max:e.max-s.max};return ii(e,o,i,!0)}function Dy(e,t,n,i){let s=Ey(e,t,n);return ii(e,s,i,!0)}function Ay(e,t,n,i){ii(e,Ty(e,t,n),i,!0)}function Ry(e){let n=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<n&&(e.max+=1)}function Oy(e,t,n,i){let s=jh(e,t,n);e.min===e.max&&t<1&&Ry(e);let o={min:e.min+Ch(s.min),max:e.max-Ch(s.max)};return ii(e,o,i,!0)}function Iy(e){return e.isHorizontal()?e.width:e.height}function Ny(e,t,n){let s=e.getLabels().length-1,{min:o,max:r}=e,a=Math.max(r-o,1),l=Math.round(Iy(e)/Math.max(a,10)),c=Math.round(Math.abs(t/l)),u;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,u=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,u=o===0),ii(e,{min:o,max:r},n)||u}function $h(e,t,n,i=!1){let{min:s,max:o,options:r}=e,a=r.time&&r.time.round,l=Ly[a]||0,c=e.getValueForPixel(e.getPixelForValue(s+l)-t),u=e.getValueForPixel(e.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(u)?!0:ii(e,{min:c,max:u},n,i?"pan":!1)}function Ph(e,t,n){return $h(e,t,n,!0)}function zy(e,t,n){let{id:i,options:{min:s,max:o}}=e;if(!t[i]||!n[i])return!0;let r=n[i];return r.min!==s||r.max!==o}function Dh(e,t){U(e,(n,i)=>{t[i]||delete e[i]})}function Ii(e,t){let{scales:n}=e,{originalScaleLimits:i,updatedScaleLimits:s}=t;return U(n,function(o){zy(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Dh(i,n),Dh(s,n),i}function Ah(e,t,n,i){let s=Xl[e.type]||Xl.default;z(s,[e,t,n,i])}function Rh(e,t,n,i){let s=ql[e.type]||ql.default;z(s,[e,t,n,i])}function Vy(e){let t=e.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function ec(e,t,n="none",i="api"){let{x:s=1,y:o=1,focalPoint:r=Vy(e)}=typeof t=="number"?{x:t,y:t}:t,a=at(e),{options:{limits:l,zoom:c}}=a;Ii(e,a);let u=s!==1,d=o!==1,f=Hh(c,r,e);U(f||e.scales,function(p){p.isHorizontal()&&u?Ah(p,s,r,l):!p.isHorizontal()&&d&&Ah(p,o,r,l)}),e.update(n),z(c.onZoom,[{chart:e,trigger:i}])}function Uh(e,t,n,i="none",s="api"){let o=at(e),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;Ii(e,o);let c=Dn(l,"x",e),u=Dn(l,"y",e);U(e.scales,function(d){d.isHorizontal()&&c?Rh(d,t.x,n.x,r):!d.isHorizontal()&&u&&Rh(d,t.y,n.y,r)}),e.update(i),z(a.onZoom,[{chart:e,trigger:s}])}function Fy(e,t,n,i="none",s="api"){let o=at(e);Ii(e,o);let r=e.scales[t];ii(r,n,void 0,!0),e.update(i),z(o.options.zoom?.onZoom,[{chart:e,trigger:s}])}function Hy(e,t="default"){let n=at(e),i=Ii(e,n);U(e.scales,function(s){let o=s.options;i[s.id]?(o.min=i[s.id].min.options,o.max=i[s.id].max.options):(delete o.min,delete o.max),delete n.updatedScaleLimits[s.id]}),e.update(t),z(n.options.zoom.onZoomComplete,[{chart:e}])}function By(e,t){let n=e.originalScaleLimits[t];if(!n)return;let{min:i,max:s}=n;return $(s.options,s.scale)-$(i.options,i.scale)}function Wy(e){let t=at(e),n=1,i=1;return U(e.scales,function(s){let o=By(t,s.id);if(o){let r=Math.round(o/(s.max-s.min)*100)/100;n=Math.min(n,r),i=Math.max(i,r)}}),n<1?n:i}function Oh(e,t,n,i){let{panDelta:s}=i,o=s[e.id]||0;we(o)===we(t)&&(t+=o);let r=Zl[e.type]||Zl.default;z(r,[e,t,n])?s[e.id]=0:s[e.id]=t}function Gh(e,t,n,i="none"){let{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=at(e),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};Ii(e,r);let u=s!==0,d=o!==0;U(n||e.scales,function(f){f.isHorizontal()&&u?Oh(f,s,l,r):!f.isHorizontal()&&d&&Oh(f,o,l,r)}),e.update(i),z(c,[{chart:e}])}function Yh(e){let t=at(e);Ii(e,t);let n={};for(let i of Object.keys(e.scales)){let{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};n[i]={min:s.scale,max:o.scale}}return n}function jy(e){let t=at(e),n={};for(let i of Object.keys(e.scales))n[i]=t.updatedScaleLimits[i];return n}function $y(e){let t=Yh(e);for(let n of Object.keys(e.scales)){let{min:i,max:s}=t[n];if(i!==void 0&&e.scales[n].min!==i||s!==void 0&&e.scales[n].max!==s)return!0}return!1}function Ih(e){let t=at(e);return t.panning||t.dragging}function Yt(e,t){let{handlers:n}=at(e),i=n[t];i&&i.target&&(i.target.removeEventListener(t,i),delete n[t])}function Hs(e,t,n,i){let{handlers:s,options:o}=at(e),r=s[n];if(r&&r.target===t)return;Yt(e,n),s[n]=l=>i(e,l,o),s[n].target=t;let a=n==="wheel"?!1:void 0;t.addEventListener(n,s[n],{passive:a})}function Uy(e,t){let n=at(e);n.dragStart&&(n.dragging=!0,n.dragEnd=t,e.update("none"))}function Gy(e,t){let n=at(e);!n.dragStart||t.key!=="Escape"||(Yt(e,"keydown"),n.dragging=!1,n.dragStart=n.dragEnd=null,e.update("none"))}function Jl(e,t){if(e.target!==t.canvas){let n=t.canvas.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}return ie(e,t)}function Kh(e,t,n){let{onZoomStart:i,onZoomRejected:s}=n;if(i){let o=Jl(t,e);if(z(i,[{chart:e,event:t,point:o}])===!1)return z(s,[{chart:e,event:t}]),!1}}function Yy(e,t){if(e.legend){let o=ie(t,e);if(ne(o,e.legend))return}let n=at(e),{pan:i,zoom:s={}}=n.options;if(t.button!==0||Fh(Bs(i),t)||tc(Bs(s.drag),t))return z(s.onZoomRejected,[{chart:e,event:t}]);Kh(e,t,s)!==!1&&(n.dragStart=t,Hs(e,e.canvas.ownerDocument,"mousemove",Uy),Hs(e,window.document,"keydown",Gy))}function Ky({begin:e,end:t},n){let i=t.x-e.x,s=t.y-e.y,o=Math.abs(i/s);o>n?i=Math.sign(i)*Math.abs(s*n):o<n&&(s=Math.sign(s)*Math.abs(i/n)),t.x=e.x+i,t.y=e.y+s}function Lh(e,t,n,{min:i,max:s,prop:o}){e[i]=Nh(Math.min(n.begin[o],n.end[o]),t[i],t[s]),e[s]=Nh(Math.max(n.begin[o],n.end[o]),t[i],t[s])}function Xy(e,t,n){let i={begin:Jl(t.dragStart,e),end:Jl(t.dragEnd,e)};if(n){let s=e.chartArea.width/e.chartArea.height;Ky(i,s)}return i}function Xh(e,t,n,i){let s=Dn(t,"x",e),o=Dn(t,"y",e),{top:r,left:a,right:l,bottom:c,width:u,height:d}=e.chartArea,f={top:r,left:a,right:l,bottom:c},p=Xy(e,n,i&&s&&o);s&&Lh(f,e.chartArea,p,{min:"left",max:"right",prop:"x"}),o&&Lh(f,e.chartArea,p,{min:"top",max:"bottom",prop:"y"});let b=f.right-f.left,x=f.bottom-f.top;return{...f,width:b,height:x,zoomX:s&&b?1+(u-b)/u:1,zoomY:o&&x?1+(d-x)/d:1}}function qy(e,t){let n=at(e);if(!n.dragStart)return;Yt(e,"mousemove");let{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=n.options.zoom,a=Xh(e,i,{dragStart:n.dragStart,dragEnd:t},r),l=Dn(i,"x",e)?a.width:0,c=Dn(i,"y",e)?a.height:0,u=Math.sqrt(l*l+c*c);if(n.dragStart=n.dragEnd=null,u<=o){n.dragging=!1,e.update("none");return}Uh(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),n.dragging=!1,n.filterNextClick=!0,z(s,[{chart:e}])}function Zy(e,t,n){if(tc(Bs(n.wheel),t)){z(n.onZoomRejected,[{chart:e,event:t}]);return}if(Kh(e,t,n)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function Jy(e,t){let{handlers:{onZoomComplete:n},options:{zoom:i}}=at(e);if(!Zy(e,t,i))return;let s=t.target.getBoundingClientRect(),o=i.wheel.speed,r=t.deltaY>=0?2-1/(1-o):1+o,a={x:r,y:r,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}};ec(e,a,"zoom","wheel"),z(n,[{chart:e}])}function Qy(e,t,n,i){n&&(at(e).handlers[t]=_y(()=>z(n,[{chart:e}]),i))}function tv(e,t){let n=e.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(Hs(e,n,"wheel",Jy),Qy(e,"onZoomComplete",o,250)):Yt(e,"wheel"),s.enabled?(Hs(e,n,"mousedown",Yy),Hs(e,n.ownerDocument,"mouseup",qy)):(Yt(e,"mousedown"),Yt(e,"mousemove"),Yt(e,"mouseup"),Yt(e,"keydown"))}function ev(e){Yt(e,"mousedown"),Yt(e,"mousemove"),Yt(e,"mouseup"),Yt(e,"wheel"),Yt(e,"click"),Yt(e,"keydown")}function nv(e,t){return function(n,i){let{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;let r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(tc(Bs(s),r)||Fh(Bs(o.drag),r))?(z(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function iv(e,t){let n=Math.abs(e.clientX-t.clientX),i=Math.abs(e.clientY-t.clientY),s=n/i,o,r;return s>.3&&s<1.7?o=r=!0:n>i?o=!0:r=!0,{x:o,y:r}}function qh(e,t,n){if(t.scale){let{center:i,pointers:s}=n,o=1/t.scale*n.scale,r=n.target.getBoundingClientRect(),a=iv(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Dn(l,"x",e)?o:1,y:a.y&&Dn(l,"y",e)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};ec(e,c,"zoom","pinch"),t.scale=n.scale}}function sv(e,t,n){if(t.options.zoom.pinch.enabled){let i=ie(n,e);z(t.options.zoom.onZoomStart,[{chart:e,event:n,point:i}])===!1?(t.scale=null,z(t.options.zoom.onZoomRejected,[{chart:e,event:n}])):t.scale=1}}function ov(e,t,n){t.scale&&(qh(e,t,n),t.scale=null,z(t.options.zoom.onZoomComplete,[{chart:e}]))}function Zh(e,t,n){let i=t.delta;i&&(t.panning=!0,Gh(e,{x:n.deltaX-i.x,y:n.deltaY-i.y},t.panScales),t.delta={x:n.deltaX,y:n.deltaY})}function rv(e,t,n){let{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;let r=n.target.getBoundingClientRect(),a={x:n.center.x-r.left,y:n.center.y-r.top};if(z(s,[{chart:e,event:n,point:a}])===!1)return z(o,[{chart:e,event:n}]);t.panScales=Hh(t.options.pan,a,e),t.delta={x:0,y:0},Zh(e,t,n)}function av(e,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,z(t.options.pan.onPanComplete,[{chart:e}]))}function zh(e,t){let n=at(e),i=e.canvas,{pan:s,zoom:o}=t,r=new Oi.default.Manager(i);o&&o.pinch.enabled&&(r.add(new Oi.default.Pinch),r.on("pinchstart",a=>sv(e,n,a)),r.on("pinch",a=>qh(e,n,a)),r.on("pinchend",a=>ov(e,n,a))),s&&s.enabled&&(r.add(new Oi.default.Pan({threshold:s.threshold,enable:nv(e,n)})),r.on("panstart",a=>rv(e,n,a)),r.on("panmove",a=>Zh(e,n,a)),r.on("panend",()=>av(e,n))),Ql.set(e,r)}function Vh(e){let t=Ql.get(e);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Ql.delete(e))}function lv(e,t){let{pan:n,zoom:i}=e,{pan:s,zoom:o}=t;return i?.zoom?.pinch?.enabled!==o?.zoom?.pinch?.enabled||n?.enabled!==s?.enabled||n?.threshold!==s?.threshold}function Sr(e,t,n){let i=n.zoom.drag,{dragStart:s,dragEnd:o}=at(e);if(i.drawTime!==t||!o)return;let{left:r,top:a,width:l,height:c}=Xh(e,n.zoom.mode,{dragStart:s,dragEnd:o},i.maintainAspectRatio),u=e.ctx;u.save(),u.beginPath(),u.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",u.fillRect(r,a,l,c),i.borderWidth>0&&(u.lineWidth=i.borderWidth,u.strokeStyle=i.borderColor||"rgba(225,225,225)",u.strokeRect(r,a,l,c)),u.restore()}var Oi,Bs,Fh,tc,Kl,Ch,Ly,Xl,ql,Zl,Nh,Ql,cv,Jh,Qh=M(()=>{Oi=Bg(Sh());Mh();Bs=e=>e&&e.enabled&&e.modifierKey,Fh=(e,t)=>e&&t[e+"Key"],tc=(e,t)=>e&&!t[e+"Key"];Kl=new WeakMap;Ch=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);Ly={second:500,minute:30*1e3,hour:1800*1e3,day:720*60*1e3,week:3.5*24*60*60*1e3,month:360*60*60*1e3,quarter:1440*60*60*1e3,year:4368*60*60*1e3};Xl={category:Oy,default:Py,logarithmic:Dy},ql={default:Ay},Zl={category:Ny,default:$h,logarithmic:Ph,timeseries:Ph};Nh=(e,t,n)=>Math.min(n,Math.max(t,e));Ql=new WeakMap;cv="2.2.0";Jh={id:"zoom",version:cv,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(e,t,n){let i=at(e);i.options=n,Object.prototype.hasOwnProperty.call(n.zoom,"enabled")&&console.warn("The option \`zoom.enabled\` is no longer supported. Please use \`zoom.wheel.enabled\`, \`zoom.drag.enabled\`, or \`zoom.pinch.enabled\`."),(Object.prototype.hasOwnProperty.call(n.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(n.pan,"overScaleMode"))&&console.warn("The option \`overScaleMode\` is deprecated. Please use \`scaleMode\` instead (and update \`mode\` as desired)."),Oi.default&&zh(e,n),e.pan=(s,o,r)=>Gh(e,s,o,r),e.zoom=(s,o)=>ec(e,s,o),e.zoomRect=(s,o,r)=>Uh(e,s,o,r),e.zoomScale=(s,o,r)=>Fy(e,s,o,r),e.resetZoom=s=>Hy(e,s),e.getZoomLevel=()=>Wy(e),e.getInitialScaleBounds=()=>Yh(e),e.getZoomedScaleBounds=()=>jy(e),e.isZoomedOrPanned=()=>$y(e),e.isZoomingOrPanning=()=>Ih(e)},beforeEvent(e,{event:t}){if(Ih(e))return!1;if(t.type==="click"||t.type==="mouseup"){let n=at(e);if(n.filterNextClick)return n.filterNextClick=!1,!1}},beforeUpdate:function(e,t,n){let i=at(e),s=i.options;i.options=n,lv(s,n)&&(Vh(e),zh(e,n)),tv(e,n)},beforeDatasetsDraw(e,t,n){Sr(e,"beforeDatasetsDraw",n)},afterDatasetsDraw(e,t,n){Sr(e,"afterDatasetsDraw",n)},beforeDraw(e,t,n){Sr(e,"beforeDraw",n)},afterDraw(e,t,n){Sr(e,"afterDraw",n)},stop:function(e){ev(e),Oi.default&&Vh(e),Sy(e)},panFunctions:Zl,zoomFunctions:Xl,zoomRectFunctions:ql}});function nc(e){let t=[],n=()=>t.forEach(l=>l()),i=D(null),s=null;return{canvasRef:i,init:()=>{let l=i.value;if(!l)return console.error("createLineChart: canvas ref not set",new Error().stack),n;fe.register(Jh,Di,ti,Pi,ei,Cn,yh,wh),s=new fe(l,{type:"line",data:e.data.peek(),options:{scales:{y:{min:0,suggestedMax:10}},animation:!1,responsive:!0,plugins:{zoom:{pan:{enabled:!0,mode:"x"},zoom:{wheel:{enabled:!0},mode:"x"}},legend:{align:"start",position:"bottom"},title:{display:!1}}}});let c=e.data.subscribe(d=>{s&&(s.data=d,s.update())}),u=new ResizeObserver(()=>s?.resize());return u.observe(l.parentElement),t.push(()=>{u.disconnect(),s?.destroy(),s=null,c()}),()=>n()},resetZoom:()=>s?.resetZoom(),getZoomLevel:()=>s?.getZoomLevel()??0}}var tp=M(()=>{"use strict";V();kh();Qh()});var Er=M(()=>{"use strict";Rd();Od();Id();Nd();tp()});var ic,ep=M(()=>{"use strict";V();q();Er();ic=e=>{let t=e.minContainerWidth??250,n=[],i=()=>{n.forEach(y=>y()),n.length=0},s=D(null),o=D(0),r=D(0),a=xn(null),l=xn(null),[c,u]=us(),d=Wa(a);n.push(u);let f=y=>{y.preventDefault(),s.value={...c.value},o.value=r.value,console.log("onMouseDown",{startMouse:s.value,prevFirstContainerWidth:o.value,firstContainerWidth:r.value})},p=()=>s.value=null,b=y=>{if(s.value==null||l.current==null)return;let w=Math.max(o.value+y.x-s.value.x,t);r.value=Math.min(w,l.current.clientWidth-t),console.log("onMouseMove",w,r.value)},x=()=>{l.current!=null&&l.current.clientWidth-t<r.value&&(r.value=Math.max(l.current.clientWidth-t,t))};return window.addEventListener("mouseup",p),window.addEventListener("mousemove",b),window.addEventListener("resize",x),n.push(()=>{window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",b),window.removeEventListener("resize",x)}),Aa(()=>{if(l.current)return r.value=l.current.clientWidth/2,d.init(),()=>{d.dispose()}}),d.state.width.subscribe(y=>{console.log("width",y)}),Wt(()=>i()),({children:y,className:w,..._})=>{let[S,E]=Array.isArray(y)?y:[];return g("div",{className:ft("flex-grow grid gap-2 items-start w-full relative",Z(w)),ref:l,style:{gridTemplateColumns:\`\${r}px 1fr\`},..._},g("div",{ref:a,className:"firstContainer w-full h-full"},S),d.state.width.value!=0&&g("div",{className:"w-8 flex justify-center h-full absolute top-0 -translate-x-1/2 cursor-col-resize z-[9999]",style:{left:\`\${d.state.width.value}px\`},onmousedown:f},g("div",{className:"dividerLine w-[5px] bg-neutral-800 h-full"})),g("div",{className:"secondContainer h-full"},E))}}});function An({root:e,className:t}){let{objectKeysChunkSize:n}=Q.viewerSettings.value,i=e.page.value,s=e.children.slice(0,(i+1)*n),o=s.length<e.children.length;return g(_t,null,g("div",{className:ft("flex flex-col items-start w-full",Z(t))},s.map(r=>g("div",{key:r.path,className:"flex flex-col items-start w-full gap-2 pl-2 py-1 pr-1 border-b border-neutral-700 last:border-b-0"},g(Mr,{node:r})))),o&&g("button",{onclick:()=>e.page.value++,title:"Show more",className:"p-1 border font-bold border-neutral-700 hover:bg-neutral-700"},g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1rem",height:"1rem",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},g("circle",{cx:"12",cy:"12",r:"1"}),g("circle",{cx:"19",cy:"12",r:"1"}),g("circle",{cx:"5",cy:"12",r:"1"}))))}function Mr({node:e}){switch(e.kind){case"null":case"undefined":case"string":case"number":case"bigint":case"boolean":case"symbol":case"function":case"dom-node":case"error":return g(uv,{node:e});case"object":return g(fv,{node:e});case"array":return g(hv,{node:e});case"array-chunk":return g(pv,{node:e});case"signal":return g(gv,{node:e})}}function uv({node:e}){let{label:t,path:n,raw:i,kind:s}=e;return g(Tr,null,g("label",{className:"text-xs truncate",title:n},t),g(dv,{kind:s,raw:i}))}function dv({kind:e,raw:t}){switch(e){case"null":return g("small",{className:"text-neutral-300"},"null");case"undefined":return g("small",{className:"text-neutral-300"},"undefined");case"dom-node":return g("small",{className:"text-neutral-300"},"<",g("span",{style:"color: #f0a05e"},t.nodeName),"/>");case"error":{let n=t;return g("small",{className:"text-neutral-300"},n.message,"cause"in n&&!!n.cause&&\` (\${String(n.cause)})\`)}case"string":return g("small",{className:"text-neutral-300"},\`"\${t}"\`);case"number":case"bigint":return g("small",{className:"text-neutral-300"},t);case"boolean":return g("small",{className:"text-neutral-300"},t?"true":"false");case"symbol":return g("small",{className:"text-neutral-300"},t.toString());case"function":return g("small",{className:"text-neutral-300 italic"},\`\\u0192 \${t.name??"anonymous"}()\`)}}function fv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return g(Tr,null,g("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,g(en,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n!==null&&g(An,{root:{children:n,page:e.page}}))}function hv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return g(Tr,null,g("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",title:e.path,onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,g(en,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),t?g("small",{className:"text-neutral-300"},\`Array(\${e.length})\`):n&&g("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>g(Mr,{node:i}))))}function pv({node:e}){let t=e.collapsed.value;t||e.buildChildren();let n=t?null:e.children.peek();return g("div",{className:"flex flex-col items-start gap-1 w-full"},g("button",{className:"text-xs flex items-center gap-1 cursor-pointer w-full",onclick:()=>e.collapsed.value=!e.collapsed.value},e.label,g(en,{width:10,height:10,className:\`transition \${t?"":"rotate-90"}\`})),n&&g("div",{className:"flex flex-col items-start gap-1 w-full"},n.map(i=>g(Mr,{node:i}))))}function gv({node:e}){let t=e.viewerNode.value;return g(Tr,null,g("div",{className:"flex items-center gap-2"},g("label",{className:"text-xs truncate",title:e.path},e.label),g("span",{className:"text-[10px] italic text-primary border border-primary/40 px-1 rounded leading-none py-px"},"signal")),g("div",{className:"pl-2 w-full"},g(Mr,{node:t})))}function Tr({children:e}){return g("div",{className:"flex flex-col items-start gap-1 w-full"},e)}var sc=M(()=>{"use strict";V();V();q();Oo();Ie()});function Pt(){return{collapsed:new Map,page:new Map,children:new Map,signalNodes:new Map}}function ke(e,t,n){n.page.set(t,e.page),js(e.children,n)}function js(e,t){for(let n of e)if(n.kind==="object"){t.collapsed.set(n.path,n.collapsed),t.page.set(n.path,n.page),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&js(i,t)}else if(n.kind==="array"||n.kind==="array-chunk"){t.collapsed.set(n.path,n.collapsed),t.children.set(n.path,n.children);let i=n.children.peek();i!==null&&js(i,t)}else n.kind==="signal"&&(t.signalNodes.set(n.path,n),js([n.viewerNode.peek()],t))}function he(e){for(let t of e.collapsed.values())L.dispose(t);for(let t of e.page.values())L.dispose(t);for(let t of e.children.values())L.dispose(t);for(let t of e.signalNodes.values())t.unsubscribe(),L.dispose(t.viewerNode)}function mv(e){if(e===null)return"null";if(e===void 0)return"undefined";let t=window.opener?window.opener.Node:window.Node;if(e instanceof t)return"dom-node";let n=window.opener?window.opener.Error:window.Error;if(e instanceof n)return"error";let i=typeof e;return i==="string"?"string":i==="number"?"number":i==="bigint"?"bigint":i==="boolean"?"boolean":i==="symbol"?"symbol":i==="function"?"function":null}function Ws(e,t,n,i,s){let o=mv(e);if(o!==null)return{kind:o,label:t,path:n,raw:e};if(L.isSignal(e)){let d=e,f=\`\${n}.$value\`,p=Ws(d.peek(),"value",f,i,s),b=D(p),x=d.subscribe(y=>{let w=Pt();js([b.peek()],w),b.value=Ws(y,"value",f,w,s),he(w)});return{kind:"signal",label:t,path:n,signal:d,viewerNode:b,unsubscribe:x}}if(Array.isArray(e)){let d=i.collapsed.get(n)??D(!0);i.collapsed.delete(n);let f=D(null);return{kind:"array",label:t,path:n,collapsed:d,length:e.length,children:f,buildChildren:()=>{if(f.peek()===null)if(e.length>s.arrayChunkSize){let b=Math.ceil(e.length/s.arrayChunkSize);f.value=Array.from({length:b},(x,y)=>{let w=y*s.arrayChunkSize,_=Math.min((y+1)*s.arrayChunkSize,e.length),S=\`\${n}[\${w}..\${_-1}]\`,E=D(!0),T=D(null),R=e.slice(w,_);return{kind:"array-chunk",label:\`[\${w}..\${_-1}]\`,path:S,collapsed:E,range:{start:w,end:_},children:T,buildChildren:()=>{T.peek()===null&&(T.value=R.map((P,N)=>Ws(P,(w+N).toString(),\`\${n}[\${w+N}]\`,Pt(),s)))}}})}else f.value=e.map((b,x)=>Ws(b,x.toString(),\`\${n}[\${x}]\`,Pt(),s))}}}let r=i.collapsed.get(n)??D(!0);i.collapsed.delete(n);let a=i.page.get(n)??D(0);i.page.delete(n);let l=D(null),c=e;return{kind:"object",label:t,path:n,collapsed:r,page:a,children:l,buildChildren:()=>{l.peek()===null&&(l.value=np(c,n,Pt(),s))}}}function np(e,t,n,i){return Object.keys(e).map(s=>Ws(e[s],s,\`\${t}.\${s}\`,n,i))}function un(e,t,n,i){let s=n.page.get(t)??D(0);n.page.delete(t);let o=np(e,t,n,i);return{page:s,children:o}}var oc=M(()=>{"use strict";V()});var $s=M(()=>{"use strict";Ad();ep();sc();oc()});function Cr(e){e&&("nodes"in e?e.nodes.forEach(Cr):(Cr(e.child),Cr(e.sibling)))}function ip(e,t,n){let i=new Map;Pr(n,i);let s=e.rootNode,o=ac();if(s){let r=t.trim().toLowerCase(),a=r?r.split(/\\s+/):[];o.nodes.push(...rp(s,a,i))}for(let{collapsed:r}of i.values())L.dispose(r);return o}function Pr(e,t){if(e)if("nodes"in e)for(let n of e.nodes)Pr(n,t);else{let{id:n,collapsed:i}=e;t.set(e.kiruNode,{id:n,collapsed:i}),Pr(e.child,t),Pr(e.sibling,t)}}function rp(e,t,n=new Map){let i=[],s=e;for(;s;){let o=rp(s.child,t,n);if(typeof s.type!="function")i.push(...o);else{let r=Bn(s);if(yv(t,r)){let a=vv(s,r,n);a.child=o[0]??null;for(let l=0;l<o.length;l++)o[l].parent=a,o[l].sibling=o[l+1]??null;i.push(a)}else i.push(...o)}s=s.sibling}return i}function yv(e,t){let n=t.toLowerCase();return e.every(i=>n.includes(i))}function ac(...e){return{value:"ROOT",nodes:e}}function vv(e,t,n=new Map){let{id:i,collapsed:s}=n.get(e)??{id:crypto.randomUUID(),collapsed:D(!0)};return n.delete(e),{id:i,name:t,kiruNode:e,collapsed:s,parent:null,child:null,sibling:null}}function rc(e){let t=Ni.peek();if(!t)return;let n=lc(e,t);if(!n)return;let i=n.parent;for(;i;)i.collapsed.value=!1,i=i.parent}function ap(e){e&&rc(Kt.peek())}function wv(e){let t=Ni.peek();if(!t)return;let n=lc(Kt.peek(),t);n?.child&&(n.collapsed.value=e)}function _v(e,t){let n=Array.from(e.querySelectorAll("[data-graph-node-id]"));if(n.length===0)return;let i=Ni.peek(),s=-1;if(i){let c=lc(Kt.peek(),i);c&&(s=n.findIndex(u=>u.dataset.graphNodeId===c.id))}let r=s===-1?t==="down"?0:n.length-1:(s+(t==="up"?-1:1)+n.length)%n.length,a=n[r];if(!a)return;let l=kv(Kt.peek(),a);l&&(Ni.sneak(l.kiruNode),Ni.notify(c=>c!==ap))}function kv(e,t){let n=t.dataset.graphNodeId;if(!n)return null;let i=s=>s?s.id===n?s:i(s.child)??i(s.sibling):null;for(let s of e.nodes){let o=i(s);if(o)return o}return null}function lc(e,t){let n=i=>i?i.kiruNode===t?i:n(i.child)??n(i.sibling):null;for(let i of e.nodes){let s=n(i);if(s)return s}return null}var bv,Ni,xv,Kt,op,sp,lp=M(()=>{"use strict";V();Ie();Wn();({selectedApp:bv,selectedNode:Ni,appSearchTerm:xv}=Q),Kt=D(ac()),op=()=>(window.addEventListener("keydown",sp),()=>window.removeEventListener("keydown",sp));Bt(()=>{let e=bv.value,t=xv.value;if(!e){Cr(Kt.peek()),Kt.value=ac();return}Kt.value=ip(e,t,Kt.peek()),rc(Kt.peek());let n=i=>{i===e&&(Kt.value=ip(i,t,Kt.peek()),rc(Kt.peek()))};return ht().on("update",n),()=>ht().off("update",n)});Ni.subscribe(ap);sp=e=>{Ia(t=>{if(e.key==="l"&&e.ctrlKey){e.preventDefault(),Q.appSearchInput.value?.focus(),Q.appSearchInput.value?.select();return}if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;if(Q.appSearchInput.value?.matches(":focus")){if(!e.altKey)return;e.preventDefault()}let n=e.key==="ArrowUp"?"up":e.key==="ArrowDown"?"down":e.key==="ArrowLeft"?"left":"right";if(n==="left"||n==="right"){wv(n==="left");return}_v(t,n)})}});function up(){return Ct(()=>op()),()=>g("div",{className:"flex-grow p-2 sticky top-0"},g("div",{className:"flex gap-4 pb-2 border-b-2 border-neutral-800 mb-2 items-center"},g("input",{autofocus:!0,ref:Ev,className:"bg-[#171616] px-1 py-2 w-full focus:outline focus:outline-primary",placeholder:"Search for component",type:"text","bind:value":Sv})),g("div",{className:"flex flex-col"},g(ve,{from:Kt},e=>g(Mv,{root:e}))))}function Mv({root:e}){return e.nodes.map(t=>g(cc,{node:t,traverseSiblings:!0}))}function cc({node:e,traverseSiblings:t=!0}){let n=e.collapsed.value,i=cp.value===e.kiruNode,s=o=>{o.preventDefault(),o.stopPropagation(),e.collapsed.value=!e.collapsed.value};return g(_t,null,g("div",{"data-graph-node-id":e.id,className:"pl-4 mb-1 w-full"},g("button",{className:ft("flex gap-2 items-center px-2 py-0.5 w-full",i?"bg-crimson text-white":""),onclick:()=>cp.value=e.kiruNode},e.child&&g(en,{className:ft("transition-transform duration-200 w-4 h-4",n?"":"rotate-90"),onclick:s}),g("div",{className:e.child?"":"ml-6"},g("span",{className:i?"":"text-neutral-400"},"<"),g("span",{className:ft("font-medium",i?"":"text-crimson")},e.name),g("span",{className:i?"":"text-neutral-400"},">"))),!n&&e.child&&g(cc,{node:e.child})),t&&g(Tv,{node:e}))}function Tv({node:e}){if(!e)return null;let t=[],n=e.sibling;for(;n;)t.push(n),n=n.sibling;return g(_t,null,t.map(i=>g(cc,{node:i,traverseSiblings:!1})))}var cp,Sv,Ev,dp=M(()=>{"use strict";V();Ie();lp();$s();q();({selectedNode:cp,appSearchTerm:Sv,appSearchInput:Ev}=Q)});function pp(e,t){let n=Us.peek();if(!e){n&&gp(n.props),Us.value=null;return}let i=n?.node===e,s=Pt();i&&n?ke(n.props.root,"props",s):n&&gp(n.props);let o={...e.props};delete o.children;let r=i?n?.props.collapsed??D(!0):D(!0),a=un(o,"props",s,t);he(s),Us.value={node:e,name:Bn(e),props:{root:a,collapsed:r}}}function gp(e){L.dispose(e.collapsed),L.dispose(e.root.page);let t=Pt();ke(e.root,"props",t),he(t)}var fp,Cv,hp,Us,mp=M(()=>{"use strict";V();q();Ie();Wn();oc();({selectedNode:fp,selectedApp:Cv,viewerSettings:hp}=Q),Us=D(null);Bt(()=>{let e=fp.value,t=Cv.value,n=hp.value;if(pp(e,n),!e||!t)return;let i=s=>{if(s===t){if(Eo(e)){fp.value=null;return}pp(e,hp.peek())}};return ht().on("update",i),()=>ht().off("update",i)})});function bp(){let e=Us.value;if(!e)return null;let{name:t,props:n}=e,i=n.collapsed.value;return g("div",{className:"flex-grow p-2 sticky top-0"},g("h2",{className:"flex justify-between items-center font-bold mb-2 pb-2 border-b-2 border-neutral-800"},g("div",{className:"flex gap-2 items-center"},"<"+t+">")),g("div",{className:"flex flex-col"},g("button",{onclick:()=>n.collapsed.value=!n.collapsed.value,className:n.root.children.length===0?"opacity-50 cursor-default":"cursor-pointer"},g("span",{className:"flex items-center gap-2 font-medium"},g(en,{className:\`transition \${i?"":"rotate-90"}\`}),"props")),i?null:g("div",{className:"p-2",...n},g(An,{root:n.root}))))}var xp=M(()=>{"use strict";V();sc();Oo();mp()});function uc(){let e=vp.value;return g(_t,null,g("div",{className:"flex items-center justify-between gap-4 p-2 bg-neutral-400 bg-opacity-5 border border-white border-opacity-10 rounded"},g("div",{className:"flex items-center gap-4"},g("select",{className:"px-2 py-1 bg-neutral-800 text-neutral-100 rounded border border-white border-opacity-10",value:e?.name??"",onchange:t=>vp.value=yp.peek().find(n=>n.name===t.currentTarget.value)??null},g("option",{value:"",disabled:!0},"Select App"),g(Je,{each:yp},t=>g("option",{key:t.id,value:t.name},t.name))),g("button",{title:"Toggle Component Inspection",onclick:Pv,className:\`p-1 rounded \${Dv.value?"bg-neutral-900":""}\`},g(cs,null)))),g(ic,{minContainerWidth:100,className:"min-w-[480px]"},g(up,null),g(bp,null)))}var yp,vp,Dr,Pv,Dv,wp=M(()=>{"use strict";V();Ie();$s();dp();xp();({apps:yp,selectedApp:vp,componentSelection:Dr}=Q),Pv=()=>{Dr.value={enabled:!Dr.value.enabled,componentNode:Dr.value.componentNode}},Dv=Ot(()=>Dr.value.enabled)});function Tp(e){if(kp)return;kp=!0;let t=e.profilingContext,n=s=>{if(ue(s)||je.value.find(a=>a.app.name===s.name))return;let r=Ep(e,t,s);je.value=[...je.value,r]},i=s=>{ue(s)||(console.log("onAppUnmounted",s),je.value.find(o=>o.app.name===s.name)?.dispose())};t.appStats.forEach((s,o)=>{if(ue(o))return;let r=Ep(e,t,o);je.value=[...je.value,r]}),e.on("mount",n),e.on("unmount",i)}function Sp(e,t){return{mountDuration:e.mountDuration(t).toFixed(2),totalTicks:e.totalTicks(t).toLocaleString(),avgTickDuration:e.averageTickDuration(t).toFixed(2),lastTickDuration:e.lastTickDuration(t).toFixed(2)}}function Ep(e,t,n){let i=[],s=()=>{i.forEach(u=>u()),je.value=je.value.filter(u=>u.app.name!==n.name)},o=Av(),r=D({labels:[(performance.now()/1e3).toFixed(2)],datasets:Mp(o)});i.push(()=>L.dispose(r)),Object.entries(o).forEach(([u,{values:d}])=>{let f=b=>{b.name===n.name&&d[d.length-1]++},p=u;t.addEventListener(p,f),i.push(()=>t.removeEventListener(p,f))});let a=setInterval(()=>{Object.values(o).forEach(d=>{d.values.push(0),d.values.length>_p&&d.values.shift()});let u=[...r.value.labels,(performance.now()/1e3).toFixed(2)];u.length>_p&&u.shift(),r.value={labels:u,datasets:Mp(o)}},100);i.push(()=>clearInterval(a));let l=D(Sp(t,n)),c=u=>{u.name===n.name&&(l.value=Sp(t,u))};return e.on("update",c),i.push(()=>e.off("update",c)),{app:n,stats:l,chartData:r,dispose:s}}function Mp(e){return Object.entries(e).map(([t,{values:n,color:i}])=>({label:t,data:[...n],fill:!1,borderColor:i,tension:.1}))}function Av(){return{update:{values:[0],color:"#ad981f"},updateDirtied:{values:[0],color:"#b21f3a"},createNode:{values:[0],color:"#198019"},removeNode:{values:[0],color:"#5F3691"},updateNode:{values:[0],color:"#2f2f9d"},signalAttrUpdate:{values:[0],color:"#28888f"},signalTextUpdate:{values:[0],color:"#9b3b98"}}}var _p,je,kp,Cp=M(()=>{"use strict";V();Wn();_p=100,je=D([]),kp=!1});function Pp(e){return g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...e},g("circle",{cx:"12",cy:"12",r:"10"}),g("path",{d:"M12 16v-4"}),g("path",{d:"M12 8h.01"}))}var Dp=M(()=>{"use strict";V()});function Gs({pauseWhen:e}){let t=ht();return Ct(()=>Tp(t)),g("div",{className:"flex flex-col gap-2"},g(Je,{each:je},n=>g(Rv,{item:n,pauseWhen:e})))}function Rv({item:e,pauseWhen:t}){let n=D(!1),i=D(e.chartData.peek()),s=nc({data:i}),o=e.chartData.subscribe(c=>{n.peek()||t?.peek()||(i.value=c)});Wt(()=>o()),Ct(()=>s.init());let r=D(!1),a=()=>{n.value=!0},l=()=>{t?.peek()||(n.value=!1,i.value=e.chartData.peek(),s.resetZoom())};return()=>g("div",{className:"flex overflow-hidden"},g("canvas",{ref:s.canvasRef,className:"w-full max-w-full h-80 overflow-hidden",onmouseover:a,onmouseout:l,onmousedown:c=>{s.getZoomLevel()<=1||(c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation())}}),g("div",{onmousedown:c=>c.stopPropagation(),className:"absolute top-1 right-1 flex flex-col gap-1 items-end text-neutral-300"},g("button",{className:"p-1",onclick:()=>r.value=!r.value},g(Pp,{className:"w-4 h-4"})),g(ve,{from:{stats:e.stats,showStatsTooltip:r}},({stats:c,showStatsTooltip:u})=>u&&g("div",{className:"bg-neutral-800 bg-opacity-60 hover:bg-opacity-80 rounded-md p-2 flex flex-col gap-2 cursor-auto"},g("div",{className:"text-xs font-medium"},e.app.name),g("div",{className:"text-xs grid grid-cols-2 gap-x-4 text-neutral-400",style:"grid-template-columns: auto auto;"},g("span",null,"Mount duration:"),g("span",null,c.mountDuration," ms"),g("span",null,"Total updates:"),g("span",null,c.totalTicks),g("span",null,"Avg. update duration:"),g("span",null,c.avgTickDuration," ms"),g("span",null,"Latest update:"),g("span",null,c.lastTickDuration," ms"))))))}var Ap=M(()=>{"use strict";V();Er();Ie();Cp();Dp()});var dc=M(()=>{"use strict";wp();Ap()});var Ar,Rp=M(()=>{"use strict";V();$s();dc();Ar={Apps:{Icon:La,View:uc},FileRouter:{Icon:Fa,View:()=>g("div",null,"FileRouter")},Profiling:{Icon:ls,View:Gs},Settings:{Icon:Va,View:()=>g("div",null,"Settings")}}});function Iv(){return g("button",{ref:Q.rootRef,className:"flex gap-2 cursor-default"},g("nav",{className:"flex flex-col gap-2 justify-between"},g("div",{className:"flex flex-col gap-2"},Object.keys(Ar).map(e=>g(Nv,{key:e,id:e})))),g("main",{className:"flex flex-col flex-1 max-h-[calc(100vh-1rem)] overflow-y-auto p-2 bg-neutral-400/5 rounded"},g(ve,{from:Ov},e=>g(e.View,null))))}function Nv({id:e}){let{Icon:t}=Ar[e];return g("button",{key:e,onclick:()=>Q.devtoolsTab.value=e,className:"flex items-center px-2 py-1 gap-2 rounded border text-xs border-white border-opacity-10"+(Q.devtoolsTab.value===e?" bg-white bg-opacity-5 text-neutral-100":" hover:bg-white hover:bg-opacity-10 text-neutral-400"),title:e},g(t,{className:"text-primary"}),g("span",{className:"hidden sm:inline"},e))}var Ov,Op=M(()=>{"use strict";V();Ie();Rp();Ov=Ot(()=>Ar[Q.devtoolsTab.value])});var Ip={};jr(Ip,{AppsIcon:()=>La,AppsTabView:()=>uc,ChevronRightIcon:()=>en,CloseIcon:()=>za,CogIcon:()=>Va,ComponentIcon:()=>tb,DevtoolsApp:()=>Iv,ExpandIcon:()=>eb,ExternalLinkIcon:()=>as,FlameIcon:()=>Ha,FolderTreeIcon:()=>Fa,GaugeIcon:()=>ls,GripIcon:()=>nb,MouseIcon:()=>cs,OpenIcon:()=>ib,ProfilingTabView:()=>Gs,RadioIcon:()=>Ba,ResizableSplit:()=>ic,ResizeGripIcon:()=>jn,ValueViewer:()=>An,ZapIcon:()=>sb,assert:()=>Qe,buildViewerRoot:()=>un,clamp:()=>tn,collectFromRoot:()=>ke,computeComponentHash:()=>xi,createDraggableController:()=>nn,createElementBoundingTracker:()=>Wa,createLineChart:()=>nc,createMousePositionTracker:()=>us,createResizableController:()=>$n,devtoolsAppRootHasFocus:()=>Jm,devtoolsState:()=>Q,disposeCache:()=>he,emptyCache:()=>Pt,findComponentByHash:()=>Na,getFileLink:()=>rs,getNodeName:()=>Bn,ifDevtoolsAppRootHasFocus:()=>Ia,isDevtoolsApp:()=>ue,kiruGlobal:()=>ht,trapFocus:()=>Zm,typedMapEntries:()=>qm});var si=M(()=>{"use strict";Op();$s();Er();Ie();dc();Wn()});var JM,Ys,Ks,Se,Et,Np,dn,pe,Li=M(()=>{"use strict";V();JM=D(!1),Ys=D(!1),Ks=D(!1),Se=D(!1),Et=D([]),Np=Ot(()=>Et.value.length>0),dn=50,pe=D(null)});var Xs=M(()=>{"use strict"});var Lv,zv,Vp,Vv,Fv,Hv,Fp=M(()=>{"use strict";V();q();si();Xs();Li();Lv="kiru.devtools.debuggerPosition",zv="kiru.devtools.debuggerSize",Vp=()=>{let e=nn({key:Lv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=$n({key:zv,storage:sessionStorage,minSize:[320,180]});Ct(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>g("div",{ref:n,className:ft("fixed rounded-lg p-0.5 flex flex-col gap-2 select-none overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:pe.value==="debugger"?dn+1:dn,minWidth:\`\${320}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>pe.value="debugger"},g("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"auto",scrollbarWidth:"thin",minHeight:0}},g(Vv,null)),g("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},g(jn,{className:"text-neutral-500"})))},Vv=()=>{let e=D([]);return Ct(()=>{let t=ht().devtools.subscribe(n=>{e.value=Array.from(n).map(i=>({...i,link:rs(i.signal)}))});return()=>t()}),g("div",{className:"flex flex-col gap-2 p-2"},g(Je,{each:e,fallback:g("div",{className:"flex flex-col items-center justify-center gap-2 py-8 px-4 text-center text-neutral-400 text-sm"},g("p",{className:"font-medium"},"No signals tracked"),g("p",{className:"text-xs text-neutral-500 max-w-[240px]"},"Use"," ",g("code",{className:"px-1 py-0.5 rounded bg-neutral-800 text-neutral-300 font-mono text-[11px]"},"DevTools.track(signal, label)")," ","in your app to inspect signal values here."))},t=>g(Fv,{key:\`\${t.signal.$id}:\${t.label}\${t.link}\`,entry:t})))},Fv=({entry:e})=>{let t=Q.viewerSettings.peek(),n=s=>s!==null&&typeof s=="object"&&!Array.isArray(s)?s:{value:s},i=D(un(n(e.signal.peek()),e.label,Pt(),t));return Ct(()=>{let s=e.signal.subscribe(o=>{let r=Pt();ke(i.peek(),e.label,r),i.value=un(n(o),e.label,r,t),he(r)});return()=>{s();let o=Pt();ke(i.peek(),e.label,o),he(o)}}),()=>g("div",{className:"rounded border border-neutral-700 text-xs"},g("div",{className:"flex items-center justify-between px-2 py-1 border-b border-neutral-700 font-medium text-neutral-300"},e.label,g(Hv,{link:e.link})),g(ve,{from:i},s=>g(An,{root:s})))},Hv=({link:e})=>e?g("a",{className:"flex items-center gap-1 text-[10px] opacity-50 hover:opacity-100 transition-opacity",href:e,onclick:t=>{t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),window.open(e)},title:"Open in editor"},"Open in editor",g(as,{width:"0.65rem",height:"0.65rem"})):null});var Bv,Wv,Wp,jp=M(()=>{"use strict";V();q();si();Xs();Li();Bv="kiru.devtools.profilerPosition",Wv="kiru.devtools.profilerSize",Wp=()=>{let e=nn({key:Bv,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),t=$n({key:Wv,storage:sessionStorage,minSize:[360,180],aspectRatio:2/1});Ct(()=>(e.init(),t.init(),()=>{e.dispose(),t.dispose()}));let n=s=>{e.containerRef.value=s,e.handleRef.value=s,t.containerRef.value=s},i=s=>{t.handleRef.value=s};return({state:s})=>g("div",{ref:n,className:ft("fixed rounded-lg p-0.5 flex flex-col gap-2 overflow-hidden","bg-neutral-900 opacity-75 hover:opacity-100 shadow-lg"),style:{zIndex:pe.value==="profiler"?dn+1:dn,minWidth:\`\${360}px\`,minHeight:\`\${180}px\`,cursor:t.isResizing.value?"se-resize":e.isDragging.value?"grabbing":"grab"},onclick:()=>pe.value="profiler"},g("div",{style:{transition:"80ms ease-in-out",opacity:s==="entered"?1:0,flex:1,overflow:"hidden",minHeight:0}},g(Gs,{pauseWhen:e.isDragging})),g("div",{ref:i,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},g(jn,{className:"text-neutral-500"})))}});function Rr({style:e,top:t,left:n,width:i,height:s,...o}){return g("div",{style:{...e,position:"absolute",zIndex:50,top:t+"px",left:n+"px",width:i+"px",height:s+"px",background:"linear-gradient(135deg, rgb(164 11 32 / 66%) 0%, rgb(82 14 47 / 80%) 80%)"},...o})}var fc=M(()=>{"use strict";V()});function jv(e){let t=null,n=e;for(;n;){if(typeof n.type=="function"){let i=n,s=rs(i.type);if(s){t={component:i,link:s};break}}n=n.parent}return t?{...t,elements:Up(t.component.child)}:null}function Up(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&Up(n.child,t),n=n.sibling;return t}var $p,Gp=M(()=>{"use strict";V();si();Li();fc();q();$p=()=>{let[e,t]=us();Wt(()=>t());let n=D(null),i=null,s=()=>{let u=Se.value,{x:d,y:f}=e.value;if(!u){n.value=null;return}let p=document.elementsFromPoint(d,f),b=null;for(let T of p){let R=T.__kiruNode;if(R&&(b=jv(R),b))break}if(!b){n.value=null;return}let x=1/0,y=1/0,w=-1/0,_=-1/0;for(let T of b.elements){let{top:R,left:O,width:P,height:N}=T.getBoundingClientRect();x=Math.min(x,O),y=Math.min(y,R),w=Math.max(w,O+P),_=Math.max(_,R+N)}let S=w-x,E=_-y;n.value={name:Bn(b.component),top:y,left:x,width:S,height:E,link:b.link,component:b.component}},o=()=>{i==null&&(i=requestAnimationFrame(()=>{i=null,s()}))};Bt([Se,e],o);let r=u=>{if(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),!Se.value||!n.value)return;let{name:d,link:f,component:p}=n.value;if(!f)return;let b=xi(p);Se.value=!1;let x=Et.value,y=x.findIndex(w=>w.hash===b&&w.link===f);if(y!==-1){let w=x[y],_={...w,pulseGeneration:(w.pulseGeneration??0)+1},S=x.filter(E=>E.id!==w.id);Et.value=[...S,_],pe.value="componentInfo";return}Et.value=[...x,{id:crypto.randomUUID(),name:d,link:f,component:p,unmounted:!1,hash:b,pulseGeneration:0}],pe.value="componentInfo"},a=u=>{ue(u)||o()};ht().on("update",a),window.addEventListener("resize",o),window.addEventListener("scroll",o);let l=new MutationObserver(o);l.observe(document.body,{childList:!0,subtree:!0});let c=new ResizeObserver(o);return c.observe(document.body),Wt(()=>{ht().off("update",a),window.removeEventListener("resize",o),window.removeEventListener("scroll",o),l.disconnect(),c.disconnect()}),({state:u})=>{let d=Se.value,f=n.value;return!d||!f||u==="exited"?null:g(Rr,{top:f.top+window.scrollY,left:f.left+window.scrollX,width:f.width,height:f.height,className:ft("text-white flex items-center justify-center",u==="entered"?"opacity-100":"opacity-90",u==="entered"?"scale-100":"scale-90"),onclick:r},g("span",{className:"font-medium text-sm truncate max-w-full"},\`<\${f.name}>\`))}}});function Xp(e){let t={...e.props};return delete t.children,t}function hc(e){let t=Pt();ke(e,"props",t),he(t)}function qp(e,t=new Set){let n=e;for(;n;)n.dom&&n.dom instanceof Element?t.add(n.dom):n.child&&qp(n.child,t),n=n.sibling;return t}function Yv(e){if(!e.child)return null;let t=qp(e.child);if(t.size===0)return null;let n=1/0,i=1/0,s=-1/0,o=-1/0;for(let l of t){let{top:c,left:u,width:d,height:f}=l.getBoundingClientRect();n=Math.min(n,u),i=Math.min(i,c),s=Math.max(s,u+d),o=Math.max(o,c+f)}let r=s-n,a=o-i;return{top:i,left:n,width:r,height:a}}var $v,Uv,Gv,Kv,Zp,Jp=M(()=>{"use strict";V();q();si();Xs();Li();fc();$v="kiru.devtools.componentInfoPosition",Uv="kiru.devtools.componentInfoSize",Gv=300;Kv=()=>{let e=D(null),t=D(null),n=D(null),i=D(!1),s=D(!1),o=-1;Bt(()=>{let u=n.value;if(!u){let _=e.peek();_&&(hc(_),e.value=null);return}let d=Et.value,f=d.find(_=>_.id===u);if(!f){let _=e.peek();_&&(hc(_),e.value=null);return}if(f.pulseGeneration!==o&&(o=f.pulseGeneration,f.pulseGeneration>0&&(s.value=!0,setTimeout(()=>{o===f.pulseGeneration&&(s.value=!1)},Gv))),!f.unmounted){let _=xi(f.component);t.value=_,f.hash!==_&&(Et.value=d.map(S=>S.id===u?{...S,hash:_}:S))}if(f.unmounted)return;let p=e.peek(),b=Pt();p&&ke(p,"props",b);let x=Q.viewerSettings.peek(),y=Xp(f.component),w=un(y,"props",b,x);e.value=w,he(b)}),Wt(()=>{let u=e.peek();u&&(hc(u),e.value=null)});let r=nn({key:$v,storage:sessionStorage,allowFloat:!0,snapDistance:50,defaultPosition:{type:"floating",x:.5,y:.5},getDraggableBounds:()=>[window.innerWidth,window.innerHeight],getPadding:()=>[10,10]}),a=$n({key:Uv,storage:sessionStorage,minSize:[320,200]});Ct(()=>{r.init(),a.init();let u=d=>{let f=n.value;if(!f)return;let p=Et.value,b=p.find(S=>S.id===f);if(!b||ue(d))return;let x=Rt(b.component);if(x&&x!==d)return;if(b.unmounted){let S=t.value;if(!S)return;let E=Na(d.rootNode,S);if(!E)return;Et.value=p.map(T=>T.id===f?{...T,component:E,unmounted:!1}:T);return}if(Eo(b.component)){Et.value=p.map(S=>S.id===f?{...S,unmounted:!0}:S);return}let y=e.peek();if(!y)return;let w=Q.viewerSettings.peek(),_=Pt();ke(y,"props",_),e.value=un(Xp(b.component),"props",_,w),he(_)};return ht().on("update",u),()=>{r.dispose(),a.dispose(),ht().off("update",u)}});let l=u=>{r.containerRef.value=u,r.handleRef.value=u,a.containerRef.value=u},c=u=>{a.handleRef.value=u};return({panel:u,state:d})=>{n.value||(n.value=u.id);let p=Et.value.find(_=>_.id===u.id);if(!p)return null;let b=()=>{let _=Et.value,S=_.find(E=>E.id===u.id);S&&(Et.value=[..._.filter(E=>E.id!==u.id),S],pe.value="componentInfo")},x=i.value,y=s.value,w=x&&!p.unmounted?Yv(p.component):null;return g(_t,null,w&&g(Rr,{top:w.top+window.scrollY,left:w.left+window.scrollX,width:w.width,height:w.height,className:ft("pointer-events-none",d==="entered"?"opacity-100":"opacity-90")}),g("div",{ref:l,className:"fixed p-0.5 flex flex-col gap-2 select-none z-index-1001",style:{zIndex:pe.value==="componentInfo"?dn+1:dn,minWidth:\`\${320}px\`,minHeight:\`\${200}px\`,opacity:d==="entered"?1:0,cursor:a.isResizing.value?"se-resize":r.isDragging.value?"grabbing":"grab"},onclick:b,onmousedown:b,onmouseenter:()=>i.value=!0,onmouseleave:()=>i.value=!1},g("div",{style:{transition:"80ms ease-in-out",opacity:y?1:.75,flex:1,scrollbarWidth:"thin",minHeight:0,overflow:"hidden",boxShadow:y?"0 0 8px crimson":void 0},className:"rounded-lg bg-neutral-900 opacity-75 hover:opacity-100! shadow-lg"},g("div",{className:"flex flex-col text-sm overflow-auto"},g("div",{className:"flex items-center justify-between gap-2 p-2"},g("a",{href:p.link,className:ft("flex items-center justify-center gap-2","text-neutral-400 hover:text-neutral-200"),onclick:_=>{_.preventDefault(),_.stopPropagation(),window.open(p.link)},onmousedown:_=>_.stopPropagation(),title:"Open in editor"},\`<\${p.name}>\`,g(as,{className:"w-4 h-4 shrink-0 pointer-events-none"})),g("div",{className:"flex items-center gap-2"},p.unmounted&&g("span",{className:"rounded bg-amber-500/20 px-1.5 py-0.5 text-[10px] font-medium text-amber-400"},"Unmounted"),g("button",{type:"button",className:"p-1 text-neutral-400 hover:text-neutral-200",onclick:()=>{Et.value=Et.value.filter(_=>_.id!==u.id)},title:"Close"},g(za,{className:"w-4 h-4 shrink-0 pointer-events-none"})))),g("div",{className:"pt-2 px-4"},g("div",{className:"mb-1.5 font-medium text-neutral-300 text-xs"},"Props"),g(ve,{from:e},_=>_?_.children.length===0?g("div",{className:"text-neutral-500 text-xs italic py-1"},"No props"):g(An,{root:_,className:"text-xs"}):null)))),g("div",{ref:c,style:{position:"absolute",bottom:"4px",right:"4px",width:"16px",height:"16px",cursor:"se-resize",display:"flex",alignItems:"center",justifyContent:"center"}},g(jn,{className:"text-neutral-500"}))))}},Zp=({state:e})=>g(Je,{each:Et},(t,n)=>g(Kv,{key:t.id,panel:t,index:n,state:e}))});var Qp=M(()=>{"use strict";Fp();jp();Gp();Jp()});var sg={};jr(sg,{default:()=>ig});function ig(){let e=nn({storage:localStorage,key:Xv,defaultPosition:{type:"snapped",side:"bottom",percent:.5},getPadding:()=>[10,10],getDraggableBounds:()=>[window.innerWidth,window.innerHeight],onclick:()=>pc.value=!pc.value}),t=Ot(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"column":"row"}),n=Ot(()=>{let i=e.snapSide.value;return i==="left"||i==="right"?"row":"column"});return Ct(()=>{e.init();let i=e.containerRef.value,s=eg.current;setTimeout(()=>{ng.value=!0},50),Bt([pc,e.snapSide,e.containerPos],(o,r,[a,l])=>{let[c,u]=[s.offsetWidth,s.offsetHeight],d=e.handleRef.value,f=d?.offsetWidth??0,p=d?.offsetHeight??0,b=0,x=0;if(r==="top"||r==="bottom"){let R=a+i.offsetWidth/2-c/2;b=tn(R,10,window.innerWidth-10-c)-R}else{let R=l+i.offsetHeight/2-u/2;x=tn(R,10,window.innerHeight-10-u)-R}let y=f/2+8+c/2,w=p/2+8+u/2,_=0,S=0;r==="left"?_=o?y:-y:r==="right"?_=o?-y:y:r==="top"?S=o?w:-w:S=o?-w:w;let E=-c/2+b+_,T=-u/2+x+S;s.style.transform=\`scale(\${o?1:0}) translate(\${E}px, \${T}px)\`})}),()=>g(_t,null,g("div",{ref:e.containerRef,style:{transition:"80ms",opacity:qv,flexDirection:n},className:"z-999999 top-0 left-0 flex items-center justify-center"},g("button",{ref:e.handleRef,className:"rounded-full p-2 z-10 text-white",style:{background:"linear-gradient(135deg, rgb(143 1 1 / 90%) 0%, rgba(119, 14, 103, 0.89) 75%)"}},g(Ha,{className:"w-5 h-5"})),g("div",{ref:eg,style:{transition:"80ms ease-in-out",transformOrigin:"0 0",flexDirection:t},className:ft("absolute left-1/2 top-1/2 z-0 flex p-1 gap-1","bg-neutral-900 rounded-xl shadow-sm")},g(gc,{active:Ys,title:"Toggle Profiler",onclick:()=>Ys.value=!Ys.value},g(ls,{className:"w-4 h-4 pointer-events-none"}),g("small",null,"Profiler")),g(gc,{active:Ks,title:"Toggle Debugger",onclick:()=>Ks.value=!Ks.value},g(Ba,{className:"w-4 h-4 pointer-events-none"}),g("small",null,"Tracking")),g(gc,{active:Se,title:"Select Component",onclick:()=>{Se.value=!Se.value}},g(cs,{className:"w-4 h-4 pointer-events-none"}),g("small",null,"Inspect")))),g(bi,{in:Ys,duration:{in:0,out:150},element:i=>i==="exited"?null:g(Wp,{state:i})}),g(bi,{in:Ks,duration:{in:0,out:150},element:i=>i==="exited"?null:g(Vp,{state:i})}),g(bi,{in:Se,duration:{in:0,out:150},element:i=>i==="exited"?null:g($p,{state:i})}),g(bi,{in:Np,duration:{in:0,out:150},element:i=>i==="exited"?null:g(Zp,{state:i})}))}var Xv,ng,pc,eg,qv,gc,og=M(()=>{"use strict";V();q();si();Li();Xs();Qp();Xv="kiru.devtools.anchorPosition",ng=D(!1),pc=D(!1),eg=xn(null),qv=Ot(()=>ng.value?1:0);gc=()=>{let{derive:e}=Ra(),t=e(({className:i,active:s})=>{let o=!!s?.value;return ft("flex items-center px-1.5 py-0.5 gap-2","text-sm rounded-lg border border-white/10",o?"text-neutral-100":"bg-white/2.5 hover:bg-white/5 text-neutral-400","transition-colors duration-150",Z(i,!0))}),n=e(({active:i})=>!!i?.value?"linear-gradient(135deg, rgb(143 1 1 / 75%) 0%, rgba(119, 14, 103, 0.89) 65%)":"transparent");return({className:i,active:s,...o})=>g("button",{className:t,style:{background:n},...o})}});var Nc=\`/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
5421
5423
  @layer properties;
5422
5424
  @layer theme, base, components, utilities;
5423
5425
  @layer theme {
@@ -5780,6 +5782,9 @@ var dist_default = `var Dg=Object.create;var so=Object.defineProperty;var Ag=Obj
5780
5782
  .transform {
5781
5783
  transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
5782
5784
  }
5785
+ .cursor-auto {
5786
+ cursor: auto;
5787
+ }
5783
5788
  .cursor-col-resize {
5784
5789
  cursor: col-resize;
5785
5790
  }
@@ -5995,9 +6000,6 @@ var dist_default = `var Dg=Object.create;var so=Object.defineProperty;var Ag=Obj
5995
6000
  .text-left {
5996
6001
  text-align: left;
5997
6002
  }
5998
- .text-right {
5999
- text-align: right;
6000
- }
6001
6003
  .font-mono {
6002
6004
  font-family: var(--font-mono);
6003
6005
  }
@@ -6366,7 +6368,7 @@ var dist_default = `var Dg=Object.create;var so=Object.defineProperty;var Ag=Obj
6366
6368
  --tw-outline-style: solid;
6367
6369
  }
6368
6370
  }
6369
- }\`;if("window"in globalThis){async function e(){let t=await Promise.resolve().then(()=>(V(),B)),{default:n}=await Promise.resolve().then(()=>(ng(),eg)),{devtoolsState:i}=await Promise.resolve().then(()=>(ei(),Ap)),s=document.createElement("kiru-devtools");s.setAttribute("style","display: contents"),s.tabIndex=-1,document.body.appendChild(s);let o=s.attachShadow({mode:"open",delegatesFocus:!0}),r=new CSSStyleSheet;r.replaceSync(Ic),o.adoptedStyleSheets=[r],t.mount(t.createElement(n),o,{name:"kiru.devtools"});let a=()=>i.popupWindow.value?.close();window.addEventListener("close",a),window.addEventListener("beforeunload",a)}window.addEventListener("kiru:ready",e,{once:!0})}
6371
+ }\`;if("window"in globalThis){async function e(){let t=await Promise.resolve().then(()=>(V(),j)),{default:n}=await Promise.resolve().then(()=>(og(),sg)),{devtoolsState:i}=await Promise.resolve().then(()=>(si(),Ip)),s=document.createElement("kiru-devtools");s.setAttribute("style","display: contents"),s.tabIndex=-1,document.body.appendChild(s);let o=s.attachShadow({mode:"open",delegatesFocus:!0}),r=new CSSStyleSheet;r.replaceSync(Nc),o.adoptedStyleSheets=[r],t.mount(t.createElement(n),o,{name:"kiru.devtools"});let a=()=>i.popupWindow.value?.close();window.addEventListener("close",a),window.addEventListener("beforeunload",a)}window.addEventListener("kiru:ready",e,{once:!0})}
6370
6372
  /*! Bundled license information:
6371
6373
 
6372
6374
  @kurkle/color/dist/color.esm.js: